cft-builder 0.2.89 → 0.2.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-CSLhUKcu.js";
1
+ import { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-CrfuAsE4.js";
2
2
  export {
3
3
  s as BuilderItems,
4
4
  o as BuilderItemsRender,
@@ -2378,7 +2378,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2378
2378
  }
2379
2379
  }
2380
2380
  `}}),ui=b.forwardRef(function(t,e){var n=qn(),r=b.useContext(nr),i=h4.getProps(t,r),a=b.useState(i.id),s=yO(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=yO(u,2),f=d[0],h=d[1],g=b.useRef(null),v=b.useRef(null),m=i.toggleable?i.onToggle?i.collapsed:f:!1,A=l+"_header",w=l+"_content",E=h4.setMetaData({props:i,state:{id:l,collapsed:m}}),x=E.ptm,C=E.cx,S=E.isUnstyled;ci(h4.css.styles,S,{name:"panel"});var _=function(Q){i.toggleable&&(m?I(Q):F(Q),Q&&(i.onToggle&&i.onToggle({originalEvent:Q,value:!m}),Q.preventDefault()))},I=function(Q){i.onToggle||h(!1),i.onExpand&&Q&&i.onExpand(Q)},F=function(Q){i.onToggle||h(!0),i.onCollapse&&Q&&i.onCollapse(Q)};b.useImperativeHandle(e,function(){return{props:i,toggle:_,expand:I,collapse:F,getElement:function(){return g.current},getContent:function(){return v.current}}}),Pi(function(){l||c(el())});var P=function(){if(i.toggleable){var Q=l+"_label",pe=n({className:C("toggler"),onClick:_,id:Q,"aria-controls":w,"aria-expanded":!m,type:"button",role:"button","aria-label":i.header},x("toggler")),Y=n(x("togglericon")),de=m?i.expandIcon||b.createElement(A3,Y):i.collapseIcon||b.createElement(G8,Y),ee=Wn.getJSXIcon(de,Y,{props:i,collapsed:m});return b.createElement("button",pe,ee,b.createElement(tn,null))}return null},L=function(){var Q=Fe.getJSXElement(i.header,i),pe=Fe.getJSXElement(i.icons,i),Y=P(),de=n({id:A,className:C("title")},x("title")),ee=b.createElement("span",de,Q),ne=n({className:C("icons")},x("icons")),K=b.createElement("div",ne,pe,Y),R=n({className:C("header")},x("header")),fe=b.createElement("div",R,ee,K);if(i.headerTemplate){var be={className:"p-panel-header",titleClassName:"p-panel-title",iconsClassName:"p-panel-icons",togglerClassName:"p-panel-header-icon p-panel-toggler p-link",onTogglerClick:_,titleElement:ee,iconsElement:K,togglerElement:Y,element:fe,id:l+"_header",props:i,collapsed:m};return Fe.getJSXElement(i.headerTemplate,be)}else if(i.header||i.toggleable)return fe;return null},V=function(){var Q=Fe.getJSXElement(i.footer,i),pe=n({className:C("footer")},x("footer")),Y=b.createElement("div",pe,Q);if(i.footerTemplate){var de={className:C("footer"),element:Y,props:i};return Fe.getJSXElement(i.footerTemplate,de)}else if(i.footer)return Y;return null},z=function(){var Q=n({ref:v,className:C("toggleableContent"),"aria-hidden":m,role:"region",id:w,"aria-labelledby":A},x("toggleablecontent")),pe=n({className:C("content")},x("content")),Y=n({classNames:C("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},x("transition"));return b.createElement(tl,pb({nodeRef:v},Y),b.createElement("div",Q,b.createElement("div",pe,i.children)))},N=n({id:l,ref:g,style:i.style,className:ft(i.className,C("root"))},h4.getOtherProps(i),x("root")),U=L(),Z=z(),he=V();return b.createElement("div",N,U,Z,he)});ui.displayName="Panel";const Goe=t=>{var v;const{fieldState:e,setFieldState:n,pageIndex:r,formBuilderFormLayout:i,pageSettingUpdate:a}=t,s=(m,A)=>{const w=`${m.className} justify-content-start`,E=`${m.titleClassName} pl-1`;return o.jsxs("div",{className:w,children:[o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:m.togglerClassName,onClick:()=>c(A),"aria-label":"Submit"}),o.jsx("span",{className:E,children:`Rule ${A+1}`})]})},l=(m,A)=>{var E;const w=[...((E=e==null?void 0:e.conditionalTabRules)==null?void 0:E.rules)||[]];w[m].conditions=w[m].conditions.filter((x,C)=>A!==C),n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:w}}))},c=m=>{var x;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],w=A.filter((C,S)=>m!==S);n(C=>({...C,conditionalTabRules:{...C.conditionalTabRules,rules:w}}));const E=A[m];(x=E==null?void 0:E.conditions)==null||x.map(C=>{const S=i?It.findIndex(i,I=>{var F;return(I==null?void 0:I.uuid)===((F=C==null?void 0:C.tab)==null?void 0:F.uuid)}):-1,_=i[S];_&&(_.isHidden=!1,a(S,_))})};let u=[...i].filter(function(m,A){return A!==r});u.map(m=>({uuid:m==null?void 0:m.uuid,title:m==null?void 0:m.title}));const d=(m,A,w)=>{const E=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];E[A].conditions[w].option=m==null?void 0:m.value,n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:E}}))},f=(m,A,w)=>{const E=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];E[A].conditions[w].tab=m==null?void 0:m.value,n(S=>({...S,conditionalTabRules:{...S.conditionalTabRules,rules:E}}));const x=It.findIndex(i,S=>{var _;return(S==null?void 0:S.uuid)===((_=m==null?void 0:m.value)==null?void 0:_.uuid)}),C=i[x];C&&(C.isHidden=!0,a(x,C))},h=()=>{n(m=>({...m,conditionalTabRules:{...m.conditionalTabRules,rules:[...m.conditionalTabRules.rules,{conditions:[]}]}}))},g=m=>{const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];A[m].conditions=[...A[m].conditions,{option:null,tab:null}],n(w=>({...w,conditionalTabRules:{...w.conditionalTabRules,rules:[...A]}}))};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Tabs"}),i&&(i==null?void 0:i.length)>1&&((v=e==null?void 0:e.conditionalTabRules)==null?void 0:v.rules.map((m,A)=>o.jsx(ui,{className:"mb-3",header:`Rule ${A+1}`,headerTemplate:w=>s(w,A),children:o.jsxs("div",{children:[m==null?void 0:m.conditions.map((w,E)=>o.jsx("div",{className:"p-field pb-6",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-2",children:o.jsxs("label",{children:["Show tab",w.value]})}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Oa,{value:w.tab,options:u,onChange:x=>f(x,A,E),optionLabel:"title.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-3",children:"when option is selected"}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Oa,{value:w==null?void 0:w.option,options:e==null?void 0:e.options,onChange:x=>d(x,A,E),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>l(A,E),tooltipOptions:{position:"top"}})})]})},E)),o.jsx(Ft,{text:!0,size:"small",onClick:()=>g(A),icon:"pi pi-plus",className:"p-mt-4",label:"Add Condition"})]})},"conditional_tab_rule"+A))),i&&(i==null?void 0:i.length)>1&&o.jsx(Ft,{text:!0,onClick:()=>h(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"}),i&&(i==null?void 0:i.length)<2&&o.jsx("p",{className:"error",children:"Please needs to have two or more tabs to enable the conditional tabs"})]})},Woe=t=>{var x;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:a,page:s}=t,[l]=M.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=on(),d=(C,S)=>{const _=`${C.className} justify-content-start`,I=`${C.titleClassName} pl-1`;return o.jsxs("div",{className:_,children:[o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:C.togglerClassName,onClick:()=>f(S),"aria-label":"Submit"}),o.jsx("span",{className:I,children:`Rule ${S+1}`})]})},f=C=>{var F;const S=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=S[C];(F=_==null?void 0:_.conditions)==null||F.map(P=>{var z;const L=It.findIndex(i,N=>{var U;return(N==null?void 0:N.uuid)===((U=P==null?void 0:P.tab)==null?void 0:U.uuid)}),V=i?It.findIndex(i[L].children,N=>{var U;return(N==null?void 0:N.uuid)===((U=P==null?void 0:P.section)==null?void 0:U.uuid)}):-1;if(V>=0){const N=(z=i[L])==null?void 0:z.children[V];N&&(N.isHidden=!1,a(L,V,N))}});const I=S.filter((P,L)=>C!==L);n(P=>({...P,conditionalSectionRules:{...P.conditionalSectionRules,rules:I}}))},h=C=>{var I;let S=!1;const _=i?i.filter(function(F){return(F==null?void 0:F.uuid)===(C==null?void 0:C.uuid)}):[];return(_==null?void 0:_.length)>0&&((I=_[0].children)==null?void 0:I.length)>1&&(S=!0),S},g=(C,S,_)=>{const I=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];I[S].conditions[_].option=C==null?void 0:C.value,n(F=>({...F,conditionalSectionRules:{...F.conditionalSectionRules,rules:I}}))},v=(C,S)=>{var F;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],I=_[C];(F=I==null?void 0:I.conditions)==null||F.map(P=>{var N;const L=It.findIndex(i,U=>{var Z;return(U==null?void 0:U.uuid)===((Z=P==null?void 0:P.tab)==null?void 0:Z.uuid)}),V=i?It.findIndex(i[L].children,U=>{var Z;return(U==null?void 0:U.uuid)===((Z=P==null?void 0:P.section)==null?void 0:Z.uuid)}):-1,z=(N=i[L])==null?void 0:N.children[V];console.log("sectionData",z),z&&(z.isHidden=!1,console.log("sectionData",z),a(L,V,z))}),_[C].conditions=_[C].conditions.filter((P,L)=>S!==L),n(P=>({...P,conditionalSectionRules:{...P.conditionalSectionRules,rules:_}}))},m=(C,S,_)=>{var z,N;const I=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];I[S].conditions[_].section=C==null?void 0:C.value;const F=(N=(z=I[S].conditions[_])==null?void 0:z.tab)==null?void 0:N.uuid,P=It.findIndex(i,U=>(U==null?void 0:U.uuid)===F);n(U=>({...U,conditionalSectionRules:{...U.conditionalSectionRules,rules:I}}));const L=i?It.findIndex(i[P].children,U=>{var Z;return(U==null?void 0:U.uuid)===((Z=C==null?void 0:C.value)==null?void 0:Z.uuid)}):-1,V=i[P].children[L];V&&(V.isHidden=!0,a(P,L,V))},A=C=>{const S=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];S[C].conditions=[...S[C].conditions,{option:null,tab:{title:s==null?void 0:s.title,uuid:s==null?void 0:s.uuid},section:null}],n(_=>({..._,conditionalSectionRules:{..._.conditionalSectionRules,rules:S}}))},w=()=>{n(S=>({...S,conditionalSectionRules:{...S.conditionalSectionRules,rules:[...S.conditionalSectionRules.rules,{uuid:tt(),conditions:[]}]}}));const C=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...C,{fieldId:e==null?void 0:e.uuid,uuid:tt(),conditions:[]}]})},E=C=>{var _;const S=i==null?void 0:i.filter(function(I){return(I==null?void 0:I.uuid)===(C==null?void 0:C.uuid)});if(S&&(S==null?void 0:S.length)>0){const I=(_=S[0])==null?void 0:_.children.filter(function(F){return(F==null?void 0:F.uuid)!==(r==null?void 0:r.uuid)});if((I==null?void 0:I.length)>0)return I}return l};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Sections"}),(x=e==null?void 0:e.conditionalSectionRules)==null?void 0:x.rules.map((C,S)=>o.jsx(ui,{className:"mb-3",header:`Rule ${S+1}`,headerTemplate:_=>d(_,S),children:o.jsxs("div",{children:[C==null?void 0:C.conditions.map((_,I)=>{var F,P;return o.jsx("div",{className:"p-field pb-2",children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsx("label",{children:"In Tab"}),o.jsx("p",{children:(P=(F=_==null?void 0:_.tab)==null?void 0:F.title)==null?void 0:P.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",_.value]}),o.jsx(Oa,{disabled:!h(_==null?void 0:_.tab),value:_.section,options:E(_.tab),onChange:L=>m(L,S,I),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Oa,{disabled:!h(_==null?void 0:_.tab),value:_==null?void 0:_.option,options:e==null?void 0:e.options,onChange:L=>g(L,S,I),optionLabel:"optionText.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-1",children:[o.jsx("br",{}),o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>v(S,I),tooltipOptions:{position:"top"}})]}),!h(_.tab)&&o.jsx("div",{className:"col-12",children:o.jsxs("p",{className:"error",children:[" ","At least two or more sections should exist in a page"]})})]})},I)}),o.jsx("div",{children:o.jsx("div",{className:"flex",children:o.jsx(Ft,{text:!0,className:"btn-sm mt-3 ",label:"+ Add Condition",onClick:()=>A(S),size:"small"})})})]})},S)),o.jsx(Ft,{text:!0,icon:"pi pi-plus",onClick:()=>w(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},Qoe=t=>{var u;const{fieldState:e,setFieldState:n}=t,r=d=>{var g;const h=[...((g=e==null?void 0:e.inlineConditionalRules)==null?void 0:g.rules)||[]].filter((v,m)=>d!==m);n(v=>({...v,inlineConditionalRules:{...v.inlineConditionalRules,rules:h}}))},i=(d,f)=>{const h=`${d.className} justify-content-start`,g=`${d.titleClassName} pl-1`;return o.jsxs("div",{className:h,children:[o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:d.togglerClassName,onClick:()=>r(f),"aria-label":"Submit"}),o.jsx("span",{className:g,children:`Rule ${f+1}`})]})},a=(d,f,h)=>{const g=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];g[f].conditions[h].value=d==null?void 0:d.value,n(v=>({...v,inlineConditionalRules:{...v.inlineConditionalRules,rules:g}}))},s=(d,f)=>{const h=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];h[d].conditions=h[d].conditions.filter((g,v)=>f!==v),n(g=>({...g,inlineConditionalRules:{...g.inlineConditionalRules,rules:h}}))},l=d=>{const f=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];f[d].conditions=[...f[d].conditions,{value:"",children:[]}],n(h=>({...h,inlineConditionalRules:{...h.inlineConditionalRules,rules:f}}))},c=()=>{n(d=>({...d,inlineConditionalRules:{...d.inlineConditionalRules,rules:[...d.inlineConditionalRules.rules,{conditions:[]}]}}))};return o.jsxs("div",{children:[o.jsx("h4",{children:"Inline Conditions"}),(u=e==null?void 0:e.inlineConditionalRules)==null?void 0:u.rules.map((d,f)=>o.jsx(ui,{className:"mb-3",header:`Rule ${f+1}`,headerTemplate:h=>i(h,f),children:o.jsxs("div",{children:[d==null?void 0:d.conditions.map((h,g)=>o.jsx("div",{className:"p-field p-pt-2",children:o.jsxs("div",{className:"grid",children:[o.jsx("label",{className:"block",children:"Show when selected option is:"}),o.jsx("div",{className:" p-fluid col-11",children:o.jsx(Oa,{value:h.value,options:e==null?void 0:e.options,onChange:v=>a(v,f,g),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>s(f,g),tooltipOptions:{position:"top"}})})]})},"inline-rules-"+g)),o.jsx(Ft,{text:!0,onClick:()=>l(f),className:"p-mt-4",icon:"pi pi-plus",label:"Add Condition",size:"small"})]})},f)),o.jsx(Ft,{text:!0,onClick:()=>c(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"})]})},Joe=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:a}=t,{pageSettingUpdate:s,formBuilderFormLayout:l,sectionSettingUpdate:c}=on();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(Qoe,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(Goe,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:s}),o.jsx("hr",{}),o.jsx(Woe,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:a}),o.jsx("hr",{})]})})},Zoe=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=M.useState(""),[a,s]=M.useState([""]),[l,c]=M.useState(!1),[u,d]=M.useState(0),[f,h]=M.useState(!1),{updateGlobalToast:g}=Jt(),v=()=>{h(!0)},m=()=>{var U;const z=((U=e==null?void 0:e.reviewerChecklist)==null?void 0:U.length)>=0?[...e.reviewerChecklist]:[];z.push({uuid:tt(),checklist:r,action:a,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const N={...e,reviewerChecklist:z};n(Z=>({...Z,...N})),h(!1),i(""),s([""])},A=()=>{h(!1),i(""),s([""])},w=z=>{const N=[...e.reviewerChecklist];N.splice(z,1);const U={...e,reviewerChecklist:N};n(Z=>({...Z,...U}))},E=(z,N)=>{c(!0);const{checklist:U,action:Z}=z;h(!0),d(N),setTimeout(()=>{i(U),s(Z)},1e3)},x=(z,N)=>o.jsxs(o.Fragment,{children:[o.jsx(Ft,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>E(z,N==null?void 0:N.rowIndex)}),o.jsx(Ft,{text:!0,type:"button",className:"p-button-danger",icon:"pi pi-trash",onClick:()=>w(N==null?void 0:N.rowIndex)})]}),C=z=>{var N;return o.jsx(o.Fragment,{children:(N=z==null?void 0:z.action)==null?void 0:N.length})},S=z=>{const N=[...a];N.splice(z,1),s(N)},_=()=>{const z=[...e.reviewerChecklist];z[u]={checklist:r,action:a};const N={...e,reviewerChecklist:z};n(U=>({...U,...N})),h(!1),c(!1)},I=()=>o.jsx("div",{children:l?o.jsx(Ft,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{_()}}):o.jsx(Ft,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{m()}})}),F=z=>{n(N=>({...N,reviewerChecklist:z==null?void 0:z.value}))},P=z=>{navigator.clipboard.writeText(JSON.stringify(z))};function L(z){try{JSON.parse(z)}catch{return!1}return!0}const V=async()=>{var U;const z=await navigator.clipboard.readText();let N="";if(L(z)){const Z=JSON.parse(z);if((U=Z[0])!=null&&U.checklist){const he={...It.cloneDeep(e),reviewerChecklist:Z};n(te=>({...te,...he}));return}else N="Empty or Invalid Schema"}else N="Invalid Schema";g({showToast:!0,toastMessage:N,toastDetail:"",toastType:"error"})};return o.jsxs("div",{children:[o.jsx(Fs,{maximizable:!0,header:"Add Checklist",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:I(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(ks,{rows:2,cols:50,value:r,onChange:z=>{var N;i((N=z==null?void 0:z.target)==null?void 0:N.value)}}),o.jsx("h5",{children:"Actions when user selects No"}),a.map((z,N)=>o.jsxs("div",{children:[N+1,"."," ",o.jsx(ks,{value:z,onChange:U=>{var he;const Z=[...a];Z[N]=(he=U==null?void 0:U.target)==null?void 0:he.value,s(Z)},rows:2,cols:50})," ",o.jsx(Ft,{text:!0,type:"button",icon:"pi pi-trash",className:"p-button-danger",onClick:()=>S(N)}),o.jsx("br",{}),o.jsx("br",{})]},`actionIndex-${N}`)),o.jsx(Ft,{text:!0,className:" p-button-info mr-2",onClick:()=>{s([...a,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx(Ft,{text:!0,className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{v()}}),o.jsx(Ft,{text:!0,label:"Copy Schema ",onClick:()=>{P([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx(Ft,{text:!0,label:"Paste Checklist ",onClick:()=>{V()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(Ks,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:F,scrollable:!0,children:[o.jsx(dr,{rowReorder:!0,style:{width:"3em"}}),o.jsx(dr,{field:"checklist",header:"Checklist"}),o.jsx(dr,{field:"actions",header:"Actions",body:z=>C(z)}),o.jsx(dr,{header:"",body:(z,N)=>x(z,N)})]})})]})},ele=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{inputId:"isFieldAnFilterOption",checked:(n==null?void 0:n.isFieldAnFilterOption)||!1,onChange:r=>e("isFieldAnFilterOption",r.checked)}),o.jsx("label",{htmlFor:"isFieldAnFilterOption",children:"Is Field an filter option to filter Data"}),"     ",o.jsx(sn,{target:".isFieldAnFilterOption",content:"Make the field a filter for sorting data"}),o.jsx("i",{className:"isFieldAnFilterOption pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{inputId:"isSortable",checked:(n==null?void 0:n.isSortable)||!1,onChange:r=>e("isSortable",r.checked)}),o.jsx("label",{htmlFor:"isSortable",children:"Enable Sortable"}),"     ",o.jsx(sn,{target:".isSortable",content:"Make the field as column sortable"}),o.jsx("i",{className:"isSortable pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{inputId:"isFilterable",checked:(n==null?void 0:n.isFilterable)||!1,onChange:r=>e("isFilterable",r.checked)}),o.jsx("label",{htmlFor:"isFilterable",children:"Enable Filter"}),"     ",o.jsx(sn,{target:".isFilterable",content:"Filter the column data"}),o.jsx("i",{className:"isFilterable pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{inputId:"resizableColumns",checked:n==null?void 0:n.resizableColumns,onChange:r=>e("resizableColumns",r.checked)}),o.jsx("label",{htmlFor:"resizableColumns",children:"Enable Resizable Columns"}),"     ",o.jsx(sn,{target:".resizableColumns",content:"Column width can be increase or decreased by dragging"}),o.jsx("i",{className:"resizableColumns pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{inputId:"reorderableColumns",checked:n==null?void 0:n.reorderableColumns,onChange:r=>e("reorderableColumns",r.checked)}),o.jsx("label",{htmlFor:"reorderableColumns",children:"Enable Reorderable Columns"}),"     ",o.jsx(sn,{target:".reorderableColumns",content:"Column can ordered to show as first or last"}),o.jsx("i",{className:"reorderableColumns pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{inputId:"colToggle",checked:(n==null?void 0:n.colToggle)||!1,onChange:r=>e("colToggle",r.checked)}),o.jsx("label",{htmlFor:"colToggle",children:"Enable Column Toggle"}),"     ",o.jsx(sn,{target:".colToggle",content:"Column can be shown and hide by settings by user"}),o.jsx("i",{className:"colToggle pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{inputId:"freezeColumn",checked:(n==null?void 0:n.freezeColumn)||!1,onChange:r=>e("freezeColumn",r.checked)}),o.jsx("label",{htmlFor:"freezeColumn",children:"Enable Freeze Columns"}),"     ",o.jsx(sn,{target:".freezeColumn",content:"Column can sticky so the important can be in view all the time"}),o.jsx("i",{className:"freezeColumn pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]})]})},tle=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=on(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:tt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},a=f=>{n(h=>({...h,fieldType:{...h==null?void 0:h.fieldType,type:f}}))},s=(f,h)=>{n(g=>({...g,[f]:h}))},l=[{label:"Employee",api:"/employees/list",availableId:["user_id","employee_id"],optionValue:"employee_id",optionLabel:"first_name"},{label:"Departments",api:"/department/",availableId:["department_id"],optionValue:"department_id",optionLabel:"department_name"}];return o.jsxs("div",{className:"p-fluid",children:[o.jsx("h4",{children:"Render Type"}),o.jsxs("div",{className:"flex flex-wrap gap-3 my-2",children:[o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(aa,{inputId:"renderType1",name:"renderType",value:"radio",onChange:f=>{a(f==null?void 0:f.value)},checked:((c=e==null?void 0:e.fieldType)==null?void 0:c.type)==="radio"}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:"Radio"})]}),o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(aa,{inputId:"renderType2",name:"renderType",value:"dropdown",onChange:f=>{a(f==null?void 0:f.value)},checked:((u=e==null?void 0:e.fieldType)==null?void 0:u.type)==="dropdown"}),o.jsx("label",{htmlFor:"ingredient2",className:"ml-2",children:"Dropdown"})]})]}),o.jsx("label",{htmlFor:"",className:"pb-2",children:"Data Source"}),o.jsxs("div",{className:"flex flex-wrap gap-3 mt-2",children:[o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(aa,{inputId:"dataSourceType1",name:"dataSourceType",value:"custom",onChange:f=>{s("dataSourceType",f==null?void 0:f.value)},checked:(e==null?void 0:e.dataSourceType)==="custom"}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:"Custom"})]}),o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(aa,{inputId:"dataSourceType2",name:"dataSourceType",value:"database",onChange:f=>{s("dataSourceType",f==null?void 0:f.value)},checked:(e==null?void 0:e.dataSourceType)==="database"}),o.jsx("label",{htmlFor:"ingredient2",className:"ml-2",children:"Database"})]})]}),(e==null?void 0:e.dataSourceType)==="database"&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{children:"Select Data Source"}),o.jsx("div",{children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-6",children:[o.jsx("div",{className:"py-2",children:o.jsx("label",{children:"Datasources"})}),o.jsx(Oa,{value:e==null?void 0:e.dataSource,onChange:f=>{var h;s("optionLabel",(h=f.value)==null?void 0:h.optionLabel),s("dataSource",f.value)},options:l,placeholder:"Select a Data Source",className:"w-full "})]}),o.jsxs("div",{className:"col-6",children:[o.jsx("div",{className:"py-2",children:o.jsx("label",{htmlFor:"",className:"py-2",children:"Select Datasource Id"})}),o.jsx(Oa,{value:e==null?void 0:e.optionValue,onChange:f=>s("optionValue",f.value),options:(d=e==null?void 0:e.dataSource)==null?void 0:d.availableId,placeholder:"Source Id",className:"w-full "})]})]})})]}),(e==null?void 0:e.dataSourceType)==="custom"&&o.jsx(o.Fragment,{children:(e==null?void 0:e.options)!==void 0&&e.componentType!=="grid-component"&&e.componentType!=="matrix-dropdown"&&e.componentType!=="table"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"scroll-height-300 pt-5",children:o.jsx(fo,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(uo,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(vO,{enableCopyPaste:!0,isCustomValue:!0,fieldState:e,setFieldState:n,language:f})},h)):""})}),o.jsx(Ft,{text:!0,className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>i(),"aria-label":"Add"})]})})]})},nle=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t,{userSelectedLanguage:s}=on(),l=[{type:"radio",label:"Radio"},{type:"text",label:"Input Text"},{type:"text-area",label:"Text Area"},{type:"date",label:"Date Field"}],c=(f,h)=>{var g;return o.jsxs("div",{onClick:f.onClick,className:f.className,children:[o.jsx("span",{children:f.titleElement}),e.children&&((g=e.children)==null?void 0:g.length)>1&&o.jsx(Ft,{text:!0,icon:"pi pi-trash",size:"small",onClick:()=>{console.log("field",h==null?void 0:h.uuid),a(h==null?void 0:h.uuid)},"aria-label":"Filter"})]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(Br,{inputId:"showConditionalFields",onChange:f=>{n(e==null?void 0:e.uuid,f.checked,{enableConditionalField:f.checked})},checked:e==null?void 0:e.enableConditionalField}),o.jsx("label",{htmlFor:"showConditionalFields",children:"Enable Conditional Field"})]}),(e==null?void 0:e.enableConditionalField)===!0&&o.jsxs(o.Fragment,{children:[o.jsx(Ft,{text:!0,label:"Add Field",onClick:()=>{i(e==null?void 0:e.uuid)}}),o.jsx(Za,{children:((u=e.children)==null?void 0:u.length)&&((d=e.children)==null?void 0:d.map((f,h)=>{var g,v;return o.jsx(fr,{header:(g=f.label)==null?void 0:g[s==null?void 0:s.type],headerTemplate:m=>c(m,f),children:o.jsxs("div",{className:"card",children:[o.jsx("p",{children:"Choose Field Type"}),o.jsx("div",{className:"flex mb-3",children:(l==null?void 0:l.length)&&(l==null?void 0:l.map(m=>o.jsxs("div",{className:"mr-3",children:[o.jsx(aa,{inputId:"ingredient1",name:"fieldType",value:m==null?void 0:m.type,onChange:()=>r(f==null?void 0:f.uuid,{type:m==null?void 0:m.type}),checked:(f==null?void 0:f.type)===(m==null?void 0:m.type)}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:m==null?void 0:m.label})]},`field_type_${f==null?void 0:f.uuid}`)))}),o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(Br,{inputId:"isRequired",onChange:m=>{r(f==null?void 0:f.uuid,{attributes:{required:m.checked}})},checked:(v=f==null?void 0:f.attributes)==null?void 0:v.required}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Is Required"," "]})]}),o.jsxs(Za,{children:[o.jsx(fr,{header:"Text",children:o.jsx(ui,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(hN,{language:s,fieldState:f,onHandleChange:(m,A,w)=>{r(f==null?void 0:f.uuid,{[m]:{[A==null?void 0:A.type]:w}})}})})})}),(f==null?void 0:f.type)==="radio"&&o.jsx(fr,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(gb,{option:e,fieldState:f,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})})})]})]})},`field-tab-${h}-${f==null?void 0:f.uuid}-${e==null?void 0:e.uuid}`)}))})]})]})},gb=t=>{var s,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t;return o.jsx(o.Fragment,{children:o.jsx(Za,{children:((s=e==null?void 0:e.options)==null?void 0:s.length)&&((l=e==null?void 0:e.options)==null?void 0:l.map((c,u)=>o.jsx(fr,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(nle,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})},`hirarchey-option-${u}`)))})})};var AO={},rle=Di&&Di.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),p4=Di&&Di.__assign||function(){return p4=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},p4.apply(this,arguments)},ile=Di&&Di.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),ale=Di&&Di.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wO=Di&&Di.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ile(e,t,n);return ale(e,t),e},sle=Di&&Di.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},ole=Di&&Di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(AO,"__esModule",{value:!0});var mb=wO(M),lle=ole(G_),hd=wO(ua);function SO(t){return t&&t.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function cle(t){var e=document.createTextNode("");t.appendChild(e);var n=document.activeElement===t;if(e!==null&&e.nodeValue!==null&&n){var r=window.getSelection();if(r!==null){var i=document.createRange();i.setStart(e,e.nodeValue.length),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}t instanceof HTMLElement&&t.focus()}}var ule=function(t){rle(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.lastHtml=n.props.html,n.el=typeof n.props.innerRef=="function"?{current:null}:mb.createRef(),n.getEl=function(){return(n.props.innerRef&&typeof n.props.innerRef!="function"?n.props.innerRef:n.el).current},n.emitChange=function(r){var i=n.getEl();if(i){var a=i.innerHTML;if(n.props.onChange&&a!==n.lastHtml){var s=Object.assign({},r,{target:{value:a}});n.props.onChange(s)}n.lastHtml=a}},n}return e.prototype.render=function(){var n=this,r=this.props,i=r.tagName,a=r.html,s=r.innerRef,l=sle(r,["tagName","html","innerRef"]);return mb.createElement(i||"div",p4(p4({},l),{ref:typeof s=="function"?function(c){s(c),n.el.current=c}:s||this.el,onInput:this.emitChange,onBlur:this.props.onBlur||this.emitChange,onKeyUp:this.props.onKeyUp||this.emitChange,onKeyDown:this.props.onKeyDown||this.emitChange,contentEditable:!this.props.disabled,dangerouslySetInnerHTML:{__html:a}}),this.props.children)},e.prototype.shouldComponentUpdate=function(n){var r=this.props,i=this.getEl();return!i||SO(n.html)!==SO(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,lle.default)(r.style,n.style)},e.prototype.componentDidUpdate=function(){var n=this.getEl();n&&(this.props.html!==n.innerHTML&&(n.innerHTML=this.props.html),this.lastHtml=this.props.html,cle(n))},e.propTypes={html:hd.string.isRequired,onChange:hd.func,disabled:hd.bool,tagName:hd.string,className:hd.string,style:hd.object,innerRef:hd.oneOfType([hd.object,hd.func])},e}(mb.Component),g4=AO.default=ule;const dle=t=>{var w;const e=M.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,path:c}=t,[u,d]=M.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=on(),m=(E,x,C)=>{d(S=>({...S,[E]:{...S[E],[x==null?void 0:x.type]:C}}))};M.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const E=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(E[ma],E[va],E[xa],E[Ca],E[Ta],E[Na],E[Zo],E[Fo],u):(E==null?void 0:E.length)>Na&&(E==null?void 0:E.length)===tc+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(E[ma],E[va],E[xa],E[Ca],E[Ta],E[5],E[6],E[7],u):h(i,a,s,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(g4,{style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:(w=n==null?void 0:n.label)==null?void 0:w[f==null?void 0:f.type],disabled:!1,onChange:E=>{var x;m("label",f,(x=E==null?void 0:E.target)==null?void 0:x.value)},tagName:"article"})})},da=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=on();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(D7,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},vb=t=>{var d,f,h,g,v,m,A,w,E,x,C,S,_,I;const{field:e,update:n,value:r,isFirst:i,isDisabled:a}=t,{isPreview:s}=Jt(),{userSelectedLanguage:l}=on(),[c,u]=M.useState(0);return M.useEffect(()=>{const F=Zt.addListener("onSubmitUserForm",()=>{var L;(L=e==null?void 0:e.attributes)!=null&&L.required?r!=null&&r[e.uuid]?e.isValid=1:e.isValid=0:e.isValid=1}),P=Zt.addListener("OnInvalidFieldCatch",L=>{(e==null?void 0:e.uuid)===(L==null?void 0:L.fieldId)?u(1):u(0)});return()=>{F.remove(),P.remove()}}),o.jsxs("div",{className:"ml-3 p-2",children:[(e==null?void 0:e.type)==="radio"&&o.jsxs(o.Fragment,{children:[o.jsxs("h5",{children:[" ",i===!0&&o.jsx(da,{...t}),((d=e==null?void 0:e.attributes)==null?void 0:d.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",s?o.jsx(o.Fragment,{children:(f=e==null?void 0:e.label)==null?void 0:f[l==null?void 0:l.type]}):o.jsx(dle,{...t})]}),((h=e==null?void 0:e.options)==null?void 0:h.length)&&((g=e==null?void 0:e.options)==null?void 0:g.map(F=>{var P,L;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(aa,{inputId:F.uuid,name:e==null?void 0:e.uuid,value:F.uuid,onChange:V=>n(e==null?void 0:e.uuid,V==null?void 0:V.value),checked:(r==null?void 0:r[e.uuid])===F.uuid,disabled:a}),o.jsx("label",{htmlFor:F.uuid,className:"ml-2",children:F.label})]}),(F==null?void 0:F.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(F==null?void 0:F.uuid)&&(F==null?void 0:F.children)&&((P=F==null?void 0:F.children)==null?void 0:P.length)>0&&((L=F==null?void 0:F.children)==null?void 0:L.map(()=>o.jsx(vb,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${F.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)==="text"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(vn,{className:"mt-2",onChange:F=>{var P;return n(e==null?void 0:e.uuid,(P=F==null?void 0:F.target)==null?void 0:P.value)},value:r==null?void 0:r.uuid,placeholder:(m=e==null?void 0:e.placeholder)==null?void 0:m[l==null?void 0:l.type]})]})}),(e==null?void 0:e.type)==="date"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((A=e==null?void 0:e.attributes)==null?void 0:A.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(If,{className:"mt-2",onChange:F=>{var P;return n(e==null?void 0:e.uuid,(P=F==null?void 0:F.target)==null?void 0:P.value)},value:r==null?void 0:r.uuid,placeholder:(w=e==null?void 0:e.placeholder)==null?void 0:w[l==null?void 0:l.type]})]})}),(e==null?void 0:e.type)==="text-area"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((E=e==null?void 0:e.attributes)==null?void 0:E.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(ks,{className:"mt-2",onChange:F=>{var P;return n(e==null?void 0:e.uuid,(P=F==null?void 0:F.target)==null?void 0:P.value)},value:r==null?void 0:r.uuid,placeholder:(x=e==null?void 0:e.placeholder)==null?void 0:x[l==null?void 0:l.type]})]})}),o.jsx("div",{children:((C=e==null?void 0:e.helperText)==null?void 0:C[l==null?void 0:l.type])!==""&&o.jsx("small",{children:(S=e==null?void 0:e.helperText)==null?void 0:S[l==null?void 0:l.type]})}),o.jsx("div",{children:((_=e==null?void 0:e.attributes)==null?void 0:_.required)&&o.jsx("small",{className:"error",children:c===1&&!(r!=null&&r[e.uuid])?(I=e==null?void 0:e.validationMesssage)==null?void 0:I.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},fle=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=M.useState({});return o.jsx("div",{children:o.jsx(vb,{schema:e,field:e,update:(i,a)=>{const s={...n};s[i]=a,r(s)},value:n,sectionIndex:0,fieldIndex:0,pageIndex:0,rowIndex:0,columnIndex:0,path:""})})},bb={showHeaderText:!1,showHelperText:!1,showToolTip:!1,showLabel:!0,label:{english:"Field label"},abbreviationLabel:{english:""},helperText:{english:"Helper Text"},guidelines:{english:""},headerText:{english:"Header Text"},textTable:{english:""},toolTip:{english:""},validationMesssage:{english:"This field is required"},placeholder:{english:""},enableConditionalField:!0},hle={uuid:tt(),...bb,type:"radio",value:null,options:[{uuid:tt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:tt(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:tt(),...bb,options:(tt(),{uuid:tt(),...bb,options:(tt(),tt())},tt())});const ple=t=>{const{fieldState:e,setFieldState:n}=t,r=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.uuid===f?{...v,...h}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.type==="radio"?{...A,options:r(f,h,(A==null?void 0:A.options)||[])}:{...A})]:[]}}),i=(f,h,g)=>{const v=r(f,g,e.options);n(m=>({...m,options:v}))},a=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.uuid===f?{...A,...h}:{...A,options:a(f,h,A==null?void 0:A.options)})]:[]}}),s=(f,h)=>{const g=a(f,h,e.options);n(v=>({...v,options:g}))},l=(f,h)=>h==null?void 0:h.map(g=>{var v;return{...g,children:g!=null&&g.children&&((v=g==null?void 0:g.children)==null?void 0:v.length)>0?[...g.children.filter(m=>{if(m.uuid!==f)return{...m,options:l(f,m==null?void 0:m.options)}})]:[]}}),c=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.children&&v.uuid===f?{...v,children:[...v.children,h]}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>({...A,options:c(f,h,A==null?void 0:A.options)}))]:[]}}),u=f=>{const h=c(f,{...hle,isValid:0,uuid:tt(),options:[{uuid:tt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:tt(),label:"No",value:null,enableConditionalField:!0,children:[]}],isPostField:!1,showAlphabetList:!1,showButtonLayout:!1,answerOptions:[],isExternalSource:!1,underLined:!1,noOfMultpleAnswer:void 0,isAllowMultipleAnswer:!1,isIcon:!1,isTodayBtn:!1,resizableColumns:!1,isFilterable:!1,freezeColumn:!1,colToggle:!1,isFieldAnFilterOption:!1,isSortable:!1,reorderableColumns:!1,timeLimit:0,score:0,subject_id:0,course_category_id:0,TextEditorProps:!1,fieldData:void 0},e.options);n(g=>({...g,options:h}))},d=f=>{const h=l(f,e.options);n(g=>({...g,options:h}))};return o.jsx("div",{children:o.jsx("div",{className:" px-4",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-6 scroll-height-200",children:(e==null?void 0:e.isHierarchalCondionalTabEnabled)===!0&&o.jsx(gb,{fieldState:e,updateCondtionOption:i,updateChildrenField:s,addChildrenField:u,removeChildrenField:d})}),o.jsxs("div",{className:"col-6 p-3 scroll-height-200",children:[o.jsx("h4",{className:"flex justify-content-center align-items-center",children:"Preview"}),o.jsx(fle,{hirarechicalRadioSchemaState:e})]})]})})})},Wi=t=>{var ee,ne;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:a,formBuilderFormLayout:s,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=on(),{renderType:u}=Jt(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:v,rowIndex:m,columnIndex:A,fieldIndex:w,path:E,row:x}=t,{updateGlobalToast:C}=Jt(),[S,_]=M.useState(f),I=E.split("-"),F=()=>{const K=E.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(K[ma],K[va],K[xa],K[Ca],K[Ta],K[Na],K[Zo],K[Fo],S):(K==null?void 0:K.length)>Na&&(K==null?void 0:K.length)===tc+1&&(S!=null&&S.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(K[ma],K[va],K[xa],K[Ca],K[Ta],K[5],K[6],K[7],S):(n(g,v,m,A,w,S),setTimeout(()=>{Zt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Zt.emit("onUpdateField",{})},1e3)),C({showToast:!0,toastMessage:"Updated",toastDetail:"Field Updated",toastType:"success"})},P=(K,R,fe)=>{_(be=>({...be,[K]:{...be[K],[R==null?void 0:R.type]:fe}}))},L=(K,R)=>{_(fe=>({...fe,attributes:{...fe.attributes,[K]:R}}))},V=(K,R)=>{_(fe=>({...fe,[K]:R}))},z=(K,R)=>{_(fe=>({...fe,inlineConditional:{...fe.inlineConditional,[K]:R}}))},N=()=>{},U=()=>{_(K=>({...K,data:[...K.data,{uuid:tt(),dataKey:"",value:""}]}))},Z=()=>{_(K=>Object.assign({},K,{options:[...K.options,{uuid:tt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},he=()=>{},te=()=>{},Q=()=>{},pe=()=>{},Y=K=>{var Te;const R=[...(S==null?void 0:S.conditionalTabRules.rules)||[]],fe=R.filter((ye,Ae)=>K!==Ae);_(ye=>({...ye,conditionalTabRules:{...ye.conditionalTabRules,rules:fe}}));const be=R[K];(Te=be==null?void 0:be.conditions)==null||Te.map(ye=>{const Ae=It.findIndex(s,q=>{var ie;return(q==null?void 0:q.uuid)===((ie=ye==null?void 0:ye.tab)==null?void 0:ie.uuid)}),re=s[Ae];re&&(re.isHidden=!1,a(Ae,re))})},de=(K,R)=>{const fe=[...(S==null?void 0:S.conditionalTabRules.rules)||[]];fe[K].conditions=fe[K].conditions.filter((be,Te)=>R!==Te),_(be=>({...be,conditionalTabRules:{...be.conditionalTabRules,rules:fe}}))};return o.jsx(o.Fragment,{children:o.jsxs(Vo,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[(ee=f==null?void 0:f.label)==null?void 0:ee.english," "]})]}),!l&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx(Ft,{className:"mt-3",label:"Update",onClick:()=>F(),"aria-label":"Update"})})]}),o.jsx("div",{className:" mt-4",children:o.jsxs(Za,{children:[o.jsx(fr,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(fo,{activeIndex:0,children:i!=null&&i.length?i.map((K,R)=>o.jsx(uo,{tabIndex:R,header:K==null?void 0:K.language,children:o.jsx(hN,{language:K,fieldState:S,onHandleChange:P,...t})},R)):""})})}),(S==null?void 0:S.isValidationTabEnabled)===!0&&o.jsx(fr,{header:"Validation",children:o.jsx(Dre,{fieldState:S,onHandleChangeLayoutSettings:V,onHandleChangeAttributesSetttings:L,...t})}),o.jsx(fr,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Nre,{fieldState:S,onHandleChangeLayoutSettings:V,onHandleChangeAttributesSetttings:L})})}),(S==null?void 0:S.isLayoutTabEnabled)===!0&&o.jsx(fr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Fre,{fieldState:S,onHandleChangeLayoutSettings:V})})}),(S==null?void 0:S.isDynamicListingTabEnabled)===!0&&o.jsx(fr,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(tle,{fieldState:S,setFieldState:_})})}),(S==null?void 0:S.options)!==void 0&&(S==null?void 0:S.data)&&o.jsx(fr,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(kre,{onHandleChangeLayoutSettings:V,fieldState:S,setFieldState:_}),o.jsx(Ft,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>U(),"aria-label":"Add"})]})}),o.jsx(fr,{header:"Table view options",children:o.jsx(ele,{fieldState:S,onHandleChangeLayoutSettings:V})}),(S==null?void 0:S.componentType)!=="radio-hierarchal"&&(S==null?void 0:S.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(fr,{header:"Options",children:[(S==null?void 0:S.componentType)!=="radio-hierarchal"&&o.jsx("div",{className:"flex justify-content-end",children:o.jsx(Ft,{className:"mr-3 mb-2",label:"Option",icon:"pi pi-plus",onClick:()=>Z(),"aria-label":"Option"})}),o.jsxs("div",{className:"scroll-height-200 px-4",children:[o.jsx(fo,{activeIndex:0,children:i!=null&&i.length?i.map((K,R)=>o.jsx(uo,{tabIndex:R,header:K==null?void 0:K.language,children:o.jsx(vO,{enableAbbreviationColumn:(S==null?void 0:S.componentType)!=="radio-hierarchal",enableHyperTextColumn:(S==null?void 0:S.componentType)!=="radio-hierarchal",enableAddNewColumn:(S==null?void 0:S.componentType)!=="radio-hierarchal",enableCopyPaste:(S==null?void 0:S.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:S,setFieldState:_,language:K})},R)):""}),(S==null?void 0:S.isHierarchalCondionalTabEnabled)===!0&&o.jsx(gb,{fieldState:S,onHandleChangeLayoutSettings:V,removeChildrenField:pe,addChildrenField:Q,updateChildrenField:te,updateCondtionOption:he})]})]}),(S==null?void 0:S.componentType)==="radio-hierarchal"&&(S==null?void 0:S.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(fr,{header:"Hierarchal Options",children:o.jsx(ple,{fieldState:S,setFieldState:_})}),u===j3&&(S==null?void 0:S.inlineConditionalRules)!==void 0&&!(x!=null&&x.rowIsRepeatable)&&(I==null?void 0:I.length)<Fo+1&&o.jsx(fr,{header:"Conditional",children:o.jsx(Joe,{handleRemoveConditionalTabRule:Y,handleRemoveConditionalTabRuleCondition:de,onHandleSelectInlineConditionalOption:N,onHandleChangeLayoutSettings:V,onHandleChangeInlineConditionaltSetttings:z,fieldState:S,setFieldState:_,pageIndex:g,sectionIndex:v,...t})}),!((ne=t==null?void 0:t.row)!=null&&ne.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(fr,{header:"Admin",children:o.jsx(Zoe,{fieldState:S,setFieldState:_})})]})})]})})},Ni=t=>{const[e,n]=M.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:a}=yr();M.useEffect(()=>{var h,g;if(i!==null&&e===null){let v=0;r!=null&&r.rowIsRepeatable?v=i.findIndex(m=>(m==null?void 0:m.rowId)===(r==null?void 0:r.uuid)):v=i.findIndex(m=>(m==null?void 0:m.fieldId)===(r==null?void 0:r.uuid)),n((h=i[v])!=null&&h.reviewerChecklist?(g=i[v])==null?void 0:g.reviewerChecklist:[])}return()=>{}},[r==null?void 0:r.rowIsRepeatable,r==null?void 0:r.uuid,e,i]);const s=h=>{const g=i.findIndex(m=>(m==null?void 0:m.fieldId)===(r==null?void 0:r.uuid)),v=[...i];v[g]={...v[g],reviewerChecklist:h},a(v)},l=(h,g)=>{const v=e;v[g]={...v[g],agree:h==null?void 0:h.value},n([...v]),s(v)},c=(h,g)=>{const v=e;if(g!=null&&g.checked)v[h].selectAction.push(g==null?void 0:g.value);else{const m=v[h].selectAction.findIndex(A=>A===(g==null?void 0:g.value));v[h].selectAction.splice(m,1)}n([...v]),s(v)},u=(h,g)=>{const v=e;h!=null&&h.checked?v[g]={...v[g],other:{...v[g].other,isOther:!0}}:v[g]={...v[g],other:{...v[g].other,isOther:!1}},n([...v]),s(v)},d=(h,g)=>{var m;const v=e;v[g]={...v[g],other:{...v[g].other,description:(m=h==null?void 0:h.target)==null?void 0:m.value}},n([...v]),s(v)},f=(h,g,v)=>{var A;const m=e;m[v]={...m[v],[g]:(A=h==null?void 0:h.target)==null?void 0:A.value},n([...m]),s(m)};return o.jsx(o.Fragment,{children:o.jsx("div",{className:"col-12",children:o.jsx(Za,{children:o.jsx(fr,{header:"Admin Review",children:o.jsx("div",{className:"grid",children:e!==null&&(e==null?void 0:e.length)>0&&(e==null?void 0:e.map((h,g)=>{var v,m,A,w,E;return o.jsx("div",{className:"col-4 p-fluid p-3",children:o.jsxs("div",{className:"card",children:[o.jsx("h6",{className:"mb-2",children:h==null?void 0:h.checklist}),o.jsx("br",{}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(aa,{inputId:`yes-${g}`,name:"action",value:!0,onChange:x=>{l(x,g)},checked:(h==null?void 0:h.agree)===!0}),o.jsx("label",{htmlFor:`yes-${g}`,children:"Yes"})]}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(aa,{inputId:`no-${g}`,name:"action",value:!1,onChange:x=>{l(x,g)},checked:(h==null?void 0:h.agree)===!1}),o.jsx("label",{htmlFor:`no-${g}`,children:"No"})]}),(h==null?void 0:h.agree)===!1&&o.jsxs("div",{className:"px-5 mb-3",children:[(h==null?void 0:h.action)&&Array.isArray(h.action)&&((v=h==null?void 0:h.action)==null?void 0:v.length)>0&&((m=h==null?void 0:h.action)==null?void 0:m.map((x,C)=>{var S;return o.jsxs("div",{children:[o.jsx(Br,{value:x,checked:((S=h==null?void 0:h.selectAction)==null?void 0:S.length)>0?h==null?void 0:h.selectAction.some(_=>_===x):!1,onChange:_=>{c(g,_)}})," ",x," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${g}-${C}`)})),o.jsx(Br,{checked:(A=h==null?void 0:h.other)==null?void 0:A.isOther,onChange:x=>{u(x,g)}})," Other ",o.jsx("br",{}),o.jsx("br",{}),((w=h==null?void 0:h.other)==null?void 0:w.isOther)===!0&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"If other please specify the action point"}),o.jsx("br",{}),o.jsx(ks,{className:"mt-3",value:(E=h==null?void 0:h.other)==null?void 0:E.description,onChange:x=>d(x,g)})]})]}),(h==null?void 0:h.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(ks,{className:"mt-3",value:h==null?void 0:h.reviewerFeedback,onChange:x=>f(x,"reviewerFeedback",g)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(ks,{className:"mt-3",value:h==null?void 0:h.reviewerComments,onChange:x=>f(x,"reviewerComments",g)})]})]})},`checklistIndex-${g}`)}))})})})})})},Si=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:a}=on(),{globalAlignment:s}=Jt(),l=g=>{const v=g.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",m=`${g.className} justify-content-start`,A=`${g.titleClassName} pl-1`;return o.jsxs("div",{className:m,children:[o.jsxs("button",{className:g.togglerClassName,onClick:g.onTogglerClick,children:[o.jsx("span",{className:v}),o.jsx(tn,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=yr(),[d,f]=M.useState("");M.useEffect(()=>{var g;f((g=n==null?void 0:n.label)==null?void 0:g[a==null?void 0:a.type])},[n,a==null?void 0:a.type]);const h=()=>{let g="";return e||(g=g+" field-form-builder"),u===c&&r===!0&&(g=g+" card"),g};return o.jsx(o.Fragment,{children:o.jsx("div",{dir:s,className:h(),children:u===c&&r===!0?o.jsx(ui,{headerTemplate:l,toggleable:!0,children:i}):i})})};/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */const{entries:xO,setPrototypeOf:CO,isFrozen:gle,getPrototypeOf:mle,getOwnPropertyDescriptor:vle}=Object;let{freeze:Uo,seal:sc,create:TO}=Object,{apply:yb,construct:Ab}=typeof Reflect<"u"&&Reflect;Uo||(Uo=function(e){return e}),sc||(sc=function(e){return e}),yb||(yb=function(e,n,r){return e.apply(n,r)}),Ab||(Ab=function(e,n){return new e(...n)});const m4=Dl(Array.prototype.forEach),EO=Dl(Array.prototype.pop),F2=Dl(Array.prototype.push),v4=Dl(String.prototype.toLowerCase),wb=Dl(String.prototype.toString),IO=Dl(String.prototype.match),k2=Dl(String.prototype.replace),ble=Dl(String.prototype.indexOf),yle=Dl(String.prototype.trim),qc=Dl(Object.prototype.hasOwnProperty),qo=Dl(RegExp.prototype.test),P2=Ale(TypeError);function Dl(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return yb(t,e,r)}}function Ale(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ab(t,n)}}function pi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v4;CO&&CO(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=n(i);a!==i&&(gle(e)||(e[r]=a),i=a)}t[i]=!0}return t}function wle(t){for(let e=0;e<t.length;e++)qc(t,e)||(t[e]=null);return t}function b1(t){const e=TO(null);for(const[n,r]of xO(t))qc(t,n)&&(Array.isArray(r)?e[n]=wle(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=b1(r):e[n]=r);return e}function M2(t,e){for(;t!==null;){const r=vle(t,e);if(r){if(r.get)return Dl(r.get);if(typeof r.value=="function")return Dl(r.value)}t=mle(t)}function n(){return null}return n}const _O=Uo(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Sb=Uo(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xb=Uo(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Sle=Uo(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Cb=Uo(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),xle=Uo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),DO=Uo(["#text"]),NO=Uo(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Tb=Uo(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),OO=Uo(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),b4=Uo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Cle=sc(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Tle=sc(/<%[\w\W]*|[\w\W]*%>/gm),Ele=sc(/\$\{[\w\W]*}/gm),Ile=sc(/^data-[\-\w.\u00B7-\uFFFF]+$/),_le=sc(/^aria-[\-\w]+$/),FO=sc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dle=sc(/^(?:\w+script|data):/i),Nle=sc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kO=sc(/^html$/i),Ole=sc(/^[a-z][.\w]*(-[.\w]+)+$/i);var PO=Object.freeze({__proto__:null,ARIA_ATTR:_le,ATTR_WHITESPACE:Nle,CUSTOM_ELEMENT:Ole,DATA_ATTR:Ile,DOCTYPE_NAME:kO,ERB_EXPR:Tle,IS_ALLOWED_URI:FO,IS_SCRIPT_OR_DATA:Dle,MUSTACHE_EXPR:Cle,TMPLIT_EXPR:Ele});const L2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Fle=function(){return typeof window>"u"?null:window},kle=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},MO=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function LO(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fle();const e=ot=>LO(ot);if(e.version="3.2.3",e.removed=[],!t||!t.document||t.document.nodeType!==L2.document)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:g}=t,v=c.prototype,m=M2(v,"cloneNode"),A=M2(v,"remove"),w=M2(v,"nextSibling"),E=M2(v,"childNodes"),x=M2(v,"parentNode");if(typeof s=="function"){const ot=n.createElement("template");ot.content&&ot.content.ownerDocument&&(n=ot.content.ownerDocument)}let C,S="";const{implementation:_,createNodeIterator:I,createDocumentFragment:F,getElementsByTagName:P}=n,{importNode:L}=r;let V=MO();e.isSupported=typeof xO=="function"&&typeof x=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:N,TMPLIT_EXPR:U,DATA_ATTR:Z,ARIA_ATTR:he,IS_SCRIPT_OR_DATA:te,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:pe}=PO;let{IS_ALLOWED_URI:Y}=PO,de=null;const ee=pi({},[..._O,...Sb,...xb,...Cb,...DO]);let ne=null;const K=pi({},[...NO,...Tb,...OO,...b4]);let R=Object.seal(TO(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,be=null,Te=!0,ye=!0,Ae=!1,re=!0,q=!1,ie=!0,W=!1,ue=!1,Ie=!1,Ee=!1,ve=!1,me=!1,Se=!0,De=!1;const $="user-content-";let oe=!0,ge=!1,ce={},le=null;const se=pi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Oe=null;const Ne=pi({},["audio","video","img","source","image","track"]);let Ke=null;const ut=pi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",ht="http://www.w3.org/2000/svg",kt="http://www.w3.org/1999/xhtml";let wn=kt,Ut=!1,Nt=null;const $e=pi({},[pt,ht,kt],wb);let yt=pi({},["mi","mo","mn","ms","mtext"]),jt=pi({},["annotation-xml"]);const un=pi({},["title","style","font","a","script"]);let pn=null;const En=["application/xhtml+xml","text/html"],Nn="text/html";let _n=null,Mt=null;const Xe=n.createElement("form"),et=function(Ve){return Ve instanceof RegExp||Ve instanceof Function},dt=function(){let Ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Mt&&Mt===Ve)){if((!Ve||typeof Ve!="object")&&(Ve={}),Ve=b1(Ve),pn=En.indexOf(Ve.PARSER_MEDIA_TYPE)===-1?Nn:Ve.PARSER_MEDIA_TYPE,_n=pn==="application/xhtml+xml"?wb:v4,de=qc(Ve,"ALLOWED_TAGS")?pi({},Ve.ALLOWED_TAGS,_n):ee,ne=qc(Ve,"ALLOWED_ATTR")?pi({},Ve.ALLOWED_ATTR,_n):K,Nt=qc(Ve,"ALLOWED_NAMESPACES")?pi({},Ve.ALLOWED_NAMESPACES,wb):$e,Ke=qc(Ve,"ADD_URI_SAFE_ATTR")?pi(b1(ut),Ve.ADD_URI_SAFE_ATTR,_n):ut,Oe=qc(Ve,"ADD_DATA_URI_TAGS")?pi(b1(Ne),Ve.ADD_DATA_URI_TAGS,_n):Ne,le=qc(Ve,"FORBID_CONTENTS")?pi({},Ve.FORBID_CONTENTS,_n):se,fe=qc(Ve,"FORBID_TAGS")?pi({},Ve.FORBID_TAGS,_n):{},be=qc(Ve,"FORBID_ATTR")?pi({},Ve.FORBID_ATTR,_n):{},ce=qc(Ve,"USE_PROFILES")?Ve.USE_PROFILES:!1,Te=Ve.ALLOW_ARIA_ATTR!==!1,ye=Ve.ALLOW_DATA_ATTR!==!1,Ae=Ve.ALLOW_UNKNOWN_PROTOCOLS||!1,re=Ve.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=Ve.SAFE_FOR_TEMPLATES||!1,ie=Ve.SAFE_FOR_XML!==!1,W=Ve.WHOLE_DOCUMENT||!1,Ee=Ve.RETURN_DOM||!1,ve=Ve.RETURN_DOM_FRAGMENT||!1,me=Ve.RETURN_TRUSTED_TYPE||!1,Ie=Ve.FORCE_BODY||!1,Se=Ve.SANITIZE_DOM!==!1,De=Ve.SANITIZE_NAMED_PROPS||!1,oe=Ve.KEEP_CONTENT!==!1,ge=Ve.IN_PLACE||!1,Y=Ve.ALLOWED_URI_REGEXP||FO,wn=Ve.NAMESPACE||kt,yt=Ve.MATHML_TEXT_INTEGRATION_POINTS||yt,jt=Ve.HTML_INTEGRATION_POINTS||jt,R=Ve.CUSTOM_ELEMENT_HANDLING||{},Ve.CUSTOM_ELEMENT_HANDLING&&et(Ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(R.tagNameCheck=Ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ve.CUSTOM_ELEMENT_HANDLING&&et(Ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(R.attributeNameCheck=Ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ve.CUSTOM_ELEMENT_HANDLING&&typeof Ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(R.allowCustomizedBuiltInElements=Ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(ye=!1),ve&&(Ee=!0),ce&&(de=pi({},DO),ne=[],ce.html===!0&&(pi(de,_O),pi(ne,NO)),ce.svg===!0&&(pi(de,Sb),pi(ne,Tb),pi(ne,b4)),ce.svgFilters===!0&&(pi(de,xb),pi(ne,Tb),pi(ne,b4)),ce.mathMl===!0&&(pi(de,Cb),pi(ne,OO),pi(ne,b4))),Ve.ADD_TAGS&&(de===ee&&(de=b1(de)),pi(de,Ve.ADD_TAGS,_n)),Ve.ADD_ATTR&&(ne===K&&(ne=b1(ne)),pi(ne,Ve.ADD_ATTR,_n)),Ve.ADD_URI_SAFE_ATTR&&pi(Ke,Ve.ADD_URI_SAFE_ATTR,_n),Ve.FORBID_CONTENTS&&(le===se&&(le=b1(le)),pi(le,Ve.FORBID_CONTENTS,_n)),oe&&(de["#text"]=!0),W&&pi(de,["html","head","body"]),de.table&&(pi(de,["tbody"]),delete fe.tbody),Ve.TRUSTED_TYPES_POLICY){if(typeof Ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw P2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw P2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=Ve.TRUSTED_TYPES_POLICY,S=C.createHTML("")}else C===void 0&&(C=kle(g,i)),C!==null&&typeof S=="string"&&(S=C.createHTML(""));Uo&&Uo(Ve),Mt=Ve}},Xt=pi({},[...Sb,...xb,...Sle]),bn=pi({},[...Cb,...xle]),On=function(Ve){let rt=x(Ve);(!rt||!rt.tagName)&&(rt={namespaceURI:wn,tagName:"template"});const Et=v4(Ve.tagName),zt=v4(rt.tagName);return Nt[Ve.namespaceURI]?Ve.namespaceURI===ht?rt.namespaceURI===kt?Et==="svg":rt.namespaceURI===pt?Et==="svg"&&(zt==="annotation-xml"||yt[zt]):!!Xt[Et]:Ve.namespaceURI===pt?rt.namespaceURI===kt?Et==="math":rt.namespaceURI===ht?Et==="math"&&jt[zt]:!!bn[Et]:Ve.namespaceURI===kt?rt.namespaceURI===ht&&!jt[zt]||rt.namespaceURI===pt&&!yt[zt]?!1:!bn[Et]&&(un[Et]||!Xt[Et]):!!(pn==="application/xhtml+xml"&&Nt[Ve.namespaceURI]):!1},Gn=function(Ve){F2(e.removed,{element:Ve});try{x(Ve).removeChild(Ve)}catch{A(Ve)}},ir=function(Ve,rt){try{F2(e.removed,{attribute:rt.getAttributeNode(Ve),from:rt})}catch{F2(e.removed,{attribute:null,from:rt})}if(rt.removeAttribute(Ve),Ve==="is")if(Ee||ve)try{Gn(rt)}catch{}else try{rt.setAttribute(Ve,"")}catch{}},Jn=function(Ve){let rt=null,Et=null;if(Ie)Ve="<remove></remove>"+Ve;else{const Ue=IO(Ve,/^[\r\n\t ]+/);Et=Ue&&Ue[0]}pn==="application/xhtml+xml"&&wn===kt&&(Ve='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ve+"</body></html>");const zt=C?C.createHTML(Ve):Ve;if(wn===kt)try{rt=new h().parseFromString(zt,pn)}catch{}if(!rt||!rt.documentElement){rt=_.createDocument(wn,"template",null);try{rt.documentElement.innerHTML=Ut?S:zt}catch{}}const bt=rt.body||rt.documentElement;return Ve&&Et&&bt.insertBefore(n.createTextNode(Et),bt.childNodes[0]||null),wn===kt?P.call(rt,W?"html":"body")[0]:W?rt.documentElement:bt},mr=function(Ve){return I.call(Ve.ownerDocument||Ve,Ve,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},gi=function(Ve){return Ve instanceof f&&(typeof Ve.nodeName!="string"||typeof Ve.textContent!="string"||typeof Ve.removeChild!="function"||!(Ve.attributes instanceof d)||typeof Ve.removeAttribute!="function"||typeof Ve.setAttribute!="function"||typeof Ve.namespaceURI!="string"||typeof Ve.insertBefore!="function"||typeof Ve.hasChildNodes!="function")},yn=function(Ve){return typeof l=="function"&&Ve instanceof l};function it(ot,Ve,rt){m4(ot,Et=>{Et.call(e,Ve,rt,Mt)})}const ct=function(Ve){let rt=null;if(it(V.beforeSanitizeElements,Ve,null),gi(Ve))return Gn(Ve),!0;const Et=_n(Ve.nodeName);if(it(V.uponSanitizeElement,Ve,{tagName:Et,allowedTags:de}),Ve.hasChildNodes()&&!yn(Ve.firstElementChild)&&qo(/<[/\w]/g,Ve.innerHTML)&&qo(/<[/\w]/g,Ve.textContent)||Ve.nodeType===L2.progressingInstruction||ie&&Ve.nodeType===L2.comment&&qo(/<[/\w]/g,Ve.data))return Gn(Ve),!0;if(!de[Et]||fe[Et]){if(!fe[Et]&&Lt(Et)&&(R.tagNameCheck instanceof RegExp&&qo(R.tagNameCheck,Et)||R.tagNameCheck instanceof Function&&R.tagNameCheck(Et)))return!1;if(oe&&!le[Et]){const zt=x(Ve)||Ve.parentNode,bt=E(Ve)||Ve.childNodes;if(bt&&zt){const Ue=bt.length;for(let Qe=Ue-1;Qe>=0;--Qe){const Dt=m(bt[Qe],!0);Dt.__removalCount=(Ve.__removalCount||0)+1,zt.insertBefore(Dt,w(Ve))}}}return Gn(Ve),!0}return Ve instanceof c&&!On(Ve)||(Et==="noscript"||Et==="noembed"||Et==="noframes")&&qo(/<\/no(script|embed|frames)/i,Ve.innerHTML)?(Gn(Ve),!0):(q&&Ve.nodeType===L2.text&&(rt=Ve.textContent,m4([z,N,U],zt=>{rt=k2(rt,zt," ")}),Ve.textContent!==rt&&(F2(e.removed,{element:Ve.cloneNode()}),Ve.textContent=rt)),it(V.afterSanitizeElements,Ve,null),!1)},At=function(Ve,rt,Et){if(Se&&(rt==="id"||rt==="name")&&(Et in n||Et in Xe))return!1;if(!(ye&&!be[rt]&&qo(Z,rt))){if(!(Te&&qo(he,rt))){if(!ne[rt]||be[rt]){if(!(Lt(Ve)&&(R.tagNameCheck instanceof RegExp&&qo(R.tagNameCheck,Ve)||R.tagNameCheck instanceof Function&&R.tagNameCheck(Ve))&&(R.attributeNameCheck instanceof RegExp&&qo(R.attributeNameCheck,rt)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(rt))||rt==="is"&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&qo(R.tagNameCheck,Et)||R.tagNameCheck instanceof Function&&R.tagNameCheck(Et))))return!1}else if(!Ke[rt]){if(!qo(Y,k2(Et,Q,""))){if(!((rt==="src"||rt==="xlink:href"||rt==="href")&&Ve!=="script"&&ble(Et,"data:")===0&&Oe[Ve])){if(!(Ae&&!qo(te,k2(Et,Q,"")))){if(Et)return!1}}}}}}return!0},Lt=function(Ve){return Ve!=="annotation-xml"&&IO(Ve,pe)},qt=function(Ve){it(V.beforeSanitizeAttributes,Ve,null);const{attributes:rt}=Ve;if(!rt||gi(Ve))return;const Et={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ne,forceKeepAttr:void 0};let zt=rt.length;for(;zt--;){const bt=rt[zt],{name:Ue,namespaceURI:Qe,value:Dt}=bt,nn=_n(Ue);let wt=Ue==="value"?Dt:yle(Dt);if(Et.attrName=nn,Et.attrValue=wt,Et.keepAttr=!0,Et.forceKeepAttr=void 0,it(V.uponSanitizeAttribute,Ve,Et),wt=Et.attrValue,De&&(nn==="id"||nn==="name")&&(ir(Ue,Ve),wt=$+wt),ie&&qo(/((--!?|])>)|<\/(style|title)/i,wt)){ir(Ue,Ve);continue}if(Et.forceKeepAttr||(ir(Ue,Ve),!Et.keepAttr))continue;if(!re&&qo(/\/>/i,wt)){ir(Ue,Ve);continue}q&&m4([z,N,U],Ze=>{wt=k2(wt,Ze," ")});const Me=_n(Ve.nodeName);if(At(Me,nn,wt)){if(C&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Qe)switch(g.getAttributeType(Me,nn)){case"TrustedHTML":{wt=C.createHTML(wt);break}case"TrustedScriptURL":{wt=C.createScriptURL(wt);break}}try{Qe?Ve.setAttributeNS(Qe,Ue,wt):Ve.setAttribute(Ue,wt),gi(Ve)?Gn(Ve):EO(e.removed)}catch{}}}it(V.afterSanitizeAttributes,Ve,null)},mt=function ot(Ve){let rt=null;const Et=mr(Ve);for(it(V.beforeSanitizeShadowDOM,Ve,null);rt=Et.nextNode();)it(V.uponSanitizeShadowNode,rt,null),ct(rt),qt(rt),rt.content instanceof a&&ot(rt.content);it(V.afterSanitizeShadowDOM,Ve,null)};return e.sanitize=function(ot){let Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=null,Et=null,zt=null,bt=null;if(Ut=!ot,Ut&&(ot="<!-->"),typeof ot!="string"&&!yn(ot))if(typeof ot.toString=="function"){if(ot=ot.toString(),typeof ot!="string")throw P2("dirty is not a string, aborting")}else throw P2("toString is not a function");if(!e.isSupported)return ot;if(ue||dt(Ve),e.removed=[],typeof ot=="string"&&(ge=!1),ge){if(ot.nodeName){const Dt=_n(ot.nodeName);if(!de[Dt]||fe[Dt])throw P2("root node is forbidden and cannot be sanitized in-place")}}else if(ot instanceof l)rt=Jn("<!---->"),Et=rt.ownerDocument.importNode(ot,!0),Et.nodeType===L2.element&&Et.nodeName==="BODY"||Et.nodeName==="HTML"?rt=Et:rt.appendChild(Et);else{if(!Ee&&!q&&!W&&ot.indexOf("<")===-1)return C&&me?C.createHTML(ot):ot;if(rt=Jn(ot),!rt)return Ee?null:me?S:""}rt&&Ie&&Gn(rt.firstChild);const Ue=mr(ge?ot:rt);for(;zt=Ue.nextNode();)ct(zt),qt(zt),zt.content instanceof a&&mt(zt.content);if(ge)return ot;if(Ee){if(ve)for(bt=F.call(rt.ownerDocument);rt.firstChild;)bt.appendChild(rt.firstChild);else bt=rt;return(ne.shadowroot||ne.shadowrootmode)&&(bt=L.call(r,bt,!0)),bt}let Qe=W?rt.outerHTML:rt.innerHTML;return W&&de["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&qo(kO,rt.ownerDocument.doctype.name)&&(Qe="<!DOCTYPE "+rt.ownerDocument.doctype.name+`>
2381
- `+Qe),q&&m4([z,N,U],Dt=>{Qe=k2(Qe,Dt," ")}),C&&me?C.createHTML(Qe):Qe},e.setConfig=function(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(ot),ue=!0},e.clearConfig=function(){Mt=null,ue=!1},e.isValidAttribute=function(ot,Ve,rt){Mt||dt({});const Et=_n(ot),zt=_n(Ve);return At(Et,zt,rt)},e.addHook=function(ot,Ve){typeof Ve=="function"&&F2(V[ot],Ve)},e.removeHook=function(ot){return EO(V[ot])},e.removeHooks=function(ot){V[ot]=[]},e.removeAllHooks=function(){V=MO()},e}var y4=LO();const sa=t=>{var E;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,path:l}=t,[c,u]=M.useState(e);M.useEffect(()=>{var x;return A((x=e==null?void 0:e.label)==null?void 0:x[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=on(),v=(x,C,S)=>{u(_=>({..._,[x]:{..._[x],[C==null?void 0:C.type]:S}}))},[m,A]=M.useState((E=e==null?void 0:e.label)==null?void 0:E[d==null?void 0:d.type]);M.useEffect(()=>(w(),()=>{}),[c]);const w=()=>{const x=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(x[ma],x[va],x[xa],x[Ca],x[Ta],x[Na],x[Zo],x[Fo],c):(x==null?void 0:x.length)>Na&&(x==null?void 0:x.length)===tc+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(x[ma],x[va],x[xa],x[Ca],x[Ta],x[5],x[6],x[7],c):f(r,i,a,s,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(g4,{style:{display:"inline-block"},className:"builder-input-label-edit",html:m,disabled:!1,onChange:x=>{var C;A(y4.sanitize((C=x==null?void 0:x.target)==null?void 0:C.value))},onBlur:x=>{var S;const C=y4.sanitize((S=x==null?void 0:x.target)==null?void 0:S.innerText);A(C),v("label",d,C)},tagName:"article"})})},y1=t=>{const{onLabel:e,offLabel:n,onIcon:r,offIcon:i,onHandleChangeSetttings:a,settingsKey:s,settingsKeyValue:l}=t;return o.jsx(o.Fragment,{children:o.jsx(w2,{checked:l,onLabel:e,onChange:c=>{a(s,c.value)},offLabel:n,onIcon:r,offIcon:i,className:"mr-1 px-1",style:{fontSize:"0.8rem"}})})},Xr=t=>{var he,te,Q,pe;const{field:e,fieldIndex:n,columnIndex:r,sectionIndex:i,rowIndex:a,pageIndex:s,type:l,path:c,handleFieldSettingsSidebar:u,showFieldIcons:d=!0,showSettingsIcon:f=!0}=t,{emitSocketData:h,renderType:g}=Jt(),v=(Y,de)=>{V(ee=>({...ee,[Y]:de}))},{fieldSettingUpdate:m,fieldSettingUpdateInlineConditional:A,cloneField:w,gridComponentFieldSettingUpdate:E,fieldSettingDeleteInlineConditional:x,gridComponentFieldDelete:C,removeField:S}=on(),{updateGlobalToast:_}=Jt(),I=Y=>{const de=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?A(de[ma],de[va],de[xa],de[Ca],de[Ta],de[Na],de[Zo],de[Fo],Y):(de==null?void 0:de.length)>Na&&(de==null?void 0:de.length)===tc+1&&(Y!=null&&Y.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?E(de[ma],de[va],de[xa],de[Ca],de[Ta],de[5],de[6],de[7],Y):m(s,i,a,r,n,Y),_({showToast:!0,toastMessage:"Updated",toastDetail:"Field Updated",toastType:"success"})},[F,P]=M.useState(!1),[L,V]=M.useState({custom_component_title:"",custom_component_description:""}),z=()=>{V(Y=>({...Y,custom_component_schema:e})),P(!0)},N=()=>{const Y=c.split("-").map(Number);l==="inline-conditional"?x(Y[ma],Y[va],Y[xa],Y[Ca],Y[Ta],Y[Na],Y[Zo],Y[Fo]):(Y==null?void 0:Y.length)>Na&&(Y==null?void 0:Y.length)===tc+1&&(e!=null&&e.componentType)&&l==="grid"?C(Y[ma],Y[va],Y[xa],Y[Ca],Y[Ta],Y[5],Y[6],Y[7]):S(s,i,a,r,n)},U=(Y,de)=>{const ee={...e,attributes:{...e.attributes,[Y]:de}};I(ee)},Z=(Y,de)=>{const ee={...e,[Y]:de};I(ee)};return o.jsx(o.Fragment,{children:o.jsxs("div",{className:`${(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"?"builder-element-quick-options mb-2 w-9 justify-content-between":"builder-element-quick-options mb-2 w-4 justify-content-center"} flex quick-setting`,children:[o.jsx(o.Fragment,{children:(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"&&d===!0&&o.jsxs("div",{className:" ",children:[o.jsx(y1,{field:e,onHandleChangeSetttings:U,settingsKey:"required",settingsKeyValue:(he=e==null?void 0:e.attributes)==null?void 0:he.required,onLabel:"Required",offLabel:"Not Required",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(te=e==null?void 0:e.attributes)==null?void 0:te.required}),o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"showToolTip",settingsKeyValue:e==null?void 0:e.showToolTip,onLabel:"Tooltip",offLabel:"Tooltip",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showToolTip}),o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"showHelperText",settingsKeyValue:e==null?void 0:e.showHelperText,onLabel:"Helper text",offLabel:"Helper text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHelperText}),o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"showHeaderText",settingsKeyValue:e==null?void 0:e.showHeaderText,onLabel:"Header text",offLabel:"Header text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHeaderText}),o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"isFluid",settingsKeyValue:e==null?void 0:e.isFluid,onLabel:"Fluid",offLabel:"Fluid",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.isFluid}),(e==null?void 0:e.componentType)=="radio"&&o.jsxs(o.Fragment,{children:[o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"showAlphabetList",settingsKeyValue:e==null?void 0:e.showAlphabetList,onLabel:"Alpha",offLabel:"Alpha",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showAlphabetList}),o.jsx(y1,{field:e,onHandleChangeSetttings:U,settingsKey:"style",settingsKeyValue:(Q=e==null?void 0:e.attributes)==null?void 0:Q.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(pe=e==null?void 0:e.attributes)==null?void 0:pe.style})]})]})}),o.jsxs("div",{className:"quick-setting",children:[f===!0&&o.jsxs("span",{className:"p-buttonset",children:[(e==null?void 0:e.componentType)!=="hr"&&o.jsx(Ft,{text:!0,size:"small",label:"Advance Settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx(Ft,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{w(e,s,i,a,r,n),h()}}),o.jsx(Ft,{text:!0,size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{N()}}),(g===j3||g===J0)&&o.jsx(Ft,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",onClick:()=>{z()}})]}),o.jsxs(Fs,{maximizable:!0,header:"Custom component save",visible:F,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx(Ft,{size:"small",text:!0,label:"Close",icon:"pi pi-times",onClick:()=>P(!1),className:"p-button-text"}),(e==null?void 0:e.componentType)!=="hidden-field"&&o.jsx(Ft,{text:!0,label:"Save",icon:"pi pi-check",onClick:()=>{P(!1)},autoFocus:!0})]})}),onHide:()=>P(!1),children:[o.jsxs("span",{className:"p-float-label",children:[o.jsx(vn,{id:"custom_component_title",name:"custom_component_title",className:"w-full",value:(L==null?void 0:L.custom_component_title)||"",onChange:Y=>{var de;return v("custom_component_title",(de=Y==null?void 0:Y.target)==null?void 0:de.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(ks,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(L==null?void 0:L.custom_component_description)||"",onChange:Y=>{var de;return v("custom_component_description",(de=Y==null?void 0:Y.target)==null?void 0:de.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},Ple=t=>{var R,fe,be,Te,ye,Ae,re,q;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isRenderView:d,isPreview:f}=Jt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=on(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:w,updateUserFormDataSubmit:E,userTaskSubmitFormData:x,TASK_PUBLISHED:C}=yr(),[S,_]=M.useState(!1),[I,F]=M.useState(!1),[P,L]=M.useState(null),[V,z]=M.useState(0),[N,U]=M.useState(!1),Z=()=>{U(!0)},he=()=>{U(!1)},te=ie=>{_(ie)},Q=()=>{_(!1)},pe=()=>{var ie,W,ue;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ie=[...a.repeatableFields],Ee=It.findIndex(Ie,function(ve){return ve.uuid===(r==null?void 0:r.uuid)});Ee>=0&&Ie[Ee].fieldData?L(Ie[Ee].fieldData):(r.isValid=0,L(null))}}else{const Ie=x,Ee=It.cloneDeep(m);if(Ie!=null&&Ie.length){for(const ve of Ie)if(ve.fieldId===t.field.uuid&&((ie=ve==null?void 0:ve.postData)!=null&&ie.length)){L((W=ve==null?void 0:ve.postData[0])==null?void 0:W.postValue),Ee[r==null?void 0:r.uuid]=(ue=ve==null?void 0:ve.postData[0])==null?void 0:ue.postValue;const me=Object.keys(Ee).length;w(me);break}}}F(!0)},Y=ie=>{var Ee;L(ie.target.value);const W=x,ue=It.cloneDeep(m);if((Ee=ie==null?void 0:ie.target)!=null&&Ee.value&&(W==null?void 0:W.length)>0)for(const ve of W)ve.fieldId===t.field.uuid&&(ue[r==null?void 0:r.uuid]=ie==null?void 0:ie.value,ve.postData[0]={postValue:ie.value});else delete ue[r==null?void 0:r.uuid];A(ue);const Ie=Object.keys(ue).length;w(Ie)};M.useEffect(()=>{I||pe();const ie=Zt.addListener("clearRepeatableFields",Ie=>{Ie===(a==null?void 0:a.uuid)&&(L(""),z(0),r.isValid=0,g(e,n,s,l,i,r))}),W=Zt.addListener("onSubmitUserForm",()=>{var Ie;(Ie=r==null?void 0:r.attributes)!=null&&Ie.required?P?r.isValid=1:r.isValid=0:r.isValid=1}),ue=Zt.addListener("OnInvalidFieldCatch",Ie=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(Ie==null?void 0:Ie.fieldId)),r.uuid===(Ie==null?void 0:Ie.fieldId)?z(1):z(0)});return()=>{W.remove(),ue.remove(),ie.remove()}});const de=(ie,W)=>{var ue;if(x){const Ie=[...x],Ee=It.findIndex(Ie,function(me){return me.rowId===(a==null?void 0:a.uuid)});let ve=(ue=x[Ee])==null?void 0:ue.repeatableFields;ve={...ve,[ie==null?void 0:ie.uuid]:W},Ie[Ee]={...Ie[Ee],repeatableFields:ve},E(Ie)}L(W),W!==null?ie.isValid=1:ie.isValid=0},ee=(ie,W)=>ie?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:ie.name,src:ie==null?void 0:ie.image,onError:ue=>ue.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:ie.name})]}):o.jsx("span",{children:W.placeholder}),ne=ie=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:ie.name,src:ie==null?void 0:ie.image,onError:W=>W.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:ie.name})]});console.log("field?.validationMesssage",r==null?void 0:r.validationMesssage);const K=o.jsxs("div",{onMouseOver:Z,onMouseOut:he,children:[!d&&!f&&N&&o.jsx(Xr,{handleFieldSettingsSidebar:te,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(r==null?void 0:r.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"field-form-builder col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(R=r==null?void 0:r.headerText)==null?void 0:R[h==null?void 0:h.type]}),(r==null?void 0:r.showLabel)&&o.jsxs("label",{htmlFor:i,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((fe=r==null?void 0:r.attributes)==null?void 0:fe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=r==null?void 0:r.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(Mi,{message:(Te=r==null?void 0:r.toolTip)==null?void 0:Te[h==null?void 0:h.type],position:"right"})})]}),o.jsx(Oa,{className:"country-select-builder-component",onFocus:()=>z(1),onChange:ie=>{a!=null&&a.rowIsRepeatable?de(r,ie.target.value):Y(ie)},options:r==null?void 0:r.countries,optionLabel:"name",value:P,placeholder:(ye=r==null?void 0:r.placeholder)==null?void 0:ye[h==null?void 0:h.type],disabled:c,valueTemplate:ee,itemTemplate:ne,filter:!0,filterBy:"name",showClear:!0}),((Ae=r==null?void 0:r.attributes)==null?void 0:Ae.required)&&o.jsx("small",{className:"error",children:V===1&&P===null?((re=r==null?void 0:r.validationMesssage)==null?void 0:re[h==null?void 0:h.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(q=r==null?void 0:r.helperText)==null?void 0:q[h==null?void 0:h.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:Q,...t},r==null?void 0:r.uuid),o.jsx(Si,{...t,fieldWrap:K})]})},Mle=t=>{var R,fe,be,Te,ye,Ae,re,q,ie,W,ue,Ie,Ee,ve,me;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:a,task_status:s,TASK_PUBLISHED:l}=yr(),{userSelectedLanguage:c,fieldSettingUpdate:u}=on(),{field:d,fieldIndex:f,sectionIndex:h,pageIndex:g,row:v,rowIndex:m,columnIndex:A,isDisabled:w}=t,{isAdmin:E,isRenderView:x,isPreview:C}=Jt(),[S,_]=M.useState(!1),[I,F]=M.useState(""),[P,L]=M.useState(null),[V,z]=M.useState(0),[N,U]=M.useState(!1),[Z,he]=M.useState(!1),te=()=>{he(!0)},Q=()=>{he(!1)},pe=()=>{var Se,De,$;if(v!=null&&v.rowIsRepeatable){if(v!=null&&v.repeatableFields){const oe=[...v.repeatableFields],ge=It.findIndex(oe,function(ce){return ce.uuid===(d==null?void 0:d.uuid)});ge>=0&&oe[ge].fieldData?F(oe[ge].fieldData):F("")}}else{const oe=a;if(oe!=null&&oe.length){for(const ge of oe)if(ge.fieldId===t.field.uuid&&((Se=ge==null?void 0:ge.postData[0])==null?void 0:Se.postValue)!==""&&((De=ge==null?void 0:ge.postData[0])!=null&&De.postValue)){F(($=ge==null?void 0:ge.postData[0])==null?void 0:$.postValue);break}}}U(!0)};M.useEffect(()=>{N||pe();const Se=Zt.addListener("clearRepeatableFields",ce=>{ce===(v==null?void 0:v.uuid)&&(F(""),z(0),d.isValid=0,u(g,h,m,A,f,d))}),De=Zt.addListener("onSubmitUserForm",()=>{var ce,le;(ce=d==null?void 0:d.attributes)!=null&&ce.required?I&&I.length&&(I==null?void 0:I.length)<((le=d==null?void 0:d.attributes)==null?void 0:le.minLength)?d.isValid=1:d.isValid=0:d.isValid=1}),$=Zt.addListener("OnInvalidFieldCatch",ce=>{d.uuid===(ce==null?void 0:ce.fieldId)?z(1):z(0)}),oe=Zt.addListener("OnGetFieldValue",ce=>{var se;const le=(se=ce==null?void 0:ce.repeatableColumn)==null?void 0:se.filter(Oe=>(Oe==null?void 0:Oe.fieldUuid)===(d==null?void 0:d.uuid));le!=null&&le.length}),ge=Zt.addListener("formFieldAdded",ce=>{P===null&&L(ce==null?void 0:ce.uuid)});return()=>{De.remove(),$.remove(),oe.remove(),Se.remove(),ge.remove()}}),M.useEffect(()=>(P!==null&&setTimeout(()=>{L(null)},1e3),()=>{}),[P]);const Y=Se=>{_(Se)},de=()=>{_(!1)},ee=Se=>{var oe,ge;F(Se.target.value);const De=a,$=It.cloneDeep(e);if(De!==null){if((oe=Se==null?void 0:Se.target)!=null&&oe.value){if($[d==null?void 0:d.uuid]=(ge=Se==null?void 0:Se.target)==null?void 0:ge.value,(De==null?void 0:De.length)>0)for(const ce of De)ce.fieldId===t.field.uuid&&(ce.postData[0]={postValue:Se.target.value})}else if(delete $[d==null?void 0:d.uuid],(De==null?void 0:De.length)>0)for(const ce of De)ce.fieldId===t.field.uuid&&(ce.postData[0]={postValue:""})}if(console.log("row?.rowIsRepeatable",v==null?void 0:v.rowIsRepeatable),!(v!=null&&v.rowIsRepeatable)){n($);const ce=Object.keys($).length;r(ce)}},ne=(Se,De)=>{var $;if(a){const oe=[...a],ge=It.findIndex(oe,function(le){return le.rowId===(v==null?void 0:v.uuid)});let ce=($=a[ge])==null?void 0:$.repeatableFields;ce={...ce,[Se==null?void 0:Se.uuid]:De},oe[ge]={...oe[ge],repeatableFields:ce},i(oe)}F(De),De!==""?Se.isValid=1:Se.isValid=0},K=o.jsxs("div",{onMouseOver:te,onMouseOut:Q,children:[!x&&!C&&Z&&o.jsx(Xr,{handleFieldSettingsSidebar:Y,...t}),o.jsxs("div",{className:`field ${C?" ":" builder-element-wrapper "} ${(d==null?void 0:d.isFluid)===!0?" p-fluid ":""} ${x?" ":" py-6 px-4 "} ${P===(d==null?void 0:d.uuid)?" new-field ":" card "} `,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:E?"col-6 ":"col-12 p-fluid",children:[(d==null?void 0:d.showHeaderText)&&o.jsx("h6",{children:(R=d==null?void 0:d.headerText)==null?void 0:R[c==null?void 0:c.type]}),(d==null?void 0:d.showLabel)&&o.jsxs("label",{htmlFor:d==null?void 0:d.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((fe=d==null?void 0:d.attributes)==null?void 0:fe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",C?o.jsx(o.Fragment,{children:(be=d==null?void 0:d.label)==null?void 0:be[c==null?void 0:c.type]}):o.jsx(sa,{...t}),(d==null?void 0:d.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(Mi,{message:(Te=d==null?void 0:d.toolTip)==null?void 0:Te[c==null?void 0:c.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(d==null?void 0:d.iconAlignment),children:[(d==null?void 0:d.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=d==null?void 0:d.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(vn,{id:d==null?void 0:d.uuid,placeholder:(re=d==null?void 0:d.placeholder)==null?void 0:re[c==null?void 0:c.type],minLength:(q=d==null?void 0:d.attributes)==null?void 0:q.minLength,maxLength:(ie=d==null?void 0:d.attributes)==null?void 0:ie.maxLength,value:I,onFocus:()=>z(1),onChange:Se=>{v!=null&&v.rowIsRepeatable?ne(d,Se.target.value):ee(Se)},className:V===1&&((W=d==null?void 0:d.attributes)!=null&&W.required)?I?"valid":"invalid":"valid'",readOnly:w})]}),o.jsx("div",{children:((ue=d==null?void 0:d.attributes)==null?void 0:ue.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:V===1&&!I?(Ie=d==null?void 0:d.validationMesssage)==null?void 0:Ie.english:""}),o.jsx("small",{className:"error",children:V===1&&I.length&&(I==null?void 0:I.length)<((Ee=d==null?void 0:d.attributes)==null?void 0:Ee.minLength)?`Mini length ${(ve=d==null?void 0:d.attributes)==null?void 0:ve.minLength}`:""})]})}),o.jsx("div",{children:(d==null?void 0:d.showHelperText)&&o.jsx("small",{children:(me=d==null?void 0:d.helperText)==null?void 0:me[c==null?void 0:c.type]})})]})]})}),E&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:de,...t}),o.jsx(Si,{...t,fieldWrap:K})]})},Lle=t=>{var i,a;const{language:e,onHandleChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink text"}),o.jsx(vn,{value:(i=r==null?void 0:r.text)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("text",e,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(vn,{value:(a=r==null?void 0:r.hrefLink)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("hrefLink",e,s.target.value)})]})]})},Ble=t=>{var r;const{onHandleChangeStyling:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{className:"mr-2",children:"Hyperlink color"}),o.jsx(l0,{value:n==null?void 0:n.color,onChange:i=>{e("color",i.value)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Font Size"}),o.jsx(vn,{type:"number",maxLength:2,placeholder:"eg 20px",value:(r=Number(n==null?void 0:n.fontSize))==null?void 0:r.toFixed(0),onChange:i=>{e("fontSize",i.target.value)}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},Vle=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=t,[u,d]=M.useState(n),{fieldSettingUpdate:f,formBuilderSchemaLanguages:h,formBuilderPublishedStatus:g}=on(),{updateGlobalToast:v}=Jt(),m=(E,x,C)=>{d(S=>({...S,[E]:{...S[E],[x==null?void 0:x.type]:C}}))},A=(E,x)=>{d(C=>({...C,[E]:x}))},w=()=>{f(i,a,s,l,c,u),v({showToast:!0,toastMessage:"Updated",toastDetail:"Html Updated",toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(Vo,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[t==null?void 0:t.typeName," settings "]})]}),!g&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx(Ft,{className:"mt-3",label:"Update",onClick:()=>w(),"aria-label":"Update"})})]}),o.jsxs(Za,{children:[o.jsx(fr,{header:"Text",children:o.jsx(fo,{activeIndex:0,children:h!=null&&h.length?h.map((E,x)=>o.jsx(uo,{tabIndex:x,header:E==null?void 0:E.language,children:o.jsx(Lle,{language:E,fieldState:u,onHandleChange:m,...t})},x)):""})}),o.jsx(fr,{header:"Styling",children:o.jsx(Ble,{fieldState:u,onHandleChangeStyling:A,...t})})]})]})})},Ule=t=>{var g,v,m,A,w,E,x,C,S;const{field:e}=t,{userSelectedLanguage:n}=on(),{isPreview:r}=Jt(),[i,a]=M.useState(!1),[s,l]=M.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=_=>{a(_)},f=()=>{a(!1)};M.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"":"builder-element-wrapper",onMouseOver:c,onMouseOut:u,children:[!r&&s&&o.jsx(Xr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?" px-4":"field-form-builder px-4",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(g=e==null?void 0:e.headerText)==null?void 0:g[n==null?void 0:n.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required",children:"*"})," ",r?o.jsx(o.Fragment,{children:(m=e==null?void 0:e.label)==null?void 0:m[n==null?void 0:n.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(A=e==null?void 0:e.toolTip)==null?void 0:A[n==null?void 0:n.type],position:"right"})})]}),o.jsx("a",{style:{fontSize:parseInt(e==null?void 0:e.fontSize),color:`#${e==null?void 0:e.color}`,textDecoration:e!=null&&e.underLined?"underline":"none"},className:"atag-style",href:(w=e==null?void 0:e.hrefLink)==null?void 0:w[n==null?void 0:n.type],children:(E=e==null?void 0:e.text)==null?void 0:E[n==null?void 0:n.type]}),((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("small",{className:"error",children:(C=e==null?void 0:e.validationMesssage)==null?void 0:C[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(S=e==null?void 0:e.helperText)==null?void 0:S[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Vle,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(Si,{...t,fieldWrap:h})]})},qle=t=>{var R,fe,be,Te,ye,Ae,re,q,ie,W,ue,Ie,Ee,ve,me,Se,De,$,oe,ge,ce;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isPreview:u,isRenderView:d,isAdmin:f}=Jt(),{taskRegisterData:h,updateTaskRegisterData:g,updateTaskProgressValue:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,TASK_PUBLISHED:w,task_status:E}=yr(),{userSelectedLanguage:x,fieldSettingUpdate:C}=on(),[S,_]=M.useState(null),[I,F]=M.useState(!1),[P,L]=M.useState(null),[V,z]=M.useState(0),[N,U]=M.useState(!1),[Z,he]=M.useState(!1),te=()=>{he(!0)},Q=()=>{he(!1)},pe=()=>{var le,se;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Oe=[...a.repeatableFields],Ne=It.findIndex(Oe,function(Ke){return Ke.uuid===(e==null?void 0:e.uuid)});Ne>=0&&Oe[Ne].fieldData?L(Number(Oe[Ne].fieldData)||null):L(null)}}else{const Oe=A;if(Oe!=null&&Oe.length){for(const Ne of Oe)if(Ne.fieldId===t.field.uuid&&((le=Ne==null?void 0:Ne.postData)!=null&&le.length)){L(Number((se=Ne==null?void 0:Ne.postData[0])==null?void 0:se.postValue)||null);break}}}U(!0)};M.useEffect(()=>{N||pe();const le=Zt.addListener("clearRepeatableFields",ut=>{ut===(a==null?void 0:a.uuid)&&(L(null),z(0),e.isValid=0,C(i,r,s,l,n,e))}),se=Zt.addListener("onSubmitUserForm",()=>{var ut;(ut=e==null?void 0:e.attributes)!=null&&ut.required?P?e.isValid=1:e.isValid=0:e.isValid=1}),Oe=Zt.addListener("OnInvalidFieldCatch",ut=>{e.uuid===(ut==null?void 0:ut.fieldId)?z(1):z(0)}),Ne=Zt.addListener("OnGetFieldValue",ut=>{var ht;const pt=(ht=ut==null?void 0:ut.repeatableColumn)==null?void 0:ht.filter(kt=>(kt==null?void 0:kt.fieldUuid)===(e==null?void 0:e.uuid));pt!=null&&pt.length}),Ke=Zt.addListener("formFieldAdded",ut=>{S===null&&_(ut.uuid)});return()=>{se.remove(),Oe.remove(),Ne.remove(),le.remove(),Ke.remove()}}),M.useEffect(()=>(S!==null&&setTimeout(()=>{_(null)},1e3),()=>{}),[S]);const Y=le=>{F(le)},de=()=>{F(!1)},ee=le=>{const se=A,Oe=It.cloneDeep(h);if(se!==null){if(le){if(Oe[e==null?void 0:e.uuid]=le,(se==null?void 0:se.length)>0)for(const Ne of se)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:le})}else if(delete Oe[e==null?void 0:e.uuid],(se==null?void 0:se.length)>0)for(const Ne of se)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){g(Oe);const Ne=Object.keys(Oe).length;v(Ne)}},ne=(le,se)=>{var Oe;if(A!=null&&A.length){const Ne=[...A],Ke=It.findIndex(Ne,function(pt){return pt.rowId===(a==null?void 0:a.uuid)});let ut=(Oe=A[Ke])==null?void 0:Oe.repeatableFields;ut={...ut,[le==null?void 0:le.uuid]:se},Ne[Ke]={...Ne[Ke],repeatableFields:ut},m(Ne)}L(se),se!==""?le.isValid=1:le.isValid=0},K=o.jsxs("div",{onMouseOver:te,onMouseOut:Q,children:[!d&&!u&&Z&&o.jsx(Xr,{handleFieldSettingsSidebar:Y,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" p-fluid py-6 px-4":" py-6 px-4"} ${S===(e==null?void 0:e.uuid)?" new-field ":" card "}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(R=e==null?void 0:e.headerText)==null?void 0:R[x==null?void 0:x.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((fe=e==null?void 0:e.attributes)==null?void 0:fe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[x==null?void 0:x.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Te=e==null?void 0:e.toolTip)==null?void 0:Te[x==null?void 0:x.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=e==null?void 0:e.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(Ba,{readOnly:c,id:e==null?void 0:e.uuid,placeholder:(re=e==null?void 0:e.placeholder)==null?void 0:re[x==null?void 0:x.type],value:P,min:(q=e==null?void 0:e.attributes)==null?void 0:q.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(ie=e==null?void 0:e.attributes)==null?void 0:ie.prefix,showButtons:(W=e==null?void 0:e.attributes)==null?void 0:W.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(ue=e==null?void 0:e.attributes)==null?void 0:ue.minFractionDigits,maxFractionDigits:(Ie=e==null?void 0:e.attributes)==null?void 0:Ie.maxFractionDigits,locale:(Ee=e==null?void 0:e.attributes)==null?void 0:Ee.locale,mode:(ve=e==null?void 0:e.attributes)==null?void 0:ve.mode,currency:(me=e==null?void 0:e.attributes)==null?void 0:me.currency,currencyDisplay:(Se=e==null?void 0:e.attributes)==null?void 0:Se.currencyDisplay,useGrouping:(De=e==null?void 0:e.attributes)==null?void 0:De.useGrouping,onFocus:()=>z(1),onChange:le=>{a!=null&&a.rowIsRepeatable?ne(e,le.value):ee(le.value)},className:V===1&&(($=e==null?void 0:e.attributes)!=null&&$.required)?P?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:((oe=e==null?void 0:e.attributes)==null?void 0:oe.required)&&o.jsx("small",{className:"error",children:V===1&&!P?(ge=e==null?void 0:e.validationMesssage)==null?void 0:ge.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ce=e==null?void 0:e.helperText)==null?void 0:ce[x==null?void 0:x.type]})})]})]})}),f&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[I===!0&&o.jsx(Wi,{visibilty:I,closeSettingFieldSidebar:de,...t}),o.jsx(Si,{...t,fieldWrap:K})]})},Eb=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],A4=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,xu=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+\$,\\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/;function BO(t){try{JSON.parse(t)}catch{return!1}return!0}function VO(t){if(t<26)return Eb[t];{const e=Math.floor(t/26)-1,n=t%26;return Eb[e]+Eb[n]}}const $le=t=>{var ee,ne,K,R,fe,be,Te,ye,Ae,re,q;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,row:a,update:s,value:l,isDisabled:c}=t,{isPreview:u,isAdmin:d,isRenderView:f}=Jt(),{task_status:h,taskRegisterData:g,updateTaskRegisterData:v,updateTaskProgressValue:m,updateUserFormDataSubmit:A,userTaskSubmitFormData:w,TASK_PUBLISHED:E}=yr(),{userSelectedLanguage:x}=on(),[C,S]=M.useState(!1),[_,I]=M.useState(""),[F,P]=M.useState(0),[L,V]=M.useState(!1),z=()=>{V(!0)},N=()=>{V(!1)};M.useEffect(()=>{C||Q();const ie=Zt.addListener("clearRepeatableFields",ue=>{ue===(a==null?void 0:a.uuid)&&(I(""),P(0),e.isValid=0)}),W=Zt.addListener("onSubmitUserForm",()=>{var ue;(ue=e==null?void 0:e.attributes)!=null&&ue.required?_!==""&&A4.test(_)===!0?e.isValid=1:e.isValid=0:e.isValid=1});return()=>{W.remove(),ie.remove()}});const[U,Z]=M.useState(!1),he=ie=>{Z(ie)},te=()=>{Z(!1)},Q=()=>{var ie,W,ue;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ie=[...a.repeatableFields],Ee=It.findIndex(Ie,function(ve){return ve.uuid===(e==null?void 0:e.uuid)});Ee>=0&&Ie[Ee].fieldData?I(Ie[Ee].fieldData):I("")}}else{const Ie=w;if(Ie!=null&&Ie.length){for(const Ee of Ie)if(Ee.fieldId===t.field.uuid&&((ie=Ee==null?void 0:Ee.postData[0])==null?void 0:ie.postValue)!==""&&((W=Ee==null?void 0:Ee.postData[0])!=null&&W.postValue)){I((ue=Ee==null?void 0:Ee.postData[0])==null?void 0:ue.postValue),S(!0);break}}}S(!0)},pe=ie=>{I(ie);const W=w,ue=It.cloneDeep(g);if(W!==null){if(ie!==""&&A4.test(ie)===!0){if(ue[e==null?void 0:e.uuid]=ie,(W==null?void 0:W.length)>0)for(const Ie of W)Ie.fieldId===t.field.uuid&&(Ie.postData[0]={postValue:ie})}else if(delete ue[e==null?void 0:e.uuid],(W==null?void 0:W.length)>0)for(const Ie of W)Ie.fieldId===t.field.uuid&&(Ie.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){v(ue);const Ie=Object.keys(ue).length;m(Ie)}},Y=(ie,W,ue,Ie)=>{var Ee;if(I(Ie),w!==null){const ve=[...w],me=It.findIndex(ve,function(De){return De.rowId===(a==null?void 0:a.uuid)});let Se=(Ee=w[me])==null?void 0:Ee.repeatableFields;Se={...Se,[ue==null?void 0:ue.uuid]:Ie},ve[me]={...ve[me],repeatableFields:Se},A(ve),Ie!==""&&A4.test(Ie)===!0?e.isValid=1:e.isValid=0}},de=o.jsxs("div",{onMouseOver:z,onMouseOut:N,children:[!f&&!u&&L&&o.jsx(Xr,{handleFieldSettingsSidebar:he,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(ee=e==null?void 0:e.headerText)==null?void 0:ee[x==null?void 0:x.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t,update:s,value:l}),((ne=e==null?void 0:e.attributes)==null?void 0:ne.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(K=e==null?void 0:e.label)==null?void 0:K[x==null?void 0:x.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-2",children:(e==null?void 0:e.showToolTip)&&o.jsx(o.Fragment,{children:o.jsx(Mi,{message:(R=e==null?void 0:e.toolTip)==null?void 0:R[x==null?void 0:x.type],position:"right"})})})]}),o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((be=(fe=e==null?void 0:e.icon)==null?void 0:fe.properties)==null?void 0:be.name)}),o.jsx(vn,{id:e==null?void 0:e.uuid,placeholder:(Te=e==null?void 0:e.placeholder)==null?void 0:Te[x==null?void 0:x.type],value:_,onFocus:()=>P(1),onChange:ie=>{a!=null&&a.rowIsRepeatable?Y(r,i,{uuid:e.uuid},ie.target.value):pe(ie.target.value)},className:F===1&&((ye=e==null?void 0:e.attributes)!=null&&ye.required)?_?"valid":"invalid":"valid'",readOnly:c})]}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("div",{children:o.jsx("small",{className:"error",children:F===1&&(_===null||_==="")?(re=e==null?void 0:e.validationMesssage)==null?void 0:re[x==null?void 0:x.language]:""})}),_!==""&&F===1&&A4.test(_)===!1&&o.jsx("small",{className:"error",children:"Please enter correct email"}),(e==null?void 0:e.showHelperText)&&o.jsx("div",{children:o.jsx("small",{children:(q=e==null?void 0:e.helperText)==null?void 0:q[x==null?void 0:x.type]})})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]});return o.jsxs(o.Fragment,{children:[U===!0&&o.jsx(Wi,{visibilty:U,closeSettingFieldSidebar:te,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:de})]})},jle=t=>{var R,fe,be,Te,ye,Ae,re,q,ie;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,row:l,isDisabled:c}=t,{isRenderView:u,isAdmin:d,isPreview:f}=Jt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=on(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:w,updateUserFormDataSubmit:E,userTaskSubmitFormData:x,TASK_PUBLISHED:C}=yr(),[S,_]=M.useState(!1),[I,F]=M.useState(""),[P,L]=M.useState(0),[V,z]=M.useState(!1),[N,U]=M.useState(!1),[Z,he]=M.useState(!1),te=()=>{U(!0)},Q=()=>{U(!1)},pe=W=>{_(W)},Y=()=>{_(!1)},de=()=>{var ue,Ie,Ee;const W=x;if(l!=null&&l.rowIsRepeatable){if(l!=null&&l.repeatableFields){const ve=[...l.repeatableFields],me=It.findIndex(ve,function(Se){return Se.uuid===(e==null?void 0:e.uuid)});me>=0&&ve[me].fieldData?F(ve[me].fieldData):(e.isValid=0,F(""))}}else if(W!=null&&W.length){for(const ve of W)if(ve.fieldId===t.field.uuid&&((ue=ve==null?void 0:ve.postData[0])!=null&&ue.postValue)&&((Ie=ve==null?void 0:ve.postData[0])==null?void 0:Ie.postValue)!==""){F((Ee=ve==null?void 0:ve.postData[0])==null?void 0:Ee.postValue),z(!0);break}}z(!0)},ee=(W,ue,Ie,Ee)=>{var ve;if(x!=null&&x.length){const me=[...x],Se=It.findIndex(me,function($){return $.rowId===(l==null?void 0:l.uuid)});let De=(ve=x[Se])==null?void 0:ve.repeatableFields;De={...De,[Ie==null?void 0:Ie.uuid]:Ee},me[Se]={...me[Se],repeatableFields:De},E(me)}F(Ee),Ee!==""?e.isValid=1:e.isValid=0,g(W,ue,a,s,n,e)};M.useEffect(()=>{V||de();const W=Zt.addListener("clearRepeatableFields",me=>{me===(l==null?void 0:l.uuid)&&(F(""),L(0),e.isValid=0)}),ue=Zt.addListener("onSubmitUserForm",()=>{var me;(me=e==null?void 0:e.attributes)!=null&&me.required?I?e.isValid=1:e.isValid=0:e.isValid=1}),Ie=Zt.addListener("OnInvalidFieldCatch",me=>{e.uuid===(me==null?void 0:me.fieldId)?L(1):L(0)}),Ee=Zt.addListener("OnGetFieldValue",me=>{var De;const Se=(De=me==null?void 0:me.repeatableColumn)==null?void 0:De.filter($=>($==null?void 0:$.fieldUuid)===(e==null?void 0:e.uuid));Se!=null&&Se.length}),ve=Zt.addListener("onUpdateField",()=>{he(!Z)});return()=>{ve.remove(),ue.remove(),Ie.remove(),Ee.remove(),W.remove()}});const ne=W=>{var Ee,ve;F(W.target.value);const ue=x,Ie=It.cloneDeep(m);if(ue!==null){if((Ee=W==null?void 0:W.target)!=null&&Ee.value){if(Ie[e==null?void 0:e.uuid]=(ve=W==null?void 0:W.target)==null?void 0:ve.value,(ue==null?void 0:ue.length)>0)for(const me of ue)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:W.target.value})}else if(delete Ie[e==null?void 0:e.uuid],(ue==null?void 0:ue.length)>0)for(const me of ue)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:""})}if(!(l!=null&&l.rowIsRepeatable)){A(Ie);const me=Object.keys(Ie).length;w(me)}},K=o.jsxs("div",{onMouseOver:te,onMouseOut:Q,children:[!u&&!f&&N&&o.jsx(Xr,{handleFieldSettingsSidebar:pe,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?"card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"col-12 field-form-builder ",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(R=e==null?void 0:e.headerText)==null?void 0:R[h==null?void 0:h.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((fe=e==null?void 0:e.attributes)==null?void 0:fe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Te=e==null?void 0:e.toolTip)==null?void 0:Te[h==null?void 0:h.type],position:"right"})})]}),o.jsx(ks,{rows:e==null?void 0:e.textareaRows,cols:e==null?void 0:e.textareaCols,autoResize:e==null?void 0:e.resizable,id:e==null?void 0:e.uuid,placeholder:(ye=e==null?void 0:e.placeholder)==null?void 0:ye[h==null?void 0:h.type],value:I,onFocus:()=>L(1),onChange:W=>{l!=null&&l.rowIsRepeatable?ee(r,i,e,W.target.value):ne(W)},className:P===1&&((Ae=e==null?void 0:e.attributes)!=null&&Ae.required)?I?"valid":"invalid":"valid",readOnly:c}),o.jsx("div",{children:((re=e==null?void 0:e.attributes)==null?void 0:re.required)&&o.jsx("small",{className:"error",children:P===1&&!I?(q=e==null?void 0:e.validationMesssage)==null?void 0:q[h==null?void 0:h.type]:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ie=e==null?void 0:e.helperText)==null?void 0:ie[h==null?void 0:h.type]})})]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:Y,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:K})]})},zle={},Ib=t=>{var I,F,P,L;const{isAdmin:e,isAdvanceView:n,isPreview:r}=Jt(),{handleDrop:i}=on(),{data:a,path:s,pageIndex:l,sectionIndex:c,rowIndex:u,columnIndex:d,conditionIndex:f,ruleIndex:h,condition:g,page:v,section:m,row:A,column:w}=t,E=M.useRef(null),[{isDragging:x},C]=ia({type:hT,item:{type:hT,uuid:a.uuid,children:a.children,path:s},collect:V=>({isDragging:V.isDragging()})}),S=x?0:1;C(E);const _=(V,z,N,U,Z,he,te)=>{const Q=t!=null&&t.fieldContainer?t==null?void 0:t.fieldContainer:"inline-condition-container";return o.jsx(tu,{type:"inline-conditional",field:V,data:V,path:z,page:v,section:m,row:A,column:w,pageIndex:N,sectionIndex:U,rowIndex:Z,columnIndex:he,fieldIndex:te,isAdmin:e,fieldContainer:Q},V.uuid)};return o.jsxs("div",{ref:r===!1?E:null,style:{...zle,opacity:S},className:"draggable column",children:[g&&((I=g.children)==null?void 0:I.length)===0&&o.jsx("p",{className:"text-primary text-center",children:"Drag item here"}),g&&g.children&&((F=g.children)==null?void 0:F.length)>0&&g.children.map((V,z)=>{var N;return o.jsxs(M.Fragment,{children:[r===!1&&o.jsx(Fr,{isAdvanceView:n,data:{path:`${s}-${h}-${f}-${z}`,childrenCount:(N=g==null?void 0:g.children)==null?void 0:N.length,droppedField:g},onDrop:i}),_(V,`${s}-${h}-${f}-${z}`,l,c,u,d,z)]},V.uuid)}),r===!1&&o.jsx(Fr,{isAdvanceView:n,fieldDropArea:!0,data:{path:`${s}-${h}-${f}-${(P=g==null?void 0:g.children)==null?void 0:P.length}`,childrenCount:(L=g==null?void 0:g.children)==null?void 0:L.length,droppedField:g},onDrop:i,isLast:!0})]})},d0=t=>{const{inputValue:e,condition:n,ruleIndex:r,conditionIndex:i,field:a,section:s,page:l,row:c,pageIndex:u,sectionIndex:d,rowIndex:f,columnIndex:h,isConditionTrue:g}=t,{taskRegisterData:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,updateProgressDataValuesHook:w}=yr(),E=M.useCallback((x,C,S)=>{var I,F,P;const _=A;if(_!=null&&_.length){const L=v,V=(I=a==null?void 0:a.inlineConditionalRules)==null?void 0:I.rules[C].conditions[S].children;for(const[N,U]of V.entries()){(F=U==null?void 0:U.attributes)!=null&&F.required;const Z=It.findIndex(_,function(he){return he.fieldId===U.uuid});x?Z===-1&&(_.push({postData:[],tabId:l.uuid,tabIndex:u,...a.inlineConditionalRules?{inlineConditionalRules:a.inlineConditionalRules}:{},...a.conditionalTabRules?{conditionalTabRules:a.conditionalTabRules}:{},...a.conditionalSectionRules?{conditionalSectionRules:a.conditionalSectionRules}:{},sectionId:s.uuid,sectionIndex:d,sectionHeading:s.heading,subHeadingText:s.subHeadingText,reviewerChecklist:a==null?void 0:a.reviewerChecklist,rowId:c.uuid,rowIndex:f,columnId:s.uuid,columnIndex:h,inlineConditionalField:!0,fieldIndex:N,fieldId:U.uuid,fieldInputType:a.componentType,fieldTitle:(P=a.label)==null?void 0:P.english,fieldDescription:a.description||null,fieldHelperText:a.helperText||null,fieldHeaderText:a.headerText||null,fieldFooterText:a.footerText||null,fieldTitleAbb:a.abbreviationLabel||a.label,question_abb_table:a.textForTable||null,language:"english",isHiddenfield:a.isHidden&&a.isHidden===1?1:0,isHiddenSection:s.isHidden&&s.isHidden===1?1:0}),L[U==null?void 0:U.uuid]&&delete L[U==null?void 0:U.uuid]):(L[U==null?void 0:U.uuid]&&delete L[U==null?void 0:U.uuid],Z>=0&&_.splice(Z,1))}const z=Object.keys(L).length;w({progressMaxValue:_==null?void 0:_.length,progressValue:z}),m(_)}},[h,a.abbreviationLabel,a.componentType,a.conditionalSectionRules,a.conditionalTabRules,a.description,a.footerText,a.headerText,a.helperText,a.inlineConditionalRules,a.isHidden,a.label,a==null?void 0:a.reviewerChecklist,a.textForTable,l.uuid,u,c.uuid,f,s.heading,s.isHidden,s.subHeadingText,s.uuid,d,v,w,m,A]);return M.useEffect(()=>(E(g,r,i),()=>{}),[i,e,g,r,E]),o.jsx("div",{children:g&&o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(Ib,{...t,ruleIndex:r,conditionIndex:i,condition:n,data:a})})},i)})};function B2(t){"@babel/helpers - typeof";return B2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B2(t)}function Hle(t,e){if(B2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(B2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yle(t){var e=Hle(t,"string");return B2(e)=="symbol"?e:e+""}function _b(t,e,n){return(e=Yle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Kle={value:"p-tag-value",icon:"p-tag-icon",root:function(e){var n=e.props;return ft("p-tag p-component",_b(_b({},"p-tag-".concat(n.severity),n.severity!==null),"p-tag-rounded",n.rounded))}},Xle=`
2381
+ `+Qe),q&&m4([z,N,U],Dt=>{Qe=k2(Qe,Dt," ")}),C&&me?C.createHTML(Qe):Qe},e.setConfig=function(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(ot),ue=!0},e.clearConfig=function(){Mt=null,ue=!1},e.isValidAttribute=function(ot,Ve,rt){Mt||dt({});const Et=_n(ot),zt=_n(Ve);return At(Et,zt,rt)},e.addHook=function(ot,Ve){typeof Ve=="function"&&F2(V[ot],Ve)},e.removeHook=function(ot){return EO(V[ot])},e.removeHooks=function(ot){V[ot]=[]},e.removeAllHooks=function(){V=MO()},e}var y4=LO();const sa=t=>{var E;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,path:l}=t,[c,u]=M.useState(e);M.useEffect(()=>{var x;return A((x=e==null?void 0:e.label)==null?void 0:x[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=on(),v=(x,C,S)=>{u(_=>({..._,[x]:{..._[x],[C==null?void 0:C.type]:S}}))},[m,A]=M.useState((E=e==null?void 0:e.label)==null?void 0:E[d==null?void 0:d.type]);M.useEffect(()=>(w(),()=>{}),[c]);const w=()=>{const x=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(x[ma],x[va],x[xa],x[Ca],x[Ta],x[Na],x[Zo],x[Fo],c):(x==null?void 0:x.length)>Na&&(x==null?void 0:x.length)===tc+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(x[ma],x[va],x[xa],x[Ca],x[Ta],x[5],x[6],x[7],c):f(r,i,a,s,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(g4,{style:{display:"inline-block"},className:"builder-input-label-edit",html:m,disabled:!1,onChange:x=>{var C;A(y4.sanitize((C=x==null?void 0:x.target)==null?void 0:C.value))},onBlur:x=>{var S;const C=y4.sanitize((S=x==null?void 0:x.target)==null?void 0:S.innerText);A(C),v("label",d,C)},tagName:"article"})})},y1=t=>{const{onLabel:e,offLabel:n,onIcon:r,offIcon:i,onHandleChangeSetttings:a,settingsKey:s,settingsKeyValue:l}=t;return o.jsx(o.Fragment,{children:o.jsx(w2,{checked:l,onLabel:e,onChange:c=>{a(s,c.value)},offLabel:n,onIcon:r,offIcon:i,className:"mr-1 px-1",style:{fontSize:"0.8rem"}})})},Xr=t=>{var he,te,Q,pe;const{field:e,fieldIndex:n,columnIndex:r,sectionIndex:i,rowIndex:a,pageIndex:s,type:l,path:c,handleFieldSettingsSidebar:u,showFieldIcons:d=!0,showSettingsIcon:f=!0}=t,{emitSocketData:h,renderType:g}=Jt(),v=(Y,de)=>{V(ee=>({...ee,[Y]:de}))},{fieldSettingUpdate:m,fieldSettingUpdateInlineConditional:A,cloneField:w,gridComponentFieldSettingUpdate:E,fieldSettingDeleteInlineConditional:x,gridComponentFieldDelete:C,removeField:S}=on(),{updateGlobalToast:_}=Jt(),I=Y=>{const de=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?A(de[ma],de[va],de[xa],de[Ca],de[Ta],de[Na],de[Zo],de[Fo],Y):(de==null?void 0:de.length)>Na&&(de==null?void 0:de.length)===tc+1&&(Y!=null&&Y.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?E(de[ma],de[va],de[xa],de[Ca],de[Ta],de[5],de[6],de[7],Y):m(s,i,a,r,n,Y),_({showToast:!0,toastMessage:"Updated",toastDetail:"Field Updated",toastType:"success"})},[F,P]=M.useState(!1),[L,V]=M.useState({custom_component_title:"",custom_component_description:""}),z=()=>{V(Y=>({...Y,custom_component_schema:e})),P(!0)},N=()=>{const Y=c.split("-").map(Number);l==="inline-conditional"?x(Y[ma],Y[va],Y[xa],Y[Ca],Y[Ta],Y[Na],Y[Zo],Y[Fo]):(Y==null?void 0:Y.length)>Na&&(Y==null?void 0:Y.length)===tc+1&&(e!=null&&e.componentType)&&l==="grid"?C(Y[ma],Y[va],Y[xa],Y[Ca],Y[Ta],Y[5],Y[6],Y[7]):S(s,i,a,r,n)},U=(Y,de)=>{const ee={...e,attributes:{...e.attributes,[Y]:de}};I(ee)},Z=(Y,de)=>{const ee={...e,[Y]:de};I(ee)};return o.jsx(o.Fragment,{children:o.jsxs("div",{className:`${(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"?"builder-element-quick-options mb-2 w-9 justify-content-between":"builder-element-quick-options mb-2 w-4 justify-content-center"} flex quick-setting`,children:[o.jsx(o.Fragment,{children:(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"&&d===!0&&o.jsxs("div",{className:" ",children:[o.jsx(y1,{field:e,onHandleChangeSetttings:U,settingsKey:"required",settingsKeyValue:(he=e==null?void 0:e.attributes)==null?void 0:he.required,onLabel:"Required",offLabel:"Not Required",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(te=e==null?void 0:e.attributes)==null?void 0:te.required}),o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"showToolTip",settingsKeyValue:e==null?void 0:e.showToolTip,onLabel:"Tooltip",offLabel:"Tooltip",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showToolTip}),o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"showHelperText",settingsKeyValue:e==null?void 0:e.showHelperText,onLabel:"Helper text",offLabel:"Helper text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHelperText}),o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"showHeaderText",settingsKeyValue:e==null?void 0:e.showHeaderText,onLabel:"Header text",offLabel:"Header text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHeaderText}),o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"isFluid",settingsKeyValue:e==null?void 0:e.isFluid,onLabel:"Fluid",offLabel:"Fluid",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.isFluid}),(e==null?void 0:e.componentType)=="radio"&&o.jsxs(o.Fragment,{children:[o.jsx(y1,{field:e,onHandleChangeSetttings:Z,settingsKey:"showAlphabetList",settingsKeyValue:e==null?void 0:e.showAlphabetList,onLabel:"Alpha",offLabel:"Alpha",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showAlphabetList}),o.jsx(y1,{field:e,onHandleChangeSetttings:U,settingsKey:"style",settingsKeyValue:(Q=e==null?void 0:e.attributes)==null?void 0:Q.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(pe=e==null?void 0:e.attributes)==null?void 0:pe.style})]})]})}),o.jsxs("div",{className:"quick-setting",children:[f===!0&&o.jsxs("span",{className:"p-buttonset",children:[(e==null?void 0:e.componentType)!=="hr"&&o.jsx(Ft,{text:!0,size:"small",label:"Advance Settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx(Ft,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{w(e,s,i,a,r,n),h()}}),o.jsx(Ft,{text:!0,size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{N()}}),(g===j3||g===J0)&&o.jsx(Ft,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",onClick:()=>{z()}})]}),o.jsxs(Fs,{maximizable:!0,header:"Custom component save",visible:F,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx(Ft,{size:"small",text:!0,label:"Close",icon:"pi pi-times",onClick:()=>P(!1),className:"p-button-text"}),(e==null?void 0:e.componentType)!=="hidden-field"&&o.jsx(Ft,{text:!0,label:"Save",icon:"pi pi-check",onClick:()=>{P(!1)},autoFocus:!0})]})}),onHide:()=>P(!1),children:[o.jsxs("span",{className:"p-float-label",children:[o.jsx(vn,{id:"custom_component_title",name:"custom_component_title",className:"w-full",value:(L==null?void 0:L.custom_component_title)||"",onChange:Y=>{var de;return v("custom_component_title",(de=Y==null?void 0:Y.target)==null?void 0:de.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(ks,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(L==null?void 0:L.custom_component_description)||"",onChange:Y=>{var de;return v("custom_component_description",(de=Y==null?void 0:Y.target)==null?void 0:de.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},Ple=t=>{var R,fe,be,Te,ye,Ae,re,q;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isRenderView:d,isPreview:f}=Jt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=on(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:w,updateUserFormDataSubmit:E,userTaskSubmitFormData:x,TASK_PUBLISHED:C}=yr(),[S,_]=M.useState(!1),[I,F]=M.useState(!1),[P,L]=M.useState(null),[V,z]=M.useState(0),[N,U]=M.useState(!1),Z=()=>{U(!0)},he=()=>{U(!1)},te=ie=>{_(ie)},Q=()=>{_(!1)},pe=()=>{var ie,W,ue;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ie=[...a.repeatableFields],Ee=It.findIndex(Ie,function(ve){return ve.uuid===(r==null?void 0:r.uuid)});Ee>=0&&Ie[Ee].fieldData?L(Ie[Ee].fieldData):(r.isValid=0,L(null))}}else{const Ie=x,Ee=It.cloneDeep(m);if(Ie!=null&&Ie.length){for(const ve of Ie)if(ve.fieldId===t.field.uuid&&((ie=ve==null?void 0:ve.postData)!=null&&ie.length)){L((W=ve==null?void 0:ve.postData[0])==null?void 0:W.postValue),Ee[r==null?void 0:r.uuid]=(ue=ve==null?void 0:ve.postData[0])==null?void 0:ue.postValue;const me=Object.keys(Ee).length;w(me);break}}}F(!0)},Y=ie=>{var Ee;L(ie.target.value);const W=x,ue=It.cloneDeep(m);if((Ee=ie==null?void 0:ie.target)!=null&&Ee.value&&(W==null?void 0:W.length)>0)for(const ve of W)ve.fieldId===t.field.uuid&&(ue[r==null?void 0:r.uuid]=ie==null?void 0:ie.value,ve.postData[0]={postValue:ie.value});else delete ue[r==null?void 0:r.uuid];A(ue);const Ie=Object.keys(ue).length;w(Ie)};M.useEffect(()=>{I||pe();const ie=Zt.addListener("clearRepeatableFields",Ie=>{Ie===(a==null?void 0:a.uuid)&&(L(null),z(0),r.isValid=0,g(e,n,s,l,i,r))}),W=Zt.addListener("onSubmitUserForm",()=>{var Ie;(Ie=r==null?void 0:r.attributes)!=null&&Ie.required?P!==null||P!==void 0?r.isValid=1:r.isValid=0:r.isValid=1}),ue=Zt.addListener("OnInvalidFieldCatch",Ie=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(Ie==null?void 0:Ie.fieldId)),r.uuid===(Ie==null?void 0:Ie.fieldId)?z(1):z(0)});return()=>{W.remove(),ue.remove(),ie.remove()}});const de=(ie,W)=>{var ue;if(x){const Ie=[...x],Ee=It.findIndex(Ie,function(me){return me.rowId===(a==null?void 0:a.uuid)});let ve=(ue=x[Ee])==null?void 0:ue.repeatableFields;ve={...ve,[ie==null?void 0:ie.uuid]:W},Ie[Ee]={...Ie[Ee],repeatableFields:ve},E(Ie)}L(W),W!==null?ie.isValid=1:ie.isValid=0},ee=(ie,W)=>ie?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:ie.name,src:ie==null?void 0:ie.image,onError:ue=>ue.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:ie.name})]}):o.jsx("span",{children:W.placeholder}),ne=ie=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:ie.name,src:ie==null?void 0:ie.image,onError:W=>W.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:ie.name})]});console.log("field?.validationMesssage",r==null?void 0:r.validationMesssage);const K=o.jsxs("div",{onMouseOver:Z,onMouseOut:he,children:[!d&&!f&&N&&o.jsx(Xr,{handleFieldSettingsSidebar:te,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(r==null?void 0:r.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"field-form-builder col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(R=r==null?void 0:r.headerText)==null?void 0:R[h==null?void 0:h.type]}),(r==null?void 0:r.showLabel)&&o.jsxs("label",{htmlFor:i,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((fe=r==null?void 0:r.attributes)==null?void 0:fe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=r==null?void 0:r.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(Mi,{message:(Te=r==null?void 0:r.toolTip)==null?void 0:Te[h==null?void 0:h.type],position:"right"})})]}),o.jsx(Oa,{className:"country-select-builder-component",onFocus:()=>z(1),onChange:ie=>{a!=null&&a.rowIsRepeatable?de(r,ie.target.value):Y(ie)},options:r==null?void 0:r.countries,optionLabel:"name",value:P,placeholder:(ye=r==null?void 0:r.placeholder)==null?void 0:ye[h==null?void 0:h.type],disabled:c,valueTemplate:ee,itemTemplate:ne,filter:!0,filterBy:"name",showClear:!0}),((Ae=r==null?void 0:r.attributes)==null?void 0:Ae.required)&&o.jsx("small",{className:"error",children:V===1&&P===null?((re=r==null?void 0:r.validationMesssage)==null?void 0:re[h==null?void 0:h.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(q=r==null?void 0:r.helperText)==null?void 0:q[h==null?void 0:h.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:Q,...t},r==null?void 0:r.uuid),o.jsx(Si,{...t,fieldWrap:K})]})},Mle=t=>{var R,fe,be,Te,ye,Ae,re,q,ie,W,ue,Ie,Ee,ve,me;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:a,task_status:s,TASK_PUBLISHED:l}=yr(),{userSelectedLanguage:c,fieldSettingUpdate:u}=on(),{field:d,fieldIndex:f,sectionIndex:h,pageIndex:g,row:v,rowIndex:m,columnIndex:A,isDisabled:w}=t,{isAdmin:E,isRenderView:x,isPreview:C}=Jt(),[S,_]=M.useState(!1),[I,F]=M.useState(""),[P,L]=M.useState(null),[V,z]=M.useState(0),[N,U]=M.useState(!1),[Z,he]=M.useState(!1),te=()=>{he(!0)},Q=()=>{he(!1)},pe=()=>{var Se,De,$;if(v!=null&&v.rowIsRepeatable){if(v!=null&&v.repeatableFields){const oe=[...v.repeatableFields],ge=It.findIndex(oe,function(ce){return ce.uuid===(d==null?void 0:d.uuid)});ge>=0&&oe[ge].fieldData?F(oe[ge].fieldData):F("")}}else{const oe=a;if(oe!=null&&oe.length){for(const ge of oe)if(ge.fieldId===t.field.uuid&&((Se=ge==null?void 0:ge.postData[0])==null?void 0:Se.postValue)!==""&&((De=ge==null?void 0:ge.postData[0])!=null&&De.postValue)){F(($=ge==null?void 0:ge.postData[0])==null?void 0:$.postValue);break}}}U(!0)};M.useEffect(()=>{N||pe();const Se=Zt.addListener("clearRepeatableFields",ce=>{ce===(v==null?void 0:v.uuid)&&(F(""),z(0),d.isValid=0,u(g,h,m,A,f,d))}),De=Zt.addListener("onSubmitUserForm",()=>{var ce,le;(ce=d==null?void 0:d.attributes)!=null&&ce.required?I&&I.length&&(I==null?void 0:I.length)<((le=d==null?void 0:d.attributes)==null?void 0:le.minLength)?d.isValid=1:d.isValid=0:d.isValid=1}),$=Zt.addListener("OnInvalidFieldCatch",ce=>{d.uuid===(ce==null?void 0:ce.fieldId)?z(1):z(0)}),oe=Zt.addListener("OnGetFieldValue",ce=>{var se;const le=(se=ce==null?void 0:ce.repeatableColumn)==null?void 0:se.filter(Oe=>(Oe==null?void 0:Oe.fieldUuid)===(d==null?void 0:d.uuid));le!=null&&le.length}),ge=Zt.addListener("formFieldAdded",ce=>{P===null&&L(ce==null?void 0:ce.uuid)});return()=>{De.remove(),$.remove(),oe.remove(),Se.remove(),ge.remove()}}),M.useEffect(()=>(P!==null&&setTimeout(()=>{L(null)},1e3),()=>{}),[P]);const Y=Se=>{_(Se)},de=()=>{_(!1)},ee=Se=>{var oe,ge;F(Se.target.value);const De=a,$=It.cloneDeep(e);if(De!==null){if((oe=Se==null?void 0:Se.target)!=null&&oe.value){if($[d==null?void 0:d.uuid]=(ge=Se==null?void 0:Se.target)==null?void 0:ge.value,(De==null?void 0:De.length)>0)for(const ce of De)ce.fieldId===t.field.uuid&&(ce.postData[0]={postValue:Se.target.value})}else if(delete $[d==null?void 0:d.uuid],(De==null?void 0:De.length)>0)for(const ce of De)ce.fieldId===t.field.uuid&&(ce.postData[0]={postValue:""})}if(console.log("row?.rowIsRepeatable",v==null?void 0:v.rowIsRepeatable),!(v!=null&&v.rowIsRepeatable)){n($);const ce=Object.keys($).length;r(ce)}},ne=(Se,De)=>{var $;if(a){const oe=[...a],ge=It.findIndex(oe,function(le){return le.rowId===(v==null?void 0:v.uuid)});let ce=($=a[ge])==null?void 0:$.repeatableFields;ce={...ce,[Se==null?void 0:Se.uuid]:De},oe[ge]={...oe[ge],repeatableFields:ce},i(oe)}F(De),De!==""?Se.isValid=1:Se.isValid=0},K=o.jsxs("div",{onMouseOver:te,onMouseOut:Q,children:[!x&&!C&&Z&&o.jsx(Xr,{handleFieldSettingsSidebar:Y,...t}),o.jsxs("div",{className:`field ${C?" ":" builder-element-wrapper "} ${(d==null?void 0:d.isFluid)===!0?" p-fluid ":""} ${x?" ":" py-6 px-4 "} ${P===(d==null?void 0:d.uuid)?" new-field ":" card "} `,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:E?"col-6 ":"col-12 p-fluid",children:[(d==null?void 0:d.showHeaderText)&&o.jsx("h6",{children:(R=d==null?void 0:d.headerText)==null?void 0:R[c==null?void 0:c.type]}),(d==null?void 0:d.showLabel)&&o.jsxs("label",{htmlFor:d==null?void 0:d.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((fe=d==null?void 0:d.attributes)==null?void 0:fe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",C?o.jsx(o.Fragment,{children:(be=d==null?void 0:d.label)==null?void 0:be[c==null?void 0:c.type]}):o.jsx(sa,{...t}),(d==null?void 0:d.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(Mi,{message:(Te=d==null?void 0:d.toolTip)==null?void 0:Te[c==null?void 0:c.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(d==null?void 0:d.iconAlignment),children:[(d==null?void 0:d.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=d==null?void 0:d.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(vn,{id:d==null?void 0:d.uuid,placeholder:(re=d==null?void 0:d.placeholder)==null?void 0:re[c==null?void 0:c.type],minLength:(q=d==null?void 0:d.attributes)==null?void 0:q.minLength,maxLength:(ie=d==null?void 0:d.attributes)==null?void 0:ie.maxLength,value:I,onFocus:()=>z(1),onChange:Se=>{v!=null&&v.rowIsRepeatable?ne(d,Se.target.value):ee(Se)},className:V===1&&((W=d==null?void 0:d.attributes)!=null&&W.required)?I?"valid":"invalid":"valid'",readOnly:w})]}),o.jsx("div",{children:((ue=d==null?void 0:d.attributes)==null?void 0:ue.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:V===1&&!I?(Ie=d==null?void 0:d.validationMesssage)==null?void 0:Ie.english:""}),o.jsx("small",{className:"error",children:V===1&&I.length&&(I==null?void 0:I.length)<((Ee=d==null?void 0:d.attributes)==null?void 0:Ee.minLength)?`Mini length ${(ve=d==null?void 0:d.attributes)==null?void 0:ve.minLength}`:""})]})}),o.jsx("div",{children:(d==null?void 0:d.showHelperText)&&o.jsx("small",{children:(me=d==null?void 0:d.helperText)==null?void 0:me[c==null?void 0:c.type]})})]})]})}),E&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:de,...t}),o.jsx(Si,{...t,fieldWrap:K})]})},Lle=t=>{var i,a;const{language:e,onHandleChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink text"}),o.jsx(vn,{value:(i=r==null?void 0:r.text)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("text",e,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(vn,{value:(a=r==null?void 0:r.hrefLink)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("hrefLink",e,s.target.value)})]})]})},Ble=t=>{var r;const{onHandleChangeStyling:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{className:"mr-2",children:"Hyperlink color"}),o.jsx(l0,{value:n==null?void 0:n.color,onChange:i=>{e("color",i.value)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Font Size"}),o.jsx(vn,{type:"number",maxLength:2,placeholder:"eg 20px",value:(r=Number(n==null?void 0:n.fontSize))==null?void 0:r.toFixed(0),onChange:i=>{e("fontSize",i.target.value)}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},Vle=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=t,[u,d]=M.useState(n),{fieldSettingUpdate:f,formBuilderSchemaLanguages:h,formBuilderPublishedStatus:g}=on(),{updateGlobalToast:v}=Jt(),m=(E,x,C)=>{d(S=>({...S,[E]:{...S[E],[x==null?void 0:x.type]:C}}))},A=(E,x)=>{d(C=>({...C,[E]:x}))},w=()=>{f(i,a,s,l,c,u),v({showToast:!0,toastMessage:"Updated",toastDetail:"Html Updated",toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(Vo,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[t==null?void 0:t.typeName," settings "]})]}),!g&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx(Ft,{className:"mt-3",label:"Update",onClick:()=>w(),"aria-label":"Update"})})]}),o.jsxs(Za,{children:[o.jsx(fr,{header:"Text",children:o.jsx(fo,{activeIndex:0,children:h!=null&&h.length?h.map((E,x)=>o.jsx(uo,{tabIndex:x,header:E==null?void 0:E.language,children:o.jsx(Lle,{language:E,fieldState:u,onHandleChange:m,...t})},x)):""})}),o.jsx(fr,{header:"Styling",children:o.jsx(Ble,{fieldState:u,onHandleChangeStyling:A,...t})})]})]})})},Ule=t=>{var g,v,m,A,w,E,x,C,S;const{field:e}=t,{userSelectedLanguage:n}=on(),{isPreview:r}=Jt(),[i,a]=M.useState(!1),[s,l]=M.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=_=>{a(_)},f=()=>{a(!1)};M.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"":"builder-element-wrapper",onMouseOver:c,onMouseOut:u,children:[!r&&s&&o.jsx(Xr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?" px-4":"field-form-builder px-4",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(g=e==null?void 0:e.headerText)==null?void 0:g[n==null?void 0:n.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required",children:"*"})," ",r?o.jsx(o.Fragment,{children:(m=e==null?void 0:e.label)==null?void 0:m[n==null?void 0:n.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(A=e==null?void 0:e.toolTip)==null?void 0:A[n==null?void 0:n.type],position:"right"})})]}),o.jsx("a",{style:{fontSize:parseInt(e==null?void 0:e.fontSize),color:`#${e==null?void 0:e.color}`,textDecoration:e!=null&&e.underLined?"underline":"none"},className:"atag-style",href:(w=e==null?void 0:e.hrefLink)==null?void 0:w[n==null?void 0:n.type],children:(E=e==null?void 0:e.text)==null?void 0:E[n==null?void 0:n.type]}),((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("small",{className:"error",children:(C=e==null?void 0:e.validationMesssage)==null?void 0:C[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(S=e==null?void 0:e.helperText)==null?void 0:S[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Vle,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(Si,{...t,fieldWrap:h})]})},qle=t=>{var R,fe,be,Te,ye,Ae,re,q,ie,W,ue,Ie,Ee,ve,me,Se,De,$,oe,ge,ce;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isPreview:u,isRenderView:d,isAdmin:f}=Jt(),{taskRegisterData:h,updateTaskRegisterData:g,updateTaskProgressValue:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,TASK_PUBLISHED:w,task_status:E}=yr(),{userSelectedLanguage:x,fieldSettingUpdate:C}=on(),[S,_]=M.useState(null),[I,F]=M.useState(!1),[P,L]=M.useState(null),[V,z]=M.useState(0),[N,U]=M.useState(!1),[Z,he]=M.useState(!1),te=()=>{he(!0)},Q=()=>{he(!1)},pe=()=>{var le,se;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Oe=[...a.repeatableFields],Ne=It.findIndex(Oe,function(Ke){return Ke.uuid===(e==null?void 0:e.uuid)});Ne>=0&&Oe[Ne].fieldData?L(Number(Oe[Ne].fieldData)||null):L(null)}}else{const Oe=A;if(Oe!=null&&Oe.length){for(const Ne of Oe)if(Ne.fieldId===t.field.uuid&&((le=Ne==null?void 0:Ne.postData)!=null&&le.length)){L(Number((se=Ne==null?void 0:Ne.postData[0])==null?void 0:se.postValue)||null);break}}}U(!0)};M.useEffect(()=>{N||pe();const le=Zt.addListener("clearRepeatableFields",ut=>{ut===(a==null?void 0:a.uuid)&&(L(null),z(0),e.isValid=0,C(i,r,s,l,n,e))}),se=Zt.addListener("onSubmitUserForm",()=>{var ut;(ut=e==null?void 0:e.attributes)!=null&&ut.required?P?e.isValid=1:e.isValid=0:e.isValid=1}),Oe=Zt.addListener("OnInvalidFieldCatch",ut=>{e.uuid===(ut==null?void 0:ut.fieldId)?z(1):z(0)}),Ne=Zt.addListener("OnGetFieldValue",ut=>{var ht;const pt=(ht=ut==null?void 0:ut.repeatableColumn)==null?void 0:ht.filter(kt=>(kt==null?void 0:kt.fieldUuid)===(e==null?void 0:e.uuid));pt!=null&&pt.length}),Ke=Zt.addListener("formFieldAdded",ut=>{S===null&&_(ut.uuid)});return()=>{se.remove(),Oe.remove(),Ne.remove(),le.remove(),Ke.remove()}}),M.useEffect(()=>(S!==null&&setTimeout(()=>{_(null)},1e3),()=>{}),[S]);const Y=le=>{F(le)},de=()=>{F(!1)},ee=le=>{const se=A,Oe=It.cloneDeep(h);if(se!==null){if(le){if(Oe[e==null?void 0:e.uuid]=le,(se==null?void 0:se.length)>0)for(const Ne of se)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:le})}else if(delete Oe[e==null?void 0:e.uuid],(se==null?void 0:se.length)>0)for(const Ne of se)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){g(Oe);const Ne=Object.keys(Oe).length;v(Ne)}},ne=(le,se)=>{var Oe;if(A!=null&&A.length){const Ne=[...A],Ke=It.findIndex(Ne,function(pt){return pt.rowId===(a==null?void 0:a.uuid)});let ut=(Oe=A[Ke])==null?void 0:Oe.repeatableFields;ut={...ut,[le==null?void 0:le.uuid]:se},Ne[Ke]={...Ne[Ke],repeatableFields:ut},m(Ne)}L(se),se!==""?le.isValid=1:le.isValid=0},K=o.jsxs("div",{onMouseOver:te,onMouseOut:Q,children:[!d&&!u&&Z&&o.jsx(Xr,{handleFieldSettingsSidebar:Y,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" p-fluid py-6 px-4":" py-6 px-4"} ${S===(e==null?void 0:e.uuid)?" new-field ":" card "}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(R=e==null?void 0:e.headerText)==null?void 0:R[x==null?void 0:x.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((fe=e==null?void 0:e.attributes)==null?void 0:fe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[x==null?void 0:x.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Te=e==null?void 0:e.toolTip)==null?void 0:Te[x==null?void 0:x.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=e==null?void 0:e.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(Ba,{readOnly:c,id:e==null?void 0:e.uuid,placeholder:(re=e==null?void 0:e.placeholder)==null?void 0:re[x==null?void 0:x.type],value:P,min:(q=e==null?void 0:e.attributes)==null?void 0:q.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(ie=e==null?void 0:e.attributes)==null?void 0:ie.prefix,showButtons:(W=e==null?void 0:e.attributes)==null?void 0:W.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(ue=e==null?void 0:e.attributes)==null?void 0:ue.minFractionDigits,maxFractionDigits:(Ie=e==null?void 0:e.attributes)==null?void 0:Ie.maxFractionDigits,locale:(Ee=e==null?void 0:e.attributes)==null?void 0:Ee.locale,mode:(ve=e==null?void 0:e.attributes)==null?void 0:ve.mode,currency:(me=e==null?void 0:e.attributes)==null?void 0:me.currency,currencyDisplay:(Se=e==null?void 0:e.attributes)==null?void 0:Se.currencyDisplay,useGrouping:(De=e==null?void 0:e.attributes)==null?void 0:De.useGrouping,onFocus:()=>z(1),onChange:le=>{a!=null&&a.rowIsRepeatable?ne(e,le.value):ee(le.value)},className:V===1&&(($=e==null?void 0:e.attributes)!=null&&$.required)?P?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:((oe=e==null?void 0:e.attributes)==null?void 0:oe.required)&&o.jsx("small",{className:"error",children:V===1&&!P?(ge=e==null?void 0:e.validationMesssage)==null?void 0:ge.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ce=e==null?void 0:e.helperText)==null?void 0:ce[x==null?void 0:x.type]})})]})]})}),f&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[I===!0&&o.jsx(Wi,{visibilty:I,closeSettingFieldSidebar:de,...t}),o.jsx(Si,{...t,fieldWrap:K})]})},Eb=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],A4=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,xu=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+\$,\\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/;function BO(t){try{JSON.parse(t)}catch{return!1}return!0}function VO(t){if(t<26)return Eb[t];{const e=Math.floor(t/26)-1,n=t%26;return Eb[e]+Eb[n]}}const $le=t=>{var ee,ne,K,R,fe,be,Te,ye,Ae,re,q;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,row:a,update:s,value:l,isDisabled:c}=t,{isPreview:u,isAdmin:d,isRenderView:f}=Jt(),{task_status:h,taskRegisterData:g,updateTaskRegisterData:v,updateTaskProgressValue:m,updateUserFormDataSubmit:A,userTaskSubmitFormData:w,TASK_PUBLISHED:E}=yr(),{userSelectedLanguage:x}=on(),[C,S]=M.useState(!1),[_,I]=M.useState(""),[F,P]=M.useState(0),[L,V]=M.useState(!1),z=()=>{V(!0)},N=()=>{V(!1)};M.useEffect(()=>{C||Q();const ie=Zt.addListener("clearRepeatableFields",ue=>{ue===(a==null?void 0:a.uuid)&&(I(""),P(0),e.isValid=0)}),W=Zt.addListener("onSubmitUserForm",()=>{var ue;(ue=e==null?void 0:e.attributes)!=null&&ue.required?_!==""&&A4.test(_)===!0?e.isValid=1:e.isValid=0:e.isValid=1});return()=>{W.remove(),ie.remove()}});const[U,Z]=M.useState(!1),he=ie=>{Z(ie)},te=()=>{Z(!1)},Q=()=>{var ie,W,ue;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ie=[...a.repeatableFields],Ee=It.findIndex(Ie,function(ve){return ve.uuid===(e==null?void 0:e.uuid)});Ee>=0&&Ie[Ee].fieldData?I(Ie[Ee].fieldData):I("")}}else{const Ie=w;if(Ie!=null&&Ie.length){for(const Ee of Ie)if(Ee.fieldId===t.field.uuid&&((ie=Ee==null?void 0:Ee.postData[0])==null?void 0:ie.postValue)!==""&&((W=Ee==null?void 0:Ee.postData[0])!=null&&W.postValue)){I((ue=Ee==null?void 0:Ee.postData[0])==null?void 0:ue.postValue),S(!0);break}}}S(!0)},pe=ie=>{I(ie);const W=w,ue=It.cloneDeep(g);if(W!==null){if(ie!==""&&A4.test(ie)===!0){if(ue[e==null?void 0:e.uuid]=ie,(W==null?void 0:W.length)>0)for(const Ie of W)Ie.fieldId===t.field.uuid&&(Ie.postData[0]={postValue:ie})}else if(delete ue[e==null?void 0:e.uuid],(W==null?void 0:W.length)>0)for(const Ie of W)Ie.fieldId===t.field.uuid&&(Ie.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){v(ue);const Ie=Object.keys(ue).length;m(Ie)}},Y=(ie,W,ue,Ie)=>{var Ee;if(I(Ie),w!==null){const ve=[...w],me=It.findIndex(ve,function(De){return De.rowId===(a==null?void 0:a.uuid)});let Se=(Ee=w[me])==null?void 0:Ee.repeatableFields;Se={...Se,[ue==null?void 0:ue.uuid]:Ie},ve[me]={...ve[me],repeatableFields:Se},A(ve),Ie!==""&&A4.test(Ie)===!0?e.isValid=1:e.isValid=0}},de=o.jsxs("div",{onMouseOver:z,onMouseOut:N,children:[!f&&!u&&L&&o.jsx(Xr,{handleFieldSettingsSidebar:he,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(ee=e==null?void 0:e.headerText)==null?void 0:ee[x==null?void 0:x.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t,update:s,value:l}),((ne=e==null?void 0:e.attributes)==null?void 0:ne.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(K=e==null?void 0:e.label)==null?void 0:K[x==null?void 0:x.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-2",children:(e==null?void 0:e.showToolTip)&&o.jsx(o.Fragment,{children:o.jsx(Mi,{message:(R=e==null?void 0:e.toolTip)==null?void 0:R[x==null?void 0:x.type],position:"right"})})})]}),o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((be=(fe=e==null?void 0:e.icon)==null?void 0:fe.properties)==null?void 0:be.name)}),o.jsx(vn,{id:e==null?void 0:e.uuid,placeholder:(Te=e==null?void 0:e.placeholder)==null?void 0:Te[x==null?void 0:x.type],value:_,onFocus:()=>P(1),onChange:ie=>{a!=null&&a.rowIsRepeatable?Y(r,i,{uuid:e.uuid},ie.target.value):pe(ie.target.value)},className:F===1&&((ye=e==null?void 0:e.attributes)!=null&&ye.required)?_?"valid":"invalid":"valid'",readOnly:c})]}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("div",{children:o.jsx("small",{className:"error",children:F===1&&(_===null||_==="")?(re=e==null?void 0:e.validationMesssage)==null?void 0:re[x==null?void 0:x.language]:""})}),_!==""&&F===1&&A4.test(_)===!1&&o.jsx("small",{className:"error",children:"Please enter correct email"}),(e==null?void 0:e.showHelperText)&&o.jsx("div",{children:o.jsx("small",{children:(q=e==null?void 0:e.helperText)==null?void 0:q[x==null?void 0:x.type]})})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]});return o.jsxs(o.Fragment,{children:[U===!0&&o.jsx(Wi,{visibilty:U,closeSettingFieldSidebar:te,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:de})]})},jle=t=>{var R,fe,be,Te,ye,Ae,re,q,ie;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,row:l,isDisabled:c}=t,{isRenderView:u,isAdmin:d,isPreview:f}=Jt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=on(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:w,updateUserFormDataSubmit:E,userTaskSubmitFormData:x,TASK_PUBLISHED:C}=yr(),[S,_]=M.useState(!1),[I,F]=M.useState(""),[P,L]=M.useState(0),[V,z]=M.useState(!1),[N,U]=M.useState(!1),[Z,he]=M.useState(!1),te=()=>{U(!0)},Q=()=>{U(!1)},pe=W=>{_(W)},Y=()=>{_(!1)},de=()=>{var ue,Ie,Ee;const W=x;if(l!=null&&l.rowIsRepeatable){if(l!=null&&l.repeatableFields){const ve=[...l.repeatableFields],me=It.findIndex(ve,function(Se){return Se.uuid===(e==null?void 0:e.uuid)});me>=0&&ve[me].fieldData?F(ve[me].fieldData):(e.isValid=0,F(""))}}else if(W!=null&&W.length){for(const ve of W)if(ve.fieldId===t.field.uuid&&((ue=ve==null?void 0:ve.postData[0])!=null&&ue.postValue)&&((Ie=ve==null?void 0:ve.postData[0])==null?void 0:Ie.postValue)!==""){F((Ee=ve==null?void 0:ve.postData[0])==null?void 0:Ee.postValue),z(!0);break}}z(!0)},ee=(W,ue,Ie,Ee)=>{var ve;if(x!=null&&x.length){const me=[...x],Se=It.findIndex(me,function($){return $.rowId===(l==null?void 0:l.uuid)});let De=(ve=x[Se])==null?void 0:ve.repeatableFields;De={...De,[Ie==null?void 0:Ie.uuid]:Ee},me[Se]={...me[Se],repeatableFields:De},E(me)}F(Ee),Ee!==""?e.isValid=1:e.isValid=0,g(W,ue,a,s,n,e)};M.useEffect(()=>{V||de();const W=Zt.addListener("clearRepeatableFields",me=>{me===(l==null?void 0:l.uuid)&&(F(""),L(0),e.isValid=0)}),ue=Zt.addListener("onSubmitUserForm",()=>{var me;(me=e==null?void 0:e.attributes)!=null&&me.required?I?e.isValid=1:e.isValid=0:e.isValid=1}),Ie=Zt.addListener("OnInvalidFieldCatch",me=>{e.uuid===(me==null?void 0:me.fieldId)?L(1):L(0)}),Ee=Zt.addListener("OnGetFieldValue",me=>{var De;const Se=(De=me==null?void 0:me.repeatableColumn)==null?void 0:De.filter($=>($==null?void 0:$.fieldUuid)===(e==null?void 0:e.uuid));Se!=null&&Se.length}),ve=Zt.addListener("onUpdateField",()=>{he(!Z)});return()=>{ve.remove(),ue.remove(),Ie.remove(),Ee.remove(),W.remove()}});const ne=W=>{var Ee,ve;F(W.target.value);const ue=x,Ie=It.cloneDeep(m);if(ue!==null){if((Ee=W==null?void 0:W.target)!=null&&Ee.value){if(Ie[e==null?void 0:e.uuid]=(ve=W==null?void 0:W.target)==null?void 0:ve.value,(ue==null?void 0:ue.length)>0)for(const me of ue)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:W.target.value})}else if(delete Ie[e==null?void 0:e.uuid],(ue==null?void 0:ue.length)>0)for(const me of ue)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:""})}if(!(l!=null&&l.rowIsRepeatable)){A(Ie);const me=Object.keys(Ie).length;w(me)}},K=o.jsxs("div",{onMouseOver:te,onMouseOut:Q,children:[!u&&!f&&N&&o.jsx(Xr,{handleFieldSettingsSidebar:pe,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?"card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"col-12 field-form-builder ",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(R=e==null?void 0:e.headerText)==null?void 0:R[h==null?void 0:h.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((fe=e==null?void 0:e.attributes)==null?void 0:fe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Te=e==null?void 0:e.toolTip)==null?void 0:Te[h==null?void 0:h.type],position:"right"})})]}),o.jsx(ks,{rows:e==null?void 0:e.textareaRows,cols:e==null?void 0:e.textareaCols,autoResize:e==null?void 0:e.resizable,id:e==null?void 0:e.uuid,placeholder:(ye=e==null?void 0:e.placeholder)==null?void 0:ye[h==null?void 0:h.type],value:I,onFocus:()=>L(1),onChange:W=>{l!=null&&l.rowIsRepeatable?ee(r,i,e,W.target.value):ne(W)},className:P===1&&((Ae=e==null?void 0:e.attributes)!=null&&Ae.required)?I?"valid":"invalid":"valid",readOnly:c}),o.jsx("div",{children:((re=e==null?void 0:e.attributes)==null?void 0:re.required)&&o.jsx("small",{className:"error",children:P===1&&!I?(q=e==null?void 0:e.validationMesssage)==null?void 0:q[h==null?void 0:h.type]:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ie=e==null?void 0:e.helperText)==null?void 0:ie[h==null?void 0:h.type]})})]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:Y,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:K})]})},zle={},Ib=t=>{var I,F,P,L;const{isAdmin:e,isAdvanceView:n,isPreview:r}=Jt(),{handleDrop:i}=on(),{data:a,path:s,pageIndex:l,sectionIndex:c,rowIndex:u,columnIndex:d,conditionIndex:f,ruleIndex:h,condition:g,page:v,section:m,row:A,column:w}=t,E=M.useRef(null),[{isDragging:x},C]=ia({type:hT,item:{type:hT,uuid:a.uuid,children:a.children,path:s},collect:V=>({isDragging:V.isDragging()})}),S=x?0:1;C(E);const _=(V,z,N,U,Z,he,te)=>{const Q=t!=null&&t.fieldContainer?t==null?void 0:t.fieldContainer:"inline-condition-container";return o.jsx(tu,{type:"inline-conditional",field:V,data:V,path:z,page:v,section:m,row:A,column:w,pageIndex:N,sectionIndex:U,rowIndex:Z,columnIndex:he,fieldIndex:te,isAdmin:e,fieldContainer:Q},V.uuid)};return o.jsxs("div",{ref:r===!1?E:null,style:{...zle,opacity:S},className:"draggable column",children:[g&&((I=g.children)==null?void 0:I.length)===0&&o.jsx("p",{className:"text-primary text-center",children:"Drag item here"}),g&&g.children&&((F=g.children)==null?void 0:F.length)>0&&g.children.map((V,z)=>{var N;return o.jsxs(M.Fragment,{children:[r===!1&&o.jsx(Fr,{isAdvanceView:n,data:{path:`${s}-${h}-${f}-${z}`,childrenCount:(N=g==null?void 0:g.children)==null?void 0:N.length,droppedField:g},onDrop:i}),_(V,`${s}-${h}-${f}-${z}`,l,c,u,d,z)]},V.uuid)}),r===!1&&o.jsx(Fr,{isAdvanceView:n,fieldDropArea:!0,data:{path:`${s}-${h}-${f}-${(P=g==null?void 0:g.children)==null?void 0:P.length}`,childrenCount:(L=g==null?void 0:g.children)==null?void 0:L.length,droppedField:g},onDrop:i,isLast:!0})]})},d0=t=>{const{inputValue:e,condition:n,ruleIndex:r,conditionIndex:i,field:a,section:s,page:l,row:c,pageIndex:u,sectionIndex:d,rowIndex:f,columnIndex:h,isConditionTrue:g}=t,{taskRegisterData:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,updateProgressDataValuesHook:w}=yr(),E=M.useCallback((x,C,S)=>{var I,F,P;const _=A;if(_!=null&&_.length){const L=v,V=(I=a==null?void 0:a.inlineConditionalRules)==null?void 0:I.rules[C].conditions[S].children;for(const[N,U]of V.entries()){(F=U==null?void 0:U.attributes)!=null&&F.required;const Z=It.findIndex(_,function(he){return he.fieldId===U.uuid});x?Z===-1&&(_.push({postData:[],tabId:l.uuid,tabIndex:u,...a.inlineConditionalRules?{inlineConditionalRules:a.inlineConditionalRules}:{},...a.conditionalTabRules?{conditionalTabRules:a.conditionalTabRules}:{},...a.conditionalSectionRules?{conditionalSectionRules:a.conditionalSectionRules}:{},sectionId:s.uuid,sectionIndex:d,sectionHeading:s.heading,subHeadingText:s.subHeadingText,reviewerChecklist:a==null?void 0:a.reviewerChecklist,rowId:c.uuid,rowIndex:f,columnId:s.uuid,columnIndex:h,inlineConditionalField:!0,fieldIndex:N,fieldId:U.uuid,fieldInputType:a.componentType,fieldTitle:(P=a.label)==null?void 0:P.english,fieldDescription:a.description||null,fieldHelperText:a.helperText||null,fieldHeaderText:a.headerText||null,fieldFooterText:a.footerText||null,fieldTitleAbb:a.abbreviationLabel||a.label,question_abb_table:a.textForTable||null,language:"english",isHiddenfield:a.isHidden&&a.isHidden===1?1:0,isHiddenSection:s.isHidden&&s.isHidden===1?1:0}),L[U==null?void 0:U.uuid]&&delete L[U==null?void 0:U.uuid]):(L[U==null?void 0:U.uuid]&&delete L[U==null?void 0:U.uuid],Z>=0&&_.splice(Z,1))}const z=Object.keys(L).length;w({progressMaxValue:_==null?void 0:_.length,progressValue:z}),m(_)}},[h,a.abbreviationLabel,a.componentType,a.conditionalSectionRules,a.conditionalTabRules,a.description,a.footerText,a.headerText,a.helperText,a.inlineConditionalRules,a.isHidden,a.label,a==null?void 0:a.reviewerChecklist,a.textForTable,l.uuid,u,c.uuid,f,s.heading,s.isHidden,s.subHeadingText,s.uuid,d,v,w,m,A]);return M.useEffect(()=>(E(g,r,i),()=>{}),[i,e,g,r,E]),o.jsx("div",{children:g&&o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(Ib,{...t,ruleIndex:r,conditionIndex:i,condition:n,data:a})})},i)})};function B2(t){"@babel/helpers - typeof";return B2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B2(t)}function Hle(t,e){if(B2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(B2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yle(t){var e=Hle(t,"string");return B2(e)=="symbol"?e:e+""}function _b(t,e,n){return(e=Yle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Kle={value:"p-tag-value",icon:"p-tag-icon",root:function(e){var n=e.props;return ft("p-tag p-component",_b(_b({},"p-tag-".concat(n.severity),n.severity!==null),"p-tag-rounded",n.rounded))}},Xle=`
2382
2382
  @layer primereact {
2383
2383
  .p-tag {
2384
2384
  display: inline-flex;
@@ -55028,7 +55028,7 @@ const $i = (t) => {
55028
55028
  const re = Qt.addListener(
55029
55029
  "clearRepeatableFields",
55030
55030
  (_e) => {
55031
- _e === (a == null ? void 0 : a.uuid) && (L(""), q(0), r.isValid = 0, g(
55031
+ _e === (a == null ? void 0 : a.uuid) && (L(null), q(0), r.isValid = 0, g(
55032
55032
  e,
55033
55033
  n,
55034
55034
  s,
@@ -55039,7 +55039,7 @@ const $i = (t) => {
55039
55039
  }
55040
55040
  ), G = Qt.addListener("onSubmitUserForm", () => {
55041
55041
  var _e;
55042
- (_e = r == null ? void 0 : r.attributes) != null && _e.required ? M ? r.isValid = 1 : r.isValid = 0 : r.isValid = 1;
55042
+ (_e = r == null ? void 0 : r.attributes) != null && _e.required ? M !== null || M !== void 0 ? r.isValid = 1 : r.isValid = 0 : r.isValid = 1;
55043
55043
  }), ce = Qt.addListener(
55044
55044
  "OnInvalidFieldCatch",
55045
55045
  (_e) => {
@@ -58136,7 +58136,7 @@ var que = function() {
58136
58136
  theme: i.theme,
58137
58137
  formats: i.formats
58138
58138
  };
58139
- que ? A(new Quill(d.current, V)) : import("./quill-DPbfIhVx.js").then(function(q) {
58139
+ que ? A(new Quill(d.current, V)) : import("./quill-Cns5Lqgx.js").then(function(q) {
58140
58140
  if (q && Se.isExist(d.current)) {
58141
58141
  var N;
58142
58142
  q.default ? N = new q.default(d.current, V) : N = new q(d.current, V), A(N);
@@ -1,7 +1,7 @@
1
1
  var Bl = Object.defineProperty;
2
2
  var Ml = (n, t, e) => t in n ? Bl(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var T = (n, t, e) => Ml(n, typeof t != "symbol" ? t + "" : t, e);
4
- import { d as ti, i as Rr, a as Hi, b as Dl, e as Br, M as Ul, S as ei, U as si, g as ni, c as ri, f as fr, h as zs, j as $i, k as Vs, l as dr, m as Pl, n as jl, o as Fi, p as Hl, q as $l, r as Fl, s as zl, t as ii, u as Kl, v as Gl, w as Ft, x as zi, y as xe } from "./main-CSLhUKcu.js";
4
+ import { d as ti, i as Rr, a as Hi, b as Dl, e as Br, M as Ul, S as ei, U as si, g as ni, c as ri, f as fr, h as zs, j as $i, k as Vs, l as dr, m as Pl, n as jl, o as Fi, p as Hl, q as $l, r as Fl, s as zl, t as ii, u as Kl, v as Gl, w as Ft, x as zi, y as xe } from "./main-CrfuAsE4.js";
5
5
  function Ki(n) {
6
6
  return n;
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cft-builder",
3
- "version": "0.2.89",
3
+ "version": "0.2.90",
4
4
  "type": "module",
5
5
  "types": "dist/types/index",
6
6
  "files": [