cft-builder 0.2.310 → 0.2.312
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.
package/dist/cft-builder.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as s, D as o, F as a, G as d, R as i, T as u, C as m, A as B, z as k, B as l } from "./main-
|
|
1
|
+
import { E as s, D as o, F as a, G as d, R as i, T as u, C as m, A as B, z as k, B as l } from "./main-Bm6KEtyk.js";
|
|
2
2
|
export {
|
|
3
3
|
s as BuilderItems,
|
|
4
4
|
o as BuilderItemsRender,
|
package/dist/cft-builder.umd.cjs
CHANGED
|
@@ -2286,7 +2286,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2286
2286
|
position: relative;
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
|
-
`}}),ci=b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=_3.getProps(t,r),a=b.useState(i.id),s=pN(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=pN(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",C=_3.setMetaData({props:i,state:{id:l,collapsed:m}}),S=C.ptm,T=C.cx,x=C.isUnstyled;li(_3.css.styles,x,{name:"panel"});var E=function(R){i.toggleable&&(m?_(R):M(R),R&&(i.onToggle&&i.onToggle({originalEvent:R,value:!m}),R.preventDefault()))},_=function(R){i.onToggle||h(!1),i.onExpand&&R&&i.onExpand(R)},M=function(R){i.onToggle||h(!0),i.onCollapse&&R&&i.onCollapse(R)};b.useImperativeHandle(e,function(){return{props:i,toggle:E,expand:_,collapse:M,getElement:function(){return g.current},getContent:function(){return v.current}}}),Li(function(){l||c(So())});var O=function(){if(i.toggleable){var R=l+"_label",ue=n({className:T("toggler"),onClick:E,id:R,"aria-controls":w,"aria-expanded":!m,type:"button",role:"button","aria-label":i.header},S("toggler")),Y=n(S("togglericon")),ie=m?i.expandIcon||b.createElement(Mm,Y):i.collapseIcon||b.createElement(n8,Y),re=nr.getJSXIcon(ie,Y,{props:i,collapsed:m});return b.createElement("button",ue,re,b.createElement(Qt,null))}return null},F=function(){var R=ke.getJSXElement(i.header,i),ue=ke.getJSXElement(i.icons,i),Y=O(),ie=n({id:A,className:T("title")},S("title")),re=b.createElement("span",ie,R),Z=n({className:T("icons")},S("icons")),K=b.createElement("div",Z,ue,Y),W=n({className:T("header")},S("header")),ge=b.createElement("div",W,re,K);if(i.headerTemplate){var ye={className:"p-panel-header",titleClassName:"p-panel-title",iconsClassName:"p-panel-icons",togglerClassName:"p-panel-header-icon p-panel-toggler p-link",onTogglerClick:E,titleElement:re,iconsElement:K,togglerElement:Y,element:ge,id:l+"_header",props:i,collapsed:m};return ke.getJSXElement(i.headerTemplate,ye)}else if(i.header||i.toggleable)return ge;return null},P=function(){var R=ke.getJSXElement(i.footer,i),ue=n({className:T("footer")},S("footer")),Y=b.createElement("div",ue,R);if(i.footerTemplate){var ie={className:T("footer"),element:Y,props:i};return ke.getJSXElement(i.footerTemplate,ie)}else if(i.footer)return Y;return null},H=function(){var R=n({ref:v,className:T("toggleableContent"),"aria-hidden":m,role:"region",id:w,"aria-labelledby":A},S("toggleablecontent")),ue=n({className:T("content")},S("content")),Y=n({classNames:T("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},S("transition"));return b.createElement(Ro,v7({nodeRef:v},Y),b.createElement("div",R,b.createElement("div",ue,i.children)))},N=n({id:l,ref:g,style:i.style,className:ft(i.className,T("root"))},_3.getOtherProps(i),S("root")),z=F(),U=H(),ce=P();return b.createElement("div",N,z,U,ce)});ci.displayName="Panel";const ese=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`,C=`${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:C,children:`Rule ${A+1}`})]})},l=(m,A)=>{var C;const w=[...((C=e==null?void 0:e.conditionalTabRules)==null?void 0:C.rules)||[]];w[m].conditions=w[m].conditions.filter((S,T)=>A!==T),n(S=>({...S,conditionalTabRules:{...S.conditionalTabRules,rules:w}}))},c=m=>{var S;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],w=A.filter((T,x)=>m!==x);n(T=>({...T,conditionalTabRules:{...T.conditionalTabRules,rules:w}}));const C=A[m];(S=C==null?void 0:C.conditions)==null||S.map(T=>{const x=i?_t.findIndex(i,_=>{var M;return(_==null?void 0:_.uuid)===((M=T==null?void 0:T.tab)==null?void 0:M.uuid)}):-1,E=i[x];E&&(E.isHidden=!1,a(x,E))})};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 C=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];C[A].conditions[w].option=m==null?void 0:m.value,n(S=>({...S,conditionalTabRules:{...S.conditionalTabRules,rules:C}}))},f=(m,A,w)=>{const C=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];C[A].conditions[w].tab=m==null?void 0:m.value,n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:C}}));const S=_t.findIndex(i,x=>{var E;return(x==null?void 0:x.uuid)===((E=m==null?void 0:m.value)==null?void 0:E.uuid)}),T=i[S];T&&(T.isHidden=!0,a(S,T))},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(ci,{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,C)=>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(Pa,{value:w.tab,options:u,onChange:S=>f(S,A,C),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(Pa,{value:w==null?void 0:w.option,options:e==null?void 0:e.options,onChange:S=>d(S,A,C),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,C),tooltipOptions:{position:"top"}})})]})},C)),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"})]})},tse=t=>{var S;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:a,page:s}=t,[l]=k.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=sn(),d=(T,x)=>{const E=`${T.className} justify-content-start`,_=`${T.titleClassName} pl-1`;return o.jsxs("div",{className:E,children:[o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:T.togglerClassName,onClick:()=>f(x),"aria-label":"Submit"}),o.jsx("span",{className:_,children:`Rule ${x+1}`})]})},f=T=>{var M;const x=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],E=x[T];(M=E==null?void 0:E.conditions)==null||M.map(O=>{var H;const F=_t.findIndex(i,N=>{var z;return(N==null?void 0:N.uuid)===((z=O==null?void 0:O.tab)==null?void 0:z.uuid)}),P=i?_t.findIndex(i[F].children,N=>{var z;return(N==null?void 0:N.uuid)===((z=O==null?void 0:O.section)==null?void 0:z.uuid)}):-1;if(P>=0){const N=(H=i[F])==null?void 0:H.children[P];N&&(N.isHidden=!1,a(F,P,N))}});const _=x.filter((O,F)=>T!==F);n(O=>({...O,conditionalSectionRules:{...O.conditionalSectionRules,rules:_}}))},h=T=>{var _;let x=!1;const E=i?i.filter(function(M){return(M==null?void 0:M.uuid)===(T==null?void 0:T.uuid)}):[];return(E==null?void 0:E.length)>0&&((_=E[0].children)==null?void 0:_.length)>1&&(x=!0),x},g=(T,x,E)=>{const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[x].conditions[E].option=T==null?void 0:T.value,n(M=>({...M,conditionalSectionRules:{...M.conditionalSectionRules,rules:_}}))},v=(T,x)=>{var M;const E=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=E[T];(M=_==null?void 0:_.conditions)==null||M.map(O=>{var N;const F=_t.findIndex(i,z=>{var U;return(z==null?void 0:z.uuid)===((U=O==null?void 0:O.tab)==null?void 0:U.uuid)}),P=i?_t.findIndex(i[F].children,z=>{var U;return(z==null?void 0:z.uuid)===((U=O==null?void 0:O.section)==null?void 0:U.uuid)}):-1,H=(N=i[F])==null?void 0:N.children[P];console.log("sectionData",H),H&&(H.isHidden=!1,console.log("sectionData",H),a(F,P,H))}),E[T].conditions=E[T].conditions.filter((O,F)=>x!==F),n(O=>({...O,conditionalSectionRules:{...O.conditionalSectionRules,rules:E}}))},m=(T,x,E)=>{var H,N;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[x].conditions[E].section=T==null?void 0:T.value;const M=(N=(H=_[x].conditions[E])==null?void 0:H.tab)==null?void 0:N.uuid,O=_t.findIndex(i,z=>(z==null?void 0:z.uuid)===M);n(z=>({...z,conditionalSectionRules:{...z.conditionalSectionRules,rules:_}}));const F=i?_t.findIndex(i[O].children,z=>{var U;return(z==null?void 0:z.uuid)===((U=T==null?void 0:T.value)==null?void 0:U.uuid)}):-1,P=i[O].children[F];P&&(P.isHidden=!0,a(O,F,P))},A=T=>{const x=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];x[T].conditions=[...x[T].conditions,{option:null,tab:{title:s==null?void 0:s.title,uuid:s==null?void 0:s.uuid},section:null}],n(E=>({...E,conditionalSectionRules:{...E.conditionalSectionRules,rules:x}}))},w=()=>{n(x=>({...x,conditionalSectionRules:{...x.conditionalSectionRules,rules:[...x.conditionalSectionRules.rules,{uuid:rt(),conditions:[]}]}}));const T=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...T,{fieldId:e==null?void 0:e.uuid,uuid:rt(),conditions:[]}]})},C=T=>{var E;const x=i==null?void 0:i.filter(function(_){return(_==null?void 0:_.uuid)===(T==null?void 0:T.uuid)});if(x&&(x==null?void 0:x.length)>0){const _=(E=x[0])==null?void 0:E.children.filter(function(M){return(M==null?void 0:M.uuid)!==(r==null?void 0:r.uuid)});if((_==null?void 0:_.length)>0)return _}return l};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Sections"}),(S=e==null?void 0:e.conditionalSectionRules)==null?void 0:S.rules.map((T,x)=>o.jsx(ci,{className:"mb-3",header:`Rule ${x+1}`,headerTemplate:E=>d(E,x),children:o.jsxs("div",{children:[T==null?void 0:T.conditions.map((E,_)=>{var M,O;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:(O=(M=E==null?void 0:E.tab)==null?void 0:M.title)==null?void 0:O.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",E.value]}),o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E.section,options:C(E.tab),onChange:F=>m(F,x,_),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E==null?void 0:E.option,options:e==null?void 0:e.options,onChange:F=>g(F,x,_),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(x,_),tooltipOptions:{position:"top"}})]}),!h(E.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"]})})]})},_)}),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(x),size:"small"})})})]})},x)),o.jsx(Ft,{text:!0,icon:"pi pi-plus",onClick:()=>w(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},nse=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(ci,{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(Pa,{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"})]})},rse=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:a}=t,{pageSettingUpdate:s,formBuilderFormLayout:l,sectionSettingUpdate:c}=sn();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(nse,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(ese,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:s}),o.jsx("hr",{}),o.jsx(tse,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:a}),o.jsx("hr",{})]})})},ise=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=k.useState(""),[a,s]=k.useState([""]),[l,c]=k.useState(!1),[u,d]=k.useState(0),[f,h]=k.useState(!1),{updateGlobalToast:g}=Ht(),v=()=>{h(!0)},m=()=>{var z;const H=((z=e==null?void 0:e.reviewerChecklist)==null?void 0:z.length)>=0?[...e.reviewerChecklist]:[];H.push({uuid:rt(),checklist:r,action:a,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const N={...e,reviewerChecklist:H};n(U=>({...U,...N})),h(!1),i(""),s([""])},A=()=>{h(!1),i(""),s([""])},w=H=>{const N=[...e.reviewerChecklist];N.splice(H,1);const z={...e,reviewerChecklist:N};n(U=>({...U,...z}))},C=(H,N)=>{c(!0);const{checklist:z,action:U}=H;h(!0),d(N),setTimeout(()=>{i(z),s(U)},1e3)},S=(H,N)=>o.jsxs(o.Fragment,{children:[o.jsx(Ft,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>C(H,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)})]}),T=H=>{var N;return o.jsx(o.Fragment,{children:(N=H==null?void 0:H.action)==null?void 0:N.length})},x=H=>{const N=[...a];N.splice(H,1),s(N)},E=()=>{const H=[...e.reviewerChecklist];H[u]={checklist:r,action:a};const N={...e,reviewerChecklist:H};n(z=>({...z,...N})),h(!1),c(!1)},_=()=>o.jsx("div",{children:l?o.jsx(Ft,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{E()}}):o.jsx(Ft,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{m()}})}),M=H=>{n(N=>({...N,reviewerChecklist:H==null?void 0:H.value}))},O=H=>{navigator.clipboard.writeText(JSON.stringify(H))};function F(H){try{JSON.parse(H)}catch{return!1}return!0}const P=async()=>{var z;const H=await navigator.clipboard.readText();let N="";if(F(H)){const U=JSON.parse(H);if((z=U[0])!=null&&z.checklist){const ce={..._t.cloneDeep(e),reviewerChecklist:U};n(X=>({...X,...ce}));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(Os,{maximizable:!0,header:"Add Checklist options for admin to reveiw",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:_(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(so,{rows:2,cols:50,value:r,onChange:H=>{var N;i((N=H==null?void 0:H.target)==null?void 0:N.value)}}),o.jsx("h5",{children:"Actions when admin selects NO as invalid"}),a.map((H,N)=>o.jsxs("div",{children:[N+1,"."," ",o.jsx(so,{value:H,onChange:z=>{var ce;const U=[...a];U[N]=(ce=z==null?void 0:z.target)==null?void 0:ce.value,s(U)},rows:2,cols:50})," ",o.jsx(Ft,{text:!0,type:"button",icon:"pi pi-trash",className:"p-button-danger",onClick:()=>x(N)}),o.jsx("br",{}),o.jsx("br",{})]},`actionIndex-${N}`)),o.jsx(Ft,{outlined:!0,className:" p-button-primary mr-2",onClick:()=>{s([...a,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx(Ft,{className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{v()}}),o.jsx(Ft,{outlined:!0,label:"Copy Schema ",onClick:()=>{O([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx(Ft,{outlined:!0,label:"Paste Checklist ",onClick:()=>{P()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:M,scrollable:!0,children:[o.jsx(xr,{rowReorder:!0,style:{width:"3em"}}),o.jsx(xr,{field:"checklist",header:"Checklist"}),o.jsx(xr,{field:"actions",header:"Actions",body:H=>T(H)}),o.jsx(xr,{header:"",body:(H,N)=>S(H,N)})]})})]})},ase=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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}})]})]})},sse=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=sn(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:rt(),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(ia,{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(ia,{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(ia,{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(ia,{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(Pa,{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(Pa,{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(ao,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(io,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(fN,{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"})]})})]})},ose=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t,{userSelectedLanguage:s}=sn(),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(Yr,{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(ts,{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(wr,{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(ia,{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(Yr,{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(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ci,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(nD,{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(wr,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(b7,{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}`)}))})]})]})},b7=t=>{var s,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t;return o.jsx(o.Fragment,{children:o.jsx(ts,{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(wr,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(ose,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})},`hirarchey-option-${u}`)))})})};var gN={},lse=Fi&&Fi.__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)}}(),D3=Fi&&Fi.__assign||function(){return D3=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},D3.apply(this,arguments)},cse=Fi&&Fi.__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]}),use=Fi&&Fi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mN=Fi&&Fi.__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)&&cse(e,t,n);return use(e,t),e},dse=Fi&&Fi.__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},fse=Fi&&Fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gN,"__esModule",{value:!0});var y7=mN(k),hse=fse(GI),Zu=mN(la);function vN(t){return t&&t.replace(/ |\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function pse(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 gse=function(t){lse(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}:y7.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=dse(r,["tagName","html","innerRef"]);return y7.createElement(i||"div",D3(D3({},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||vN(n.html)!==vN(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,hse.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,pse(n))},e.propTypes={html:Zu.string.isRequired,onChange:Zu.func,disabled:Zu.bool,tagName:Zu.string,className:Zu.string,style:Zu.object,innerRef:Zu.oneOfType([Zu.object,Zu.func])},e}(y7.Component),N3=gN.default=gse;const mse=t=>{var w;const e=k.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,path:c}=t,[u,d]=k.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),m=(C,S,T)=>{d(x=>({...x,[C]:{...x[C],[S==null?void 0:S.type]:T}}))};k.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const C=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(C[fa],C[ha],C[Ca],C[xa],C[Ta],C[Fa],C[Xo],C[wo],u):(C==null?void 0:C.length)>Fa&&(C==null?void 0:C.length)===Bl+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(C[fa],C[ha],C[Ca],C[xa],C[Ta],C[5],C[6],C[7],u):h(i,a,s,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(N3,{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:C=>{var S;m("label",f,(S=C==null?void 0:C.target)==null?void 0:S.value)},tagName:"article"})})},ca=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=sn();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(F8,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},A7=t=>{var f,h,g,v,m,A,w,C,S,T,x,E,_,M;const{field:e,update:n,value:r,isFirst:i,isDisabled:a}=t,{isBuilderMode:s,isAdmin:l}=Ht(),{selectedLanguage:c}=sn(),[u,d]=k.useState(0);return k.useEffect(()=>{const O=Gt.addListener("onSubmitUserForm",()=>{var P;(P=e==null?void 0:e.attributes)!=null&&P.required?r!=null&&r[e.uuid]?e.isValid=t3:e.isValid=D8:e.isValid=1}),F=Gt.addListener("OnInvalidFieldCatch",P=>{(e==null?void 0:e.uuid)===(P==null?void 0:P.fieldId)?d(N8):d(O8)});return()=>{O.remove(),F.remove()}}),o.jsxs("div",{className:"",children:[(e==null?void 0:e.type)===yZ&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex align-items-center mb-3",children:[" ",i===!0&&o.jsx(ca,{...t}),((f=e==null?void 0:e.attributes)==null?void 0:f.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",s?o.jsx(mse,{...t}):o.jsx("div",{className:"text-gray-900 font-bold text-xl",children:(h=e==null?void 0:e.label)==null?void 0:h[c]})]}),((g=e==null?void 0:e.options)==null?void 0:g.length)&&((v=e==null?void 0:e.options)==null?void 0:v.map(O=>{var F,P;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(ia,{inputId:O.uuid,name:e==null?void 0:e.uuid,value:O.uuid,onChange:H=>{(!l||!a)&&n(e==null?void 0:e.uuid,H==null?void 0:H.value)},checked:(r==null?void 0:r[e.uuid])===O.uuid,disabled:l||a}),o.jsx("label",{htmlFor:O.uuid,className:"ml-2",children:O.label})]}),(O==null?void 0:O.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(O==null?void 0:O.uuid)&&(O==null?void 0:O.children)&&((F=O==null?void 0:O.children)==null?void 0:F.length)>0&&((P=O==null?void 0:O.children)==null?void 0:P.map(()=>o.jsx(A7,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${O.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)===AZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((m=e==null?void 0:e.attributes)==null?void 0:m.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(wn,{className:"mt-2",onChange:O=>{var F;return n(e==null?void 0:e.uuid,(F=O==null?void 0:O.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(A=e==null?void 0:e.placeholder)==null?void 0:A[c],disabled:l||a})]})}),(e==null?void 0:e.type)===wZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((w=e==null?void 0:e.attributes)==null?void 0:w.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(ef,{className:"mt-2",onChange:O=>{var F;return n(e==null?void 0:e.uuid,(F=O==null?void 0:O.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(C=e==null?void 0:e.placeholder)==null?void 0:C[c],disabled:l||a})]})}),(e==null?void 0:e.type)===SZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((S=e==null?void 0:e.attributes)==null?void 0:S.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(so,{className:"mt-2",onChange:O=>{var F;return n(e==null?void 0:e.uuid,(F=O==null?void 0:O.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(T=e==null?void 0:e.placeholder)==null?void 0:T[c],disabled:l||a})]})}),o.jsx("div",{children:((x=e==null?void 0:e.helperText)==null?void 0:x[c])!==""&&o.jsx("small",{children:(E=e==null?void 0:e.helperText)==null?void 0:E[c]})}),o.jsx("div",{children:((_=e==null?void 0:e.attributes)==null?void 0:_.required)&&o.jsx("small",{className:"error",children:u===1&&!(r!=null&&r[e.uuid])?(M=e==null?void 0:e.validationMesssage)==null?void 0:M.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},vse=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=k.useState({});return o.jsx("div",{children:o.jsx(A7,{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:""})})},w7={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},bse={uuid:rt(),...w7,type:"radio",value:null,options:[{uuid:rt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:rt(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:rt(),...w7,options:(rt(),{uuid:rt(),...w7,options:(rt(),rt())},rt())});const yse=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,{...bse,isValid:0,uuid:rt(),options:[{uuid:rt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:rt(),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(b7,{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(vse,{hirarechicalRadioSchemaState:e})]})]})})})},Qi=t=>{var Z;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:a,formBuilderFormLayout:s,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=sn(),{renderType:u}=Ht(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:v,rowIndex:m,columnIndex:A,fieldIndex:w,path:C,row:S,typeName:T}=t,{updateGlobalToast:x}=Ht(),[E,_]=k.useState(f),M=C.split("-"),O=()=>{const K=C.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[Fa],K[Xo],K[wo],E):(K==null?void 0:K.length)>Fa&&(K==null?void 0:K.length)===Bl+1&&(E!=null&&E.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[5],K[6],K[7],E):(n(g,v,m,A,w,{...E}),setTimeout(()=>{Gt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Gt.emit("onUpdateField",{})},1e3)),x({showToast:!0,toastMessage:"Updated",toastDetail:`${T} updated`,toastType:"success"})},F=(K,W,ge)=>{_(ye=>({...ye,[K]:{...ye[K],[W==null?void 0:W.type]:ge}}))},P=(K,W)=>{_(ge=>({...ge,attributes:{...ge.attributes,[K]:W}}))},H=(K,W)=>{_(ge=>({...ge,[K]:W}))},N=(K,W)=>{_(ge=>({...ge,inlineConditional:{...ge.inlineConditional,[K]:W}}))},z=()=>{},U=()=>{_(K=>({...K,data:[...K.data,{uuid:rt(),dataKey:"",value:""}]}))},ce=()=>{_(K=>Object.assign({},K,{options:[...K.options,{uuid:rt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},X=()=>{},R=()=>{},ue=()=>{},Y=()=>{},ie=K=>{var Ee;const W=[...(E==null?void 0:E.conditionalTabRules.rules)||[]],ge=W.filter((Ae,fe)=>K!==fe);_(Ae=>({...Ae,conditionalTabRules:{...Ae.conditionalTabRules,rules:ge}}));const ye=W[K];(Ee=ye==null?void 0:ye.conditions)==null||Ee.map(Ae=>{const fe=_t.findIndex(s,q=>{var ee;return(q==null?void 0:q.uuid)===((ee=Ae==null?void 0:Ae.tab)==null?void 0:ee.uuid)}),ne=s[fe];ne&&(ne.isHidden=!1,a(fe,ne))})},re=(K,W)=>{const ge=[...(E==null?void 0:E.conditionalTabRules.rules)||[]];ge[K].conditions=ge[K].conditions.filter((ye,Ee)=>W!==Ee),_(ye=>({...ye,conditionalTabRules:{...ye.conditionalTabRules,rules:ge}}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),header:()=>{var K;return o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[(K=f==null?void 0:f.label)==null?void 0:K.english," "]})})},"aria-label":"Field Setting Sidebar",children:[o.jsx("div",{className:"",children:o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(nD,{language:K,fieldState:E,onHandleChange:F,...t})},W)):""})})}),(E==null?void 0:E.isValidationTabEnabled)===!0&&o.jsx(wr,{header:"Validation",children:o.jsx(xte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P,...t})}),o.jsx(wr,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Tte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P})})}),(E==null?void 0:E.isLayoutTabEnabled)===!0&&o.jsx(wr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Bte,{fieldState:E,onHandleChangeLayoutSettings:H})})}),(E==null?void 0:E.isDynamicListingTabEnabled)===!0&&o.jsx(wr,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(sse,{fieldState:E,setFieldState:_})})}),(E==null?void 0:E.options)!==void 0&&(E==null?void 0:E.data)&&o.jsx(wr,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(Vte,{onHandleChangeLayoutSettings:H,fieldState:E,setFieldState:_}),o.jsx(Ft,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>U(),"aria-label":"Add"})]})}),o.jsx(wr,{header:"Table view options",children:o.jsx(ase,{fieldState:E,onHandleChangeLayoutSettings:H})}),(E==null?void 0:E.componentType)!=="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(wr,{header:"Options",children:[(E==null?void 0:E.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:()=>ce(),"aria-label":"Option"})}),o.jsxs("div",{className:"scroll-height-200 px-4",children:[o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(fN,{enableAbbreviationColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableHyperTextColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableAddNewColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableCopyPaste:(E==null?void 0:E.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:E,setFieldState:_,language:K})},W)):""}),(E==null?void 0:E.isHierarchalCondionalTabEnabled)===!0&&o.jsx(b7,{fieldState:E,onHandleChangeLayoutSettings:H,removeChildrenField:Y,addChildrenField:ue,updateChildrenField:R,updateCondtionOption:X})]})]}),(E==null?void 0:E.componentType)==="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(wr,{header:"Hierarchal Options",children:o.jsx(yse,{fieldState:E,setFieldState:_})}),u===e3&&(E==null?void 0:E.inlineConditionalRules)!==void 0&&!(S!=null&&S.rowIsRepeatable)&&(M==null?void 0:M.length)<wo+1&&o.jsx(wr,{header:"Conditional",children:o.jsx(rse,{handleRemoveConditionalTabRule:ie,handleRemoveConditionalTabRuleCondition:re,onHandleSelectInlineConditionalOption:z,onHandleChangeLayoutSettings:H,onHandleChangeInlineConditionaltSetttings:N,fieldState:E,setFieldState:_,pageIndex:g,sectionIndex:v,...t})}),!((Z=t==null?void 0:t.row)!=null&&Z.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(wr,{header:"Admin",children:o.jsx(ise,{fieldState:E,setFieldState:_})})]})}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ft,{text:!0,label:"Close",type:"button",icon:"pi pi-times",onClick:()=>h(),"aria-label":"Close",size:"small",className:"p-button-danger"}),!l&&o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>O(),"aria-label":"Update"})]})})]})})},ki=t=>{const[e,n]=k.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:a}=Ar();k.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:e!==null&&(e==null?void 0:e.length)>0?o.jsx("div",{className:"col-12",children:o.jsx(ts,{children:o.jsx(wr,{header:"Admin Review",children:o.jsx("div",{className:"grid",children:e==null?void 0:e.map((h,g)=>{var v,m,A,w,C;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(ia,{inputId:`yes-${g}`,name:"action",value:!0,onChange:S=>{l(S,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(ia,{inputId:`no-${g}`,name:"action",value:!1,onChange:S=>{l(S,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((S,T)=>{var x;return o.jsxs("div",{children:[o.jsx(Yr,{value:S,checked:((x=h==null?void 0:h.selectAction)==null?void 0:x.length)>0?h==null?void 0:h.selectAction.some(E=>E===S):!1,onChange:E=>{c(g,E)}})," ",S," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${g}-${T}`)})),o.jsx(Yr,{checked:(A=h==null?void 0:h.other)==null?void 0:A.isOther,onChange:S=>{u(S,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(so,{className:"mt-3",value:(C=h==null?void 0:h.other)==null?void 0:C.description,onChange:S=>d(S,g)})]})]}),(h==null?void 0:h.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:h==null?void 0:h.reviewerFeedback,onChange:S=>f(S,"reviewerFeedback",g)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:h==null?void 0:h.reviewerComments,onChange:S=>f(S,"reviewerComments",g)})]})]})},`checklistIndex-${g}`)})})})})}):o.jsx(o.Fragment,{})})},xi=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:a}=sn(),{globalAlignment:s}=Ht(),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(Qt,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=Ar(),[d,f]=k.useState("");k.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(ci,{headerTemplate:l,toggleable:!0,children:i}):i})})};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:bN,setPrototypeOf:yN,isFrozen:Ase,getPrototypeOf:wse,getOwnPropertyDescriptor:Sse}=Object;let{freeze:Eo,seal:jl,create:AN}=Object,{apply:S7,construct:C7}=typeof Reflect<"u"&&Reflect;Eo||(Eo=function(e){return e}),jl||(jl=function(e){return e}),S7||(S7=function(e,n,r){return e.apply(n,r)}),C7||(C7=function(e,n){return new e(...n)});const O3=ml(Array.prototype.forEach),wN=ml(Array.prototype.pop),Jp=ml(Array.prototype.push),F3=ml(String.prototype.toLowerCase),x7=ml(String.prototype.toString),SN=ml(String.prototype.match),Zp=ml(String.prototype.replace),Cse=ml(String.prototype.indexOf),xse=ml(String.prototype.trim),xc=ml(Object.prototype.hasOwnProperty),Io=ml(RegExp.prototype.test),e2=Tse(TypeError);function ml(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 S7(t,e,r)}}function Tse(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return C7(t,n)}}function hi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:F3;yN&&yN(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=n(i);a!==i&&(Ase(e)||(e[r]=a),i=a)}t[i]=!0}return t}function Ese(t){for(let e=0;e<t.length;e++)xc(t,e)||(t[e]=null);return t}function J0(t){const e=AN(null);for(const[n,r]of bN(t))xc(t,n)&&(Array.isArray(r)?e[n]=Ese(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=J0(r):e[n]=r);return e}function t2(t,e){for(;t!==null;){const r=Sse(t,e);if(r){if(r.get)return ml(r.get);if(typeof r.value=="function")return ml(r.value)}t=wse(t)}function n(){return null}return n}const CN=Eo(["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"]),T7=Eo(["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"]),E7=Eo(["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"]),Ise=Eo(["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"]),I7=Eo(["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"]),_se=Eo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xN=Eo(["#text"]),TN=Eo(["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"]),_7=Eo(["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"]),EN=Eo(["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"]),k3=Eo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dse=jl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nse=jl(/<%[\w\W]*|[\w\W]*%>/gm),Ose=jl(/\${[\w\W]*}/gm),Fse=jl(/^data-[\-\w.\u00B7-\uFFFF]/),kse=jl(/^aria-[\-\w]+$/),IN=jl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pse=jl(/^(?:\w+script|data):/i),Mse=jl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_N=jl(/^html$/i),Lse=jl(/^[a-z][.\w]*(-[.\w]+)+$/i);var DN=Object.freeze({__proto__:null,MUSTACHE_EXPR:Dse,ERB_EXPR:Nse,TMPLIT_EXPR:Ose,DATA_ATTR:Fse,ARIA_ATTR:kse,IS_ALLOWED_URI:IN,IS_SCRIPT_OR_DATA:Pse,ATTR_WHITESPACE:Mse,DOCTYPE_NAME:_N,CUSTOM_ELEMENT:Lse});const n2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Bse=function(){return typeof window>"u"?null:window},Vse=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}};function NN(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bse();const e=It=>NN(It);if(e.version="3.1.7",e.removed=[],!t||!t.document||t.document.nodeType!==n2.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=t2(v,"cloneNode"),A=t2(v,"remove"),w=t2(v,"nextSibling"),C=t2(v,"childNodes"),S=t2(v,"parentNode");if(typeof s=="function"){const It=n.createElement("template");It.content&&It.content.ownerDocument&&(n=It.content.ownerDocument)}let T,x="";const{implementation:E,createNodeIterator:_,createDocumentFragment:M,getElementsByTagName:O}=n,{importNode:F}=r;let P={};e.isSupported=typeof bN=="function"&&typeof S=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:N,TMPLIT_EXPR:z,DATA_ATTR:U,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:ue}=DN;let{IS_ALLOWED_URI:Y}=DN,ie=null;const re=hi({},[...CN,...T7,...E7,...I7,...xN]);let Z=null;const K=hi({},[...TN,..._7,...EN,...k3]);let W=Object.seal(AN(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}})),ge=null,ye=null,Ee=!0,Ae=!0,fe=!1,ne=!0,q=!1,ee=!0,oe=!1,he=!1,De=!1,Ne=!1,ve=!1,Se=!1,Be=!0,Te=!1;const $="user-content-";let pe=!0,me=!1,ae={},le=null;const be=hi({},["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 Ie=null;const Pe=hi({},["audio","video","img","source","image","track"]);let ze=null;const Ze=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",ht="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let fn=Ut,$t=!1,mn=null;const En=hi({},[nt,ht,Ut],x7);let Tt=null;const je=["application/xhtml+xml","text/html"],He="text/html";let ot=null,rn=null;const nn=n.createElement("form"),Jt=function(Fe){return Fe instanceof RegExp||Fe instanceof Function},_n=function(){let Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rn&&rn===Fe)){if((!Fe||typeof Fe!="object")&&(Fe={}),Fe=J0(Fe),Tt=je.indexOf(Fe.PARSER_MEDIA_TYPE)===-1?He:Fe.PARSER_MEDIA_TYPE,ot=Tt==="application/xhtml+xml"?x7:F3,ie=xc(Fe,"ALLOWED_TAGS")?hi({},Fe.ALLOWED_TAGS,ot):re,Z=xc(Fe,"ALLOWED_ATTR")?hi({},Fe.ALLOWED_ATTR,ot):K,mn=xc(Fe,"ALLOWED_NAMESPACES")?hi({},Fe.ALLOWED_NAMESPACES,x7):En,ze=xc(Fe,"ADD_URI_SAFE_ATTR")?hi(J0(Ze),Fe.ADD_URI_SAFE_ATTR,ot):Ze,Ie=xc(Fe,"ADD_DATA_URI_TAGS")?hi(J0(Pe),Fe.ADD_DATA_URI_TAGS,ot):Pe,le=xc(Fe,"FORBID_CONTENTS")?hi({},Fe.FORBID_CONTENTS,ot):be,ge=xc(Fe,"FORBID_TAGS")?hi({},Fe.FORBID_TAGS,ot):{},ye=xc(Fe,"FORBID_ATTR")?hi({},Fe.FORBID_ATTR,ot):{},ae=xc(Fe,"USE_PROFILES")?Fe.USE_PROFILES:!1,Ee=Fe.ALLOW_ARIA_ATTR!==!1,Ae=Fe.ALLOW_DATA_ATTR!==!1,fe=Fe.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=Fe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=Fe.SAFE_FOR_TEMPLATES||!1,ee=Fe.SAFE_FOR_XML!==!1,oe=Fe.WHOLE_DOCUMENT||!1,Ne=Fe.RETURN_DOM||!1,ve=Fe.RETURN_DOM_FRAGMENT||!1,Se=Fe.RETURN_TRUSTED_TYPE||!1,De=Fe.FORCE_BODY||!1,Be=Fe.SANITIZE_DOM!==!1,Te=Fe.SANITIZE_NAMED_PROPS||!1,pe=Fe.KEEP_CONTENT!==!1,me=Fe.IN_PLACE||!1,Y=Fe.ALLOWED_URI_REGEXP||IN,fn=Fe.NAMESPACE||Ut,W=Fe.CUSTOM_ELEMENT_HANDLING||{},Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&typeof Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(Ae=!1),ve&&(Ne=!0),ae&&(ie=hi({},xN),Z=[],ae.html===!0&&(hi(ie,CN),hi(Z,TN)),ae.svg===!0&&(hi(ie,T7),hi(Z,_7),hi(Z,k3)),ae.svgFilters===!0&&(hi(ie,E7),hi(Z,_7),hi(Z,k3)),ae.mathMl===!0&&(hi(ie,I7),hi(Z,EN),hi(Z,k3))),Fe.ADD_TAGS&&(ie===re&&(ie=J0(ie)),hi(ie,Fe.ADD_TAGS,ot)),Fe.ADD_ATTR&&(Z===K&&(Z=J0(Z)),hi(Z,Fe.ADD_ATTR,ot)),Fe.ADD_URI_SAFE_ATTR&&hi(ze,Fe.ADD_URI_SAFE_ATTR,ot),Fe.FORBID_CONTENTS&&(le===be&&(le=J0(le)),hi(le,Fe.FORBID_CONTENTS,ot)),pe&&(ie["#text"]=!0),oe&&hi(ie,["html","head","body"]),ie.table&&(hi(ie,["tbody"]),delete ge.tbody),Fe.TRUSTED_TYPES_POLICY){if(typeof Fe.TRUSTED_TYPES_POLICY.createHTML!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Fe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=Fe.TRUSTED_TYPES_POLICY,x=T.createHTML("")}else T===void 0&&(T=Vse(g,i)),T!==null&&typeof x=="string"&&(x=T.createHTML(""));Eo&&Eo(Fe),rn=Fe}},wt=hi({},["mi","mo","mn","ms","mtext"]),Ke=hi({},["annotation-xml"]),st=hi({},["title","style","font","a","script"]),vt=hi({},[...T7,...E7,...Ise]),Vt=hi({},[...I7,..._se]),On=function(Fe){let Qe=S(Fe);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:fn,tagName:"template"});const At=F3(Fe.tagName),jt=F3(Qe.tagName);return mn[Fe.namespaceURI]?Fe.namespaceURI===ht?Qe.namespaceURI===Ut?At==="svg":Qe.namespaceURI===nt?At==="svg"&&(jt==="annotation-xml"||wt[jt]):!!vt[At]:Fe.namespaceURI===nt?Qe.namespaceURI===Ut?At==="math":Qe.namespaceURI===ht?At==="math"&&Ke[jt]:!!Vt[At]:Fe.namespaceURI===Ut?Qe.namespaceURI===ht&&!Ke[jt]||Qe.namespaceURI===nt&&!wt[jt]?!1:!Vt[At]&&(st[At]||!vt[At]):!!(Tt==="application/xhtml+xml"&&mn[Fe.namespaceURI]):!1},$n=function(Fe){Jp(e.removed,{element:Fe});try{S(Fe).removeChild(Fe)}catch{A(Fe)}},lr=function(Fe,Qe){try{Jp(e.removed,{attribute:Qe.getAttributeNode(Fe),from:Qe})}catch{Jp(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(Fe),Fe==="is"&&!Z[Fe])if(Ne||ve)try{$n(Qe)}catch{}else try{Qe.setAttribute(Fe,"")}catch{}},Wn=function(Fe){let Qe=null,At=null;if(De)Fe="<remove></remove>"+Fe;else{const Zt=SN(Fe,/^[\r\n\t ]+/);At=Zt&&Zt[0]}Tt==="application/xhtml+xml"&&fn===Ut&&(Fe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Fe+"</body></html>");const jt=T?T.createHTML(Fe):Fe;if(fn===Ut)try{Qe=new h().parseFromString(jt,Tt)}catch{}if(!Qe||!Qe.documentElement){Qe=E.createDocument(fn,"template",null);try{Qe.documentElement.innerHTML=$t?x:jt}catch{}}const Xt=Qe.body||Qe.documentElement;return Fe&&At&&Xt.insertBefore(n.createTextNode(At),Xt.childNodes[0]||null),fn===Ut?O.call(Qe,oe?"html":"body")[0]:oe?Qe.documentElement:Xt},vr=function(Fe){return _.call(Fe.ownerDocument||Fe,Fe,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Nr=function(Fe){return Fe instanceof f&&(typeof Fe.nodeName!="string"||typeof Fe.textContent!="string"||typeof Fe.removeChild!="function"||!(Fe.attributes instanceof d)||typeof Fe.removeAttribute!="function"||typeof Fe.setAttribute!="function"||typeof Fe.namespaceURI!="string"||typeof Fe.insertBefore!="function"||typeof Fe.hasChildNodes!="function")},yn=function(Fe){return typeof l=="function"&&Fe instanceof l},lt=function(Fe,Qe,At){P[Fe]&&O3(P[Fe],jt=>{jt.call(e,Qe,At,rn)})},ut=function(Fe){let Qe=null;if(lt("beforeSanitizeElements",Fe,null),Nr(Fe))return $n(Fe),!0;const At=ot(Fe.nodeName);if(lt("uponSanitizeElement",Fe,{tagName:At,allowedTags:ie}),Fe.hasChildNodes()&&!yn(Fe.firstElementChild)&&Io(/<[/\w]/g,Fe.innerHTML)&&Io(/<[/\w]/g,Fe.textContent)||Fe.nodeType===n2.progressingInstruction||ee&&Fe.nodeType===n2.comment&&Io(/<[/\w]/g,Fe.data))return $n(Fe),!0;if(!ie[At]||ge[At]){if(!ge[At]&&Nt(At)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At)))return!1;if(pe&&!le[At]){const jt=S(Fe)||Fe.parentNode,Xt=C(Fe)||Fe.childNodes;if(Xt&&jt){const Zt=Xt.length;for(let Sn=Zt-1;Sn>=0;--Sn){const Ln=m(Xt[Sn],!0);Ln.__removalCount=(Fe.__removalCount||0)+1,jt.insertBefore(Ln,w(Fe))}}}return $n(Fe),!0}return Fe instanceof c&&!On(Fe)||(At==="noscript"||At==="noembed"||At==="noframes")&&Io(/<\/no(script|embed|frames)/i,Fe.innerHTML)?($n(Fe),!0):(q&&Fe.nodeType===n2.text&&(Qe=Fe.textContent,O3([H,N,z],jt=>{Qe=Zp(Qe,jt," ")}),Fe.textContent!==Qe&&(Jp(e.removed,{element:Fe.cloneNode()}),Fe.textContent=Qe)),lt("afterSanitizeElements",Fe,null),!1)},yt=function(Fe,Qe,At){if(Be&&(Qe==="id"||Qe==="name")&&(At in n||At in nn))return!1;if(!(Ae&&!ye[Qe]&&Io(U,Qe))){if(!(Ee&&Io(ce,Qe))){if(!Z[Qe]||ye[Qe]){if(!(Nt(Fe)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,Fe)||W.tagNameCheck instanceof Function&&W.tagNameCheck(Fe))&&(W.attributeNameCheck instanceof RegExp&&Io(W.attributeNameCheck,Qe)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(Qe))||Qe==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At))))return!1}else if(!ze[Qe]){if(!Io(Y,Zp(At,R,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&Fe!=="script"&&Cse(At,"data:")===0&&Ie[Fe])){if(!(fe&&!Io(X,Zp(At,R,"")))){if(At)return!1}}}}}}return!0},Nt=function(Fe){return Fe!=="annotation-xml"&&SN(Fe,ue)},An=function(Fe){lt("beforeSanitizeAttributes",Fe,null);const{attributes:Qe}=Fe;if(!Qe)return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z};let jt=Qe.length;for(;jt--;){const Xt=Qe[jt],{name:Zt,namespaceURI:Sn,value:Ln}=Xt,zn=ot(Zt);let at=Zt==="value"?Ln:xse(Ln);if(At.attrName=zn,At.attrValue=at,At.keepAttr=!0,At.forceKeepAttr=void 0,lt("uponSanitizeAttribute",Fe,At),at=At.attrValue,At.forceKeepAttr||(lr(Zt,Fe),!At.keepAttr))continue;if(!ne&&Io(/\/>/i,at)){lr(Zt,Fe);continue}q&&O3([H,N,z],Me=>{at=Zp(at,Me," ")});const se=ot(Fe.nodeName);if(yt(se,zn,at)){if(Te&&(zn==="id"||zn==="name")&&(lr(Zt,Fe),at=$+at),ee&&Io(/((--!?|])>)|<\/(style|title)/i,at)){lr(Zt,Fe);continue}if(T&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Sn)switch(g.getAttributeType(se,zn)){case"TrustedHTML":{at=T.createHTML(at);break}case"TrustedScriptURL":{at=T.createScriptURL(at);break}}try{Sn?Fe.setAttributeNS(Sn,Zt,at):Fe.setAttribute(Zt,at),Nr(Fe)?$n(Fe):wN(e.removed)}catch{}}}lt("afterSanitizeAttributes",Fe,null)},Nn=function It(Fe){let Qe=null;const At=vr(Fe);for(lt("beforeSanitizeShadowDOM",Fe,null);Qe=At.nextNode();)lt("uponSanitizeShadowNode",Qe,null),!ut(Qe)&&(Qe.content instanceof a&&It(Qe.content),An(Qe));lt("afterSanitizeShadowDOM",Fe,null)};return e.sanitize=function(It){let Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,At=null,jt=null,Xt=null;if($t=!It,$t&&(It="<!-->"),typeof It!="string"&&!yn(It))if(typeof It.toString=="function"){if(It=It.toString(),typeof It!="string")throw e2("dirty is not a string, aborting")}else throw e2("toString is not a function");if(!e.isSupported)return It;if(he||_n(Fe),e.removed=[],typeof It=="string"&&(me=!1),me){if(It.nodeName){const Ln=ot(It.nodeName);if(!ie[Ln]||ge[Ln])throw e2("root node is forbidden and cannot be sanitized in-place")}}else if(It instanceof l)Qe=Wn("<!---->"),At=Qe.ownerDocument.importNode(It,!0),At.nodeType===n2.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?Qe=At:Qe.appendChild(At);else{if(!Ne&&!q&&!oe&&It.indexOf("<")===-1)return T&&Se?T.createHTML(It):It;if(Qe=Wn(It),!Qe)return Ne?null:Se?x:""}Qe&&De&&$n(Qe.firstChild);const Zt=vr(me?It:Qe);for(;jt=Zt.nextNode();)ut(jt)||(jt.content instanceof a&&Nn(jt.content),An(jt));if(me)return It;if(Ne){if(ve)for(Xt=M.call(Qe.ownerDocument);Qe.firstChild;)Xt.appendChild(Qe.firstChild);else Xt=Qe;return(Z.shadowroot||Z.shadowrootmode)&&(Xt=F.call(r,Xt,!0)),Xt}let Sn=oe?Qe.outerHTML:Qe.innerHTML;return oe&&ie["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Io(_N,Qe.ownerDocument.doctype.name)&&(Sn="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`>
|
|
2289
|
+
`}}),ci=b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=_3.getProps(t,r),a=b.useState(i.id),s=pN(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=pN(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",C=_3.setMetaData({props:i,state:{id:l,collapsed:m}}),S=C.ptm,T=C.cx,x=C.isUnstyled;li(_3.css.styles,x,{name:"panel"});var E=function(R){i.toggleable&&(m?_(R):M(R),R&&(i.onToggle&&i.onToggle({originalEvent:R,value:!m}),R.preventDefault()))},_=function(R){i.onToggle||h(!1),i.onExpand&&R&&i.onExpand(R)},M=function(R){i.onToggle||h(!0),i.onCollapse&&R&&i.onCollapse(R)};b.useImperativeHandle(e,function(){return{props:i,toggle:E,expand:_,collapse:M,getElement:function(){return g.current},getContent:function(){return v.current}}}),Li(function(){l||c(So())});var O=function(){if(i.toggleable){var R=l+"_label",ue=n({className:T("toggler"),onClick:E,id:R,"aria-controls":w,"aria-expanded":!m,type:"button",role:"button","aria-label":i.header},S("toggler")),Y=n(S("togglericon")),ie=m?i.expandIcon||b.createElement(Mm,Y):i.collapseIcon||b.createElement(n8,Y),re=nr.getJSXIcon(ie,Y,{props:i,collapsed:m});return b.createElement("button",ue,re,b.createElement(Qt,null))}return null},F=function(){var R=ke.getJSXElement(i.header,i),ue=ke.getJSXElement(i.icons,i),Y=O(),ie=n({id:A,className:T("title")},S("title")),re=b.createElement("span",ie,R),Z=n({className:T("icons")},S("icons")),K=b.createElement("div",Z,ue,Y),W=n({className:T("header")},S("header")),ge=b.createElement("div",W,re,K);if(i.headerTemplate){var ye={className:"p-panel-header",titleClassName:"p-panel-title",iconsClassName:"p-panel-icons",togglerClassName:"p-panel-header-icon p-panel-toggler p-link",onTogglerClick:E,titleElement:re,iconsElement:K,togglerElement:Y,element:ge,id:l+"_header",props:i,collapsed:m};return ke.getJSXElement(i.headerTemplate,ye)}else if(i.header||i.toggleable)return ge;return null},P=function(){var R=ke.getJSXElement(i.footer,i),ue=n({className:T("footer")},S("footer")),Y=b.createElement("div",ue,R);if(i.footerTemplate){var ie={className:T("footer"),element:Y,props:i};return ke.getJSXElement(i.footerTemplate,ie)}else if(i.footer)return Y;return null},H=function(){var R=n({ref:v,className:T("toggleableContent"),"aria-hidden":m,role:"region",id:w,"aria-labelledby":A},S("toggleablecontent")),ue=n({className:T("content")},S("content")),Y=n({classNames:T("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},S("transition"));return b.createElement(Ro,v7({nodeRef:v},Y),b.createElement("div",R,b.createElement("div",ue,i.children)))},N=n({id:l,ref:g,style:i.style,className:ft(i.className,T("root"))},_3.getOtherProps(i),S("root")),z=F(),U=H(),ce=P();return b.createElement("div",N,z,U,ce)});ci.displayName="Panel";const ese=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`,C=`${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:C,children:`Rule ${A+1}`})]})},l=(m,A)=>{var C;const w=[...((C=e==null?void 0:e.conditionalTabRules)==null?void 0:C.rules)||[]];w[m].conditions=w[m].conditions.filter((S,T)=>A!==T),n(S=>({...S,conditionalTabRules:{...S.conditionalTabRules,rules:w}}))},c=m=>{var S;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],w=A.filter((T,x)=>m!==x);n(T=>({...T,conditionalTabRules:{...T.conditionalTabRules,rules:w}}));const C=A[m];(S=C==null?void 0:C.conditions)==null||S.map(T=>{const x=i?_t.findIndex(i,_=>{var M;return(_==null?void 0:_.uuid)===((M=T==null?void 0:T.tab)==null?void 0:M.uuid)}):-1,E=i[x];E&&(E.isHidden=!1,a(x,E))})};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 C=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];C[A].conditions[w].option=m==null?void 0:m.value,n(S=>({...S,conditionalTabRules:{...S.conditionalTabRules,rules:C}}))},f=(m,A,w)=>{const C=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];C[A].conditions[w].tab=m==null?void 0:m.value,n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:C}}));const S=_t.findIndex(i,x=>{var E;return(x==null?void 0:x.uuid)===((E=m==null?void 0:m.value)==null?void 0:E.uuid)}),T=i[S];T&&(T.isHidden=!0,a(S,T))},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(ci,{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,C)=>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(Pa,{value:w.tab,options:u,onChange:S=>f(S,A,C),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(Pa,{value:w==null?void 0:w.option,options:e==null?void 0:e.options,onChange:S=>d(S,A,C),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,C),tooltipOptions:{position:"top"}})})]})},C)),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"})]})},tse=t=>{var S;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:a,page:s}=t,[l]=k.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=sn(),d=(T,x)=>{const E=`${T.className} justify-content-start`,_=`${T.titleClassName} pl-1`;return o.jsxs("div",{className:E,children:[o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:T.togglerClassName,onClick:()=>f(x),"aria-label":"Submit"}),o.jsx("span",{className:_,children:`Rule ${x+1}`})]})},f=T=>{var M;const x=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],E=x[T];(M=E==null?void 0:E.conditions)==null||M.map(O=>{var H;const F=_t.findIndex(i,N=>{var z;return(N==null?void 0:N.uuid)===((z=O==null?void 0:O.tab)==null?void 0:z.uuid)}),P=i?_t.findIndex(i[F].children,N=>{var z;return(N==null?void 0:N.uuid)===((z=O==null?void 0:O.section)==null?void 0:z.uuid)}):-1;if(P>=0){const N=(H=i[F])==null?void 0:H.children[P];N&&(N.isHidden=!1,a(F,P,N))}});const _=x.filter((O,F)=>T!==F);n(O=>({...O,conditionalSectionRules:{...O.conditionalSectionRules,rules:_}}))},h=T=>{var _;let x=!1;const E=i?i.filter(function(M){return(M==null?void 0:M.uuid)===(T==null?void 0:T.uuid)}):[];return(E==null?void 0:E.length)>0&&((_=E[0].children)==null?void 0:_.length)>1&&(x=!0),x},g=(T,x,E)=>{const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[x].conditions[E].option=T==null?void 0:T.value,n(M=>({...M,conditionalSectionRules:{...M.conditionalSectionRules,rules:_}}))},v=(T,x)=>{var M;const E=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=E[T];(M=_==null?void 0:_.conditions)==null||M.map(O=>{var N;const F=_t.findIndex(i,z=>{var U;return(z==null?void 0:z.uuid)===((U=O==null?void 0:O.tab)==null?void 0:U.uuid)}),P=i?_t.findIndex(i[F].children,z=>{var U;return(z==null?void 0:z.uuid)===((U=O==null?void 0:O.section)==null?void 0:U.uuid)}):-1,H=(N=i[F])==null?void 0:N.children[P];console.log("sectionData",H),H&&(H.isHidden=!1,console.log("sectionData",H),a(F,P,H))}),E[T].conditions=E[T].conditions.filter((O,F)=>x!==F),n(O=>({...O,conditionalSectionRules:{...O.conditionalSectionRules,rules:E}}))},m=(T,x,E)=>{var H,N;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[x].conditions[E].section=T==null?void 0:T.value;const M=(N=(H=_[x].conditions[E])==null?void 0:H.tab)==null?void 0:N.uuid,O=_t.findIndex(i,z=>(z==null?void 0:z.uuid)===M);n(z=>({...z,conditionalSectionRules:{...z.conditionalSectionRules,rules:_}}));const F=i?_t.findIndex(i[O].children,z=>{var U;return(z==null?void 0:z.uuid)===((U=T==null?void 0:T.value)==null?void 0:U.uuid)}):-1,P=i[O].children[F];P&&(P.isHidden=!0,a(O,F,P))},A=T=>{const x=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];x[T].conditions=[...x[T].conditions,{option:null,tab:{title:s==null?void 0:s.title,uuid:s==null?void 0:s.uuid},section:null}],n(E=>({...E,conditionalSectionRules:{...E.conditionalSectionRules,rules:x}}))},w=()=>{n(x=>({...x,conditionalSectionRules:{...x.conditionalSectionRules,rules:[...x.conditionalSectionRules.rules,{uuid:rt(),conditions:[]}]}}));const T=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...T,{fieldId:e==null?void 0:e.uuid,uuid:rt(),conditions:[]}]})},C=T=>{var E;const x=i==null?void 0:i.filter(function(_){return(_==null?void 0:_.uuid)===(T==null?void 0:T.uuid)});if(x&&(x==null?void 0:x.length)>0){const _=(E=x[0])==null?void 0:E.children.filter(function(M){return(M==null?void 0:M.uuid)!==(r==null?void 0:r.uuid)});if((_==null?void 0:_.length)>0)return _}return l};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Sections"}),(S=e==null?void 0:e.conditionalSectionRules)==null?void 0:S.rules.map((T,x)=>o.jsx(ci,{className:"mb-3",header:`Rule ${x+1}`,headerTemplate:E=>d(E,x),children:o.jsxs("div",{children:[T==null?void 0:T.conditions.map((E,_)=>{var M,O;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:(O=(M=E==null?void 0:E.tab)==null?void 0:M.title)==null?void 0:O.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",E.value]}),o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E.section,options:C(E.tab),onChange:F=>m(F,x,_),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E==null?void 0:E.option,options:e==null?void 0:e.options,onChange:F=>g(F,x,_),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(x,_),tooltipOptions:{position:"top"}})]}),!h(E.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"]})})]})},_)}),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(x),size:"small"})})})]})},x)),o.jsx(Ft,{text:!0,icon:"pi pi-plus",onClick:()=>w(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},nse=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(ci,{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(Pa,{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"})]})},rse=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:a}=t,{pageSettingUpdate:s,formBuilderFormLayout:l,sectionSettingUpdate:c}=sn();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(nse,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(ese,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:s}),o.jsx("hr",{}),o.jsx(tse,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:a}),o.jsx("hr",{})]})})},ise=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=k.useState(""),[a,s]=k.useState([""]),[l,c]=k.useState(!1),[u,d]=k.useState(0),[f,h]=k.useState(!1),{updateGlobalToast:g}=Ht(),v=()=>{h(!0)},m=()=>{var z;const H=((z=e==null?void 0:e.reviewerChecklist)==null?void 0:z.length)>=0?[...e.reviewerChecklist]:[];H.push({uuid:rt(),checklist:r,action:a,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const N={...e,reviewerChecklist:H};n(U=>({...U,...N})),h(!1),i(""),s([""])},A=()=>{h(!1),i(""),s([""])},w=H=>{const N=[...e.reviewerChecklist];N.splice(H,1);const z={...e,reviewerChecklist:N};n(U=>({...U,...z}))},C=(H,N)=>{c(!0);const{checklist:z,action:U}=H;h(!0),d(N),setTimeout(()=>{i(z),s(U)},1e3)},S=(H,N)=>o.jsxs(o.Fragment,{children:[o.jsx(Ft,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>C(H,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)})]}),T=H=>{var N;return o.jsx(o.Fragment,{children:(N=H==null?void 0:H.action)==null?void 0:N.length})},x=H=>{const N=[...a];N.splice(H,1),s(N)},E=()=>{const H=[...e.reviewerChecklist];H[u]={checklist:r,action:a};const N={...e,reviewerChecklist:H};n(z=>({...z,...N})),h(!1),c(!1)},_=()=>o.jsx("div",{children:l?o.jsx(Ft,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{E()}}):o.jsx(Ft,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{m()}})}),M=H=>{n(N=>({...N,reviewerChecklist:H==null?void 0:H.value}))},O=H=>{navigator.clipboard.writeText(JSON.stringify(H))};function F(H){try{JSON.parse(H)}catch{return!1}return!0}const P=async()=>{var z;const H=await navigator.clipboard.readText();let N="";if(F(H)){const U=JSON.parse(H);if((z=U[0])!=null&&z.checklist){const ce={..._t.cloneDeep(e),reviewerChecklist:U};n(X=>({...X,...ce}));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(Os,{maximizable:!0,header:"Add Checklist options for admin to reveiw",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:_(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(so,{rows:2,cols:50,value:r,onChange:H=>{var N;i((N=H==null?void 0:H.target)==null?void 0:N.value)}}),o.jsx("h5",{children:"Actions when admin selects NO as invalid"}),a.map((H,N)=>o.jsxs("div",{children:[N+1,"."," ",o.jsx(so,{value:H,onChange:z=>{var ce;const U=[...a];U[N]=(ce=z==null?void 0:z.target)==null?void 0:ce.value,s(U)},rows:2,cols:50})," ",o.jsx(Ft,{text:!0,type:"button",icon:"pi pi-trash",className:"p-button-danger",onClick:()=>x(N)}),o.jsx("br",{}),o.jsx("br",{})]},`actionIndex-${N}`)),o.jsx(Ft,{outlined:!0,className:" p-button-primary mr-2",onClick:()=>{s([...a,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx(Ft,{className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{v()}}),o.jsx(Ft,{outlined:!0,label:"Copy Schema ",onClick:()=>{O([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx(Ft,{outlined:!0,label:"Paste Checklist ",onClick:()=>{P()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:M,scrollable:!0,children:[o.jsx(xr,{rowReorder:!0,style:{width:"3em"}}),o.jsx(xr,{field:"checklist",header:"Checklist"}),o.jsx(xr,{field:"actions",header:"Actions",body:H=>T(H)}),o.jsx(xr,{header:"",body:(H,N)=>S(H,N)})]})})]})},ase=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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(Yr,{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(cn,{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}})]})]})},sse=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=sn(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:rt(),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(ia,{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(ia,{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(ia,{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(ia,{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(Pa,{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(Pa,{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(ao,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(io,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(fN,{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"})]})})]})},ose=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t,{userSelectedLanguage:s}=sn(),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(Yr,{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(ts,{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(wr,{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(ia,{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(Yr,{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(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ci,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(nD,{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(wr,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(b7,{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}`)}))})]})]})},b7=t=>{var s,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t;return o.jsx(o.Fragment,{children:o.jsx(ts,{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(wr,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(ose,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})},`hirarchey-option-${u}`)))})})};var gN={},lse=Fi&&Fi.__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)}}(),D3=Fi&&Fi.__assign||function(){return D3=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},D3.apply(this,arguments)},cse=Fi&&Fi.__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]}),use=Fi&&Fi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mN=Fi&&Fi.__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)&&cse(e,t,n);return use(e,t),e},dse=Fi&&Fi.__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},fse=Fi&&Fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gN,"__esModule",{value:!0});var y7=mN(k),hse=fse(GI),Zu=mN(la);function vN(t){return t&&t.replace(/ |\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function pse(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 gse=function(t){lse(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}:y7.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=dse(r,["tagName","html","innerRef"]);return y7.createElement(i||"div",D3(D3({},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||vN(n.html)!==vN(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,hse.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,pse(n))},e.propTypes={html:Zu.string.isRequired,onChange:Zu.func,disabled:Zu.bool,tagName:Zu.string,className:Zu.string,style:Zu.object,innerRef:Zu.oneOfType([Zu.object,Zu.func])},e}(y7.Component),N3=gN.default=gse;const mse=t=>{var w;const e=k.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,path:c}=t,[u,d]=k.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),m=(C,S,T)=>{d(x=>({...x,[C]:{...x[C],[S==null?void 0:S.type]:T}}))};k.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const C=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(C[fa],C[ha],C[Ca],C[xa],C[Ta],C[Fa],C[Xo],C[wo],u):(C==null?void 0:C.length)>Fa&&(C==null?void 0:C.length)===Bl+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(C[fa],C[ha],C[Ca],C[xa],C[Ta],C[5],C[6],C[7],u):h(i,a,s,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(N3,{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:C=>{var S;m("label",f,(S=C==null?void 0:C.target)==null?void 0:S.value)},tagName:"article"})})},ca=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=sn();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(F8,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},A7=t=>{var f,h,g,v,m,A,w,C,S,T,x,E,_,M;const{field:e,update:n,value:r,isFirst:i,isDisabled:a}=t,{isBuilderMode:s,isAdmin:l}=Ht(),{selectedLanguage:c}=sn(),[u,d]=k.useState(0);return k.useEffect(()=>{const O=Gt.addListener("onSubmitUserForm",()=>{var P;(P=e==null?void 0:e.attributes)!=null&&P.required?r!=null&&r[e.uuid]?e.isValid=t3:e.isValid=D8:e.isValid=1}),F=Gt.addListener("OnInvalidFieldCatch",P=>{(e==null?void 0:e.uuid)===(P==null?void 0:P.fieldId)?d(N8):d(O8)});return()=>{O.remove(),F.remove()}}),o.jsxs("div",{className:"",children:[(e==null?void 0:e.type)===yZ&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex align-items-center mb-3",children:[" ",i===!0&&o.jsx(ca,{...t}),((f=e==null?void 0:e.attributes)==null?void 0:f.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",s?o.jsx(mse,{...t}):o.jsx("div",{className:"text-gray-900 font-bold text-xl",children:(h=e==null?void 0:e.label)==null?void 0:h[c]})]}),((g=e==null?void 0:e.options)==null?void 0:g.length)&&((v=e==null?void 0:e.options)==null?void 0:v.map(O=>{var F,P;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(ia,{inputId:O.uuid,name:e==null?void 0:e.uuid,value:O.uuid,onChange:H=>{(!l||!a)&&n(e==null?void 0:e.uuid,H==null?void 0:H.value)},checked:(r==null?void 0:r[e.uuid])===O.uuid,disabled:l||a}),o.jsx("label",{htmlFor:O.uuid,className:"ml-2",children:O.label})]}),(O==null?void 0:O.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(O==null?void 0:O.uuid)&&(O==null?void 0:O.children)&&((F=O==null?void 0:O.children)==null?void 0:F.length)>0&&((P=O==null?void 0:O.children)==null?void 0:P.map(()=>o.jsx(A7,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${O.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)===AZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((m=e==null?void 0:e.attributes)==null?void 0:m.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(wn,{className:"mt-2",onChange:O=>{var F;return n(e==null?void 0:e.uuid,(F=O==null?void 0:O.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(A=e==null?void 0:e.placeholder)==null?void 0:A[c],disabled:l||a})]})}),(e==null?void 0:e.type)===wZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((w=e==null?void 0:e.attributes)==null?void 0:w.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(ef,{className:"mt-2",onChange:O=>{var F;return n(e==null?void 0:e.uuid,(F=O==null?void 0:O.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(C=e==null?void 0:e.placeholder)==null?void 0:C[c],disabled:l||a})]})}),(e==null?void 0:e.type)===SZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((S=e==null?void 0:e.attributes)==null?void 0:S.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(so,{className:"mt-2",onChange:O=>{var F;return n(e==null?void 0:e.uuid,(F=O==null?void 0:O.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(T=e==null?void 0:e.placeholder)==null?void 0:T[c],disabled:l||a})]})}),o.jsx("div",{children:((x=e==null?void 0:e.helperText)==null?void 0:x[c])!==""&&o.jsx("small",{children:(E=e==null?void 0:e.helperText)==null?void 0:E[c]})}),o.jsx("div",{children:((_=e==null?void 0:e.attributes)==null?void 0:_.required)&&o.jsx("small",{className:"error",children:u===1&&!(r!=null&&r[e.uuid])?(M=e==null?void 0:e.validationMesssage)==null?void 0:M.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},vse=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=k.useState({});return o.jsx("div",{children:o.jsx(A7,{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:""})})},w7={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},bse={uuid:rt(),...w7,type:"radio",value:null,options:[{uuid:rt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:rt(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:rt(),...w7,options:(rt(),{uuid:rt(),...w7,options:(rt(),rt())},rt())});const yse=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,{...bse,isValid:0,uuid:rt(),options:[{uuid:rt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:rt(),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(b7,{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(vse,{hirarechicalRadioSchemaState:e})]})]})})})},Qi=t=>{var Z;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:a,formBuilderFormLayout:s,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=sn(),{renderType:u}=Ht(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:v,rowIndex:m,columnIndex:A,fieldIndex:w,path:C,row:S,typeName:T}=t,{updateGlobalToast:x}=Ht(),[E,_]=k.useState(f),M=C.split("-"),O=()=>{const K=C.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[Fa],K[Xo],K[wo],E):(K==null?void 0:K.length)>Fa&&(K==null?void 0:K.length)===Bl+1&&(E!=null&&E.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[5],K[6],K[7],E):(n(g,v,m,A,w,{...E}),setTimeout(()=>{Gt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Gt.emit("onUpdateField",{})},1e3)),x({showToast:!0,toastMessage:"Updated",toastDetail:`${T} updated`,toastType:"success"})},F=(K,W,ge)=>{_(ye=>({...ye,[K]:{...ye[K],[W==null?void 0:W.type]:ge}}))},P=(K,W)=>{_(ge=>({...ge,attributes:{...ge.attributes,[K]:W}}))},H=(K,W)=>{_(ge=>({...ge,[K]:W}))},N=(K,W)=>{_(ge=>({...ge,inlineConditional:{...ge.inlineConditional,[K]:W}}))},z=()=>{},U=()=>{_(K=>({...K,data:[...K.data,{uuid:rt(),dataKey:"",value:""}]}))},ce=()=>{_(K=>Object.assign({},K,{options:[...K.options,{uuid:rt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},X=()=>{},R=()=>{},ue=()=>{},Y=()=>{},ie=K=>{var Ee;const W=[...(E==null?void 0:E.conditionalTabRules.rules)||[]],ge=W.filter((Ae,fe)=>K!==fe);_(Ae=>({...Ae,conditionalTabRules:{...Ae.conditionalTabRules,rules:ge}}));const ye=W[K];(Ee=ye==null?void 0:ye.conditions)==null||Ee.map(Ae=>{const fe=_t.findIndex(s,q=>{var ee;return(q==null?void 0:q.uuid)===((ee=Ae==null?void 0:Ae.tab)==null?void 0:ee.uuid)}),ne=s[fe];ne&&(ne.isHidden=!1,a(fe,ne))})},re=(K,W)=>{const ge=[...(E==null?void 0:E.conditionalTabRules.rules)||[]];ge[K].conditions=ge[K].conditions.filter((ye,Ee)=>W!==Ee),_(ye=>({...ye,conditionalTabRules:{...ye.conditionalTabRules,rules:ge}}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),header:()=>{var K;return o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[(K=f==null?void 0:f.label)==null?void 0:K.english," "]})})},"aria-label":"Field Setting Sidebar",children:[o.jsx("div",{className:"",children:o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(nD,{language:K,fieldState:E,onHandleChange:F,...t})},W)):""})})}),(E==null?void 0:E.isValidationTabEnabled)===!0&&o.jsx(wr,{header:"Validation",children:o.jsx(xte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P,...t})}),o.jsx(wr,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Tte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P})})}),(E==null?void 0:E.isLayoutTabEnabled)===!0&&o.jsx(wr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Bte,{fieldState:E,onHandleChangeLayoutSettings:H})})}),(E==null?void 0:E.isDynamicListingTabEnabled)===!0&&o.jsx(wr,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(sse,{fieldState:E,setFieldState:_})})}),(E==null?void 0:E.options)!==void 0&&(E==null?void 0:E.data)&&o.jsx(wr,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(Vte,{onHandleChangeLayoutSettings:H,fieldState:E,setFieldState:_}),o.jsx(Ft,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>U(),"aria-label":"Add"})]})}),o.jsx(wr,{header:"Table view options",children:o.jsx(ase,{fieldState:E,onHandleChangeLayoutSettings:H})}),(E==null?void 0:E.componentType)!=="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(wr,{header:"Options",children:[(E==null?void 0:E.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:()=>ce(),"aria-label":"Option"})}),o.jsxs("div",{className:"scroll-height-200 px-4",children:[o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(fN,{enableAbbreviationColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableHyperTextColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableAddNewColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableCopyPaste:(E==null?void 0:E.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:E,setFieldState:_,language:K})},W)):""}),(E==null?void 0:E.isHierarchalCondionalTabEnabled)===!0&&o.jsx(b7,{fieldState:E,onHandleChangeLayoutSettings:H,removeChildrenField:Y,addChildrenField:ue,updateChildrenField:R,updateCondtionOption:X})]})]}),(E==null?void 0:E.componentType)==="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(wr,{header:"Hierarchal Options",children:o.jsx(yse,{fieldState:E,setFieldState:_})}),u===e3&&(E==null?void 0:E.inlineConditionalRules)!==void 0&&!(S!=null&&S.rowIsRepeatable)&&(M==null?void 0:M.length)<wo+1&&o.jsx(wr,{header:"Conditional",children:o.jsx(rse,{handleRemoveConditionalTabRule:ie,handleRemoveConditionalTabRuleCondition:re,onHandleSelectInlineConditionalOption:z,onHandleChangeLayoutSettings:H,onHandleChangeInlineConditionaltSetttings:N,fieldState:E,setFieldState:_,pageIndex:g,sectionIndex:v,...t})}),!((Z=t==null?void 0:t.row)!=null&&Z.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(wr,{header:"Admin reviewer checklist",children:o.jsx(ise,{fieldState:E,setFieldState:_})})]})}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ft,{text:!0,label:"Close",type:"button",icon:"pi pi-times",onClick:()=>h(),"aria-label":"Close",size:"small",className:"p-button-danger"}),!l&&o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>O(),"aria-label":"Update"})]})})]})})},ki=t=>{const[e,n]=k.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:a}=Ar();k.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:e!==null&&(e==null?void 0:e.length)>0?o.jsx("div",{className:"col-12",children:o.jsx(ts,{children:o.jsx(wr,{header:"Admin Review",children:o.jsx("div",{className:"grid",children:e==null?void 0:e.map((h,g)=>{var v,m,A,w,C;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(ia,{inputId:`yes-${g}`,name:"action",value:!0,onChange:S=>{l(S,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(ia,{inputId:`no-${g}`,name:"action",value:!1,onChange:S=>{l(S,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((S,T)=>{var x;return o.jsxs("div",{children:[o.jsx(Yr,{value:S,checked:((x=h==null?void 0:h.selectAction)==null?void 0:x.length)>0?h==null?void 0:h.selectAction.some(E=>E===S):!1,onChange:E=>{c(g,E)}})," ",S," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${g}-${T}`)})),o.jsx(Yr,{checked:(A=h==null?void 0:h.other)==null?void 0:A.isOther,onChange:S=>{u(S,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(so,{className:"mt-3",value:(C=h==null?void 0:h.other)==null?void 0:C.description,onChange:S=>d(S,g)})]})]}),(h==null?void 0:h.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:h==null?void 0:h.reviewerFeedback,onChange:S=>f(S,"reviewerFeedback",g)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:h==null?void 0:h.reviewerComments,onChange:S=>f(S,"reviewerComments",g)})]})]})},`checklistIndex-${g}`)})})})})}):o.jsx(o.Fragment,{})})},xi=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:a}=sn(),{globalAlignment:s}=Ht(),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(Qt,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=Ar(),[d,f]=k.useState("");k.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(ci,{headerTemplate:l,toggleable:!0,children:i}):i})})};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:bN,setPrototypeOf:yN,isFrozen:Ase,getPrototypeOf:wse,getOwnPropertyDescriptor:Sse}=Object;let{freeze:Eo,seal:jl,create:AN}=Object,{apply:S7,construct:C7}=typeof Reflect<"u"&&Reflect;Eo||(Eo=function(e){return e}),jl||(jl=function(e){return e}),S7||(S7=function(e,n,r){return e.apply(n,r)}),C7||(C7=function(e,n){return new e(...n)});const O3=ml(Array.prototype.forEach),wN=ml(Array.prototype.pop),Jp=ml(Array.prototype.push),F3=ml(String.prototype.toLowerCase),x7=ml(String.prototype.toString),SN=ml(String.prototype.match),Zp=ml(String.prototype.replace),Cse=ml(String.prototype.indexOf),xse=ml(String.prototype.trim),xc=ml(Object.prototype.hasOwnProperty),Io=ml(RegExp.prototype.test),e2=Tse(TypeError);function ml(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 S7(t,e,r)}}function Tse(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return C7(t,n)}}function hi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:F3;yN&&yN(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=n(i);a!==i&&(Ase(e)||(e[r]=a),i=a)}t[i]=!0}return t}function Ese(t){for(let e=0;e<t.length;e++)xc(t,e)||(t[e]=null);return t}function J0(t){const e=AN(null);for(const[n,r]of bN(t))xc(t,n)&&(Array.isArray(r)?e[n]=Ese(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=J0(r):e[n]=r);return e}function t2(t,e){for(;t!==null;){const r=Sse(t,e);if(r){if(r.get)return ml(r.get);if(typeof r.value=="function")return ml(r.value)}t=wse(t)}function n(){return null}return n}const CN=Eo(["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"]),T7=Eo(["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"]),E7=Eo(["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"]),Ise=Eo(["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"]),I7=Eo(["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"]),_se=Eo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xN=Eo(["#text"]),TN=Eo(["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"]),_7=Eo(["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"]),EN=Eo(["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"]),k3=Eo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dse=jl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nse=jl(/<%[\w\W]*|[\w\W]*%>/gm),Ose=jl(/\${[\w\W]*}/gm),Fse=jl(/^data-[\-\w.\u00B7-\uFFFF]/),kse=jl(/^aria-[\-\w]+$/),IN=jl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pse=jl(/^(?:\w+script|data):/i),Mse=jl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_N=jl(/^html$/i),Lse=jl(/^[a-z][.\w]*(-[.\w]+)+$/i);var DN=Object.freeze({__proto__:null,MUSTACHE_EXPR:Dse,ERB_EXPR:Nse,TMPLIT_EXPR:Ose,DATA_ATTR:Fse,ARIA_ATTR:kse,IS_ALLOWED_URI:IN,IS_SCRIPT_OR_DATA:Pse,ATTR_WHITESPACE:Mse,DOCTYPE_NAME:_N,CUSTOM_ELEMENT:Lse});const n2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Bse=function(){return typeof window>"u"?null:window},Vse=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}};function NN(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bse();const e=It=>NN(It);if(e.version="3.1.7",e.removed=[],!t||!t.document||t.document.nodeType!==n2.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=t2(v,"cloneNode"),A=t2(v,"remove"),w=t2(v,"nextSibling"),C=t2(v,"childNodes"),S=t2(v,"parentNode");if(typeof s=="function"){const It=n.createElement("template");It.content&&It.content.ownerDocument&&(n=It.content.ownerDocument)}let T,x="";const{implementation:E,createNodeIterator:_,createDocumentFragment:M,getElementsByTagName:O}=n,{importNode:F}=r;let P={};e.isSupported=typeof bN=="function"&&typeof S=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:N,TMPLIT_EXPR:z,DATA_ATTR:U,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:ue}=DN;let{IS_ALLOWED_URI:Y}=DN,ie=null;const re=hi({},[...CN,...T7,...E7,...I7,...xN]);let Z=null;const K=hi({},[...TN,..._7,...EN,...k3]);let W=Object.seal(AN(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}})),ge=null,ye=null,Ee=!0,Ae=!0,fe=!1,ne=!0,q=!1,ee=!0,oe=!1,he=!1,De=!1,Ne=!1,ve=!1,Se=!1,Be=!0,Te=!1;const $="user-content-";let pe=!0,me=!1,ae={},le=null;const be=hi({},["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 Ie=null;const Pe=hi({},["audio","video","img","source","image","track"]);let ze=null;const Ze=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",ht="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let fn=Ut,$t=!1,mn=null;const En=hi({},[nt,ht,Ut],x7);let Tt=null;const je=["application/xhtml+xml","text/html"],He="text/html";let ot=null,rn=null;const nn=n.createElement("form"),Jt=function(Fe){return Fe instanceof RegExp||Fe instanceof Function},_n=function(){let Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rn&&rn===Fe)){if((!Fe||typeof Fe!="object")&&(Fe={}),Fe=J0(Fe),Tt=je.indexOf(Fe.PARSER_MEDIA_TYPE)===-1?He:Fe.PARSER_MEDIA_TYPE,ot=Tt==="application/xhtml+xml"?x7:F3,ie=xc(Fe,"ALLOWED_TAGS")?hi({},Fe.ALLOWED_TAGS,ot):re,Z=xc(Fe,"ALLOWED_ATTR")?hi({},Fe.ALLOWED_ATTR,ot):K,mn=xc(Fe,"ALLOWED_NAMESPACES")?hi({},Fe.ALLOWED_NAMESPACES,x7):En,ze=xc(Fe,"ADD_URI_SAFE_ATTR")?hi(J0(Ze),Fe.ADD_URI_SAFE_ATTR,ot):Ze,Ie=xc(Fe,"ADD_DATA_URI_TAGS")?hi(J0(Pe),Fe.ADD_DATA_URI_TAGS,ot):Pe,le=xc(Fe,"FORBID_CONTENTS")?hi({},Fe.FORBID_CONTENTS,ot):be,ge=xc(Fe,"FORBID_TAGS")?hi({},Fe.FORBID_TAGS,ot):{},ye=xc(Fe,"FORBID_ATTR")?hi({},Fe.FORBID_ATTR,ot):{},ae=xc(Fe,"USE_PROFILES")?Fe.USE_PROFILES:!1,Ee=Fe.ALLOW_ARIA_ATTR!==!1,Ae=Fe.ALLOW_DATA_ATTR!==!1,fe=Fe.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=Fe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=Fe.SAFE_FOR_TEMPLATES||!1,ee=Fe.SAFE_FOR_XML!==!1,oe=Fe.WHOLE_DOCUMENT||!1,Ne=Fe.RETURN_DOM||!1,ve=Fe.RETURN_DOM_FRAGMENT||!1,Se=Fe.RETURN_TRUSTED_TYPE||!1,De=Fe.FORCE_BODY||!1,Be=Fe.SANITIZE_DOM!==!1,Te=Fe.SANITIZE_NAMED_PROPS||!1,pe=Fe.KEEP_CONTENT!==!1,me=Fe.IN_PLACE||!1,Y=Fe.ALLOWED_URI_REGEXP||IN,fn=Fe.NAMESPACE||Ut,W=Fe.CUSTOM_ELEMENT_HANDLING||{},Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&typeof Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(Ae=!1),ve&&(Ne=!0),ae&&(ie=hi({},xN),Z=[],ae.html===!0&&(hi(ie,CN),hi(Z,TN)),ae.svg===!0&&(hi(ie,T7),hi(Z,_7),hi(Z,k3)),ae.svgFilters===!0&&(hi(ie,E7),hi(Z,_7),hi(Z,k3)),ae.mathMl===!0&&(hi(ie,I7),hi(Z,EN),hi(Z,k3))),Fe.ADD_TAGS&&(ie===re&&(ie=J0(ie)),hi(ie,Fe.ADD_TAGS,ot)),Fe.ADD_ATTR&&(Z===K&&(Z=J0(Z)),hi(Z,Fe.ADD_ATTR,ot)),Fe.ADD_URI_SAFE_ATTR&&hi(ze,Fe.ADD_URI_SAFE_ATTR,ot),Fe.FORBID_CONTENTS&&(le===be&&(le=J0(le)),hi(le,Fe.FORBID_CONTENTS,ot)),pe&&(ie["#text"]=!0),oe&&hi(ie,["html","head","body"]),ie.table&&(hi(ie,["tbody"]),delete ge.tbody),Fe.TRUSTED_TYPES_POLICY){if(typeof Fe.TRUSTED_TYPES_POLICY.createHTML!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Fe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=Fe.TRUSTED_TYPES_POLICY,x=T.createHTML("")}else T===void 0&&(T=Vse(g,i)),T!==null&&typeof x=="string"&&(x=T.createHTML(""));Eo&&Eo(Fe),rn=Fe}},wt=hi({},["mi","mo","mn","ms","mtext"]),Ke=hi({},["annotation-xml"]),st=hi({},["title","style","font","a","script"]),vt=hi({},[...T7,...E7,...Ise]),Vt=hi({},[...I7,..._se]),On=function(Fe){let Qe=S(Fe);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:fn,tagName:"template"});const At=F3(Fe.tagName),jt=F3(Qe.tagName);return mn[Fe.namespaceURI]?Fe.namespaceURI===ht?Qe.namespaceURI===Ut?At==="svg":Qe.namespaceURI===nt?At==="svg"&&(jt==="annotation-xml"||wt[jt]):!!vt[At]:Fe.namespaceURI===nt?Qe.namespaceURI===Ut?At==="math":Qe.namespaceURI===ht?At==="math"&&Ke[jt]:!!Vt[At]:Fe.namespaceURI===Ut?Qe.namespaceURI===ht&&!Ke[jt]||Qe.namespaceURI===nt&&!wt[jt]?!1:!Vt[At]&&(st[At]||!vt[At]):!!(Tt==="application/xhtml+xml"&&mn[Fe.namespaceURI]):!1},$n=function(Fe){Jp(e.removed,{element:Fe});try{S(Fe).removeChild(Fe)}catch{A(Fe)}},lr=function(Fe,Qe){try{Jp(e.removed,{attribute:Qe.getAttributeNode(Fe),from:Qe})}catch{Jp(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(Fe),Fe==="is"&&!Z[Fe])if(Ne||ve)try{$n(Qe)}catch{}else try{Qe.setAttribute(Fe,"")}catch{}},Wn=function(Fe){let Qe=null,At=null;if(De)Fe="<remove></remove>"+Fe;else{const Zt=SN(Fe,/^[\r\n\t ]+/);At=Zt&&Zt[0]}Tt==="application/xhtml+xml"&&fn===Ut&&(Fe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Fe+"</body></html>");const jt=T?T.createHTML(Fe):Fe;if(fn===Ut)try{Qe=new h().parseFromString(jt,Tt)}catch{}if(!Qe||!Qe.documentElement){Qe=E.createDocument(fn,"template",null);try{Qe.documentElement.innerHTML=$t?x:jt}catch{}}const Xt=Qe.body||Qe.documentElement;return Fe&&At&&Xt.insertBefore(n.createTextNode(At),Xt.childNodes[0]||null),fn===Ut?O.call(Qe,oe?"html":"body")[0]:oe?Qe.documentElement:Xt},vr=function(Fe){return _.call(Fe.ownerDocument||Fe,Fe,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Nr=function(Fe){return Fe instanceof f&&(typeof Fe.nodeName!="string"||typeof Fe.textContent!="string"||typeof Fe.removeChild!="function"||!(Fe.attributes instanceof d)||typeof Fe.removeAttribute!="function"||typeof Fe.setAttribute!="function"||typeof Fe.namespaceURI!="string"||typeof Fe.insertBefore!="function"||typeof Fe.hasChildNodes!="function")},yn=function(Fe){return typeof l=="function"&&Fe instanceof l},lt=function(Fe,Qe,At){P[Fe]&&O3(P[Fe],jt=>{jt.call(e,Qe,At,rn)})},ut=function(Fe){let Qe=null;if(lt("beforeSanitizeElements",Fe,null),Nr(Fe))return $n(Fe),!0;const At=ot(Fe.nodeName);if(lt("uponSanitizeElement",Fe,{tagName:At,allowedTags:ie}),Fe.hasChildNodes()&&!yn(Fe.firstElementChild)&&Io(/<[/\w]/g,Fe.innerHTML)&&Io(/<[/\w]/g,Fe.textContent)||Fe.nodeType===n2.progressingInstruction||ee&&Fe.nodeType===n2.comment&&Io(/<[/\w]/g,Fe.data))return $n(Fe),!0;if(!ie[At]||ge[At]){if(!ge[At]&&Nt(At)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At)))return!1;if(pe&&!le[At]){const jt=S(Fe)||Fe.parentNode,Xt=C(Fe)||Fe.childNodes;if(Xt&&jt){const Zt=Xt.length;for(let Sn=Zt-1;Sn>=0;--Sn){const Ln=m(Xt[Sn],!0);Ln.__removalCount=(Fe.__removalCount||0)+1,jt.insertBefore(Ln,w(Fe))}}}return $n(Fe),!0}return Fe instanceof c&&!On(Fe)||(At==="noscript"||At==="noembed"||At==="noframes")&&Io(/<\/no(script|embed|frames)/i,Fe.innerHTML)?($n(Fe),!0):(q&&Fe.nodeType===n2.text&&(Qe=Fe.textContent,O3([H,N,z],jt=>{Qe=Zp(Qe,jt," ")}),Fe.textContent!==Qe&&(Jp(e.removed,{element:Fe.cloneNode()}),Fe.textContent=Qe)),lt("afterSanitizeElements",Fe,null),!1)},yt=function(Fe,Qe,At){if(Be&&(Qe==="id"||Qe==="name")&&(At in n||At in nn))return!1;if(!(Ae&&!ye[Qe]&&Io(U,Qe))){if(!(Ee&&Io(ce,Qe))){if(!Z[Qe]||ye[Qe]){if(!(Nt(Fe)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,Fe)||W.tagNameCheck instanceof Function&&W.tagNameCheck(Fe))&&(W.attributeNameCheck instanceof RegExp&&Io(W.attributeNameCheck,Qe)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(Qe))||Qe==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At))))return!1}else if(!ze[Qe]){if(!Io(Y,Zp(At,R,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&Fe!=="script"&&Cse(At,"data:")===0&&Ie[Fe])){if(!(fe&&!Io(X,Zp(At,R,"")))){if(At)return!1}}}}}}return!0},Nt=function(Fe){return Fe!=="annotation-xml"&&SN(Fe,ue)},An=function(Fe){lt("beforeSanitizeAttributes",Fe,null);const{attributes:Qe}=Fe;if(!Qe)return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z};let jt=Qe.length;for(;jt--;){const Xt=Qe[jt],{name:Zt,namespaceURI:Sn,value:Ln}=Xt,zn=ot(Zt);let at=Zt==="value"?Ln:xse(Ln);if(At.attrName=zn,At.attrValue=at,At.keepAttr=!0,At.forceKeepAttr=void 0,lt("uponSanitizeAttribute",Fe,At),at=At.attrValue,At.forceKeepAttr||(lr(Zt,Fe),!At.keepAttr))continue;if(!ne&&Io(/\/>/i,at)){lr(Zt,Fe);continue}q&&O3([H,N,z],Me=>{at=Zp(at,Me," ")});const se=ot(Fe.nodeName);if(yt(se,zn,at)){if(Te&&(zn==="id"||zn==="name")&&(lr(Zt,Fe),at=$+at),ee&&Io(/((--!?|])>)|<\/(style|title)/i,at)){lr(Zt,Fe);continue}if(T&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Sn)switch(g.getAttributeType(se,zn)){case"TrustedHTML":{at=T.createHTML(at);break}case"TrustedScriptURL":{at=T.createScriptURL(at);break}}try{Sn?Fe.setAttributeNS(Sn,Zt,at):Fe.setAttribute(Zt,at),Nr(Fe)?$n(Fe):wN(e.removed)}catch{}}}lt("afterSanitizeAttributes",Fe,null)},Nn=function It(Fe){let Qe=null;const At=vr(Fe);for(lt("beforeSanitizeShadowDOM",Fe,null);Qe=At.nextNode();)lt("uponSanitizeShadowNode",Qe,null),!ut(Qe)&&(Qe.content instanceof a&&It(Qe.content),An(Qe));lt("afterSanitizeShadowDOM",Fe,null)};return e.sanitize=function(It){let Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,At=null,jt=null,Xt=null;if($t=!It,$t&&(It="<!-->"),typeof It!="string"&&!yn(It))if(typeof It.toString=="function"){if(It=It.toString(),typeof It!="string")throw e2("dirty is not a string, aborting")}else throw e2("toString is not a function");if(!e.isSupported)return It;if(he||_n(Fe),e.removed=[],typeof It=="string"&&(me=!1),me){if(It.nodeName){const Ln=ot(It.nodeName);if(!ie[Ln]||ge[Ln])throw e2("root node is forbidden and cannot be sanitized in-place")}}else if(It instanceof l)Qe=Wn("<!---->"),At=Qe.ownerDocument.importNode(It,!0),At.nodeType===n2.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?Qe=At:Qe.appendChild(At);else{if(!Ne&&!q&&!oe&&It.indexOf("<")===-1)return T&&Se?T.createHTML(It):It;if(Qe=Wn(It),!Qe)return Ne?null:Se?x:""}Qe&&De&&$n(Qe.firstChild);const Zt=vr(me?It:Qe);for(;jt=Zt.nextNode();)ut(jt)||(jt.content instanceof a&&Nn(jt.content),An(jt));if(me)return It;if(Ne){if(ve)for(Xt=M.call(Qe.ownerDocument);Qe.firstChild;)Xt.appendChild(Qe.firstChild);else Xt=Qe;return(Z.shadowroot||Z.shadowrootmode)&&(Xt=F.call(r,Xt,!0)),Xt}let Sn=oe?Qe.outerHTML:Qe.innerHTML;return oe&&ie["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Io(_N,Qe.ownerDocument.doctype.name)&&(Sn="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`>
|
|
2290
2290
|
`+Sn),q&&O3([H,N,z],Ln=>{Sn=Zp(Sn,Ln," ")}),T&&Se?T.createHTML(Sn):Sn},e.setConfig=function(){let It=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n(It),he=!0},e.clearConfig=function(){rn=null,he=!1},e.isValidAttribute=function(It,Fe,Qe){rn||_n({});const At=ot(It),jt=ot(Fe);return yt(At,jt,Qe)},e.addHook=function(It,Fe){typeof Fe=="function"&&(P[It]=P[It]||[],Jp(P[It],Fe))},e.removeHook=function(It){if(P[It])return wN(P[It])},e.removeHooks=function(It){P[It]&&(P[It]=[])},e.removeAllHooks=function(){P={}},e}var P3=NN();const aa=t=>{var C;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,path:l}=t,[c,u]=k.useState(e);k.useEffect(()=>{var S;return A((S=e==null?void 0:e.label)==null?void 0:S[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=sn(),v=(S,T,x)=>{u(E=>({...E,[S]:{...E[S],[T==null?void 0:T.type]:x}}))},[m,A]=k.useState((C=e==null?void 0:e.label)==null?void 0:C[d==null?void 0:d.type]);k.useEffect(()=>(w(),()=>{}),[c]);const w=()=>{const S=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(S[fa],S[ha],S[Ca],S[xa],S[Ta],S[Fa],S[Xo],S[wo],c):(S==null?void 0:S.length)>Fa&&(S==null?void 0:S.length)===Bl+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(S[fa],S[ha],S[Ca],S[xa],S[Ta],S[5],S[6],S[7],c):f(r,i,a,s,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(N3,{style:{display:"inline-block"},className:"builder-input-label-edit",html:m,disabled:!1,onChange:S=>{var T;A(P3.sanitize((T=S==null?void 0:S.target)==null?void 0:T.value))},onBlur:S=>{var x;const T=P3.sanitize((x=S==null?void 0:S.target)==null?void 0:x.innerText);A(T),v("label",d,T)},tagName:"article"})})},Z0=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(qp,{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"}})})},Wr=t=>{var ce,X,R,ue;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}=Ht(),v=(Y,ie)=>{P(re=>({...re,[Y]:ie}))},{fieldSettingUpdate:m,fieldSettingUpdateInlineConditional:A,cloneField:w,gridComponentFieldSettingUpdate:C,fieldSettingDeleteInlineConditional:S,gridComponentFieldDelete:T,removeField:x}=sn(),{updateGlobalToast:E}=Ht(),_=Y=>{const ie=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?A(ie[fa],ie[ha],ie[Ca],ie[xa],ie[Ta],ie[Fa],ie[Xo],ie[wo],Y):(ie==null?void 0:ie.length)>Fa&&(ie==null?void 0:ie.length)===Bl+1&&(Y!=null&&Y.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?C(ie[fa],ie[ha],ie[Ca],ie[xa],ie[Ta],ie[5],ie[6],ie[7],Y):m(s,i,a,r,n,Y),E({showToast:!0,toastMessage:"Updated",toastDetail:"Field updated",toastType:"success"})},[M,O]=k.useState(!1),[F,P]=k.useState({custom_component_title:"",custom_component_description:""}),H=()=>{P(Y=>({...Y,custom_component_schema:e})),O(!0)},N=()=>{const Y=c.split("-").map(Number);l==="inline-conditional"?S(Y[fa],Y[ha],Y[Ca],Y[xa],Y[Ta],Y[Fa],Y[Xo],Y[wo]):(Y==null?void 0:Y.length)>Fa&&(Y==null?void 0:Y.length)===Bl+1&&(e!=null&&e.componentType)&&l==="grid"?T(Y[fa],Y[ha],Y[Ca],Y[xa],Y[Ta],Y[5],Y[6],Y[7]):x(s,i,a,r,n)},z=(Y,ie)=>{const re={...e,attributes:{...e.attributes,[Y]:ie}};_(re)},U=(Y,ie)=>{const re={...e,[Y]:ie};_(re)};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-3 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===!1&&o.jsxs("div",{className:" ",children:[o.jsx(Z0,{field:e,onHandleChangeSetttings:z,settingsKey:"required",settingsKeyValue:(ce=e==null?void 0:e.attributes)==null?void 0:ce.required,onLabel:"Required",offLabel:"Not Required",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(X=e==null?void 0:e.attributes)==null?void 0:X.required}),o.jsx(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:z,settingsKey:"style",settingsKeyValue:(R=e==null?void 0:e.attributes)==null?void 0:R.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(ue=e==null?void 0:e.attributes)==null?void 0:ue.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",tooltip:"Advanced 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()},tooltip:"Clone"}),o.jsx(Ft,{text:!0,className:"p-button-danger",size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{N()},tooltip:"Delete"}),(g===e3||g===k0)&&o.jsx(Ft,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",tooltip:"Save as custom component",onClick:()=>{H()}})]}),o.jsxs(Os,{header:"Custom component save",visible:M,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:()=>O(!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:()=>{O(!1)},autoFocus:!0})]})}),onHide:()=>O(!1),children:[o.jsxs("span",{className:"p-float-label",children:[o.jsx(wn,{id:"custom_component_title",name:"custom_component_title",className:"w-full",value:(F==null?void 0:F.custom_component_title)||"",onChange:Y=>{var ie;return v("custom_component_title",(ie=Y==null?void 0:Y.target)==null?void 0:ie.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(so,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(F==null?void 0:F.custom_component_description)||"",onChange:Y=>{var ie;return v("custom_component_description",(ie=Y==null?void 0:Y.target)==null?void 0:ie.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},qse=t=>{var re,Z,K,W,ge,ye,Ee,Ae;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isBuilderMode:d}=Ht(),{userSelectedLanguage:f,fieldSettingUpdate:h}=sn(),{taskRegisterData:g,updateTaskRegisterData:v,updateTaskProgressValue:m,updateUserFormDataSubmit:A,userTaskSubmitFormData:w}=Ar(),[C,S]=k.useState(!1),[T,x]=k.useState(!1),[E,_]=k.useState(null),[M,O]=k.useState(0),[F,P]=k.useState(!1),H=()=>{P(!0)},N=()=>{P(!1)},z=fe=>{S(fe)},U=()=>{S(!1)},ce=()=>{var fe,ne,q;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const ee=[...a.repeatableFields],oe=_t.findIndex(ee,function(he){return he.uuid===(r==null?void 0:r.uuid)});oe>=0&&ee[oe].fieldData?_(ee[oe].fieldData):(r.isValid=0,_(null))}}else{const ee=w,oe=_t.cloneDeep(g);if(ee!=null&&ee.length){for(const he of ee)if(he.fieldId===t.field.uuid&&((fe=he==null?void 0:he.postData)!=null&&fe.length)){_((ne=he==null?void 0:he.postData[0])==null?void 0:ne.postValue),oe[r==null?void 0:r.uuid]=(q=he==null?void 0:he.postData[0])==null?void 0:q.postValue;const De=Object.keys(oe).length;m(De);break}}}x(!0)},X=fe=>{var oe;_(fe.target.value);const ne=w,q=_t.cloneDeep(g);if((oe=fe==null?void 0:fe.target)!=null&&oe.value&&(ne==null?void 0:ne.length)>0)for(const he of ne)he.fieldId===t.field.uuid&&(q[r==null?void 0:r.uuid]=fe==null?void 0:fe.value,he.postData[0]={postValue:fe.value});else delete q[r==null?void 0:r.uuid];v(q);const ee=Object.keys(q).length;m(ee)};k.useEffect(()=>{T||ce();const fe=Gt.addListener("clearRepeatableFields",ee=>{ee===(a==null?void 0:a.uuid)&&(_(null),O(0),r.isValid=0,h(e,n,s,l,i,r))}),ne=Gt.addListener("onSubmitUserForm",()=>{var ee;(ee=r==null?void 0:r.attributes)!=null&&ee.required?E!==null||E!==void 0?r.isValid=1:(console.log("Countr field in valid ",E),r.isValid=0):r.isValid=1}),q=Gt.addListener("OnInvalidFieldCatch",ee=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(ee==null?void 0:ee.fieldId)),r.uuid===(ee==null?void 0:ee.fieldId)?O(1):O(0)});return()=>{ne.remove(),q.remove(),fe.remove()}});const R=(fe,ne)=>{var q;if(w){const ee=[...w],oe=_t.findIndex(ee,function(De){return De.rowId===(a==null?void 0:a.uuid)});let he=(q=w[oe])==null?void 0:q.repeatableFields;he={...he,[fe==null?void 0:fe.uuid]:ne==null?void 0:ne.name},ee[oe]={...ee[oe],repeatableFields:he},A(ee)}_(ne),console.log("value !== null country",ne!==null),ne!==null?fe.isValid=1:fe.isValid=0},ue=(fe,ne)=>fe?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:fe.name,src:fe==null?void 0:fe.image,onError:q=>q.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:fe.name})]}):o.jsx("span",{children:ne.placeholder}),Y=fe=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:fe.name,src:fe==null?void 0:fe.image,onError:ne=>ne.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:fe.name})]}),ie=o.jsxs("div",{onMouseOver:H,onMouseOut:N,children:[d&&F&&o.jsx(Wr,{handleFieldSettingsSidebar:z,...t}),o.jsxs("div",{className:`field ${d&&" py-3 px-4 builder-element-wrapper "}${(r==null?void 0:r.isFluid)===!0&&" p-fluid"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:d?"field-form-builder col-12 ":"col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(re=r==null?void 0:r.headerText)==null?void 0:re[f==null?void 0:f.type]}),(r==null?void 0:r.showLabel)&&o.jsxs("label",{htmlFor:i,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((Z=r==null?void 0:r.attributes)==null?void 0:Z.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",d?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(K=r==null?void 0:r.label)==null?void 0:K[f==null?void 0:f.type]}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(zi,{message:(W=r==null?void 0:r.toolTip)==null?void 0:W[f==null?void 0:f.type],position:"right"})})]}),o.jsx(Pa,{className:"country-select-builder-component",onFocus:()=>O(1),onChange:fe=>{a!=null&&a.rowIsRepeatable?R(r,fe.target.value):X(fe)},options:r==null?void 0:r.countries,optionLabel:"name",value:E,placeholder:(ge=r==null?void 0:r.placeholder)==null?void 0:ge[f==null?void 0:f.type],disabled:c,valueTemplate:ue,itemTemplate:Y,filter:!0,filterBy:"name",showClear:!0}),((ye=r==null?void 0:r.attributes)==null?void 0:ye.required)&&o.jsx("small",{className:"error",children:M===1&&E===null?((Ee=r==null?void 0:r.validationMesssage)==null?void 0:Ee[f==null?void 0:f.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(Ae=r==null?void 0:r.helperText)==null?void 0:Ae[f==null?void 0:f.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[C===!0&&o.jsx(Qi,{visibilty:C,closeSettingFieldSidebar:U,...t},r==null?void 0:r.uuid),o.jsx(xi,{...t,fieldWrap:ie})]})},Use=t=>{var re,Z,K,W,ge,ye,Ee,Ae,fe,ne,q,ee,oe,he,De;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:a}=Ar(),{userSelectedLanguage:s,fieldSettingUpdate:l}=sn(),{field:c,fieldIndex:u,sectionIndex:d,pageIndex:f,row:h,rowIndex:g,columnIndex:v,isDisabled:m}=t,{isAdmin:A,isBuilderMode:w}=Ht(),[C,S]=k.useState(!1),[T,x]=k.useState(""),[E,_]=k.useState(null),[M,O]=k.useState(0),[F,P]=k.useState(!1),[H,N]=k.useState(!1),z=()=>{N(!0)},U=()=>{N(!1)},ce=()=>{var Ne,ve,Se;if(h!=null&&h.rowIsRepeatable){if(h!=null&&h.repeatableFields){const Be=[...h.repeatableFields],Te=_t.findIndex(Be,function($){return $.uuid===(c==null?void 0:c.uuid)});Te>=0&&Be[Te].fieldData?x(Be[Te].fieldData):x("")}}else{const Be=a;if(Be!=null&&Be.length){for(const Te of Be)if(Te.fieldId===t.field.uuid&&((Ne=Te==null?void 0:Te.postData[0])==null?void 0:Ne.postValue)!==""&&((ve=Te==null?void 0:Te.postData[0])!=null&&ve.postValue)){x((Se=Te==null?void 0:Te.postData[0])==null?void 0:Se.postValue);break}}}P(!0)};k.useEffect(()=>{F||ce();const Ne=Gt.addListener("clearRepeatableFields",$=>{$===(h==null?void 0:h.uuid)&&(x(""),O(0),c.isValid=0,l(f,d,g,v,u,c))}),ve=Gt.addListener("onSubmitUserForm",()=>{var $,pe;($=c==null?void 0:c.attributes)!=null&&$.required?T&&T.length&&(T==null?void 0:T.length)<((pe=c==null?void 0:c.attributes)==null?void 0:pe.minLength)?c.isValid=1:c.isValid=0:c.isValid=1}),Se=Gt.addListener("OnInvalidFieldCatch",$=>{c.uuid===($==null?void 0:$.fieldId)?O(1):O(0)}),Be=Gt.addListener("OnGetFieldValue",$=>{var me;const pe=(me=$==null?void 0:$.repeatableColumn)==null?void 0:me.filter(ae=>(ae==null?void 0:ae.fieldUuid)===(c==null?void 0:c.uuid));pe!=null&&pe.length}),Te=Gt.addListener("formFieldAdded",$=>{E===null&&_($==null?void 0:$.uuid)});return()=>{ve.remove(),Se.remove(),Be.remove(),Ne.remove(),Te.remove()}}),k.useEffect(()=>(E!==null&&setTimeout(()=>{_(null)},1e3),()=>{}),[E]);const X=Ne=>{S(Ne)},R=()=>{S(!1)},ue=Ne=>{var Be,Te;x(Ne.target.value);const ve=a,Se=_t.cloneDeep(e);if(ve!==null){if((Be=Ne==null?void 0:Ne.target)!=null&&Be.value){if(Se[c==null?void 0:c.uuid]=(Te=Ne==null?void 0:Ne.target)==null?void 0:Te.value,(ve==null?void 0:ve.length)>0)for(const $ of ve)$.fieldId===t.field.uuid&&($.postData[0]={postValue:Ne.target.value})}else if(delete Se[c==null?void 0:c.uuid],(ve==null?void 0:ve.length)>0)for(const $ of ve)$.fieldId===t.field.uuid&&($.postData[0]={postValue:""})}if(!(h!=null&&h.rowIsRepeatable)){n(Se);const $=Object.keys(Se).length;r($)}},Y=(Ne,ve)=>{var Se;if(a){const Be=[...a],Te=_t.findIndex(Be,function(pe){return pe.rowId===(h==null?void 0:h.uuid)});let $=(Se=a[Te])==null?void 0:Se.repeatableFields;$={...$,[Ne==null?void 0:Ne.uuid]:ve},Be[Te]={...Be[Te],repeatableFields:$},i(Be)}x(ve),ve!==""?Ne.isValid=1:Ne.isValid=0},ie=o.jsxs("div",{onMouseOver:z,onMouseOut:U,children:[w&&H&&o.jsx(Wr,{handleFieldSettingsSidebar:X,...t}),o.jsxs("div",{className:`field ${w&&" py-3 px-4 builder-element-wrapper "} ${(c==null?void 0:c.isFluid)===!0&&" p-fluid"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:A?"col-6 ":"col-12 p-fluid",children:[(c==null?void 0:c.showHeaderText)&&o.jsx("h6",{children:(re=c==null?void 0:c.headerText)==null?void 0:re[s==null?void 0:s.type]}),(c==null?void 0:c.showLabel)&&o.jsxs("label",{htmlFor:c==null?void 0:c.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((Z=c==null?void 0:c.attributes)==null?void 0:Z.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",w===!1?o.jsx(o.Fragment,{children:(K=c==null?void 0:c.label)==null?void 0:K[s==null?void 0:s.type]}):o.jsx(aa,{...t}),(c==null?void 0:c.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(zi,{message:(W=c==null?void 0:c.toolTip)==null?void 0:W[s==null?void 0:s.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(c==null?void 0:c.iconAlignment),children:[(c==null?void 0:c.showIcon)&&o.jsx("i",{className:"pi pi-"+((ye=(ge=c==null?void 0:c.icon)==null?void 0:ge.properties)==null?void 0:ye.name)}),o.jsx(wn,{"data-component":"text-input",id:c==null?void 0:c.uuid,placeholder:(Ee=c==null?void 0:c.placeholder)==null?void 0:Ee[s==null?void 0:s.type],minLength:(Ae=c==null?void 0:c.attributes)==null?void 0:Ae.minLength,maxLength:(fe=c==null?void 0:c.attributes)==null?void 0:fe.maxLength,value:T,onFocus:()=>O(1),onChange:Ne=>{h!=null&&h.rowIsRepeatable?Y(c,Ne.target.value):ue(Ne)},className:M===N8&&((ne=c==null?void 0:c.attributes)!=null&&ne.required)?T?"valid":"invalid":"valid'",readOnly:m,disabled:A})]}),o.jsx("div",{children:((q=c==null?void 0:c.attributes)==null?void 0:q.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:M===1&&!T?(ee=c==null?void 0:c.validationMesssage)==null?void 0:ee.english:""}),o.jsx("small",{className:"error",children:M===1&&T.length&&(T==null?void 0:T.length)<((oe=c==null?void 0:c.attributes)==null?void 0:oe.minLength)?`Mini length ${(he=c==null?void 0:c.attributes)==null?void 0:he.minLength}`:""})]})}),o.jsx("div",{children:(c==null?void 0:c.showHelperText)&&o.jsx("small",{children:(De=c==null?void 0:c.helperText)==null?void 0:De[s==null?void 0:s.type]})})]})]})}),A&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[C===!0&&o.jsx(Qi,{visibilty:C,closeSettingFieldSidebar:R,...t}),o.jsx(xi,{...t,fieldWrap:ie})]})},$se=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(wn,{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(wn,{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)})]})]})},jse=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(v3,{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(wn,{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(Yr,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},zse=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,typeName:u}=t,[d,f]=k.useState(n),{fieldSettingUpdate:h,formBuilderSchemaLanguages:g,formBuilderPublishedStatus:v}=sn(),{updateGlobalToast:m}=Ht(),A=(S,T,x)=>{f(E=>({...E,[S]:{...E[S],[T==null?void 0:T.type]:x}}))},w=(S,T)=>{f(x=>({...x,[S]:T}))},C=()=>{h(i,a,s,l,c,d),m({showToast:!0,toastMessage:"Updated",toastDetail:`${u} updated`,toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(To,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),header:()=>{var S,T;return o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[t==null?void 0:t.typeName," settings"," ",(S=n==null?void 0:n.label)!=null&&S.english?`- ${(T=n==null?void 0:n.label)==null?void 0:T.english}`:""," "]})})},children:[o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:g!=null&&g.length?g.map((S,T)=>o.jsx(io,{tabIndex:T,header:S==null?void 0:S.language,children:o.jsx($se,{language:S,fieldState:d,onHandleChange:A,...t})},T)):""})}),o.jsx(wr,{header:"Styling",children:o.jsx(jse,{fieldState:d,onHandleChangeStyling:w,...t})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[!v&&o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>C(),"aria-label":"Update"}),o.jsx(Ft,{label:"Close",type:"button",onClick:()=>r(),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Hse=t=>{var g,v,m,A,w,C,S,T,x;const{field:e}=t,{userSelectedLanguage:n}=sn(),{isBuilderMode:r}=Ht(),[i,a]=k.useState(!1),[s,l]=k.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=E=>{a(E)},f=()=>{a(!1)};k.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"builder-element-wrapper":"",onMouseOver:c,onMouseOut:u,children:[r&&s&&o.jsx(Wr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?"field-form-builder px-4":" 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-bold mb-3 text-gray-900 text-xl",children:[((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required",children:"*"})," ",r?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(m=e==null?void 0:e.label)==null?void 0:m[n==null?void 0:n.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{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:(C=e==null?void 0:e.text)==null?void 0:C[n==null?void 0:n.type]}),((S=e==null?void 0:e.attributes)==null?void 0:S.required)&&o.jsx("small",{className:"error",children:(T=e==null?void 0:e.validationMesssage)==null?void 0:T[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(x=e==null?void 0:e.helperText)==null?void 0:x[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[i&&o.jsx(zse,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(xi,{...t,fieldWrap:h})]})},Yse=t=>{var K,W,ge,ye,Ee,Ae,fe,ne,q,ee,oe,he,De,Ne,ve,Se,Be,Te,$,pe,me;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isBuilderMode:d}=Ht(),{taskRegisterData:f,updateTaskRegisterData:h,updateTaskProgressValue:g,updateUserFormDataSubmit:v,userTaskSubmitFormData:m,TASK_PUBLISHED:A,task_status:w}=Ar(),{userSelectedLanguage:C,fieldSettingUpdate:S}=sn(),[T,x]=k.useState(null),[E,_]=k.useState(!1),[M,O]=k.useState(null),[F,P]=k.useState(0),[H,N]=k.useState(!1),[z,U]=k.useState(!1),ce=()=>{U(!0)},X=()=>{U(!1)},R=()=>{var ae,le;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const be=[...a.repeatableFields],Ie=_t.findIndex(be,function(Pe){return Pe.uuid===(e==null?void 0:e.uuid)});Ie>=0&&be[Ie].fieldData?O(Number(be[Ie].fieldData)||null):O(null)}}else{const be=m;if(be!=null&&be.length){for(const Ie of be)if(Ie.fieldId===t.field.uuid&&((ae=Ie==null?void 0:Ie.postData)!=null&&ae.length)){O(Number((le=Ie==null?void 0:Ie.postData[0])==null?void 0:le.postValue)||null);break}}}N(!0)};k.useEffect(()=>{H||R();const ae=Gt.addListener("clearRepeatableFields",ze=>{ze===(a==null?void 0:a.uuid)&&(O(null),P(0),e.isValid=0,S(i,r,s,l,n,e))}),le=Gt.addListener("onSubmitUserForm",()=>{var ze;(ze=e==null?void 0:e.attributes)!=null&&ze.required?M?e.isValid=1:e.isValid=0:e.isValid=1}),be=Gt.addListener("OnInvalidFieldCatch",ze=>{e.uuid===(ze==null?void 0:ze.fieldId)?P(1):P(0)}),Ie=Gt.addListener("OnGetFieldValue",ze=>{var nt;const Ze=(nt=ze==null?void 0:ze.repeatableColumn)==null?void 0:nt.filter(ht=>(ht==null?void 0:ht.fieldUuid)===(e==null?void 0:e.uuid));Ze!=null&&Ze.length}),Pe=Gt.addListener("formFieldAdded",ze=>{T===null&&x(ze.uuid)});return()=>{le.remove(),be.remove(),Ie.remove(),ae.remove(),Pe.remove()}}),k.useEffect(()=>(T!==null&&setTimeout(()=>{x(null)},1e3),()=>{}),[T]);const ue=ae=>{_(ae)},Y=()=>{_(!1)},ie=ae=>{const le=m,be=_t.cloneDeep(f);if(le!==null){if(ae){if(be[e==null?void 0:e.uuid]=ae,(le==null?void 0:le.length)>0)for(const Ie of le)Ie.fieldId===t.field.uuid&&(Ie.postData[0]={postValue:ae})}else if(delete be[e==null?void 0:e.uuid],(le==null?void 0:le.length)>0)for(const Ie of le)Ie.fieldId===t.field.uuid&&(Ie.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){h(be);const Ie=Object.keys(be).length;g(Ie)}},re=(ae,le)=>{var be;if(m!=null&&m.length){const Ie=[...m],Pe=_t.findIndex(Ie,function(Ze){return Ze.rowId===(a==null?void 0:a.uuid)});let ze=(be=m[Pe])==null?void 0:be.repeatableFields;ze={...ze,[ae==null?void 0:ae.uuid]:le},Ie[Pe]={...Ie[Pe],repeatableFields:ze},v(Ie)}O(le),le!==""?ae.isValid=1:ae.isValid=0},Z=o.jsxs("div",{onMouseOver:ce,onMouseOut:X,children:[d===!0&&z===!0&&o.jsx(Wr,{handleFieldSettingsSidebar:ue,...t}),o.jsxs("div",{className:`field ${d===!0&&" py-3 px-4 builder-element-wrapper "} ${(e==null?void 0:e.isFluid)===!0&&" p-fluid"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:u?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(K=e==null?void 0:e.headerText)==null?void 0:K[C==null?void 0:C.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((W=e==null?void 0:e.attributes)==null?void 0:W.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",d?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(ge=e==null?void 0:e.label)==null?void 0:ge[C==null?void 0:C.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{message:(ye=e==null?void 0:e.toolTip)==null?void 0:ye[C==null?void 0:C.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=(Ee=e==null?void 0:e.icon)==null?void 0:Ee.properties)==null?void 0:Ae.name)}),o.jsx(eo,{readOnly:c,id:e==null?void 0:e.uuid,disabled:u||c,placeholder:(fe=e==null?void 0:e.placeholder)==null?void 0:fe[C==null?void 0:C.type],value:M,min:(ne=e==null?void 0:e.attributes)==null?void 0:ne.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(q=e==null?void 0:e.attributes)==null?void 0:q.prefix,showButtons:(ee=e==null?void 0:e.attributes)==null?void 0:ee.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(oe=e==null?void 0:e.attributes)==null?void 0:oe.minFractionDigits,maxFractionDigits:(he=e==null?void 0:e.attributes)==null?void 0:he.maxFractionDigits,locale:(De=e==null?void 0:e.attributes)==null?void 0:De.locale,mode:(Ne=e==null?void 0:e.attributes)==null?void 0:Ne.mode,currency:(ve=e==null?void 0:e.attributes)==null?void 0:ve.currency,currencyDisplay:(Se=e==null?void 0:e.attributes)==null?void 0:Se.currencyDisplay,useGrouping:(Be=e==null?void 0:e.attributes)==null?void 0:Be.useGrouping,onFocus:()=>P(1),onChange:ae=>{a!=null&&a.rowIsRepeatable?re(e,ae.value):ie(ae.value)},className:F===1&&((Te=e==null?void 0:e.attributes)!=null&&Te.required)?M?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:(($=e==null?void 0:e.attributes)==null?void 0:$.required)&&o.jsx("small",{className:"error",children:F===1&&!M?(pe=e==null?void 0:e.validationMesssage)==null?void 0:pe.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(me=e==null?void 0:e.helperText)==null?void 0:me[C==null?void 0:C.type]})})]})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[E===!0&&d===!0&&o.jsx(Qi,{visibilty:E,closeSettingFieldSidebar:Y,...t}),o.jsx(xi,{...t,fieldWrap:Z})]})};//! moment.js
|
|
2291
2291
|
//! version : 2.30.1
|
|
2292
2292
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
@@ -3511,7 +3511,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3511
3511
|
}
|
|
3512
3512
|
}
|
|
3513
3513
|
`,Ide={root:function(e){var n=e.props;return n.showClear&&!n.disabled&&{position:"relative"}},itemGroup:function(e){var n=e.scrollerOptions;return{height:n.props?n.props.itemSize:void 0}}},v2=Vn.extend({defaultProps:{__TYPE:"MultiSelect",appendTo:null,ariaLabelledBy:null,checkboxIcon:null,className:null,clearIcon:null,closeIcon:null,dataKey:null,disabled:!1,display:"comma",dropdownIcon:null,emptyFilterMessage:null,emptyMessage:null,filter:!1,filterBy:null,filterDelay:300,filterInputAutoFocus:!0,filterLocale:void 0,selectOnFocus:!1,focusOnHover:!0,autoOptionFocus:!1,filterMatchMode:"contains",filterPlaceholder:null,filterTemplate:null,fixedPlaceholder:!1,flex:!1,id:null,inline:!1,inputId:null,inputRef:null,invalid:!1,variant:null,itemCheckboxIcon:null,itemClassName:null,itemTemplate:null,loading:!1,loadingIcon:null,maxSelectedLabels:null,name:null,onBlur:null,onChange:null,onClick:null,onFilter:null,onFocus:null,onHide:null,onRemove:null,onSelectAll:null,onShow:null,optionDisabled:null,optionGroupChildren:null,optionGroupLabel:null,optionGroupTemplate:null,optionLabel:null,optionValue:null,options:null,overlayVisible:!1,panelClassName:null,panelFooterTemplate:null,panelHeaderTemplate:null,panelStyle:null,placeholder:null,removeIcon:null,resetFilterOnHide:!1,scrollHeight:"200px",selectAll:!1,selectAllLabel:null,selectedItemTemplate:null,selectedItemsLabel:void 0,selectionLimit:null,showClear:!1,showSelectAll:!0,style:null,tabIndex:0,tooltip:null,tooltipOptions:null,transitionOptions:null,useOptionAsValue:!1,value:null,virtualScrollerOptions:null,children:void 0},css:{classes:Tde,styles:Ede,inlineStyles:Ide}}),_de={box:"p-checkbox-box",input:"p-checkbox-input",icon:"p-checkbox-icon",root:function(e){var n=e.props,r=e.checked,i=e.context;return ft("p-checkbox p-component",{"p-highlight":r,"p-disabled":n.disabled,"p-invalid":n.invalid,"p-variant-filled":n.variant?n.variant==="filled":i&&i.inputStyle==="filled"})}},s4=Vn.extend({defaultProps:{__TYPE:"Checkbox",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,icon:null,id:null,inputId:null,inputRef:null,invalid:!1,variant:null,name:null,onChange:null,onContextMenu:null,onMouseDown:null,readOnly:!1,required:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,value:null,children:void 0},css:{classes:_de}});function PO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function MO(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var gb=b.memo(b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=s4.getProps(t,r),a=b.useState(!1),s=cd(a,2),l=s[0],c=s[1],u=s4.setMetaData({props:i,state:{focused:l},context:{checked:i.checked===i.trueValue,disabled:i.disabled}}),d=u.ptm,f=u.cx,h=u.isUnstyled;li(s4.css.styles,h,{name:"checkbox"});var g=b.useRef(null),v=b.useRef(i.inputRef),m=function(){return i.checked===i.trueValue},A=function(F){if(!(i.disabled||i.readOnly)&&i.onChange){var P,H=m(),N=H?i.falseValue:i.trueValue,z={originalEvent:F,value:i.value,checked:N,stopPropagation:function(){F==null||F.stopPropagation()},preventDefault:function(){F==null||F.preventDefault()},target:{type:"checkbox",name:i.name,id:i.id,value:i.value,checked:N}};if(i==null||(P=i.onChange)===null||P===void 0||P.call(i,z),F.defaultPrevented)return;xe.focus(v.current)}},w=function(F){var P;c(!0),i==null||(P=i.onFocus)===null||P===void 0||P.call(i,F)},C=function(F){var P;c(!1),i==null||(P=i.onBlur)===null||P===void 0||P.call(i,F)};b.useImperativeHandle(e,function(){return{props:i,focus:function(){return xe.focus(v.current)},getElement:function(){return g.current},getInput:function(){return v.current}}}),b.useEffect(function(){ke.combinedRefs(v,i.inputRef)},[v,i.inputRef]),fr(function(){v.current.checked=m()},[i.checked,i.trueValue]),Li(function(){i.autoFocus&&xe.focus(v.current,i.autoFocus)});var S=m(),T=ke.isNotEmpty(i.tooltip),x=s4.getOtherProps(i),E=n({id:i.id,className:ft(i.className,f("root",{checked:S,context:r})),style:i.style,"data-p-highlight":S,"data-p-disabled":i.disabled,onContextMenu:i.onContextMenu,onMouseDown:i.onMouseDown},x,d("root")),_=function(){var F=ke.reduceKeys(x,xe.ARIA_PROPS),P=n(MO({id:i.inputId,type:"checkbox",className:f("input"),name:i.name,tabIndex:i.tabIndex,onFocus:function(N){return w(N)},onBlur:function(N){return C(N)},onChange:function(N){return A(N)},disabled:i.disabled,readOnly:i.readOnly,required:i.required,"aria-invalid":i.invalid,checked:S},F),d("input"));return b.createElement("input",ks({ref:v},P))},M=function(){var F=n({className:f("icon")},d("icon")),P=n({className:f("box",{checked:S}),"data-p-highlight":S,"data-p-disabled":i.disabled},d("box")),H=S?i.icon||b.createElement(vc,F):null,N=nr.getJSXIcon(H,MO({},F),{props:i,checked:S});return b.createElement("div",P,N)};return b.createElement(b.Fragment,null,b.createElement("div",ks({ref:g},E),_(),M()),T&&b.createElement(cn,ks({target:g,content:i.tooltip,pt:d("tooltip")},i.tooltipOptions)))}));gb.displayName="Checkbox";function LO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function o4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?LO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):LO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var BO=b.memo(function(t){var e=Kn(),n=t.ptm,r=t.cx,i=t.isUnstyled,a={filter:function(P){return l(P)},reset:function(){return t.resetFilter()}},s=function(P,H){return n(P,o4({hostName:t.hostName},H))},l=function(P){t.onFilter&&t.onFilter({originalEvent:P,query:P.target.value})},c=function(P){if(t.onSelectAll)t.onSelectAll({originalEvent:P,checked:t.selectAll});else{var H=t.isAllSelected()?[]:t.visibleOptions.filter(function(N){return t.isValidOption(N)}).map(function(N){return t.getOptionValue(N)});t.updateModel(P,H,H)}},u=function(){var P=e({className:r("filterIcon")},s("filterIcon")),H=t.filterIcon||b.createElement(M6,P),N=nr.getJSXIcon(H,o4({},P),{props:t});if(t.filter){var z=e({className:r("filterContainer")},s("filterContainer")),U=b.createElement("div",z,b.createElement(wn,{ref:t.filterRef,type:"text",role:"searchbox",value:t.filterValue,onChange:l,className:"p-multiselect-filter",placeholder:t.filterPlaceholder,pt:n("filterInput"),unstyled:t.unstyled,__parentMetadata:{parent:t.metaData}}),N);if(t.filterTemplate){var ce={className:z.className,element:U,filterOptions:a,onFilter:l,filterIconClassName:t.filterIconClassName,props:t};U=ke.getJSXElement(t.filterTemplate,ce)}return b.createElement(b.Fragment,null,U)}return null},d=u(),f=t.id?t.id+"_selectall":So(),h=e({htmlFor:f,className:r("headerSelectAllLabel")},s("headerSelectAllLabel")),g=e({className:r("headerCheckboxIcon")},s("headerCheckbox.icon")),v=e({className:r("headerCheckboxContainer")},s("headerCheckboxContainer")),m=t.itemCheckboxIcon||b.createElement(vc,g),A=nr.getJSXIcon(m,o4({},g),{selected:t.selected}),w=t.showSelectAll&&b.createElement("div",v,b.createElement(gb,{id:f,checked:t.selectAll,onChange:c,role:"checkbox","aria-checked":t.selectAll,icon:A,pt:n("headerCheckbox"),unstyled:i()}),!t.filter&&b.createElement("label",h,t.selectAllLabel)),C=e({className:r("closeIcon"),"aria-hidden":!0},s("closeIcon")),S=t.closeIcon||b.createElement(mc,C),T=nr.getJSXIcon(S,o4({},C),{props:t}),x=e({className:r("header")},s("header")),E=e({type:"button",className:r("closeButton"),"aria-label":pa("close"),onClick:t.onClose},s("closeButton")),_=b.createElement("button",E,T,b.createElement(Qt,null)),M=b.createElement("div",x,w,d,_);if(t.template){var O={className:"p-multiselect-header",checkboxElement:w,checked:t.selectAll,onChange:c,filterElement:d,closeElement:_,closeElementClassName:"p-multiselect-close p-link",closeIconClassName:"p-multiselect-close-icon",onCloseClick:t.onClose,element:M,itemCheckboxIcon:A,props:t};return ke.getJSXElement(t.template,O)}return M});BO.displayName="MultiSelectHeader";function VO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Dde(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?VO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):VO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var qO=b.memo(function(t){var e=b.useState(!1),n=cd(e,2),r=n[0],i=n[1],a=b.useRef(null),s=Kn(),l=t.ptm,c=t.cx,u=t.isUnstyled,d=function(x){return l(x,{hostName:t.hostName,context:{selected:t.selected,disabled:t.disabled,focused:r,focusedIndex:t.focusedIndex,index:t.index}})},f=function(x){var E;i(!0),a==null||(E=a.current)===null||E===void 0||E.getInput().focus()},h=function(x){i(!1)},g=function(x){t.onClick&&t.onClick(x,t.option),x.preventDefault(),x.stopPropagation()},v=s({className:c("checkboxIcon")},d("checkbox.icon")),m=t.checkboxIcon||b.createElement(vc,v),A=t.selected?nr.getJSXIcon(m,Dde({},v),{selected:t.selected}):null,w=t.template?ke.getJSXElement(t.template,t.option):t.label,C=s({className:c("checkboxContainer")},d("checkboxContainer")),S=s({className:ft(t.className,t.option.className,c("item",{itemProps:t})),style:t.style,onClick:g,onFocus:f,onBlur:h,onMouseMove:function(x){return t==null?void 0:t.onMouseMove(x,t.index)},role:"option","aria-selected":t.selected,"data-p-highlight":t.selected,"data-p-disabled":t.disabled},d("item"));return b.createElement("li",ks({},S,{key:t.index+"_multiselectitem"}),b.createElement("div",C,b.createElement(gb,{ref:a,checked:t.selected,icon:A,pt:l("checkbox"),unstyled:u(),tabIndex:-1})),b.createElement("span",null,w),b.createElement(Qt,null))});qO.displayName="MultiSelectItem";function UO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function i1(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?UO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):UO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var $O=b.memo(b.forwardRef(function(t,e){var n=b.useRef(null),r=b.useRef(null),i=Kn(),a=b.useContext(ar),s=t.ptm,l=t.cx,c=t.sx,u=t.isUnstyled,d=function(F,P){return s(F,i1({hostName:t.hostName},P))},f=function(){t.onEnter(function(){if(n.current){var F=t.getSelectedOptionIndex();F!==-1&&setTimeout(function(){return n.current.scrollToIndex(F)},0)}})},h=function(){t.onEntered(function(){t.filter&&t.filterInputAutoFocus&&r.current&&xe.focus(r.current,!1)})},g=function(F){n.current&&n.current.scrollToIndex(0),t.onFilterInputChange&&t.onFilterInputChange(F)},v=function(){return!(t.visibleOptions&&t.visibleOptions.length)&&t.hasFilter},m=function(){return b.createElement(BO,{hostName:t.hostName,id:t.id,filter:t.filter,filterRef:r,filterValue:t.filterValue,filterTemplate:t.filterTemplate,visibleOptions:t.visibleOptions,isValidOption:t.isValidOption,getOptionValue:t.getOptionValue,updateModel:t.updateModel,onFilter:g,filterPlaceholder:t.filterPlaceholder,onClose:t.onCloseClick,showSelectAll:t.showSelectAll,selectAll:t.isAllSelected(),selectAllLabel:t.selectAllLabel,onSelectAll:t.onSelectAll,template:t.panelHeaderTemplate,resetFilter:t.resetFilter,closeIcon:t.closeIcon,filterIcon:t.filterIcon,itemCheckboxIcon:t.itemCheckboxIcon,ptm:s,cx:l,isUnstyled:u,metaData:t.metaData})},A=function(){if(t.panelFooterTemplate){var F=ke.getJSXElement(t.panelFooterTemplate,t,t.onOverlayHide);return b.createElement("div",{className:"p-multiselect-footer"},F)}return null},w=function(F,P){if(t.focusOnHover){var H;t==null||(H=t.changeFocusedOptionIndex)===null||H===void 0||H.call(t,F,P)}},C=function(){var F=ke.getJSXElement(t.emptyFilterMessage,t)||ni("emptyFilterMessage"),P=i({className:l("emptyMessage")},d("emptyMessage"));return b.createElement("li",ks({},P,{key:"emptyFilterMessage"}),F)},S=function(){var F=ke.getJSXElement(t.emptyMessage,t)||ni("emptyMessage"),P=i({className:l("emptyMessage")},d("emptyMessage"));return b.createElement("li",ks({},P,{key:"emptyMessage"}),F)},T=function(F,P){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N={height:H.props?H.props.itemSize:void 0},z=F.group===!0&&t.optionGroupLabel;if(z){var U=t.optionGroupTemplate?ke.getJSXElement(t.optionGroupTemplate,F,P):t.getOptionGroupLabel(F),ce=P+"_"+t.getOptionGroupRenderKey(F),X=i({className:l("itemGroup"),style:c("itemGroup",{scrollerOptions:H})},d("itemGroup"));return b.createElement("li",ks({key:ce},X),U)}var R=t.getOptionLabel(F),ue=P+"_"+t.getOptionRenderKey(F),Y=t.isOptionDisabled(F),ie=t.isSelected(F);return b.createElement(qO,{hostName:t.hostName,key:ue,focusedOptionIndex:t.focusedOptionIndex,label:R,option:F,style:N,index:P,template:t.itemTemplate,selected:ie,onClick:t.onOptionSelect,onMouseMove:w,disabled:Y,className:t.itemClassName,checkboxIcon:t.checkboxIcon,isUnstyled:u,ptm:s,cx:l})},x=function(){return ke.isNotEmpty(t.visibleOptions)?t.visibleOptions.map(T):t.hasFilter?C():S()},E=function(){if(t.virtualScrollerOptions){var F=i1(i1({},t.virtualScrollerOptions),{style:i1(i1({},t.virtualScrollerOptions.style),{height:t.scrollHeight}),className:ft("p-multiselect-items-wrapper",t.virtualScrollerOptions.className),items:t.visibleOptions,autoSize:!0,onLazyLoad:function(U){return t.virtualScrollerOptions.onLazyLoad(i1(i1({},U),{filter:t.filterValue}))},itemTemplate:function(U,ce){return U&&T(U,ce.index,ce)},contentTemplate:function(U){var ce=v()?C():U.children,X=i({ref:U.contentRef,style:U.style,className:ft(U.className,l("list",{virtualScrollerProps:t.virtualScrollerOptions})),role:"listbox","aria-multiselectable":!0},d("list"));return b.createElement("ul",X,ce)}});return b.createElement(Om,ks({ref:n},F,{pt:s("virtualScroller"),__parentMetadata:{parent:t.metaData}}))}var P=x(),H=i({className:l("wrapper"),style:{maxHeight:t.scrollHeight}},d("wrapper")),N=i({className:l("list"),role:"listbox","aria-multiselectable":!0},d("list"));return b.createElement("div",H,b.createElement("ul",N,P))},_=function(){var F=t.allowOptionSelect(),P=m(),H=E(),N=A(),z=i({className:ft(t.panelClassName,l("panel",{panelProps:t,context:a,allowOptionSelect:F})),style:t.panelStyle,onClick:t.onClick},d("panel"));if(t.inline)return b.createElement("div",ks({ref:e},z),H,N);var U=i({classNames:l("transition"),in:t.in,timeout:{enter:120,exit:100},options:t.transitionOptions,appear:!0,unmountOnExit:!0,onEnter:f,onEntered:h,onExit:t.onExit,onExited:t.onExited},d("transition")),ce=i({ref:t.firstHiddenFocusableElementOnOverlay,role:"presentation",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:t.onFirstHiddenFocus,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},s("hiddenFirstFocusableEl")),X=i({ref:t.lastHiddenFocusableElementOnOverlay,role:"presentation",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:t.onLastHiddenFocus,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},s("hiddenLastFocusableEl"));return b.createElement(Ro,ks({nodeRef:e},U),b.createElement("div",ks({ref:e},z),b.createElement("span",ce),P,H,N,b.createElement("span",X)))},M=_();return t.inline?M:b.createElement(Vl,{element:M,appendTo:t.appendTo})}));$O.displayName="MultiSelectPanel";function jO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function bl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zO(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Nde(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3514
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,a=u},f:function(){try{s||n.return==null||n.return()}finally{if(l)throw a}}}}function Nde(t,e){if(t){if(typeof t=="string")return HO(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HO(t,e):void 0}}function HO(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var YO=b.memo(b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=v2.getProps(t,r),a=b.useState(null),s=cd(a,2),l=s[0],c=s[1],u=b.useState(!1),d=cd(u,2),f=d[0],h=d[1],g=jx("",i.filterDelay||0),v=cd(g,3),m=v[0],A=v[1],w=v[2],C=b.useState(-1),S=cd(C,2),T=S[0],x=S[1],E=b.useState(!1),_=cd(E,2),M=_[0],O=_[1],F=b.useState(i.inline),P=cd(F,2),H=P[0],N=P[1],z=b.useRef(null),U=b.useRef(null),ce=b.useRef(null),X=b.useRef(null),R=b.useRef(null),ue=b.useRef(i.inputRef),Y=b.useRef(null),ie=b.useRef(null),re=b.useRef(null),Z=A&&A.trim().length>0,K=ke.isEmpty(i.value),W=i.optionValue?null:i.dataKey,ge={props:i,state:{filterState:A,focused:M,overlayVisible:H}},ye=v2.setMetaData(ge),Ee=ye.ptm,Ae=ye.cx,fe=ye.sx,ne=ye.isUnstyled;li(v2.css.styles,ne,{name:"multiselect"});var q=ep({target:z,overlay:ie,listener:function(Ye,Et){var Wt=Et.type,Jn=Et.valid;Jn&&(Wt==="outside"?!Ke(Ye)&&!st(Ye)&&ot():r.hideOverlaysOnDocumentScrolling?ot():xe.isDocument(Ye.target)||wt())},when:H}),ee=cd(q,2),oe=ee[0],he=ee[1],De=function(Ye){var Et=Ye.relatedTarget===ue.current?xe.getFirstFocusableElement(ie.current,':not([data-p-hidden-focusable="true"])'):ue.current;xe.focus(Et)},Ne=function(Ye){var Et=Ye.relatedTarget===ue.current?xe.getLastFocusableElement(ie.current,':not([data-p-hidden-focusable="true"])'):ue.current;xe.focus(Et)},ve=function(Ye){ws.emit("overlay-click",{originalEvent:Ye,target:z.current})},Se=function(){return!i.selectionLimit||!i.value||i.value&&i.value.length<i.selectionLimit},Be=function(Ye){var Et=Xt()&&Ye<er.length-1?er.slice(Ye+1).findIndex(function(Wt){return zn(Wt)}):-1;return Et>-1?Et+Ye+1:-1},Te=function(Ye){var Et=Xt()&&Ye>0?ke.findLastIndex(er.slice(0,Ye),function(Wt){return zn(Wt)}):-1;return Et>-1?Et:-1},$=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=-1;return Xt()&&(Et?(Wt=Te(Ye),Wt=Wt===-1?Be(Ye):Wt):(Wt=Be(Ye),Wt=Wt===-1?Te(Ye):Wt)),Wt>-1?Wt:Ye},pe=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,Wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(Et===-1&&(Et=$(Wt,!0)),Wt===-1&&(Wt=$(Et)),Et!==-1&&Wt!==-1){var Jn=Math.min(Et,Wt),br=Math.max(Et,Wt),Pr=er.slice(Jn,br+1).filter(function(oa){return Ln(oa)}).map(function(oa){return Nt(oa)});mn(Ye,Pr,Pr)}},me=function(Ye,Et){var Wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(!(i.disabled||Qe(Et))){var Jn=Wn(Et),br=null;Jn?br=i.value.filter(function(Pr){return!ke.equals(Pr,Nt(Et),W)}):br=[].concat(Ade(i.value||[]),[Nt(Et)]),mn(Ye,br,Et),Wt!==-1&&c(Wt)}},ae=function(Ye){!i.inline&&!i.disabled&&!i.loading&&!vt(Ye)&&!Ke(Ye)&&(H?ot():He(),xe.focus(ue.current),Ye.preventDefault()),h(!0)},le=function(Ye){if(!H)He(),i.editable&&kn(Ye,at());else{var Et=l!==-1?xt(l):f?We():se();Ye.shiftKey&&pe(Ye,T,Et),kn(Ye,Et)}Ye.preventDefault()},be=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ye.altKey&&!Et)l!==-1&&me(Ye,er[l]),H&&ot(),Ye.preventDefault();else{var Wt=l!==-1?Rt(l):f?dt():Me();kn(Ye,Wt),!H&&He(),Ye.preventDefault()}},Ie=function(Ye){H?l!==-1&&(Ye.shiftKey?pe(Ye,l):me(Ye,er[l])):(c(-1),le(Ye)),Ye.preventDefault()},Pe=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=Ye.currentTarget;if(Et){var Jn=Wt.value.length;Wt.setSelectionRange(0,Ye.shiftKey?Jn:0),c(-1)}else{var br=Ye.metaKey||Ye.ctrlKey,Pr=We();Ye.shiftKey&&br&&pe(Ye,Pr,T),kn(Ye,Pr),!H&&He()}Ye.preventDefault()},ze=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=Ye.currentTarget;if(Et){var Jn=Wt.value.length;Wt.setSelectionRange(Ye.shiftKey?0:Jn,Jn),wde("focusedOptionIndex")}else{var br=Ye.metaKey||Ye.ctrlKey,Pr=dt();Ye.shiftKey&&br&&pe(Ye,T,Pr),kn(Ye,Pr),!H&&He()}Ye.preventDefault()},Ze=function(Ye){Ye.preventDefault()},nt=function(Ye){Ye.preventDefault()},ht=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Et||(H&&Zt()?(xe.focus(Ye.shiftKey?R.current:X.current),Ye.preventDefault()):(l!==-1&&me(Ye,er[l]),H&&ot(filter)))},Ut=function(){x(l)},fn=function(Ye){var Et=Ye.metaKey||Ye.ctrlKey;switch(Ye.code){case"ArrowUp":if(i.inline)break;be(Ye);break;case"ArrowDown":if(i.inline)break;le(Ye);break;case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;Ie(Ye);break;case"Home":if(i.inline)break;Pe(Ye),Ye.preventDefault();break;case"End":if(i.inline)break;ze(Ye),Ye.preventDefault();break;case"PageDown":nt(Ye);break;case"PageUp":Ze(Ye);break;case"Escape":if(i.inline)break;ot();break;case"Tab":ht(Ye);break;case"ShiftLeft":case"ShiftRight":Ut();break;default:if(Ye.key==="a"&&Et){var Wt=er.filter(function(Jn){return Ln(Jn)}).map(function(Jn){return Nt(Jn)});mn(Ye,Wt,Wt),Ye.preventDefault();break}!Et&&ke.isPrintableCharacter(Ye.key)&&(!H&&He(),Dn(Ye),Ye.preventDefault());break}h(!1)},$t=function(Ye){if(i.onSelectAll)i.onSelectAll(Ye);else{var Et=null;if(Ye.checked)Et=[];else{var Wt=er.filter(function(Jn){return Ln(Jn)&&!Qe(Jn)});Wt&&(Et=Wt.map(function(Jn){return Nt(Jn)}))}i.selectionLimit&&Et&&Et.length&&(Et=Et.slice(0,i.selectionLimit)),mn(Ye.originalEvent,Et,Et)}},mn=function(Ye,Et,Wt){i.onChange&&(i.onChange({originalEvent:Ye,value:Et,selectedOption:Wt,stopPropagation:function(){Ye==null||Ye.stopPropagation()},preventDefault:function(){Ye==null||Ye.preventDefault()},target:{name:i.name,id:i.id,value:Et}}),xe.focus(ue.current))},En=function(Ye){var Et=Ye.query;w(Et),i.onFilter&&i.onFilter({originalEvent:Ye,filter:Et})},Tt=function(){w(""),i.onFilter&&i.onFilter({filter:""})},je=function(Ye){if(H){var Et;Ye?Et=Ye.currentTarget:Et=xe.findSingle(ie.current,'li[data-p-highlight="true"]'),Et&&Et.scrollIntoView&&Et.scrollIntoView({block:"nearest",inline:"nearest"})}},He=function(){N(!0),c(l!==-1?l:i.autoOptionFocus?se():at()),xe.focus(ue.current)},ot=function(){c(-1),N(!1),h(!1)},rn=function(Ye){Di.set("overlay",ie.current,r&&r.autoZIndex||Yn.autoZIndex,r&&r.zIndex.overlay||Yn.zIndex.overlay),xe.addStyles(ie.current,{position:"absolute",top:"0",left:"0"}),wt(),je(),Ye&&Ye()},nn=function(Ye){Ye&&Ye(),oe(),i.onShow&&i.onShow()},Jt=function(){he()},_n=function(){i.filter&&i.resetFilterOnHide&&Tt(),Di.clear(ie.current),i.onHide&&i.onHide()},wt=function(){!i.inline&&xe.alignOverlay(ie.current,Y.current.parentElement,i.appendTo||r&&r.appendTo||Yn.appendTo)},Ke=function(Ye){return xe.getAttribute(Ye.target,"data-pc-section")==="clearicon"},st=function(Ye){return xe.getAttribute(Ye.target,"data-pc-section")==="headercheckboxcontainer"},vt=function(Ye){return ie.current&&ie.current.contains(Ye.target)},Vt=function(Ye){ot(),xe.focus(ue.current),Ye.preventDefault(),Ye.stopPropagation()},On=function(){if(i.value!=null&&i.options){if(i.optionGroupLabel){var Ye=0,Et=i.options.findIndex(function(Wt,Jn){return(Ye=Jn)&&$n(i.value,Fe(Wt))!==-1});return Et!==-1?{group:Ye,option:Et}:-1}return $n(i.value,i.options)}return-1},$n=function(Ye,Et){return Et.findIndex(function(Wt){return Ye.some(function(Jn){return ke.equals(Jn,Nt(Wt),W)})})},lr=function(Ye,Et){return ke.equals(Ye,Et,W)},Wn=function(Ye){if(i.value){var Et=Nt(Ye),Wt=At(Ye);return i.value.some(function(Jn){return ke.equals(Wt?Jn:Nt(Jn),Et,W)})}return!1},vr=function(Ye){var Et;if(i.options)if(i.optionGroupLabel){var Wt=zO(i.options),Jn;try{for(Wt.s();!(Jn=Wt.n()).done;){var br=Jn.value;if(Et=Nr(Ye,Fe(br)),Et)break}}catch(Pr){Wt.e(Pr)}finally{Wt.f()}}else Et=Nr(Ye,i.options),ke.isEmpty(Et)&&(Et=Nr(Ye,i.value));return Et?yt(Et):null},Nr=function(Ye,Et){return Et.find(function(Wt){return ke.equals(Nt(Wt),Ye,W)})},yn=function(Ye){O(!0),i.onFocus&&i.onFocus(Ye)},lt=function(Ye){O(!1),i.onBlur&&i.onBlur(Ye)},ut=function(){if(i.onSelectAll)return i.selectAll;if(ke.isEmpty(er))return!1;var Ye=er.filter(function(Et){return!Qe(Et)&&Ln(Et)});return!Ye.some(function(Et){return!Wn(Et)})},yt=function(Ye){return i.optionLabel?ke.resolveFieldData(Ye,i.optionLabel):Ye&&Ye.label!==void 0?Ye.label:Ye},Nt=function(Ye){return i.useOptionAsValue?Ye:i.optionValue?ke.resolveFieldData(Ye,i.optionValue):Ye&&Ye.value!==void 0?Ye.value:Ye},An=function(Ye){return i.dataKey?ke.resolveFieldData(Ye,i.dataKey):yt(Ye)},Nn=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupLabel)},It=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupLabel)},Fe=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupChildren)},Qe=function(Ye){var Et;if(!Se()&&!Wn(Ye))return!0;var Wt=i.optionDisabled;return Wt?ke.isFunction(Wt)?Wt(Ye):ke.resolveFieldData(Ye,Wt):Ye&&((Et=Ye.disabled)!==null&&Et!==void 0?Et:!1)},At=function(Ye){return!i.useOptionAsValue&&i.optionValue||Ye&&Ye.value!==void 0},jt=function(Ye){return i.optionGroupLabel&&Ye.group},Xt=function(){return ke.isNotEmpty(i.value)},Zt=function(){return xe.getFocusableElements(ie.current,':not([data-p-hidden-focusable="true"])').length>0},Sn=function(Ye){var Et;return Ln(Ye)&&((Et=yt(Ye))===null||Et===void 0?void 0:Et.toLocaleLowerCase(i.filterLocale).startsWith(U.current.toLocaleLowerCase(i.filterLocale)))},Ln=function(Ye){return ke.isNotEmpty(Ye)&&!(Qe(Ye)||jt(Ye))},zn=function(Ye){return Ln(Ye)&&Wn(Ye)},at=function(){if(Xt()){for(var Ye=function(){var br=i.value[Wt],Pr=er.findIndex(function(oa){return zn(oa)&&lr(br,Nt(oa))});if(Pr>-1)return{v:Pr}},Et,Wt=i.value.length-1;Wt>=0;Wt--)if(Et=Ye(),Et)return Et.v}return-1},se=function(){var Ye=at();return Ye<0?We():Ye},Me=function(){var Ye=at();return Ye<0?dt():Ye},We=function(){return er.findIndex(function(Ye){return Ln(Ye)})},dt=function(){return ke.findLastIndex(er,function(Ye){return Ln(Ye)})},xt=function(Ye){var Et=Ye<er.length-1?er.slice(Ye+1).findIndex(function(Wt){return Ln(Wt)}):-1;return Et>-1?Et+Ye+1:Ye},Rt=function(Ye){var Et=Ye>0?ke.findLastIndex(er.slice(0,Ye),function(Wt){return Ln(Wt)}):-1;return Et>-1?Et:Ye},Dn=function(Ye){U.current=(U.current||"")+Ye.key;var Et=-1;ke.isNotEmpty(U.current)&&(l!==-1?(Et=er.slice(l).findIndex(function(Wt){return Sn(Wt)}),Et=Et===-1?er.slice(0,l).findIndex(function(Wt){return Sn(Wt)}):Et+l):Et=er.findIndex(function(Wt){return Sn(Wt)}),Et===-1&&l===-1&&(Et=se()),Et!==-1&&kn(Ye,Et)),ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){U.current="",ce.current=null},500)},kn=function(Ye,Et){l!==Et&&(c(Et),je(Ye),i.selectOnFocus&&me(Ye,er[Et],!1))},Hn=function(Ye,Et){if(Ye.stopPropagation(),!!Mr(Ye.currentTarget)){var Wt=i.value.filter(function(Jn){return!ke.equals(Jn,Et,W)});i.onRemove&&i.onRemove({originalEvent:Ye,value:Wt}),mn(Ye,Wt,Et)}},Mr=function(Ye){var Et=re.current,Wt=Et.clientWidth<Et.scrollWidth;if(!Wt)return!0;var Jn=Ye.closest('[data-pc-section="token"]'),br=window.getComputedStyle(Et),Pr=window.getComputedStyle(Jn),oa=Et.clientWidth-parseFloat(br.paddingLeft)-parseFloat(br.paddingRight),da=Jn.getBoundingClientRect().right+parseFloat(Pr.marginRight)-Et.getBoundingClientRect().left;return da<=oa},Kr=function(){var Ye=/{(.*?)}/,Et=i.selectedItemsLabel||ni("selectionMessage"),Wt=i.value?i.value.length:0;return Ye.test(Et)?Et.replace(Et.match(Ye)[0],Wt+""):Et},qn=function(){var Ye;if(!K&&!i.fixedPlaceholder){var Et;return ke.isNotEmpty(i.maxSelectedLabels)&&((Et=i.value)===null||Et===void 0?void 0:Et.length)>i.maxSelectedLabels?Kr():ke.isArray(i.value)?i.value.reduce(function(Wt,Jn,br){return Wt+(br!==0?", ":"")+vr(Jn)},""):""}return Ye},Fn=function(){var Ye=i.value?i.value.length:0;if(ke.isNotEmpty(i.maxSelectedLabels)&&Ye>i.maxSelectedLabels)return Kr();if(i.selectedItemTemplate)return K?ke.getJSXElement(i.selectedItemTemplate):i.value.map(function(Wt,Jn){var br=ke.getJSXElement(i.selectedItemTemplate,Wt);return b.createElement(b.Fragment,{key:Jn},br)});if(i.display==="chip"&&!K){var Et=i.value.slice(0,i.maxSelectedLabels||Ye);return Et.map(function(Wt,Jn){var br={context:{value:Wt,index:Jn}},Pr=vr(Wt),oa=Pr+"_"+Jn,da=n({"aria-label":ni("removeTokenIcon"),className:Ae("removeTokenIcon"),onClick:function(te){return Hn(te,Wt)},onKeyDown:function(te){return ai(te,Wt)},tabIndex:i.tabIndex||"0"},Ee("removeTokenIcon",br)),Vs=!i.disabled&&(i.removeIcon?nr.getJSXIcon(i.removeIcon,bl({},da),{props:i}):b.createElement(hb,da)),mo=n({className:Ae("token")},Ee("token",br)),Xr=n({className:Ae("tokenLabel")},Ee("tokenLabel",br));return b.createElement("div",ks({},mo,{key:oa}),b.createElement("span",Xr,Pr),Vs)})}return qn()},sr=function(){var Ye=i.optionGroupLabel?Lr(i.options):i.options;if(Z){var Et=A.trim().toLocaleLowerCase(i.filterLocale),Wt=i.filterBy?i.filterBy.split(","):[i.optionLabel||"label"];if(i.optionGroupLabel){var Jn=[],br=zO(i.options),Pr;try{for(br.s();!(Pr=br.n()).done;){var oa=Pr.value,da=P0.filter(Fe(oa),Wt,Et,i.filterMatchMode,i.filterLocale);da&&da.length&&Jn.push(bl(bl({},oa),_f({},i.optionGroupChildren,da)))}}catch(Vs){br.e(Vs)}finally{br.f()}return Lr(Jn)}return P0.filter(Ye,Wt,Et,i.filterMatchMode,i.filterLocale)}return Ye},Lr=function(Ye){return(Ye||[]).reduce(function(Et,Wt,Jn){Et.push(bl(bl({},Wt),{},{group:!0,index:Jn}));var br=Fe(Wt);return br&&br.forEach(function(Pr){return Et.push(Pr)}),Et},[])},pi=function(Ye){switch(Ye.code){case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;mn(Ye,[],[]),Ye.preventDefault(),Ye.stopPropagation();break}},ai=function(Ye,Et){switch(Ye.code){case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;Hn(Ye,Et),Ye.preventDefault(),Ye.stopPropagation();break}};b.useImperativeHandle(e,function(){return{props:i,show:He,hide:ot,focus:function(){return xe.focus(ue.current)},getElement:function(){return z.current},getOverlay:function(){return ie.current},getInput:function(){return ue.current}}}),Li(function(){wt()}),b.useEffect(function(){ke.combinedRefs(ue,i.inputRef)},[ue,i.inputRef]),b.useEffect(function(){i.overlayVisible===!0?He():i.overlayVisible===!1&&ot()},[i.overlayVisible]),fr(function(){H&&A&&Z&&wt()},[H,A,Z]),ja(function(){Di.clear(ie.current)});var ui=function(){var Ye=n({className:Ae("clearIcon"),"aria-label":ni("clear"),onClick:function(br){return mn(br,[],[])},onKeyDown:function(br){return pi(br)},tabIndex:i.tabIndex||"0"},Ee("clearIcon")),Et=i.clearIcon||b.createElement(mc,Ye),Wt=nr.getJSXIcon(Et,bl({},Ye),{props:i});return!K&&i.showClear&&!i.disabled?Wt:null},Pi=function(){var Ye=Fn(),Et=n({ref:Y,className:Ae("labelContainer")},Ee("labelContainer")),Wt=n({ref:re,className:Ae("label",{empty:K})},Ee("label"));return b.createElement("div",Et,b.createElement("div",Wt,Ye||i.placeholder||i.emptyMessage||"empty"))},er=sr(),Ui=ke.isNotEmpty(i.tooltip),Ti=v2.getOtherProps(i),Si=ke.reduceKeys(Ti,xe.ARIA_PROPS),Hi=n({className:Ae("triggerIcon")},Ee("triggerIcon")),hn=n({className:Ae("trigger")},Ee("trigger")),Ue=i.loadingIcon?nr.getJSXIcon(i.loadingIcon,bl({},Hi),{props:i}):b.createElement(R1,ks({spin:!0},Hi)),Kt=i.dropdownIcon?nr.getJSXIcon(i.dropdownIcon,bl({},Hi),{props:i}):b.createElement(Yd,Hi),jn=b.createElement("div",hn,i.loading?Ue:Kt),jr=!i.inline&&Pi(),kr=!i.inline&&ui(),Ka=n(bl(bl({ref:z,id:i.id,style:bl(bl({},i.style),fe("root")),className:ft(i.className,Ae("root",{focusedState:M,context:r,overlayVisibleState:H}))},Ti),{},{onClick:ae}),v2.getOtherProps(i),Ee("root")),Vr=n({className:"p-hidden-accessible","data-p-hidden-accessible":!0},Ee("hiddenInputWrapper")),Es=n(bl({ref:ue,id:i.inputId,name:i.name,type:"text",onFocus:yn,onBlur:lt,onKeyDown:fn,role:"combobox","aria-expanded":H,disabled:i.disabled,tabIndex:i.disabled?-1:i.tabIndex,value:qn()},Si),Ee("input"));return b.createElement(b.Fragment,null,b.createElement("div",Ka,b.createElement("div",Vr,b.createElement("input",ks({},Es,{readOnly:!0}))),!i.inline&&b.createElement(b.Fragment,null,jr,kr,jn),b.createElement($O,ks({hostName:"MultiSelect",ref:ie,visibleOptions:er},i,{onClick:ve,onOverlayHide:ot,filterValue:m,focusedOptionIndex:l,onFirstHiddenFocus:De,onLastHiddenFocus:Ne,firstHiddenFocusableElementOnOverlay:X,lastHiddenFocusableElementOnOverlay:R,setFocusedOptionIndex:c,hasFilter:Z,isValidOption:Ln,getOptionValue:Nt,updateModel:mn,onFilterInputChange:En,resetFilter:Tt,onCloseClick:Vt,onSelectAll:$t,getOptionLabel:yt,getOptionRenderKey:An,isOptionDisabled:Qe,getOptionGroupChildren:Fe,getOptionGroupLabel:It,getOptionGroupRenderKey:Nn,isSelected:Wn,getSelectedOptionIndex:On,isAllSelected:ut,onOptionSelect:me,allowOptionSelect:Se,in:H,onEnter:rn,onEntered:nn,onExit:Jt,onExited:_n,ptm:Ee,cx:Ae,sx:fe,isUnstyled:ne,metaData:ge,changeFocusedOptionIndex:kn}))),Ui&&b.createElement(cn,ks({target:z,content:i.tooltip,pt:Ee("tooltip")},i.tooltipOptions)))}));YO.displayName="MultiSelect";const Ode=t=>{var Ee,Ae,fe,ne,q,ee,oe,he,De,Ne;const{field:e,fieldIndex:n,row:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isBuilderMode:u,isAdmin:d}=Ht(),[f,h]=k.useState([]),[g,v]=k.useState(!1),[m,A]=k.useState(!1),{userSelectedLanguage:w,formBuilderFormLayout:C,sectionSettingUpdate:S,pageSettingUpdate:T,fieldSettingUpdate:x}=sn(),{taskRegisterData:E,updateTaskRegisterData:_,updateTaskProgressValue:M,userTaskSubmitFormData:O,updateUserFormDataSubmit:F,task_status:P,TASK_PUBLISHED:H}=Ar(),[N,z]=k.useState(0),[U,ce]=k.useState(!1),X=()=>{ce(!0)},R=()=>{ce(!1)},ue=ve=>{A(ve)},Y=()=>{A(!1)},ie=ve=>{h(ve.value),r!=null&&r.rowIsRepeatable?W(i,a,e,ve.value):K(ve.value)},re=ve=>{e==null||e.conditionalTabRules.rules.map(Se=>{var Be;(Be=Se==null?void 0:Se.conditions)==null||Be.map(Te=>{var $;if(($=ve.value)!=null&&$.some(pe=>pe===Te.option)){const pe=_t.findIndex(C,ae=>{var le;return ae.uuid===((le=Te==null?void 0:Te.tab)==null?void 0:le.uuid)}),me=C[pe];me.isHidden=!1,T(pe,me)}else{const pe=_t.findIndex(C,ae=>{var le;return ae.uuid===((le=Te==null?void 0:Te.tab)==null?void 0:le.uuid)}),me=C[pe];me.isHidden=!0,T(pe,me)}})})},Z=ve=>{e==null||e.conditionalSectionRules.rules.map(Se=>{var Be;(Be=Se==null?void 0:Se.conditions)==null||Be.map(Te=>{var $;if(($=ve.value)!=null&&$.some(pe=>pe===Te.option)){const pe=_t.findIndex(C,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.tab)==null?void 0:be.uuid)}),me=_t.findIndex(C[pe].children,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.section)==null?void 0:be.uuid)}),ae=C[pe].children[me];ae.isHidden=!1,S(pe,me,ae)}else{const pe=_t.findIndex(C,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.tab)==null?void 0:be.uuid)}),me=_t.findIndex(C[pe].children,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.section)==null?void 0:be.uuid)}),ae=C[pe].children[me];ae.isHidden=!0,S(pe,me,ae)}})})},K=ve=>{const Se=O,Be=_t.cloneDeep(E);if((ve==null?void 0:ve.length)>0&&(Se==null?void 0:Se.length)>0){Be[e==null?void 0:e.uuid]=ve;for(const Te of Se)Te.fieldId===t.field.uuid&&(Te.postData[0]={postValue:ve})}else if(delete Be[e==null?void 0:e.uuid],(Se==null?void 0:Se.length)>0)for(const Te of Se)Te.fieldId===t.field.uuid&&(Te.postData[0]={postValue:[]});if(!(r!=null&&r.rowIsRepeatable)){_(Be);const Te=Object.keys(Be).length;M(Te)}},W=(ve,Se,Be,Te)=>{var $;if(h(Te),O){const pe=[...O],me=_t.findIndex(pe,function(be){return be.rowId===(r==null?void 0:r.uuid)});let ae=($=O[me])==null?void 0:$.repeatableFields,le="<ol class='card '>";Te==null||Te.map(be=>{le=le+`<li>${be}</li>`}),le=le+"</ol>",ae={...ae,[Be==null?void 0:Be.uuid]:le},pe[me]={...pe[me],repeatableFields:ae},F(pe)}(Te==null?void 0:Te.length)>0?Be.isValid=1:Be.isValid=0,x(ve,Se,s,l,n,Be)},ge=()=>{var ve,Se,Be;if(r!=null&&r.rowIsRepeatable){if(r!=null&&r.repeatableFields){const Te=[...r.repeatableFields],$=_t.findIndex(Te,function(pe){return pe.uuid===(e==null?void 0:e.uuid)});$>=0&&Te[$].fieldData?h(pe=>[...pe,Te[$].fieldData]):(e.isValid=0,h([]))}}else{const Te=O,$=_t.cloneDeep(E);if(Te!=null&&Te.length){for(const pe of Te)if(pe.fieldId===t.field.uuid&&((ve=pe==null?void 0:pe.postData)!=null&&ve.length)){h((Se=pe==null?void 0:pe.postData[0])==null?void 0:Se.postValue),$[e==null?void 0:e.uuid]=(Be=pe==null?void 0:pe.postData[0])==null?void 0:Be.postValue;const me=Object.keys($).length;M(me);break}}}v(!0)};k.useEffect(()=>{!g&&(O==null?void 0:O.length)>0&&ge();const ve=Gt.addListener("onSubmitUserForm",()=>{var Te;(Te=e==null?void 0:e.attributes)!=null&&Te.required?(f==null?void 0:f.length)>0?e.isValid=1:e.isValid=0:e.isValid=1}),Se=Gt.addListener("clearRepeatableFields",Te=>{Te===(r==null?void 0:r.uuid)&&(h([]),z(0),e.isValid=0)}),Be=Gt.addListener("OnInvalidFieldCatch",Te=>{e.uuid===(Te==null?void 0:Te.fieldId)?z(1):z(0)});return()=>{ve.remove(),Be.remove(),Se.remove()}});const ye=o.jsxs("div",{onMouseOver:X,onMouseOut:R,children:[u&&U&&o.jsx(Wr,{handleFieldSettingsSidebar:ue,...t}),o.jsxs("div",{className:`field ${u&&" py-3 px-4 builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:u?"col-12 p-fluid field-form-builder":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Ee=e==null?void 0:e.headerText)==null?void 0:Ee[w==null?void 0:w.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(fe=e==null?void 0:e.label)==null?void 0:fe[w==null?void 0:w.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{message:(ne=e==null?void 0:e.toolTip)==null?void 0:ne[w==null?void 0:w.type],position:"right"})})]}),o.jsx(YO,{onFocus:()=>z(1),value:f,onChange:ve=>{ie(ve),re(ve),Z(ve)},options:e==null?void 0:e.options,optionLabel:`optionText.${w.type}`,placeholder:(q=e==null?void 0:e.placeholder)==null?void 0:q[w==null?void 0:w.type],display:"chip",disabled:d||c}),((ee=e==null?void 0:e.attributes)==null?void 0:ee.required)&&o.jsx("small",{className:"error",children:N===1&&!((f==null?void 0:f.length)>0)?(oe=e==null?void 0:e.validationMesssage)==null?void 0:oe.english:""})]}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(he=e==null?void 0:e.helperText)==null?void 0:he[w==null?void 0:w.type]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]}),((De=e==null?void 0:e.inlineConditionalRules)==null?void 0:De.rules.length)>0&&u===!0&&o.jsx("p",{children:"Inline conditional rules"}),(Ne=e==null?void 0:e.inlineConditionalRules)==null?void 0:Ne.rules.map((ve,Se)=>u===!1?o.jsx("div",{children:ve==null?void 0:ve.conditions.map((Be,Te)=>{if(f!=null&&f.some($=>$===Be.value)||u)return o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(cb,{data:e,ruleIndex:Se,conditionIndex:Te,condition:Be,...t})})},Te)})},`rule-${Se}`):o.jsx(ci,{className:"mt-4",header:`Rule ${Se+1}`,children:o.jsx("div",{children:ve==null?void 0:ve.conditions.map((Be,Te)=>{if(f!=null&&f.some($=>$===Be.value)||u)return o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(cb,{data:e,...t,ruleIndex:Se,conditionIndex:Te,condition:Be})})},Te)})},`rule-${Se}`)},Se))]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Qi,{visibilty:m,closeSettingFieldSidebar:Y,...t},e==null?void 0:e.uuid),o.jsx(xi,{...t,fieldWrap:ye})]})},Fde=t=>{const{options:e,title:n}=t,r=e.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",i=`${e.className} justify-content-start`,a=`${e.titleClassName} pl-1`;return o.jsxs("div",{className:i,children:[o.jsxs("button",{className:e.togglerClassName,onClick:e.onTogglerClick,children:[o.jsx("span",{className:r}),o.jsx(Qt,{})]}),o.jsx("span",{className:a,children:n})]})},KO=t=>{const e=k.useRef(null),{optionIndex:n,option:r,field:i,fieldIndex:a,pageIndex:s,sectionIndex:l,rowIndex:c,columnIndex:u,path:d}=t,{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),[m,A]=k.useState(r==null?void 0:r.optionText[f==null?void 0:f.type]);k.useEffect(()=>(A(r==null?void 0:r.optionText[f==null?void 0:f.type]),()=>{}),[i]),k.useEffect(()=>{const S=setTimeout(()=>{C("optionText",r.uuid,m,f)},1500);return()=>{clearTimeout(S)}},[m]);const w=S=>{const T=d.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(T[fa],T[ha],T[Ca],T[xa],T[Ta],T[Fa],T[Xo],T[wo],S):(T==null?void 0:T.length)>Fa&&(T==null?void 0:T.length)===Bl+1&&(i!=null&&i.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(T[fa],T[ha],T[Ca],T[xa],T[Ta],T[5],T[6],T[7],S):h(s,l,c,u,a,{...S})},C=(S,T,x,E)=>{if(i!=null&&i.options){const _=[...i.options];_[n][S][E==null?void 0:E.type]=x,w({...i,options:_})}};return o.jsx(o.Fragment,{children:o.jsx(N3,{id:r==null?void 0:r.uuid,style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:m||"",disabled:!1,onChange:S=>{A(S.target.value)},tagName:"article"},r==null?void 0:r.uuid)})},XO=t=>{const{optionId:e,field:n,fieldIndex:r,columnIndex:i,sectionIndex:a,rowIndex:s,pageIndex:l,path:c}=t,{fieldSettingUpdate:u,fieldSettingUpdateInlineConditional:d,gridComponentFieldSettingUpdate:f}=sn(),h=m=>{const A=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?d(A[fa],A[ha],A[Ca],A[xa],A[Ta],A[Fa],A[Xo],A[wo],m):(A==null?void 0:A.length)>Fa&&(A==null?void 0:A.length)===Bl+1&&(m!=null&&m.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?f(A[fa],A[ha],A[Ca],A[xa],A[Ta],A[5],A[6],A[7],m):u(l,a,s,i,r,m)},g=()=>{const m=n==null?void 0:n.options.filter(function(w){return(w==null?void 0:w.uuid)!==e}),A={...n,options:m};h(A)},v=()=>{const m=_t.cloneDeep(n),A={...m,options:[...m.options,{uuid:rt(),optionText:{english:"Unititled"},value:rt(),score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]};h(A)};return o.jsxs(o.Fragment,{children:[o.jsx(Ft,{text:!0,label:"Add",className:"w-5rem ml-3 mr-3",onClick:()=>v(),size:"small"}),o.jsx(Ft,{text:!0,className:"w-3rem",size:"small",onClick:()=>{g()},icon:"pi pi-trash"})]})},kde=t=>{var Ne,ve,Se,Be,Te,$,pe,me,ae;const[e,n]=k.useState([]),[r,i]=k.useState(0),{taskRegisterData:a,updateTaskRegisterData:s,updateTaskProgressValue:l,userTaskSubmitFormData:c,task_status:u,updateUserFormDataSubmit:d,taskFieldUpdateHook:f,TASK_PUBLISHED:h,updateProgressDataValuesHook:g}=Ar(),{globalAlignment:v,isBuilderMode:m,isRenderView:A,isAdmin:w}=Ht(),{sectionSettingUpdate:C,userSelectedLanguage:S,fieldSettingUpdate:T,formBuilderFormLayout:x,pageSettingUpdate:E}=sn(),{field:_,fieldIndex:M,sectionIndex:O,pageIndex:F,row:P,rowIndex:H,columnIndex:N,section:z,page:U,isDisabled:ce}=t,[X,R]=k.useState(!1),[ue,Y]=k.useState(!1),[ie,re]=k.useState(!1),Z=()=>{re(!0)},K=()=>{re(!1)},W=le=>{R(le)},ge=()=>{R(!1)},ye=le=>{const be=[...e];le.checked?be.push(le.value):be.splice(be.indexOf(le.value),1),n(be),P!=null&&P.rowIsRepeatable?c&&oe(F,O,_,be):(Ee(le),fe(be),c&&(q(be),(be==null?void 0:be.length)>0?_.isValid=1:_.isValid=0,f(F,O,H,N,M,_)))},Ee=le=>{var Ie;const be=(Ie=le==null?void 0:le.value)==null?void 0:Ie.value;_==null||_.conditionalTabRules.rules.map(Pe=>{var ze;(ze=Pe==null?void 0:Pe.conditions)==null||ze.map(Ze=>{if(be===(Ze==null?void 0:Ze.option)&&(le!=null&&le.checked)){const nt=_t.findIndex(x,Ut=>{var fn;return Ut.uuid===((fn=Ze==null?void 0:Ze.tab)==null?void 0:fn.uuid)}),ht=x[nt];ht.isHidden=!1,E(nt,ht)}else if(be===(Ze==null?void 0:Ze.option)&&!(le!=null&&le.checked)){const nt=_t.findIndex(x,Ut=>{var fn;return Ut.uuid===((fn=Ze==null?void 0:Ze.tab)==null?void 0:fn.uuid)}),ht=x[nt];ht.isHidden=!0,E(nt,ht)}})})},Ae=k.useCallback((le,be)=>{var Ie;if((c==null?void 0:c.length)>0){const Pe=c;if(Pe!=null&&Pe.length){const ze=a;for(const[nt,ht]of be.children.entries())for(const[,Ut]of ht.children.entries())for(const[fn,$t]of Ut.children.entries())if(ht!=null&&ht.rowIsRepeatable){if((ht==null?void 0:ht.rowIsRepeatable)===!0){const mn=_t.findIndex(Pe,function(En){return En.rowId===ht.uuid});le===!0?mn===-1&&(Pe.push({postData:[],tabId:U.uuid,rowId:ht==null?void 0:ht.uuid,tabIndex:F,sectionId:z.uuid,minimumEntries:z==null?void 0:z.minimumEntries,sectionIndex:O,sectionHeading:z.heading,subHeadingText:z.subHeadingText,repeatableFields:{},repeatableFieldsData:[],language:"english",isHiddenSection:z.isHidden&&z.isHidden===1?1:0,reviewerChecklist:ht==null?void 0:ht.reviewerChecklist}),ze[ht==null?void 0:ht.uuid]&&delete ze[ht==null?void 0:ht.uuid]):(ze[ht==null?void 0:ht.uuid]&&delete ze[ht==null?void 0:ht.uuid],mn>=0&&Pe.splice(mn,1))}}else{const mn=_t.findIndex(Pe,function(En){return En.fieldId===$t.uuid});le?mn===-1&&(Pe.push({postData:[],tabId:U.uuid,tabIndex:F,...$t.inlineConditionalRules?{inlineConditionalRules:$t.inlineConditionalRules}:{},...$t.conditionalTabRules?{conditionalTabRules:$t.conditionalTabRules}:{},...$t.conditionalSectionRules?{conditionalSectionRules:$t.conditionalSectionRules}:{},sectionId:z.uuid,sectionIndex:O,sectionHeading:z.heading,subHeadingText:z.subHeadingText,reviewerChecklist:$t==null?void 0:$t.reviewerChecklist,rowId:ht.uuid,rowIndex:nt,columnId:z.uuid,columnIndex:N,inlineConditionalField:!0,fieldIndex:fn,fieldId:$t.uuid,fieldInputType:$t.componentType,fieldTitle:(Ie=$t.label)==null?void 0:Ie.english,fieldDescription:$t.description||null,fieldHelperText:$t.helperText||null,fieldHeaderText:$t.headerText||null,fieldFooterText:$t.footerText||null,fieldTitleAbb:$t.abbreviationLabel||$t.label,question_abb_table:$t.textForTable||null,language:"english",isHiddenfield:$t.isHidden&&$t.isHidden===1?1:0,isHiddenSection:z.isHidden&&z.isHidden===1?1:0}),ze[$t==null?void 0:$t.uuid]&&delete ze[$t==null?void 0:$t.uuid]):(ze[$t==null?void 0:$t.uuid]&&delete ze[$t==null?void 0:$t.uuid],mn>=0&&Pe.splice(mn,1))}const Ze=Object.keys(ze).length;g({progressMaxValue:Pe==null?void 0:Pe.length,progressValue:Ze}),d([...Pe])}}},[N,_==null?void 0:_.abbreviationLabel,_==null?void 0:_.componentType,_==null?void 0:_.conditionalSectionRules,_==null?void 0:_.conditionalTabRules,_==null?void 0:_.description,_==null?void 0:_.footerText,_==null?void 0:_.headerText,_==null?void 0:_.helperText,_==null?void 0:_.inlineConditionalRules,_==null?void 0:_.isHidden,_==null?void 0:_.label,_==null?void 0:_.reviewerChecklist,_==null?void 0:_.textForTable,U==null?void 0:U.uuid,F,P==null?void 0:P.uuid,H,z==null?void 0:z.heading,z==null?void 0:z.isHidden,z==null?void 0:z.subHeadingText,z==null?void 0:z.uuid,O,a,g,d,c]),fe=le=>{_==null||_.conditionalSectionRules.rules.map(be=>{var Ie;(Ie=be==null?void 0:be.conditions)==null||Ie.map(Pe=>{if(le!=null&&le.some(ze=>ze.value===Pe.option)){const ze=_t.findIndex(x,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.tab)==null?void 0:Ut.uuid)}),Ze=_t.findIndex(x[ze].children,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.section)==null?void 0:Ut.uuid)}),nt=x[ze].children[Ze];nt.isHidden=!1,Ae(!0,x[ze].children[Ze]),C(ze,Ze,nt)}else{const ze=_t.findIndex(x,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.tab)==null?void 0:Ut.uuid)}),Ze=_t.findIndex(x[ze].children,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.section)==null?void 0:Ut.uuid)}),nt=x[ze].children[Ze];nt.isHidden=!0,Ae(!1,x[ze].children[Ze]),C(ze,Ze,nt)}})})},ne=()=>{var be,Ie,Pe,ze;const le=c;if((le==null?void 0:le.length)>0){for(const Ze of le)if(Ze.fieldId===t.field.uuid){n(((be=Ze==null?void 0:Ze.postData[0])==null?void 0:be.postValue.length)>0?(Ie=Ze==null?void 0:Ze.postData[0])==null?void 0:Ie.postValue:[]);const nt=((Pe=Ze==null?void 0:Ze.postData[0])==null?void 0:Pe.postValue.length)>0?(ze=Ze==null?void 0:Ze.postData[0])==null?void 0:ze.postValue:[];_==null||_.conditionalTabRules.rules.map(ht=>{var Ut;(Ut=ht==null?void 0:ht.conditions)==null||Ut.map(fn=>{if(nt.some($t=>$t.value===(fn==null?void 0:fn.option))){const $t=_t.findIndex(x,En=>{var Tt;return En.uuid===((Tt=fn==null?void 0:fn.tab)==null?void 0:Tt.uuid)}),mn=x[$t];mn.isHidden=!1,E($t,mn)}})}),Y(!0);break}}},q=le=>{const be=c,Ie=_t.cloneDeep(a);if((le==null?void 0:le.length)>0&&(be==null?void 0:be.length)>0){Ie[_==null?void 0:_.uuid]=le;for(const ze of be)ze.fieldId===t.field.uuid&&(ze.postData[0]={postValue:le});s(Ie);const Pe=Object.keys(Ie).length;l(Pe)}else{if(delete Ie[_==null?void 0:_.uuid],(be==null?void 0:be.length)>0)for(const ze of be)ze.fieldId===t.field.uuid&&(ze.postData[0]={postValue:[]});s(Ie);const Pe=Object.keys(Ie).length;l(Pe)}},ee=()=>{const le=[];return _==null||_.options.map((be,Ie)=>{var ze,Ze,nt,ht;const Pe=e;le.push(o.jsxs("div",{className:`field ${m&&" py-3 px-4 builder-element-wrapper "}${(_==null?void 0:_.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"flex align-items-center gap-2",children:[o.jsx(Yr,{id:`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`,onFocus:()=>i(1),disabled:w||ce,onChange:Ut=>{ye(Ut)},value:be,checked:Pe==null?void 0:Pe.some(Ut=>Ut.uuid===be.uuid)}),((ze=be==null?void 0:be.hyperlinkText)==null?void 0:ze[S==null?void 0:S.type])===""?o.jsxs("label",{htmlFor:`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`,children:[_!=null&&_.showAlphabetList?o.jsxs("span",{className:"mx-2",children:[" ",_O(Ie)," "]}):o.jsx(o.Fragment,{}),m?o.jsx(o.Fragment,{children:o.jsx(KO,{...t,option:be,optionIndex:Ie})}):o.jsx(o.Fragment,{children:(Ze=be==null?void 0:be.optionText)==null?void 0:Ze[S==null?void 0:S.type]})]}):o.jsx("label",{children:o.jsx("a",{href:(nt=be==null?void 0:be.hyperlinkText)==null?void 0:nt[S==null?void 0:S.type],target:"_blank",rel:"noreferrer",children:(ht=be==null?void 0:be.optionText)==null?void 0:ht[S==null?void 0:S.type]})})]}),m&&o.jsx("div",{className:"builder-radio-option-settings",children:o.jsx(XO,{optionId:be==null?void 0:be.uuid,...t})})]},`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`))}),le};k.useEffect(()=>{ue||ne();const le=Gt.addListener("clearRepeatableFields",Pe=>{Pe===(P==null?void 0:P.uuid)&&(n([]),i(0),_.isValid=0,T(F,O,H,N,M,_))}),be=Gt.addListener("onSubmitUserForm",()=>{var ze;const Pe=e;(ze=_==null?void 0:_.attributes)!=null&&ze.required?(Pe.length>0?_.isValid=1:_.isValid=0,f(F,O,H,N,M,_)):_.isValid=1}),Ie=Gt.addListener("OnInvalidFieldCatch",Pe=>{_.uuid===(Pe==null?void 0:Pe.fieldId)?i(1):i(0)});return()=>{be.remove(),Ie.remove(),le.remove()}});const oe=(le,be,Ie,Pe)=>{var Ut;n(Pe);const ze=[...c],Ze=_t.findIndex(ze,function(fn){return fn.rowId===(P==null?void 0:P.uuid)});let nt=(Ut=c[Ze])==null?void 0:Ut.repeatableFields,ht="<ol class='card '>";Pe==null||Pe.map(fn=>{ht=ht+`<li>${fn.value}</li>`}),ht=ht+"</ol>",nt={...nt,[Ie==null?void 0:Ie.uuid]:ht},ze[Ze]={...ze[Ze],repeatableFields:nt},d(ze),(Pe==null?void 0:Pe.length)>0?Ie.isValid=1:Ie.isValid=0,T(le,be,H,N,Ze,Ie)},he=o.jsxs("div",{onMouseOver:Z,onMouseOut:K,children:[m&&ie&&o.jsx(Wr,{handleFieldSettingsSidebar:W,...t}),o.jsx("div",{className:`field ${m&&" py-3 px-4 builder-element-wrapper "}${(_==null?void 0:_.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-12",children:[(_==null?void 0:_.showHeaderText)&&o.jsx("h6",{children:(Ne=_==null?void 0:_.headerText)==null?void 0:Ne[S==null?void 0:S.type]}),(_==null?void 0:_.showLabel)&&o.jsxs("label",{htmlFor:`${M}`,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((ve=_==null?void 0:_.attributes)==null?void 0:ve.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",m?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(Se=_==null?void 0:_.label)==null?void 0:Se[S==null?void 0:S.type]}),o.jsx("span",{className:"ml-3",children:(_==null?void 0:_.showToolTip)&&o.jsx(zi,{message:(Be=_==null?void 0:_.toolTip)==null?void 0:Be[S==null?void 0:S.type],position:"right"})})]}),ee(),o.jsx("div",{children:((Te=_==null?void 0:_.attributes)==null?void 0:Te.required)&&o.jsx("small",{className:"error",children:r===1&&!(e&&(e==null?void 0:e.length)>0)?($=_==null?void 0:_.validationMesssage)==null?void 0:$.language:""})}),o.jsx("div",{children:(_==null?void 0:_.showHelperText)&&o.jsx("small",{children:(pe=_==null?void 0:_.helperText)==null?void 0:pe[S==null?void 0:S.type]})}),((me=_==null?void 0:_.inlineConditionalRules)==null?void 0:me.rules.length)>0&&m===!0&&o.jsx("p",{children:"Inline conditional rules"}),(ae=_==null?void 0:_.inlineConditionalRules)==null?void 0:ae.rules.map((le,be)=>{if(m===!1){const Ie=e;return o.jsx("div",{children:le==null?void 0:le.conditions.map((Pe,ze)=>o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:Ie==null?void 0:Ie.some(Ze=>Ze.value===Pe.value),inputValue:e,condition:Pe,ruleIndex:be,conditionIndex:ze,field:_,section:z,page:U,row:P,pageIndex:F,sectionIndex:O,rowIndex:H,columnIndex:N,...t})},`select-rule-${be}-`+ze))},`rule-${be}`)}else return o.jsx(ci,{className:"mt-4",header:`Rule ${be+1}`,children:o.jsx("div",{children:le==null?void 0:le.conditions.map((Ie,Pe)=>o.jsx(k.Fragment,{children:o.jsxs("div",{className:"card",children:[o.jsx(fu,{style:{marginTop:-20},className:"mr-2",severity:"success",value:`Condition: ${Ie==null?void 0:Ie.value}`,rounded:!0}),o.jsx(e0,{isConditionTrue:(e==null?void 0:e.some(ze=>ze.value===Ie.value))||m,inputValue:e,condition:Ie,ruleIndex:be,conditionIndex:Pe,field:_,section:z,page:U,row:P,pageIndex:F,sectionIndex:O,rowIndex:H,columnIndex:N,...t})]})},`select-rule-${be}-`+Pe))},`rule-${be}`)},be)})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]}),De=()=>{let le="";return m&&(le=le+" field-form-builder"),u===h&&w===!0&&(le=le+" card"),le};return o.jsxs(o.Fragment,{children:[X===!0&&o.jsx(Qi,{visibilty:X,closeSettingFieldSidebar:ge,...t},_==null?void 0:_.uuid),o.jsx("div",{className:De(),dir:v,children:u===h&&w===!0?o.jsx(ci,{headerTemplate:le=>{var be;return o.jsx(Fde,{options:le,title:(be=_==null?void 0:_.label)==null?void 0:be[S==null?void 0:S.type]})},toggleable:!0,children:he}):he})]})},Pde=6,Mde=t=>{var ne,q,ee,oe,he,De,Ne,ve,Se,Be,Te;const{task_status:e,taskRegisterData:n,updateTaskRegisterData:r,updateTaskProgressValue:i,userTaskSubmitFormData:a,updateUserFormDataSubmit:s,updateProgressDataValuesHook:l,TASK_PUBLISHED:c}=Ar(),{field:u,row:d,pageIndex:f,sectionIndex:h,section:g,page:v,rowIndex:m,columnIndex:A,isDisabled:w=!1}=t,{isAdmin:C,isBuilderMode:S}=Ht(),{pageSettingUpdate:T,formBuilderFormLayout:x,sectionSettingUpdate:E,userSelectedLanguage:_}=sn(),[M,O]=k.useState(!1),[F,P]=k.useState(null),[H,N]=k.useState(0),[z,U]=k.useState(!1),[ce,X]=k.useState(!1),R=()=>{X(!0)},ue=()=>{X(!1)},Y=$=>{O($)},ie=()=>{O(!1)},re=()=>{var $,pe,me,ae;if((a==null?void 0:a.length)>0)if(d!=null&&d.rowIsRepeatable){if(d!=null&&d.repeatableFields){const le=[...d.repeatableFields],be=_t.findIndex(le,function(Ie){return Ie.uuid===(u==null?void 0:u.uuid)});be>=0&&le[be].fieldData?P(le[be].fieldData):(u.isValid=0,P(null))}}else{const le=a,be=_t.cloneDeep(n);let Ie=null;if(le!=null&&le.length){for(const Pe of le)if(Pe.fieldId===t.field.uuid&&(($=Pe==null?void 0:Pe.postData)!=null&&$.length)){Ie=(pe=Pe==null?void 0:Pe.postData[0])==null?void 0:pe.postValue,P((me=Pe==null?void 0:Pe.postData[0])==null?void 0:me.postValue),be[u==null?void 0:u.uuid]=(ae=Pe==null?void 0:Pe.postData[0])==null?void 0:ae.postValue;const ze=Object.keys(be).length;i(ze);break}}Z({value:Ie}),W({value:Ie})}setTimeout(()=>{U(!0)},2e3)},Z=$=>{const pe=$.value;u==null||u.conditionalTabRules.rules.map(me=>{var ae;(ae=me==null?void 0:me.conditions)==null||ae.map(le=>{const be=_t.findIndex(x,Ie=>{var Pe;return Ie.uuid===((Pe=le==null?void 0:le.tab)==null?void 0:Pe.uuid)});if(pe===(le==null?void 0:le.option)){const Ie=x[be];Ie.isHidden=!1,T(be,Ie)}else{let Ie=x[be];Ie={...Ie,isHidden:!0},T(be,Ie)}})})},K=k.useCallback(($,pe)=>{var me;if((a==null?void 0:a.length)>0){const ae=a;if(ae!=null&&ae.length){const le=n;for(const[Ie,Pe]of pe.children.entries())for(const[,ze]of Pe.children.entries())for(const[Ze,nt]of ze.children.entries())if(Pe!=null&&Pe.rowIsRepeatable){if((Pe==null?void 0:Pe.rowIsRepeatable)===!0){const ht=_t.findIndex(ae,function(Ut){return Ut.rowId===Pe.uuid});$===!0?ht===-1&&(ae.push({postData:[],tabId:v.uuid,rowId:Pe==null?void 0:Pe.uuid,tabIndex:f,sectionId:g.uuid,minimumEntries:g==null?void 0:g.minimumEntries,sectionIndex:h,sectionHeading:g.heading,subHeadingText:g.subHeadingText,repeatableFields:{},repeatableFieldsData:[],language:"english",isHiddenSection:!!(g.isHidden&&g.isHidden===!0),reviewerChecklist:Pe==null?void 0:Pe.reviewerChecklist}),le[Pe==null?void 0:Pe.uuid]&&delete le[Pe==null?void 0:Pe.uuid]):(le[Pe==null?void 0:Pe.uuid]&&delete le[Pe==null?void 0:Pe.uuid],ht>=0&&ae.splice(ht,1))}}else{const ht=_t.findIndex(ae,function(Ut){return Ut.fieldId===nt.uuid});$?ht===-1&&(ae.push({postData:[],tabId:v.uuid,tabIndex:f,...nt.inlineConditionalRules?{inlineConditionalRules:nt.inlineConditionalRules}:{},...nt.conditionalTabRules?{conditionalTabRules:nt.conditionalTabRules}:{},...nt.conditionalSectionRules?{conditionalSectionRules:nt.conditionalSectionRules}:{},sectionId:g.uuid,sectionIndex:h,sectionHeading:g.heading,subHeadingText:g.subHeadingText,reviewerChecklist:nt==null?void 0:nt.reviewerChecklist,rowId:Pe.uuid,rowIndex:Ie,columnId:g.uuid,columnIndex:A,inlineConditionalField:!0,fieldIndex:Ze,fieldId:nt.uuid,fieldInputType:nt.componentType,fieldTitle:(me=nt.label)==null?void 0:me.english,fieldDescription:nt.description||null,fieldHelperText:nt.helperText||null,fieldHeaderText:nt.headerText||null,fieldFooterText:nt.footerText||null,fieldTitleAbb:nt.abbreviationLabel||nt.label,question_abb_table:nt.textForTable||null,language:"english",isHiddenfield:nt.isHidden&&nt.isHidden===1?1:0,isHiddenSection:!!(g.isHidden&&g.isHidden===!0)}),le[nt==null?void 0:nt.uuid]&&delete le[nt==null?void 0:nt.uuid]):(le[nt==null?void 0:nt.uuid]&&delete le[nt==null?void 0:nt.uuid],ht>=0&&ae.splice(ht,1))}const be=Object.keys(le).length;l({progressMaxValue:ae==null?void 0:ae.length,progressValue:be}),s([...ae])}}},[A,u==null?void 0:u.abbreviationLabel,u==null?void 0:u.componentType,u==null?void 0:u.conditionalSectionRules,u==null?void 0:u.conditionalTabRules,u==null?void 0:u.description,u==null?void 0:u.footerText,u==null?void 0:u.headerText,u==null?void 0:u.helperText,u==null?void 0:u.inlineConditionalRules,u==null?void 0:u.isHidden,u==null?void 0:u.label,u==null?void 0:u.reviewerChecklist,u==null?void 0:u.textForTable,v==null?void 0:v.uuid,f,d==null?void 0:d.uuid,m,g==null?void 0:g.heading,g==null?void 0:g.isHidden,g==null?void 0:g.subHeadingText,g==null?void 0:g.uuid,h,n,l,s,a]),W=$=>{const pe=$.value;u==null||u.conditionalSectionRules.rules.map(me=>{var ae;(ae=me==null?void 0:me.conditions)==null||ae.map(le=>{if((pe==null?void 0:pe.value)===(le==null?void 0:le.option)){const be=_t.findIndex(x,ze=>{var Ze;return ze.uuid===((Ze=le==null?void 0:le.tab)==null?void 0:Ze.uuid)}),Ie=_t.findIndex(x[be].children,ze=>{var Ze;return ze.uuid===((Ze=le==null?void 0:le.section)==null?void 0:Ze.uuid)}),Pe=x[be].children[Ie];Pe.isHidden=!1,K(!0,x[be].children[Ie]),E(be,Ie,Pe)}else{const be=_t.findIndex(x,ze=>{var Ze;return(ze==null?void 0:ze.uuid)===((Ze=le==null?void 0:le.tab)==null?void 0:Ze.uuid)}),Ie=_t.findIndex(x[be].children,ze=>{var Ze;return(ze==null?void 0:ze.uuid)===((Ze=le==null?void 0:le.section)==null?void 0:Ze.uuid)}),Pe=x[be].children[Ie];Pe.isHidden=!0,K(!1,x[be].children[Ie]),E(be,Ie,Pe)}})})};k.useEffect(()=>{z||re();const $=Gt.addListener("clearRepeatableFields",ae=>{ae===(d==null?void 0:d.uuid)&&(P(""),N(0),u.isValid=1)}),pe=Gt.addListener("onSubmitUserForm",()=>{var ae;if((ae=u==null?void 0:u.attributes)!=null&&ae.required){const le=F;le!=null&&le.uuid&&(le!=null&&le.value)?u.isValid=1:u.isValid=0}else u.isValid=1}),me=Gt.addListener("OnInvalidFieldCatch",ae=>{(u==null?void 0:u.uuid)===(ae==null?void 0:ae.fieldId)?N(1):N(0)});return()=>{pe.remove(),me.remove(),$.remove()}});const ge=($,pe)=>{var me;if(a){const ae=[...a],le=_t.findIndex(ae,function(Ie){return Ie.rowId===(d==null?void 0:d.uuid)});let be=(me=a[le])==null?void 0:me.repeatableFields;be={...be,[$==null?void 0:$.uuid]:pe},ae[le]={...ae[le],repeatableFields:be},s(ae)}P(pe),pe!==null?$.isValid=1:$.isValid=0},ye=$=>{var pe;P($.target.value),Z($),W($),d!=null&&d.rowIsRepeatable?ge(u,(pe=$==null?void 0:$.target)==null?void 0:pe.value):Ae($),setTimeout(()=>{Gt.emit("updatePageRender","complete")},1e3)},Ee=()=>{var $;if((($=u==null?void 0:u.fieldType)==null?void 0:$.type)==="radio"){const pe=[];return u==null||u.options.map((me,ae)=>{var be,Ie,Pe,ze;const le=F;pe.push(o.jsxs("div",{className:`field-radiobutton ${u!=null&&u.showButtonLayout?"col-6 field-radiobutton-builder":""}`,onClick:()=>{(!C||!w)&&e!==Pde&&ye({value:me,target:{value:me}})},style:(le==null?void 0:le.uuid)===(me==null?void 0:me.uuid)&&(u!=null&&u.showButtonLayout)?{backgroundColor:"#0F8BFD",padding:5,borderRadius:8}:{padding:5},children:[o.jsx(ia,{onFocus:()=>{(!C||!w)&&N(1)},inputId:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder-radio":"preview"}`,onChange:Ze=>{(!C||!w)&&ye(Ze)},value:me,name:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder":"preview"}`,checked:(le==null?void 0:le.uuid)===(me==null?void 0:me.uuid),disabled:C||w,readOnly:C||w}),((be=me==null?void 0:me.hyperlinkText)==null?void 0:be[_==null?void 0:_.type])===""?o.jsxs("label",{htmlFor:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder-label":"preview"}`,children:[u!=null&&u.showAlphabetList?o.jsxs("span",{className:"mx-2",children:[" ",_O(ae)," "]}):"",S?o.jsx(o.Fragment,{children:o.jsx(KO,{...t,option:me,optionIndex:ae})}):o.jsxs(o.Fragment,{children:[" ",(Ie=me==null?void 0:me.optionText)==null?void 0:Ie[_==null?void 0:_.type]]})]}):o.jsx("label",{children:o.jsx("a",{href:(Pe=me==null?void 0:me.hyperlinkText)==null?void 0:Pe[_==null?void 0:_.type],target:"_blank",rel:"noreferrer",children:(ze=me==null?void 0:me.optionText)==null?void 0:ze[_==null?void 0:_.type]})}),S&&o.jsx("div",{className:"builder-radio-option-settings",children:o.jsx(XO,{optionId:me==null?void 0:me.uuid,...t})})]},"li-item-"+ae))}),pe}},Ae=$=>{var be,Ie;P($.target.value);const pe={value:$.target.value};Z(pe),W(pe);const me=a,ae=_t.cloneDeep(n);if((be=$==null?void 0:$.target)!=null&&be.value&&(me==null?void 0:me.length)>0)for(const Pe of me)Pe.fieldId===t.field.uuid&&(ae[u==null?void 0:u.uuid]=(Ie=$==null?void 0:$.target)==null?void 0:Ie.value,Pe.postData[0]={postValue:$.target.value});else delete ae[u==null?void 0:u.uuid];r(ae);const le=Object.keys(ae).length;i(le)},fe=o.jsxs("div",{onMouseOver:R,onMouseOut:ue,children:[S&&ce&&o.jsx(Wr,{handleFieldSettingsSidebar:Y,...t}),o.jsx("div",{className:`field ${S&&" py-3 px-4 builder-element-wrapper "}${(u==null?void 0:u.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-12",children:[(u==null?void 0:u.showHeaderText)&&o.jsx("h6",{children:(ne=u==null?void 0:u.headerText)==null?void 0:ne[_==null?void 0:_.type]}),(u==null?void 0:u.showLabel)&&o.jsxs("label",{htmlFor:u.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((q=u==null?void 0:u.attributes)==null?void 0:q.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",S?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(ee=u==null?void 0:u.label)==null?void 0:ee[_==null?void 0:_.type]}),o.jsx("span",{className:"ml-3",children:u!=null&&u.showToolTip?o.jsx(o.Fragment,{children:o.jsx(zi,{message:(oe=u==null?void 0:u.toolTip)==null?void 0:oe[_==null?void 0:_.type],position:"right"})}):""})]}),(u==null?void 0:u.showButtonLayout)===!0?o.jsxs("div",{className:"grid",children:[Ee()," "]}):Ee(),o.jsx("div",{children:((he=u==null?void 0:u.attributes)==null?void 0:he.required)&&o.jsx("small",{className:"error",children:H===1&&F!==null?(De=u==null?void 0:u.validationMesssage)==null?void 0:De.language:""})}),o.jsx("div",{children:(u==null?void 0:u.showHelperText)&&o.jsx("small",{children:(Ne=u==null?void 0:u.helperText)==null?void 0:Ne[_==null?void 0:_.type]})}),((ve=u==null?void 0:u.inlineConditionalRules)==null?void 0:ve.rules.length)>0&&S===!0&&o.jsx("p",{children:"Inline conditional rules"}),z===!0&&((Be=(Se=u==null?void 0:u.inlineConditionalRules)==null?void 0:Se.rules)==null?void 0:Be.length)>0&&((Te=u==null?void 0:u.inlineConditionalRules)==null?void 0:Te.rules.map(($,pe)=>{const me=F;return S===!1?o.jsx("div",{children:$==null?void 0:$.conditions.map((ae,le)=>o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:!!((me==null?void 0:me.value)===ae.value||S),inputValue:F,condition:ae,ruleIndex:pe,conditionIndex:le,field:u,section:g,page:v,row:d,pageIndex:f,sectionIndex:h,rowIndex:m,columnIndex:A,isAdmin:C,...t})},`select-rule-${pe}-`+le))},`rule-${pe}`):o.jsx(ci,{className:"mt-4",header:`Rule ${pe+1}`,children:o.jsx("div",{children:$==null?void 0:$.conditions.map((ae,le)=>{const be=F;return o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:!!((be==null?void 0:be.value)===ae.value||S),inputValue:F,condition:ae,ruleIndex:pe,conditionIndex:le,field:u,section:g,page:v,row:d,pageIndex:f,sectionIndex:h,rowIndex:m,columnIndex:A,...t})},`select-rule-${pe}-`+le)})},`rule-${pe}`)},pe)}))]}),C&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]});return o.jsxs(o.Fragment,{children:[M===!0&&o.jsx(Qi,{visibilty:M,closeSettingFieldSidebar:ie,...t},u==null?void 0:u.uuid),o.jsx(xi,{...t,fieldWrap:fe})]})},Lde=k.memo(Mde),Bde=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("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Text"}),o.jsx(wn,{value:(i=r.text)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("text",e,s.target.value),placeholder:"Heading text",id:r==null?void 0:r.uuid})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(wn,{value:(a=r.hrefLink)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("hrefLink",e,s.target.value),placeholder:"Link"})]})]})},Vde=t=>{const{onHandleChangeHeadingTypeSetttings:e,fieldState:n}=t,r=[{name:"H1",type:"h1"},{name:"H2",type:"h2"},{name:"H3",type:"h3"},{name:"H4",type:"h4"},{name:"H5",type:"h5"}];return o.jsxs("form",{className:"p-fluid",children:[o.jsx("h3",{children:"Select heading type"}),r.map((i,a)=>o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:i==null?void 0:i.type,name:"heading",value:i==null?void 0:i.type,onChange:s=>e(s),checked:n.headingType===i.type}),o.jsx("label",{htmlFor:i.type,children:i.name})]},a))]})},qde=t=>{const{fieldSettingUpdate:e,formBuilderSchemaLanguages:n,formBuilderPublishedStatus:r,fieldSettingUpdateInlineConditional:i,gridComponentFieldSettingUpdate:a}=sn(),{path:s,visibilty:l,field:c,closeSettingFieldSidebar:u,pageIndex:d,sectionIndex:f,rowIndex:h,columnIndex:g,fieldIndex:v,typeName:m}=t,[A,w]=k.useState(c),{updateGlobalToast:C}=Ht(),S=(E,_,M)=>{w(O=>({...O,[E]:{...O[E],[_==null?void 0:_.type]:M}}))},T=E=>{w(_=>({..._,headingType:E==null?void 0:E.value}))},x=()=>{const E=s.split("-").map(Number);(E==null?void 0:E.length)>5&&(E==null?void 0:E.length)===8&&(A!=null&&A.inlineConditionalRules)?i(E[fa],E[ha],E[Ca],E[xa],E[Ta],E[Fa],E[Xo],E[wo],A):(E==null?void 0:E.length)>Fa&&(E==null?void 0:E.length)===Bl+1&&(A!=null&&A.componentType)?a(E[fa],E[ha],E[Ca],E[xa],E[Ta],E[lx],E[cx],E[ux],A):e(d,f,h,g,v,A),C({showToast:!0,toastMessage:"Updated",toastDetail:`${m} updated`,toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"750px"},visible:l,position:"left",className:"p-sidebar-lg",onHide:()=>u(),header:()=>o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[t==null?void 0:t.typeName," settings"]})}),children:[o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:n!=null&&n.length?n.map((E,_)=>o.jsx(io,{tabIndex:_,header:E==null?void 0:E.language,children:o.jsx(Bde,{language:E,fieldState:A,onHandleChange:S,...t})},_)):""})}),o.jsx(wr,{header:"Setting",children:o.jsx(Vde,{onHandleChangeHeadingTypeSetttings:T,fieldState:A})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[!r&&o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>x(),"aria-label":"Update"}),o.jsx(Ft,{label:"Close",type:"button",onClick:()=>u(),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Ude=t=>{var v,m;const{field:e}=t,{isBuilderMode:n}=Ht(),{userSelectedLanguage:r}=sn(),[i,a]=k.useState(!1),[s,l]=k.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=A=>{a(A)},f=()=>{a(!1)},h=()=>{var A,w,C,S,T,x;return(e==null?void 0:e.headingType)==="h1"?o.jsx("h1",{children:(A=e==null?void 0:e.text)==null?void 0:A[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h2"?o.jsx("h2",{children:(w=e==null?void 0:e.text)==null?void 0:w[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h3"?o.jsx("h3",{children:(C=e==null?void 0:e.text)==null?void 0:C[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h4"?o.jsx("h4",{children:(S=e==null?void 0:e.text)==null?void 0:S[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h5"?o.jsx("h5",{children:(T=e==null?void 0:e.text)==null?void 0:T[r==null?void 0:r.type]}):o.jsx("h1",{children:(x=e==null?void 0:e.text)==null?void 0:x[r==null?void 0:r.type]})},g=o.jsxs("div",{className:n?"builder-element-wrapper":"",onMouseOver:c,onMouseOut:u,children:[n&&s&&o.jsx(Wr,{handleFieldSettingsSidebar:d,...t}),o.jsx("div",{className:n?"field-form-builder px-2":" px-2",children:o.jsx("div",{className:"col-12",children:((v=e==null?void 0:e.hrefLink)==null?void 0:v[r==null?void 0:r.type])!==""?o.jsx("a",{href:(m=e==null?void 0:e.hrefLink)==null?void 0:m[r==null?void 0:r.type],target:"_blank",rel:"noreferrer",children:h()}):h()})})]});return o.jsxs(o.Fragment,{children:[i&&o.jsx(qde,{visibilty:i,closeSettingFieldSidebar:f,...t},e==null?void 0:e.uuid),o.jsx(xi,{...t,fieldWrap:g})]})},$de=t=>{var i,a;const{language:e,onHandleQuestionTextChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Question text"}),o.jsx(wn,{placeholder:"Enter question",value:(i=r.questionText)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("questionText",e.type,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Correct answer"}),o.jsx(wn,{placeholder:"Enter correct answer",value:(a=r.correctAnswerComment)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("correctAnswerComment",e.type,s.target.value)})]})]})},jde=t=>{var i;const{onHandleChange:e,fieldState:n,onHandleChangeAttributesSetttings:r}=t;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field",style:{display:"inline-block",width:"150px"},children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Time limit"}),o.jsxs("div",{className:"p-inputgroup",children:[o.jsx(eo,{inputId:"horizontal",showButtons:!0,buttonLayout:"horizontal",step:1,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},value:n==null?void 0:n.timeLimit,onChange:a=>e("timeLimit",a.value)}),o.jsx("span",{className:"p-inputgroup-addon",children:"mins"})]})]})}),o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field",style:{display:"inline-block",width:"100px"},children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Score"}),o.jsx("div",{className:"p-inputgroup",children:o.jsx(eo,{inputId:"horizontal",showButtons:!0,buttonLayout:"horizontal",step:1,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},value:n==null?void 0:n.score,onChange:a=>e("score",a.value)})})]})}),o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"required",checked:(i=n==null?void 0:n.attributes)==null?void 0:i.required,onChange:a=>r("required",a.checked)}),o.jsx("label",{htmlFor:"required",children:"Is complusory?"})]})})]})},zde=t=>{const{onHandleChange:e,fieldState:n}=t,[r,i]=k.useState([{type:"radio"},{type:"checkbox"}]);return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field field-checkbox",children:[o.jsx(Yr,{inputId:"isAllowMultipleAnswer",value:"isAllowMultipleAnswer",onChange:a=>{e("isAllowMultipleAnswer",a==null?void 0:a.checked),a!=null&&a.checked?(i([{type:"checkbox"}]),e("answerInputType","checkbox")):(i([{type:"radio"}]),e("answerInputType","radio"))},checked:n==null?void 0:n.isAllowMultipleAnswer}),o.jsx("label",{htmlFor:"isAllowMultipleAnswer",className:"p-checkbox-label ",children:"Allow multiple answer"})]}),(n==null?void 0:n.isAllowMultipleAnswer)&&o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Number of options"}),o.jsx(wn,{type:"number",value:(n==null?void 0:n.noOfMultpleAnswer)||0,onChange:a=>{var s;e("noOfMultpleAnswer",(s=a==null?void 0:a.target)==null?void 0:s.value)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Answer input type"}),r.map((a,s)=>o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:a.type,name:"answerInputType",value:a.type,onChange:()=>{if(e("answerInputType",a.type),a.type==="checkbox"&&e("isAllowMultipleAnswer",!0),a.type==="radio"){let l=[...(n==null?void 0:n.answerOptions)||[]];l=l.map(c=>({...c,isCorrect:!1})),e("answerOptions",l),e("isAllowMultipleAnswer",!1)}},checked:(n==null?void 0:n.answerInputType)===a.type}),o.jsx("label",{htmlFor:a.type,children:a.type})]},s))]})]})},Hde=t=>{const{fieldState:e,setFieldState:n,language:r}=t,i=()=>{var g;let f=!1;const h=(g=e==null?void 0:e.answerOptions)==null?void 0:g.filter(v=>(v==null?void 0:v.isCorrect)===!0);return(h==null?void 0:h.length)===parseInt(e==null?void 0:e.noOfMultpleAnswer)&&(f=!0),f},a=f=>o.jsx(o.Fragment,{children:o.jsx(Ft,{text:!0,type:"button",className:"p-button-danger left-space",onClick:()=>d((f==null?void 0:f.uuid)||""),icon:"pi pi-trash"})}),s=f=>o.jsx(o.Fragment,{children:o.jsx(wn,{value:f==null?void 0:f.answersText[r],onChange:h=>c("answersText",(f==null?void 0:f.uuid)||"",h.target.value)})}),l=(f,h)=>o.jsx(o.Fragment,{children:o.jsx(Yr,{inputId:"binary",checked:(f==null?void 0:f.isCorrect)||!1,onChange:g=>{g.checked&&i()||u("isCorrect",(f==null?void 0:f.uuid)||"",g.checked,h)}})}),c=(f,h,g)=>{n(v=>({...v,answerOptions:v!=null&&v.answerOptions?v==null?void 0:v.answerOptions.map(m=>m.uuid!==h?m:{...m,[f]:{...m[f],[r]:g}}):[]}))},u=(f,h,g,v)=>{n(m=>{const{answerOptions:A,isAllowMultipleAnswer:w,answerInputType:C}=m,S=v.rowIndex,T=A.map((x,E)=>{const _=E===S;return w||C==="checkbox"?_?{...x,[f]:g}:x:{...x,[f]:_?g:!1}});return{...m,answerOptions:T}})},d=f=>{const h=_t.findIndex(e==null?void 0:e.answerOptions,v=>v.uuid===f),g=(e==null?void 0:e.answerOptions)&&(e==null?void 0:e.answerOptions.filter(function(v,m){return m!==h}));g!=null&&g.length&&(g==null?void 0:g.length)>0&&n(v=>({...v,answerOptions:g}))};return o.jsx("div",{children:o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.answerOptions,scrollable:!0,children:[o.jsx(xr,{header:"Answer text",body:f=>s(f),headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}}),o.jsx(xr,{body:(f,h)=>l(f,h),header:"Is answer ?",headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}}),o.jsx(xr,{header:"Action",body:f=>a(f),headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}})]})})})},Yde=t=>{const e=[],[n]=k.useState([]),{onHandleChange:r,fieldState:i}=t;return k.useEffect(()=>{},[]),o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field mt-3 w-full",children:[o.jsx("label",{children:"Subject"}),o.jsx(Pa,{id:"subject",name:"subject",optionLabel:"subject_title",value:(n==null?void 0:n.length)>0&&(i==null?void 0:i.subject_id)!==null?n.filter(a=>(i==null?void 0:i.subject_id)===(a==null?void 0:a.subject_id))[0]:null,placeholder:"Select a Subject",options:n,className:"w-full",onChange:a=>{var s;r("subject_id",(s=a==null?void 0:a.value)==null?void 0:s.subject_id)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Course category"}),o.jsx(Pa,{id:"course_category",name:"course_category",optionLabel:"course_category_title",value:(e==null?void 0:e.length)>0&&(i==null?void 0:i.course_category_id)!==null?e.filter(a=>(i==null?void 0:i.course_category_id)===(a==null?void 0:a.course_category_id))[0]:null,placeholder:"Select a category",options:e,className:"w-full",onChange:a=>{var s;r("course_category_id",(s=a==null?void 0:a.value)==null?void 0:s.course_category_id)}})]})]})},Kde=t=>{const{formBuilderSchemaLanguages:e,fieldSettingUpdate:n}=sn(),{visibilty:r,setVisibility:i,rowIndex:a,columnIndex:s,fieldIndex:l,pageIndex:c,sectionIndex:u,field:d,typeName:f}=t,[h,g]=k.useState(d),{updateGlobalToast:v}=Ht(),m=(x,E)=>{g(_=>({..._,attributes:{..._.attributes,[x]:E}}))},A=(x,E,_)=>{g(M=>({...M,[x]:{[E]:_}}))},w=(x,E)=>{g(_=>({..._,[x]:E}))},C=()=>{const x=[],_=((h==null?void 0:h.answerOptions)||[]).filter(P=>P.isCorrect===!0),{answerInputType:M,isAllowMultipleAnswer:O,noOfMultpleAnswer:F}=h||{};if(M==="radio")_.length!==1&&x.push("Please select one answer");else if(M==="checkbox"){const P=O?parseInt(F,10)||0:1;_.length!==P&&x.push(P>1?`Select ${P} answers`:"Please select one answer")}return x.length?(v({showToast:!0,toastMessage:"Validation error",toastDetail:x.join(", "),toastType:"error"}),!1):!0},S=()=>{C()&&(n(c,u,a,s,l,h),v({showToast:!0,toastMessage:"Updated",toastDetail:`${f} updated`,toastType:"success"}))},T=()=>{g(x=>Object.assign({},x,{answerOptions:[...x.answerOptions||[],{uuid:rt(),answersText:{english:""},isCorrect:!1}]}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{visible:r,position:"left",className:"p-sidebar-lg",onHide:()=>i(!1),children:[o.jsx("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",{children:[t==null?void 0:t.typeName," settings"," "]})," "]})}),o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:e!=null&&e.length?e.map((x,E)=>o.jsx(io,{tabIndex:E,header:x==null?void 0:x.language,children:o.jsx($de,{language:x,fieldState:h,onHandleQuestionTextChange:A,...t})},E)):""})}),o.jsx(wr,{header:"Advance",children:o.jsx(jde,{fieldState:h,onHandleChangeAttributesSetttings:m,onHandleChange:w,...t})}),o.jsx(wr,{header:"Answers",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(zde,{fieldState:h,onHandleChange:w,...t}),o.jsxs("div",{className:"flex justify-content-between mb-2",children:[o.jsx("h4",{children:"Answers options"}),o.jsx(Ft,{className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>T(),"aria-label":"Add"})]}),(h==null?void 0:h.answerOptions)!==void 0&&o.jsx(o.Fragment,{children:o.jsx(ao,{activeIndex:0,children:e!=null&&e.length?e.map((x,E)=>o.jsx(io,{tabIndex:E,header:x==null?void 0:x.language,children:o.jsx(Hde,{language:x==null?void 0:x.type,fieldState:h,setFieldState:g})},E)):""})})]})}),o.jsx(wr,{header:"Information",children:o.jsx(Yde,{fieldState:h,onHandleChange:w})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>S(),"aria-label":"Update"}),o.jsx(Ft,{label:"Close",type:"button",onClick:()=>i(!1),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Xde=t=>{var O,F,P,H,N,z;const{isBuilderMode:e}=Ht(),{field:n}=t,{taskRegisterData:r,updateTaskRegisterData:i,updateTaskProgressValue:a,userTaskSubmitFormData:s}=Ar(),{userSelectedLanguage:l}=sn(),{media:c}=Ht(),u=(O=c==null?void 0:c.image)!=null&&O.MediaImage?(F=c==null?void 0:c.image)==null?void 0:F.MediaImage:o.jsx(o.Fragment,{}),[d,f]=k.useState(!1),[h,g]=k.useState([]),[v,m]=k.useState(!1),A=U=>{m(U)},w=()=>{m(!1)},C=()=>{f(!0)},S=()=>{f(!1)},T=U=>{var ue;const ce=_t.cloneDeep(r),X=[...h];U.checked?(ce[n==null?void 0:n.uuid]=(ue=U==null?void 0:U.target)==null?void 0:ue.value,X.push(U.value)):(delete ce[n==null?void 0:n.uuid],X.splice(X.indexOf(U.value),1)),g(X),x(U,X),i(ce);const R=Object.keys(ce).length;a(R)},x=(U,ce)=>{const X=s;if((X==null?void 0:X.length)>0&&U!=null&&U.value)for(const R of X)R.fieldId===t.field.uuid&&(R.postData[0]={postValue:ce})},E=U=>{var ue;const ce=s,X=_t.cloneDeep(r);if((ce==null?void 0:ce.length)>0)if((ue=U==null?void 0:U.target)!=null&&ue.value)for(const Y of ce)Y.fieldId===t.field.uuid&&(X[n==null?void 0:n.uuid]=U==null?void 0:U.value,Y.postData[0]={postValue:U.value});else delete X[n==null?void 0:n.uuid];i(X);const R=Object.keys(X).length;a(R)};k.useEffect(()=>{g([])},[n==null?void 0:n.answerInputType]);const _=()=>{const U=[];return(n==null?void 0:n.answerInputType)==="radio"?n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var ue,Y,ie,re;const R=h;U.push(o.jsxs("div",{className:"flex align-items-center p-field-radiobutton mb-3",children:[o.jsx(ia,{inputId:`${X}`,onChange:Z=>{g(Z.target.value),E(Z)},checked:(R==null?void 0:R.uuid)===(ce==null?void 0:ce.uuid),name:"category",value:ce})," ",((ue=ce.answersTextImage)==null?void 0:ue[l==null?void 0:l.type])&&((Y=ce.answersTextImage)==null?void 0:Y[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(ie=ce.answersTextImage)==null?void 0:ie[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),o.jsx("label",{htmlFor:`${X}`,children:(re=ce==null?void 0:ce.answersText)==null?void 0:re[l==null?void 0:l.type]})]},X))})):(n==null?void 0:n.answerInputType)==="checkbox"?n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var R;U.push(o.jsxs("div",{className:"p-field-radiobutton mb-3",children:[o.jsx(Yr,{inputId:`${X}`,name:"category",onChange:ue=>{T(ue)},value:ce,checked:h!=null&&h.length?h==null?void 0:h.some(ue=>ue.uuid===ce.uuid):!1})," ",o.jsx("label",{htmlFor:`${X}`,children:(R=ce==null?void 0:ce.answersText)==null?void 0:R[l==null?void 0:l.type]})]},X))})):n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var ue,Y,ie,re,Z,K,W;const R=h;U.push(o.jsxs("div",{className:"p-field-radiobutton mb-3",children:[o.jsx(ia,{inputId:`${X}`,onChange:ge=>{g(ge.target.value),E(ge)},checked:(R==null?void 0:R.uuid)===(ce==null?void 0:ce.uuid),name:"category",value:ce})," ",((ue=ce.answersTextImage)==null?void 0:ue[l==null?void 0:l.type])&&((Y=ce.answersTextImage)==null?void 0:Y[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(ie=ce.answersTextImage)==null?void 0:ie[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),o.jsxs("label",{htmlFor:`${X}`,children:[((re=ce.answersTextImage)==null?void 0:re[l==null?void 0:l.type])&&((Z=ce.answersTextImage)==null?void 0:Z[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(K=ce.answersTextImage)==null?void 0:K[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),(W=ce==null?void 0:ce.answersText)==null?void 0:W[l==null?void 0:l.type]]})]},X))})),U},M=o.jsxs("div",{onMouseOver:C,onMouseOut:S,children:[e&&d&&o.jsx(Wr,{handleFieldSettingsSidebar:A,...t}),o.jsx("div",{className:`field ${e&&" py-3 px-4 builder-element-wrapper "}${(n==null?void 0:n.isFluid)===!0&&" p-fluid"}`,children:o.jsx("div",{className:"grid",children:o.jsxs("div",{className:"col-12 p-fluid",children:[((P=n==null?void 0:n.questionTextImage)==null?void 0:P[l==null?void 0:l.type])&&((H=n==null?void 0:n.questionTextImage)==null?void 0:H[l==null?void 0:l.type])!==""&&o.jsx("div",{className:"text-center assessment_image_container",children:o.jsx(u,{mediaId:(N=n==null?void 0:n.questionTextImage)==null?void 0:N[l==null?void 0:l.type],style:{height:"100px",width:"100px",objectFit:"cover",borderRadius:100},className:"text-center",alt:"questionImage"})}),o.jsx("h5",{children:(z=n==null?void 0:n.questionText)==null?void 0:z[l==null?void 0:l.type]}),_()]})})})]});return o.jsxs(o.Fragment,{children:[v===!0&&o.jsx(Kde,{visibilty:v,setVisibility:w,...t},n==null?void 0:n.uuid),o.jsx(xi,{...t,fieldWrap:M})]})},Rde=t=>{var i,a;const{onHandleChange:e,fieldState:n,language:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Title"}),o.jsx(wn,{value:(i=n.title)==null?void 0:i[r==null?void 0:r.type],onChange:s=>e("title",r,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Image Url"}),o.jsx(wn,{value:(a=n.media_url)==null?void 0:a[r==null?void 0:r.type],onChange:s=>e("media_url",r,s.target.value)})]})]})};class RO{constructor(){Rn(this,"formatBytes",(e,n=2)=>{if(e===0||e===void 0||e===null)return"0 Bytes";const r=1024,i=n<0?0:n,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,s)).toFixed(i))+" "+a[s]})}}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 Gde(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 Wde(t){var e=Gde(t,"string");return b2(e)=="symbol"?e:e+""}function GO(t,e,n){return(e=Wde(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qde={root:function(e){var n=e.props;return ft("p-badge p-component",GO({"p-badge-no-gutter":ke.isNotEmpty(n.value)&&String(n.value).length===1,"p-badge-dot":ke.isEmpty(n.value),"p-badge-lg":n.size==="large","p-badge-xl":n.size==="xlarge"},"p-badge-".concat(n.severity),n.severity!==null))}},Jde=`
|
|
3514
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,a=u},f:function(){try{s||n.return==null||n.return()}finally{if(l)throw a}}}}function Nde(t,e){if(t){if(typeof t=="string")return HO(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HO(t,e):void 0}}function HO(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var YO=b.memo(b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=v2.getProps(t,r),a=b.useState(null),s=cd(a,2),l=s[0],c=s[1],u=b.useState(!1),d=cd(u,2),f=d[0],h=d[1],g=jx("",i.filterDelay||0),v=cd(g,3),m=v[0],A=v[1],w=v[2],C=b.useState(-1),S=cd(C,2),T=S[0],x=S[1],E=b.useState(!1),_=cd(E,2),M=_[0],O=_[1],F=b.useState(i.inline),P=cd(F,2),H=P[0],N=P[1],z=b.useRef(null),U=b.useRef(null),ce=b.useRef(null),X=b.useRef(null),R=b.useRef(null),ue=b.useRef(i.inputRef),Y=b.useRef(null),ie=b.useRef(null),re=b.useRef(null),Z=A&&A.trim().length>0,K=ke.isEmpty(i.value),W=i.optionValue?null:i.dataKey,ge={props:i,state:{filterState:A,focused:M,overlayVisible:H}},ye=v2.setMetaData(ge),Ee=ye.ptm,Ae=ye.cx,fe=ye.sx,ne=ye.isUnstyled;li(v2.css.styles,ne,{name:"multiselect"});var q=ep({target:z,overlay:ie,listener:function(Ye,Et){var Wt=Et.type,Jn=Et.valid;Jn&&(Wt==="outside"?!Ke(Ye)&&!st(Ye)&&ot():r.hideOverlaysOnDocumentScrolling?ot():xe.isDocument(Ye.target)||wt())},when:H}),ee=cd(q,2),oe=ee[0],he=ee[1],De=function(Ye){var Et=Ye.relatedTarget===ue.current?xe.getFirstFocusableElement(ie.current,':not([data-p-hidden-focusable="true"])'):ue.current;xe.focus(Et)},Ne=function(Ye){var Et=Ye.relatedTarget===ue.current?xe.getLastFocusableElement(ie.current,':not([data-p-hidden-focusable="true"])'):ue.current;xe.focus(Et)},ve=function(Ye){ws.emit("overlay-click",{originalEvent:Ye,target:z.current})},Se=function(){return!i.selectionLimit||!i.value||i.value&&i.value.length<i.selectionLimit},Be=function(Ye){var Et=Xt()&&Ye<er.length-1?er.slice(Ye+1).findIndex(function(Wt){return zn(Wt)}):-1;return Et>-1?Et+Ye+1:-1},Te=function(Ye){var Et=Xt()&&Ye>0?ke.findLastIndex(er.slice(0,Ye),function(Wt){return zn(Wt)}):-1;return Et>-1?Et:-1},$=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=-1;return Xt()&&(Et?(Wt=Te(Ye),Wt=Wt===-1?Be(Ye):Wt):(Wt=Be(Ye),Wt=Wt===-1?Te(Ye):Wt)),Wt>-1?Wt:Ye},pe=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,Wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(Et===-1&&(Et=$(Wt,!0)),Wt===-1&&(Wt=$(Et)),Et!==-1&&Wt!==-1){var Jn=Math.min(Et,Wt),br=Math.max(Et,Wt),Pr=er.slice(Jn,br+1).filter(function(oa){return Ln(oa)}).map(function(oa){return Nt(oa)});mn(Ye,Pr,Pr)}},me=function(Ye,Et){var Wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(!(i.disabled||Qe(Et))){var Jn=Wn(Et),br=null;Jn?br=i.value.filter(function(Pr){return!ke.equals(Pr,Nt(Et),W)}):br=[].concat(Ade(i.value||[]),[Nt(Et)]),mn(Ye,br,Et),Wt!==-1&&c(Wt)}},ae=function(Ye){!i.inline&&!i.disabled&&!i.loading&&!vt(Ye)&&!Ke(Ye)&&(H?ot():He(),xe.focus(ue.current),Ye.preventDefault()),h(!0)},le=function(Ye){if(!H)He(),i.editable&&kn(Ye,at());else{var Et=l!==-1?xt(l):f?We():se();Ye.shiftKey&&pe(Ye,T,Et),kn(Ye,Et)}Ye.preventDefault()},be=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ye.altKey&&!Et)l!==-1&&me(Ye,er[l]),H&&ot(),Ye.preventDefault();else{var Wt=l!==-1?Rt(l):f?dt():Me();kn(Ye,Wt),!H&&He(),Ye.preventDefault()}},Ie=function(Ye){H?l!==-1&&(Ye.shiftKey?pe(Ye,l):me(Ye,er[l])):(c(-1),le(Ye)),Ye.preventDefault()},Pe=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=Ye.currentTarget;if(Et){var Jn=Wt.value.length;Wt.setSelectionRange(0,Ye.shiftKey?Jn:0),c(-1)}else{var br=Ye.metaKey||Ye.ctrlKey,Pr=We();Ye.shiftKey&&br&&pe(Ye,Pr,T),kn(Ye,Pr),!H&&He()}Ye.preventDefault()},ze=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=Ye.currentTarget;if(Et){var Jn=Wt.value.length;Wt.setSelectionRange(Ye.shiftKey?0:Jn,Jn),wde("focusedOptionIndex")}else{var br=Ye.metaKey||Ye.ctrlKey,Pr=dt();Ye.shiftKey&&br&&pe(Ye,T,Pr),kn(Ye,Pr),!H&&He()}Ye.preventDefault()},Ze=function(Ye){Ye.preventDefault()},nt=function(Ye){Ye.preventDefault()},ht=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Et||(H&&Zt()?(xe.focus(Ye.shiftKey?R.current:X.current),Ye.preventDefault()):(l!==-1&&me(Ye,er[l]),H&&ot(filter)))},Ut=function(){x(l)},fn=function(Ye){var Et=Ye.metaKey||Ye.ctrlKey;switch(Ye.code){case"ArrowUp":if(i.inline)break;be(Ye);break;case"ArrowDown":if(i.inline)break;le(Ye);break;case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;Ie(Ye);break;case"Home":if(i.inline)break;Pe(Ye),Ye.preventDefault();break;case"End":if(i.inline)break;ze(Ye),Ye.preventDefault();break;case"PageDown":nt(Ye);break;case"PageUp":Ze(Ye);break;case"Escape":if(i.inline)break;ot();break;case"Tab":ht(Ye);break;case"ShiftLeft":case"ShiftRight":Ut();break;default:if(Ye.key==="a"&&Et){var Wt=er.filter(function(Jn){return Ln(Jn)}).map(function(Jn){return Nt(Jn)});mn(Ye,Wt,Wt),Ye.preventDefault();break}!Et&&ke.isPrintableCharacter(Ye.key)&&(!H&&He(),Dn(Ye),Ye.preventDefault());break}h(!1)},$t=function(Ye){if(i.onSelectAll)i.onSelectAll(Ye);else{var Et=null;if(Ye.checked)Et=[];else{var Wt=er.filter(function(Jn){return Ln(Jn)&&!Qe(Jn)});Wt&&(Et=Wt.map(function(Jn){return Nt(Jn)}))}i.selectionLimit&&Et&&Et.length&&(Et=Et.slice(0,i.selectionLimit)),mn(Ye.originalEvent,Et,Et)}},mn=function(Ye,Et,Wt){i.onChange&&(i.onChange({originalEvent:Ye,value:Et,selectedOption:Wt,stopPropagation:function(){Ye==null||Ye.stopPropagation()},preventDefault:function(){Ye==null||Ye.preventDefault()},target:{name:i.name,id:i.id,value:Et}}),xe.focus(ue.current))},En=function(Ye){var Et=Ye.query;w(Et),i.onFilter&&i.onFilter({originalEvent:Ye,filter:Et})},Tt=function(){w(""),i.onFilter&&i.onFilter({filter:""})},je=function(Ye){if(H){var Et;Ye?Et=Ye.currentTarget:Et=xe.findSingle(ie.current,'li[data-p-highlight="true"]'),Et&&Et.scrollIntoView&&Et.scrollIntoView({block:"nearest",inline:"nearest"})}},He=function(){N(!0),c(l!==-1?l:i.autoOptionFocus?se():at()),xe.focus(ue.current)},ot=function(){c(-1),N(!1),h(!1)},rn=function(Ye){Di.set("overlay",ie.current,r&&r.autoZIndex||Yn.autoZIndex,r&&r.zIndex.overlay||Yn.zIndex.overlay),xe.addStyles(ie.current,{position:"absolute",top:"0",left:"0"}),wt(),je(),Ye&&Ye()},nn=function(Ye){Ye&&Ye(),oe(),i.onShow&&i.onShow()},Jt=function(){he()},_n=function(){i.filter&&i.resetFilterOnHide&&Tt(),Di.clear(ie.current),i.onHide&&i.onHide()},wt=function(){!i.inline&&xe.alignOverlay(ie.current,Y.current.parentElement,i.appendTo||r&&r.appendTo||Yn.appendTo)},Ke=function(Ye){return xe.getAttribute(Ye.target,"data-pc-section")==="clearicon"},st=function(Ye){return xe.getAttribute(Ye.target,"data-pc-section")==="headercheckboxcontainer"},vt=function(Ye){return ie.current&&ie.current.contains(Ye.target)},Vt=function(Ye){ot(),xe.focus(ue.current),Ye.preventDefault(),Ye.stopPropagation()},On=function(){if(i.value!=null&&i.options){if(i.optionGroupLabel){var Ye=0,Et=i.options.findIndex(function(Wt,Jn){return(Ye=Jn)&&$n(i.value,Fe(Wt))!==-1});return Et!==-1?{group:Ye,option:Et}:-1}return $n(i.value,i.options)}return-1},$n=function(Ye,Et){return Et.findIndex(function(Wt){return Ye.some(function(Jn){return ke.equals(Jn,Nt(Wt),W)})})},lr=function(Ye,Et){return ke.equals(Ye,Et,W)},Wn=function(Ye){if(i.value){var Et=Nt(Ye),Wt=At(Ye);return i.value.some(function(Jn){return ke.equals(Wt?Jn:Nt(Jn),Et,W)})}return!1},vr=function(Ye){var Et;if(i.options)if(i.optionGroupLabel){var Wt=zO(i.options),Jn;try{for(Wt.s();!(Jn=Wt.n()).done;){var br=Jn.value;if(Et=Nr(Ye,Fe(br)),Et)break}}catch(Pr){Wt.e(Pr)}finally{Wt.f()}}else Et=Nr(Ye,i.options),ke.isEmpty(Et)&&(Et=Nr(Ye,i.value));return Et?yt(Et):null},Nr=function(Ye,Et){return Et.find(function(Wt){return ke.equals(Nt(Wt),Ye,W)})},yn=function(Ye){O(!0),i.onFocus&&i.onFocus(Ye)},lt=function(Ye){O(!1),i.onBlur&&i.onBlur(Ye)},ut=function(){if(i.onSelectAll)return i.selectAll;if(ke.isEmpty(er))return!1;var Ye=er.filter(function(Et){return!Qe(Et)&&Ln(Et)});return!Ye.some(function(Et){return!Wn(Et)})},yt=function(Ye){return i.optionLabel?ke.resolveFieldData(Ye,i.optionLabel):Ye&&Ye.label!==void 0?Ye.label:Ye},Nt=function(Ye){return i.useOptionAsValue?Ye:i.optionValue?ke.resolveFieldData(Ye,i.optionValue):Ye&&Ye.value!==void 0?Ye.value:Ye},An=function(Ye){return i.dataKey?ke.resolveFieldData(Ye,i.dataKey):yt(Ye)},Nn=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupLabel)},It=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupLabel)},Fe=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupChildren)},Qe=function(Ye){var Et;if(!Se()&&!Wn(Ye))return!0;var Wt=i.optionDisabled;return Wt?ke.isFunction(Wt)?Wt(Ye):ke.resolveFieldData(Ye,Wt):Ye&&((Et=Ye.disabled)!==null&&Et!==void 0?Et:!1)},At=function(Ye){return!i.useOptionAsValue&&i.optionValue||Ye&&Ye.value!==void 0},jt=function(Ye){return i.optionGroupLabel&&Ye.group},Xt=function(){return ke.isNotEmpty(i.value)},Zt=function(){return xe.getFocusableElements(ie.current,':not([data-p-hidden-focusable="true"])').length>0},Sn=function(Ye){var Et;return Ln(Ye)&&((Et=yt(Ye))===null||Et===void 0?void 0:Et.toLocaleLowerCase(i.filterLocale).startsWith(U.current.toLocaleLowerCase(i.filterLocale)))},Ln=function(Ye){return ke.isNotEmpty(Ye)&&!(Qe(Ye)||jt(Ye))},zn=function(Ye){return Ln(Ye)&&Wn(Ye)},at=function(){if(Xt()){for(var Ye=function(){var br=i.value[Wt],Pr=er.findIndex(function(oa){return zn(oa)&&lr(br,Nt(oa))});if(Pr>-1)return{v:Pr}},Et,Wt=i.value.length-1;Wt>=0;Wt--)if(Et=Ye(),Et)return Et.v}return-1},se=function(){var Ye=at();return Ye<0?We():Ye},Me=function(){var Ye=at();return Ye<0?dt():Ye},We=function(){return er.findIndex(function(Ye){return Ln(Ye)})},dt=function(){return ke.findLastIndex(er,function(Ye){return Ln(Ye)})},xt=function(Ye){var Et=Ye<er.length-1?er.slice(Ye+1).findIndex(function(Wt){return Ln(Wt)}):-1;return Et>-1?Et+Ye+1:Ye},Rt=function(Ye){var Et=Ye>0?ke.findLastIndex(er.slice(0,Ye),function(Wt){return Ln(Wt)}):-1;return Et>-1?Et:Ye},Dn=function(Ye){U.current=(U.current||"")+Ye.key;var Et=-1;ke.isNotEmpty(U.current)&&(l!==-1?(Et=er.slice(l).findIndex(function(Wt){return Sn(Wt)}),Et=Et===-1?er.slice(0,l).findIndex(function(Wt){return Sn(Wt)}):Et+l):Et=er.findIndex(function(Wt){return Sn(Wt)}),Et===-1&&l===-1&&(Et=se()),Et!==-1&&kn(Ye,Et)),ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){U.current="",ce.current=null},500)},kn=function(Ye,Et){l!==Et&&(c(Et),je(Ye),i.selectOnFocus&&me(Ye,er[Et],!1))},Hn=function(Ye,Et){if(Ye.stopPropagation(),!!Mr(Ye.currentTarget)){var Wt=i.value.filter(function(Jn){return!ke.equals(Jn,Et,W)});i.onRemove&&i.onRemove({originalEvent:Ye,value:Wt}),mn(Ye,Wt,Et)}},Mr=function(Ye){var Et=re.current,Wt=Et.clientWidth<Et.scrollWidth;if(!Wt)return!0;var Jn=Ye.closest('[data-pc-section="token"]'),br=window.getComputedStyle(Et),Pr=window.getComputedStyle(Jn),oa=Et.clientWidth-parseFloat(br.paddingLeft)-parseFloat(br.paddingRight),da=Jn.getBoundingClientRect().right+parseFloat(Pr.marginRight)-Et.getBoundingClientRect().left;return da<=oa},Kr=function(){var Ye=/{(.*?)}/,Et=i.selectedItemsLabel||ni("selectionMessage"),Wt=i.value?i.value.length:0;return Ye.test(Et)?Et.replace(Et.match(Ye)[0],Wt+""):Et},qn=function(){var Ye;if(!K&&!i.fixedPlaceholder){var Et;return ke.isNotEmpty(i.maxSelectedLabels)&&((Et=i.value)===null||Et===void 0?void 0:Et.length)>i.maxSelectedLabels?Kr():ke.isArray(i.value)?i.value.reduce(function(Wt,Jn,br){return Wt+(br!==0?", ":"")+vr(Jn)},""):""}return Ye},Fn=function(){var Ye=i.value?i.value.length:0;if(ke.isNotEmpty(i.maxSelectedLabels)&&Ye>i.maxSelectedLabels)return Kr();if(i.selectedItemTemplate)return K?ke.getJSXElement(i.selectedItemTemplate):i.value.map(function(Wt,Jn){var br=ke.getJSXElement(i.selectedItemTemplate,Wt);return b.createElement(b.Fragment,{key:Jn},br)});if(i.display==="chip"&&!K){var Et=i.value.slice(0,i.maxSelectedLabels||Ye);return Et.map(function(Wt,Jn){var br={context:{value:Wt,index:Jn}},Pr=vr(Wt),oa=Pr+"_"+Jn,da=n({"aria-label":ni("removeTokenIcon"),className:Ae("removeTokenIcon"),onClick:function(te){return Hn(te,Wt)},onKeyDown:function(te){return ai(te,Wt)},tabIndex:i.tabIndex||"0"},Ee("removeTokenIcon",br)),Vs=!i.disabled&&(i.removeIcon?nr.getJSXIcon(i.removeIcon,bl({},da),{props:i}):b.createElement(hb,da)),mo=n({className:Ae("token")},Ee("token",br)),Xr=n({className:Ae("tokenLabel")},Ee("tokenLabel",br));return b.createElement("div",ks({},mo,{key:oa}),b.createElement("span",Xr,Pr),Vs)})}return qn()},sr=function(){var Ye=i.optionGroupLabel?Lr(i.options):i.options;if(Z){var Et=A.trim().toLocaleLowerCase(i.filterLocale),Wt=i.filterBy?i.filterBy.split(","):[i.optionLabel||"label"];if(i.optionGroupLabel){var Jn=[],br=zO(i.options),Pr;try{for(br.s();!(Pr=br.n()).done;){var oa=Pr.value,da=P0.filter(Fe(oa),Wt,Et,i.filterMatchMode,i.filterLocale);da&&da.length&&Jn.push(bl(bl({},oa),_f({},i.optionGroupChildren,da)))}}catch(Vs){br.e(Vs)}finally{br.f()}return Lr(Jn)}return P0.filter(Ye,Wt,Et,i.filterMatchMode,i.filterLocale)}return Ye},Lr=function(Ye){return(Ye||[]).reduce(function(Et,Wt,Jn){Et.push(bl(bl({},Wt),{},{group:!0,index:Jn}));var br=Fe(Wt);return br&&br.forEach(function(Pr){return Et.push(Pr)}),Et},[])},pi=function(Ye){switch(Ye.code){case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;mn(Ye,[],[]),Ye.preventDefault(),Ye.stopPropagation();break}},ai=function(Ye,Et){switch(Ye.code){case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;Hn(Ye,Et),Ye.preventDefault(),Ye.stopPropagation();break}};b.useImperativeHandle(e,function(){return{props:i,show:He,hide:ot,focus:function(){return xe.focus(ue.current)},getElement:function(){return z.current},getOverlay:function(){return ie.current},getInput:function(){return ue.current}}}),Li(function(){wt()}),b.useEffect(function(){ke.combinedRefs(ue,i.inputRef)},[ue,i.inputRef]),b.useEffect(function(){i.overlayVisible===!0?He():i.overlayVisible===!1&&ot()},[i.overlayVisible]),fr(function(){H&&A&&Z&&wt()},[H,A,Z]),ja(function(){Di.clear(ie.current)});var ui=function(){var Ye=n({className:Ae("clearIcon"),"aria-label":ni("clear"),onClick:function(br){return mn(br,[],[])},onKeyDown:function(br){return pi(br)},tabIndex:i.tabIndex||"0"},Ee("clearIcon")),Et=i.clearIcon||b.createElement(mc,Ye),Wt=nr.getJSXIcon(Et,bl({},Ye),{props:i});return!K&&i.showClear&&!i.disabled?Wt:null},Pi=function(){var Ye=Fn(),Et=n({ref:Y,className:Ae("labelContainer")},Ee("labelContainer")),Wt=n({ref:re,className:Ae("label",{empty:K})},Ee("label"));return b.createElement("div",Et,b.createElement("div",Wt,Ye||i.placeholder||i.emptyMessage||"empty"))},er=sr(),Ui=ke.isNotEmpty(i.tooltip),Ti=v2.getOtherProps(i),Si=ke.reduceKeys(Ti,xe.ARIA_PROPS),Hi=n({className:Ae("triggerIcon")},Ee("triggerIcon")),hn=n({className:Ae("trigger")},Ee("trigger")),Ue=i.loadingIcon?nr.getJSXIcon(i.loadingIcon,bl({},Hi),{props:i}):b.createElement(R1,ks({spin:!0},Hi)),Kt=i.dropdownIcon?nr.getJSXIcon(i.dropdownIcon,bl({},Hi),{props:i}):b.createElement(Yd,Hi),jn=b.createElement("div",hn,i.loading?Ue:Kt),jr=!i.inline&&Pi(),kr=!i.inline&&ui(),Ka=n(bl(bl({ref:z,id:i.id,style:bl(bl({},i.style),fe("root")),className:ft(i.className,Ae("root",{focusedState:M,context:r,overlayVisibleState:H}))},Ti),{},{onClick:ae}),v2.getOtherProps(i),Ee("root")),Vr=n({className:"p-hidden-accessible","data-p-hidden-accessible":!0},Ee("hiddenInputWrapper")),Es=n(bl({ref:ue,id:i.inputId,name:i.name,type:"text",onFocus:yn,onBlur:lt,onKeyDown:fn,role:"combobox","aria-expanded":H,disabled:i.disabled,tabIndex:i.disabled?-1:i.tabIndex,value:qn()},Si),Ee("input"));return b.createElement(b.Fragment,null,b.createElement("div",Ka,b.createElement("div",Vr,b.createElement("input",ks({},Es,{readOnly:!0}))),!i.inline&&b.createElement(b.Fragment,null,jr,kr,jn),b.createElement($O,ks({hostName:"MultiSelect",ref:ie,visibleOptions:er},i,{onClick:ve,onOverlayHide:ot,filterValue:m,focusedOptionIndex:l,onFirstHiddenFocus:De,onLastHiddenFocus:Ne,firstHiddenFocusableElementOnOverlay:X,lastHiddenFocusableElementOnOverlay:R,setFocusedOptionIndex:c,hasFilter:Z,isValidOption:Ln,getOptionValue:Nt,updateModel:mn,onFilterInputChange:En,resetFilter:Tt,onCloseClick:Vt,onSelectAll:$t,getOptionLabel:yt,getOptionRenderKey:An,isOptionDisabled:Qe,getOptionGroupChildren:Fe,getOptionGroupLabel:It,getOptionGroupRenderKey:Nn,isSelected:Wn,getSelectedOptionIndex:On,isAllSelected:ut,onOptionSelect:me,allowOptionSelect:Se,in:H,onEnter:rn,onEntered:nn,onExit:Jt,onExited:_n,ptm:Ee,cx:Ae,sx:fe,isUnstyled:ne,metaData:ge,changeFocusedOptionIndex:kn}))),Ui&&b.createElement(cn,ks({target:z,content:i.tooltip,pt:Ee("tooltip")},i.tooltipOptions)))}));YO.displayName="MultiSelect";const Ode=t=>{var Ee,Ae,fe,ne,q,ee,oe,he,De,Ne;const{field:e,fieldIndex:n,row:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isBuilderMode:u,isAdmin:d}=Ht(),[f,h]=k.useState([]),[g,v]=k.useState(!1),[m,A]=k.useState(!1),{userSelectedLanguage:w,formBuilderFormLayout:C,sectionSettingUpdate:S,pageSettingUpdate:T,fieldSettingUpdate:x}=sn(),{taskRegisterData:E,updateTaskRegisterData:_,updateTaskProgressValue:M,userTaskSubmitFormData:O,updateUserFormDataSubmit:F,task_status:P,TASK_PUBLISHED:H}=Ar(),[N,z]=k.useState(0),[U,ce]=k.useState(!1),X=()=>{ce(!0)},R=()=>{ce(!1)},ue=ve=>{A(ve)},Y=()=>{A(!1)},ie=ve=>{h(ve.value),r!=null&&r.rowIsRepeatable?W(i,a,e,ve.value):K(ve.value)},re=ve=>{e==null||e.conditionalTabRules.rules.map(Se=>{var Be;(Be=Se==null?void 0:Se.conditions)==null||Be.map(Te=>{var $;if(($=ve.value)!=null&&$.some(pe=>pe===Te.option)){const pe=_t.findIndex(C,ae=>{var le;return ae.uuid===((le=Te==null?void 0:Te.tab)==null?void 0:le.uuid)}),me=C[pe];me.isHidden=!1,T(pe,me)}else{const pe=_t.findIndex(C,ae=>{var le;return ae.uuid===((le=Te==null?void 0:Te.tab)==null?void 0:le.uuid)}),me=C[pe];me.isHidden=!0,T(pe,me)}})})},Z=ve=>{e==null||e.conditionalSectionRules.rules.map(Se=>{var Be;(Be=Se==null?void 0:Se.conditions)==null||Be.map(Te=>{var $;if(($=ve.value)!=null&&$.some(pe=>pe===Te.option)){const pe=_t.findIndex(C,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.tab)==null?void 0:be.uuid)}),me=_t.findIndex(C[pe].children,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.section)==null?void 0:be.uuid)}),ae=C[pe].children[me];ae.isHidden=!1,S(pe,me,ae)}else{const pe=_t.findIndex(C,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.tab)==null?void 0:be.uuid)}),me=_t.findIndex(C[pe].children,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.section)==null?void 0:be.uuid)}),ae=C[pe].children[me];ae.isHidden=!0,S(pe,me,ae)}})})},K=ve=>{const Se=O,Be=_t.cloneDeep(E);if((ve==null?void 0:ve.length)>0&&(Se==null?void 0:Se.length)>0){Be[e==null?void 0:e.uuid]=ve;for(const Te of Se)Te.fieldId===t.field.uuid&&(Te.postData[0]={postValue:ve})}else if(delete Be[e==null?void 0:e.uuid],(Se==null?void 0:Se.length)>0)for(const Te of Se)Te.fieldId===t.field.uuid&&(Te.postData[0]={postValue:[]});if(!(r!=null&&r.rowIsRepeatable)){_(Be);const Te=Object.keys(Be).length;M(Te)}},W=(ve,Se,Be,Te)=>{var $;if(h(Te),O){const pe=[...O],me=_t.findIndex(pe,function(be){return be.rowId===(r==null?void 0:r.uuid)});let ae=($=O[me])==null?void 0:$.repeatableFields,le="<ol class='card '>";Te==null||Te.map(be=>{le=le+`<li>${be}</li>`}),le=le+"</ol>",ae={...ae,[Be==null?void 0:Be.uuid]:le},pe[me]={...pe[me],repeatableFields:ae},F(pe)}(Te==null?void 0:Te.length)>0?Be.isValid=1:Be.isValid=0,x(ve,Se,s,l,n,Be)},ge=()=>{var ve,Se,Be;if(r!=null&&r.rowIsRepeatable){if(r!=null&&r.repeatableFields){const Te=[...r.repeatableFields],$=_t.findIndex(Te,function(pe){return pe.uuid===(e==null?void 0:e.uuid)});$>=0&&Te[$].fieldData?h(pe=>[...pe,Te[$].fieldData]):(e.isValid=0,h([]))}}else{const Te=O,$=_t.cloneDeep(E);if(Te!=null&&Te.length){for(const pe of Te)if(pe.fieldId===t.field.uuid&&((ve=pe==null?void 0:pe.postData)!=null&&ve.length)){h((Se=pe==null?void 0:pe.postData[0])==null?void 0:Se.postValue),$[e==null?void 0:e.uuid]=(Be=pe==null?void 0:pe.postData[0])==null?void 0:Be.postValue;const me=Object.keys($).length;M(me);break}}}v(!0)};k.useEffect(()=>{!g&&(O==null?void 0:O.length)>0&&ge();const ve=Gt.addListener("onSubmitUserForm",()=>{var Te;(Te=e==null?void 0:e.attributes)!=null&&Te.required?(f==null?void 0:f.length)>0?e.isValid=1:e.isValid=0:e.isValid=1}),Se=Gt.addListener("clearRepeatableFields",Te=>{Te===(r==null?void 0:r.uuid)&&(h([]),z(0),e.isValid=0)}),Be=Gt.addListener("OnInvalidFieldCatch",Te=>{e.uuid===(Te==null?void 0:Te.fieldId)?z(1):z(0)});return()=>{ve.remove(),Be.remove(),Se.remove()}});const ye=o.jsxs("div",{onMouseOver:X,onMouseOut:R,children:[u&&U&&o.jsx(Wr,{handleFieldSettingsSidebar:ue,...t}),o.jsxs("div",{className:`field ${u&&" py-3 px-4 builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:u?"col-12 p-fluid field-form-builder":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Ee=e==null?void 0:e.headerText)==null?void 0:Ee[w==null?void 0:w.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(fe=e==null?void 0:e.label)==null?void 0:fe[w==null?void 0:w.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{message:(ne=e==null?void 0:e.toolTip)==null?void 0:ne[w==null?void 0:w.type],position:"right"})})]}),o.jsx(YO,{onFocus:()=>z(1),value:f,onChange:ve=>{ie(ve),re(ve),Z(ve)},options:e==null?void 0:e.options,optionLabel:`optionText.${w.type}`,placeholder:(q=e==null?void 0:e.placeholder)==null?void 0:q[w==null?void 0:w.type],display:"chip",disabled:d||c}),((ee=e==null?void 0:e.attributes)==null?void 0:ee.required)&&o.jsx("small",{className:"error",children:N===1&&!((f==null?void 0:f.length)>0)?(oe=e==null?void 0:e.validationMesssage)==null?void 0:oe.english:""})]}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(he=e==null?void 0:e.helperText)==null?void 0:he[w==null?void 0:w.type]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]}),((De=e==null?void 0:e.inlineConditionalRules)==null?void 0:De.rules.length)>0&&u===!0&&o.jsx("p",{children:"Inline conditional rules"}),(Ne=e==null?void 0:e.inlineConditionalRules)==null?void 0:Ne.rules.map((ve,Se)=>u===!1?o.jsx("div",{children:ve==null?void 0:ve.conditions.map((Be,Te)=>{if(f!=null&&f.some($=>$===Be.value)||u)return o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(cb,{data:e,ruleIndex:Se,conditionIndex:Te,condition:Be,...t})})},Te)})},`rule-${Se}`):o.jsx(ci,{className:"mt-4",header:`Rule ${Se+1}`,children:o.jsx("div",{children:ve==null?void 0:ve.conditions.map((Be,Te)=>{if(f!=null&&f.some($=>$===Be.value)||u)return o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(cb,{data:e,...t,ruleIndex:Se,conditionIndex:Te,condition:Be})})},Te)})},`rule-${Se}`)},Se))]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Qi,{visibilty:m,closeSettingFieldSidebar:Y,...t},e==null?void 0:e.uuid),o.jsx(xi,{...t,fieldWrap:ye})]})},Fde=t=>{const{options:e,title:n}=t,r=e.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",i=`${e.className} justify-content-start`,a=`${e.titleClassName} pl-1`;return o.jsxs("div",{className:i,children:[o.jsxs("button",{className:e.togglerClassName,onClick:e.onTogglerClick,children:[o.jsx("span",{className:r}),o.jsx(Qt,{})]}),o.jsx("span",{className:a,children:n})]})},KO=t=>{const e=k.useRef(null),{optionIndex:n,option:r,field:i,fieldIndex:a,pageIndex:s,sectionIndex:l,rowIndex:c,columnIndex:u,path:d}=t,{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),[m,A]=k.useState(r==null?void 0:r.optionText[f==null?void 0:f.type]);k.useEffect(()=>(A(r==null?void 0:r.optionText[f==null?void 0:f.type]),()=>{}),[i]),k.useEffect(()=>{const S=setTimeout(()=>{C("optionText",r.uuid,m,f)},1500);return()=>{clearTimeout(S)}},[m]);const w=S=>{const T=d.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(T[fa],T[ha],T[Ca],T[xa],T[Ta],T[Fa],T[Xo],T[wo],S):(T==null?void 0:T.length)>Fa&&(T==null?void 0:T.length)===Bl+1&&(i!=null&&i.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(T[fa],T[ha],T[Ca],T[xa],T[Ta],T[5],T[6],T[7],S):h(s,l,c,u,a,{...S})},C=(S,T,x,E)=>{if(i!=null&&i.options){const _=[...i.options];_[n][S][E==null?void 0:E.type]=x,w({...i,options:_})}};return o.jsx(o.Fragment,{children:o.jsx(N3,{id:r==null?void 0:r.uuid,style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:m||"",disabled:!1,onChange:S=>{A(S.target.value)},tagName:"article"},r==null?void 0:r.uuid)})},XO=t=>{const{optionId:e,field:n,fieldIndex:r,columnIndex:i,sectionIndex:a,rowIndex:s,pageIndex:l,path:c}=t,{fieldSettingUpdate:u,fieldSettingUpdateInlineConditional:d,gridComponentFieldSettingUpdate:f}=sn(),h=m=>{const A=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?d(A[fa],A[ha],A[Ca],A[xa],A[Ta],A[Fa],A[Xo],A[wo],m):(A==null?void 0:A.length)>Fa&&(A==null?void 0:A.length)===Bl+1&&(m!=null&&m.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?f(A[fa],A[ha],A[Ca],A[xa],A[Ta],A[5],A[6],A[7],m):u(l,a,s,i,r,m)},g=()=>{const m=n==null?void 0:n.options.filter(function(w){return(w==null?void 0:w.uuid)!==e}),A={...n,options:m};h(A)},v=()=>{const m=_t.cloneDeep(n),A={...m,options:[...m.options,{uuid:rt(),optionText:{english:"Unititled"},value:rt(),score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]};h(A)};return o.jsxs(o.Fragment,{children:[o.jsx(Ft,{text:!0,label:"Add",className:"w-5rem ml-3 mr-3",onClick:()=>v(),size:"small"}),o.jsx(Ft,{text:!0,className:"w-3rem",size:"small",onClick:()=>{g()},icon:"pi pi-trash"})]})},kde=t=>{var Ne,ve,Se,Be,Te,$,pe,me,ae;const[e,n]=k.useState([]),[r,i]=k.useState(0),{taskRegisterData:a,updateTaskRegisterData:s,updateTaskProgressValue:l,userTaskSubmitFormData:c,task_status:u,updateUserFormDataSubmit:d,taskFieldUpdateHook:f,TASK_PUBLISHED:h,updateProgressDataValuesHook:g}=Ar(),{globalAlignment:v,isBuilderMode:m,isRenderView:A,isAdmin:w}=Ht(),{sectionSettingUpdate:C,userSelectedLanguage:S,fieldSettingUpdate:T,formBuilderFormLayout:x,pageSettingUpdate:E}=sn(),{field:_,fieldIndex:M,sectionIndex:O,pageIndex:F,row:P,rowIndex:H,columnIndex:N,section:z,page:U,isDisabled:ce}=t,[X,R]=k.useState(!1),[ue,Y]=k.useState(!1),[ie,re]=k.useState(!1),Z=()=>{re(!0)},K=()=>{re(!1)},W=le=>{R(le)},ge=()=>{R(!1)},ye=le=>{const be=[...e];le.checked?be.push(le.value):be.splice(be.indexOf(le.value),1),n(be),P!=null&&P.rowIsRepeatable?c&&oe(F,O,_,be):(Ee(le),fe(be),c&&(q(be),(be==null?void 0:be.length)>0?_.isValid=1:_.isValid=0,f(F,O,H,N,M,_)))},Ee=le=>{var Ie;const be=(Ie=le==null?void 0:le.value)==null?void 0:Ie.value;_==null||_.conditionalTabRules.rules.map(Pe=>{var ze;(ze=Pe==null?void 0:Pe.conditions)==null||ze.map(Ze=>{if(be===(Ze==null?void 0:Ze.option)&&(le!=null&&le.checked)){const nt=_t.findIndex(x,Ut=>{var fn;return Ut.uuid===((fn=Ze==null?void 0:Ze.tab)==null?void 0:fn.uuid)}),ht=x[nt];ht.isHidden=!1,E(nt,ht)}else if(be===(Ze==null?void 0:Ze.option)&&!(le!=null&&le.checked)){const nt=_t.findIndex(x,Ut=>{var fn;return Ut.uuid===((fn=Ze==null?void 0:Ze.tab)==null?void 0:fn.uuid)}),ht=x[nt];ht.isHidden=!0,E(nt,ht)}})})},Ae=k.useCallback((le,be)=>{var Ie;if((c==null?void 0:c.length)>0){const Pe=c;if(Pe!=null&&Pe.length){const ze=a;for(const[nt,ht]of be.children.entries())for(const[,Ut]of ht.children.entries())for(const[fn,$t]of Ut.children.entries())if(ht!=null&&ht.rowIsRepeatable){if((ht==null?void 0:ht.rowIsRepeatable)===!0){const mn=_t.findIndex(Pe,function(En){return En.rowId===ht.uuid});le===!0?mn===-1&&(Pe.push({postData:[],tabId:U.uuid,rowId:ht==null?void 0:ht.uuid,tabIndex:F,sectionId:z.uuid,minimumEntries:z==null?void 0:z.minimumEntries,sectionIndex:O,sectionHeading:z.heading,subHeadingText:z.subHeadingText,repeatableFields:{},repeatableFieldsData:[],language:"english",isHiddenSection:z.isHidden&&z.isHidden===1?1:0,reviewerChecklist:ht==null?void 0:ht.reviewerChecklist}),ze[ht==null?void 0:ht.uuid]&&delete ze[ht==null?void 0:ht.uuid]):(ze[ht==null?void 0:ht.uuid]&&delete ze[ht==null?void 0:ht.uuid],mn>=0&&Pe.splice(mn,1))}}else{const mn=_t.findIndex(Pe,function(En){return En.fieldId===$t.uuid});le?mn===-1&&(Pe.push({postData:[],tabId:U.uuid,tabIndex:F,...$t.inlineConditionalRules?{inlineConditionalRules:$t.inlineConditionalRules}:{},...$t.conditionalTabRules?{conditionalTabRules:$t.conditionalTabRules}:{},...$t.conditionalSectionRules?{conditionalSectionRules:$t.conditionalSectionRules}:{},sectionId:z.uuid,sectionIndex:O,sectionHeading:z.heading,subHeadingText:z.subHeadingText,reviewerChecklist:$t==null?void 0:$t.reviewerChecklist,rowId:ht.uuid,rowIndex:nt,columnId:z.uuid,columnIndex:N,inlineConditionalField:!0,fieldIndex:fn,fieldId:$t.uuid,fieldInputType:$t.componentType,fieldTitle:(Ie=$t.label)==null?void 0:Ie.english,fieldDescription:$t.description||null,fieldHelperText:$t.helperText||null,fieldHeaderText:$t.headerText||null,fieldFooterText:$t.footerText||null,fieldTitleAbb:$t.abbreviationLabel||$t.label,question_abb_table:$t.textForTable||null,language:"english",isHiddenfield:$t.isHidden&&$t.isHidden===1?1:0,isHiddenSection:z.isHidden&&z.isHidden===1?1:0}),ze[$t==null?void 0:$t.uuid]&&delete ze[$t==null?void 0:$t.uuid]):(ze[$t==null?void 0:$t.uuid]&&delete ze[$t==null?void 0:$t.uuid],mn>=0&&Pe.splice(mn,1))}const Ze=Object.keys(ze).length;g({progressMaxValue:Pe==null?void 0:Pe.length,progressValue:Ze}),d([...Pe])}}},[N,_==null?void 0:_.abbreviationLabel,_==null?void 0:_.componentType,_==null?void 0:_.conditionalSectionRules,_==null?void 0:_.conditionalTabRules,_==null?void 0:_.description,_==null?void 0:_.footerText,_==null?void 0:_.headerText,_==null?void 0:_.helperText,_==null?void 0:_.inlineConditionalRules,_==null?void 0:_.isHidden,_==null?void 0:_.label,_==null?void 0:_.reviewerChecklist,_==null?void 0:_.textForTable,U==null?void 0:U.uuid,F,P==null?void 0:P.uuid,H,z==null?void 0:z.heading,z==null?void 0:z.isHidden,z==null?void 0:z.subHeadingText,z==null?void 0:z.uuid,O,a,g,d,c]),fe=le=>{_==null||_.conditionalSectionRules.rules.map(be=>{var Ie;(Ie=be==null?void 0:be.conditions)==null||Ie.map(Pe=>{if(le!=null&&le.some(ze=>ze.value===Pe.option)){const ze=_t.findIndex(x,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.tab)==null?void 0:Ut.uuid)}),Ze=_t.findIndex(x[ze].children,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.section)==null?void 0:Ut.uuid)}),nt=x[ze].children[Ze];nt.isHidden=!1,Ae(!0,x[ze].children[Ze]),C(ze,Ze,nt)}else{const ze=_t.findIndex(x,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.tab)==null?void 0:Ut.uuid)}),Ze=_t.findIndex(x[ze].children,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.section)==null?void 0:Ut.uuid)}),nt=x[ze].children[Ze];nt.isHidden=!0,Ae(!1,x[ze].children[Ze]),C(ze,Ze,nt)}})})},ne=()=>{var be,Ie,Pe,ze;const le=c;if((le==null?void 0:le.length)>0){for(const Ze of le)if(Ze.fieldId===t.field.uuid){n(((be=Ze==null?void 0:Ze.postData[0])==null?void 0:be.postValue.length)>0?(Ie=Ze==null?void 0:Ze.postData[0])==null?void 0:Ie.postValue:[]);const nt=((Pe=Ze==null?void 0:Ze.postData[0])==null?void 0:Pe.postValue.length)>0?(ze=Ze==null?void 0:Ze.postData[0])==null?void 0:ze.postValue:[];_==null||_.conditionalTabRules.rules.map(ht=>{var Ut;(Ut=ht==null?void 0:ht.conditions)==null||Ut.map(fn=>{if(nt.some($t=>$t.value===(fn==null?void 0:fn.option))){const $t=_t.findIndex(x,En=>{var Tt;return En.uuid===((Tt=fn==null?void 0:fn.tab)==null?void 0:Tt.uuid)}),mn=x[$t];mn.isHidden=!1,E($t,mn)}})}),Y(!0);break}}},q=le=>{const be=c,Ie=_t.cloneDeep(a);if((le==null?void 0:le.length)>0&&(be==null?void 0:be.length)>0){Ie[_==null?void 0:_.uuid]=le;for(const ze of be)ze.fieldId===t.field.uuid&&(ze.postData[0]={postValue:le});s(Ie);const Pe=Object.keys(Ie).length;l(Pe)}else{if(delete Ie[_==null?void 0:_.uuid],(be==null?void 0:be.length)>0)for(const ze of be)ze.fieldId===t.field.uuid&&(ze.postData[0]={postValue:[]});s(Ie);const Pe=Object.keys(Ie).length;l(Pe)}},ee=()=>{const le=[];return _==null||_.options.map((be,Ie)=>{var ze,Ze,nt,ht;const Pe=e;le.push(o.jsxs("div",{className:`field ${m&&" py-3 px-4 builder-element-wrapper "}${(_==null?void 0:_.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"flex align-items-center gap-2",children:[o.jsx(Yr,{id:`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`,onFocus:()=>i(1),disabled:w||ce,onChange:Ut=>{ye(Ut)},value:be,checked:Pe==null?void 0:Pe.some(Ut=>Ut.uuid===be.uuid)}),((ze=be==null?void 0:be.hyperlinkText)==null?void 0:ze[S==null?void 0:S.type])===""?o.jsxs("label",{htmlFor:`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`,children:[_!=null&&_.showAlphabetList?o.jsxs("span",{className:"mx-2",children:[" ",_O(Ie)," "]}):o.jsx(o.Fragment,{}),m?o.jsx(o.Fragment,{children:o.jsx(KO,{...t,option:be,optionIndex:Ie})}):o.jsx(o.Fragment,{children:(Ze=be==null?void 0:be.optionText)==null?void 0:Ze[S==null?void 0:S.type]})]}):o.jsx("label",{children:o.jsx("a",{href:(nt=be==null?void 0:be.hyperlinkText)==null?void 0:nt[S==null?void 0:S.type],target:"_blank",rel:"noreferrer",children:(ht=be==null?void 0:be.optionText)==null?void 0:ht[S==null?void 0:S.type]})})]}),m&&o.jsx("div",{className:"builder-radio-option-settings",children:o.jsx(XO,{optionId:be==null?void 0:be.uuid,...t})})]},`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`))}),le};k.useEffect(()=>{ue||ne();const le=Gt.addListener("clearRepeatableFields",Pe=>{Pe===(P==null?void 0:P.uuid)&&(n([]),i(0),_.isValid=0,T(F,O,H,N,M,_))}),be=Gt.addListener("onSubmitUserForm",()=>{var ze;const Pe=e;(ze=_==null?void 0:_.attributes)!=null&&ze.required?(Pe.length>0?_.isValid=1:_.isValid=0,f(F,O,H,N,M,_)):_.isValid=1}),Ie=Gt.addListener("OnInvalidFieldCatch",Pe=>{_.uuid===(Pe==null?void 0:Pe.fieldId)?i(1):i(0)});return()=>{be.remove(),Ie.remove(),le.remove()}});const oe=(le,be,Ie,Pe)=>{var Ut;n(Pe);const ze=[...c],Ze=_t.findIndex(ze,function(fn){return fn.rowId===(P==null?void 0:P.uuid)});let nt=(Ut=c[Ze])==null?void 0:Ut.repeatableFields,ht="<ol class='card '>";Pe==null||Pe.map(fn=>{ht=ht+`<li>${fn.value}</li>`}),ht=ht+"</ol>",nt={...nt,[Ie==null?void 0:Ie.uuid]:ht},ze[Ze]={...ze[Ze],repeatableFields:nt},d(ze),(Pe==null?void 0:Pe.length)>0?Ie.isValid=1:Ie.isValid=0,T(le,be,H,N,Ze,Ie)},he=o.jsxs("div",{onMouseOver:Z,onMouseOut:K,children:[m&&ie&&o.jsx(Wr,{handleFieldSettingsSidebar:W,...t}),o.jsx("div",{className:`field ${m&&" py-3 px-4 builder-element-wrapper "}${(_==null?void 0:_.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-12",children:[(_==null?void 0:_.showHeaderText)&&o.jsx("h6",{children:(Ne=_==null?void 0:_.headerText)==null?void 0:Ne[S==null?void 0:S.type]}),(_==null?void 0:_.showLabel)&&o.jsxs("label",{htmlFor:`${M}`,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((ve=_==null?void 0:_.attributes)==null?void 0:ve.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",m?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(Se=_==null?void 0:_.label)==null?void 0:Se[S==null?void 0:S.type]}),o.jsx("span",{className:"ml-3",children:(_==null?void 0:_.showToolTip)&&o.jsx(zi,{message:(Be=_==null?void 0:_.toolTip)==null?void 0:Be[S==null?void 0:S.type],position:"right"})})]}),ee(),o.jsx("div",{children:((Te=_==null?void 0:_.attributes)==null?void 0:Te.required)&&o.jsx("small",{className:"error",children:r===1&&!(e&&(e==null?void 0:e.length)>0)?($=_==null?void 0:_.validationMesssage)==null?void 0:$.language:""})}),o.jsx("div",{children:(_==null?void 0:_.showHelperText)&&o.jsx("small",{children:(pe=_==null?void 0:_.helperText)==null?void 0:pe[S==null?void 0:S.type]})}),((me=_==null?void 0:_.inlineConditionalRules)==null?void 0:me.rules.length)>0&&m===!0&&o.jsx("p",{children:"Inline conditional rules"}),(ae=_==null?void 0:_.inlineConditionalRules)==null?void 0:ae.rules.map((le,be)=>{if(m===!1){const Ie=e;return o.jsx("div",{children:le==null?void 0:le.conditions.map((Pe,ze)=>o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:Ie==null?void 0:Ie.some(Ze=>Ze.value===Pe.value),inputValue:e,condition:Pe,ruleIndex:be,conditionIndex:ze,field:_,section:z,page:U,row:P,pageIndex:F,sectionIndex:O,rowIndex:H,columnIndex:N,...t})},`select-rule-${be}-`+ze))},`rule-${be}`)}else return o.jsx(ci,{className:"mt-4",header:`Rule ${be+1}`,children:o.jsx("div",{children:le==null?void 0:le.conditions.map((Ie,Pe)=>o.jsx(k.Fragment,{children:o.jsxs("div",{className:"card",children:[o.jsx(fu,{style:{marginTop:-20},className:"mr-2",severity:"success",value:`Condition: ${Ie==null?void 0:Ie.value}`,rounded:!0}),o.jsx(e0,{isConditionTrue:(e==null?void 0:e.some(ze=>ze.value===Ie.value))||m,inputValue:e,condition:Ie,ruleIndex:be,conditionIndex:Pe,field:_,section:z,page:U,row:P,pageIndex:F,sectionIndex:O,rowIndex:H,columnIndex:N,...t})]})},`select-rule-${be}-`+Pe))},`rule-${be}`)},be)})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]}),De=()=>{let le="";return m&&(le=le+" field-form-builder"),u===h&&w===!0&&(le=le+" card"),le};return o.jsxs(o.Fragment,{children:[X===!0&&o.jsx(Qi,{visibilty:X,closeSettingFieldSidebar:ge,...t},_==null?void 0:_.uuid),o.jsx("div",{className:De(),dir:v,children:u===h&&w===!0?o.jsx(ci,{headerTemplate:le=>{var be;return o.jsx(Fde,{options:le,title:(be=_==null?void 0:_.label)==null?void 0:be[S==null?void 0:S.type]})},toggleable:!0,children:he}):he})]})},Pde=6,Mde=t=>{var ne,q,ee,oe,he,De,Ne,ve,Se,Be,Te;const{task_status:e,taskRegisterData:n,updateTaskRegisterData:r,updateTaskProgressValue:i,userTaskSubmitFormData:a,updateUserFormDataSubmit:s,updateProgressDataValuesHook:l,TASK_PUBLISHED:c}=Ar(),{field:u,row:d,pageIndex:f,sectionIndex:h,section:g,page:v,rowIndex:m,columnIndex:A,isDisabled:w=!1}=t,{isAdmin:C,isBuilderMode:S}=Ht(),{pageSettingUpdate:T,formBuilderFormLayout:x,sectionSettingUpdate:E,selectedLanguage:_}=sn(),[M,O]=k.useState(!1),[F,P]=k.useState(null),[H,N]=k.useState(0),[z,U]=k.useState(!1),[ce,X]=k.useState(!1),R=()=>{X(!0)},ue=()=>{X(!1)},Y=$=>{O($)},ie=()=>{O(!1)},re=()=>{var $,pe,me,ae;if((a==null?void 0:a.length)>0)if(d!=null&&d.rowIsRepeatable){if(d!=null&&d.repeatableFields){const le=[...d.repeatableFields],be=_t.findIndex(le,function(Ie){return Ie.uuid===(u==null?void 0:u.uuid)});be>=0&&le[be].fieldData?P(le[be].fieldData):(u.isValid=0,P(null))}}else{const le=a,be=_t.cloneDeep(n);let Ie=null;if(le!=null&&le.length){for(const Pe of le)if(Pe.fieldId===t.field.uuid&&(($=Pe==null?void 0:Pe.postData)!=null&&$.length)){Ie=(pe=Pe==null?void 0:Pe.postData[0])==null?void 0:pe.postValue,P((me=Pe==null?void 0:Pe.postData[0])==null?void 0:me.postValue),be[u==null?void 0:u.uuid]=(ae=Pe==null?void 0:Pe.postData[0])==null?void 0:ae.postValue;const ze=Object.keys(be).length;i(ze);break}}Z({value:Ie}),W({value:Ie})}setTimeout(()=>{U(!0)},2e3)},Z=$=>{const pe=$.value;u==null||u.conditionalTabRules.rules.map(me=>{var ae;(ae=me==null?void 0:me.conditions)==null||ae.map(le=>{const be=_t.findIndex(x,Ie=>{var Pe;return Ie.uuid===((Pe=le==null?void 0:le.tab)==null?void 0:Pe.uuid)});if(pe===(le==null?void 0:le.option)){const Ie=x[be];Ie.isHidden=!1,T(be,Ie)}else{let Ie=x[be];Ie={...Ie,isHidden:!0},T(be,Ie)}})})},K=k.useCallback(($,pe)=>{var me;if((a==null?void 0:a.length)>0){const ae=a;if(ae!=null&&ae.length){const le=n;for(const[Ie,Pe]of pe.children.entries())for(const[,ze]of Pe.children.entries())for(const[Ze,nt]of ze.children.entries())if(Pe!=null&&Pe.rowIsRepeatable){if((Pe==null?void 0:Pe.rowIsRepeatable)===!0){const ht=_t.findIndex(ae,function(Ut){return Ut.rowId===Pe.uuid});$===!0?ht===-1&&(ae.push({postData:[],tabId:v.uuid,rowId:Pe==null?void 0:Pe.uuid,tabIndex:f,sectionId:g.uuid,minimumEntries:g==null?void 0:g.minimumEntries,sectionIndex:h,sectionHeading:g.heading,subHeadingText:g.subHeadingText,repeatableFields:{},repeatableFieldsData:[],language:"english",isHiddenSection:!!(g.isHidden&&g.isHidden===!0),reviewerChecklist:Pe==null?void 0:Pe.reviewerChecklist}),le[Pe==null?void 0:Pe.uuid]&&delete le[Pe==null?void 0:Pe.uuid]):(le[Pe==null?void 0:Pe.uuid]&&delete le[Pe==null?void 0:Pe.uuid],ht>=0&&ae.splice(ht,1))}}else{const ht=_t.findIndex(ae,function(Ut){return Ut.fieldId===nt.uuid});$?ht===-1&&(ae.push({postData:[],tabId:v.uuid,tabIndex:f,...nt.inlineConditionalRules?{inlineConditionalRules:nt.inlineConditionalRules}:{},...nt.conditionalTabRules?{conditionalTabRules:nt.conditionalTabRules}:{},...nt.conditionalSectionRules?{conditionalSectionRules:nt.conditionalSectionRules}:{},sectionId:g.uuid,sectionIndex:h,sectionHeading:g.heading,subHeadingText:g.subHeadingText,reviewerChecklist:nt==null?void 0:nt.reviewerChecklist,rowId:Pe.uuid,rowIndex:Ie,columnId:g.uuid,columnIndex:A,inlineConditionalField:!0,fieldIndex:Ze,fieldId:nt.uuid,fieldInputType:nt.componentType,fieldTitle:(me=nt.label)==null?void 0:me.english,fieldDescription:nt.description||null,fieldHelperText:nt.helperText||null,fieldHeaderText:nt.headerText||null,fieldFooterText:nt.footerText||null,fieldTitleAbb:nt.abbreviationLabel||nt.label,question_abb_table:nt.textForTable||null,language:"english",isHiddenfield:nt.isHidden&&nt.isHidden===1?1:0,isHiddenSection:!!(g.isHidden&&g.isHidden===!0)}),le[nt==null?void 0:nt.uuid]&&delete le[nt==null?void 0:nt.uuid]):(le[nt==null?void 0:nt.uuid]&&delete le[nt==null?void 0:nt.uuid],ht>=0&&ae.splice(ht,1))}const be=Object.keys(le).length;l({progressMaxValue:ae==null?void 0:ae.length,progressValue:be}),s([...ae])}}},[A,u==null?void 0:u.abbreviationLabel,u==null?void 0:u.componentType,u==null?void 0:u.conditionalSectionRules,u==null?void 0:u.conditionalTabRules,u==null?void 0:u.description,u==null?void 0:u.footerText,u==null?void 0:u.headerText,u==null?void 0:u.helperText,u==null?void 0:u.inlineConditionalRules,u==null?void 0:u.isHidden,u==null?void 0:u.label,u==null?void 0:u.reviewerChecklist,u==null?void 0:u.textForTable,v==null?void 0:v.uuid,f,d==null?void 0:d.uuid,m,g==null?void 0:g.heading,g==null?void 0:g.isHidden,g==null?void 0:g.subHeadingText,g==null?void 0:g.uuid,h,n,l,s,a]),W=$=>{const pe=$.value;u==null||u.conditionalSectionRules.rules.map(me=>{var ae;(ae=me==null?void 0:me.conditions)==null||ae.map(le=>{if((pe==null?void 0:pe.value)===(le==null?void 0:le.option)){const be=_t.findIndex(x,ze=>{var Ze;return ze.uuid===((Ze=le==null?void 0:le.tab)==null?void 0:Ze.uuid)}),Ie=_t.findIndex(x[be].children,ze=>{var Ze;return ze.uuid===((Ze=le==null?void 0:le.section)==null?void 0:Ze.uuid)}),Pe=x[be].children[Ie];Pe.isHidden=!1,K(!0,x[be].children[Ie]),E(be,Ie,Pe)}else{const be=_t.findIndex(x,ze=>{var Ze;return(ze==null?void 0:ze.uuid)===((Ze=le==null?void 0:le.tab)==null?void 0:Ze.uuid)}),Ie=_t.findIndex(x[be].children,ze=>{var Ze;return(ze==null?void 0:ze.uuid)===((Ze=le==null?void 0:le.section)==null?void 0:Ze.uuid)}),Pe=x[be].children[Ie];Pe.isHidden=!0,K(!1,x[be].children[Ie]),E(be,Ie,Pe)}})})};k.useEffect(()=>{z||re();const $=Gt.addListener("clearRepeatableFields",ae=>{ae===(d==null?void 0:d.uuid)&&(P(""),N(0),u.isValid=1)}),pe=Gt.addListener("onSubmitUserForm",()=>{var ae;if((ae=u==null?void 0:u.attributes)!=null&&ae.required){const le=F;le!=null&&le.uuid&&(le!=null&&le.value)?u.isValid=1:u.isValid=0}else u.isValid=1}),me=Gt.addListener("OnInvalidFieldCatch",ae=>{(u==null?void 0:u.uuid)===(ae==null?void 0:ae.fieldId)?N(1):N(0)});return()=>{pe.remove(),me.remove(),$.remove()}});const ge=($,pe)=>{var me;if(a){const ae=[...a],le=_t.findIndex(ae,function(Ie){return Ie.rowId===(d==null?void 0:d.uuid)});let be=(me=a[le])==null?void 0:me.repeatableFields;be={...be,[$==null?void 0:$.uuid]:pe==null?void 0:pe.optionText[_]},ae[le]={...ae[le],repeatableFields:be},s(ae)}P(pe),pe!==null?$.isValid=1:$.isValid=0},ye=$=>{var pe;P($.target.value),Z($),W($),d!=null&&d.rowIsRepeatable?ge(u,(pe=$==null?void 0:$.target)==null?void 0:pe.value):Ae($),setTimeout(()=>{Gt.emit("updatePageRender","complete")},1e3)},Ee=()=>{var $;if((($=u==null?void 0:u.fieldType)==null?void 0:$.type)==="radio"){const pe=[];return u==null||u.options.map((me,ae)=>{var be,Ie,Pe,ze;const le=F;pe.push(o.jsxs("div",{className:`field-radiobutton ${u!=null&&u.showButtonLayout?"col-6 field-radiobutton-builder":""}`,onClick:()=>{(!C||!w)&&e!==Pde&&ye({value:me,target:{value:me}})},style:(le==null?void 0:le.uuid)===(me==null?void 0:me.uuid)&&(u!=null&&u.showButtonLayout)?{backgroundColor:"#0F8BFD",padding:5,borderRadius:8}:{padding:5},children:[o.jsx(ia,{onFocus:()=>{(!C||!w)&&N(1)},inputId:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder-radio":"preview"}`,onChange:Ze=>{(!C||!w)&&ye(Ze)},value:me,name:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder":"preview"}`,checked:(le==null?void 0:le.uuid)===(me==null?void 0:me.uuid),disabled:C||w,readOnly:C||w}),((be=me==null?void 0:me.hyperlinkText)==null?void 0:be[_])===""?o.jsxs("label",{htmlFor:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder-label":"preview"}`,children:[u!=null&&u.showAlphabetList?o.jsxs("span",{className:"mx-2",children:[" ",_O(ae)," "]}):"",S?o.jsx(o.Fragment,{children:o.jsx(KO,{...t,option:me,optionIndex:ae})}):o.jsxs(o.Fragment,{children:[" ",(Ie=me==null?void 0:me.optionText)==null?void 0:Ie[_]]})]}):o.jsx("label",{children:o.jsx("a",{href:(Pe=me==null?void 0:me.hyperlinkText)==null?void 0:Pe[_],target:"_blank",rel:"noreferrer",children:(ze=me==null?void 0:me.optionText)==null?void 0:ze[_]})}),S&&o.jsx("div",{className:"builder-radio-option-settings",children:o.jsx(XO,{optionId:me==null?void 0:me.uuid,...t})})]},"li-item-"+ae))}),pe}},Ae=$=>{var be,Ie;P($.target.value);const pe={value:$.target.value};Z(pe),W(pe);const me=a,ae=_t.cloneDeep(n);if((be=$==null?void 0:$.target)!=null&&be.value&&(me==null?void 0:me.length)>0)for(const Pe of me)Pe.fieldId===t.field.uuid&&(ae[u==null?void 0:u.uuid]=(Ie=$==null?void 0:$.target)==null?void 0:Ie.value,Pe.postData[0]={postValue:$.target.value});else delete ae[u==null?void 0:u.uuid];r(ae);const le=Object.keys(ae).length;i(le)},fe=o.jsxs("div",{onMouseOver:R,onMouseOut:ue,children:[S&&ce&&o.jsx(Wr,{handleFieldSettingsSidebar:Y,...t}),o.jsx("div",{className:`field ${S&&" py-3 px-4 builder-element-wrapper "}${(u==null?void 0:u.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-12",children:[(u==null?void 0:u.showHeaderText)&&o.jsx("h6",{children:(ne=u==null?void 0:u.headerText)==null?void 0:ne[_]}),(u==null?void 0:u.showLabel)&&o.jsxs("label",{htmlFor:u.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((q=u==null?void 0:u.attributes)==null?void 0:q.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",S?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(ee=u==null?void 0:u.label)==null?void 0:ee[_]}),o.jsx("span",{className:"ml-3",children:u!=null&&u.showToolTip?o.jsx(o.Fragment,{children:o.jsx(zi,{message:(oe=u==null?void 0:u.toolTip)==null?void 0:oe[_],position:"right"})}):""})]}),(u==null?void 0:u.showButtonLayout)===!0?o.jsxs("div",{className:"grid",children:[Ee()," "]}):Ee(),o.jsx("div",{children:((he=u==null?void 0:u.attributes)==null?void 0:he.required)&&o.jsx("small",{className:"error",children:H===1&&F!==null?(De=u==null?void 0:u.validationMesssage)==null?void 0:De.language:""})}),o.jsx("div",{children:(u==null?void 0:u.showHelperText)&&o.jsx("small",{children:(Ne=u==null?void 0:u.helperText)==null?void 0:Ne[_]})}),((ve=u==null?void 0:u.inlineConditionalRules)==null?void 0:ve.rules.length)>0&&S===!0&&o.jsx("p",{children:"Inline conditional rules"}),z===!0&&((Be=(Se=u==null?void 0:u.inlineConditionalRules)==null?void 0:Se.rules)==null?void 0:Be.length)>0&&((Te=u==null?void 0:u.inlineConditionalRules)==null?void 0:Te.rules.map(($,pe)=>{const me=F;return S===!1?o.jsx("div",{children:$==null?void 0:$.conditions.map((ae,le)=>o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:!!((me==null?void 0:me.value)===ae.value||S),inputValue:F,condition:ae,ruleIndex:pe,conditionIndex:le,field:u,section:g,page:v,row:d,pageIndex:f,sectionIndex:h,rowIndex:m,columnIndex:A,isAdmin:C,...t})},`select-rule-${pe}-`+le))},`rule-${pe}`):o.jsx(ci,{className:"mt-4",header:`Rule ${pe+1}`,children:o.jsx("div",{children:$==null?void 0:$.conditions.map((ae,le)=>{const be=F;return o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:!!((be==null?void 0:be.value)===ae.value||S),inputValue:F,condition:ae,ruleIndex:pe,conditionIndex:le,field:u,section:g,page:v,row:d,pageIndex:f,sectionIndex:h,rowIndex:m,columnIndex:A,...t})},`select-rule-${pe}-`+le)})},`rule-${pe}`)},pe)}))]}),C&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]});return o.jsxs(o.Fragment,{children:[M===!0&&o.jsx(Qi,{visibilty:M,closeSettingFieldSidebar:ie,...t},u==null?void 0:u.uuid),o.jsx(xi,{...t,fieldWrap:fe})]})},Lde=k.memo(Mde),Bde=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("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Text"}),o.jsx(wn,{value:(i=r.text)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("text",e,s.target.value),placeholder:"Heading text",id:r==null?void 0:r.uuid})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(wn,{value:(a=r.hrefLink)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("hrefLink",e,s.target.value),placeholder:"Link"})]})]})},Vde=t=>{const{onHandleChangeHeadingTypeSetttings:e,fieldState:n}=t,r=[{name:"H1",type:"h1"},{name:"H2",type:"h2"},{name:"H3",type:"h3"},{name:"H4",type:"h4"},{name:"H5",type:"h5"}];return o.jsxs("form",{className:"p-fluid",children:[o.jsx("h3",{children:"Select heading type"}),r.map((i,a)=>o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:i==null?void 0:i.type,name:"heading",value:i==null?void 0:i.type,onChange:s=>e(s),checked:n.headingType===i.type}),o.jsx("label",{htmlFor:i.type,children:i.name})]},a))]})},qde=t=>{const{fieldSettingUpdate:e,formBuilderSchemaLanguages:n,formBuilderPublishedStatus:r,fieldSettingUpdateInlineConditional:i,gridComponentFieldSettingUpdate:a}=sn(),{path:s,visibilty:l,field:c,closeSettingFieldSidebar:u,pageIndex:d,sectionIndex:f,rowIndex:h,columnIndex:g,fieldIndex:v,typeName:m}=t,[A,w]=k.useState(c),{updateGlobalToast:C}=Ht(),S=(E,_,M)=>{w(O=>({...O,[E]:{...O[E],[_==null?void 0:_.type]:M}}))},T=E=>{w(_=>({..._,headingType:E==null?void 0:E.value}))},x=()=>{const E=s.split("-").map(Number);(E==null?void 0:E.length)>5&&(E==null?void 0:E.length)===8&&(A!=null&&A.inlineConditionalRules)?i(E[fa],E[ha],E[Ca],E[xa],E[Ta],E[Fa],E[Xo],E[wo],A):(E==null?void 0:E.length)>Fa&&(E==null?void 0:E.length)===Bl+1&&(A!=null&&A.componentType)?a(E[fa],E[ha],E[Ca],E[xa],E[Ta],E[lx],E[cx],E[ux],A):e(d,f,h,g,v,A),C({showToast:!0,toastMessage:"Updated",toastDetail:`${m} updated`,toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"750px"},visible:l,position:"left",className:"p-sidebar-lg",onHide:()=>u(),header:()=>o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[t==null?void 0:t.typeName," settings"]})}),children:[o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:n!=null&&n.length?n.map((E,_)=>o.jsx(io,{tabIndex:_,header:E==null?void 0:E.language,children:o.jsx(Bde,{language:E,fieldState:A,onHandleChange:S,...t})},_)):""})}),o.jsx(wr,{header:"Setting",children:o.jsx(Vde,{onHandleChangeHeadingTypeSetttings:T,fieldState:A})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[!r&&o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>x(),"aria-label":"Update"}),o.jsx(Ft,{label:"Close",type:"button",onClick:()=>u(),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Ude=t=>{var v,m;const{field:e}=t,{isBuilderMode:n}=Ht(),{userSelectedLanguage:r}=sn(),[i,a]=k.useState(!1),[s,l]=k.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=A=>{a(A)},f=()=>{a(!1)},h=()=>{var A,w,C,S,T,x;return(e==null?void 0:e.headingType)==="h1"?o.jsx("h1",{children:(A=e==null?void 0:e.text)==null?void 0:A[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h2"?o.jsx("h2",{children:(w=e==null?void 0:e.text)==null?void 0:w[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h3"?o.jsx("h3",{children:(C=e==null?void 0:e.text)==null?void 0:C[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h4"?o.jsx("h4",{children:(S=e==null?void 0:e.text)==null?void 0:S[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h5"?o.jsx("h5",{children:(T=e==null?void 0:e.text)==null?void 0:T[r==null?void 0:r.type]}):o.jsx("h1",{children:(x=e==null?void 0:e.text)==null?void 0:x[r==null?void 0:r.type]})},g=o.jsxs("div",{className:n?"builder-element-wrapper":"",onMouseOver:c,onMouseOut:u,children:[n&&s&&o.jsx(Wr,{handleFieldSettingsSidebar:d,...t}),o.jsx("div",{className:n?"field-form-builder px-2":" px-2",children:o.jsx("div",{className:"col-12",children:((v=e==null?void 0:e.hrefLink)==null?void 0:v[r==null?void 0:r.type])!==""?o.jsx("a",{href:(m=e==null?void 0:e.hrefLink)==null?void 0:m[r==null?void 0:r.type],target:"_blank",rel:"noreferrer",children:h()}):h()})})]});return o.jsxs(o.Fragment,{children:[i&&o.jsx(qde,{visibilty:i,closeSettingFieldSidebar:f,...t},e==null?void 0:e.uuid),o.jsx(xi,{...t,fieldWrap:g})]})},$de=t=>{var i,a;const{language:e,onHandleQuestionTextChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Question text"}),o.jsx(wn,{placeholder:"Enter question",value:(i=r.questionText)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("questionText",e.type,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Correct answer"}),o.jsx(wn,{placeholder:"Enter correct answer",value:(a=r.correctAnswerComment)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("correctAnswerComment",e.type,s.target.value)})]})]})},jde=t=>{var i;const{onHandleChange:e,fieldState:n,onHandleChangeAttributesSetttings:r}=t;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field",style:{display:"inline-block",width:"150px"},children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Time limit"}),o.jsxs("div",{className:"p-inputgroup",children:[o.jsx(eo,{inputId:"horizontal",showButtons:!0,buttonLayout:"horizontal",step:1,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},value:n==null?void 0:n.timeLimit,onChange:a=>e("timeLimit",a.value)}),o.jsx("span",{className:"p-inputgroup-addon",children:"mins"})]})]})}),o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field",style:{display:"inline-block",width:"100px"},children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Score"}),o.jsx("div",{className:"p-inputgroup",children:o.jsx(eo,{inputId:"horizontal",showButtons:!0,buttonLayout:"horizontal",step:1,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},value:n==null?void 0:n.score,onChange:a=>e("score",a.value)})})]})}),o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"required",checked:(i=n==null?void 0:n.attributes)==null?void 0:i.required,onChange:a=>r("required",a.checked)}),o.jsx("label",{htmlFor:"required",children:"Is complusory?"})]})})]})},zde=t=>{const{onHandleChange:e,fieldState:n}=t,[r,i]=k.useState([{type:"radio"},{type:"checkbox"}]);return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field field-checkbox",children:[o.jsx(Yr,{inputId:"isAllowMultipleAnswer",value:"isAllowMultipleAnswer",onChange:a=>{e("isAllowMultipleAnswer",a==null?void 0:a.checked),a!=null&&a.checked?(i([{type:"checkbox"}]),e("answerInputType","checkbox")):(i([{type:"radio"}]),e("answerInputType","radio"))},checked:n==null?void 0:n.isAllowMultipleAnswer}),o.jsx("label",{htmlFor:"isAllowMultipleAnswer",className:"p-checkbox-label ",children:"Allow multiple answer"})]}),(n==null?void 0:n.isAllowMultipleAnswer)&&o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Number of options"}),o.jsx(wn,{type:"number",value:(n==null?void 0:n.noOfMultpleAnswer)||0,onChange:a=>{var s;e("noOfMultpleAnswer",(s=a==null?void 0:a.target)==null?void 0:s.value)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Answer input type"}),r.map((a,s)=>o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:a.type,name:"answerInputType",value:a.type,onChange:()=>{if(e("answerInputType",a.type),a.type==="checkbox"&&e("isAllowMultipleAnswer",!0),a.type==="radio"){let l=[...(n==null?void 0:n.answerOptions)||[]];l=l.map(c=>({...c,isCorrect:!1})),e("answerOptions",l),e("isAllowMultipleAnswer",!1)}},checked:(n==null?void 0:n.answerInputType)===a.type}),o.jsx("label",{htmlFor:a.type,children:a.type})]},s))]})]})},Hde=t=>{const{fieldState:e,setFieldState:n,language:r}=t,i=()=>{var g;let f=!1;const h=(g=e==null?void 0:e.answerOptions)==null?void 0:g.filter(v=>(v==null?void 0:v.isCorrect)===!0);return(h==null?void 0:h.length)===parseInt(e==null?void 0:e.noOfMultpleAnswer)&&(f=!0),f},a=f=>o.jsx(o.Fragment,{children:o.jsx(Ft,{text:!0,type:"button",className:"p-button-danger left-space",onClick:()=>d((f==null?void 0:f.uuid)||""),icon:"pi pi-trash"})}),s=f=>o.jsx(o.Fragment,{children:o.jsx(wn,{value:f==null?void 0:f.answersText[r],onChange:h=>c("answersText",(f==null?void 0:f.uuid)||"",h.target.value)})}),l=(f,h)=>o.jsx(o.Fragment,{children:o.jsx(Yr,{inputId:"binary",checked:(f==null?void 0:f.isCorrect)||!1,onChange:g=>{g.checked&&i()||u("isCorrect",(f==null?void 0:f.uuid)||"",g.checked,h)}})}),c=(f,h,g)=>{n(v=>({...v,answerOptions:v!=null&&v.answerOptions?v==null?void 0:v.answerOptions.map(m=>m.uuid!==h?m:{...m,[f]:{...m[f],[r]:g}}):[]}))},u=(f,h,g,v)=>{n(m=>{const{answerOptions:A,isAllowMultipleAnswer:w,answerInputType:C}=m,S=v.rowIndex,T=A.map((x,E)=>{const _=E===S;return w||C==="checkbox"?_?{...x,[f]:g}:x:{...x,[f]:_?g:!1}});return{...m,answerOptions:T}})},d=f=>{const h=_t.findIndex(e==null?void 0:e.answerOptions,v=>v.uuid===f),g=(e==null?void 0:e.answerOptions)&&(e==null?void 0:e.answerOptions.filter(function(v,m){return m!==h}));g!=null&&g.length&&(g==null?void 0:g.length)>0&&n(v=>({...v,answerOptions:g}))};return o.jsx("div",{children:o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.answerOptions,scrollable:!0,children:[o.jsx(xr,{header:"Answer text",body:f=>s(f),headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}}),o.jsx(xr,{body:(f,h)=>l(f,h),header:"Is answer ?",headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}}),o.jsx(xr,{header:"Action",body:f=>a(f),headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}})]})})})},Yde=t=>{const e=[],[n]=k.useState([]),{onHandleChange:r,fieldState:i}=t;return k.useEffect(()=>{},[]),o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field mt-3 w-full",children:[o.jsx("label",{children:"Subject"}),o.jsx(Pa,{id:"subject",name:"subject",optionLabel:"subject_title",value:(n==null?void 0:n.length)>0&&(i==null?void 0:i.subject_id)!==null?n.filter(a=>(i==null?void 0:i.subject_id)===(a==null?void 0:a.subject_id))[0]:null,placeholder:"Select a Subject",options:n,className:"w-full",onChange:a=>{var s;r("subject_id",(s=a==null?void 0:a.value)==null?void 0:s.subject_id)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Course category"}),o.jsx(Pa,{id:"course_category",name:"course_category",optionLabel:"course_category_title",value:(e==null?void 0:e.length)>0&&(i==null?void 0:i.course_category_id)!==null?e.filter(a=>(i==null?void 0:i.course_category_id)===(a==null?void 0:a.course_category_id))[0]:null,placeholder:"Select a category",options:e,className:"w-full",onChange:a=>{var s;r("course_category_id",(s=a==null?void 0:a.value)==null?void 0:s.course_category_id)}})]})]})},Kde=t=>{const{formBuilderSchemaLanguages:e,fieldSettingUpdate:n}=sn(),{visibilty:r,setVisibility:i,rowIndex:a,columnIndex:s,fieldIndex:l,pageIndex:c,sectionIndex:u,field:d,typeName:f}=t,[h,g]=k.useState(d),{updateGlobalToast:v}=Ht(),m=(x,E)=>{g(_=>({..._,attributes:{..._.attributes,[x]:E}}))},A=(x,E,_)=>{g(M=>({...M,[x]:{[E]:_}}))},w=(x,E)=>{g(_=>({..._,[x]:E}))},C=()=>{const x=[],_=((h==null?void 0:h.answerOptions)||[]).filter(P=>P.isCorrect===!0),{answerInputType:M,isAllowMultipleAnswer:O,noOfMultpleAnswer:F}=h||{};if(M==="radio")_.length!==1&&x.push("Please select one answer");else if(M==="checkbox"){const P=O?parseInt(F,10)||0:1;_.length!==P&&x.push(P>1?`Select ${P} answers`:"Please select one answer")}return x.length?(v({showToast:!0,toastMessage:"Validation error",toastDetail:x.join(", "),toastType:"error"}),!1):!0},S=()=>{C()&&(n(c,u,a,s,l,h),v({showToast:!0,toastMessage:"Updated",toastDetail:`${f} updated`,toastType:"success"}))},T=()=>{g(x=>Object.assign({},x,{answerOptions:[...x.answerOptions||[],{uuid:rt(),answersText:{english:""},isCorrect:!1}]}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{visible:r,position:"left",className:"p-sidebar-lg",onHide:()=>i(!1),children:[o.jsx("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",{children:[t==null?void 0:t.typeName," settings"," "]})," "]})}),o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:e!=null&&e.length?e.map((x,E)=>o.jsx(io,{tabIndex:E,header:x==null?void 0:x.language,children:o.jsx($de,{language:x,fieldState:h,onHandleQuestionTextChange:A,...t})},E)):""})}),o.jsx(wr,{header:"Advance",children:o.jsx(jde,{fieldState:h,onHandleChangeAttributesSetttings:m,onHandleChange:w,...t})}),o.jsx(wr,{header:"Answers",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(zde,{fieldState:h,onHandleChange:w,...t}),o.jsxs("div",{className:"flex justify-content-between mb-2",children:[o.jsx("h4",{children:"Answers options"}),o.jsx(Ft,{className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>T(),"aria-label":"Add"})]}),(h==null?void 0:h.answerOptions)!==void 0&&o.jsx(o.Fragment,{children:o.jsx(ao,{activeIndex:0,children:e!=null&&e.length?e.map((x,E)=>o.jsx(io,{tabIndex:E,header:x==null?void 0:x.language,children:o.jsx(Hde,{language:x==null?void 0:x.type,fieldState:h,setFieldState:g})},E)):""})})]})}),o.jsx(wr,{header:"Information",children:o.jsx(Yde,{fieldState:h,onHandleChange:w})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>S(),"aria-label":"Update"}),o.jsx(Ft,{label:"Close",type:"button",onClick:()=>i(!1),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Xde=t=>{var O,F,P,H,N,z;const{isBuilderMode:e}=Ht(),{field:n}=t,{taskRegisterData:r,updateTaskRegisterData:i,updateTaskProgressValue:a,userTaskSubmitFormData:s}=Ar(),{userSelectedLanguage:l}=sn(),{media:c}=Ht(),u=(O=c==null?void 0:c.image)!=null&&O.MediaImage?(F=c==null?void 0:c.image)==null?void 0:F.MediaImage:o.jsx(o.Fragment,{}),[d,f]=k.useState(!1),[h,g]=k.useState([]),[v,m]=k.useState(!1),A=U=>{m(U)},w=()=>{m(!1)},C=()=>{f(!0)},S=()=>{f(!1)},T=U=>{var ue;const ce=_t.cloneDeep(r),X=[...h];U.checked?(ce[n==null?void 0:n.uuid]=(ue=U==null?void 0:U.target)==null?void 0:ue.value,X.push(U.value)):(delete ce[n==null?void 0:n.uuid],X.splice(X.indexOf(U.value),1)),g(X),x(U,X),i(ce);const R=Object.keys(ce).length;a(R)},x=(U,ce)=>{const X=s;if((X==null?void 0:X.length)>0&&U!=null&&U.value)for(const R of X)R.fieldId===t.field.uuid&&(R.postData[0]={postValue:ce})},E=U=>{var ue;const ce=s,X=_t.cloneDeep(r);if((ce==null?void 0:ce.length)>0)if((ue=U==null?void 0:U.target)!=null&&ue.value)for(const Y of ce)Y.fieldId===t.field.uuid&&(X[n==null?void 0:n.uuid]=U==null?void 0:U.value,Y.postData[0]={postValue:U.value});else delete X[n==null?void 0:n.uuid];i(X);const R=Object.keys(X).length;a(R)};k.useEffect(()=>{g([])},[n==null?void 0:n.answerInputType]);const _=()=>{const U=[];return(n==null?void 0:n.answerInputType)==="radio"?n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var ue,Y,ie,re;const R=h;U.push(o.jsxs("div",{className:"flex align-items-center p-field-radiobutton mb-3",children:[o.jsx(ia,{inputId:`${X}`,onChange:Z=>{g(Z.target.value),E(Z)},checked:(R==null?void 0:R.uuid)===(ce==null?void 0:ce.uuid),name:"category",value:ce})," ",((ue=ce.answersTextImage)==null?void 0:ue[l==null?void 0:l.type])&&((Y=ce.answersTextImage)==null?void 0:Y[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(ie=ce.answersTextImage)==null?void 0:ie[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),o.jsx("label",{htmlFor:`${X}`,children:(re=ce==null?void 0:ce.answersText)==null?void 0:re[l==null?void 0:l.type]})]},X))})):(n==null?void 0:n.answerInputType)==="checkbox"?n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var R;U.push(o.jsxs("div",{className:"p-field-radiobutton mb-3",children:[o.jsx(Yr,{inputId:`${X}`,name:"category",onChange:ue=>{T(ue)},value:ce,checked:h!=null&&h.length?h==null?void 0:h.some(ue=>ue.uuid===ce.uuid):!1})," ",o.jsx("label",{htmlFor:`${X}`,children:(R=ce==null?void 0:ce.answersText)==null?void 0:R[l==null?void 0:l.type]})]},X))})):n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var ue,Y,ie,re,Z,K,W;const R=h;U.push(o.jsxs("div",{className:"p-field-radiobutton mb-3",children:[o.jsx(ia,{inputId:`${X}`,onChange:ge=>{g(ge.target.value),E(ge)},checked:(R==null?void 0:R.uuid)===(ce==null?void 0:ce.uuid),name:"category",value:ce})," ",((ue=ce.answersTextImage)==null?void 0:ue[l==null?void 0:l.type])&&((Y=ce.answersTextImage)==null?void 0:Y[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(ie=ce.answersTextImage)==null?void 0:ie[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),o.jsxs("label",{htmlFor:`${X}`,children:[((re=ce.answersTextImage)==null?void 0:re[l==null?void 0:l.type])&&((Z=ce.answersTextImage)==null?void 0:Z[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(K=ce.answersTextImage)==null?void 0:K[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),(W=ce==null?void 0:ce.answersText)==null?void 0:W[l==null?void 0:l.type]]})]},X))})),U},M=o.jsxs("div",{onMouseOver:C,onMouseOut:S,children:[e&&d&&o.jsx(Wr,{handleFieldSettingsSidebar:A,...t}),o.jsx("div",{className:`field ${e&&" py-3 px-4 builder-element-wrapper "}${(n==null?void 0:n.isFluid)===!0&&" p-fluid"}`,children:o.jsx("div",{className:"grid",children:o.jsxs("div",{className:"col-12 p-fluid",children:[((P=n==null?void 0:n.questionTextImage)==null?void 0:P[l==null?void 0:l.type])&&((H=n==null?void 0:n.questionTextImage)==null?void 0:H[l==null?void 0:l.type])!==""&&o.jsx("div",{className:"text-center assessment_image_container",children:o.jsx(u,{mediaId:(N=n==null?void 0:n.questionTextImage)==null?void 0:N[l==null?void 0:l.type],style:{height:"100px",width:"100px",objectFit:"cover",borderRadius:100},className:"text-center",alt:"questionImage"})}),o.jsx("h5",{children:(z=n==null?void 0:n.questionText)==null?void 0:z[l==null?void 0:l.type]}),_()]})})})]});return o.jsxs(o.Fragment,{children:[v===!0&&o.jsx(Kde,{visibilty:v,setVisibility:w,...t},n==null?void 0:n.uuid),o.jsx(xi,{...t,fieldWrap:M})]})},Rde=t=>{var i,a;const{onHandleChange:e,fieldState:n,language:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Title"}),o.jsx(wn,{value:(i=n.title)==null?void 0:i[r==null?void 0:r.type],onChange:s=>e("title",r,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Image Url"}),o.jsx(wn,{value:(a=n.media_url)==null?void 0:a[r==null?void 0:r.type],onChange:s=>e("media_url",r,s.target.value)})]})]})};class RO{constructor(){Rn(this,"formatBytes",(e,n=2)=>{if(e===0||e===void 0||e===null)return"0 Bytes";const r=1024,i=n<0?0:n,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,s)).toFixed(i))+" "+a[s]})}}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 Gde(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 Wde(t){var e=Gde(t,"string");return b2(e)=="symbol"?e:e+""}function GO(t,e,n){return(e=Wde(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qde={root:function(e){var n=e.props;return ft("p-badge p-component",GO({"p-badge-no-gutter":ke.isNotEmpty(n.value)&&String(n.value).length===1,"p-badge-dot":ke.isEmpty(n.value),"p-badge-lg":n.size==="large","p-badge-xl":n.size==="xlarge"},"p-badge-".concat(n.severity),n.severity!==null))}},Jde=`
|
|
3515
3515
|
@layer primereact {
|
|
3516
3516
|
.p-badge {
|
|
3517
3517
|
display: inline-block;
|
|
@@ -52982,7 +52982,7 @@ const xle = (t) => {
|
|
|
52982
52982
|
...t
|
|
52983
52983
|
}
|
|
52984
52984
|
) }),
|
|
52985
|
-
!((ee = t == null ? void 0 : t.row) != null && ee.rowIsRepeatable) && (e == null ? void 0 : e.enableReviewTask) === !0 && /* @__PURE__ */ c(pr, { header: "Admin", children: /* @__PURE__ */ c(
|
|
52985
|
+
!((ee = t == null ? void 0 : t.row) != null && ee.rowIsRepeatable) && (e == null ? void 0 : e.enableReviewTask) === !0 && /* @__PURE__ */ c(pr, { header: "Admin reviewer checklist", children: /* @__PURE__ */ c(
|
|
52986
52986
|
sle,
|
|
52987
52987
|
{
|
|
52988
52988
|
fieldState: E,
|
|
@@ -60053,7 +60053,7 @@ var m0e = function() {
|
|
|
60053
60053
|
theme: i.theme,
|
|
60054
60054
|
formats: i.formats
|
|
60055
60055
|
};
|
|
60056
|
-
m0e ? w(new Quill(d.current, P)) : import("./quill-
|
|
60056
|
+
m0e ? w(new Quill(d.current, P)) : import("./quill-DNtDfqd0.js").then(function(z) {
|
|
60057
60057
|
if (z && Se.isExist(d.current)) {
|
|
60058
60058
|
var F;
|
|
60059
60059
|
z.default ? F = new z.default(d.current, P) : F = new z(d.current, P), w(F);
|
|
@@ -63359,7 +63359,7 @@ const k0e = (t) => {
|
|
|
63359
63359
|
pageSettingUpdate: T,
|
|
63360
63360
|
formBuilderFormLayout: w,
|
|
63361
63361
|
sectionSettingUpdate: E,
|
|
63362
|
-
|
|
63362
|
+
selectedLanguage: D
|
|
63363
63363
|
} = nn(), [R, N] = Me(!1), [k, P] = Me(null), [z, F] = Me(0), [q, $] = Me(!1), [le, Y] = Me(!1), K = () => {
|
|
63364
63364
|
Y(!0);
|
|
63365
63365
|
}, ce = () => {
|
|
@@ -63632,7 +63632,7 @@ const k0e = (t) => {
|
|
|
63632
63632
|
let ve = (ge = a[oe]) == null ? void 0 : ge.repeatableFields;
|
|
63633
63633
|
ve = {
|
|
63634
63634
|
...ve,
|
|
63635
|
-
[j == null ? void 0 : j.uuid]: he
|
|
63635
|
+
[j == null ? void 0 : j.uuid]: he == null ? void 0 : he.optionText[D]
|
|
63636
63636
|
}, ie[oe] = {
|
|
63637
63637
|
...ie[oe],
|
|
63638
63638
|
repeatableFields: ve
|
|
@@ -63689,7 +63689,7 @@ const k0e = (t) => {
|
|
|
63689
63689
|
readOnly: S || x
|
|
63690
63690
|
}
|
|
63691
63691
|
),
|
|
63692
|
-
((ve = ge == null ? void 0 : ge.hyperlinkText) == null ? void 0 : ve[D
|
|
63692
|
+
((ve = ge == null ? void 0 : ge.hyperlinkText) == null ? void 0 : ve[D]) === "" ? /* @__PURE__ */ _(
|
|
63693
63693
|
"label",
|
|
63694
63694
|
{
|
|
63695
63695
|
htmlFor: `radio-option-${ie}-${ge == null ? void 0 : ge.uuid}-${C ? "builder-label" : "preview"}`,
|
|
@@ -63701,17 +63701,17 @@ const k0e = (t) => {
|
|
|
63701
63701
|
] }) : "",
|
|
63702
63702
|
C ? /* @__PURE__ */ c(Ce, { children: /* @__PURE__ */ c(wP, { ...t, option: ge, optionIndex: ie }) }) : /* @__PURE__ */ _(Ce, { children: [
|
|
63703
63703
|
" ",
|
|
63704
|
-
(_e = ge == null ? void 0 : ge.optionText) == null ? void 0 : _e[D
|
|
63704
|
+
(_e = ge == null ? void 0 : ge.optionText) == null ? void 0 : _e[D]
|
|
63705
63705
|
] })
|
|
63706
63706
|
]
|
|
63707
63707
|
}
|
|
63708
63708
|
) : /* @__PURE__ */ c("label", { children: /* @__PURE__ */ c(
|
|
63709
63709
|
"a",
|
|
63710
63710
|
{
|
|
63711
|
-
href: (Pe = ge == null ? void 0 : ge.hyperlinkText) == null ? void 0 : Pe[D
|
|
63711
|
+
href: (Pe = ge == null ? void 0 : ge.hyperlinkText) == null ? void 0 : Pe[D],
|
|
63712
63712
|
target: "_blank",
|
|
63713
63713
|
rel: "noreferrer",
|
|
63714
|
-
children: (Ke = ge == null ? void 0 : ge.optionText) == null ? void 0 : Ke[D
|
|
63714
|
+
children: (Ke = ge == null ? void 0 : ge.optionText) == null ? void 0 : Ke[D]
|
|
63715
63715
|
}
|
|
63716
63716
|
) }),
|
|
63717
63717
|
C && /* @__PURE__ */ c("div", { className: "builder-radio-option-settings", children: /* @__PURE__ */ c(CP, { optionId: ge == null ? void 0 : ge.uuid, ...t }) })
|
|
@@ -63757,7 +63757,7 @@ const k0e = (t) => {
|
|
|
63757
63757
|
className: `field ${C && " py-3 px-4 builder-element-wrapper "}${(u == null ? void 0 : u.isFluid) === !0 && " p-fluid"}`,
|
|
63758
63758
|
children: /* @__PURE__ */ _("div", { className: "grid", children: [
|
|
63759
63759
|
/* @__PURE__ */ _("div", { className: "col-12", children: [
|
|
63760
|
-
(u == null ? void 0 : u.showHeaderText) && /* @__PURE__ */ c("h6", { children: (te = u == null ? void 0 : u.headerText) == null ? void 0 : te[D
|
|
63760
|
+
(u == null ? void 0 : u.showHeaderText) && /* @__PURE__ */ c("h6", { children: (te = u == null ? void 0 : u.headerText) == null ? void 0 : te[D] }),
|
|
63761
63761
|
(u == null ? void 0 : u.showLabel) && /* @__PURE__ */ _(
|
|
63762
63762
|
"label",
|
|
63763
63763
|
{
|
|
@@ -63767,11 +63767,11 @@ const k0e = (t) => {
|
|
|
63767
63767
|
/* @__PURE__ */ c(zi, { ...t }),
|
|
63768
63768
|
((B = u == null ? void 0 : u.attributes) == null ? void 0 : B.required) && /* @__PURE__ */ c("span", { className: "must-required mr-1", children: "*" }),
|
|
63769
63769
|
" ",
|
|
63770
|
-
C ? /* @__PURE__ */ c(ji, { ...t }) : /* @__PURE__ */ c(Ce, { children: (Z = u == null ? void 0 : u.label) == null ? void 0 : Z[D
|
|
63770
|
+
C ? /* @__PURE__ */ c(ji, { ...t }) : /* @__PURE__ */ c(Ce, { children: (Z = u == null ? void 0 : u.label) == null ? void 0 : Z[D] }),
|
|
63771
63771
|
/* @__PURE__ */ c("span", { className: "ml-3", children: u != null && u.showToolTip ? /* @__PURE__ */ c(Ce, { children: /* @__PURE__ */ c(
|
|
63772
63772
|
Ti,
|
|
63773
63773
|
{
|
|
63774
|
-
message: (se = u == null ? void 0 : u.toolTip) == null ? void 0 : se[D
|
|
63774
|
+
message: (se = u == null ? void 0 : u.toolTip) == null ? void 0 : se[D],
|
|
63775
63775
|
position: "right"
|
|
63776
63776
|
}
|
|
63777
63777
|
) }) : "" })
|
|
@@ -63783,7 +63783,7 @@ const k0e = (t) => {
|
|
|
63783
63783
|
" "
|
|
63784
63784
|
] }) : Ie(),
|
|
63785
63785
|
/* @__PURE__ */ c("div", { children: ((fe = u == null ? void 0 : u.attributes) == null ? void 0 : fe.required) && /* @__PURE__ */ c("small", { className: "error", children: z === 1 && k !== null ? (De = u == null ? void 0 : u.validationMesssage) == null ? void 0 : De.language : "" }) }),
|
|
63786
|
-
/* @__PURE__ */ c("div", { children: (u == null ? void 0 : u.showHelperText) && /* @__PURE__ */ c("small", { children: (Oe = u == null ? void 0 : u.helperText) == null ? void 0 : Oe[D
|
|
63786
|
+
/* @__PURE__ */ c("div", { children: (u == null ? void 0 : u.showHelperText) && /* @__PURE__ */ c("small", { children: (Oe = u == null ? void 0 : u.helperText) == null ? void 0 : Oe[D] }) }),
|
|
63787
63787
|
((me = u == null ? void 0 : u.inlineConditionalRules) == null ? void 0 : me.rules.length) > 0 && C === !0 && /* @__PURE__ */ c("p", { children: "Inline conditional rules" }),
|
|
63788
63788
|
q === !0 && ((Le = (xe = u == null ? void 0 : u.inlineConditionalRules) == null ? void 0 : xe.rules) == null ? void 0 : Le.length) > 0 && ((Te = u == null ? void 0 : u.inlineConditionalRules) == null ? void 0 : Te.rules.map(
|
|
63789
63789
|
(j, he) => {
|
|
@@ -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-
|
|
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-Bm6KEtyk.js";
|
|
5
5
|
function Ki(n) {
|
|
6
6
|
return n;
|
|
7
7
|
}
|