import{a as R}from"./chunk-HBLYGZT3.js";import{a as j}from"./chunk-ON6EOOPH.js";import{a as p}from"./chunk-WWDP56DR.js";import{d as V,e as P}from"./chunk-FU5RC46E.js";import"./chunk-CITYLIQ2.js";import"./chunk-RSSSMYIM.js";import"./chunk-RYVXMKI7.js";import"./chunk-JV7HMPM7.js";import"./chunk-77EBS4NN.js";import"./chunk-CX35JBUF.js";import"./chunk-KB3WCNL5.js";import{a as H}from"./chunk-EV4NRATK.js";import"./chunk-CBK2CW43.js";import{n as E}from"./chunk-4UVTLMGZ.js";import{W as k,g as b,s as h}from"./chunk-KPTIOXNM.js";import"./chunk-PZHJ5CIW.js";import"./chunk-DNQDWJLY.js";import"./chunk-MJMWESWV.js";import"./chunk-RMQMBDCA.js";import"./chunk-4SAKVPN5.js";import"./chunk-TZ5EQW7H.js";import"./chunk-SU74KE7C.js";import{K as _,L as J,s as l,t as L,w as F,x as z}from"./chunk-7AC745CZ.js";import"./chunk-H2CU6EEU.js";import"./chunk-GK2ZGAUD.js";import"./chunk-4TDNJBFX.js";import"./chunk-NUAVJ2U7.js";import"./chunk-VSYEEAYL.js";import"./chunk-RD7SHR2D.js";import"./chunk-OEBXBRYJ.js";import{p as I}from"./chunk-QVLAHW2O.js";import"./chunk-TI6NUUOB.js";import"./chunk-B46M6TSS.js";import{$b as a,$c as D,F as g,Kb as S,Lb as w,Md as x,Ob as v,Qb as u,Qc as M,Sd as G,hc as o,ic as s,jc as d,k as f,la as B,nd as T,ra as y,sc as C,xb as r,yb as c}from"./chunk-PGS4AHIT.js";G();L();var m=function(t){return t.DocumentType="DefaultDocumentType",t.Classification="DefaultClassification",t}(m||{});B();T();z();J();var U=()=>({title:"BasicData",expanded:!0});function W(t,Q){if(t&1&&(o(0,"div",4)(1,"div"),d(2,"paw-input-field",5),s(),o(3,"div"),d(4,"paw-input-field",5),s()()),t&2){let i=C(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 X(t,Q){t&1&&(o(0,"div",2)(1,"paw-panel",3),u(2,W,5,6,"ng-template",null,0,D),s()()),t&2&&(r(),a("settings",M(1,U)))}var A=(()=>{class t extends j{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:h,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:h,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)}}}}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:R.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 g(this.api.get(l.documentationDefaultSettings.default(i)))})}static{this.\u0275fac=function(n){return new(n||t)(c(F),c(_))}}static{this.\u0275cmp=S({type:t,selectors:[["paw-default-settings"]],standalone:!1,features:[v],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),u(1,X,4,2,"ng-template",null,0,D),s()),n&2&&a("pageMeta",e.pageMeta)("optionsDef",e.mainOptionsDef)("headerDef",e.mainHeaderDef)("feature",e.auth.access)},dependencies:[V,b,p],encapsulation:2})}}return t})();T();var we=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275mod=w({type:t})}static{this.\u0275inj=y({imports:[x,P,E,I.forChild([{path:"",component:A}]),k,p,H]})}}return t})();export{we as DefaultSettingsModule};
