import{a as j}from"./chunk-QK22XPCC.js";import{a as R}from"./chunk-H5WCERW4.js";import{a as p}from"./chunk-FNDXPXHD.js";import{d as E,e as H}from"./chunk-5H5H6C4Y.js";import"./chunk-QEMINC2A.js";import"./chunk-P4KRQVGS.js";import"./chunk-HVLAIORG.js";import"./chunk-7NRTBDEV.js";import"./chunk-WTAT2E5Z.js";import"./chunk-4KB2I3K5.js";import{a as F}from"./chunk-4EEGS4SZ.js";import{a as P}from"./chunk-Y46LOK5X.js";import"./chunk-3PEMIHKH.js";import{o as k}from"./chunk-DFPET44C.js";import{D as g,ea as b,y as V}from"./chunk-3SGEAGU4.js";import"./chunk-AXJC5PD4.js";import"./chunk-KX2PR432.js";import"./chunk-PCQVD4UN.js";import"./chunk-FUKRVTQR.js";import{n as _,o as J}from"./chunk-HMHHBN2H.js";import"./chunk-LTTEKZWN.js";import"./chunk-JD7XHN2Y.js";import"./chunk-PNYIEM2I.js";import"./chunk-WAKTITOT.js";import"./chunk-DIZJ6SFW.js";import"./chunk-NGFJDF4M.js";import{h as l,i as L,j as I,k as z}from"./chunk-DQXXLIFV.js";import{n as x}from"./chunk-BKF2JYPP.js";import"./chunk-OFEKULYN.js";import"./chunk-T3Q3DASN.js";import"./chunk-PYC6L6XB.js";import"./chunk-BEQYW66E.js";import{$b as o,Ab as w,Bb as v,Eb as C,Fd as T,Gb as d,Ld as G,Rb as a,Tc as h,_ as B,ac as s,bc as u,ea as S,fd as M,kc as D,nb as r,ob as c,r as y}from"./chunk-LU6Q5ONP.js";import{k as f}from"./chunk-5VMFMKJR.js";G();L();var m=function(t){return t.DocumentType="DefaultDocumentType",t.Classification="DefaultClassification",t}(m||{});B();M();z();J();function U(t,Q){if(t&1&&(o(0,"div",4)(1,"div"),u(2,"paw-input-field",5),s(),o(3,"div"),u(4,"paw-input-field",5),s()()),t&2){let i=D(2);r(2),a("field",i.inputFields.anDefDocumentTypeQid)("model",i.defSettings)("form",i.formGroup),r(2),a("field",i.inputFields.anDefClassificationQid)("model",i.defSettings)("form",i.formGroup)}}function W(t,Q){if(t&1&&(o(0,"div",2)(1,"paw-panel",3),d(2,U,5,6,"ng-template",null,0,h),s()()),t&2){let i=D();r(),a("settings",i.panel)}}var A=(()=>{class t extends R{constructor(i,n){super(),this.api=i,this.featureService=n,this.auth={access:this.featureService.eval("Documentation.DefaultSettings.Access")},this.model={},this.defSettings={documentType:null,classificationId:null},this.pageMeta={title:"DefaultSettings"},this.mainOptionsDef={navigation:[{id:"documentation-default-settings",label:"DefaultSettings",link:".",linkParams:{queryParamsHandling:"preserve"}}]},this.mainHeaderDef={},this.inputFields={anDefDocumentTypeQid:{id:"documentType",label:"DocumentType",component:g,options:[],searchable:!0,iconMapper:e=>"far fa-file-lines",apiRequest:e=>this.api.get(l.documentationDefaultSettings.docTypesLookup(e)),valueMapper:e=>e?.value,labelMapper:e=>`${e?.value} - ${e?.label}`,onSelected:(e,$,q,N,O)=>{!e||!this.model||(this.model.documentType=e?.value??"",this.model.documentTypeDesc=e?.label??"")}},anDefClassificationQid:{id:"classificationId",label:"Classification",options:[],searchable:!0,component:g,apiRequest:e=>this.api.get(l.documentationDefaultSettings.classificationLookup(e)),valueMapper:e=>e?.type,labelMapper:e=>e?`${e.type} - ${e.typeDesc}`:"",onSelected:(e,$,q,N,O)=>{!e||!this.model||(this.model.classificationId=e?.typeDesc,this.model.classificationDesc=e?.type)}}},this.panel={id:F.PanelDefaultSettings,title:"BasicData",expanded:!0}}ngOnInit(){this.updateView()}setViewActions(){this.mainHeaderDef.viewActions=[{id:"wizard",icon:"far fa-wand-sparkles",isDisplayed:!0,onSelected:()=>{}},{id:"create-new",icon:"far fa-file",hotkey:j.New,onSelected:()=>{}}]}updateView(){return f(this,null,function*(){if(!this.auth.access.allowed)return;let i=yield this.fetchDefault(m.DocumentType);this.defSettings.documentType=i[0].textValue;let n=yield this.fetchDefault(m.Classification);this.defSettings.classificationId=n[0].textValue;let e={classificationId:n[0].textValue,classificationDesc:n[0].docType,documentType:i[0].docType,documentTypeDesc:i[0].textValue};this.model=e})}fetchDefault(i){return f(this,null,function*(){return yield y(this.api.get(l.documentationDefaultSettings.default(i)))})}static{this.\u0275fac=function(n){return new(n||t)(c(I),c(_))}}static{this.\u0275cmp=w({type:t,selectors:[["paw-default-settings"]],standalone:!1,features:[C],decls:3,vars:4,consts:[["contentTpl",""],[3,"pageMeta","optionsDef","headerDef","feature"],[1,"h-full","paw-padding-m"],[3,"settings"],[1,"paw-area-v","paw-gap-xs","paw-offset-top-xs","paw-padding-m"],[1,"paw-label-width-m",3,"field","model","form"]],template:function(n,e){n&1&&(o(0,"paw-main-view",1),d(1,W,4,1,"ng-template",null,0,h),s()),n&2&&a("pageMeta",e.pageMeta)("optionsDef",e.mainOptionsDef)("headerDef",e.mainHeaderDef)("feature",e.auth.access)},dependencies:[E,V,p],encapsulation:2})}}return t})();M();var we=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275mod=v({type:t})}static{this.\u0275inj=S({imports:[T,H,k,x.forChild([{path:"",component:A}]),b,p,P]})}}return t})();export{we as DefaultSettingsModule};
