import{a as m}from"./chunk-VGRXCTXL.js";import"./chunk-4G57JG5N.js";import"./chunk-MJMWESWV.js";import{c as E,d as q}from"./chunk-C2WGQZZS.js";import"./chunk-4NKYXKKW.js";import"./chunk-LNWF7VZ2.js";import{e as j}from"./chunk-T6NRFYFX.js";import{g as C}from"./chunk-RQCMKSAN.js";import"./chunk-JI65IOIM.js";import{I as $,f as A,j as R,k as G,t as V}from"./chunk-57DG2VC5.js";import{h as N}from"./chunk-NMMBNW5X.js";import"./chunk-5IDV7BCW.js";import"./chunk-CVFNZXIB.js";import{g as T}from"./chunk-EU5XKS65.js";import{c as v}from"./chunk-XALE2GEX.js";import"./chunk-GJIGZB63.js";import"./chunk-TOJME4VO.js";import"./chunk-2CD72B3Z.js";import"./chunk-4TDNJBFX.js";import"./chunk-4LZAXRJQ.js";import"./chunk-XHRSSCXW.js";import"./chunk-5VDVFGVW.js";import{p as M}from"./chunk-NLMVBXFK.js";import"./chunk-BUHB7MLU.js";import"./chunk-KUS3L5XF.js";import{Ba as S,Bc as b,Ca as w,Cc as y,Eb as f,Fb as h,Fd as I,Kb as p,Vb as a,Vc as F,cc as i,dc as r,ec as g,ic as x,la as _,lc as D,nc as d,rb as n,sb as s,td as u,ud as O}from"./chunk-J476KISY.js";function z(e,l){if(e&1&&(i(0,"div"),g(1,"paw-input-field",5),r()),e&2){let t=l.$implicit,o=d();n(),a("field",t)("model",o.dataModel)("form",o.formGroup)}}function J(e,l){if(e&1&&(i(0,"div",6),g(1,"paw-action",7),r()),e&2){let t=l.$implicit;n(),a("action",t)}}var U=(()=>{class e{constructor(t){this.dialogService=t,this.formGroup=new N([]),this.fields=[{id:"text",label:"Demo",required:!0,component:R},{id:"switch",label:"Demo",component:V},{id:"textarea",label:"Demo",component:G}],this.dataModel={text:m.randomName(),switch:m.randomBoolean(),textarea:m.randomName()+`
`+m.randomFullName()+`
`+m.randomColor()},this.actions=[{id:"submit",label:"Submit",type:"mat-flat-button",formGroup:this.formGroup,onSelected:()=>{this.dialogService.open({text:"Form submitted"}),this.dialogRef.close()}}]}ngOnInit(){}ngOnDestroy(){}static{this.\u0275fac=function(o){return new(o||e)(s(C))}}static{this.\u0275cmp=f({type:e,selectors:[["paw-sb-dialog-content"]],inputs:{dialogRef:"dialogRef"},standalone:!1,decls:6,vars:2,consts:[[4,"ngFor","ngForOf"],[1,"paw-area-h"],[1,"paw-col-d"],[1,"paw-col","paw-area-h"],["class","paw-col",4,"ngFor","ngForOf"],[3,"field","model","form"],[1,"paw-col"],[3,"action"]],template:function(o,c){o&1&&(i(0,"div"),p(1,z,2,3,"div",0),i(2,"div",1),g(3,"div",2),i(4,"div",3),p(5,J,2,1,"div",4),r()()()),o&2&&(n(),a("ngForOf",c.fields),n(4),a("ngForOf",c.actions))},dependencies:[u,A,v],encapsulation:2})}}return e})();function K(e,l){if(e&1&&(i(0,"div",7)(1,"span",8),b(2),r()()),e&2){let t=d().$implicit;n(2),y(t.title)}}function L(e,l){if(e&1){let t=x();i(0,"div",2),p(1,K,3,1,"div",4),i(2,"div",5)(3,"paw-action",6),D("selected",function(){let c=S(t).$implicit,P=d(2);return w(P.onOpenDialog(c))}),r()()()}if(e&2){let t=l.$implicit,o=d(2);n(),a("ngIf",t.title),n(2),a("id",o.dialogOpenAction.id+"-"+t.id)("action",o.dialogOpenAction)}}function X(e,l){if(e&1&&(i(0,"div",2),p(1,L,4,3,"div",3),r()),e&2){let t=d();n(),a("ngForOf",t.dialogCases)}}var B=(()=>{class e{constructor(t){this.dialogService=t,this.mainHeaderDef={viewSwitch:{viewTitle:"PAW Dialog"}},this.dialogCases=[{id:"text-only",title:"Text only",onShow:()=>{this.dialogService.open({text:m.loremIpsum()})}},{id:"question",title:"Question",onShow:()=>{this.dialogService.openTyped({text:m.loremIpsum(),onConfirm:()=>{}})}},{id:"component",title:"Component",onShow:()=>{this.dialogService.open({component:U})}}],this.dialogOpenAction={id:"open-dialog",type:"mat-flat-button",label:"Open dialog"}}ngOnInit(){}ngOnDestroy(){}onOpenDialog(t){t.onShow()}static{this.\u0275fac=function(o){return new(o||e)(s(C))}}static{this.\u0275cmp=f({type:e,selectors:[["paw-sb-dialog"]],standalone:!1,decls:3,vars:1,consts:[["contentTpl",""],[3,"headerDef"],[1,""],["class","",4,"ngFor","ngForOf"],["class","paw-offset-s",4,"ngIf"],[1,"paw-offset"],[3,"selected","id","action"],[1,"paw-offset-s"],[1,"paw-text-l","paw-noselect"]],template:function(o,c){o&1&&(i(0,"paw-main-view",1),p(1,X,2,1,"ng-template",null,0,F),r()),o&2&&a("headerDef",c.mainHeaderDef)},dependencies:[u,O,E,v],encapsulation:2})}}return e})();var _e=(()=>{class e{static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275mod=h({type:e})}static{this.\u0275inj=_({imports:[I,q,$,T,j,M.forChild([{path:"",component:B}])]})}}return e})();export{_e as SbDialogModule};
