PageSourceSearch

https://assets.productive.io/assets/-embroider-route-entrypoint.js_route_organization.settings-DOjuE3hp.js

js productive.io collected 2026-10-02 04:13:25 UTC 112,607 bytes, 1 lines download raw bytes

1import{r as e}from"./rolldown-runtime-BEU_UCik.js";import{$C as t,AK as n,AM as i,An as o,Az as r,BJ as a,Bn as s,Bz as l,CJ as u,CT as d,CW as p,Ch as m,Cn as c,DW as g,Dn as h,ES as v,EW as y,En as f,FM as b,FW as F,Fz as E,GS as C,Gw as w,Gx as x,HJ as M,Hh as A,IJ as k,IM as T,IW as S,JC as I,LI as D,MJ as P,MM as _,Mz as R,NM as z,Na as W,OJ as N,OW as O,Oz as H,PK as j,QJ as B,SI as L,SJ as U,SW as K,Sn as V,TC as G,Tn as X,Ux as J,VL as q,Vz as Q,WD as Y,Wb as $,Wh as Z,YJ as ee,Yo as te,ZK as ne,_C as ie,_O as oe,aw as re,bG as ae,bI as se,bb as le,cD as ue,cE as de,cT as pe,do as me,eC as ce,fS as ge,gR as he,gz as ve,hR as ye,hy as fe,iy as be,jJ as Fe,jK as Ee,jM as Ce,jW as we,kM as xe,kW as Me,k_ as Ae,kn as ke,kz as Te,mR as Se,nW as Ie,oA as De,oy as Pe,pE as _e,pG as Re,pP as ze,qB as We,qC as Ne,qx as Oe,rY as He,sE as je,sO as Be,tS as Le,uS as Ue,vJ as Ke,wJ as Ve,wW as Ge,wn as Xe,xT as Je,x_ as qe,yE as Qe,yI as Ye,yJ as $e,yU as Ze,yY as et,zJ as tt,zz as nt}from"./common-DdYwb9D_.js";var it,ot,rt=new WeakMap,at=class extends Q{constructor(...e){super(...e),He(this,rt,void Ve(this,"intl"))}get einvoiceFormat(){return this.args.subsidiary.einvoiceFormats[0]}get formatTitle(){return xe(this.intl,this.einvoiceFormat.format)}};U((it=at).prototype,"intl",[M]),a(tt({id:null,block:'[[[11,0],[17,1],[12],[1,"\\n  "],[8,[32,0],null,[["@subsidiary"],[[30,2]]],[["default"],[[[[1,"\\n    "],[10,0],[14,0,"flex justify-between items-center gap-2"],[12],[1,"\\n      "],[10,0],[12],[1,"\\n        "],[8,[32,1],null,[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n          "],[1,[30,0,["formatTitle"]]],[1,"\\n        "]],[]]]]],[1,"\\n        "],[8,[32,2],[[24,0,"block mt-1"]],[["@format"],[[30,0,["einvoiceFormat","format"]]]],null],[1,"\\n      "],[13],[1,"\\n\\n      "],[8,[32,3],null,[["@variant","@tone","@routeParams"],[[52,[30,0,["einvoiceFormat","isEnabled"]],"secondary","primary"],[52,[30,0,["einvoiceFormat","isEnabled"]],"brand","brand"],[28,[32,4],["organization.settings.invoicing.subsidiary-e-invoicing-options",[30,2]],null]]],[["default"],[[[[1,"\\n"],[41,[30,0,["einvoiceFormat","isEnabled"]],[[[1,"          "],[1,[28,[32,5],["shared.ui-actions.edit"],null]],[1,"\\n"]],[]],[[[1,"          "],[1,[28,[32,5],["components.integrations.einvoice.subsidiary-einvoice-settings.setUp"],null]],[1,"\\n"]],[]]],[1,"      "]],[]]]]],[1,"\\n    "],[13],[1,"\\n  "]],[]]]]],[1,"\\n"],[13]],["&attrs","@subsidiary"],["if"]]',moduleName:"(unknown template module)",scope:()=>({SubsidiaryEinvoiceAvailability:ke,Typography:Te,EinvoiceFormatHelp:o,Button:R,routeParams:x,t:l}),isStrictMode:!0}),it);var st=new WeakMap,lt=class extends Q{constructor(...e){super(...e),He(this,st,void Ve(this,"intl")),et(this,"getFormatLabel",e=>{const t=this.intl.consts.einvoiceFormat[e.format];return e.isEnabled?e.canDownloadXml?this.intl.t("components.settings.subsidiary-einvoice-status.formatTitleXml",{format:t}):this.intl.t("components.settings.subsidiary-einvoice-status.formatTitleSend",{format:t}):this.intl.t("components.settings.subsidiary-einvoice-status.formatNotSet",{format:t})})}};U((ot=lt).prototype,"intl",[M]),a(tt({id:null,block:'[[[11,0],[17,1],[12],[1,"\\n"],[41,[28,[32,0],[[30,2,["einvoiceFormats","length"]],0],null],[[[1,"    "],[8,[32,1],null,[["@color"],["disabled"]],[["default"],[[[[1,"\\n      "],[1,[28,[32,2],["components.settings.subsidiary-einvoice-status.unavailable"],null]],[1,"\\n    "]],[]]]]],[1,"\\n"]],[]],[[[41,[28,[32,0],[[30,2,["enabledEinvoiceFormats","length"]],0],null],[[[1,"    "],[10,1],[14,0,"color-icon-neutral-subtle"],[12],[8,[32,3],null,null,null],[13],[1,"\\n    "],[1,[28,[32,2],["components.settings.subsidiary-einvoice-status.notSet"],null]],[1,"\\n"]],[]],[[[42,[28,[31,2],[[28,[31,2],[[30,2,["einvoiceFormats"]]],null]],null],null,[[[41,[30,3,["isEnabled"]],[[[1,"        "],[10,1],[14,0,"color-icon-success"],[12],[8,[32,4],null,null,null],[13],[1,"\\n"]],[]],[[[1,"        "],[10,1],[14,0,"color-icon-neutral-subtle"],[12],[8,[32,3],null,null,null],[13],[1,"\\n"]],[]]],[1,"      "],[1,[28,[30,0,["getFormatLabel"]],[[30,3]],null]],[1,"\\n"]],[3]],null],[1,"  "]],[]]]],[]]],[13]],["&attrs","@subsidiary","einvoiceFormat"],["if","each","-track-array"]]',moduleName:"(unknown template module)",scope:()=>({__keyword__eq:y,Typography:Te,t:l,IconXCircleFill:A,IconCheckCircleFilled:Ae}),isStrictMode:!0}),ot);
1var ut,dt={type:"_type_1f1pq_1",isSelected:"_isSelected_1f1pq_1",divider:"_divider_1f1pq_5",toggleIcon:"_toggleIcon_1f1pq_10",checkboxGrid:"_checkboxGrid_1f1pq_16",reportRow:"_reportRow_1f1pq_23",reportRowActions:"_reportRowActions_1f1pq_32",reportRowInfo:"_reportRowInfo_1f1pq_36",fileTypeIcon:"_fileTypeIcon_1f1pq_49"},pt=new WeakMap,mt=new WeakMap,ct=new WeakMap,gt=new WeakMap,ht=new WeakMap,vt=new WeakMap,yt=new WeakMap,ft=class extends Q{constructor(...e){super(...e),He(this,pt,void Ve(this,"intl")),He(this,mt,void Ve(this,"routing")),He(this,ct,void Ve(this,"externalServices")),He(this,gt,void Ve(this,"flags")),He(this,ht,void Ve(this,"ui")),He(this,vt,void Ve(this,"isEditing")),He(this,yt,void Ve(this,"isAdvancedOptionsExpanded")),et(this,"reports",Le(this,async()=>{const e=await Ze.on(this).forFilterableCollection(ae.TIME_ENTRY_REPORTS).withContext("timesheet-attachments-settings").reports().depaginate().run();return{reports:e,fieldOptions:e.map(e=>e.id),fieldOptionsLabelMap:e.reduce((e,t)=>(e[t.id]=t.name,e),{}),fieldDescriptionsLabelMap:e.reduce((e,t)=>{var n;return e[t.id]=null!==(n=t.description)&&void 0!==n?n:"",e},{})}}))}get isPdfFormat(){return this.args.timesheetAttachmentsForm.invoiceTimesheetExportFormat===q.PDF}get fileThumb(){const e=this.args.timesheetAttachmentsForm.invoiceTimesheetExportFormat;return e===q.XLS?Ee.SHEET:e===q.CSV?Ee.TEXT:Ee.PDF}get reportName(){return this.args.timesheetAttachmentsForm.reportName}get exportTargetUrl(){const e=this.args.timesheetAttachmentsForm;return e.timesheetReport?this.routing.tryGenerateURL(["organization.export.report",[ae.TIME_ENTRY_REPORTS],{filter:ne(JSON.stringify(e.filter)),exportData:ne(JSON.stringify({...e.exportData,extraApiParams:{invoiceId:0}}))}]):null}get downloadHref(){var e;if(this.isPdfFormat)return null;const t=this.exportTargetUrl;if(!t)return null;const n=null===(e=j({}).location)||void 0===e?void 0:e.origin,i=this.externalServices.getUrl("export-pdf");return this.flags.debugExporterPreviewInHtml?t:i+"?url="+ne(`${n}${t}`)}get isAnyAdvancedOptionEnabled(){const e=this.args.timesheetAttachmentsForm;return e.invoiceTimesheetExportDisplayCreatedBy||e.invoiceTimesheetExportDisplayDateCreated||e.invoiceTimesheetExportDisplayTimePeriod||e.invoiceTimesheetExportDisplayDescription||e.invoiceTimesheetExportDisplayOrganizationLogo||e.invoiceTimesheetExportDisplayTotalCount}get isConfigured(){return!!this.args.timesheetAttachmentsForm.invoiceTimesheetExportReportId}get showConfigurePrompt(){return!this.isConfigured&&!this.isEditing}get showSavedState(){return this.isConfigured&&!this.isEditing}get previewAttachment(){var e;if(!this.isPdfFormat)return null;const t=this.exportTargetUrl;if(!t)return null;const n=null===(e=j({}).location)||void 0===e?void 0:e.origin,i=this.externalServices.getUrl("export-pdf"),o=this.flags.debugExporterPreviewInHtml?t:i+"?url="+ne(`${n}${t}`);return new Ye(B(this),{name:this.reportName,tempUrl:o})}toggleEditMode(){this.isEditing=!this.isEditing,this.isEditing||(this.args.timesheetAttachmentsForm.reset(),this.isAdvancedOptionsExpanded=this.isAnyAdvancedOptionEnabled)}setFormat(e){this.args.timesheetAttachmentsForm.invoiceTimesheetExportFormat=e}setOrientation(e){this.args.timesheetAttachmentsForm.invoiceTimesheetExportOrientation=e}setPageSize(e){this.args.timesheetAttachmentsForm.invoiceTimesheetExportPageSize=e}toggleAdvancedOptions(){this.isAdvancedOptionsExpanded=!this.isAdvancedOptionsExpanded}async handleSubmit(){await this.args.submitForm(),this.isEditing=!1}async clearConfiguration(){await this.args.timesheetAttachmentsForm.clearConfiguration(),this.args.timesheetAttachmentsForm.reset(),this.isEditing=!1}openPreview(){const e=this.previewAttachment;e&&this.ui.openAttachmentsGallery([e],e)}};U((ut=ft).prototype,"intl",[M]),U(ut.prototype,"routing",[M]),U(ut.prototype,"externalServices",[M]),U(ut.prototype,"flags",[M]),U(ut.prototype,"ui",[M]),U(ut.prototype,"isEditing",[P],function(){return!1}),U(ut.prototype,"isAdvancedOptionsExpanded",[P],function(){return this.isAnyAdvancedOptionEnabled}),u(ut.prototype,"toggleEditMode",[ee]),u(ut.prototype,"setFormat",[ee]),u(ut.prototype,"setOrientation",[ee]),u(ut.prototype,"setPageSize",[ee]),u(ut.prototype,"toggleAdvancedOptions",[ee]),u(ut.prototype,"handleSubmit",[ee]),u(ut.prototype,"clearConfiguration",[ee]),u(ut.prototype,"openPreview",[ee]),a(tt({id:null,block:'[[[11,0],[17,1],[12],[1,"\\n  "],[8,[32,0],null,[["@trackedFunction"],[[30,0,["reports"]
1]]],[["default"],[[[[1,"\\n    "],[8,[32,1],[[24,0,"mt-2 mb-1.5"]],[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n      "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.timesheetFormat"],null]],[1,"\\n    "]],[]]]]],[1,"\\n\\n    "],[8,[32,1],[[24,0,"mb-4"]],[["@variant","@color"],["body-default-400","neutral-subtle"]],[["default"],[[[[1,"\\n      "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.snapshotNote"],null]],[1,"\\n    "]],[]]]]],[1,"\\n\\n"],[41,[30,0,["showConfigurePrompt"]],[[[1,"      "],[8,[32,3],[[4,[32,4],["click",[30,0,["toggleEditMode"]]],null]],[["@variant"],["secondary"]],[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.configure"],null]],[1,"\\n      "]],[]]]]],[1,"\\n"]],[]],[[[41,[30,0,["showSavedState"]],[[[1,"      "],[10,0],[15,0,[32,5,["reportRow"]]],[12],[1,"\\n        "],[10,0],[15,0,[32,5,["reportRowInfo"]]],[12],[1,"\\n          "],[8,[32,6],[[16,0,[32,5,["fileTypeIcon"]]]],[["@fileType"],[[30,0,["fileThumb"]]]],null],[1,"\\n          "],[8,[32,1],null,[["@variant"],["body-default-400"]],[["default"],[[[[1,[30,0,["reportName"]]]],[]]]]],[1,"\\n        "],[13],[1,"\\n        "],[10,0],[15,0,[32,5,["reportRowActions"]]],[12],[1,"\\n"],[41,[28,[32,7],[[30,0,["flags","timesheetAttachmentPreview"]],[28,[32,8],[[30,0,["previewAttachment"]],[30,0,["downloadHref"]]],null]],null],[[[1,"            "],[8,[32,3],[[16,"target",[52,[30,0,["downloadHref"]],"_blank"]],[16,"rel",[52,[30,0,["downloadHref"]],"noopener noreferrer"]],[4,[32,4],["click",[52,[30,0,["previewAttachment"]],[30,0,["openPreview"]],[32,10]]],null]],[["@icon","@variant","@tone","@size","@href"],[[32,9],"ghost","default","small",[52,[30,0,["downloadHref"]],[30,0,["downloadHref"]]]]],null],[1,"\\n"]],[]],null],[1,"          "],[8,[32,3],[[4,[32,4],["click",[30,0,["toggleEditMode"]]],null]],[["@icon","@variant","@tone","@size"],[[32,11],"ghost","default","small"]],null],[1,"\\n          "],[8,[32,3],[[4,[32,4],["click",[30,0,["clearConfiguration"]]],null]],[["@icon","@variant","@tone","@size"],[[32,12],"ghost","default","small"]],null],[1,"\\n        "],[13],[1,"\\n      "],[13],[1,"\\n"]],[]],[[[1,"      "],[8,[32,13],null,[["@object","@submitForm"],[[30,2],[30,0,["handleSubmit"]]]],[["default"],[[[[1,"\\n        "],[10,0],[15,0,[32,5,["divider"]]],[12],[13],[1,"\\n\\n        "],[8,[32,1],[[24,0,"mb-1.5"]],[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n          "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.selectReport"],null]],[1,"\\n        "]],[]]]]],[1,"\\n\\n        "],[8,[32,1],[[24,0,"mb-4"]],[["@variant","@color"],["body-default-400","neutral-subtle"]],[["default"],[[[[1,"\\n          "],[8,[32,14],null,[["@key"],["components.settings.timesheet-attachments-form.reportDescription"]],[["default"],[[[[1,"\\n            "],[8,[32,15],null,[["@params"],[[28,[32,16],["organization.reports.new"],null]]],[["default"],[[[[1,[30,4,["text"]]]],[]]]]],[1,"\\n          "]],[4]]]]],[1,"\\n        "]],[]]]]],[1,"\\n\\n        "],[8,[30,3,["SelectField"]],null,[["@propertyName","@placeholder","@options","@optionLabelMap","@optionDescriptionMap"],["invoiceTimesheetExportReportId",[28,[32,2],["components.settings.timesheet-attachments-form.reportPlaceholder"],null],[30,0,["reports","value","fieldOptions"]],[30,0,["reports","value","fieldOptionsLabelMap"]],[30,0,["reports","value","fieldDescriptionsLabelMap"]]]],null],[1,"\\n\\n        "],[8,[32,1],[[24,0,"mt-6 mb-4"]],[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n          "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.exportReportView"],null]],[1,"\\n        "]],[]]]]],[1,"\\n\\n        "],[10,0],[14,0,"mt-2 flex justify-between"],[12],[1,"\\n          "],[8,[32,1],[[24,0,"mr-2.5 py-1"]],[["@variant"],["body-default-400"]],[["default"],[[[[1,"\\n            "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.documentFormat"],null]],[1,"\\n          "]],[]]]]],[1,"\\n\\n          "],[10,0],[14,0,"flex gap-4"],[12],[1,"\\n"],[42,[28,[31,2],[[28,[31,2],[[28,[32,17,["values"]],[[32,18]],null]],null]],null],null,[[[1,"              "],[8,[32,3],[[16,0,[29,["button ",[32,5,["type"]]," ",[52,[28,[32,19],[[30,2,["invoiceTimesheetExportFormat"]],[30,5]],null],[32,5,["isSelected"]]]]]],[4,[32,4],["click",[28,[32,20],[[30,0,["setFormat"]],[30,5]],null]],null]],[["@variant","@tone","@size"],["ghost","default","xsmall"]],[["default"],[[[[1,"\\n                "],[1,[28,[32,21],[[30,0,["intl","consts","exportFormat"]],[30,5]],null]],[1,"\\n              "]],[]]]]],[1,"\\n"]],[5]],null],[1,"          "],[13],[1,"\\n        "],[13],[1,"\\n\\n"],[41,[30,0,["isPdfFormat"]],[[[1,"          "],[10,0],[14,0,"mt-2 flex justify-between"],[12],[1,"\\n            "],[8,[32,1],[[24,0,"mr-2.5 py-1"]],[["@variant"],["body-default-400"]],[["default"],[[[[1,"\\n              "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.orientation"],null]],[1,"\\n            "]],[]]]]],[1,"\\n\\n            "],[10,0],[14,0,"flex gap-4"],[12],[1,"\\n"],[42,[28,[31,2],[[28,[31,2],[[28,[32,17,["values"]],[[32,22]],null]],null]],null],null,[[[1,"                "],[8,[32,3],[[16,0,[29,["button ",[32,5,["type"]]," ",[52,[28,[32,19],[[30,2,["invoiceTimesheetExportOrientation"]],[30,6]],null],[32,5,["isSelected"]]]]]],[4,[32,4],["click",[28,[32,20],[[30,0,["setOrientation"]],[30,6]],null]],null]],[["@variant","@tone","@size"],["ghost","default","xsmall"]],[["default"],[[[[1,"\\n                  "],[1,[28,[32,21],[[30,0,["intl","consts","pageOrientation"]],[30,6]],null]],[1,"\\n                "]],[]]]]],[1,"\\n"]],[6]],null],[1,"            "],[13],[1,"\\n          "],[13],[1,"\\n\\n          "],[10,0],[14,0,"mt-2 flex justify-between"],[12],[1,"\\n            "],[8,[32,1],[[24,0,"mr-2.5 py-1"]],[["@variant"],["body-default-400"]],[["default"],[[[[1,"\\n              "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.pageSize"],null]],[1,"\\n            "]],[]]]]],[1,"\\n\\n            "],[10,0],[14,0,"flex gap-4"],[12],[1,"\\n"],[42,[28,[31,2],[[28,[31,2],[[28,[32,17,["values"]],[[32,23]],null]],null]],null],null,[[[1,"                "],[8,[32,3],[[16,0,[29,["button ",[32,5,["type"]]," ",[52,[28,[32,19],[[30,2,["invoiceTimesheetExportPageSize"]],[30,7]],null],[32,5,["isSelected"]]]]]],[4,[32,4],["click",[28,[32,20],[[30,0,["setPageSize"]],[30,7]],null]],null]],[["@variant","@tone","@size"],["ghost","default","xsmall"]],[["default"],[[[[1,"\\n                  "],[1,[28,[32,21],[[30,0,["intl","consts","pageSize"]],[30,7]],null]],[1,"\\n                "]],[]]]]],[1,"\\n"]],[7]],null],[1,"            "],[13],[1,"\\n          "],[13],[1,"\\n\\n          "],[10,0],[15,0,[32,5,["divider"]]],[12],[13],[1,"\\n\\n          "],[10,0],[14,0,"mt-6"],[12],[1,"\\n            "],[11,"button"],[24,0,"flex items-center justify-between w-full"],[16,"aria-expanded",[52,[30,0,["isAdvancedOptionsExpanded"]],"true","false"]],[24,4,"button"],[4,[32,4],["click",[30,0,["toggleAdvancedOptions"]]],null],[12],[1,"\\n              "],[8,[32,1],[[24,0,"flex items-center"]],[["@variant","@color"],["body-default-500","neutral-subtle"]],[["default"],[[[[1,"\\n                "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.advancedOptions"],null]],[1,"\\n                "],[10,1],[14,0,"ml-2"],[12],[1,"\\n                  "],[8,[32,24],null,
1null,null],[1,"\\n                  "],[8,[32,25],null,null,[["default"],[[[[1,"\\n                    "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.advancedOptionsTooltip"],null]],[1,"\\n                  "]],[]]]]],[1,"\\n                "],[13],[1,"\\n              "]],[]]]]],[1,"\\n\\n"],[41,[30,0,["isAdvancedOptionsExpanded"]],[[[1,"                "],[8,[32,26],[[16,0,[32,5,["toggleIcon"]]]],null,null],[1,"\\n"]],[]],[[[1,"                "],[8,[32,27],[[16,0,[32,5,["toggleIcon"]]]],null,null],[1,"\\n"]],[]]],[1,"            "],[13],[1,"\\n\\n            "],[10,0],[15,0,[29,["overflow-hidden ",[52,[30,0,["isAdvancedOptionsExpanded"]],"max-h-96 opacity-100","max-h-0 opacity-0"]]]],[12],[1,"\\n              "],[10,0],[15,0,[32,5,["checkboxGrid"]]],[12],[1,"\\n                "],[8,[30,3,["CheckboxField"]],null,[["@class","@propertyName","@label"],[null,"invoiceTimesheetExportDisplayCreatedBy",[28,[32,2],["components.settings.timesheet-attachments-form.displayCreatedBy"],null]]],null],[1,"\\n                "],[8,[30,3,["CheckboxField"]],null,[["@class","@propertyName","@label"],[null,"invoiceTimesheetExportDisplayDateCreated",[28,[32,2],["components.settings.timesheet-attachments-form.displayDateCreated"],null]]],null],[1,"\\n                "],[8,[30,3,["CheckboxField"]],null,[["@class","@propertyName","@label"],[null,"invoiceTimesheetExportDisplayTimePeriod",[28,[32,2],["components.settings.timesheet-attachments-form.displayTimePeriod"],null]]],null],[1,"\\n                "],[8,[30,3,["CheckboxField"]],null,[["@class","@propertyName","@label"],[null,"invoiceTimesheetExportDisplayDescription",[28,[32,2],["components.settings.timesheet-attachments-form.displayDescription"],null]]],null],[1,"\\n                "],[8,[30,3,["CheckboxField"]],null,[["@class","@propertyName","@label"],[null,"invoiceTimesheetExportDisplayOrganizationLogo",[28,[32,2],["components.settings.timesheet-attachments-form.displayOrganizationLogo"],null]]],null],[1,"\\n                "],[8,[30,3,["CheckboxField"]],null,[["@class","@propertyName","@label"],[null,"invoiceTimesheetExportDisplayTotalCount",[28,[32,2],["components.settings.timesheet-attachments-form.displayTotalCount"],null]]],null],[1,"\\n              "],[13],[1,"\\n            "],[13],[1,"\\n          "],[13],[1,"\\n"]],[]],null],[1,"\\n        "],[8,[30,3,["FormActions"]],null,[["@hasSuccessState","@secondaryAction"],[[30,0,["showSavedState"]],[30,0,["toggleEditMode"]]]],[["default"],[[[[1,"\\n"],[41,[28,[32,7],[[30,0,["flags","timesheetAttachmentPreview"]],[28,[32,8],[[30,0,["previewAttachment"]],[30,0,["downloadHref"]]],null]],null],[[[1,"            "],[8,[32,3],[[24,0,"ml-3"],[16,"target",[52,[30,0,["downloadHref"]],"_blank"]],[16,"rel",[52,[30,0,["downloadHref"]],"noopener noreferrer"]],[4,[32,4],["click",[52,[30,0,["previewAttachment"]],[30,0,["openPreview"]],[32,10]]],null]],[["@variant","@tone","@href"],["outline","default",[52,[30,0,["downloadHref"]],[30,0,["downloadHref"]]]]],[["default"],[[[[1,"\\n              "],[1,[28,[32,2],["components.settings.timesheet-attachments-form.preview"],null]],[1,"\\n            "]],[]]]]],[1,"\\n"]],[]],null],[1,"          "],[8,[30,3,["FormErrors"]],null,null,null],[1,"\\n        "]],[]]]]],[1,"\\n      "]],[3]]]]],[1,"\\n    "]],[]]]],[]]],[1,"  "]],[]]]]],[1,"\\n"],[13]],["&attrs","@timesheetAttachmentsForm","f","slot","format","orientation","pageSize"],["if","each","-track-array"]]',moduleName:"(unknown template module)",scope:()=>({TrackedFunctionState:be,Typography:Te,t:l,Button:R,__keyword__on:k,styles:dt,FileTypeIcon:Ne,__keyword__and:K,__keyword__or:S,IconEye3:t,noop:pe,IconPencil:ce,IconTrash:w,FormFor:Ue,Intl:G,Link:r,__keyword__array:p,Object:Object,ExportFormatExtension:q,__keyword__eq:y,__keyword__fn:g,get:O,PageOrientation:de,PageSize:je,IconInfo:Qe,TooltipOnParent:d,IconCaretUp:le,IconCaretDown:$}),isStrictMode:!0}),ut);var bt,Ft={disabledCard:"_disabledCard_1mggm_1"},Et=new WeakMap,Ct=new WeakMap,wt=class extends Q{constructor(...e){super(...e),He(this,Et,void Ve(this,"session")),He(this,Ct,void Ve(this,"app"))}get subsidiaries(){var e;return null===(e=this.session.organization)||void 0===e?void 0:e.orderedActiveSubsidiaries}get isRoundingMethodUnchanged(){return this.args.organizationForm.invoiceRoundingMethodId===this.args.organizationForm.model.invoiceRoundingMethodId}setRoundingMethod(e){this.args.organizationForm.invoiceRoundingMethodId=e}};U((bt=wt).prototype,"session",[M]),U(bt.prototype,"app",[M]),u(bt.prototype,"setRoundingMethod",[ee]),a(tt({id:null,block:'[[[11,0],[24,0,"settings-invoicing-settings-form"],[17,1],[12],[1,"\\n  "],[8,[32,0],[[16,0,[32,1,["section"]]]],null,[["info","content"],[[[[1,"\\n      "],[8,[30,2,["Title"]],null,null,[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.settings.invoicing-settings-form.paymentTerms"],null]],[1,"\\n      "]],[]]]]],[1,"\\n      "],[8,[30,2,["Description"]],null,null,[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.settings.invoicing-settings-form.paymentTermsDescription"],null]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[2]],[[[1,"\\n      "],[8,[30,3,["Card"]],null,null,[["default"],[[[[1,"\\n          "],[8,[32,3],null,[["@object","@submitForm"],[[30,4],[3
10,5]]],[["default"],[[[[1,"\\n            "],[10,0],[14,0,"flex flex-col gap-6"],[12],[1,"\\n              "],[10,0],[14,0,"flex flex-col gap-1"],[12],[1,"\\n                "],[8,[32,4],null,[["@variant","@as"],["body-default-600","h4"]],[["default"],[[[[1,"\\n                  "],[1,[28,[32,2],["components.settings.invoicing-settings-form.organizationDefaultTerms"],null]],[1,"\\n                "]],[]]]]],[1,"\\n                "],[8,[32,4],null,[["@variant","@color"],["body-small-400","neutral-subtle"]],[["default"],[[[[1,"\\n                  "],[1,[28,[32,2],["components.settings.invoicing-settings-form.organizationDefaultTermsDescription"],null]],[1,"\\n                "]],[]]]]],[1,"\\n              "],[13],[1,"\\n\\n              "],[10,0],[12],[1,"\\n                "],[8,[32,5],null,[["@paymentTermsType","@dueDays","@onChange","@isDisabled","@hasExample"],[[30,4,["paymentTermsType"]],[30,4,["dueDays"]],[30,4,["setPaymentTerms"]],[30,7],true]],null],[1,"\\n\\n"],[41,[30,7],[[[1,"                  "],[8,[32,6],null,null,[["default"],[[[[1,"\\n                    "],[1,[28,[32,2],["components.settings.invoicing-settings-form.turnOnInvoiceForPaymentTerms"],null]],[1,"\\n                  "]],[]]]]],[1,"\\n"]],[]],null],[1,"              "],[13],[1,"\\n            "],[13],[1,"\\n\\n            "],[8,[30,6,["FormActions"]],null,[["@hasSuccessState"],[true]],[["default"],[[[[1,"\\n              "],[8,[30,6,["FormErrors"]],null,null,null],[1,"\\n            "]],[]]]]],[1,"\\n          "]],[6]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[3]]]]],[1,"\\n\\n  "],[8,[32,0],[[16,0,[32,1,["section"]]]],null,[["info","content"],[[[[1,"\\n      "],[8,[30,8,["Title"]],null,null,[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.settings.invoicing-settings-form.roundingMethods"],null]],[1,"\\n      "]],[]]]]],[1,"\\n      "],[8,[30,8,["Description"]],null,null,[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.settings.invoicing-settings-form.roundingMethodsDescription"],null]],[1,"\\n        "],[11,"button"],[24,0,"button--link"],[24,4,"button"],[4,[32,7],["click",[28,[32,8],["12598457"],null]],null],[12],[1,"\\n          "],[1,[28,[32,2],["shared.ui-actions.learnMore"],null]],[1,"\\n        "],[13],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[8]],[[[1,"\\n      "],[8,[30,9,["Card"]],null,null,[["default"],[[[[1,"\\n          "],[8,[32,3],null,[["@object","@submitForm"],[[30,10],[30,11]]],[["default"],[[[[1,"\\n            "],[8,[30,12,["RadioField"]],[[24,0,"items-start"]],[["@propertyName","@value","@onChange"],["invoiceRoundingMethodId",[32,9,["PER_LINE_ITEM"]],[30,0,["setRoundingMethod"]
1]]],[["default"],[[[[1,"\\n              "],[8,[32,4],null,[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n                "],[1,[28,[32,2],["components.settings.invoicing-settings-form.roundingPerLineItem"],null]],[1,"\\n              "]],[]]]]],[1,"\\n\\n              "],[8,[32,4],[[24,0,"mt-1"]],null,[["default"],[[[[1,"\\n                "],[1,[28,[32,2],["components.settings.invoicing-settings-form.roundingPerLineItemDescription"],null]],[1,"\\n              "]],[]]]]],[1,"\\n            "]],[]]]]],[1,"\\n\\n            "],[8,[30,12,["RadioField"]],[[24,0,"mt-6 items-start"]],[["@propertyName","@value","@onChange"],["invoiceRoundingMethodId",[32,9,["PER_SUBTOTAL"]],[30,0,["setRoundingMethod"]]]],[["default"],[[[[1,"\\n              "],[8,[32,4],null,[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n                "],[1,[28,[32,2],["components.settings.invoicing-settings-form.roundingPerSubtotal"],null]],[1,"\\n              "]],[]]]]],[1,"\\n\\n              "],[8,[32,4],[[24,0,"mt-1"]],null,[["default"],[[[[1,"\\n                "],[1,[28,[32,2],["components.settings.invoicing-settings-form.roundingPerSubtotalDescription"],null]],[1,"\\n              "]],[]]]]],[1,"\\n            "]],[]]]]],[1,"\\n\\n"],[41,[28,[32,10],[[30,0,["isRoundingMethodUnchanged"]]],null],[[[1,"              "],[8,[32,11],[[24,0,"mt-6"]],[["@tone"],["warning"]],[["default"],[[[[1,"\\n                "],[8,[30,13,["Content"]],null,null,[["default"],[[[[1,"\\n                  "],[8,[30,13,["Description"]],null,null,[["default"],[[[[1,"\\n                    "],[1,[28,[32,2],["components.settings.invoicing-settings-form.roundingMethodsBanner"],null]],[1,"\\n                  "]],[]]]]],[1,"\\n                "]],[]]]]],[1,"\\n              "]],[13]]]]],[1,"\\n"]],[]],null],[1,"\\n            "],[8,[30,12,["FormActions"]],null,[["@hasSuccessState","@isSubmitDisabled","@submitAction"],[true,[30,0,["isRoundingMethodUnchanged"]],[30,11]]],null],[1,"\\n          "]],[12]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[9]]]]],[1,"\\n\\n  "],[8,[32,0],[[16,0,[32,1,["section"]]]],null,[["info","content"],[[[[1,"\\n      "],[8,[30,14,["Title"]],null,null,[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.settings.invoicing-settings-form.timesheetAttachments"],null]],[1,"\\n      "]],[]]]]],[1,"\\n      "],[8,[30,14,["Description"]],null,null,[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.settings.invoicing-settings-form.timesheetAttachmentsDescription"],null]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[14]],[[[1,"\\n      "],[8,[30,15,["Card"]],null,null,[["default"],[[[[1,"\\n        "],[8,[32,12],null,[["@timesheetAttachmentsForm","@submitForm"],[[30,16],[30,17]]],null],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[15]]]]],[1,"\\n\\n  "],[8,[32,0],[[16,0,[32,1,["section"]]]],null,[["info","content"],[[[[1,"\\n      "],[8,[30,18,["Title"]],null,null,[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.settings.invoicing-settings-form.invoicingOptions"],null]],[1,"\\n      "]],[]]]]],[1,"\\n      "],[8,[30,18,["Description"]],null,null,[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.settings.invoicing-settings-form.invoicingOptionsDescription"],null]],[1,"\\n        "],[11,"button"],[24,0,"button--link"],[24,4,"button"],[4,[32,7],["click",[28,[32,8],["6609219"],null]],null],[12],[1,"\\n          "],[1,[28,[32,2],["shared.ui-actions.learnMore"],null]],[1,"\\n        "],[13],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[18]],[[[1,"\\n      "],[8,[30,19,["Card"]],null,null,[["default"],[[[[1,"\\n"],[41,[30,0,["session","organization","hasMultipleSubsidiaries"]],[[[42,[28,[31,2],[[28,[31,2],[[30,0,["subsidiaries"]]],null]],null],null,[[[1,"              "],[8,[32,13],[[24,0,"js-click-proxy"]],[["@model"],[[30,20]]],[["default"],[[[[1,"\\n"],[41,[30,7],[[[1,"                  "],[10,1],[14,0,"form-for__label"],[12],[1,[30,20,["name"]]],[13],[1,"\\n\\n                  "],[8,[32,6],null,null,[["default"],[[[[1,"\\n                    "],[1,[28,[32,2],["components.settings.invoicing-settings-form.turnOnInvoiceForInvoicingOptions"],null]],[1,"\\n                  "]],[]]]]],[1,"\\n"]],[]],[[[1,"                  "],[10,3],[15,6,[28,[32,14],["organization.settings.invoicing.subsidiary-options",[30,20]],[["debug"],["settings-subsidiary-options"]]]],[14,0,"js-click-proxy-target form-for__label"],[12],[1,"\\n                    "],[1,[30,20,["name"]]],[1,"\\n                  "],[13],[1,"\\n"]],[]]],[1,"\\n                "],[10,0],[12],[1,"\\n                  "],[1,[28,[32,2],["components.settings.invoicing-settings-form.ivoiceAutogeneratedOrManualInput"],[["isInvoiceAutogenerated"],[[52,[30,20,["invoiceNumberFormat"]],true]]]]],[1,"\\n                  •\\n                  "],[1,[28,[32,2],["components.settings.invoicing-settings-form.showsOrDoesntShowDeliveryDate"],[["isDeliveryDateShown"],[[52,[30,20,["showDeliveryDate"]],true]]]]],[1,"\\n                "],[13],[1,"\\n              "]],[]]]]],[1,"\\n"]],[20]],null]],[]],[[[1,"            "],[8,[32,15],null,[["@subsidiaryForm","@submitForm","@isToggleDisabled"],[[30,21],[30,22],[30,7]]],null],[1,"\\n"]],[]]],[1,"      "]],[]]]]],[1,"\\n    "]],[19]]]]],[1,"\\n\\n"],[41,[30,0,["session","organization","isEinvoicingAvailable"]],[[[1,"    "],[8,[32,0],[[16,0,[32,1,["section"]]]],null,[["info","content"],[[[[1,"\\n        "],[8,[30,23,["Title"]],null,null,[["default"],[[[[1,"\\n          "],[1,[28,[32,2],["components.settings.invoicing-settings-form.eInvoicing"],null]],[1,"\\n        "]],[]]]]],[1,"\\n        "],[8,[30,23,["Description"]],null,null,[["default"],[[[[1,"\\n          "],[1,[28,[32,2],["components.settings.invoicing-settings-form.eInvoicingDescription"],null]],[1,"\\n          "],[11,"button"],[24,0,"button--link"],[24,4,"button"],[4,[32,7],["click",[28,[32,8],["10164959"],null]],null],[12],[1,"\\n            "],[1,[28,[32,2],["shared.ui-actions.learnMore"],null]],[1,"\\n          "],[13],[1,"\\n        "]],[]]]]],[1,"\\n      "]],[23]],[[[1,"\\n        "],[8,[30,24,["Card"]],null,null,[["default"],[[[[1,"\\n            "],[10,0],[15,0,[52,[30,0,["app","isSandbox"]],[32,1,["disabledCard"]]]],[15,"inert",[30,0,["app","isSandbox"]]],[12],[1,"\\n"],[41,[30,0,["session","organization","hasMultipleSubsidiaries"]],[[[42,[28,[31,2],[[28,[31,2],[[30,0,["subsidiaries"]]],null]],null],null,[[[1,"                "],[8,[32,13],[[24,0,"js-click-proxy"]],[["@model"],[[30,25]]],[["default"],[[[[1,"\\n"],[41,[30,7],[[[1,"                    "],[10,1],[14,0,"form-for__label"],[12],[1,[30,25,["name"]]],[13],[1,"\\n\\n                    "],[8,[32,6],null,null,[["default"],[[[[1,"\\n                      "],[1,[28,[32,2],["components.settings.invoicing-settings-form.turnOnInvoiceForE
1Invoicing"],null]],[1,"\\n                    "]],[]]]]],[1,"\\n"]],[]],[[[41,[28,[32,16],[[30,25,["einvoiceFormats","length"]],0],null],[[[1,"                    "],[10,3],[15,6,[28,[32,14],["organization.settings.invoicing.subsidiary-e-invoicing-options",[30,25]],[["debug"],["settings-subsidiary-e-invoicingoptions"]]]],[14,0,"js-click-proxy-target form-for__label"],[12],[1,"\\n                      "],[1,[30,25,["name"]]],[1,"\\n                    "],[13],[1,"\\n"]],[]],[[[1,"                    "],[10,1],[14,0,"form-for__label"],[12],[1,[30,25,["name"]]],[13],[1,"\\n                  "]],[]]]],[]]],[1,"\\n                  "],[8,[32,17],null,[["@subsidiary"],[[30,25]]],null],[1,"\\n                "]],[]]]]],[1,"\\n"]],[25]],null]],[]],[[[41,[30,26],[[[41,[30,7],[[[1,"                "],[8,[32,4],null,[["@color"],["disabled"]],[["default"],[[[[1,"\\n                  "],[1,[28,[32,2],["components.settings.invoicing-settings-form.turnOnInvoiceForEInvoicingSingleSubsidiary"],null]],[1,"\\n                "]],[]]]]],[1,"\\n"]],[]],[[[1,"                "],[8,[32,18],null,[["@subsidiary"],[[30,26]]],null],[1,"\\n"]],[]]],[1,"            "]],[]],null]],[]]],[1,"            "],[13],[1,"\\n\\n"],[41,[30,0,["app","isSandbox"]],[[[1,"              "],[8,[32,6],null,null,[["default"],[[[[1,"\\n                "],[1,[28,[32,2],["components.settings.invoicing-settings-form.unavailableInSandbox"],null]],[1,"\\n              "]],[]]]]],[1,"\\n"]],[]],null],[1,"        "]],[]]]]],[1,"\\n      "]],[24]]]]],[1,"\\n"]],[]],null],[1,"\\n"],[13]],["&attrs","Info","Content","@paymentTermsForm","@submitPaymentTermsForm","f","@isInvoicingDisabled","Info","Content","@organizationForm","@submitOrganizationForm","f","B","Info","Content","@timesheetAttachmentsForm","@submitTimesheetAttachmentsForm","Info","Content","subsidiary","@subsidiaryForm","@submitSubsidiaryForm","Info","Content","subsidiary","@defaultSubsidiary"],["if","each","-track-array"]]',moduleName:"(unknown template module)",scope:()=>({Section:W,styles:Ft,t:l,FormFor:Ue,Typography:Te,PaymentTermsField:qe,TooltipOnParent:d,__keyword__on:k,showIntercomArticle:nt,InvoiceRoundingMethod:ze,__keyword__not:F,Banner:H,TimesheetAttachmentsForm:ft,ListItem:h,hrefTo:E,SubsidiaryInvoicingForm:f,__keyword__gt:Me,SubsidiaryEinvoiceStatus:lt,SubsidiaryEinvoiceSettings:at}),isStrictMode:!0}),bt);var xt,Mt=e({default:()=>It}),At=new WeakMap,kt=class extends Q{constructor(...e){super(...e),He(this,At,void Ve(this,"session"))}get isInvoicingEnabled(){return this.session.addons.isInvoicingEnabled}async onChange(e){await this.args.controller.updateInvoicingAddonTask.perform(Ie.INVOICING,e)}};U((xt=kt).prototype,"session",[M]),u(xt.prototype,"onChange",[ee]),a(tt({id:null,block:'[[[1,[28,[32,0],[[28,[32,1],["routes.organization.settings.invoicing.invoicing"],null]],null]],[1,"\\n"],[10,0],[15,0,[29,[[32,2,["page"]]," ",[32,2,["pageFullWidth"]]]]],[12],[1,"\\n  "],[10,0],[15,0,[32,2,["section"]]],[12],[1,"\\n    "],[8,[32,3],[[24,0,"py-2.5"]],[["@as","@variant"],["h1","heading-medium-700"]],[["default"],[[[[1,"\\n      "],[1,[28,[32,1],["templates.organization.settings.invoicing.pageTitle"],null]],[1,"\\n    "]],[]]]]],[1,"\\n    "],[10,0],[15,0,[32,2,["titleWrapper"]]],[12],[1,"\\n      "],[10,0],[15,0,[32,2,["description"]]],[12],[1,"\\n        "],[1,[28,[32,1],["templates.organization.settings.invoicing.pageDescription"],null]],[1,"\\n        "],[11,"button"],[24,0,"button--link"],[24,4,"button"],[4,[32,4],["click",[28,[32,5],["2179631"],null]],null],[12],[1,"\\n          "],[1,[28,[32,1],["shared.ui-actions.learnMore"],null]],[1,"\\n        "],[13],[1,"\\n      "],[13],[1,"\\n\\n      "],[10,0],[12],[1,"\\n        "],[8,[32,6],null,[["@disabled","@value","@onChange"],[[30,1,["updateInvoicingAddonTask","isRunning"]],[30,0,["isInvoicingEnabled"]],[30,0,["onChange"]]]],null],[1,"\\n      "],[13],[1,"\\n\\n    "],[13],[1,"\\n    "],[8,[32,7],null,[["@paymentTermsForm","@submitPaymentTermsForm","@subsidiaryForm","@submitSubsidiaryForm","@defaultSubsidiary","@organizationForm","@submitOrganizationForm","@timesheetAttachmentsForm","@submitTimesheetAttachmentsForm","@isInvoicingDisabled"],[[30,1,["paymentTermsForm"]],[30,1,["route","submitPaymentTermsForm"]],[30,1,["subsidiaryForm"]],[30,1,["route","submitSubsidiaryForm"]],[30,1,["defaultSubsidiary"]],[30,1,["organizationForm"]],[30,1,["route","submitOrganizationForm"]],[30,1,["timesheetAttachmentsForm"]],[30,1,["route","submitTimesheetAttachmentsForm"]],[28,[32,8],[[30,0,["isInvoicingEnabled"]]],null]]],null],[1,"\\n  "],[13],[1,"\\n"],[13],[1,"\\n\\n"],[46,[28,[31,1],null,null],null,null,null]],["@controller"],["component","-outlet"]]',moduleName:"(unknown template module)",scope:()=>({pageTitle:ie,t:l,settingsStyles:te,Typography:Te,__keyword__on:k,showIntercomArticle:nt,Toggle:v,InvoicingSettingsForm:wt,__keyword__not:F}),isStrictMode:!0}),xt);
1var Tt,St,It=re(kt),Dt=new WeakMap,Pt=new WeakMap,_t=class extends Se{constructor(...e){super(...e),He(this,Dt,void Ve(this,"paymentTermsType")),He(this,Pt,void Ve(this,"dueDays"))}get shouldRegisterFormLossPreventer(){return!1}setPaymentTerms(e,t){this.paymentTermsType=e,this.dueDays=t,this.saveError=null}};U((Tt=_t).prototype,"paymentTermsType",[he({})]),U(Tt.prototype,"dueDays",[he({validations:{presence:e=>"due_upon_receipt"!==e.paymentTermsType,numericality:e=>"due_upon_receipt"!==e.paymentTermsType&&{onlyInteger:!0,..."end_of_month"===e.paymentTermsType?{greaterThanOrEqualTo:0}:{greaterThan:0}}}})]),u(Tt.prototype,"setPaymentTerms",[ee]);var Rt=new WeakMap,zt=new WeakMap,Wt=new WeakMap,Nt=new WeakMap,Ot=new WeakMap,Ht=new WeakMap,jt=new WeakMap,Bt=new WeakMap,Lt=new WeakMap,Ut=new WeakMap,Kt=new WeakMap,Vt=new WeakMap,Gt=class extends Se{constructor(...e){super(...e),He(this,Rt,void Ve(this,"store")),He(this,zt,void Ve(this,"ui")),et(this,"allowSaveIfNotDirty",!0),He(this,Wt,void Ve(this,"invoiceTimesheetExportReportId")),He(this,Nt,void Ve(this,"invoiceTimesheetExportOrientation")),He(this,Ot,void Ve(this,"invoiceTimesheetExportPageSize")),He(this,Ht,void Ve(this,"invoiceTimesheetExportFormat")),He(this,jt,void Ve(this,"invoiceTimesheetExportDisplayCreatedBy")),He(this,Bt,void Ve(this,"invoiceTimesheetExportDisplayDateCreated")),He(this,Lt,void Ve(this,"invoiceTimesheetExportDisplayTimePeriod")),He(this,Ut,void Ve(this,"invoiceTimesheetExportDisplayDescription")),He(this,Kt,void Ve(this,"invoiceTimesheetExportDisplayOrganizationLogo")),He(this,Vt,void Ve(this,"invoiceTimesheetExportDisplayTotalCount"))}get shouldRegisterFormLossPreventer(){return!1}get timesheetReport(){const e=this.invoiceTimesheetExportReportId;if(e)return this.store.peekRecord("filter",e)}get filter(){if(this.timesheetReport)return{name:this.timesheetReport.name,default:!1,filterableCollection:ae.TIME_ENTRY_REPORTS,public:!1,columns:this.timesheetReport.columns,columnSettings:this.timesheetReport.columnSettings,groupBy:this.timesheetReport.groupBy,sortBy:this.timesheetReport.sortBy,transposeBy:this.timesheetReport.transposeBy,formulas:this.timesheetReport.formulas,layoutId:this.timesheetReport.layoutId,chartTypeId:this.timesheetReport.chartTypeId,reportLayoutId:this.timesheetReport.reportLayoutId,report:!0}}get reportName(){var e,t,n,i;return null!==(n=null!==(i=null===(e=this.timesheetReport)||void 0===e?void 0:e.name)&&void 0!==i?i:null===(t=this.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.name)&&void 0!==n?n:"Timesheet report"}get exportData(){return{name:this.reportName,format:this.invoiceTimesheetExportFormat,pageSize:this.invoiceTimesheetExportPageSize,orientation:this.invoiceTimesheetExportOrientation,exportAs:"manager",isTimeExport:!1,isTimeEntryReportExport:!0,isCreatedByDisplayed:this.invoiceTimesheetExportDisplayCreatedBy,isDateCreatedDisplayed:this.invoiceTimesheetExportDisplayDateCreated,isTimePeriodDisplayed:this.invoiceTimesheetExportDisplayTimePeriod,isDescriptionDisplayed:this.invoiceTimesheetExportDisplayDescription,isOrganizationLogoDisplayed:this.invoiceTimesheetExportDisplayOrganizationLogo,isTotalCountDisplayed:this.invoiceTimesheetExportDisplayTotalCount}}async clearConfiguration(){this.model.invoiceTimesheetExportConfiguration={};try{await this.model.save(),this.ui.showSaveSuccessFlash()}catch{this.ui.showSaveErrorFlash()}}applyFields(){this.invoiceTimesheetExportReportId&&this.filter&&(this.model.invoiceTimesheetExportConfiguration={reportId:this.invoiceTimesheetExportReportId,filter:this.filter,exportData:this.exportData}),super.applyFields()}};U((St=Gt).prototype,"store",[M]),U(St.prototype,"ui",[M]),U(St.prototype,"invoiceTimesheetExportReportId",[he({getValue:e=>{var t;return null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t?void 0:t.reportId},validations:{presence:!0}})]),U(St.prototype,"invoiceTimesheetExportOrientation",[he({getValue:e=>{var t,n;return null!==(n=null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.orientation)&&void 0!==n?n:de.PORTRAIT}})]),U(St.prototype,"invoiceTimesheetExportPageSize",[he({getValue:e=>{var t,n;return null!==(n=null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.pageSize)&&void 0!==n?n:je.A4}})]),U(St.prototype,"invoiceTimesheetExportFormat",[he({getValue:e=>{var t,n;return null!==(n=null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.format)&&void 0!==n?n:q.PDF}})]),U(St.prototype,"invoiceTimesheetExportDisplayCreatedBy",[he({getValue:e=>{var t;return null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.isCreatedByDisplayed}})]),U(St.prototype,"invoiceTimesheetExportDisplayDateCreated",[he({getValue:e=>{var t;return null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.isDateCreatedDisplayed}})]),U(St.prototype,"invoiceTimesheetExportDisplayTimePeriod",[he({getValue:e=>{var t;return null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.isTimePeriodDisplayed}})]),U(St.prototype,"invoiceTimesheetExportDisplayDescription",[he({getValue:e=>{var t;return null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.isDescriptionDisplayed}})]),U(St.prototype,"invoiceTimesheetExportDisplayOrganizationLogo",[he({getValue:e=>{var t;return null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.isOrganizationLogoDisplayed}})]),U(St.prototype,"invoiceTimesheetExportDisplayTotalCount",[he({getValue:e=>{var t;return null===(t=e.model.invoiceTimesheetExportConfiguration)||void 0===t||null===(t=t.exportData)||void 0===t?void 0:t.isTotalCountDisplayed}})]);var Xt,Jt=e({default:()=>en}),qt=new WeakMap,Qt=new WeakMap,Yt=new WeakMap,$t=new WeakMap,Zt=new WeakMap,en=class extends ue{constructor(...e){super(...e),He(this,qt,void Ve(this,"can")),He(this,Qt,void Ve(this,"formsHandler")),He(this,Yt,void Ve(this,"metrics")),He(this,$t,void Ve(this,"ui")),He(this,Zt,void Ve(this,"intl")),et(this,"updateInvoicingAddonTask",Ke(()=>({context:this,generator:function*(e,t){const n=this.controller.organization;this.metrics.trackAddonToggle(e,t);const i=n.addons||[];n.addons=t?i.concat(e):i.filter(t=>t!==e);try{yield n.save()}catch(o){n.rollbackAttributes(),this.ui.showSaveErrorFlash(this.intl.t("routes.organization.settings.invoicing.errorUpdatingInvoicingSettings"),o)}}}),null,"updateInvoicingAddonTask","drop"))}beforeModel(e){super.beforeModel(e),this.can.app.canManageInvoicingSettings||this.routing.transitionTo("organization.settings")}model(){return this.session.organization}async afterModel(e,t){await super.afterModel(e,t),await Be.on(this).active().includes(e=>e.add("einvoiceConfiguration","einvoiceIdentity","billFrom")).depaginate().withContext("settings-invoicing").run()}setupController(e,t,n){var i;super.setupController(e,t,n);const o=null!==(i=t.defaultSubsidiary)&&void 0!==i?i:this.store.createRecord("subsidiary",{name:t.name});e.route=this,e.organization=t,e.paymentTermsForm=this.formsHandler.createForm(_t,[t]),e.subsidiaryForm=this.formsHandler.createForm(X,[o,{preventFormLoss:!1}]),t.hasMultipleSubsidiaries||(e.defaultSubsidiary=o),e.updateInvoicingAddonTask=this.updateInvoicingAddonTask,e.organizationForm=this.formsHandler.createForm(s,[t]),e.timesheetAttachmentsForm=this.formsHandler.createForm(Gt,[t])}resetController(e,t,n){super.resetController(e,t,n),e.paymentTermsForm&&(e.paymentTermsForm.destroy(),e.set("paymentTermsForm",null)),e.subsidiaryForm&&(e.subsidiaryForm.destroy(),e.set("subsidiaryForm",null)),e.organizationForm&&(e.organizationForm.destroy(),e.set("organizationForm",null)),e.timesheetAttachmentsForm&&(e.timesheetAttachmentsForm.destroy(),e.set("timesheetAttachmentsForm",null))}async submitSubsidiaryForm(){if(this.controller.subsidiaryForm)try{await this.formsHandler.submitForm(this.controller.subsidiaryForm),this.ui.showSaveSuccessFlash()}catch(e){if(this.ui.showSaveErrorFlash(this.intl.t("routes.organization.settings.invoicing.errorUpdatingSubsidiarySettings"),e),e instanceof TypeError)throw e}else this.ui.showSaveErrorFlash()}async submitPaymentTermsForm(){if(this.controller.paymentTermsForm)try{await this.formsHandler.submitForm(this.controller.paymentTermsForm)}catch(e){if(e instanceof ye)return;throw e}}async submitOrganizationForm(){if(this.controller.organizationForm)try{await this.formsHandler.submitForm(this.controller.organizationForm,{showSuccessFlash:!0})}catch(e){Re(e)}else this.ui.showSaveErrorFlash()}async submitTimesheetAttachmentsForm(){this.controller.timesheetAttachmentsForm&&await this.formsHandler.submitForm(this.controller.timesheetAttachmentsForm)}};U((Xt=en).prototype,"can",[M]),U(Xt.prototype,"formsHandler",[M]),U(Xt.prototype,"metrics",[M]),U(Xt.prototype,"ui",[M]),U(Xt.prototype,"intl",[M]),u(Xt.prototype,"submitSubsidiaryForm",[ee]),u(Xt.prototype,"submitPaymentTermsForm",[ee]),u(Xt.prototype,"submitOrganizationForm",[ee]),u(Xt.prototype,"submitTimesheetAttachmentsForm",[ee]);var tn,nn,on=a(tt({id:null,block:'[[[8,[32,0],[[17,1]],[["@object","@submitForm"],[[30,2,["einvoiceConfigurationForm"]],[30,3]]],[["default"],[[[[1,"\\n\\n  "],[8,[32,1],[[24,0,"mb-6"]],[["@einvoiceFormat","@isEdit","@removeConfiguration","@isRemoveDisabled","@subsidiaryName"],[[32,2,["FACE"]],[30,2,["isEdit"]],[30,5],[30,2,["isSomeFormsSubmitting"]],[30,2,["subsidiaryName"]]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"vat",[28,[32,3],["shared.form-fields.taxId"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"address",[28,[32,3],["shared.form-fields.street"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"city",[28,[32,3],["shared.form-fields.city"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"zipcode",[28,[32,3],["components.settings.subsidiary-face-form.zipcode"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label","@class"],[[30,2,["contactEntryForm"]],"state",[28,[32,3],["components.settings.subsidiary-face-form.state"],null],null]],null],[1,"\\n\\n"],[41,[30,2,["submitError"]],[[[1,"    "],[8,[32,4],[[24,0,"mt-4"]],[["@tone"],["danger"]],[["default"],[[[[1,"\\n      "],[8,[30,6,["Content"]],null,null,[["default"],[[[[1,"\\n        "],[8,[30,6,["Description"]],null,null,[["default"],[[[[1,[30,2,["submitError"]]]],[]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[6]]]]],[1,"\\n"]],[]],null],[1,"\\n  "],[8,[32,5],null,[["@formAggregate","@hasSuccessState","@isDisabled","@submitAction","@submitLabel","@secondaryAction","@isReversed"],[[30,2],true,[30,2,["isSomeFormsSubmitting"]],[30,3],[52,[30,2,["isEdit"]],[28,[32,3],["shared.ui-actions.saveChanges"],null],[28,[32,3],["components.settings.subsidiary-face-form.finishSetup"],null]],[30,7],true]],null],[1,"\\n"]],[4]]]]]],["&attrs","@formAggregate","@submitFormAggregate","f","@removeConfiguration","B","@close"],["if"]]',moduleName:"(unknown template module)",scope:()=>({FormFor:Ue,SubsidiaryFormatFormHeader:Xe,EinvoiceFormat:T,t:l,Banner:H,FormActions:ge}),isStrictMode:!0}),n()),rn=a(tt({id:null,block:'[[[8,[32,0],[[17,1]],[["@object","@submitForm"],[[30,2,["einvoiceConfigurationForm"]],[30,3]]],[["default"],[[[[1,"\\n\\n  "],[8,[32,1],[[24,0,"mb-6"]],[["@einvoiceFormat","@isEdit","@isRemoveDisabled","@removeConfiguration","@subsidiaryName"],[[32,2,["KSEF"]],[30,2,["isEdit"]],[30,2,["isSomeFormsSubmitting"]],[30,5],[30,2,["subsidiaryName"]]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"vat",[28,[32,3],["shared.form-fields.taxId"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@options","@optionLabelMap","@isClearButtonEnabled","@isSearchEnabled"],["paymentMeansTypeId",[28,[32,3],["components.settings.subsidiary-ksef-form.paymentMeans"],null],[28,[32,4,["values"]],[[32,5]],null],[28,[32,6],["consts.eInvoicePaymentMeansType"],null],false,false]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"address",[28,[32,3],["shared.form-fields.street"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"city",[28,[32,3],["shared.form-fields.city"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"zipcode",[28,[32,3],["components.settings.subsidiary-ksef-form.zipcode"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label","@class"],[[30,2,["contactEntryForm"]],"state",[28,[32,3],["components.settings.subsidiary-ksef-form.state"],null],null]],null],[1,"\\n\\n"],[41,[30,2,["submitError"]],[[[1,"    "],[8,[32,7],[[24,0,"mt-4"]],[["@tone"],["danger"]],[["default"],[[[[1,"\\n      "],[8,[30,6,["Content"]],null,null,[["default"],[[[[1,"\\n        "],[8,[30,6,["Description"]],null,null,[["default"],[[[[1,[30,2,["submitError"]]]],[]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[6]]]]],[1,"\\n"]],[]],null],[1,"\\n  "],[8,[32,8],null,[["@formAggregate","@hasSuccessState","@isDisabled","@submitAction","@submitLabel","@secondaryAction","@isReversed"],[[30,2],true,[30,2,["isSomeFormsSubmitting"]],[30,3],[52,[30,2,["isEdit"]],[28,[32,3],["shared.ui-actions.saveChanges"],null],[28,[32,3],["components.settings.subsidiary-ksef-form.finishSetup"],null]],[30,7],true]],null],[1,"\\n"]],[4]]]]]],["&attrs","@formAggregate","@submitFormAggregate","f","@removeConfiguration","B","@close"],["if"]]',moduleName:"(unknown template module)",scope:()=>({FormFor:Ue,SubsidiaryFormatFormHeader:Xe,EinvoiceFormat:T,t:l,Object:Object,EInvoicePaymentMeansType:_e,labelFor:J,Banner:H,FormActions:ge}),isStrictMode:!0}),n()),an=new WeakMap,sn=class extends Q{constructor(...e){super(...e),He(this,an,void Ve(this,"mappingArray"))}get croatianTaxOptions(){return We.map(e=>({...e,optionLabel:`${e.name} (${e.value})`}))}updateCroatianTax(e,t){this.mappingArray[e]&&(this.mappingArray=this.mappingArray.map((n,i)=>i!==e?n:{...n,croatianTax:t,exemptionReason:t.exemptable?n.exemptionReason:""}),this.commitMappingChanges())}setExemptionReason(e,t){this.mappingArray[e]&&(this.mappingArray[e].exemptionReason=t)}commitMappingChanges(){const e=this.mappingArray.reduce((e,t)=>
1{var n,i,o,r;return(null===(n=t.subsidiaryTax)||void 0===n?void 0:n.id)&&(e[t.subsidiaryTax.id]={taxCategoryId:null!==(o=null===(i=t.croatianTax)||void 0===i?void 0:i.id)&&void 0!==o?o:"",exemptionReason:null!==(r=t.exemptionReason)&&void 0!==r?r:""}),e},{});this.args.setMapping(e)}};U((tn=sn).prototype,"mappingArray",[P],function(){var e;return(null!==(e=this.args.subsidiary.taxRates)&&void 0!==e?e:[]).map(e=>{var t;const n=this.args.mapping[e.id];return{subsidiaryTax:e,croatianTax:this.croatianTaxOptions.find(e=>e.id===(null==n?void 0:n.taxCategoryId)),exemptionReason:null!==(t=null==n?void 0:n.exemptionReason)&&void 0!==t?t:""}})}),u(tn.prototype,"updateCroatianTax",[ee]),u(tn.prototype,"setExemptionReason",[ee]),u(tn.prototype,"commitMappingChanges",[ee]),a(tt({id:null,block:'[[[11,0],[17,1],[12],[1,"\\n"],[41,[30,2,["taxRates","length"]],[[[1,"    "],[8,[32,0],null,[["@variant"],["light"]],[["colgroup","head","body"],[[[[1,"\\n        "],[10,"col"],[14,0,"w-1/3"],[12],[13],[1,"\\n        "],[10,"col"],[15,0,[32,1,["narrowColumn"]]],[12],[13],[1,"\\n        "],[10,"col"],[14,0,"w-1/3"],[12],[13],[1,"\\n        "],[10,"col"],[14,0,"w-1/3"],[12],[13],[1,"\\n      "]],[]],[[[1,"\\n        "],[8,[30,3,["Row"]],null,null,[["default"],[[[[1,"\\n          "],[8,[30,3,["HeaderCell"]],null,[["@col"],["tax-rate"]],[["default"],[[[[1,"\\n            "],[1,[28,[32,2],["components.integrations.einvoice.croatian-tax-mapping.taxRateProductive"],null]],[1,"\\n          "]],[]]]]],[1,"\\n\\n          "],[8,[30,3,["HeaderCell"]],null,[["@col"],["arrow"]],null],[1,"\\n\\n          "],[8,[30,3,["HeaderCell"]],null,[["@col"],["tax-category"]],[["default"],[[[[1,"\\n            "],[1,[28,[32,2],["components.integrations.einvoice.croatian-tax-mapping.taxRateCroatia"],null]],[1,"\\n          "]],[]]]]],[1,"\\n\\n          "],[8,[30,3,["HeaderCell"]],[[24,0,"flex items-center"]],[["@col"],["exemption-reason"]],[["default"],[[[[1,"\\n            "],[1,[28,[32,2],["components.integrations.einvoice.croatian-tax-mapping.taxRateExemption"],null]],[1,"\\n            "],[10,1],[14,0,"ml-1"],[12],[1,"\\n              "],[8,[32,3],null,null,null],[1,"\\n              "],[8,[32,4],null,null,[["default"],[[[[1,"\\n                "],[1,[28,[32,2],["components.integrations.einvoice.croatian-tax-mapping.taxRateExemptionTooltip"],null]],[1,"\\n              "]],[]]]]],[1,"\\n            "],[13],[1,"\\n          "]],[]]]]],[1,"\\n        "]],[]]]]],[1,"\\n      "]],[3]],[[[1,"\\n"],[42,[28,[31,2],[[28,[31,2],[[30,0,["mappingArray"]]],null]],null],null,[[[41,[30,5,["subsidiaryTax","id"]],[[[1,"            "],[8,[30,4,["Row"]],null,null,[["default"],[[[[1,"\\n              "],[8,[30,4,["Cell"]],null,[["@col"],["tax-rate"]],[["default"],[[[[1,"\\n                  "],[8,[30,7,["Text"]],null,null,[["default"],[[[[1,"\\n                    "],[1,[28,[32,5],[[30,5,["subsidiaryTax"]],"nameWithTotalTaxValue"],null]],[1,"\\n                  "]],[]]]]],[1,"\\n                "]],[7]]]]],[1,"\\n\\n              "],[8,[30,4,["Cell"]],null,[["@col"],["arrow"]],[["default"],[[[[1,"\\n                "],[8,[30,8,["Text"]],null,null,[["default"],[[[[8,[32,6],[[16,0,[32,1,["arrowIcon"]]]],null,null]],[]]]]],[1,"\\n              "]],[8]]]]],[1,"\\n\\n              "],[8,[30,4,["Cell"]],null,[["@col"],["tax-category"]],[["default"],[[[[1,"\\n                  "],[8,[30,9,["Select"]],null,[["@property","@options","@optionLabelPath","@onChange","@placeholder","@popoverClass","@isClearButtonEnabled"],[[30,5,["croatianTax"]],[30,0,["croatianTaxOptions"]],"optionLabel",[28,[32,7],[[30,0,["updateCroatianTax"]],[30,6]],null],[28,[32,2],["components.integrations.einvoice.croatian-tax-mapping.select"],null],[32,1,["wideSelectPopover"]],false]],null],[1,"\\n                "]],[9]]]]],[1,"\\n\\n              "],[8,[30,4,["Cell"]],null,[["@col"],["exemption-reason"]],[["default"],[[[[1,"\\n"],[41,[30,5,["croatianTax","exemptable"]],[[[1,"                    "],[8,[30,10,["Input"]],null,[["@property","@onChange","@onBlur","@placeholder"],[[30,5,["exemptionReason"]],[28,[32,7],[[30,0,["setExemptionReason"]],[30,6]],null],[30,0,["commitMappingChanges"]],[28,[32,2],["components.integrations.einvoice.croatian-tax-mapping.exemptionReasonPlaceholder"],null]]],null],[1,"\\n"]],[]],null],[1,"                "]],[10]]]]],[1,"\\n            "]],[]]]]],[1,"\\n"]],[]],null]],[5,6]],null],[1,"      "]],[4]]]]],[1,"\\n\\n"],[41,[30,11,["length"]],[[[1,"      "],[8,[32,8],[[16,0,[32,1,["errorMessage"]]]],[["@variant"],["caption-default-400"]],[["default"],[[[[1,"\\n        "],[1,[28,[32,5],[[30,11],0],null]],[1,"\\n      "]],[]]]]],[1,"\\n"]],[]],null]],[]],[[[1,"    "],[8,[32,9],[[24,0,"mx-0.5"]],[["@tone"],["warning"]],[["default"],[[[[1,"\\n      "],[8,[30,12,["Content"]],null,null,[["default"],[[[[1,"\\n        "],[8,[30,12,["Description"]],null,null,[["default"],[[[[1,"\\n          "],[8,[32,10],null,[["@key"],["components.integrations.einvoice.croatian-tax-mapping.noTaxRates"]],[["default"],[[[[1,"\\n            "],[8,[30,12,["Link"]],null,[["@params"],[[28,[32,11],["organization.settings.subsidiaries"],null]]],[["default"],[[[[1,"\\n              "],[1,[30,13,["text"]]],[1,"\\n            "]],[]]]]],[1,"\\n          "]],[13]]]]],[1,"\\n        "]],[]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[12]]]]],[1,"\\n"]],[]]],[13]],["&attrs","@subsidiary","H","DG","item","index","Fields","Fields","Fields","Fields","@errors","B","slot"],["if","each","-track-array"]]',moduleName:"(unknown template module)",scope:()=>({DataGrid:Pe,styles:c,t:l,IconInfo:Qe,TooltipOnParent:d,get:O,IconArrowRight:Oe,__keyword__fn:g,Typography:Te,Banner:H,Intl:G,__keyword__array:p}),isStrictMode:!0}),tn);var ln=new WeakMap,un=new WeakMap,dn=class extends Q{constructor(...e){super(...e),He(this,ln,void Ve(this,"store")),He(this,un,void Ve(this,"mappingArray")),et(this,"serviceTypesTrackedFn",Le(this,async()=>{const e=await oe.on(this).loadAllServiceTypes();return{serviceTypes:e,fieldOptions:e.map(e=>e.id),fieldOptionsLabelMap:e.reduce((e,t)=>
1(e[t.id]=t.name,e),{})}})),et(this,"initializeMappingDataTask",Ke(()=>({context:this,generator:function*(){let e=[];const t=Object.values(this.args.mapping).filter(Boolean);t.length&&(e=yield De.on(this).withId(t).withContext("kpd-code-mapping").depaginate().run()),this.mappingArray=Object.keys(this.args.mapping).length?Object.keys(this.args.mapping).map(t=>{var n;return{serviceId:t,kpdCode:null!==(n=e.find(e=>{var n;return e.id===(null===(n=this.args.mapping)||void 0===n?void 0:n[t])}))&&void 0!==n?n:null}}):[{serviceId:null,kpdCode:null}]}}),null,"initializeMappingDataTask","drop"))}get serviceTypesDisabledMap(){var e;return null===(e=this.serviceTypesTrackedFn.value)||void 0===e?void 0:e.serviceTypes.reduce((e,t)=>(e[t.id]=this.isServiceTypeMapped(t.id),e),{})}isServiceTypeMapped(e){return Boolean(e)&&this.mappingArray.some(t=>t.serviceId===e)}kpdCodeQuery(){return De.on(this).isKPD(!0)}setServiceId(e,t){this.mappingArray[e]&&(this.mappingArray=this.mappingArray.map((n,i)=>i===e?{...n,serviceId:t}:n)),this.commitMappingsChange()}setKPDCode(e,t){this.mappingArray[e]&&(this.mappingArray=this.mappingArray.map((n,i)=>i===e?{...n,kpdCode:t}:n)),this.commitMappingsChange()}
1deleteMapping(e){this.mappingArray=this.mappingArray.filter((t,n)=>n!==e),this.commitMappingsChange()}addNewMapping(){this.mappingArray=[...this.mappingArray,{serviceId:null,kpdCode:null}],this.commitMappingsChange()}commitMappingsChange(){const e=(this.mappingArray||[]).reduce((e,t)=>{var n,i;return t.serviceId&&(e[t.serviceId]=null!==(i=null===(n=t.kpdCode)||void 0===n?void 0:n.id)&&void 0!==i?i:null),e},{});this.args.setMapping(e)}};U((nn=dn).prototype,"store",[M]),U(nn.prototype,"mappingArray",[P],function(){return[]}),u(nn.prototype,"kpdCodeQuery",[ee]),u(nn.prototype,"setServiceId",[ee]),u(nn.prototype,"setKPDCode",[ee]),u(nn.prototype,"deleteMapping",[ee]),u(nn.prototype,"addNewMapping",[ee]),u(nn.prototype,"commitMappingsChange",[ee]),a(tt({id:null,block:'[[[11,0],[17,1],[12],[1,"\\n  "],[8,[32,0],null,[["@trackedFunction","@errorTitle","@loaderVariant"],[[30,0,["serviceTypesTrackedFn"]],[28,[32,1],["components.integrations.einvoice.kpd-code-mapping.serviceTypeLoadingError"],null],"skeleton"]],[["default"],[[[[1,"\\n"],[41,[30,0,["serviceTypesTrackedFn","value","serviceTypes","length"]],[[[1,"      "],[8,[32,2],null,[["@task","@errorTitle","@loaderVariant"],[[30,0,["initializeMappingDataTask"]],[28,[32,1],["components.integrations.einvoice.kpd-code-mapping.kpdCodeLoadingError"],null],"skeleton"]],[["default"],[[[[1,"\\n        "],[8,[32,3],null,[["@variant"],["light"]],[["colgroup","head","body"],[[[[1,"\\n            "],[10,"col"],[14,0,"w-1/3"],[12],[13],[1,"\\n            "],[10,"col"],[15,0,[32,4,["narrowColumn"]]],[12],[13],[1,"\\n            "],[10,"col"],[14,0,"w-2/3"],[12],[13],[1,"\\n            "],[10,"col"],[15,0,[32,4,["narrowColumn"]]],[12],[13],[1,"\\n          "]],[]],[[[1,"\\n            "],[8,[30,2,["Row"]],null,null,[["default"],[[[[1,"\\n              "],[8,[30,2,["HeaderCell"]],null,[["@col"],["service-type"]],[["default"],[[[[1,"\\n                "],[1,[28,[32,1],["components.integrations.einvoice.kpd-code-mapping.serviceType"],null]],[1,"\\n              "]],[]]]]],[1,"\\n\\n              "],[8,[30,2,["HeaderCell"]],null,[["@col"],["arrow"]],null],[1,"\\n\\n              "],[8,[30,2,["HeaderCell"]],null,[["@col"],["kpd-code"]],[["default"],[[[[1,"\\n                "],[1,[28,[32,1],["components.integrations.einvoice.kpd-code-mapping.kpd"],null]],[1,"\\n              "]],[]]]]],[1,"\\n\\n              "],[8,[30,2,["HeaderCell"]],[[16,"aria-label",[28,[32,1],["components.integrations.einvoice.kpd-code-mapping.deleteServiceKpdMapping"],null]]],[["@col"],["delete"]],null],[1,"\\n            "]],[]]]]],[1,"\\n          "]],[2]],[[[1,"\\n"],[42,[28,[31,2],[[28,[31,2],[[30,0,["mappingArray"]]],null]],null],null,[[[1,"              "],[8,[30,3,["Row"]],null,null,[["default"],[[[[1,"\\n                "],[8,[30,3,["Cell"]],null,[["@col"],["service-type"]],[["default"],[[[[1,"\\n                    "],[8,[30,6,["Select"]],null,[["@property","@options","@optionLabelMap","@optionDisabledMap","@onChange","@placeholder","@popoverClass"],[[30,4,["serviceId"]],[30,0,["serviceTypesTrackedFn","value","fieldOptions"]],[30,0,["serviceTypesTrackedFn","value","fieldOptionsLabelMap"]],[30,0,["serviceTypesDisabledMap"]],[28,[32,5],[[30,0,["setServiceId"]],[30,5]],null],[28,[32,1],["components.integrations.einvoice.kpd-code-mapping.select"],null],[32,4,["wideSelectPopover"]]]],null],[1,"\\n                  "]],[6]]]]],[1,"\\n\\n                "],[8,[30,3,["Cell"]],null,[["@col"],["arrow"]],[["default"],[[[[1,"\\n                  "],[8,[30,7,["Text"]],null,null,[["default"],[[[[8,[32,6],[[16,0,[32,4,["arrowIcon"]]]],null,null]],[]]]]],[1,"\\n                "]],[7]]]]],[1,"\\n\\n                "],[8,[30,3,["Cell"]],null,[["@col"],["kpd-code"]],[["default"],[[[[1,"\\n                    "],[8,[30,8,["Select"]],null,[["@property","@buildQuery","@selectFieldItemComponent","@onChange","@placeholder","@popoverClass"],[[30,4,["kpdCode"]],[30,0,["kpdCodeQuery"]],[32,7],[28,[32,5],[[30,0,["setKPDCode"]],[30,5]],null],[28,[32,1],["components.integrations.einvoice.kpd-code-mapping.select"],null],[32,4,["wideSelectPopover"]]]],null],[1,"\\n                  "]],[8]]]]],[1,"\\n\\n                "],[8,[30,3,["Cell"]],null,[["@col"],["delete"]],[["default"],[[[[1,"\\n                  "],[8,[30,3,["Components","Action"]],[[4,[32,9],["click",[28,[32,5],[[30,0,["deleteMapping"]],[30,5]],null]],null]],[["@icon"],[[32,8]]],null],[1,"\\n                "]],[]]]]],[1,"\\n              "]],[]]]]],[1,"\\n"]],[4,5]],null],[1,"          "]],[3]]]]],[1,"\\n\\n"],[41,[30,9,["length"]],[[[1,"          "],[8,[32,10],[[16,0,[32,4,["errorMessage"]]]],[["@variant"],["caption-default-400"]],[["default"],[[[[1,"\\n            "],[1,[28,[32,11],[[30,9],0],null]],[1,"\\n          "]],[]]]]],[1,"\\n"]],[]],null],[1,"\\n        "],[8,[32,12],[[24,0,"mt-2"],[4,[32,9],["click",[30,0,["addNe
1wMapping"]]],null]],[["@variant","@tone","@icon"],["ghost","default",[32,13]]],[["default"],[[[[1,"\\n          "],[1,[28,[32,1],["components.integrations.einvoice.kpd-code-mapping.addRow"],null]],[1,"\\n        "]],[]]]]],[1,"\\n      "]],[]]]]],[1,"\\n"]],[]],[[[1,"      "],[8,[32,14],[[24,0,"mx-0.5"]],[["@tone"],["warning"]],[["default"],[[[[1,"\\n        "],[8,[30,10,["Content"]],null,null,[["default"],[[[[1,"\\n          "],[8,[30,10,["Description"]],null,null,[["default"],[[[[1,"\\n            "],[8,[32,15],null,[["@key"],["components.integrations.einvoice.kpd-code-mapping.noServiceTypes"]],[["default"],[[[[1,"\\n              "],[8,[30,10,["Link"]],null,[["@params"],[[28,[32,16],["organization.settings.service-types"],null]]],[["default"],[[[[1,"\\n                "],[1,[30,11,["text"]]],[1,"\\n              "]],[]]]]],[1,"\\n            "]],[11]]]]],[1,"\\n          "]],[]]]]],[1,"\\n        "]],[]]]]],[1,"\\n      "]],[10]]]]],[1,"\\n"]],[]]],[1,"  "]],[]]]]],[1,"\\n"],[13]],["&attrs","H","DG","item","index","Fields","Fields","Fields","@errors","B","slot"],["if","each","-track-array"]]',moduleName:"(unknown template module)",scope:()=>({TrackedFunctionState:be,t:l,ConcurrencyTaskState:fe,DataGrid:Pe,styles:c,__keyword__fn:g,IconArrowRight:Oe,KPDCodeSelectFieldItem:me,IconTrash:w,__keyword__on:k,Typography:Te,get:O,Button:R,IconPlus:C,Banner:H,Intl:G,__keyword__array:p}),isStrictMode:!0}),nn);var pn,mn={shorterField:"_shorterField_ikykc_1",providerIcon:"_providerIcon_ikykc_6",radioSelect:"_radioSelect_ikykc_11"},cn=new WeakMap,gn=class extends Q{constructor(...e){super(...e),He(this,cn,void Ve(this,"intl"))}get eInvoicePaymentMeansTypeOptions(){return Object.values(_e)}get showPasswordField(){return this.args.formAggregate.isEditingPassword||!this.args.formAggregate.isEdit}get taxRateMapping(){var e;return null!==(e=this.args.formAggregate.einvoiceConfigurationForm.taxRateMapping)&&void 0!==e?e:{}}get kpdCodeMapping(){var e;return null!==(e=this.args.formAggregate.einvoiceConfigurationForm.kpdCodeMapping)&&void 0!==e?e:{}}setTaxRateMapping(e){this.args.formAggregate.einvoiceConfigurationForm.taxRateMapping=e}setKpdCodeMapping(e){this.args.formAggregate.einvoiceConfigurationForm.kpdCodeMapping=e}togglePasswordEdit(){this.args.formAggregate.isEditingPassword&&this.args.formAggregate.einvoiceConfigurationForm.resetField("merPassword"),this.args.formAggregate.isEditingPassword=!this.args.formAggregate.isEditingPassword}};U((pn=gn).prototype,"intl",[M]),u(pn.prototype,"setTaxRateMapping",[ee]),u(pn.prototype,"setKpdCodeMapping",[ee]),u(pn.prototype,"togglePasswordEdit",[ee]),a(tt({id:null,block:'[[[8,[32,0],[[17,1]],[["@object","@submitForm"],[[30,2,["einvoiceConfigurationForm"]],[30,3]]],[["default"],[[[[1,"\\n\\n  "],[8,[32,1],[[24,0,"mb-6"]],[["@einvoiceFormat","@isEdit","@removeConfiguration","@isRemoveDisabled","@subsidiaryName"],[[32,2,["HR_CIUS"]],[30,2,["isEdit"]],[30,5],[30,2,["isSomeFormsSubmitting"]],[30,2,["subsidiaryName"]]]],[["default"],[[[[1,"\\n    "],[10,0],[14,0,"flex items-center gap-2 mb-2"],[12],[1,"\\n      "],[8,[32,3],[[16,0,[32,4,["providerIcon"]]]],null,null],[1,"\\n\\n      "],[10,0],[12],[1,"\\n        "],[8,[32,5],null,[["@variant","@color"],["caption-default-400","neutral-subtle"]],[["default"],[[[[1,"\\n          "],[1,[28,[32,6],["components.settings.subsidiary-mer-form.provider"],null]],[1,"\\n        "]],[]]]]],[1,"\\n\\n        "],[10,0],[14,0,"flex gap-2"],[12],[1,"\\n          "],[8,[32,5],null,[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n            "],[1,[28,[32,7],[[30,0,["intl","consts","einvoiceFormat"]],[32,2,["HR_CIUS"]]],null]],[1,"\\n          "]],[]]]]],[1,"\\n          "],[8,[32,8],null,[["@format"],[[32,2,["HR_CIUS"]]]],null],[1,"\\n        "],[13],[1,"\\n      "],[13],[1,"\\n    "],[13],[1,"\\n  "]],[]]]]],[1,"\\n\\n  "],[8,[32,5],[[24,0,"mb-2"]],[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n    "],[1,[28,[32,6],["components.settings.subsidiary-mer-form.subsidiaryInfo"],null]],[1,"\\n  "]],[]]]]],[1,"\\n\\n  "],[8,[30,4,["InputField"]],[[16,0,[32,4,["shorterField"]]]],[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"vat",[28,[32,6],["shared.form-fields.taxId"],null]]],null],[1,"\\n\\n  "],[8,[32,5],[[24,0,"pt-3 mb-2"]],[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n    "],[1,[28,[32,6],["components.settings.subsidiary-mer-form.einvoicingInfo"],null]],[1,"\\n  "]],[]]]]],[1,"\\n\\n  "],[8,[30,4,["InputField"]],[[16,0,[32,4,["shorterField"]]]],[["@propertyName","@label"],["merUsername",[28,[32,6],["components.settings.subsidiary-mer-form.merUsername"],null]]],null],[1,"\\n\\n  "],[10,0],[14,0,"flex-1 flex items-start gap-2"],[12],[1,"\\n"],[41,[30,0,["showPasswordField"]],[[[1,"      "],[8,[30,4,["InputField"]],[[16,0,[32,4,["shorterField"]]]],[["@propertyName","@label","@type","@autocomplete"],["merPassword",[28,[32,6],["components.settings.subsidiary-mer-form.merPassword"],null],"password","new-password"]],null],[1,"\\n\\n"],[41,[30,2,["isEditingPassword"]],[[[1,"        "],[8,[32,9],[[24,0,"mt-6"],[24,4,"button"],[4,[32,11],["click",[30,0,["togglePasswordEdit"]]],null]],[["@variant","@tone","@size","@prefixIcon"],["ghost","default","small",[32,10]]],[["default"],[[[[1,"\\n          "],[1,[28,[32,6],["components.settings.subsidiary-mer-form.revert"],null]],[1,"\\n        "]],[]]]]],[1,"\\n"]],[]],null]],[]],[[[1,"      "],[8,[30,4,["InputField"]],[[16,0,[32,4,["shorterField"]]]],[["@property","@label","@isDisabled","@type","@autocomplete"],["**********",[28,[32,6],["components.settings.subsidiary-mer-form.merPassword"],null],true,"password","new-password"]],null],[1,"\\n\\n      "],[8,[32,9],[[24,0,"mt-6"],[24,4,"button"],[4,[32,11],["click",[30,0,["togglePasswordEdit"]]],null]],[["@variant","@tone","@size"],["ghost","default","small"]],[["default"],[[[[1,"\\n        "],[1,[28,[32,6],["components.settings.subsidiary-mer-form.updatePassword"],null]],[1,"\\n      "]],[]]]]],[1,"\\n"]],[]]],[1,"  "],[13],[1,"\\n\\n  "],[8,[30,4,["SelectField"]],[[16,0,[32,4,["shorterField"]]]],[["@propertyName","@label","@options","@optionLabelMap","@isClearButtonEnabled","@isSearchEnabled"],["paymentMeansTypeId",[28,[32,6],["components.settings.subsidiary-mer-form.paymentMeans"],null],[30,0,["eInvoicePaymentMeansTypeOptions"]],[28,[32,12],["consts.eInvoicePaymentMeansType"],null],false,false]],null],[1,"\\n\\n  "],[8,[32,5],[[24,0,"pt-3 mb-2"]],[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n    "],[1,[28,[32,6],["components.settings.subsidiary-mer-form.taxRateMapping"],null]],[1,"\\n  "]],[]]]]],[1,"\\n\\n  "],[8,[32,13],null,[["@subsidiary","@mapping","@setMapping","@errors"],[[30,6],[30,0,["taxRateMapping"]],[30,0,["setTaxRateMapping"]],[30,2,["einvoiceConfigurationForm","errors","taxRateMapping"]]]],null],[1,"\\n\\n  "],[10,0],[14,0,"mt-8 flex items-center gap-2"],[12],[1,"\\n    "],[8,[32,5],null,[["@variant"],["body-default-600"]],[["default"],[[[[1,"\\n      "],[1,[28,[32,6],["components.settings.subsidiary-mer-form.serviceMapping"],null]],[1,"\\n    "]],[]]]]],[1,"\\n    "],[8,[32,14],null,[["@theme"],["electric"]],[["default"],[[[[1,"\\n      "],[1,[28,[32,6],["components.settings.subsidiary-mer-form.recommended"],null]],[1,"\\n    "]],[]]]]],[1,"\\n  "],[13],[1,"\\n\\n  "],[8,[32,5],[[24,0,"mb-2"]],[["@variant","@color"],["body-small-400","
1neutral-subtle"]],[["default"],[[[[1,"\\n    "],[1,[28,[32,6],["components.settings.subsidiary-mer-form.serviceMappingInfo"],null]],[1,"\\n  "]],[]]]]],[1,"\\n\\n  "],[8,[32,15],null,[["@mapping","@setMapping","@errors"],[[30,0,["kpdCodeMapping"]],[30,0,["setKpdCodeMapping"]],[30,2,["einvoiceConfigurationForm","errors","kpdCodeMapping"]]]],null],[1,"\\n\\n  "],[8,[30,4,["RadioFieldSelect"]],[[16,0,[29,["mt-8 ",[32,4,["radioSelect"]]]]]],[["@propertyName","@label","@isStacked","@options"],["includePdfAttachment",[28,[32,6],["components.settings.subsidiary-mer-form.includePdfAttachment"],null],true,[28,[32,16],[[28,[32,17],null,[["value","label"],[true,"Productive PDF"]]],[28,[32,17],null,[["value","label"],[false,"mer PDF"]]]],null]]],null],[1,"\\n\\n"],[41,[30,2,["submitError"]],[[[1,"    "],[8,[32,18],[[24,0,"mt-4"]],[["@tone"],["danger"]],[["default"],[[[[1,"\\n      "],[8,[30,7,["Content"]],null,null,[["default"],[[[[1,"\\n        "],[8,[30,7,["Description"]],null,null,[["default"],[[[[1,[30,2,["submitError"]]]],[]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[7]]]]],[1,"\\n"]],[]],null],[1,"\\n  "],[8,[32,19],null,[["@formAggregate","@hasSuccessState","@isDisabled","@submitAction","@submitLabel","@secondaryAction","@isReversed"],[[30,2],true,[30,2,["isSomeFormsSubmitting"]],[30,3],[52,[30,2,["isEdit"]],[28,[32,6],["shared.ui-actions.saveChanges"],null],[28,[32,6],["components.settings.subsidiary-mer-form.finishSetup"],null]],[30,8],true]],null],[1,"\\n"]],[4]]]]]],["&attrs","@formAggregate","@submitFormAggregate","f","@removeConfiguration","@subsidiary","B","@close"],["if"]]',moduleName:"(unknown template module)",scope:()=>({FormFor:Ue,SubsidiaryFormatFormHeader:Xe,EinvoiceFormat:T,IconSquaresThree:m,styles:mn,Typography:Te,t:l,get:O,EinvoiceFormatHelp:o,Button:R,IconArrowCounterClockwise:Z,__keyword__on:k,labelFor:J,CroatianTaxMapping:sn,Tag:Je,KpdCodeMapping:dn,__keyword__array:p,__keyword__hash:we,Banner:H,FormActions:ge}),isStrictMode:!0}),pn);var hn,vn,yn=a(tt({id:null,block:'[[[8,[32,0],[[17,1]],[["@object","@submitForm"],[[30,2,["einvoiceConfigurationForm"]],[30,3]]],[["default"],[[[[1,"\\n\\n  "],[8,[32,1],[[24,0,"mb-6"]],[["@einvoiceFormat","@isEdit","@removeConfiguration","@isRemoveDisabled","@subsidiaryName"],[[32,2,["PEPPOL"]],[30,2,["isEdit"]],[30,5],[30,2,["isSomeFormsSubmitting"]],[30,2,["subsidiaryName"]]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"vat",[28,[32,3],["shared.form-fields.taxId"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@options","@optionLabelMap","@isClearButtonEnabled","@isSearchEnabled"],["paymentMeansTypeId",[28,[32,3],["components.settings.subsidiary-peppol-form.paymentMeans"],null],[28,[32,4,["values"]],[[32,5]],null],[28,[32,6],["consts.eInvoicePaymentMeansType"],null],false,false]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["einvoiceIdentityForm"]],"peppolId",[28,[32,3],["components.settings.subsidiary-peppol-form.peppolId"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["CheckboxField"]],null,[["@propertyName","@label"],["includePdfAttachment",[28,[32,3],["components.settings.subsidiary-peppol-form.includePdfAttachment"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["CheckboxField"]],null,[["@propertyName","@label","@labelTooltip"],["useInvoicePeriod",[28,[32,3],["components.settings.subsidiary-peppol-form.useInvoicePeriod"],null],[28,[32,3],["components.settings.subsidiary-peppol-form.useInvoicePeriodTooltip"],null]]],null],[1,"\\n\\n"],[41,[30,2,["submitError"]],[[[1,"    "],[8,[32,7],[[24,0,"mt-4"]],[["@tone"],["danger"]],[["default"],[[[[1,"\\n      "],[8,[30,6,["Content"]],null,null,[["default"],[[[[1,"\\n        "],[8,[30,6,["Description"]],null,null,[["default"],[[[[1,[30,2,["submitError"]]]],[]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[6]]]]],[1,"\\n"]],[]],null],[1,"\\n  "],[8,[32,8],null,[["@formAggregate","@hasSuccessState","@isDisabled","@submitAction","@submitLabel","@secondaryAction","@isReversed"],[[30,2],true,[30,2,["isSomeFormsSubmitting"]],[30,3],[52,[30,2,["isEdit"]],[28,[32,3],["shared.ui-actions.saveChanges"],null],[28,[32,3],["components.settings.subsidiary-peppol-form.finishSetup"],null]],[30,7],true]],null],[1,"\\n"]],[4]]]]]],["&attrs","@formAggregate","@submitFormAggregate","f","@removeConfiguration","B","@close"],["if"]]',moduleName:"(unknown template module)",scope:()=>({FormFor:Ue,SubsidiaryFormatFormHeader:Xe,EinvoiceFormat:T,t:l,Object:Object,EInvoicePaymentMeansType:_e,labelFor:J,Banner:H,FormActions:ge}),isStrictMode:!0}),n()),fn=a(tt({id:null,block:'[[[8,[32,0],[[17,1]],[["@object","@submitForm"],[[30,2,["einvoiceConfigurationForm"]],[30,3]]],[["default"],[[[[1,"\\n\\n  "],[8,[32,1],[[24,0,"mb-6"]],[["@einvoiceFormat","@isEdit","@isRemoveDisabled","@removeConfiguration","@subsidiaryName"],[[32,2,["SDI"]],[30,2,["isEdit"]],[30,2,["isSomeFormsSubmitting"]],[30,5],[30,2,["subsidiaryName"]]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"vat",[28,[32,3],["shared.form-fields.taxId"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@options","@optionLabelMap","@isClearButtonEnabled","@isSearchEnabled"],["paymentMeansTypeId",[28,[32,3],["components.settings.subsidiary-sdi-form.paymentMeans"],null],[28,[32,4,["values"]],[[32,5]],null],[28,[32,6],["consts.eInvoicePaymentMeansType"],null],false,false]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"address",[28,[32,3],["shared.form-fields.street"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"city",[28,[32,3],["shared.form-fields.city"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"zipcode",[28,[32,3],["components.settings.subsidiary-sdi-form.zipcode"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label","@class"],[[30,2,["contactEntryForm"]],"state",[28,[32,3],["components.settings.subsidiary-sdi-form.state"],null],null]],null],[1,"\\n\\n"],[41,[30,2,["submitError"]],[[[1,"    "],[8,[32,7],[[24,0,"mt-4"]],[["@tone"],["danger"]],[["default"],[[[[1,"\\n      "],[8,[30,6,["Content"]],null,null,[["default"],[[[[1,"\\n        "],[8,[30,6,["Description"]],null,null,[["default"],[[[[1,[30,2,["submitError"]]]],[]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[6]]]]],[1,"\\n"]],[]],null],[1,"\\n  "],[8,[32,8],null,[["@formAggregate","@hasSuccessState","@isDisabled","@submitAction","@submitLabel","@secondaryAction","@isReversed"],[[30,2],true,[30,2,["isSomeFormsSubmitting"]],[30,3],[52,[30,2,["isEdit"]],[28,[32,3],["shared.ui-actions.saveChanges"],null],[28,[32,3],["components.settings.subsidiary-sdi-form.finishSetup"],null]],[30,7],true]],null],[1,"\\n"]],[4]]]]]],["&attrs","@formAggregate","@submitFormAggregate","f","@removeConfiguration","B","@close"],["if"]]',moduleName:"(unknown template module)",scope:()=>({FormFor:Ue,SubsidiaryFormatFormHeader:Xe,EinvoiceFormat:T,t:l,Object:Object,EInvoicePaymentMeansType:_e,labelFor:J,Banner:H,FormActions:ge}),isStrictMode:!0}),n()),bn=a(tt({id:null,block:'[[[8,[32,0],[[17,1]],[["@object","@submitForm"],[[30,2,["einvoiceConfigurationForm"]],[30,3]]],[["default"],[[[[1,"\\n  "],[8,[32,1],[[24,0,"mb-6"]],[["@einvoiceFormat","@isEdit","@removeConfiguration","@isRemoveDisabled","@subsidiaryName"],[[32,2,["XRECHNUNG"]],[30,2,["isEdit"]],[30,5],[30,2,["isSomeFormsSubmitting"]],[30,2,["subsidiaryName"]]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"vat",[28,[32,3],["shared.form-fields.taxId"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@options","@optionLabelMap","@isClearButtonEnabled","@isSearchEnabled"],["paymentMeansTypeId",[28,[32,3],["components.settings.subsidiary-xrechnung-form.paymentMeans"],null],[28,[32,4,["values"]],[[32,5]],null],[28,[32,6],["consts.eInvoicePaymentMeansType"],null],false,false]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@isInputPreviewDisabled","@propertyName","@label"],[[30,2,["contactEntryForm"]],true,"email",[28,[32,3],["components.settings.subsidiary-xrechnung-form.email"],null]]],null],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@object","@propertyName","@label"],[[30,2,["contactEntryForm"]],"phone",[28,[32,3],["components.settings.subsidiary-xrechnung-form.phone"],null]]],null],[1,"\\n\\n"],[41,[30,2,["submitError"]],[[[1,"    "],[8,[32,7],[[24,0,"mt-4"]],[["@tone"],["danger"]],[["default"],[[[[1,"\\n      "],[8,[30,6,["Content"]],null,null,[["default"],[[[[1,"\\n        "],[8,[30,6,["Description"]],null,null,[["default"],[[[[1,[30,2,["submitError"]]]],[]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[6]]]]],[1,"\\n"]],[]],null],[1,"\\n  "],[8,[32,8],null,[["@formAggregate","@hasSuccessState","@isDisabled","@submitAction","@submitLabel","@secondaryAction","@isReversed"],[[30,2],true,[30,2,["isSomeFormsSubmitting"]],[30,3],[52,[30,2,["isEdit"]],[28,[32,3],["shared.ui-actions.saveChanges"],null],[28,[32,3],["components.settings.subsidiary-xrechnung-form.finishSetup"],null]],[30,7],true]],null],[1,"\\n"]],[4]]]]]],["&attrs","@formAggregate","@submitFormAggregate","f","@removeConfiguration","B","@close"],["if"]]',moduleName:"(unknown template module)",scope:()=>({FormFor:Ue,SubsidiaryFormatFormHeader:Xe,EinvoiceFormat:T,t:l,Object:Object,EInvoicePaymentMeansType:_e,labelFor:J,Banner:H,FormActions:ge}),isStrictMode:!0}),n()),Fn=new WeakMap,En=new WeakMap,Cn=new WeakMap,wn=new WeakMap,xn=new WeakMap,Mn=new WeakMap,An=new WeakMap,kn=class extends Se{constructor(...e){super(...e),He(this,Fn,void Ve(this,"intl")),He(this,En,void Ve(this,"name")),He(this,Cn,void Ve(this,"vat")),He(this,wn,void Ve(this,"address")),He(this,xn,void Ve(this,"city")),He(this,Mn,void Ve(this,"zipcode")),He(this,An,void Ve(this,"state"))}};U((hn=kn).prototype,"intl",[M]),U(hn.prototype,"name",[he()]),U(hn.prototype,"vat",[he({label:e=>e.intl.t("shared.form-fields.taxId"),validations:{presence:e=>e.args.formAggregate.isFaceEnabled,inline(e,t){if(t.args.formAggregate.isFaceEnabled)return b(t.intl,e)}}})]),U(hn.prototype,"address",[he({label:e=>e.intl.t("shared.form-fields.street"),validations:{presence:e=>e.args.formAggregate.isFaceEnabled}})]),U(hn.prototype,"city",[he({label:e=>e.intl.t("shared.form-fields.city"),validations:{presence:e=>e.args.formAggregate.isFaceEnabled}})]),U(hn.prototype,"zipcode",[he({label:e=>e.intl.t("forms.e-invoicing.contact-entry-face-form.zipcode"),validations:{presence:e=>e.args.formAggregate.isFaceEnabled}})]),U(hn.prototype,"state",[he({label:e=>e.intl.t("forms.e-invoicing.contact-entry-face-form.state"),validations:{presence:e=>e.args.formAggregate.isFaceEnabled}})]);var Tn,Sn=new WeakMap,In=new WeakMap,Dn=class extends Se{constructor(...e){super(...e),He(this,Sn,void Ve(this,"intl")),et(this,"allowSaveIfNotDirty",!0),He(this,In,void Ve(this,"faceEnabled"))}};U((vn=Dn).prototype,"intl",[M]),U(vn.prototype,"faceEnabled",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-face-form.face")})]);var Pn,_n=class extends V{constructor(e,t){super(e,{...t,isEdit:Boolean(t.einvoiceConfiguration.faceEnabled)})}get isFaceEnabled(){return!!this.einvoiceConfigurationForm.faceEnabled}get forms(){return[this.contactEntryForm,this.einvoiceConfigurationForm]}get contactEntryForm(){return this.getFormForModel(this.subsidiaryContactEntry
1)}get einvoiceConfigurationForm(){return this.getFormForModel(this.einvoiceConfiguration)}async submit(){this.einvoiceConfigurationForm.faceEnabled=!0,await super.submit()}async removeConfiguration(){this.einvoiceConfigurationForm.faceEnabled=!1,this.contactEntryForm.resetField("vat"),this.contactEntryForm.resetField("address"),this.contactEntryForm.resetField("city"),this.contactEntryForm.resetField("zipcode"),this.contactEntryForm.resetField("state"),await super.submit()}createFormForModel(e){return e instanceof D?this.createForm(kn,[e,{formAggregate:this}]):e instanceof L?this.createForm(Dn,[e]):void 0}};u((Tn=_n).prototype,"forms",[Fe]),u(Tn.prototype,"contactEntryForm",[Fe]),u(Tn.prototype,"einvoiceConfigurationForm",[Fe]),u(Tn.prototype,"submit",[ee]),u(Tn.prototype,"removeConfiguration",[ee]);var Rn,zn=new WeakMap,Wn=new WeakMap,Nn=new WeakMap,On=new WeakMap,Hn=new WeakMap,jn=new WeakMap,Bn=new WeakMap,Ln=class extends Se{constructor(...e){super(...e),He(this,zn,void Ve(this,"intl")),He(this,Wn,void Ve(this,"name")),He(this,Nn,void Ve(this,"vat")),He(this,On,void Ve(this,"address")),He(this,Hn,void Ve(this,"city")),He(this,jn,void Ve(this,"zipcode")),He(this,Bn,void Ve(this,"state"))}};U((Pn=Ln).prototype,"intl",[M]),U(Pn.prototype,"name",[he()]),U(Pn.prototype,"vat",[he({label:e=>e.intl.t("shared.form-fields.taxId"),validations:{presence:e=>e.args.formAggregate.isKsefEnabled,inline(e,t){if(t.args.formAggregate.isKsefEnabled)return z(t.intl,e)}}})]),U(Pn.prototype,"address",[he({label:e=>e.intl.t("shared.form-fields.street"),validations:{presence:e=>e.args.formAggregate.isKsefEnabled}})]),U(Pn.prototype,"city",[he({label:e=>e.intl.t("shared.form-fields.city"),validations:{presence:e=>e.args.formAggregate.isKsefEnabled}})]),U(Pn.prototype,"zipcode",[he({label:e=>e.intl.t("forms.e-invoicing.contact-entry-ksef-form.zipcode"),validations:{presence:e=>e.args.formAggregate.isKsefEnabled}})]),U(Pn.prototype,"state",[he({label:e=>e.intl.t("forms.e-invoicing.contact-entry-ksef-form.state"),validations:{presence:e=>e.args.formAggregate.isKsefEnabled}})]);var Un,Kn=new WeakMap,Vn=new WeakMap,Gn=new WeakMap,Xn=class extends Se{constructor(...e){super(...e),He(this,Kn,void Ve(this,"intl")),et(this,"allowSaveIfNotDirty",!0),He(this,Vn,void Ve(this,"ksefEnabled")),He(this,Gn,void Ve(this,"paymentMeansTypeId"))}};U((Rn=Xn).prototype,"intl",[M]),U(Rn.prototype,"ksefEnabled",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-ksef-form.ksef")})]),U(Rn.prototype,"paymentMeansTypeId",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-ksef-form.paymentMeans"),validations:{presence:e=>e.ksefEnabled}})]);var Jn,qn=class extends V{constructor(e,t){super(e,{...t,isEdit:Boolean(t.einvoiceConfiguration.ksefEnabled)})}get isKsefEnabled(){return!!this.einvoiceConfigurationForm.ksefEnabled}get forms(){return[this.contactEntryForm,this.einvoiceConfigurationForm]}get contactEntryForm(){return this.getFormForModel(this.subsidiaryContactEntry)}get einvoiceConfigurationForm(){return this.getFormForModel(this.einvoiceConfiguration)}async submit(){this.einvoiceConfigurationForm.ksefEnabled=!0,await super.submit()}async removeConfiguration(){this.einvoiceConfigurationForm.ksefEnabled=!1,this.contactEntryForm.resetField("vat"),this.contactEntryForm.resetField("address"),this.contactEntryForm.resetField("city"),this.contactEntryForm.resetField("zipcode"),this.contactEntryForm.resetField("state"),this.einvoiceConfigurationForm.paymentMeansTypeId=void 0,await super.submit()}createFormForModel(e){return e instanceof D?this.createForm(Ln,[e,{formAggregate:this}]):e instanceof L?this.createForm(Xn,[e]):void 0}};u((Un=qn).prototype,"forms",[Fe]),u(Un.prototype,"contactEntryForm",[Fe]),u(Un.prototype,"einvoiceConfigurationForm",[Fe]),u(Un.prototype,"submit",[ee]),u(Un.prototype,"removeConfiguration",[ee]);var Qn,Yn=new WeakMap,$n=new WeakMap,Zn=new WeakMap,ei=class extends Se{constructor(...e){super(...e),He(this,Yn,void Ve(this,"intl")),He(this,$n,void Ve(this,"name")),He(this,Zn,void Ve(this,"vat"))}};U((Jn=ei).prototype,"intl",[M]),U(Jn.prototype,"name",[he()]),U(Jn.prototype,"vat",[he({label:e=>e.intl.t("shared.form-fields.taxId"),validations:{presence:e=>e.args.formAggregate.isMerEnabled,inline(e,t){if(t.args.formAggregate.isMerEnabled)return i(t.intl,e)}}})]);var ti,ni=new WeakMap,ii=new WeakMap,oi=new WeakMap,ri=new WeakMap,ai=new WeakMap,si=new WeakMap,li=new WeakMap,ui=new WeakMap,di=class extends Se{constructor(...e){super(...e),He(this,ni,void Ve(this,"intl")),et(this,"allowSaveIfNotDirty",!0),He(this,ii,void Ve(this,"merEnabled")),He(this,oi,void Ve(this,"merUsername")),He(this,ri,void Ve(this,"merPassword")),He(this,ai,void Ve(this,"paymentMeansTypeId")),He(this,si,void Ve(this,"taxRateMapping")),He(this,li,void Ve(this,"kpdCodeMapping")),He(this,ui,void Ve(this,"includePdfAttachment"))}};U((Qn=di).prototype,"intl",[M]),U(Qn.prototype,"merEnabled",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.mer")})]),U(Qn.prototype,"merUsername",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.merUsername"),validations:{presence:e=>e.merEnabled}})]),U(Qn.prototype,"merPassword",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.merPassword"),validations:{presence:e=>e.merEnabled&&(!e.args.formAggregate.isEdit||e.args.formAggregate.isEditingPassword)}})]),U(Qn.prototype,"paymentMeansTypeId",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.paymentMeans"),validations:{presence:e=>e.merEnabled}})]),U(Qn.prototype,"taxRateMapping",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.taxRateMapping"),validations:{inline(e,t){var n,i;if(t.merEnabled&&0!==(null!==(i=null===(n=t.model.subsidiary)||void 0===n||null===(n=n.taxRates)||void 0===n?void 0:n.length)&&void 0!==i?i:0)){if
1(!e||0===Object.keys(e).length)return[t.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.allTaxRatesMustBeMapped")];for(const n in e){var o;if(!(null===(o=e[n])||void 0===o?void 0:o.taxCategoryId))return[t.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.allTaxRatesMustBeMapped")]}for(const n in e){var r;const i=We.find(t=>{var i;return t.id===(null===(i=e[n])||void 0===i?void 0:i.taxCategoryId)});if((null==i?void 0:i.exemptable)&&!(null===(r=e[n])||void 0===r||null===(r=r.exemptionReason)||void 0===r?void 0:r.trim()))return[t.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.provideExemptionReasons")]}}}},getValue(e){var t,n;return(null!==(n=null===(t=e.model.subsidiary)||void 0===t||null===(t=t.taxRates)||void 0===t?void 0:t.slice())&&void 0!==n?n:[]).reduce((t,n)=>{var i,o;return t[n.id]=null!==(o=null===(i=e.model.taxRateMapping)||void 0===i?void 0:i[n.id])&&void 0!==o?o:{taxCategoryId:"",exemptionReason:""},t},{})}})]),U(Qn.prototype,"kpdCodeMapping",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.kpdCodeMapping")})]),U(Qn.prototype,"includePdfAttachment",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-mer-form.includePdfAttachment")})]);var pi,mi=new WeakMap,ci=class extends V{constructor(e,t){super(e,{...t,isEdit:Boolean(t.einvoiceConfiguration.merEnabled)}),He(this,mi,void Ve(this,"isEditingPassword"))}get isMerEnabled(){return this.einvoiceConfigurationForm.merEnabled}get forms(){return[this.contactEntryForm,this.einvoiceConfigurationForm]}get contactEntryForm(){return this.getFormForModel(this.subsidiaryContactEntry)}get einvoiceConfigurationForm(){return this.getFormForModel(this.einvoiceConfiguration)}async submit(){this.einvoiceConfigurationForm.merEnabled=!0,await super.submit()}async removeConfiguration(){this.einvoiceConfigurationForm.merEnabled=!1,this.contactEntryForm.resetField("vat");for(const e of["merUsername","merPassword","paymentMeansTypeId","taxRateMapping","kpdCodeMapping"])this.einvoiceConfiguration[e]&&(this.einvoiceConfigurationForm[e]=void 0);this.einvoiceConfigurationForm.includePdfAttachment=!1,await super.submit()}createFormForModel(e){return e instanceof D?this.createForm(ei,[e,{formAggregate:this}]):e instanceof L?this.createForm(di,[e,{formAggregate:this}]):void 0}};U((ti=ci).prototype,"isEditingPassword",[P],function(){return!1}),u(ti.prototype,"forms",[Fe]),u(ti.prototype,"contactEntryForm",[Fe]),u(ti.prototype,"einvoiceConfigurationForm",[Fe]),u(ti.prototype,"submit",[ee]),u(ti.prototype,"removeConfiguration",[ee]);var gi,hi=new WeakMap,vi=new WeakMap,yi=new WeakMap,fi=class extends Se{constructor(...e){super(...e),He(this,hi,void Ve(this,"intl")),He(this,vi,void Ve(this,"name")),He(this,yi,void Ve(this,"vat"))}};U((pi=fi).prototype,"intl",[M]),U(pi.prototype,"name",[he()]),U(pi.prototype,"vat",[he({label:e=>e.intl.t("shared.form-fields.taxId"),validations:{presence:e=>e.args.formAggregate.isPeppolEnabled}})]);var bi,Fi=new WeakMap,Ei=new WeakMap,Ci=new WeakMap,wi=new WeakMap,xi=new WeakMap,Mi=class extends Se{constructor(...e){super(...e),He(this,Fi,void Ve(this,"intl")),et(this,"allowSaveIfNotDirty",!0),He(this,Ei,void Ve(this,"isPeppolEnabled")),He(this,Ci,void Ve(this,"paymentMeansTypeId")),He(this,wi,void Ve(this,"includePdfAttachment")),He(this,xi,void Ve(this,"useInvoicePeriod"))}};U((gi=Mi).prototype,"intl",[M]),U(gi.prototype,"isPeppolEnabled",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-peppol-form.peppolNetwork")})]),U(gi.prototype,"paymentMeansTypeId",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-peppol-form.paymentMeans"),validations:{presence:e=>e.isPeppolEnabled}})]),U(gi.prototype,"includePdfAttachment",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-peppol-form.includePdfAttachment")})]),U(gi.prototype,"useInvoicePeriod",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-peppol-form.useInvoicePeriod")})]);var Ai,ki=new WeakMap,Ti=new WeakMap,Si=class extends Se{constructor(...e){super(...e),He(this,ki,void Ve(this,"intl")),He(this,Ti,void Ve(this,"peppolId"))}get isPeppolEnabled(){return this.args.formAggregate.isPeppolEnabled}};U((bi=Si).prototype,"intl",[M]),U(bi.prototype,"peppolId",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-identity-subsidiary-peppol-form.peppolSenderId"),validations:{presence:e=>e.isPeppolEnabled,inline:(e,t)=>_(t.intl,e)}})]);var Ii,Di=class extends V{constructor(e,t){super(e,{...t,isEdit:Boolean(t.einvoiceIdentity.peppolId)}),et(this,"einvoiceIdentity",void 0),this.einvoiceIdentity=t.einvoiceIdentity}get isPeppolEnabled(){return!!this.einvoiceConfigurationForm.isPeppolEnabled}get forms(){return[this.contactEntryForm,this.einvoiceConfigurationForm,this.einvoiceIdentityForm]}get contactEntryForm(){return this.getFormForModel(this.subsidiaryContactEntry
1)}get einvoiceConfigurationForm(){return this.getFormForModel(this.einvoiceConfiguration)}get einvoiceIdentityForm(){return this.getFormForModel(this.einvoiceIdentity)}async submit(){this.einvoiceConfigurationForm.isPeppolEnabled=!0,await super.submit()}async removeConfiguration(){this.einvoiceConfigurationForm.isPeppolEnabled=!1,this.contactEntryForm.resetField("vat"),this.einvoiceIdentityForm.peppolId=void 0,this.einvoiceConfigurationForm.paymentMeansTypeId=void 0,this.einvoiceConfigurationForm.includePdfAttachment=!1,this.einvoiceConfigurationForm.useInvoicePeriod=!1,await super.submit()}createFormForModel(e){return e instanceof D?this.createForm(fi,[e,{formAggregate:this}]):e instanceof L?this.createForm(Mi,[e]):e instanceof se?this.createForm(Si,[e,{formAggregate:this}]):void 0}};u((Ai=Di).prototype,"forms",[Fe]),u(Ai.prototype,"contactEntryForm",[Fe]),u(Ai.prototype,"einvoiceConfigurationForm",[Fe]),u(Ai.prototype,"einvoiceIdentityForm",[Fe]),u(Ai.prototype,"submit",[ee]),u(Ai.prototype,"removeConfiguration",[ee]);var Pi,_i=new WeakMap,Ri=new WeakMap,zi=new WeakMap,Wi=new WeakMap,Ni=new WeakMap,Oi=new WeakMap,Hi=new WeakMap,ji=class extends Se{constructor(...e){super(...e),He(this,_i,void Ve(this,"intl")),He(this,Ri,void Ve(this,"name")),He(this,zi,void Ve(this,"vat")),He(this,Wi,void Ve(this,"address")),He(this,Ni,void Ve(this,"city")),He(this,Oi,void Ve(this,"zipcode")),He(this,Hi,void Ve(this,"state"))}};U((Ii=ji).prototype,"intl",[M]),U(Ii.prototype,"name",[he()]),U(Ii.prototype,"vat",[he({label:e=>e.intl.t("shared.form-fields.taxId"),validations:{presence:e=>e.args.formAggregate.isSdiEnabled,inline(e,t){if(t.args.formAggregate.isSdiEnabled)return Ce(t.intl,e)}}})]),U(Ii.prototype,"address",[he({label:e=>e.intl.t("shared.form-fields.street"),validations:{presence:e=>e.args.formAggregate.isSdiEnabled}})]),U(Ii.prototype,"city",[he({label:e=>e.intl.t("shared.form-fields.city"),validations:{presence:e=>e.args.formAggregate.isSdiEnabled}})]),U(Ii.prototype,"zipcode",[he({label:e=>e.intl.t("forms.e-invoicing.contact-entry-sdi-form.zipcode"),validations:{presence:e=>e.args.formAggregate.isSdiEnabled}})]),U(Ii.prototype,"state",[he({label:e=>e.intl.t("forms.e-invoicing.contact-entry-sdi-form.state"),validations:{presence:e=>e.args.formAggregate.isSdiEnabled}})]);var Bi,Li=new WeakMap,Ui=new WeakMap,Ki=new WeakMap,Vi=class extends Se{constructor(...e){super(...e),He(this,Li,void Ve(this,"intl")),et(this,"allowSaveIfNotDirty",!0),He(this,Ui,void Ve(this,"sdiEnabled")),He(this,Ki,void Ve(this,"paymentMeansTypeId"))}};U((Pi=Vi).prototype,"intl",[M]),U(Pi.prototype,"sdiEnabled",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-sdi-form.sdi")})]),U(Pi.prototype,"paymentMeansTypeId",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-sdi-form.paymentMeans"),validations:{presence:e=>e.sdiEnabled}})]);var Gi,Xi=class extends V{constructor(e,t){super(e,{...t,isEdit:Boolean(t.einvoiceConfiguration.sdiEnabled)})}get isSdiEnabled(){return!!this.einvoiceConfigurationForm.sdiEnabled}get forms(){return[this.contactEntryForm,this.einvoiceConfigurationForm]}get contactEntryForm(){return this.getFormForModel(this.subsidiaryContactEntry)}get einvoiceConfigurationForm(){return this.getFormForModel(this.einvoiceConfiguration)}async submit(){this.einvoiceConfigurationForm.sdiEnabled=!0,await super.submit()}async removeConfiguration(){this.einvoiceConfigurationForm.sdiEnabled=!1,this.contactEntryForm.resetField("vat"),this.contactEntryForm.resetField("address"),this.contactEntryForm.resetField("city"),this.contactEntryForm.resetField("zipcode"),this.contactEntryForm.resetField("state"),this.einvoiceConfigurationForm.paymentMeansTypeId=void 0,await super.submit()}createFormForModel(e){return e instanceof D?this.createForm(ji,[e,{formAggregate:this}]):e instanceof L?this.createForm(Vi,[e]):void 0}};u((Bi=Xi).prototype,"forms",[Fe]),u(Bi.prototype,"contactEntryForm",[Fe]),u(Bi.prototype,"einvoiceConfigurationForm",[Fe]),u(Bi.prototype,"submit",[ee]),u(Bi.prototype,"removeConfiguration",[ee]);var Ji,qi=new WeakMap,Qi=new WeakMap,Yi=new WeakMap,$i=new WeakMap,Zi=new WeakMap,eo=class extends Se{constructor(...e){super(...e),He(this,qi,void Ve(this,"intl")),He(this,Qi,void Ve(this,"name")),He(this,Yi,void Ve(this,"vat")),He(this,$i,void Ve(this,"email")),He(this,Zi,void Ve(this,"phone"))}};U((Gi=eo).prototype,"intl",[M]),U(Gi.prototype,"name",[he()]),U(Gi.prototype,"vat",[he({label:e=>e.intl.t("shared.form-fields.taxId"),validations:{presence:e=>e.args.formAggregate.isXrechnungEnabled}})]),U(Gi.prototype,"email",[he({label:e=>e.intl.t("forms.e-invoicing.contact-entry-xrechnung-form.email"),validations:{presence:e=>e.args.formAggregate.isXrechnungEnabled,email:e=>e.args.formAggregate.isXrechnungEnabled}})]),U(Gi.prototype,"phone",[he({label:e=>e.intl.t("forms.e-invoicing.contact-entry-xrechnung-form.phone"),validations:{presence:e=>e.args.formAggregate.isXrechnungEnabled,phoneNumber:e=>e.args.formAggregate.isXrechnungEnabled}})]);var to,no=new WeakMap,io=new WeakMap,oo=new WeakMap,ro=class extends Se{constructor(...e){super(...e),He(this,no,void Ve(this,"intl")),et(this,"allowSaveIfNotDirty",!0),He(this,io,void Ve(this,"xrechnungEnabled")),He(this,oo,void Ve(this,"paymentMeansTypeId"))}};U((Ji=ro).prototype,"intl",[M]),U(Ji.prototype,"xrechnungEnabled",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-xrechnung-form.xrechnung")})]),U(Ji.prototype,"paymentMeansTypeId",[he({label:e=>e.intl.t("forms.e-invoicing.einvoice-configuration-xrechnung-form.paymentMeans"),validations:{presence:e=>e.xrechnungEnabled}})]);var ao,so=class extends V{constructor(e,t){super(e,{...t,isEdit:Boolean(t.einvoiceConfiguration.xrechnungEnabled)})}get isXrechnungEnabled(){return!!this.einvoiceConfigurationForm.xrechnungEnabled}get forms(){return[this.contactEntryForm,this.einvoiceConfigurationForm]}get contactEntryForm(){return this.getFormForModel(this.subsidiaryContactEntry
1)}get einvoiceConfigurationForm(){return this.getFormForModel(this.einvoiceConfiguration)}async submit(){this.einvoiceConfigurationForm.xrechnungEnabled=!0,await super.submit()}async removeConfiguration(){this.einvoiceConfigurationForm.xrechnungEnabled=!1,this.contactEntryForm.resetField("vat"),this.contactEntryForm.resetField("email"),this.contactEntryForm.resetField("phone"),this.einvoiceConfigurationForm.paymentMeansTypeId=void 0,await super.submit()}createFormForModel(e){return e instanceof D?this.createForm(eo,[e,{formAggregate:this}]):e instanceof L?this.createForm(ro,[e]):void 0}};u((to=so).prototype,"forms",[Fe]),u(to.prototype,"contactEntryForm",[Fe]),u(to.prototype,"einvoiceConfigurationForm",[Fe]),u(to.prototype,"submit",[ee]),u(to.prototype,"removeConfiguration",[ee]);var lo=new WeakMap,uo=new WeakMap,po=new WeakMap,mo=new WeakMap,co=new WeakMap,go=new WeakMap,ho=new WeakMap,vo=new WeakMap,yo=new WeakMap,fo=new WeakMap,bo=new WeakMap,Fo=new WeakMap,Eo=new WeakMap,Co=new WeakMap,wo=class extends Q{constructor(...e){super(...e),He(this,lo,void Ve(this,"can")),He(this,uo,void Ve(this,"flags")),He(this,po,void Ve(this,"formsHandler")),He(this,mo,void Ve(this,"modals")),He(this,co,void Ve(this,"store")),He(this,go,void Ve(this,"subscription")),He(this,ho,void Ve(this,"ui")),He(this,vo,void Ve(this,"intl")),He(this,yo,void Ve(this,"xrechnungFormAggregate")),He(this,fo,void Ve(this,"peppolFormAggregate")),He(this,bo,void Ve(this,"faceFormAggregate")),He(this,Fo,void Ve(this,"merFormAggregate")),He(this,Eo,void Ve(this,"ksefFormAggregate")),He(this,Co,void Ve(this,"sdiFormAggregate")),et(this,"initializeFormAggregateTask",Ke(()=>({context:this,generator:function*(){if(this.args.subsidiary&&this.einvoiceFormat)switch(yield Promise.resolve(),this.einvoiceFormat){case T.XRECHNUNG:return void this.initializeXrechnungFormAggregate();case T.PEPPOL:return void this.initializePeppolFormAggregate();case T.FACE:return void this.initializeFaceFormAggregate();case T.HR_CIUS:return yield this.subsidiaryTaxesQuery.run(),void this.initializeMerFormAggregate();case T.KSEF:return void this.initializeKsefFormAggregate();case T.SDI:return void this.initializeSdiFormAggregate()}}}),null,"initializeFormAggregateTask",null))}get einvoiceFormat(){var e;return null===(e=this.args.subsidiary.einvoiceFormats[0])||void 0===e?void 0:e.format}get activeFormAggregate(){switch(this.einvoiceFormat){case T.XRECHNUNG:return this.xrechnungFormAggregate;case T.PEPPOL:return this.peppolFormAggregate;case T.FACE:return this.faceFormAggregate;case T.HR_CIUS:return this.merFormAggregate;case T.KSEF:return this.ksefFormAggregate;case T.SDI:return this.sdiFormAggregate}}get isVerifactuNextStepEligible(){var e;return this.flags.verifactuFiscalization&&!!(null===(e=this.subscription.features)||void 0===e?void 0:e.documentTemplates.isDiscoverable)&&this.can.app.canManageDocumentTemplates}get subsidiaryTaxesQuery(){return Y.on(this).active().forSubsidiary(this.args.subsidiary).withContext("subsidiary-einvoice-form").depaginate()}getSubsidiaryContactEntry(){var e;return null!==(e=this.args.subsidiary.billFrom)&&void 0!==e?e:ve.on(this).billFrom().forSubsidiary(this.args.subsidiary).create()}getSubsidiaryEinvoiceConfiguration(){var e;return null!==(e=this.args.subsidiary.einvoiceConfiguration)&&void 0!==e?e:this.store.createRecord("einvoice-configuration",{subsidiary:this.args.subsidiary})}getSubsidiaryEinvoiceIdentity(){var e;return null!==(e=this.args.subsidiary.einvoiceIdentity)&&void 0!==e?e:this.store.createRecord("einvoice-identity",{subsidiary:this.args.subsidiary})}initializeXrechnungFormAggregate(){var e;null===(e=this.xrechnungFormAggregate)||void 0===e||e.destroy(),this.xrechnungFormAggregate=this.formsHandler.createFormAggregate(so,[{subsidiaryName:this.args.subsidiary.name,contactEntry:this.getSubsidiaryContactEntry(),einvoiceConfiguration:this.getSubsidiaryEinvoiceConfiguration()}]),N(this,()=>this.xrechnungFormAggregate.destroy())}initializePeppolFormAggregate(){var e;null===(e=this.peppolFormAggregate)||void 0===e||e.destroy(),this.peppolFormAggregate=this.formsHandler.createFormAggregate(Di,[{subsidiaryName:this.args.subsidiary.name,contactEntry:this.getSubsidiaryContactEntry(),einvoiceConfiguration:this.getSubsidiaryEinvoiceConfiguration(),einvoiceIdentity:this.getSubsidiaryEinvoiceIdentity()}]),N(this,()=>this.peppolFormAggregate.destroy())}initializeFaceFormAggregate(){var e;null===(e=this.faceFormAggregate)||void 0===e||e.destroy(),this.faceFormAggregate=this.formsHandler.createFormAggregate(_n,[{subsidiaryName:this.args.subsidiary.name,contactEntry:this.getSubsidiaryContactEntry(),einvoiceConfiguration:this.getSubsidiaryEinvoiceConfiguration()}]),N(this,()=>this.faceFormAggregate.destroy())}initializeMerFormAggregate(){var e;null===(e=this.merFormAggregate)||void 0===e||e.destroy(),this.merFormAggregate=this.formsHandler.createFormAggregate(ci,[{subsidiaryName:this.args.subsidiary.name,contactEntry:this.getSubsidiaryContactEntry(),einvoiceConfiguration:this.getSubsidiaryEinvoiceConfiguration()}]),N(this,()=>this.merFormAggregate.destroy())}initializeKsefFormAggregate(){var e;null===(e=this.ksefFormAggregate)||void 0===e||e.destroy(),this.ksefFormAggregate=this.formsHandler.createFormAggregate(qn,[{subsidiaryName:this.args.subsidiary.name,contactEntry:this.getSubsidiaryContactEntry(),einvoiceConfiguration:this.getSubsidiaryEinvoiceConfiguration()}]),N(this,()=>this.ksefFormAggregate.destroy())}
1initializeSdiFormAggregate(){var e;null===(e=this.sdiFormAggregate)||void 0===e||e.destroy(),this.sdiFormAggregate=this.formsHandler.createFormAggregate(Xi,[{subsidiaryName:this.args.subsidiary.name,contactEntry:this.getSubsidiaryContactEntry(),einvoiceConfiguration:this.getSubsidiaryEinvoiceConfiguration()}]),N(this,()=>this.sdiFormAggregate.destroy())}async submitFormAggregate(){if(!this.activeFormAggregate)throw new Error("Tried to submit einvoice settings but no active form aggregate found.");const e=this.activeFormAggregate===this.faceFormAggregate&&!this.activeFormAggregate.isEdit;try{var t,n,i;await(null===(t=this.activeFormAggregate)||void 0===t?void 0:t.submit()),this.ui.showSaveSuccessFlash(),e&&this.isVerifactuNextStepEligible&&this.modals.openModal("verifactu-next-step",null),null===(n=(i=this.args).close)||void 0===n||n.call(i)}catch(o){if(o instanceof ye||$e(o))return;throw this.ui.showSaveErrorFlash(),o}}async removeConfiguration(){if(!this.activeFormAggregate)throw new Error("Tried to remove einvoice configuration but no active form aggregate found.");try{var e,t,n;await(null===(e=this.activeFormAggregate)||void 0===e?void 0:e.removeConfiguration()),this.ui.showSaveSuccessFlash(),null===(t=(n=this.args).close)||void 0===t||t.call(n)}catch(a){if(a instanceof ye||$e(a))return;var i,o,r;throw null===(i=this.activeFormAggregate)||void 0===i||i.reset(),this.ui.showSaveErrorFlash(this.intl.t("components.settings.subsidiary-einvoice-form.errorWhileRemoving")),null===(o=(r=this.args).close)||void 0===o||o.call(r),a}}};U((ao=wo).prototype,"can",[M]),U(ao.prototype,"flags",[M]),U(ao.prototype,"formsHandler",[M]),U(ao.prototype,"modals",[M]),U(ao.prototype,"store",[M]),U(ao.prototype,"subscription",[M]),U(ao.prototype,"ui",[M]),U(ao.prototype,"intl",[M]),U(ao.prototype,"xrechnungFormAggregate",[P]),U(ao.prototype,"peppolFormAggregate",[P]),U(ao.prototype,"faceFormAggregate",[P]),U(ao.prototype,"merFormAggregate",[P]),U(ao.prototype,"ksefFormAggregate",[P]),U(ao.prototype,"sdiFormAggregate",[P]),u(ao.prototype,"initializeXrechnungFormAggregate",[ee]),u(ao.prototype,"initializePeppolFormAggregate",[ee]),u(ao.prototype,"initializeFaceFormAggregate",[ee]),u(ao.prototype,"initializeMerFormAggregate",[ee]),u(ao.prototype,"initializeKsefFormAggregate",[ee]),u(ao.prototype,"initializeSdiFormAggregate",[ee]),u(ao.prototype,"submitFormAggregate",[ee]),u(ao.prototype,"removeConfiguration",[ee]),a(tt({id:null,block:'[[[11,0],[17,1],[12],[1,"\\n  "],[8,[32,0],null,[["@subsidiary"],[[30,2]]],[["default"],[[[[1,"\\n    "],[8,[32,1],null,[["@task","@errorTitle"],[[30,0,["initializeFormAggregateTask"]],[28,[32,2],["components.settings.subsidiary-einvoice-form.initializeFormError"],null]]],[["default"],[[[[1,"\\n"],[41,[30,0,["xrechnungFormAggregate"]],[[[1,"        "],[8,[32,3],null,[["@formAggregate","@submitFormAggregate","@removeConfiguration","@close"],[[30,0,["xrechnungFormAggregate"]],[30,0,["submitFormAggregate"]],[30,0,["removeConfiguration"]],[30,3]]],null],[1,"\\n"]],[]],[[[41,[30,0,["peppolFormAggregate"]],[[[1,"        "],[8,[32,4],null,[["@formAggregate","@submitFormAggregate","@removeConfiguration","@close"],[[30,0,["peppolFormAggregate"]],[30,0,["submitFormAggregate"]],[30,0,["removeConfiguration"]],[30,3]]],null],[1,"\\n"]],[]],[[[41,[30,0,["faceFormAggregate"]],[[[1,"        "],[8,[32,5],null,[["@formAggregate","@submitFormAggregate","@removeConfiguration","@close"],[[30,0,["faceFormAggregate"]],[30,0,["submitFormAggregate"]],[30,0,["removeConfiguration"]],[30,3]]],null],[1,"\\n"]],[]],[[[41,[30,0,["merFormAggregate"]],[[[1,"        "],[8,[32,6],null,[["@subsidiary","@formAggregate","@submitFormAggregate","@removeConfiguration","@close"],[[30,2],[30,0,["merFormAggregate"]],[30,0,["submitFormAggregate"]],[30,0,["removeConfiguration"]],[30,3]]],null],[1,"\\n"]],[]],[[[41,[30,0,["ksefFormAggregate"]],[[[1,"        "],[8,[32,7],null,[["@formAggregate","@submitFormAggregate","@removeConfiguration","@close"],[[30,0,["ksefFormAggregate"]],[30,0,["submitFormAggregate"]],[30,0,["removeConfiguration"]],[30,3]]],null],[1,"\\n"]],[]],[[[41,[30,0,["sdiFormAggregate"]],[[[1,"        "],[8,[32,8],null,[["@formAggregate","@submitFormAggregate","@removeConfiguration","@close"],[[30,0,["sdiFormAggregate"]],[30,0,["submitFormAggregate"]],[30,0,["removeConfiguration"]],[30,3]]],null],[1,"\\n      "]],[]],null]],[]]]],[]]]],[]]]],[]]]],[]]],[1,"    "]],[]]]]],[1,"\\n  "]],[]]]]],[1,"\\n"],[13]],["&attrs","@subsidiary","@close"],["if"]]',moduleName:"(unknown template module)",scope:()=>({SubsidiaryEinvoiceAvailability:ke,ConcurrencyTaskState:fe,t:l,SubsidiaryXrechnungForm:bn,SubsidiaryPeppolForm:yn,SubsidiaryFaceForm:on,SubsidiaryMerForm:gn,SubsidiaryKsefForm:rn,SubsidiarySdiForm:fn}),isStrictMode:!0}),ao);var xo,Mo=e({default:()=>ko}),Ao=class extends Q{get isWide(){var e;return(null===(e=this.args.model.einvoiceFormats[0])||void 0===e?void 0:e.format)===T.HR_CIUS}};xo=Ao,a(tt({id:null,block:'[[[1,[28,[32,0],[[28,[32,1],["routes.organization.settings.invoicing.subsidiary-e-invoicing-options.eInvoicingOptions"],[["
1name"],[[30,1,["name"]]]]]],null]],[1,"\\n"],[8,[32,2],null,[["@title","@close","@isFullWidth"],[[28,[32,1],["routes.organization.settings.invoicing.subsidiary-e-invoicing-options.einvoicingFor"],[["name"],[[30,1,["name"]]]]],[30,2,["route","closeModal"]],[30,0,["isWide"]]]],[["default"],[[[[1,"\\n  "],[8,[32,3],null,[["@subsidiary","@close"],[[30,1],[30,2,["route","closeModal"]]]],null],[1,"\\n"]],[]]]]]],["@model","@controller"],[]]',moduleName:"(unknown template module)",scope:()=>({pageTitle:ie,t:l,Modal:I,SubsidiaryEinvoiceForm:wo}),isStrictMode:!0}),xo);var ko=re(Ao),To=e({default:()=>Io}),So=new WeakMap,Io=class extends ue{constructor(...e){super(...e),He(this,So,void Ve(this,"app")),et(this,"isModalRoute",!0)}beforeModel(){this.app.isSandbox&&this.routing.transitionTo("organization.settings.invoicing")}model(e){return this.store.findRecord("subsidiary",e.subsidiary_id,{include:["einvoice_configuration","einvoice_identity","bill_from"]})}setupController(e,t,n){super.setupController(e,t,n),e.set("route",this)}};U(Io.prototype,"app",[M]);var Do,Po=e({default:()=>_o}),_o=re(a(tt({id:null,block:'[[[1,[28,[32,0],[[28,[32,1],["routes.organization.settings.invoicing.subsidiary-options.subsidiaryOptions"],[["name"],[[30,1,["subsidiaryForm","name"]]]]]],null]],[1,"\\n\\n"],[8,[32,2],null,[["@title","@close"],[[28,[32,3],[[30,1,["subsidiaryForm","name"]]," invoicing options"],null],[30,1,["route","closeModal"]]]],[["default"],[[[[1,"\\n"],[41,[30,1,["subsidiaryForm"]],[[[1,"    "],[8,[32,4],null,[["@subsidiaryForm","@submitForm"],[[30,1,["subsidiaryForm"]],[30,1,["route","submitForm"]]]],null],[1,"\\n"]],[]],null]],[]]]]]],["@controller"],["if"]]',moduleName:"(unknown template module)",scope:()=>({pageTitle:ie,t:l,Modal:I,concat:Ge,SubsidiaryInvoicingForm:f}),isStrictMode:!0}),n())),Ro=e({default:()=>Oo}),zo=new WeakMap,Wo=new WeakMap,No=new WeakMap,Oo=class extends ue{constructor(...e){super(...e),He(this,zo,void Ve(this,"formsHandler")),He(this,Wo,void Ve(this,"ui")),He(this,No,void Ve(this,"intl")),et(this,"isModalRoute",!0)}model(e){return this.store.findRecord("subsidiary",e.subsidiary_id)}setupController(e,t,n){super.setupController(e,t,n),e.set("route",this),e.set("organization",this.session.organization),e.set("subsidiaryForm",this.formsHandler.createForm(X,[t]))}async submitForm(e){try{await this.formsHandler.submitForm(e),this.ui.showSaveSuccessFlash(),this.closeModal()}catch(t){if(t instanceof TypeError)throw t;if(t instanceof ye)return}}resetController(e,t,n){super.resetController(e,t,n),this.controller.subsidiaryForm&&(this.controller.subsidiaryForm.destroy(),this.controller.set("subsidiaryForm",null))}};U((Do=Oo).prototype,"formsHandler",[M]),U(Do.prototype,"ui",[M]),U(Do.prototype,"intl",[M]),u(Do.prototype,"submitForm",[ee]);var Ho={};Ho["productive/templates/organization/settings/invoicing"]=Mt,Ho["productive/routes/organization/settings/invoicing"]=Jt,Ho["productive/templates/organization/settings/invoicing/subsidiary-e-invoicing-options"]=Mo,Ho["productive/routes/organization/settings/invoicing/subsidiary-e-invoicing-options"]=To,Ho["productive/templates/organization/settings/invoicing/subsidiary-options"]=Po,Ho["productive/routes/organization/settings/invoicing/subsidiary-options"]=Ro;export{Ho as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.