{"version":3,"file":"show-M4T3JHX2.js","sources":["../../../app/frontend/entrypoints/controllers/customer/overview/show.ts"],"sourcesContent":["\nimport * as bootstrap from 'bootstrap'\nimport Utils from '../../../utils'\nimport DefaultController from \"../../defaultController\";\nimport CustomerEntity from \"../entity\";\nimport CustomerOverviewShowLocations from \"./show/locations\";\nimport CustomerOverviewShowContacts from \"./show/contacts\";\nimport CustomerOverviewShowTickets from \"./show/tickets\";\n\nexport default class CustomerOverviewShow extends DefaultController {\n async init() {\n this.entity = \"customers\";\n await super.init();\n this.childs = {\n locations: new CustomerOverviewShowLocations(this),\n contacts: new CustomerOverviewShowContacts(this),\n tickets: new CustomerOverviewShowTickets(this)\n }\n }\n\n protected getEntityData(elem: any) {\n return CustomerEntity.getEntityData(elem)\n }\n bindListeners() {\n (document.querySelector(\"#editCustomerForm\") as HTMLFormElement).addEventListener(\"submit\", async (e) => {\n e.preventDefault();\n const elem = document.querySelector(\"#editCustomerForm\") as HTMLFormElement;\n const valid = elem.checkValidity();\n if (valid) {\n const r = await Utils.entity.upsert(this.getEntityData(elem), this.entity)\n if (r.status === 200) {\n await this.getEntity()\n const bsElem = bootstrap.Modal.getInstance((document.querySelector(\"#editCustomer\") as HTMLElement))\n if (bsElem) {\n bsElem.hide();\n }\n this.toastr.success(`${Utils.translate('customer.name')} ${Utils.translate('generic.saved')}`, `${Utils.translate('generic.success')}`)\n }\n }\n });\n }\n}"],"names":["bootstrap.Modal"],"mappings":";;;;;;;;;;;;;;;AASA,MAAqB,6BAA6B,kBAAkB;AAAA,EAChE,MAAM,OAAO;AACT,SAAK,SAAS;AACd,UAAM,MAAM;AACZ,SAAK,SAAS;AAAA,MACV,WAAW,IAAI,8BAA8B,IAAI;AAAA,MACjD,UAAU,IAAI,6BAA6B,IAAI;AAAA,MAC/C,SAAS,IAAI,4BAA4B,IAAI;AAAA,IAAA;AAAA,EAErD;AAAA,EAEU,cAAc,MAAW;AACxB,WAAA,eAAe,cAAc,IAAI;AAAA,EAC5C;AAAA,EACA,gBAAgB;AACX,aAAS,cAAc,mBAAmB,EAAsB,iBAAiB,UAAU,OAAO,MAAM;AACrG,QAAE,eAAe;AACX,YAAA,OAAO,SAAS,cAAc,mBAAmB;AACjD,YAAA,QAAQ,KAAK;AACnB,UAAI,OAAO;AACD,cAAA,IAAI,MAAM,MAAM,OAAO,OAAO,KAAK,cAAc,IAAI,GAAG,KAAK,MAAM;AACrE,YAAA,EAAE,WAAW,KAAK;AAClB,gBAAM,KAAK;AACX,gBAAM,SAASA,MAAgB,YAAa,SAAS,cAAc,eAAe,CAAiB;AACnG,cAAI,QAAQ;AACR,mBAAO,KAAK;AAAA,UAChB;AACA,eAAK,OAAO,QAAQ,GAAG,MAAM,UAAU,eAAe,CAAC,IAAI,MAAM,UAAU,eAAe,CAAC,IAAI,GAAG,MAAM,UAAU,iBAAiB,CAAC,EAAE;AAAA,QAC1I;AAAA,MACJ;AAAA,IAAA,CACH;AAAA,EACL;AACJ;"}