cft-builder 0.2.139 → 0.2.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-DIbjtdit.js";
1
+ import { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-Bmz4AfP2.js";
2
2
  export {
3
3
  s as BuilderItems,
4
4
  o as BuilderItemsRender,
@@ -2390,7 +2390,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2390
2390
  }
2391
2391
  }
2392
2392
  `}}),di=b.forwardRef(function(t,e){var n=Rn(),r=b.useContext(or),i=G3.getProps(t,r),a=b.useState(i.id),s=EO(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=EO(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",S=l+"_content",T=G3.setMetaData({props:i,state:{id:l,collapsed:m}}),C=T.ptm,x=T.cx,w=T.isUnstyled;ui(G3.css.styles,w,{name:"panel"});var I=function(ne){i.toggleable&&(m?_(ne):N(ne),ne&&(i.onToggle&&i.onToggle({originalEvent:ne,value:!m}),ne.preventDefault()))},_=function(ne){i.onToggle||h(!1),i.onExpand&&ne&&i.onExpand(ne)},N=function(ne){i.onToggle||h(!0),i.onCollapse&&ne&&i.onCollapse(ne)};b.useImperativeHandle(e,function(){return{props:i,toggle:I,expand:_,collapse:N,getElement:function(){return g.current},getContent:function(){return v.current}}}),Bi(function(){l||c(Io())});var O=function(){if(i.toggleable){var ne=l+"_label",he=n({className:x("toggler"),onClick:I,id:ne,"aria-controls":S,"aria-expanded":!m,type:"button",role:"button","aria-label":i.header},C("toggler")),q=n(C("togglericon")),W=m?i.expandIcon||b.createElement(e3,q):i.collapseIcon||b.createElement(F8,q),Q=ir.getJSXIcon(W,q,{props:i,collapsed:m});return b.createElement("button",he,Q,b.createElement(tn,null))}return null},k=function(){var ne=Pe.getJSXElement(i.header,i),he=Pe.getJSXElement(i.icons,i),q=O(),W=n({id:A,className:x("title")},C("title")),Q=b.createElement("span",W,ne),Z=n({className:x("icons")},C("icons")),H=b.createElement("div",Z,he,q),Y=n({className:x("header")},C("header")),oe=b.createElement("div",Y,Q,H);if(i.headerTemplate){var be={className:"p-panel-header",titleClassName:"p-panel-title",iconsClassName:"p-panel-icons",togglerClassName:"p-panel-header-icon p-panel-toggler p-link",onTogglerClick:I,titleElement:Q,iconsElement:H,togglerElement:q,element:oe,id:l+"_header",props:i,collapsed:m};return Pe.getJSXElement(i.headerTemplate,be)}else if(i.header||i.toggleable)return oe;return null},M=function(){var ne=Pe.getJSXElement(i.footer,i),he=n({className:x("footer")},C("footer")),q=b.createElement("div",he,ne);if(i.footerTemplate){var W={className:x("footer"),element:q,props:i};return Pe.getJSXElement(i.footerTemplate,W)}else if(i.footer)return q;return null},j=function(){var ne=n({ref:v,className:x("toggleableContent"),"aria-hidden":m,role:"region",id:S,"aria-labelledby":A},C("toggleablecontent")),he=n({className:x("content")},C("content")),q=n({classNames:x("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},C("transition"));return b.createElement(Zo,ab({nodeRef:v},q),b.createElement("div",ne,b.createElement("div",he,i.children)))},P=n({id:l,ref:g,style:i.style,className:ht(i.className,x("root"))},G3.getOtherProps(i),C("root")),$=k(),K=j(),ce=M();return b.createElement("div",P,$,K,ce)});di.displayName="Panel";const ile=t=>{var v;const{fieldState:e,setFieldState:n,pageIndex:r,formBuilderFormLayout:i,pageSettingUpdate:a}=t,s=(m,A)=>{const S=`${m.className} justify-content-start`,T=`${m.titleClassName} pl-1`;return o.jsxs("div",{className:S,children:[o.jsx(Vt,{text:!0,icon:"pi pi-trash",className:m.togglerClassName,onClick:()=>c(A),"aria-label":"Submit"}),o.jsx("span",{className:T,children:`Rule ${A+1}`})]})},l=(m,A)=>{var T;const S=[...((T=e==null?void 0:e.conditionalTabRules)==null?void 0:T.rules)||[]];S[m].conditions=S[m].conditions.filter((C,x)=>A!==x),n(C=>({...C,conditionalTabRules:{...C.conditionalTabRules,rules:S}}))},c=m=>{var C;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],S=A.filter((x,w)=>m!==w);n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:S}}));const T=A[m];(C=T==null?void 0:T.conditions)==null||C.map(x=>{const w=i?Et.findIndex(i,_=>{var N;return(_==null?void 0:_.uuid)===((N=x==null?void 0:x.tab)==null?void 0:N.uuid)}):-1,I=i[w];I&&(I.isHidden=!1,a(w,I))})};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,S)=>{const T=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];T[A].conditions[S].option=m==null?void 0:m.value,n(C=>({...C,conditionalTabRules:{...C.conditionalTabRules,rules:T}}))},f=(m,A,S)=>{const T=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];T[A].conditions[S].tab=m==null?void 0:m.value,n(w=>({...w,conditionalTabRules:{...w.conditionalTabRules,rules:T}}));const C=Et.findIndex(i,w=>{var I;return(w==null?void 0:w.uuid)===((I=m==null?void 0:m.value)==null?void 0:I.uuid)}),x=i[C];x&&(x.isHidden=!0,a(C,x))},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(S=>({...S,conditionalTabRules:{...S.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(di,{className:"mb-3",header:`Rule ${A+1}`,headerTemplate:S=>s(S,A),children:o.jsxs("div",{children:[m==null?void 0:m.conditions.map((S,T)=>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",S.value]})}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Va,{value:S.tab,options:u,onChange:C=>f(C,A,T),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(Va,{value:S==null?void 0:S.option,options:e==null?void 0:e.options,onChange:C=>d(C,A,T),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Vt,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>l(A,T),tooltipOptions:{position:"top"}})})]})},T)),o.jsx(Vt,{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(Vt,{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"})]})},ale=t=>{var C;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:a,page:s}=t,[l]=F.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=on(),d=(x,w)=>{const I=`${x.className} justify-content-start`,_=`${x.titleClassName} pl-1`;return o.jsxs("div",{className:I,children:[o.jsx(Vt,{text:!0,icon:"pi pi-trash",className:x.togglerClassName,onClick:()=>f(w),"aria-label":"Submit"}),o.jsx("span",{className:_,children:`Rule ${w+1}`})]})},f=x=>{var N;const w=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],I=w[x];(N=I==null?void 0:I.conditions)==null||N.map(O=>{var j;const k=Et.findIndex(i,P=>{var $;return(P==null?void 0:P.uuid)===(($=O==null?void 0:O.tab)==null?void 0:$.uuid)}),M=i?Et.findIndex(i[k].children,P=>{var $;return(P==null?void 0:P.uuid)===(($=O==null?void 0:O.section)==null?void 0:$.uuid)}):-1;if(M>=0){const P=(j=i[k])==null?void 0:j.children[M];P&&(P.isHidden=!1,a(k,M,P))}});const _=w.filter((O,k)=>x!==k);n(O=>({...O,conditionalSectionRules:{...O.conditionalSectionRules,rules:_}}))},h=x=>{var _;let w=!1;const I=i?i.filter(function(N){return(N==null?void 0:N.uuid)===(x==null?void 0:x.uuid)}):[];return(I==null?void 0:I.length)>0&&((_=I[0].children)==null?void 0:_.length)>1&&(w=!0),w},g=(x,w,I)=>{const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[w].conditions[I].option=x==null?void 0:x.value,n(N=>({...N,conditionalSectionRules:{...N.conditionalSectionRules,rules:_}}))},v=(x,w)=>{var N;const I=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=I[x];(N=_==null?void 0:_.conditions)==null||N.map(O=>{var P;const k=Et.findIndex(i,$=>{var K;return($==null?void 0:$.uuid)===((K=O==null?void 0:O.tab)==null?void 0:K.uuid)}),M=i?Et.findIndex(i[k].children,$=>{var K;return($==null?void 0:$.uuid)===((K=O==null?void 0:O.section)==null?void 0:K.uuid)}):-1,j=(P=i[k])==null?void 0:P.children[M];console.log("sectionData",j),j&&(j.isHidden=!1,console.log("sectionData",j),a(k,M,j))}),I[x].conditions=I[x].conditions.filter((O,k)=>w!==k),n(O=>({...O,conditionalSectionRules:{...O.conditionalSectionRules,rules:I}}))},m=(x,w,I)=>{var j,P;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[w].conditions[I].section=x==null?void 0:x.value;const N=(P=(j=_[w].conditions[I])==null?void 0:j.tab)==null?void 0:P.uuid,O=Et.findIndex(i,$=>($==null?void 0:$.uuid)===N);n($=>({...$,conditionalSectionRules:{...$.conditionalSectionRules,rules:_}}));const k=i?Et.findIndex(i[O].children,$=>{var K;return($==null?void 0:$.uuid)===((K=x==null?void 0:x.value)==null?void 0:K.uuid)}):-1,M=i[O].children[k];M&&(M.isHidden=!0,a(O,k,M))},A=x=>{const w=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];w[x].conditions=[...w[x].conditions,{option:null,tab:{title:s==null?void 0:s.title,uuid:s==null?void 0:s.uuid},section:null}],n(I=>({...I,conditionalSectionRules:{...I.conditionalSectionRules,rules:w}}))},S=()=>{n(w=>({...w,conditionalSectionRules:{...w.conditionalSectionRules,rules:[...w.conditionalSectionRules.rules,{uuid:tt(),conditions:[]}]}}));const x=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...x,{fieldId:e==null?void 0:e.uuid,uuid:tt(),conditions:[]}]})},T=x=>{var I;const w=i==null?void 0:i.filter(function(_){return(_==null?void 0:_.uuid)===(x==null?void 0:x.uuid)});if(w&&(w==null?void 0:w.length)>0){const _=(I=w[0])==null?void 0:I.children.filter(function(N){return(N==null?void 0:N.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"}),(C=e==null?void 0:e.conditionalSectionRules)==null?void 0:C.rules.map((x,w)=>o.jsx(di,{className:"mb-3",header:`Rule ${w+1}`,headerTemplate:I=>d(I,w),children:o.jsxs("div",{children:[x==null?void 0:x.conditions.map((I,_)=>{var N,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=(N=I==null?void 0:I.tab)==null?void 0:N.title)==null?void 0:O.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",I.value]}),o.jsx(Va,{disabled:!h(I==null?void 0:I.tab),value:I.section,options:T(I.tab),onChange:k=>m(k,w,_),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Va,{disabled:!h(I==null?void 0:I.tab),value:I==null?void 0:I.option,options:e==null?void 0:e.options,onChange:k=>g(k,w,_),optionLabel:"optionText.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-1",children:[o.jsx("br",{}),o.jsx(Vt,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>v(w,_),tooltipOptions:{position:"top"}})]}),!h(I.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(Vt,{text:!0,className:"btn-sm mt-3 ",label:"+ Add Condition",onClick:()=>A(w),size:"small"})})})]})},w)),o.jsx(Vt,{text:!0,icon:"pi pi-plus",onClick:()=>S(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},sle=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(Vt,{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(di,{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(Va,{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(Vt,{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(Vt,{text:!0,onClick:()=>l(f),className:"p-mt-4",icon:"pi pi-plus",label:"Add Condition",size:"small"})]})},f)),o.jsx(Vt,{text:!0,onClick:()=>c(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"})]})},ole=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:a}=t,{pageSettingUpdate:s,formBuilderFormLayout:l,sectionSettingUpdate:c}=on();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(sle,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(ile,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:s}),o.jsx("hr",{}),o.jsx(ale,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:a}),o.jsx("hr",{})]})})},lle=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=F.useState(""),[a,s]=F.useState([""]),[l,c]=F.useState(!1),[u,d]=F.useState(0),[f,h]=F.useState(!1),{updateGlobalToast:g}=Wt(),v=()=>{h(!0)},m=()=>{var $;const j=(($=e==null?void 0:e.reviewerChecklist)==null?void 0:$.length)>=0?[...e.reviewerChecklist]:[];j.push({uuid:tt(),checklist:r,action:a,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const P={...e,reviewerChecklist:j};n(K=>({...K,...P})),h(!1),i(""),s([""])},A=()=>{h(!1),i(""),s([""])},S=j=>{const P=[...e.reviewerChecklist];P.splice(j,1);const $={...e,reviewerChecklist:P};n(K=>({...K,...$}))},T=(j,P)=>{c(!0);const{checklist:$,action:K}=j;h(!0),d(P),setTimeout(()=>{i($),s(K)},1e3)},C=(j,P)=>o.jsxs(o.Fragment,{children:[o.jsx(Vt,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>T(j,P==null?void 0:P.rowIndex)}),o.jsx(Vt,{text:!0,type:"button",className:"p-button-danger",icon:"pi pi-trash",onClick:()=>S(P==null?void 0:P.rowIndex)})]}),x=j=>{var P;return o.jsx(o.Fragment,{children:(P=j==null?void 0:j.action)==null?void 0:P.length})},w=j=>{const P=[...a];P.splice(j,1),s(P)},I=()=>{const j=[...e.reviewerChecklist];j[u]={checklist:r,action:a};const P={...e,reviewerChecklist:j};n($=>({...$,...P})),h(!1),c(!1)},_=()=>o.jsx("div",{children:l?o.jsx(Vt,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{I()}}):o.jsx(Vt,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{m()}})}),N=j=>{n(P=>({...P,reviewerChecklist:j==null?void 0:j.value}))},O=j=>{navigator.clipboard.writeText(JSON.stringify(j))};function k(j){try{JSON.parse(j)}catch{return!1}return!0}const M=async()=>{var $;const j=await navigator.clipboard.readText();let P="";if(k(j)){const K=JSON.parse(j);if(($=K[0])!=null&&$.checklist){const ce={...Et.cloneDeep(e),reviewerChecklist:K};n(X=>({...X,...ce}));return}else P="Empty or Invalid Schema"}else P="Invalid Schema";g({showToast:!0,toastMessage:P,toastDetail:"",toastType:"error"})};return o.jsxs("div",{children:[o.jsx(Gs,{maximizable:!0,header:"Add Checklist",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:_(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(fo,{rows:2,cols:50,value:r,onChange:j=>{var P;i((P=j==null?void 0:j.target)==null?void 0:P.value)}}),o.jsx("h5",{children:"Actions when user selects No"}),a.map((j,P)=>o.jsxs("div",{children:[P+1,"."," ",o.jsx(fo,{value:j,onChange:$=>{var ce;const K=[...a];K[P]=(ce=$==null?void 0:$.target)==null?void 0:ce.value,s(K)},rows:2,cols:50})," ",o.jsx(Vt,{text:!0,type:"button",icon:"pi pi-trash",className:"p-button-danger",onClick:()=>w(P)}),o.jsx("br",{}),o.jsx("br",{})]},`actionIndex-${P}`)),o.jsx(Vt,{text:!0,className:" p-button-info mr-2",onClick:()=>{s([...a,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx(Vt,{text:!0,className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{v()}}),o.jsx(Vt,{text:!0,label:"Copy Schema ",onClick:()=>{O([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx(Vt,{text:!0,label:"Paste Checklist ",onClick:()=>{M()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(lo,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:N,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:j=>x(j)}),o.jsx(xr,{header:"",body:(j,P)=>C(j,P)})]})})]})},cle=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Kr,{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(dn,{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(Kr,{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(dn,{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(Kr,{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(dn,{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(Kr,{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(dn,{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(Kr,{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(dn,{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(Kr,{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(dn,{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(Kr,{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(dn,{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}})]})]})},ule=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=on(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:tt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},a=f=>{n(h=>({...h,fieldType:{...h==null?void 0:h.fieldType,type:f}}))},s=(f,h)=>{n(g=>({...g,[f]:h}))},l=[{label:"Employee",api:"/employees/list",availableId:["user_id","employee_id"],optionValue:"employee_id",optionLabel:"first_name"},{label:"Departments",api:"/department/",availableId:["department_id"],optionValue:"department_id",optionLabel:"department_name"}];return o.jsxs("div",{className:"p-fluid",children:[o.jsx("h4",{children:"Render Type"}),o.jsxs("div",{className:"flex flex-wrap gap-3 my-2",children:[o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(oa,{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(oa,{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(oa,{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(oa,{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(Va,{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(Va,{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(uo,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(co,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(xO,{enableCopyPaste:!0,isCustomValue:!0,fieldState:e,setFieldState:n,language:f})},h)):""})}),o.jsx(Vt,{text:!0,className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>i(),"aria-label":"Add"})]})})]})},dle=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t,{userSelectedLanguage:s}=on(),l=[{type:"radio",label:"Radio"},{type:"text",label:"Input Text"},{type:"text-area",label:"Text Area"},{type:"date",label:"Date Field"}],c=(f,h)=>{var g;return o.jsxs("div",{onClick:f.onClick,className:f.className,children:[o.jsx("span",{children:f.titleElement}),e.children&&((g=e.children)==null?void 0:g.length)>1&&o.jsx(Vt,{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(Kr,{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(Vt,{text:!0,label:"Add Field",onClick:()=>{i(e==null?void 0:e.uuid)}}),o.jsx(as,{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(Sr,{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(oa,{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(Kr,{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(as,{children:[o.jsx(Sr,{header:"Text",children:o.jsx(di,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(pN,{language:s,fieldState:f,onHandleChange:(m,A,S)=>{r(f==null?void 0:f.uuid,{[m]:{[A==null?void 0:A.type]:S}})}})})})}),(f==null?void 0:f.type)==="radio"&&o.jsx(Sr,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(sb,{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}`)}))})]})]})},sb=t=>{var s,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t;return o.jsx(o.Fragment,{children:o.jsx(as,{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(Sr,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(dle,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})},`hirarchey-option-${u}`)))})})};var IO={},fle=ki&&ki.__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)}}(),W3=ki&&ki.__assign||function(){return W3=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},W3.apply(this,arguments)},hle=ki&&ki.__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]}),ple=ki&&ki.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_O=ki&&ki.__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)&&hle(e,t,n);return ple(e,t),e},gle=ki&&ki.__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},mle=ki&&ki.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(IO,"__esModule",{value:!0});var ob=_O(F),vle=mle(H_),ld=_O(da);function DO(t){return t&&t.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function ble(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 yle=function(t){fle(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}:ob.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=gle(r,["tagName","html","innerRef"]);return ob.createElement(i||"div",W3(W3({},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||DO(n.html)!==DO(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,vle.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,ble(n))},e.propTypes={html:ld.string.isRequired,onChange:ld.func,disabled:ld.bool,tagName:ld.string,className:ld.string,style:ld.object,innerRef:ld.oneOfType([ld.object,ld.func])},e}(ob.Component),Q3=IO.default=yle;const Ale=t=>{var S;const e=F.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,path:c}=t,[u,d]=F.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=on(),m=(T,C,x)=>{d(w=>({...w,[T]:{...w[T],[C==null?void 0:C.type]:x}}))};F.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const T=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(T[ga],T[ma],T[Ia],T[_a],T[Da],T[La],T[Jo],T[Eo],u):(T==null?void 0:T.length)>La&&(T==null?void 0:T.length)===Kl+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(T[ga],T[ma],T[Ia],T[_a],T[Da],T[5],T[6],T[7],u):h(i,a,s,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(Q3,{style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:(S=n==null?void 0:n.label)==null?void 0:S[f==null?void 0:f.type],disabled:!1,onChange:T=>{var C;m("label",f,(C=T==null?void 0:T.target)==null?void 0:C.value)},tagName:"article"})})},fa=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=on();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(f7,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},lb=t=>{var d,f,h,g,v,m,A,S,T,C,x,w,I,_;const{field:e,update:n,value:r,isFirst:i,isDisabled:a}=t,{isPreview:s}=Wt(),{userSelectedLanguage:l}=on(),[c,u]=F.useState(0);return F.useEffect(()=>{const N=Qt.addListener("onSubmitUserForm",()=>{var k;(k=e==null?void 0:e.attributes)!=null&&k.required?r!=null&&r[e.uuid]?e.isValid=1:e.isValid=0:e.isValid=1}),O=Qt.addListener("OnInvalidFieldCatch",k=>{(e==null?void 0:e.uuid)===(k==null?void 0:k.fieldId)?u(1):u(0)});return()=>{N.remove(),O.remove()}}),o.jsxs("div",{className:"ml-3 p-2",children:[(e==null?void 0:e.type)==="radio"&&o.jsxs(o.Fragment,{children:[o.jsxs("h5",{children:[" ",i===!0&&o.jsx(fa,{...t}),((d=e==null?void 0:e.attributes)==null?void 0:d.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",s?o.jsx(o.Fragment,{children:(f=e==null?void 0:e.label)==null?void 0:f[l==null?void 0:l.type]}):o.jsx(Ale,{...t})]}),((h=e==null?void 0:e.options)==null?void 0:h.length)&&((g=e==null?void 0:e.options)==null?void 0:g.map(N=>{var O,k;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(oa,{inputId:N.uuid,name:e==null?void 0:e.uuid,value:N.uuid,onChange:M=>n(e==null?void 0:e.uuid,M==null?void 0:M.value),checked:(r==null?void 0:r[e.uuid])===N.uuid,disabled:a}),o.jsx("label",{htmlFor:N.uuid,className:"ml-2",children:N.label})]}),(N==null?void 0:N.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(N==null?void 0:N.uuid)&&(N==null?void 0:N.children)&&((O=N==null?void 0:N.children)==null?void 0:O.length)>0&&((k=N==null?void 0:N.children)==null?void 0:k.map(()=>o.jsx(lb,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${N.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)==="text"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(wn,{className:"mt-2",onChange:N=>{var O;return n(e==null?void 0:e.uuid,(O=N==null?void 0:N.target)==null?void 0:O.value)},value:r==null?void 0:r.uuid,placeholder:(m=e==null?void 0:e.placeholder)==null?void 0:m[l==null?void 0:l.type]})]})}),(e==null?void 0:e.type)==="date"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((A=e==null?void 0:e.attributes)==null?void 0:A.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(gf,{className:"mt-2",onChange:N=>{var O;return n(e==null?void 0:e.uuid,(O=N==null?void 0:N.target)==null?void 0:O.value)},value:r==null?void 0:r.uuid,placeholder:(S=e==null?void 0:e.placeholder)==null?void 0:S[l==null?void 0:l.type]})]})}),(e==null?void 0:e.type)==="text-area"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((T=e==null?void 0:e.attributes)==null?void 0:T.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(fo,{className:"mt-2",onChange:N=>{var O;return n(e==null?void 0:e.uuid,(O=N==null?void 0:N.target)==null?void 0:O.value)},value:r==null?void 0:r.uuid,placeholder:(C=e==null?void 0:e.placeholder)==null?void 0:C[l==null?void 0:l.type]})]})}),o.jsx("div",{children:((x=e==null?void 0:e.helperText)==null?void 0:x[l==null?void 0:l.type])!==""&&o.jsx("small",{children:(w=e==null?void 0:e.helperText)==null?void 0:w[l==null?void 0:l.type]})}),o.jsx("div",{children:((I=e==null?void 0:e.attributes)==null?void 0:I.required)&&o.jsx("small",{className:"error",children:c===1&&!(r!=null&&r[e.uuid])?(_=e==null?void 0:e.validationMesssage)==null?void 0:_.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},wle=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=F.useState({});return o.jsx("div",{children:o.jsx(lb,{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:""})})},cb={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},Sle={uuid:tt(),...cb,type:"radio",value:null,options:[{uuid:tt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:tt(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:tt(),...cb,options:(tt(),{uuid:tt(),...cb,options:(tt(),tt())},tt())});const Cle=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,{...Sle,isValid:0,uuid:tt(),options:[{uuid:tt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:tt(),label:"No",value:null,enableConditionalField:!0,children:[]}],isPostField:!1,showAlphabetList:!1,showButtonLayout:!1,answerOptions:[],isExternalSource:!1,underLined:!1,noOfMultpleAnswer:void 0,isAllowMultipleAnswer:!1,isIcon:!1,isTodayBtn:!1,resizableColumns:!1,isFilterable:!1,freezeColumn:!1,colToggle:!1,isFieldAnFilterOption:!1,isSortable:!1,reorderableColumns:!1,timeLimit:0,score:0,subject_id:0,course_category_id:0,TextEditorProps:!1,fieldData:void 0},e.options);n(g=>({...g,options:h}))},d=f=>{const h=l(f,e.options);n(g=>({...g,options:h}))};return o.jsx("div",{children:o.jsx("div",{className:" px-4",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-6 scroll-height-200",children:(e==null?void 0:e.isHierarchalCondionalTabEnabled)===!0&&o.jsx(sb,{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(wle,{hirarechicalRadioSchemaState:e})]})]})})})},ea=t=>{var Q,Z;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:a,formBuilderFormLayout:s,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=on(),{renderType:u}=Wt(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:v,rowIndex:m,columnIndex:A,fieldIndex:S,path:T,row:C}=t,{updateGlobalToast:x}=Wt(),[w,I]=F.useState(f),_=T.split("-"),N=()=>{const H=T.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(H[ga],H[ma],H[Ia],H[_a],H[Da],H[La],H[Jo],H[Eo],w):(H==null?void 0:H.length)>La&&(H==null?void 0:H.length)===Kl+1&&(w!=null&&w.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(H[ga],H[ma],H[Ia],H[_a],H[Da],H[5],H[6],H[7],w):(n(g,v,m,A,S,w),setTimeout(()=>{Qt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Qt.emit("onUpdateField",{})},1e3)),x({showToast:!0,toastMessage:"Updated",toastDetail:"Field updated",toastType:"success"})},O=(H,Y,oe)=>{I(be=>({...be,[H]:{...be[H],[Y==null?void 0:Y.type]:oe}}))},k=(H,Y)=>{I(oe=>({...oe,attributes:{...oe.attributes,[H]:Y}}))},M=(H,Y)=>{I(oe=>({...oe,[H]:Y}))},j=(H,Y)=>{I(oe=>({...oe,inlineConditional:{...oe.inlineConditional,[H]:Y}}))},P=()=>{},$=()=>{I(H=>({...H,data:[...H.data,{uuid:tt(),dataKey:"",value:""}]}))},K=()=>{I(H=>Object.assign({},H,{options:[...H.options,{uuid:tt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},ce=()=>{},X=()=>{},ne=()=>{},he=()=>{},q=H=>{var Ce;const Y=[...(w==null?void 0:w.conditionalTabRules.rules)||[]],oe=Y.filter((ve,ye)=>H!==ye);I(ve=>({...ve,conditionalTabRules:{...ve.conditionalTabRules,rules:oe}}));const be=Y[H];(Ce=be==null?void 0:be.conditions)==null||Ce.map(ve=>{const ye=Et.findIndex(s,L=>{var le;return(L==null?void 0:L.uuid)===((le=ve==null?void 0:ve.tab)==null?void 0:le.uuid)}),te=s[ye];te&&(te.isHidden=!1,a(ye,te))})},W=(H,Y)=>{const oe=[...(w==null?void 0:w.conditionalTabRules.rules)||[]];oe[H].conditions=oe[H].conditions.filter((be,Ce)=>Y!==Ce),I(be=>({...be,conditionalTabRules:{...be.conditionalTabRules,rules:oe}}))};return o.jsx(o.Fragment,{children:o.jsxs(No,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[(Q=f==null?void 0:f.label)==null?void 0:Q.english," "]})]}),!l&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx(Vt,{className:"mt-3",label:"Update",type:"button",onClick:()=>N(),"aria-label":"Update"})})]}),o.jsx("div",{className:" mt-4",children:o.jsxs(as,{children:[o.jsx(Sr,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(uo,{activeIndex:0,children:i!=null&&i.length?i.map((H,Y)=>o.jsx(co,{tabIndex:Y,header:H==null?void 0:H.language,children:o.jsx(pN,{language:H,fieldState:w,onHandleChange:O,...t})},Y)):""})})}),(w==null?void 0:w.isValidationTabEnabled)===!0&&o.jsx(Sr,{header:"Validation",children:o.jsx(_re,{fieldState:w,onHandleChangeLayoutSettings:M,onHandleChangeAttributesSetttings:k,...t})}),o.jsx(Sr,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Dre,{fieldState:w,onHandleChangeLayoutSettings:M,onHandleChangeAttributesSetttings:k})})}),(w==null?void 0:w.isLayoutTabEnabled)===!0&&o.jsx(Sr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx($re,{fieldState:w,onHandleChangeLayoutSettings:M})})}),(w==null?void 0:w.isDynamicListingTabEnabled)===!0&&o.jsx(Sr,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(ule,{fieldState:w,setFieldState:I})})}),(w==null?void 0:w.options)!==void 0&&(w==null?void 0:w.data)&&o.jsx(Sr,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(jre,{onHandleChangeLayoutSettings:M,fieldState:w,setFieldState:I}),o.jsx(Vt,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>$(),"aria-label":"Add"})]})}),o.jsx(Sr,{header:"Table view options",children:o.jsx(cle,{fieldState:w,onHandleChangeLayoutSettings:M})}),(w==null?void 0:w.componentType)!=="radio-hierarchal"&&(w==null?void 0:w.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(Sr,{header:"Options",children:[(w==null?void 0:w.componentType)!=="radio-hierarchal"&&o.jsx("div",{className:"flex justify-content-end",children:o.jsx(Vt,{className:"mr-3 mb-2",label:"Option",icon:"pi pi-plus",onClick:()=>K(),"aria-label":"Option"})}),o.jsxs("div",{className:"scroll-height-200 px-4",children:[o.jsx(uo,{activeIndex:0,children:i!=null&&i.length?i.map((H,Y)=>o.jsx(co,{tabIndex:Y,header:H==null?void 0:H.language,children:o.jsx(xO,{enableAbbreviationColumn:(w==null?void 0:w.componentType)!=="radio-hierarchal",enableHyperTextColumn:(w==null?void 0:w.componentType)!=="radio-hierarchal",enableAddNewColumn:(w==null?void 0:w.componentType)!=="radio-hierarchal",enableCopyPaste:(w==null?void 0:w.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:w,setFieldState:I,language:H})},Y)):""}),(w==null?void 0:w.isHierarchalCondionalTabEnabled)===!0&&o.jsx(sb,{fieldState:w,onHandleChangeLayoutSettings:M,removeChildrenField:he,addChildrenField:ne,updateChildrenField:X,updateCondtionOption:ce})]})]}),(w==null?void 0:w.componentType)==="radio-hierarchal"&&(w==null?void 0:w.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(Sr,{header:"Hierarchal Options",children:o.jsx(Cle,{fieldState:w,setFieldState:I})}),u===S3&&(w==null?void 0:w.inlineConditionalRules)!==void 0&&!(C!=null&&C.rowIsRepeatable)&&(_==null?void 0:_.length)<Eo+1&&o.jsx(Sr,{header:"Conditional",children:o.jsx(ole,{handleRemoveConditionalTabRule:q,handleRemoveConditionalTabRuleCondition:W,onHandleSelectInlineConditionalOption:P,onHandleChangeLayoutSettings:M,onHandleChangeInlineConditionaltSetttings:j,fieldState:w,setFieldState:I,pageIndex:g,sectionIndex:v,...t})}),!((Z=t==null?void 0:t.row)!=null&&Z.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(Sr,{header:"Admin",children:o.jsx(lle,{fieldState:w,setFieldState:I})})]})})]})})},Pi=t=>{const[e,n]=F.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:a}=wr();F.useEffect(()=>{var h,g;if(i!==null&&e===null){let v=0;r!=null&&r.rowIsRepeatable?v=i.findIndex(m=>(m==null?void 0:m.rowId)===(r==null?void 0:r.uuid)):v=i.findIndex(m=>(m==null?void 0:m.fieldId)===(r==null?void 0:r.uuid)),n((h=i[v])!=null&&h.reviewerChecklist?(g=i[v])==null?void 0:g.reviewerChecklist:[])}return()=>{}},[r==null?void 0:r.rowIsRepeatable,r==null?void 0:r.uuid,e,i]);const s=h=>{const g=i.findIndex(m=>(m==null?void 0:m.fieldId)===(r==null?void 0:r.uuid)),v=[...i];v[g]={...v[g],reviewerChecklist:h},a(v)},l=(h,g)=>{const v=e;v[g]={...v[g],agree:h==null?void 0:h.value},n([...v]),s(v)},c=(h,g)=>{const v=e;if(g!=null&&g.checked)v[h].selectAction.push(g==null?void 0:g.value);else{const m=v[h].selectAction.findIndex(A=>A===(g==null?void 0:g.value));v[h].selectAction.splice(m,1)}n([...v]),s(v)},u=(h,g)=>{const v=e;h!=null&&h.checked?v[g]={...v[g],other:{...v[g].other,isOther:!0}}:v[g]={...v[g],other:{...v[g].other,isOther:!1}},n([...v]),s(v)},d=(h,g)=>{var m;const v=e;v[g]={...v[g],other:{...v[g].other,description:(m=h==null?void 0:h.target)==null?void 0:m.value}},n([...v]),s(v)},f=(h,g,v)=>{var A;const m=e;m[v]={...m[v],[g]:(A=h==null?void 0:h.target)==null?void 0:A.value},n([...m]),s(m)};return o.jsx(o.Fragment,{children:o.jsx("div",{className:"col-12",children:o.jsx(as,{children:o.jsx(Sr,{header:"Admin Review",children:o.jsx("div",{className:"grid",children:e!==null&&(e==null?void 0:e.length)>0&&(e==null?void 0:e.map((h,g)=>{var v,m,A,S,T;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(oa,{inputId:`yes-${g}`,name:"action",value:!0,onChange:C=>{l(C,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(oa,{inputId:`no-${g}`,name:"action",value:!1,onChange:C=>{l(C,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((C,x)=>{var w;return o.jsxs("div",{children:[o.jsx(Kr,{value:C,checked:((w=h==null?void 0:h.selectAction)==null?void 0:w.length)>0?h==null?void 0:h.selectAction.some(I=>I===C):!1,onChange:I=>{c(g,I)}})," ",C," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${g}-${x}`)})),o.jsx(Kr,{checked:(A=h==null?void 0:h.other)==null?void 0:A.isOther,onChange:C=>{u(C,g)}})," Other ",o.jsx("br",{}),o.jsx("br",{}),((S=h==null?void 0:h.other)==null?void 0:S.isOther)===!0&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"If other please specify the action point"}),o.jsx("br",{}),o.jsx(fo,{className:"mt-3",value:(T=h==null?void 0:h.other)==null?void 0:T.description,onChange:C=>d(C,g)})]})]}),(h==null?void 0:h.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(fo,{className:"mt-3",value:h==null?void 0:h.reviewerFeedback,onChange:C=>f(C,"reviewerFeedback",g)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(fo,{className:"mt-3",value:h==null?void 0:h.reviewerComments,onChange:C=>f(C,"reviewerComments",g)})]})]})},`checklistIndex-${g}`)}))})})})})})},Ti=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:a}=on(),{globalAlignment:s}=Wt(),l=g=>{const v=g.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",m=`${g.className} justify-content-start`,A=`${g.titleClassName} pl-1`;return o.jsxs("div",{className:m,children:[o.jsxs("button",{className:g.togglerClassName,onClick:g.onTogglerClick,children:[o.jsx("span",{className:v}),o.jsx(tn,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=wr(),[d,f]=F.useState("");F.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(di,{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:NO,setPrototypeOf:OO,isFrozen:xle,getPrototypeOf:Tle,getOwnPropertyDescriptor:Ele}=Object;let{freeze:Oo,seal:Ql,create:FO}=Object,{apply:ub,construct:db}=typeof Reflect<"u"&&Reflect;Oo||(Oo=function(e){return e}),Ql||(Ql=function(e){return e}),ub||(ub=function(e,n,r){return e.apply(n,r)}),db||(db=function(e,n){return new e(...n)});const J3=Cl(Array.prototype.forEach),kO=Cl(Array.prototype.pop),g2=Cl(Array.prototype.push),Z3=Cl(String.prototype.toLowerCase),fb=Cl(String.prototype.toString),PO=Cl(String.prototype.match),m2=Cl(String.prototype.replace),Ile=Cl(String.prototype.indexOf),_le=Cl(String.prototype.trim),Fc=Cl(Object.prototype.hasOwnProperty),Fo=Cl(RegExp.prototype.test),v2=Dle(TypeError);function Cl(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 ub(t,e,r)}}function Dle(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return db(t,n)}}function gi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Z3;OO&&OO(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=n(i);a!==i&&(xle(e)||(e[r]=a),i=a)}t[i]=!0}return t}function Nle(t){for(let e=0;e<t.length;e++)Fc(t,e)||(t[e]=null);return t}function c1(t){const e=FO(null);for(const[n,r]of NO(t))Fc(t,n)&&(Array.isArray(r)?e[n]=Nle(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=c1(r):e[n]=r);return e}function b2(t,e){for(;t!==null;){const r=Ele(t,e);if(r){if(r.get)return Cl(r.get);if(typeof r.value=="function")return Cl(r.value)}t=Tle(t)}function n(){return null}return n}const MO=Oo(["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"]),hb=Oo(["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"]),pb=Oo(["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"]),Ole=Oo(["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"]),gb=Oo(["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"]),Fle=Oo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),LO=Oo(["#text"]),BO=Oo(["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"]),mb=Oo(["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"]),VO=Oo(["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"]),e4=Oo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),kle=Ql(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ple=Ql(/<%[\w\W]*|[\w\W]*%>/gm),Mle=Ql(/\${[\w\W]*}/gm),Lle=Ql(/^data-[\-\w.\u00B7-\uFFFF]/),Ble=Ql(/^aria-[\-\w]+$/),qO=Ql(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vle=Ql(/^(?:\w+script|data):/i),qle=Ql(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),UO=Ql(/^html$/i),Ule=Ql(/^[a-z][.\w]*(-[.\w]+)+$/i);var $O=Object.freeze({__proto__:null,MUSTACHE_EXPR:kle,ERB_EXPR:Ple,TMPLIT_EXPR:Mle,DATA_ATTR:Lle,ARIA_ATTR:Ble,IS_ALLOWED_URI:qO,IS_SCRIPT_OR_DATA:Vle,ATTR_WHITESPACE:qle,DOCTYPE_NAME:UO,CUSTOM_ELEMENT:Ule});const y2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},$le=function(){return typeof window>"u"?null:window},jle=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 jO(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$le();const e=_t=>jO(_t);if(e.version="3.1.7",e.removed=[],!t||!t.document||t.document.nodeType!==y2.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=b2(v,"cloneNode"),A=b2(v,"remove"),S=b2(v,"nextSibling"),T=b2(v,"childNodes"),C=b2(v,"parentNode");if(typeof s=="function"){const _t=n.createElement("template");_t.content&&_t.content.ownerDocument&&(n=_t.content.ownerDocument)}let x,w="";const{implementation:I,createNodeIterator:_,createDocumentFragment:N,getElementsByTagName:O}=n,{importNode:k}=r;let M={};e.isSupported=typeof NO=="function"&&typeof C=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:j,ERB_EXPR:P,TMPLIT_EXPR:$,DATA_ATTR:K,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:ne,CUSTOM_ELEMENT:he}=$O;let{IS_ALLOWED_URI:q}=$O,W=null;const Q=gi({},[...MO,...hb,...pb,...gb,...LO]);let Z=null;const H=gi({},[...BO,...mb,...VO,...e4]);let Y=Object.seal(FO(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}})),oe=null,be=null,Ce=!0,ve=!0,ye=!1,te=!0,L=!1,le=!0,ie=!1,ue=!1,Ne=!1,_e=!1,me=!1,se=!1,we=!0,ke=!1;const R="user-content-";let Ae=!0,Se=!1,fe={},ge=null;const pe=gi({},["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 Ve=null;const De=gi({},["audio","video","img","source","image","track"]);let He=null;const it=gi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ut="http://www.w3.org/1998/Math/MathML",dt="http://www.w3.org/2000/svg",Bt="http://www.w3.org/1999/xhtml";let ln=Bt,Ft=!1,mn=null;const Vn=gi({},[ut,dt,Bt],fb);let xt=null;const je=["application/xhtml+xml","text/html"],Ye="text/html";let st=null,Jt=null;const Xt=n.createElement("form"),Zt=function(Fe){return Fe instanceof RegExp||Fe instanceof Function},yn=function(){let Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Jt&&Jt===Fe)){if((!Fe||typeof Fe!="object")&&(Fe={}),Fe=c1(Fe),xt=je.indexOf(Fe.PARSER_MEDIA_TYPE)===-1?Ye:Fe.PARSER_MEDIA_TYPE,st=xt==="application/xhtml+xml"?fb:Z3,W=Fc(Fe,"ALLOWED_TAGS")?gi({},Fe.ALLOWED_TAGS,st):Q,Z=Fc(Fe,"ALLOWED_ATTR")?gi({},Fe.ALLOWED_ATTR,st):H,mn=Fc(Fe,"ALLOWED_NAMESPACES")?gi({},Fe.ALLOWED_NAMESPACES,fb):Vn,He=Fc(Fe,"ADD_URI_SAFE_ATTR")?gi(c1(it),Fe.ADD_URI_SAFE_ATTR,st):it,Ve=Fc(Fe,"ADD_DATA_URI_TAGS")?gi(c1(De),Fe.ADD_DATA_URI_TAGS,st):De,ge=Fc(Fe,"FORBID_CONTENTS")?gi({},Fe.FORBID_CONTENTS,st):pe,oe=Fc(Fe,"FORBID_TAGS")?gi({},Fe.FORBID_TAGS,st):{},be=Fc(Fe,"FORBID_ATTR")?gi({},Fe.FORBID_ATTR,st):{},fe=Fc(Fe,"USE_PROFILES")?Fe.USE_PROFILES:!1,Ce=Fe.ALLOW_ARIA_ATTR!==!1,ve=Fe.ALLOW_DATA_ATTR!==!1,ye=Fe.ALLOW_UNKNOWN_PROTOCOLS||!1,te=Fe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,L=Fe.SAFE_FOR_TEMPLATES||!1,le=Fe.SAFE_FOR_XML!==!1,ie=Fe.WHOLE_DOCUMENT||!1,_e=Fe.RETURN_DOM||!1,me=Fe.RETURN_DOM_FRAGMENT||!1,se=Fe.RETURN_TRUSTED_TYPE||!1,Ne=Fe.FORCE_BODY||!1,we=Fe.SANITIZE_DOM!==!1,ke=Fe.SANITIZE_NAMED_PROPS||!1,Ae=Fe.KEEP_CONTENT!==!1,Se=Fe.IN_PLACE||!1,q=Fe.ALLOWED_URI_REGEXP||qO,ln=Fe.NAMESPACE||Bt,Y=Fe.CUSTOM_ELEMENT_HANDLING||{},Fe.CUSTOM_ELEMENT_HANDLING&&Zt(Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&Zt(Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Y.attributeNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&typeof Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Y.allowCustomizedBuiltInElements=Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),L&&(ve=!1),me&&(_e=!0),fe&&(W=gi({},LO),Z=[],fe.html===!0&&(gi(W,MO),gi(Z,BO)),fe.svg===!0&&(gi(W,hb),gi(Z,mb),gi(Z,e4)),fe.svgFilters===!0&&(gi(W,pb),gi(Z,mb),gi(Z,e4)),fe.mathMl===!0&&(gi(W,gb),gi(Z,VO),gi(Z,e4))),Fe.ADD_TAGS&&(W===Q&&(W=c1(W)),gi(W,Fe.ADD_TAGS,st)),Fe.ADD_ATTR&&(Z===H&&(Z=c1(Z)),gi(Z,Fe.ADD_ATTR,st)),Fe.ADD_URI_SAFE_ATTR&&gi(He,Fe.ADD_URI_SAFE_ATTR,st),Fe.FORBID_CONTENTS&&(ge===pe&&(ge=c1(ge)),gi(ge,Fe.FORBID_CONTENTS,st)),Ae&&(W["#text"]=!0),ie&&gi(W,["html","head","body"]),W.table&&(gi(W,["tbody"]),delete oe.tbody),Fe.TRUSTED_TYPES_POLICY){if(typeof Fe.TRUSTED_TYPES_POLICY.createHTML!="function")throw v2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Fe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw v2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=Fe.TRUSTED_TYPES_POLICY,w=x.createHTML("")}else x===void 0&&(x=jle(g,i)),x!==null&&typeof w=="string"&&(w=x.createHTML(""));Oo&&Oo(Fe),Jt=Fe}},vt=gi({},["mi","mo","mn","ms","mtext"]),Be=gi({},["annotation-xml"]),nt=gi({},["title","style","font","a","script"]),Tt=gi({},[...hb,...pb,...Ole]),Mt=gi({},[...gb,...Fle]),Nn=function(Fe){let Qe=C(Fe);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:ln,tagName:"template"});const At=Z3(Fe.tagName),zt=Z3(Qe.tagName);return mn[Fe.namespaceURI]?Fe.namespaceURI===dt?Qe.namespaceURI===Bt?At==="svg":Qe.namespaceURI===ut?At==="svg"&&(zt==="annotation-xml"||vt[zt]):!!Tt[At]:Fe.namespaceURI===ut?Qe.namespaceURI===Bt?At==="math":Qe.namespaceURI===dt?At==="math"&&Be[zt]:!!Mt[At]:Fe.namespaceURI===Bt?Qe.namespaceURI===dt&&!Be[zt]||Qe.namespaceURI===ut&&!vt[zt]?!1:!Mt[At]&&(nt[At]||!Tt[At]):!!(xt==="application/xhtml+xml"&&mn[Fe.namespaceURI]):!1},kn=function(Fe){g2(e.removed,{element:Fe});try{C(Fe).removeChild(Fe)}catch{A(Fe)}},Qn=function(Fe,Qe){try{g2(e.removed,{attribute:Qe.getAttributeNode(Fe),from:Qe})}catch{g2(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(Fe),Fe==="is"&&!Z[Fe])if(_e||me)try{kn(Qe)}catch{}else try{Qe.setAttribute(Fe,"")}catch{}},Jn=function(Fe){let Qe=null,At=null;if(Ne)Fe="<remove></remove>"+Fe;else{const nn=PO(Fe,/^[\r\n\t ]+/);At=nn&&nn[0]}xt==="application/xhtml+xml"&&ln===Bt&&(Fe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Fe+"</body></html>");const zt=x?x.createHTML(Fe):Fe;if(ln===Bt)try{Qe=new h().parseFromString(zt,xt)}catch{}if(!Qe||!Qe.documentElement){Qe=I.createDocument(ln,"template",null);try{Qe.documentElement.innerHTML=Ft?w:zt}catch{}}const Rt=Qe.body||Qe.documentElement;return Fe&&At&&Rt.insertBefore(n.createTextNode(At),Rt.childNodes[0]||null),ln===Bt?O.call(Qe,ie?"html":"body")[0]:ie?Qe.documentElement:Rt},br=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)},Or=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")},Sn=function(Fe){return typeof l=="function"&&Fe instanceof l},ot=function(Fe,Qe,At){M[Fe]&&J3(M[Fe],zt=>{zt.call(e,Qe,At,Jt)})},ct=function(Fe){let Qe=null;if(ot("beforeSanitizeElements",Fe,null),Or(Fe))return kn(Fe),!0;const At=st(Fe.nodeName);if(ot("uponSanitizeElement",Fe,{tagName:At,allowedTags:W}),Fe.hasChildNodes()&&!Sn(Fe.firstElementChild)&&Fo(/<[/\w]/g,Fe.innerHTML)&&Fo(/<[/\w]/g,Fe.textContent)||Fe.nodeType===y2.progressingInstruction||le&&Fe.nodeType===y2.comment&&Fo(/<[/\w]/g,Fe.data))return kn(Fe),!0;if(!W[At]||oe[At]){if(!oe[At]&&Nt(At)&&(Y.tagNameCheck instanceof RegExp&&Fo(Y.tagNameCheck,At)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(At)))return!1;if(Ae&&!ge[At]){const zt=C(Fe)||Fe.parentNode,Rt=T(Fe)||Fe.childNodes;if(Rt&&zt){const nn=Rt.length;for(let xn=nn-1;xn>=0;--xn){const Ln=m(Rt[xn],!0);Ln.__removalCount=(Fe.__removalCount||0)+1,zt.insertBefore(Ln,S(Fe))}}}return kn(Fe),!0}return Fe instanceof c&&!Nn(Fe)||(At==="noscript"||At==="noembed"||At==="noframes")&&Fo(/<\/no(script|embed|frames)/i,Fe.innerHTML)?(kn(Fe),!0):(L&&Fe.nodeType===y2.text&&(Qe=Fe.textContent,J3([j,P,$],zt=>{Qe=m2(Qe,zt," ")}),Fe.textContent!==Qe&&(g2(e.removed,{element:Fe.cloneNode()}),Fe.textContent=Qe)),ot("afterSanitizeElements",Fe,null),!1)},yt=function(Fe,Qe,At){if(we&&(Qe==="id"||Qe==="name")&&(At in n||At in Xt))return!1;if(!(ve&&!be[Qe]&&Fo(K,Qe))){if(!(Ce&&Fo(ce,Qe))){if(!Z[Qe]||be[Qe]){if(!(Nt(Fe)&&(Y.tagNameCheck instanceof RegExp&&Fo(Y.tagNameCheck,Fe)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(Fe))&&(Y.attributeNameCheck instanceof RegExp&&Fo(Y.attributeNameCheck,Qe)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(Qe))||Qe==="is"&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&Fo(Y.tagNameCheck,At)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(At))))return!1}else if(!He[Qe]){if(!Fo(q,m2(At,ne,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&Fe!=="script"&&Ile(At,"data:")===0&&Ve[Fe])){if(!(ye&&!Fo(X,m2(At,ne,"")))){if(At)return!1}}}}}}return!0},Nt=function(Fe){return Fe!=="annotation-xml"&&PO(Fe,he)},Cn=function(Fe){ot("beforeSanitizeAttributes",Fe,null);const{attributes:Qe}=Fe;if(!Qe)return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z};let zt=Qe.length;for(;zt--;){const Rt=Qe[zt],{name:nn,namespaceURI:xn,value:Ln}=Rt,Hn=st(nn);let at=nn==="value"?Ln:_le(Ln);if(At.attrName=Hn,At.attrValue=at,At.keepAttr=!0,At.forceKeepAttr=void 0,ot("uponSanitizeAttribute",Fe,At),at=At.attrValue,At.forceKeepAttr||(Qn(nn,Fe),!At.keepAttr))continue;if(!te&&Fo(/\/>/i,at)){Qn(nn,Fe);continue}L&&J3([j,P,$],Me=>{at=m2(at,Me," ")});const ae=st(Fe.nodeName);if(yt(ae,Hn,at)){if(ke&&(Hn==="id"||Hn==="name")&&(Qn(nn,Fe),at=R+at),le&&Fo(/((--!?|])>)|<\/(style|title)/i,at)){Qn(nn,Fe);continue}if(x&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!xn)switch(g.getAttributeType(ae,Hn)){case"TrustedHTML":{at=x.createHTML(at);break}case"TrustedScriptURL":{at=x.createScriptURL(at);break}}try{xn?Fe.setAttributeNS(xn,nn,at):Fe.setAttribute(nn,at),Or(Fe)?kn(Fe):kO(e.removed)}catch{}}}ot("afterSanitizeAttributes",Fe,null)},On=function _t(Fe){let Qe=null;const At=br(Fe);for(ot("beforeSanitizeShadowDOM",Fe,null);Qe=At.nextNode();)ot("uponSanitizeShadowNode",Qe,null),!ct(Qe)&&(Qe.content instanceof a&&_t(Qe.content),Cn(Qe));ot("afterSanitizeShadowDOM",Fe,null)};return e.sanitize=function(_t){let Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,At=null,zt=null,Rt=null;if(Ft=!_t,Ft&&(_t="<!-->"),typeof _t!="string"&&!Sn(_t))if(typeof _t.toString=="function"){if(_t=_t.toString(),typeof _t!="string")throw v2("dirty is not a string, aborting")}else throw v2("toString is not a function");if(!e.isSupported)return _t;if(ue||yn(Fe),e.removed=[],typeof _t=="string"&&(Se=!1),Se){if(_t.nodeName){const Ln=st(_t.nodeName);if(!W[Ln]||oe[Ln])throw v2("root node is forbidden and cannot be sanitized in-place")}}else if(_t instanceof l)Qe=Jn("<!---->"),At=Qe.ownerDocument.importNode(_t,!0),At.nodeType===y2.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?Qe=At:Qe.appendChild(At);else{if(!_e&&!L&&!ie&&_t.indexOf("<")===-1)return x&&se?x.createHTML(_t):_t;if(Qe=Jn(_t),!Qe)return _e?null:se?w:""}Qe&&Ne&&kn(Qe.firstChild);const nn=br(Se?_t:Qe);for(;zt=nn.nextNode();)ct(zt)||(zt.content instanceof a&&On(zt.content),Cn(zt));if(Se)return _t;if(_e){if(me)for(Rt=N.call(Qe.ownerDocument);Qe.firstChild;)Rt.appendChild(Qe.firstChild);else Rt=Qe;return(Z.shadowroot||Z.shadowrootmode)&&(Rt=k.call(r,Rt,!0)),Rt}let xn=ie?Qe.outerHTML:Qe.innerHTML;return ie&&W["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Fo(UO,Qe.ownerDocument.doctype.name)&&(xn="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`>
2393
- `+xn),L&&J3([j,P,$],Ln=>{xn=m2(xn,Ln," ")}),x&&se?x.createHTML(xn):xn},e.setConfig=function(){let _t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yn(_t),ue=!0},e.clearConfig=function(){Jt=null,ue=!1},e.isValidAttribute=function(_t,Fe,Qe){Jt||yn({});const At=st(_t),zt=st(Fe);return yt(At,zt,Qe)},e.addHook=function(_t,Fe){typeof Fe=="function"&&(M[_t]=M[_t]||[],g2(M[_t],Fe))},e.removeHook=function(_t){if(M[_t])return kO(M[_t])},e.removeHooks=function(_t){M[_t]&&(M[_t]=[])},e.removeAllHooks=function(){M={}},e}var t4=jO();const la=t=>{var T;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,path:l}=t,[c,u]=F.useState(e);F.useEffect(()=>{var C;return A((C=e==null?void 0:e.label)==null?void 0:C[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=on(),v=(C,x,w)=>{u(I=>({...I,[C]:{...I[C],[x==null?void 0:x.type]:w}}))},[m,A]=F.useState((T=e==null?void 0:e.label)==null?void 0:T[d==null?void 0:d.type]);F.useEffect(()=>(S(),()=>{}),[c]);const S=()=>{const C=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(C[ga],C[ma],C[Ia],C[_a],C[Da],C[La],C[Jo],C[Eo],c):(C==null?void 0:C.length)>La&&(C==null?void 0:C.length)===Kl+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(C[ga],C[ma],C[Ia],C[_a],C[Da],C[5],C[6],C[7],c):f(r,i,a,s,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(Q3,{style:{display:"inline-block"},className:"builder-input-label-edit",html:m,disabled:!1,onChange:C=>{var x;A(t4.sanitize((x=C==null?void 0:C.target)==null?void 0:x.value))},onBlur:C=>{var w;const x=t4.sanitize((w=C==null?void 0:C.target)==null?void 0:w.innerText);A(x),v("label",d,x)},tagName:"article"})})},u1=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(n2,{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"}})})},Jr=t=>{var ce,X,ne,he;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}=Wt(),v=(q,W)=>{M(Q=>({...Q,[q]:W}))},{fieldSettingUpdate:m,fieldSettingUpdateInlineConditional:A,cloneField:S,gridComponentFieldSettingUpdate:T,fieldSettingDeleteInlineConditional:C,gridComponentFieldDelete:x,removeField:w}=on(),{updateGlobalToast:I}=Wt(),_=q=>{const W=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?A(W[ga],W[ma],W[Ia],W[_a],W[Da],W[La],W[Jo],W[Eo],q):(W==null?void 0:W.length)>La&&(W==null?void 0:W.length)===Kl+1&&(q!=null&&q.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?T(W[ga],W[ma],W[Ia],W[_a],W[Da],W[5],W[6],W[7],q):m(s,i,a,r,n,q),I({showToast:!0,toastMessage:"Updated",toastDetail:"Field updated",toastType:"success"})},[N,O]=F.useState(!1),[k,M]=F.useState({custom_component_title:"",custom_component_description:""}),j=()=>{M(q=>({...q,custom_component_schema:e})),O(!0)},P=()=>{const q=c.split("-").map(Number);l==="inline-conditional"?C(q[ga],q[ma],q[Ia],q[_a],q[Da],q[La],q[Jo],q[Eo]):(q==null?void 0:q.length)>La&&(q==null?void 0:q.length)===Kl+1&&(e!=null&&e.componentType)&&l==="grid"?x(q[ga],q[ma],q[Ia],q[_a],q[Da],q[5],q[6],q[7]):w(s,i,a,r,n)},$=(q,W)=>{const Q={...e,attributes:{...e.attributes,[q]:W}};_(Q)},K=(q,W)=>{const Q={...e,[q]:W};_(Q)};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(u1,{field:e,onHandleChangeSetttings:$,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:$,settingsKey:"style",settingsKeyValue:(ne=e==null?void 0:e.attributes)==null?void 0:ne.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(he=e==null?void 0:e.attributes)==null?void 0:he.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(Vt,{text:!0,size:"small",tooltip:"Advanced settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx(Vt,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{S(e,s,i,a,r,n),h()},tooltip:"Clone"}),o.jsx(Vt,{text:!0,className:"p-button-danger",size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{P()},tooltip:"Delete"}),(g===S3||g===z0)&&o.jsx(Vt,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",tooltip:"Save as custom component",onClick:()=>{j()}})]}),o.jsxs(Gs,{header:"Custom component save",visible:N,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx(Vt,{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(Vt,{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:(k==null?void 0:k.custom_component_title)||"",onChange:q=>{var W;return v("custom_component_title",(W=q==null?void 0:q.target)==null?void 0:W.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(fo,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(k==null?void 0:k.custom_component_description)||"",onChange:q=>{var W;return v("custom_component_description",(W=q==null?void 0:q.target)==null?void 0:W.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},zle=t=>{var Z,H,Y,oe,be,Ce,ve,ye;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isRenderView:d,isPreview:f}=Wt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=on(),{taskRegisterData:v,updateTaskRegisterData:m,updateTaskProgressValue:A,updateUserFormDataSubmit:S,userTaskSubmitFormData:T}=wr(),[C,x]=F.useState(!1),[w,I]=F.useState(!1),[_,N]=F.useState(null),[O,k]=F.useState(0),[M,j]=F.useState(!1),P=()=>{j(!0)},$=()=>{j(!1)},K=te=>{x(te)},ce=()=>{x(!1)},X=()=>{var te,L,le;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const ie=[...a.repeatableFields],ue=Et.findIndex(ie,function(Ne){return Ne.uuid===(r==null?void 0:r.uuid)});ue>=0&&ie[ue].fieldData?N(ie[ue].fieldData):(r.isValid=0,N(null))}}else{const ie=T,ue=Et.cloneDeep(v);if(ie!=null&&ie.length){for(const Ne of ie)if(Ne.fieldId===t.field.uuid&&((te=Ne==null?void 0:Ne.postData)!=null&&te.length)){N((L=Ne==null?void 0:Ne.postData[0])==null?void 0:L.postValue),ue[r==null?void 0:r.uuid]=(le=Ne==null?void 0:Ne.postData[0])==null?void 0:le.postValue;const _e=Object.keys(ue).length;A(_e);break}}}I(!0)},ne=te=>{var ue;N(te.target.value);const L=T,le=Et.cloneDeep(v);if((ue=te==null?void 0:te.target)!=null&&ue.value&&(L==null?void 0:L.length)>0)for(const Ne of L)Ne.fieldId===t.field.uuid&&(le[r==null?void 0:r.uuid]=te==null?void 0:te.value,Ne.postData[0]={postValue:te.value});else delete le[r==null?void 0:r.uuid];m(le);const ie=Object.keys(le).length;A(ie)};F.useEffect(()=>{w||X();const te=Qt.addListener("clearRepeatableFields",ie=>{ie===(a==null?void 0:a.uuid)&&(N(null),k(0),r.isValid=0,g(e,n,s,l,i,r))}),L=Qt.addListener("onSubmitUserForm",()=>{var ie;(ie=r==null?void 0:r.attributes)!=null&&ie.required?_!==null||_!==void 0?r.isValid=1:(console.log("Countr field in valid ",_),r.isValid=0):r.isValid=1}),le=Qt.addListener("OnInvalidFieldCatch",ie=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(ie==null?void 0:ie.fieldId)),r.uuid===(ie==null?void 0:ie.fieldId)?k(1):k(0)});return()=>{L.remove(),le.remove(),te.remove()}});const he=(te,L)=>{var le;if(T){const ie=[...T],ue=Et.findIndex(ie,function(_e){return _e.rowId===(a==null?void 0:a.uuid)});let Ne=(le=T[ue])==null?void 0:le.repeatableFields;Ne={...Ne,[te==null?void 0:te.uuid]:L},ie[ue]={...ie[ue],repeatableFields:Ne},S(ie)}N(L),L!==null?te.isValid=1:te.isValid=0},q=(te,L)=>te?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:te.name,src:te==null?void 0:te.image,onError:le=>le.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:te.name})]}):o.jsx("span",{children:L.placeholder}),W=te=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:te.name,src:te==null?void 0:te.image,onError:L=>L.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:te.name})]}),Q=o.jsxs("div",{onMouseOver:P,onMouseOut:$,children:[!d&&!f&&M&&o.jsx(Jr,{handleFieldSettingsSidebar:K,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(r==null?void 0:r.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"field-form-builder col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(Z=r==null?void 0:r.headerText)==null?void 0:Z[h==null?void 0:h.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(fa,{...t}),((H=r==null?void 0:r.attributes)==null?void 0:H.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(Y=r==null?void 0:r.label)==null?void 0:Y[h==null?void 0:h.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(qi,{message:(oe=r==null?void 0:r.toolTip)==null?void 0:oe[h==null?void 0:h.type],position:"right"})})]}),o.jsx(Va,{className:"country-select-builder-component",onFocus:()=>k(1),onChange:te=>{a!=null&&a.rowIsRepeatable?he(r,te.target.value):ne(te)},options:r==null?void 0:r.countries,optionLabel:"name",value:_,placeholder:(be=r==null?void 0:r.placeholder)==null?void 0:be[h==null?void 0:h.type],disabled:c,valueTemplate:q,itemTemplate:W,filter:!0,filterBy:"name",showClear:!0}),((Ce=r==null?void 0:r.attributes)==null?void 0:Ce.required)&&o.jsx("small",{className:"error",children:O===1&&_===null?((ve=r==null?void 0:r.validationMesssage)==null?void 0:ve[h==null?void 0:h.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(ye=r==null?void 0:r.helperText)==null?void 0:ye[h==null?void 0:h.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[C===!0&&o.jsx(ea,{visibilty:C,closeSettingFieldSidebar:ce,...t},r==null?void 0:r.uuid),o.jsx(Ti,{...t,fieldWrap:Q})]})},Hle=t=>{var Y,oe,be,Ce,ve,ye,te,L,le,ie,ue,Ne,_e,me,se;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:a,task_status:s,TASK_PUBLISHED:l}=wr(),{userSelectedLanguage:c,fieldSettingUpdate:u}=on(),{field:d,fieldIndex:f,sectionIndex:h,pageIndex:g,row:v,rowIndex:m,columnIndex:A,isDisabled:S}=t,{isAdmin:T,isRenderView:C,isPreview:x}=Wt(),[w,I]=F.useState(!1),[_,N]=F.useState(""),[O,k]=F.useState(null),[M,j]=F.useState(0),[P,$]=F.useState(!1),[K,ce]=F.useState(!1),X=()=>{ce(!0)},ne=()=>{ce(!1)},he=()=>{var we,ke,R;if(v!=null&&v.rowIsRepeatable){if(v!=null&&v.repeatableFields){const Ae=[...v.repeatableFields],Se=Et.findIndex(Ae,function(fe){return fe.uuid===(d==null?void 0:d.uuid)});Se>=0&&Ae[Se].fieldData?N(Ae[Se].fieldData):N("")}}else{const Ae=a;if(Ae!=null&&Ae.length){for(const Se of Ae)if(Se.fieldId===t.field.uuid&&((we=Se==null?void 0:Se.postData[0])==null?void 0:we.postValue)!==""&&((ke=Se==null?void 0:Se.postData[0])!=null&&ke.postValue)){N((R=Se==null?void 0:Se.postData[0])==null?void 0:R.postValue);break}}}$(!0)};F.useEffect(()=>{P||he();const we=Qt.addListener("clearRepeatableFields",fe=>{fe===(v==null?void 0:v.uuid)&&(N(""),j(0),d.isValid=0,u(g,h,m,A,f,d))}),ke=Qt.addListener("onSubmitUserForm",()=>{var fe,ge;(fe=d==null?void 0:d.attributes)!=null&&fe.required?_&&_.length&&(_==null?void 0:_.length)<((ge=d==null?void 0:d.attributes)==null?void 0:ge.minLength)?d.isValid=1:d.isValid=0:d.isValid=1}),R=Qt.addListener("OnInvalidFieldCatch",fe=>{d.uuid===(fe==null?void 0:fe.fieldId)?j(1):j(0)}),Ae=Qt.addListener("OnGetFieldValue",fe=>{var pe;const ge=(pe=fe==null?void 0:fe.repeatableColumn)==null?void 0:pe.filter(Ve=>(Ve==null?void 0:Ve.fieldUuid)===(d==null?void 0:d.uuid));ge!=null&&ge.length}),Se=Qt.addListener("formFieldAdded",fe=>{O===null&&k(fe==null?void 0:fe.uuid)});return()=>{ke.remove(),R.remove(),Ae.remove(),we.remove(),Se.remove()}}),F.useEffect(()=>(O!==null&&setTimeout(()=>{k(null)},1e3),()=>{}),[O]);const q=we=>{I(we)},W=()=>{I(!1)},Q=we=>{var Ae,Se;N(we.target.value);const ke=a,R=Et.cloneDeep(e);if(ke!==null){if((Ae=we==null?void 0:we.target)!=null&&Ae.value){if(R[d==null?void 0:d.uuid]=(Se=we==null?void 0:we.target)==null?void 0:Se.value,(ke==null?void 0:ke.length)>0)for(const fe of ke)fe.fieldId===t.field.uuid&&(fe.postData[0]={postValue:we.target.value})}else if(delete R[d==null?void 0:d.uuid],(ke==null?void 0:ke.length)>0)for(const fe of ke)fe.fieldId===t.field.uuid&&(fe.postData[0]={postValue:""})}if(console.log("row?.rowIsRepeatable",v==null?void 0:v.rowIsRepeatable),!(v!=null&&v.rowIsRepeatable)){n(R);const fe=Object.keys(R).length;r(fe)}},Z=(we,ke)=>{var R;if(a){const Ae=[...a],Se=Et.findIndex(Ae,function(ge){return ge.rowId===(v==null?void 0:v.uuid)});let fe=(R=a[Se])==null?void 0:R.repeatableFields;fe={...fe,[we==null?void 0:we.uuid]:ke},Ae[Se]={...Ae[Se],repeatableFields:fe},i(Ae)}N(ke),ke!==""?we.isValid=1:we.isValid=0},H=o.jsxs("div",{onMouseOver:X,onMouseOut:ne,children:[!C&&!x&&K&&o.jsx(Jr,{handleFieldSettingsSidebar:q,...t}),o.jsxs("div",{className:`field ${x?" ":" builder-element-wrapper "} ${(d==null?void 0:d.isFluid)===!0?" p-fluid ":""} ${C?" ":" py-6 px-4 "} ${O===(d==null?void 0:d.uuid)?" new-field ":" card "} `,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:T?"col-6 ":"col-12 p-fluid",children:[(d==null?void 0:d.showHeaderText)&&o.jsx("h6",{children:(Y=d==null?void 0:d.headerText)==null?void 0:Y[c==null?void 0:c.type]}),(d==null?void 0:d.showLabel)&&o.jsxs("label",{htmlFor:d==null?void 0:d.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(fa,{...t}),((oe=d==null?void 0:d.attributes)==null?void 0:oe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",x?o.jsx(o.Fragment,{children:(be=d==null?void 0:d.label)==null?void 0:be[c==null?void 0:c.type]}):o.jsx(la,{...t}),(d==null?void 0:d.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(qi,{message:(Ce=d==null?void 0:d.toolTip)==null?void 0:Ce[c==null?void 0:c.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(d==null?void 0:d.iconAlignment),children:[(d==null?void 0:d.showIcon)&&o.jsx("i",{className:"pi pi-"+((ye=(ve=d==null?void 0:d.icon)==null?void 0:ve.properties)==null?void 0:ye.name)}),o.jsx(wn,{id:d==null?void 0:d.uuid,placeholder:(te=d==null?void 0:d.placeholder)==null?void 0:te[c==null?void 0:c.type],minLength:(L=d==null?void 0:d.attributes)==null?void 0:L.minLength,maxLength:(le=d==null?void 0:d.attributes)==null?void 0:le.maxLength,value:_,onFocus:()=>j(1),onChange:we=>{v!=null&&v.rowIsRepeatable?Z(d,we.target.value):Q(we)},className:M===1&&((ie=d==null?void 0:d.attributes)!=null&&ie.required)?_?"valid":"invalid":"valid'",readOnly:S})]}),o.jsx("div",{children:((ue=d==null?void 0:d.attributes)==null?void 0:ue.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:M===1&&!_?(Ne=d==null?void 0:d.validationMesssage)==null?void 0:Ne.english:""}),o.jsx("small",{className:"error",children:M===1&&_.length&&(_==null?void 0:_.length)<((_e=d==null?void 0:d.attributes)==null?void 0:_e.minLength)?`Mini length ${(me=d==null?void 0:d.attributes)==null?void 0:me.minLength}`:""})]})}),o.jsx("div",{children:(d==null?void 0:d.showHelperText)&&o.jsx("small",{children:(se=d==null?void 0:d.helperText)==null?void 0:se[c==null?void 0:c.type]})})]})]})}),T&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[w===!0&&o.jsx(ea,{visibilty:w,closeSettingFieldSidebar:W,...t}),o.jsx(Ti,{...t,fieldWrap:H})]})},Yle=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)})]})]})},Kle=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(Kr,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},Rle=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=t,[u,d]=F.useState(n),{fieldSettingUpdate:f,formBuilderSchemaLanguages:h,formBuilderPublishedStatus:g}=on(),{updateGlobalToast:v}=Wt(),m=(T,C,x)=>{d(w=>({...w,[T]:{...w[T],[C==null?void 0:C.type]:x}}))},A=(T,C)=>{d(x=>({...x,[T]:C}))},S=()=>{f(i,a,s,l,c,u),v({showToast:!0,toastMessage:"Updated",toastDetail:"Html updated",toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(No,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[t==null?void 0:t.typeName," settings "]})]}),!g&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx(Vt,{className:"mt-3",label:"Update",type:"button",onClick:()=>S(),"aria-label":"Update"})})]}),o.jsxs(as,{children:[o.jsx(Sr,{header:"Text",children:o.jsx(uo,{activeIndex:0,children:h!=null&&h.length?h.map((T,C)=>o.jsx(co,{tabIndex:C,header:T==null?void 0:T.language,children:o.jsx(Yle,{language:T,fieldState:u,onHandleChange:m,...t})},C)):""})}),o.jsx(Sr,{header:"Styling",children:o.jsx(Kle,{fieldState:u,onHandleChangeStyling:A,...t})})]})]})})},Xle=t=>{var g,v,m,A,S,T,C,x,w;const{field:e}=t,{userSelectedLanguage:n}=on(),{isPreview:r}=Wt(),[i,a]=F.useState(!1),[s,l]=F.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=I=>{a(I)},f=()=>{a(!1)};F.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"":"builder-element-wrapper",onMouseOver:c,onMouseOut:u,children:[!r&&s&&o.jsx(Jr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?" px-4":"field-form-builder px-4",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(g=e==null?void 0:e.headerText)==null?void 0:g[n==null?void 0:n.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-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(o.Fragment,{children:(m=e==null?void 0:e.label)==null?void 0:m[n==null?void 0:n.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(qi,{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:(S=e==null?void 0:e.hrefLink)==null?void 0:S[n==null?void 0:n.type],children:(T=e==null?void 0:e.text)==null?void 0:T[n==null?void 0:n.type]}),((C=e==null?void 0:e.attributes)==null?void 0:C.required)&&o.jsx("small",{className:"error",children:(x=e==null?void 0:e.validationMesssage)==null?void 0:x[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(w=e==null?void 0:e.helperText)==null?void 0:w[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Rle,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(Ti,{...t,fieldWrap:h})]})},Gle=t=>{var Y,oe,be,Ce,ve,ye,te,L,le,ie,ue,Ne,_e,me,se,we,ke,R,Ae,Se,fe;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isPreview:u,isRenderView:d,isAdmin:f}=Wt(),{taskRegisterData:h,updateTaskRegisterData:g,updateTaskProgressValue:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,TASK_PUBLISHED:S,task_status:T}=wr(),{userSelectedLanguage:C,fieldSettingUpdate:x}=on(),[w,I]=F.useState(null),[_,N]=F.useState(!1),[O,k]=F.useState(null),[M,j]=F.useState(0),[P,$]=F.useState(!1),[K,ce]=F.useState(!1),X=()=>{ce(!0)},ne=()=>{ce(!1)},he=()=>{var ge,pe;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ve=[...a.repeatableFields],De=Et.findIndex(Ve,function(He){return He.uuid===(e==null?void 0:e.uuid)});De>=0&&Ve[De].fieldData?k(Number(Ve[De].fieldData)||null):k(null)}}else{const Ve=A;if(Ve!=null&&Ve.length){for(const De of Ve)if(De.fieldId===t.field.uuid&&((ge=De==null?void 0:De.postData)!=null&&ge.length)){k(Number((pe=De==null?void 0:De.postData[0])==null?void 0:pe.postValue)||null);break}}}$(!0)};F.useEffect(()=>{P||he();const ge=Qt.addListener("clearRepeatableFields",it=>{it===(a==null?void 0:a.uuid)&&(k(null),j(0),e.isValid=0,x(i,r,s,l,n,e))}),pe=Qt.addListener("onSubmitUserForm",()=>{var it;(it=e==null?void 0:e.attributes)!=null&&it.required?O?e.isValid=1:e.isValid=0:e.isValid=1}),Ve=Qt.addListener("OnInvalidFieldCatch",it=>{e.uuid===(it==null?void 0:it.fieldId)?j(1):j(0)}),De=Qt.addListener("OnGetFieldValue",it=>{var dt;const ut=(dt=it==null?void 0:it.repeatableColumn)==null?void 0:dt.filter(Bt=>(Bt==null?void 0:Bt.fieldUuid)===(e==null?void 0:e.uuid));ut!=null&&ut.length}),He=Qt.addListener("formFieldAdded",it=>{w===null&&I(it.uuid)});return()=>{pe.remove(),Ve.remove(),De.remove(),ge.remove(),He.remove()}}),F.useEffect(()=>(w!==null&&setTimeout(()=>{I(null)},1e3),()=>{}),[w]);const q=ge=>{N(ge)},W=()=>{N(!1)},Q=ge=>{const pe=A,Ve=Et.cloneDeep(h);if(pe!==null){if(ge){if(Ve[e==null?void 0:e.uuid]=ge,(pe==null?void 0:pe.length)>0)for(const De of pe)De.fieldId===t.field.uuid&&(De.postData[0]={postValue:ge})}else if(delete Ve[e==null?void 0:e.uuid],(pe==null?void 0:pe.length)>0)for(const De of pe)De.fieldId===t.field.uuid&&(De.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){g(Ve);const De=Object.keys(Ve).length;v(De)}},Z=(ge,pe)=>{var Ve;if(A!=null&&A.length){const De=[...A],He=Et.findIndex(De,function(ut){return ut.rowId===(a==null?void 0:a.uuid)});let it=(Ve=A[He])==null?void 0:Ve.repeatableFields;it={...it,[ge==null?void 0:ge.uuid]:pe},De[He]={...De[He],repeatableFields:it},m(De)}k(pe),pe!==""?ge.isValid=1:ge.isValid=0},H=o.jsxs("div",{onMouseOver:X,onMouseOut:ne,children:[!d&&!u&&K&&o.jsx(Jr,{handleFieldSettingsSidebar:q,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" p-fluid py-6 px-4":" py-6 px-4"} ${w===(e==null?void 0:e.uuid)?" new-field ":" card "}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Y=e==null?void 0:e.headerText)==null?void 0:Y[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(fa,{...t}),((oe=e==null?void 0:e.attributes)==null?void 0:oe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[C==null?void 0:C.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(qi,{message:(Ce=e==null?void 0:e.toolTip)==null?void 0:Ce[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-"+((ye=(ve=e==null?void 0:e.icon)==null?void 0:ve.properties)==null?void 0:ye.name)}),o.jsx(ao,{readOnly:c,id:e==null?void 0:e.uuid,placeholder:(te=e==null?void 0:e.placeholder)==null?void 0:te[C==null?void 0:C.type],value:O,min:(L=e==null?void 0:e.attributes)==null?void 0:L.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(le=e==null?void 0:e.attributes)==null?void 0:le.prefix,showButtons:(ie=e==null?void 0:e.attributes)==null?void 0:ie.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(ue=e==null?void 0:e.attributes)==null?void 0:ue.minFractionDigits,maxFractionDigits:(Ne=e==null?void 0:e.attributes)==null?void 0:Ne.maxFractionDigits,locale:(_e=e==null?void 0:e.attributes)==null?void 0:_e.locale,mode:(me=e==null?void 0:e.attributes)==null?void 0:me.mode,currency:(se=e==null?void 0:e.attributes)==null?void 0:se.currency,currencyDisplay:(we=e==null?void 0:e.attributes)==null?void 0:we.currencyDisplay,useGrouping:(ke=e==null?void 0:e.attributes)==null?void 0:ke.useGrouping,onFocus:()=>j(1),onChange:ge=>{a!=null&&a.rowIsRepeatable?Z(e,ge.value):Q(ge.value)},className:M===1&&((R=e==null?void 0:e.attributes)!=null&&R.required)?O?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("small",{className:"error",children:M===1&&!O?(Se=e==null?void 0:e.validationMesssage)==null?void 0:Se.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(fe=e==null?void 0:e.helperText)==null?void 0:fe[C==null?void 0:C.type]})})]})]})}),f&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[_===!0&&o.jsx(ea,{visibilty:_,closeSettingFieldSidebar:W,...t}),o.jsx(Ti,{...t,fieldWrap:H})]})},vb=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],n4=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,mu=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+\$,\\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/;function zO(t){try{JSON.parse(t)}catch{return!1}return!0}function HO(t){if(t<26)return vb[t];{const e=Math.floor(t/26)-1,n=t%26;return vb[e]+vb[n]}}const Wle=t=>{var Q,Z,H,Y,oe,be,Ce,ve,ye,te,L;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,row:a,update:s,value:l,isDisabled:c}=t,{isPreview:u,isAdmin:d,isRenderView:f}=Wt(),{task_status:h,taskRegisterData:g,updateTaskRegisterData:v,updateTaskProgressValue:m,updateUserFormDataSubmit:A,userTaskSubmitFormData:S,TASK_PUBLISHED:T}=wr(),{userSelectedLanguage:C}=on(),[x,w]=F.useState(!1),[I,_]=F.useState(""),[N,O]=F.useState(0),[k,M]=F.useState(!1),j=()=>{M(!0)},P=()=>{M(!1)};F.useEffect(()=>{x||ne();const le=Qt.addListener("clearRepeatableFields",ue=>{ue===(a==null?void 0:a.uuid)&&(_(""),O(0),e.isValid=0)}),ie=Qt.addListener("onSubmitUserForm",()=>{var ue;(ue=e==null?void 0:e.attributes)!=null&&ue.required?I!==""&&n4.test(I)===!0?e.isValid=1:e.isValid=0:e.isValid=1});return()=>{ie.remove(),le.remove()}});const[$,K]=F.useState(!1),ce=le=>{K(le)},X=()=>{K(!1)},ne=()=>{var le,ie,ue;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ne=[...a.repeatableFields],_e=Et.findIndex(Ne,function(me){return me.uuid===(e==null?void 0:e.uuid)});_e>=0&&Ne[_e].fieldData?_(Ne[_e].fieldData):_("")}}else{const Ne=S;if(Ne!=null&&Ne.length){for(const _e of Ne)if(_e.fieldId===t.field.uuid&&((le=_e==null?void 0:_e.postData[0])==null?void 0:le.postValue)!==""&&((ie=_e==null?void 0:_e.postData[0])!=null&&ie.postValue)){_((ue=_e==null?void 0:_e.postData[0])==null?void 0:ue.postValue),w(!0);break}}}w(!0)},he=le=>{_(le);const ie=S,ue=Et.cloneDeep(g);if(ie!==null){if(le!==""&&n4.test(le)===!0){if(ue[e==null?void 0:e.uuid]=le,(ie==null?void 0:ie.length)>0)for(const Ne of ie)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:le})}else if(delete ue[e==null?void 0:e.uuid],(ie==null?void 0:ie.length)>0)for(const Ne of ie)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){v(ue);const Ne=Object.keys(ue).length;m(Ne)}},q=(le,ie,ue,Ne)=>{var _e;if(_(Ne),S!==null){const me=[...S],se=Et.findIndex(me,function(ke){return ke.rowId===(a==null?void 0:a.uuid)});let we=(_e=S[se])==null?void 0:_e.repeatableFields;we={...we,[ue==null?void 0:ue.uuid]:Ne},me[se]={...me[se],repeatableFields:we},A(me),Ne!==""&&n4.test(Ne)===!0?e.isValid=1:e.isValid=0}},W=o.jsxs("div",{onMouseOver:j,onMouseOut:P,children:[!f&&!u&&k&&o.jsx(Jr,{handleFieldSettingsSidebar:ce,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Q=e==null?void 0:e.headerText)==null?void 0:Q[C==null?void 0:C.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(fa,{...t,update:s,value:l}),((Z=e==null?void 0:e.attributes)==null?void 0:Z.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(H=e==null?void 0:e.label)==null?void 0:H[C==null?void 0:C.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-2",children:(e==null?void 0:e.showToolTip)&&o.jsx(o.Fragment,{children:o.jsx(qi,{message:(Y=e==null?void 0:e.toolTip)==null?void 0:Y[C==null?void 0:C.type],position:"right"})})})]}),o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((be=(oe=e==null?void 0:e.icon)==null?void 0:oe.properties)==null?void 0:be.name)}),o.jsx(wn,{id:e==null?void 0:e.uuid,placeholder:(Ce=e==null?void 0:e.placeholder)==null?void 0:Ce[C==null?void 0:C.type],value:I,onFocus:()=>O(1),onChange:le=>{a!=null&&a.rowIsRepeatable?q(r,i,{uuid:e.uuid},le.target.value):he(le.target.value)},className:N===1&&((ve=e==null?void 0:e.attributes)!=null&&ve.required)?I?"valid":"invalid":"valid'",readOnly:c})]}),((ye=e==null?void 0:e.attributes)==null?void 0:ye.required)&&o.jsx("div",{children:o.jsx("small",{className:"error",children:N===1&&(I===null||I==="")?(te=e==null?void 0:e.validationMesssage)==null?void 0:te[C==null?void 0:C.language]:""})}),I!==""&&N===1&&n4.test(I)===!1&&o.jsx("small",{className:"error",children:"Please enter correct email"}),(e==null?void 0:e.showHelperText)&&o.jsx("div",{children:o.jsx("small",{children:(L=e==null?void 0:e.helperText)==null?void 0:L[C==null?void 0:C.type]})})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]});return o.jsxs(o.Fragment,{children:[$===!0&&o.jsx(ea,{visibilty:$,closeSettingFieldSidebar:X,...t},e==null?void 0:e.uuid),o.jsx(Ti,{...t,fieldWrap:W})]})},Qle=t=>{var Y,oe,be,Ce,ve,ye,te,L,le;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,row:l,isDisabled:c}=t,{isRenderView:u,isAdmin:d,isPreview:f}=Wt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=on(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:S,updateUserFormDataSubmit:T,userTaskSubmitFormData:C,TASK_PUBLISHED:x}=wr(),[w,I]=F.useState(!1),[_,N]=F.useState(""),[O,k]=F.useState(0),[M,j]=F.useState(!1),[P,$]=F.useState(!1),[K,ce]=F.useState(!1),X=()=>{$(!0)},ne=()=>{$(!1)},he=ie=>{I(ie)},q=()=>{I(!1)},W=()=>{var ue,Ne,_e;const ie=C;if(l!=null&&l.rowIsRepeatable){if(l!=null&&l.repeatableFields){const me=[...l.repeatableFields],se=Et.findIndex(me,function(we){return we.uuid===(e==null?void 0:e.uuid)});se>=0&&me[se].fieldData?N(me[se].fieldData):(e.isValid=0,N(""))}}else if(ie!=null&&ie.length){for(const me of ie)if(me.fieldId===t.field.uuid&&((ue=me==null?void 0:me.postData[0])!=null&&ue.postValue)&&((Ne=me==null?void 0:me.postData[0])==null?void 0:Ne.postValue)!==""){N((_e=me==null?void 0:me.postData[0])==null?void 0:_e.postValue),j(!0);break}}j(!0)},Q=(ie,ue,Ne,_e)=>{var me;if(C!=null&&C.length){const se=[...C],we=Et.findIndex(se,function(R){return R.rowId===(l==null?void 0:l.uuid)});let ke=(me=C[we])==null?void 0:me.repeatableFields;ke={...ke,[Ne==null?void 0:Ne.uuid]:_e},se[we]={...se[we],repeatableFields:ke},T(se)}N(_e),_e!==""?e.isValid=1:e.isValid=0,g(ie,ue,a,s,n,e)};F.useEffect(()=>{M||W();const ie=Qt.addListener("clearRepeatableFields",se=>{se===(l==null?void 0:l.uuid)&&(N(""),k(0),e.isValid=0)}),ue=Qt.addListener("onSubmitUserForm",()=>{var se;(se=e==null?void 0:e.attributes)!=null&&se.required?_?e.isValid=1:e.isValid=0:e.isValid=1}),Ne=Qt.addListener("OnInvalidFieldCatch",se=>{e.uuid===(se==null?void 0:se.fieldId)?k(1):k(0)}),_e=Qt.addListener("OnGetFieldValue",se=>{var ke;const we=(ke=se==null?void 0:se.repeatableColumn)==null?void 0:ke.filter(R=>(R==null?void 0:R.fieldUuid)===(e==null?void 0:e.uuid));we!=null&&we.length}),me=Qt.addListener("onUpdateField",()=>{ce(!K)});return()=>{me.remove(),ue.remove(),Ne.remove(),_e.remove(),ie.remove()}});const Z=ie=>{var _e,me;N(ie.target.value);const ue=C,Ne=Et.cloneDeep(m);if(ue!==null){if((_e=ie==null?void 0:ie.target)!=null&&_e.value){if(Ne[e==null?void 0:e.uuid]=(me=ie==null?void 0:ie.target)==null?void 0:me.value,(ue==null?void 0:ue.length)>0)for(const se of ue)se.fieldId===t.field.uuid&&(se.postData[0]={postValue:ie.target.value})}else if(delete Ne[e==null?void 0:e.uuid],(ue==null?void 0:ue.length)>0)for(const se of ue)se.fieldId===t.field.uuid&&(se.postData[0]={postValue:""})}if(!(l!=null&&l.rowIsRepeatable)){A(Ne);const se=Object.keys(Ne).length;S(se)}},H=o.jsxs("div",{onMouseOver:X,onMouseOut:ne,children:[!u&&!f&&P&&o.jsx(Jr,{handleFieldSettingsSidebar:he,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?"card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"col-12 field-form-builder ",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Y=e==null?void 0:e.headerText)==null?void 0:Y[h==null?void 0:h.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(fa,{...t}),((oe=e==null?void 0:e.attributes)==null?void 0:oe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(qi,{message:(Ce=e==null?void 0:e.toolTip)==null?void 0:Ce[h==null?void 0:h.type],position:"right"})})]}),o.jsx(fo,{rows:e==null?void 0:e.textareaRows,cols:e==null?void 0:e.textareaCols,autoResize:e==null?void 0:e.resizable,id:e==null?void 0:e.uuid,placeholder:(ve=e==null?void 0:e.placeholder)==null?void 0:ve[h==null?void 0:h.type],value:_,onFocus:()=>k(1),onChange:ie=>{l!=null&&l.rowIsRepeatable?Q(r,i,e,ie.target.value):Z(ie)},className:O===1&&((ye=e==null?void 0:e.attributes)!=null&&ye.required)?_?"valid":"invalid":"valid",readOnly:c}),o.jsx("div",{children:((te=e==null?void 0:e.attributes)==null?void 0:te.required)&&o.jsx("small",{className:"error",children:O===1&&!_?(L=e==null?void 0:e.validationMesssage)==null?void 0:L[h==null?void 0:h.type]:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(le=e==null?void 0:e.helperText)==null?void 0:le[h==null?void 0:h.type]})})]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[w===!0&&o.jsx(ea,{visibilty:w,closeSettingFieldSidebar:q,...t},e==null?void 0:e.uuid),o.jsx(Ti,{...t,fieldWrap:H})]})},Jle={},bb=t=>{var _,N,O,k;const{isAdmin:e,isAdvanceView:n,isPreview:r}=Wt(),{handleDrop:i}=on(),{data:a,path:s,pageIndex:l,sectionIndex:c,rowIndex:u,columnIndex:d,conditionIndex:f,ruleIndex:h,condition:g,page:v,section:m,row:A,column:S}=t,T=F.useRef(null),[{isDragging:C},x]=sa({type:iT,item:{type:iT,uuid:a.uuid,children:a.children,path:s},collect:M=>({isDragging:M.isDragging()})}),w=C?0:1;x(T);const I=(M,j,P,$,K,ce,X)=>{const ne=t!=null&&t.fieldContainer?t==null?void 0:t.fieldContainer:"inline-condition-container";return o.jsx(Yc,{type:"inline-conditional",field:M,data:M,path:j,page:v,section:m,row:A,column:S,pageIndex:P,sectionIndex:$,rowIndex:K,columnIndex:ce,fieldIndex:X,isAdmin:e,fieldContainer:ne},M.uuid)};return o.jsxs("div",{ref:r===!1?T:null,style:{...Jle,opacity:w},className:"draggable column",children:[g&&((_=g.children)==null?void 0:_.length)===0&&o.jsx("p",{className:"text-primary text-center",children:"Drag item here"}),g&&g.children&&((N=g.children)==null?void 0:N.length)>0&&g.children.map((M,j)=>{var P;return o.jsxs(F.Fragment,{children:[r===!1&&o.jsx(kr,{isAdvanceView:n,data:{path:`${s}-${h}-${f}-${j}`,childrenCount:(P=g==null?void 0:g.children)==null?void 0:P.length,droppedField:g},onDrop:i}),I(M,`${s}-${h}-${f}-${j}`,l,c,u,d,j)]},M.uuid)}),r===!1&&o.jsx(kr,{isAdvanceView:n,fieldDropArea:!0,data:{path:`${s}-${h}-${f}-${(O=g==null?void 0:g.children)==null?void 0:O.length}`,childrenCount:(k=g==null?void 0:g.children)==null?void 0:k.length,droppedField:g},onDrop:i,isLast:!0})]})},s0=t=>{const{inputValue:e,condition:n,ruleIndex:r,conditionIndex:i,field:a,section:s,page:l,row:c,pageIndex:u,sectionIndex:d,rowIndex:f,columnIndex:h,isConditionTrue:g}=t,{taskRegisterData:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,updateProgressDataValuesHook:S}=wr(),T=F.useCallback((C,x,w)=>{var _,N,O;const I=A;if(I!=null&&I.length){const k=v,M=(_=a==null?void 0:a.inlineConditionalRules)==null?void 0:_.rules[x].conditions[w].children;for(const[P,$]of M.entries()){(N=$==null?void 0:$.attributes)!=null&&N.required;const K=Et.findIndex(I,function(ce){return ce.fieldId===$.uuid});C?K===-1&&(I.push({postData:[],tabId:l.uuid,tabIndex:u,...a.inlineConditionalRules?{inlineConditionalRules:a.inlineConditionalRules}:{},...a.conditionalTabRules?{conditionalTabRules:a.conditionalTabRules}:{},...a.conditionalSectionRules?{conditionalSectionRules:a.conditionalSectionRules}:{},sectionId:s.uuid,sectionIndex:d,sectionHeading:s.heading,subHeadingText:s.subHeadingText,reviewerChecklist:a==null?void 0:a.reviewerChecklist,rowId:c.uuid,rowIndex:f,columnId:s.uuid,columnIndex:h,inlineConditionalField:!0,fieldIndex:P,fieldId:$.uuid,fieldInputType:a.componentType,fieldTitle:(O=a.label)==null?void 0:O.english,fieldDescription:a.description||null,fieldHelperText:a.helperText||null,fieldHeaderText:a.headerText||null,fieldFooterText:a.footerText||null,fieldTitleAbb:a.abbreviationLabel||a.label,question_abb_table:a.textForTable||null,language:"english",isHiddenfield:a.isHidden&&a.isHidden===1?1:0,isHiddenSection:s.isHidden&&s.isHidden===1?1:0}),k[$==null?void 0:$.uuid]&&delete k[$==null?void 0:$.uuid]):(k[$==null?void 0:$.uuid]&&delete k[$==null?void 0:$.uuid],K>=0&&I.splice(K,1))}const j=Object.keys(k).length;S({progressMaxValue:I==null?void 0:I.length,progressValue:j}),m(I)}},[h,a.abbreviationLabel,a.componentType,a.conditionalSectionRules,a.conditionalTabRules,a.description,a.footerText,a.headerText,a.helperText,a.inlineConditionalRules,a.isHidden,a.label,a==null?void 0:a.reviewerChecklist,a.textForTable,l.uuid,u,c.uuid,f,s.heading,s.isHidden,s.subHeadingText,s.uuid,d,v,S,m,A]);return F.useEffect(()=>(T(g,r,i),()=>{}),[i,e,g,r,T]),o.jsx("div",{children:g&&o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(bb,{...t,ruleIndex:r,conditionIndex:i,condition:n,data:a})})},i)})};function A2(t){"@babel/helpers - typeof";return A2=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},A2(t)}function Zle(t,e){if(A2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(A2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ece(t){var e=Zle(t,"string");return A2(e)=="symbol"?e:e+""}function yb(t,e,n){return(e=ece(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var tce={value:"p-tag-value",icon:"p-tag-icon",root:function(e){var n=e.props;return ht("p-tag p-component",yb(yb({},"p-tag-".concat(n.severity),n.severity!==null),"p-tag-rounded",n.rounded))}},nce=`
2393
+ `+xn),L&&J3([j,P,$],Ln=>{xn=m2(xn,Ln," ")}),x&&se?x.createHTML(xn):xn},e.setConfig=function(){let _t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yn(_t),ue=!0},e.clearConfig=function(){Jt=null,ue=!1},e.isValidAttribute=function(_t,Fe,Qe){Jt||yn({});const At=st(_t),zt=st(Fe);return yt(At,zt,Qe)},e.addHook=function(_t,Fe){typeof Fe=="function"&&(M[_t]=M[_t]||[],g2(M[_t],Fe))},e.removeHook=function(_t){if(M[_t])return kO(M[_t])},e.removeHooks=function(_t){M[_t]&&(M[_t]=[])},e.removeAllHooks=function(){M={}},e}var t4=jO();const la=t=>{var T;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,path:l}=t,[c,u]=F.useState(e);F.useEffect(()=>{var C;return A((C=e==null?void 0:e.label)==null?void 0:C[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=on(),v=(C,x,w)=>{u(I=>({...I,[C]:{...I[C],[x==null?void 0:x.type]:w}}))},[m,A]=F.useState((T=e==null?void 0:e.label)==null?void 0:T[d==null?void 0:d.type]);F.useEffect(()=>(S(),()=>{}),[c]);const S=()=>{const C=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(C[ga],C[ma],C[Ia],C[_a],C[Da],C[La],C[Jo],C[Eo],c):(C==null?void 0:C.length)>La&&(C==null?void 0:C.length)===Kl+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(C[ga],C[ma],C[Ia],C[_a],C[Da],C[5],C[6],C[7],c):f(r,i,a,s,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(Q3,{style:{display:"inline-block"},className:"builder-input-label-edit",html:m,disabled:!1,onChange:C=>{var x;A(t4.sanitize((x=C==null?void 0:C.target)==null?void 0:x.value))},onBlur:C=>{var w;const x=t4.sanitize((w=C==null?void 0:C.target)==null?void 0:w.innerText);A(x),v("label",d,x)},tagName:"article"})})},u1=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(n2,{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"}})})},Jr=t=>{var ce,X,ne,he;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}=Wt(),v=(q,W)=>{M(Q=>({...Q,[q]:W}))},{fieldSettingUpdate:m,fieldSettingUpdateInlineConditional:A,cloneField:S,gridComponentFieldSettingUpdate:T,fieldSettingDeleteInlineConditional:C,gridComponentFieldDelete:x,removeField:w}=on(),{updateGlobalToast:I}=Wt(),_=q=>{const W=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?A(W[ga],W[ma],W[Ia],W[_a],W[Da],W[La],W[Jo],W[Eo],q):(W==null?void 0:W.length)>La&&(W==null?void 0:W.length)===Kl+1&&(q!=null&&q.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?T(W[ga],W[ma],W[Ia],W[_a],W[Da],W[5],W[6],W[7],q):m(s,i,a,r,n,q),I({showToast:!0,toastMessage:"Updated",toastDetail:"Field updated",toastType:"success"})},[N,O]=F.useState(!1),[k,M]=F.useState({custom_component_title:"",custom_component_description:""}),j=()=>{M(q=>({...q,custom_component_schema:e})),O(!0)},P=()=>{const q=c.split("-").map(Number);l==="inline-conditional"?C(q[ga],q[ma],q[Ia],q[_a],q[Da],q[La],q[Jo],q[Eo]):(q==null?void 0:q.length)>La&&(q==null?void 0:q.length)===Kl+1&&(e!=null&&e.componentType)&&l==="grid"?x(q[ga],q[ma],q[Ia],q[_a],q[Da],q[5],q[6],q[7]):w(s,i,a,r,n)},$=(q,W)=>{const Q={...e,attributes:{...e.attributes,[q]:W}};_(Q)},K=(q,W)=>{const Q={...e,[q]:W};_(Q)};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-2 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(u1,{field:e,onHandleChangeSetttings:$,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:K,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(u1,{field:e,onHandleChangeSetttings:$,settingsKey:"style",settingsKeyValue:(ne=e==null?void 0:e.attributes)==null?void 0:ne.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(he=e==null?void 0:e.attributes)==null?void 0:he.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(Vt,{text:!0,size:"small",tooltip:"Advanced settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx(Vt,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{S(e,s,i,a,r,n),h()},tooltip:"Clone"}),o.jsx(Vt,{text:!0,className:"p-button-danger",size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{P()},tooltip:"Delete"}),(g===S3||g===z0)&&o.jsx(Vt,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",tooltip:"Save as custom component",onClick:()=>{j()}})]}),o.jsxs(Gs,{header:"Custom component save",visible:N,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx(Vt,{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(Vt,{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:(k==null?void 0:k.custom_component_title)||"",onChange:q=>{var W;return v("custom_component_title",(W=q==null?void 0:q.target)==null?void 0:W.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(fo,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(k==null?void 0:k.custom_component_description)||"",onChange:q=>{var W;return v("custom_component_description",(W=q==null?void 0:q.target)==null?void 0:W.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},zle=t=>{var Z,H,Y,oe,be,Ce,ve,ye;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isRenderView:d,isPreview:f}=Wt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=on(),{taskRegisterData:v,updateTaskRegisterData:m,updateTaskProgressValue:A,updateUserFormDataSubmit:S,userTaskSubmitFormData:T}=wr(),[C,x]=F.useState(!1),[w,I]=F.useState(!1),[_,N]=F.useState(null),[O,k]=F.useState(0),[M,j]=F.useState(!1),P=()=>{j(!0)},$=()=>{j(!1)},K=te=>{x(te)},ce=()=>{x(!1)},X=()=>{var te,L,le;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const ie=[...a.repeatableFields],ue=Et.findIndex(ie,function(Ne){return Ne.uuid===(r==null?void 0:r.uuid)});ue>=0&&ie[ue].fieldData?N(ie[ue].fieldData):(r.isValid=0,N(null))}}else{const ie=T,ue=Et.cloneDeep(v);if(ie!=null&&ie.length){for(const Ne of ie)if(Ne.fieldId===t.field.uuid&&((te=Ne==null?void 0:Ne.postData)!=null&&te.length)){N((L=Ne==null?void 0:Ne.postData[0])==null?void 0:L.postValue),ue[r==null?void 0:r.uuid]=(le=Ne==null?void 0:Ne.postData[0])==null?void 0:le.postValue;const _e=Object.keys(ue).length;A(_e);break}}}I(!0)},ne=te=>{var ue;N(te.target.value);const L=T,le=Et.cloneDeep(v);if((ue=te==null?void 0:te.target)!=null&&ue.value&&(L==null?void 0:L.length)>0)for(const Ne of L)Ne.fieldId===t.field.uuid&&(le[r==null?void 0:r.uuid]=te==null?void 0:te.value,Ne.postData[0]={postValue:te.value});else delete le[r==null?void 0:r.uuid];m(le);const ie=Object.keys(le).length;A(ie)};F.useEffect(()=>{w||X();const te=Qt.addListener("clearRepeatableFields",ie=>{ie===(a==null?void 0:a.uuid)&&(N(null),k(0),r.isValid=0,g(e,n,s,l,i,r))}),L=Qt.addListener("onSubmitUserForm",()=>{var ie;(ie=r==null?void 0:r.attributes)!=null&&ie.required?_!==null||_!==void 0?r.isValid=1:(console.log("Countr field in valid ",_),r.isValid=0):r.isValid=1}),le=Qt.addListener("OnInvalidFieldCatch",ie=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(ie==null?void 0:ie.fieldId)),r.uuid===(ie==null?void 0:ie.fieldId)?k(1):k(0)});return()=>{L.remove(),le.remove(),te.remove()}});const he=(te,L)=>{var le;if(T){const ie=[...T],ue=Et.findIndex(ie,function(_e){return _e.rowId===(a==null?void 0:a.uuid)});let Ne=(le=T[ue])==null?void 0:le.repeatableFields;Ne={...Ne,[te==null?void 0:te.uuid]:L},ie[ue]={...ie[ue],repeatableFields:Ne},S(ie)}N(L),L!==null?te.isValid=1:te.isValid=0},q=(te,L)=>te?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:te.name,src:te==null?void 0:te.image,onError:le=>le.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:te.name})]}):o.jsx("span",{children:L.placeholder}),W=te=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:te.name,src:te==null?void 0:te.image,onError:L=>L.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:te.name})]}),Q=o.jsxs("div",{onMouseOver:P,onMouseOut:$,children:[!d&&!f&&M&&o.jsx(Jr,{handleFieldSettingsSidebar:K,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(r==null?void 0:r.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"field-form-builder col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(Z=r==null?void 0:r.headerText)==null?void 0:Z[h==null?void 0:h.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(fa,{...t}),((H=r==null?void 0:r.attributes)==null?void 0:H.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(Y=r==null?void 0:r.label)==null?void 0:Y[h==null?void 0:h.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(qi,{message:(oe=r==null?void 0:r.toolTip)==null?void 0:oe[h==null?void 0:h.type],position:"right"})})]}),o.jsx(Va,{className:"country-select-builder-component",onFocus:()=>k(1),onChange:te=>{a!=null&&a.rowIsRepeatable?he(r,te.target.value):ne(te)},options:r==null?void 0:r.countries,optionLabel:"name",value:_,placeholder:(be=r==null?void 0:r.placeholder)==null?void 0:be[h==null?void 0:h.type],disabled:c,valueTemplate:q,itemTemplate:W,filter:!0,filterBy:"name",showClear:!0}),((Ce=r==null?void 0:r.attributes)==null?void 0:Ce.required)&&o.jsx("small",{className:"error",children:O===1&&_===null?((ve=r==null?void 0:r.validationMesssage)==null?void 0:ve[h==null?void 0:h.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(ye=r==null?void 0:r.helperText)==null?void 0:ye[h==null?void 0:h.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[C===!0&&o.jsx(ea,{visibilty:C,closeSettingFieldSidebar:ce,...t},r==null?void 0:r.uuid),o.jsx(Ti,{...t,fieldWrap:Q})]})},Hle=t=>{var Y,oe,be,Ce,ve,ye,te,L,le,ie,ue,Ne,_e,me,se;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:a,task_status:s,TASK_PUBLISHED:l}=wr(),{userSelectedLanguage:c,fieldSettingUpdate:u}=on(),{field:d,fieldIndex:f,sectionIndex:h,pageIndex:g,row:v,rowIndex:m,columnIndex:A,isDisabled:S}=t,{isAdmin:T,isRenderView:C,isPreview:x}=Wt(),[w,I]=F.useState(!1),[_,N]=F.useState(""),[O,k]=F.useState(null),[M,j]=F.useState(0),[P,$]=F.useState(!1),[K,ce]=F.useState(!1),X=()=>{ce(!0)},ne=()=>{ce(!1)},he=()=>{var we,ke,R;if(v!=null&&v.rowIsRepeatable){if(v!=null&&v.repeatableFields){const Ae=[...v.repeatableFields],Se=Et.findIndex(Ae,function(fe){return fe.uuid===(d==null?void 0:d.uuid)});Se>=0&&Ae[Se].fieldData?N(Ae[Se].fieldData):N("")}}else{const Ae=a;if(Ae!=null&&Ae.length){for(const Se of Ae)if(Se.fieldId===t.field.uuid&&((we=Se==null?void 0:Se.postData[0])==null?void 0:we.postValue)!==""&&((ke=Se==null?void 0:Se.postData[0])!=null&&ke.postValue)){N((R=Se==null?void 0:Se.postData[0])==null?void 0:R.postValue);break}}}$(!0)};F.useEffect(()=>{P||he();const we=Qt.addListener("clearRepeatableFields",fe=>{fe===(v==null?void 0:v.uuid)&&(N(""),j(0),d.isValid=0,u(g,h,m,A,f,d))}),ke=Qt.addListener("onSubmitUserForm",()=>{var fe,ge;(fe=d==null?void 0:d.attributes)!=null&&fe.required?_&&_.length&&(_==null?void 0:_.length)<((ge=d==null?void 0:d.attributes)==null?void 0:ge.minLength)?d.isValid=1:d.isValid=0:d.isValid=1}),R=Qt.addListener("OnInvalidFieldCatch",fe=>{d.uuid===(fe==null?void 0:fe.fieldId)?j(1):j(0)}),Ae=Qt.addListener("OnGetFieldValue",fe=>{var pe;const ge=(pe=fe==null?void 0:fe.repeatableColumn)==null?void 0:pe.filter(Ve=>(Ve==null?void 0:Ve.fieldUuid)===(d==null?void 0:d.uuid));ge!=null&&ge.length}),Se=Qt.addListener("formFieldAdded",fe=>{O===null&&k(fe==null?void 0:fe.uuid)});return()=>{ke.remove(),R.remove(),Ae.remove(),we.remove(),Se.remove()}}),F.useEffect(()=>(O!==null&&setTimeout(()=>{k(null)},1e3),()=>{}),[O]);const q=we=>{I(we)},W=()=>{I(!1)},Q=we=>{var Ae,Se;N(we.target.value);const ke=a,R=Et.cloneDeep(e);if(ke!==null){if((Ae=we==null?void 0:we.target)!=null&&Ae.value){if(R[d==null?void 0:d.uuid]=(Se=we==null?void 0:we.target)==null?void 0:Se.value,(ke==null?void 0:ke.length)>0)for(const fe of ke)fe.fieldId===t.field.uuid&&(fe.postData[0]={postValue:we.target.value})}else if(delete R[d==null?void 0:d.uuid],(ke==null?void 0:ke.length)>0)for(const fe of ke)fe.fieldId===t.field.uuid&&(fe.postData[0]={postValue:""})}if(console.log("row?.rowIsRepeatable",v==null?void 0:v.rowIsRepeatable),!(v!=null&&v.rowIsRepeatable)){n(R);const fe=Object.keys(R).length;r(fe)}},Z=(we,ke)=>{var R;if(a){const Ae=[...a],Se=Et.findIndex(Ae,function(ge){return ge.rowId===(v==null?void 0:v.uuid)});let fe=(R=a[Se])==null?void 0:R.repeatableFields;fe={...fe,[we==null?void 0:we.uuid]:ke},Ae[Se]={...Ae[Se],repeatableFields:fe},i(Ae)}N(ke),ke!==""?we.isValid=1:we.isValid=0},H=o.jsxs("div",{onMouseOver:X,onMouseOut:ne,children:[!C&&!x&&K&&o.jsx(Jr,{handleFieldSettingsSidebar:q,...t}),o.jsxs("div",{className:`field ${x?" ":" builder-element-wrapper "} ${(d==null?void 0:d.isFluid)===!0?" p-fluid ":""} ${C?" ":" py-6 px-4 "} ${O===(d==null?void 0:d.uuid)?" new-field ":" card "} `,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:T?"col-6 ":"col-12 p-fluid",children:[(d==null?void 0:d.showHeaderText)&&o.jsx("h6",{children:(Y=d==null?void 0:d.headerText)==null?void 0:Y[c==null?void 0:c.type]}),(d==null?void 0:d.showLabel)&&o.jsxs("label",{htmlFor:d==null?void 0:d.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(fa,{...t}),((oe=d==null?void 0:d.attributes)==null?void 0:oe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",x?o.jsx(o.Fragment,{children:(be=d==null?void 0:d.label)==null?void 0:be[c==null?void 0:c.type]}):o.jsx(la,{...t}),(d==null?void 0:d.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(qi,{message:(Ce=d==null?void 0:d.toolTip)==null?void 0:Ce[c==null?void 0:c.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(d==null?void 0:d.iconAlignment),children:[(d==null?void 0:d.showIcon)&&o.jsx("i",{className:"pi pi-"+((ye=(ve=d==null?void 0:d.icon)==null?void 0:ve.properties)==null?void 0:ye.name)}),o.jsx(wn,{id:d==null?void 0:d.uuid,placeholder:(te=d==null?void 0:d.placeholder)==null?void 0:te[c==null?void 0:c.type],minLength:(L=d==null?void 0:d.attributes)==null?void 0:L.minLength,maxLength:(le=d==null?void 0:d.attributes)==null?void 0:le.maxLength,value:_,onFocus:()=>j(1),onChange:we=>{v!=null&&v.rowIsRepeatable?Z(d,we.target.value):Q(we)},className:M===1&&((ie=d==null?void 0:d.attributes)!=null&&ie.required)?_?"valid":"invalid":"valid'",readOnly:S})]}),o.jsx("div",{children:((ue=d==null?void 0:d.attributes)==null?void 0:ue.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:M===1&&!_?(Ne=d==null?void 0:d.validationMesssage)==null?void 0:Ne.english:""}),o.jsx("small",{className:"error",children:M===1&&_.length&&(_==null?void 0:_.length)<((_e=d==null?void 0:d.attributes)==null?void 0:_e.minLength)?`Mini length ${(me=d==null?void 0:d.attributes)==null?void 0:me.minLength}`:""})]})}),o.jsx("div",{children:(d==null?void 0:d.showHelperText)&&o.jsx("small",{children:(se=d==null?void 0:d.helperText)==null?void 0:se[c==null?void 0:c.type]})})]})]})}),T&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[w===!0&&o.jsx(ea,{visibilty:w,closeSettingFieldSidebar:W,...t}),o.jsx(Ti,{...t,fieldWrap:H})]})},Yle=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)})]})]})},Kle=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(Kr,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},Rle=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=t,[u,d]=F.useState(n),{fieldSettingUpdate:f,formBuilderSchemaLanguages:h,formBuilderPublishedStatus:g}=on(),{updateGlobalToast:v}=Wt(),m=(T,C,x)=>{d(w=>({...w,[T]:{...w[T],[C==null?void 0:C.type]:x}}))},A=(T,C)=>{d(x=>({...x,[T]:C}))},S=()=>{f(i,a,s,l,c,u),v({showToast:!0,toastMessage:"Updated",toastDetail:"Html updated",toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(No,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[t==null?void 0:t.typeName," settings "]})]}),!g&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx(Vt,{className:"mt-3",label:"Update",type:"button",onClick:()=>S(),"aria-label":"Update"})})]}),o.jsxs(as,{children:[o.jsx(Sr,{header:"Text",children:o.jsx(uo,{activeIndex:0,children:h!=null&&h.length?h.map((T,C)=>o.jsx(co,{tabIndex:C,header:T==null?void 0:T.language,children:o.jsx(Yle,{language:T,fieldState:u,onHandleChange:m,...t})},C)):""})}),o.jsx(Sr,{header:"Styling",children:o.jsx(Kle,{fieldState:u,onHandleChangeStyling:A,...t})})]})]})})},Xle=t=>{var g,v,m,A,S,T,C,x,w;const{field:e}=t,{userSelectedLanguage:n}=on(),{isPreview:r}=Wt(),[i,a]=F.useState(!1),[s,l]=F.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=I=>{a(I)},f=()=>{a(!1)};F.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"":"builder-element-wrapper",onMouseOver:c,onMouseOut:u,children:[!r&&s&&o.jsx(Jr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?" px-4":"field-form-builder px-4",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(g=e==null?void 0:e.headerText)==null?void 0:g[n==null?void 0:n.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-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(o.Fragment,{children:(m=e==null?void 0:e.label)==null?void 0:m[n==null?void 0:n.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(qi,{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:(S=e==null?void 0:e.hrefLink)==null?void 0:S[n==null?void 0:n.type],children:(T=e==null?void 0:e.text)==null?void 0:T[n==null?void 0:n.type]}),((C=e==null?void 0:e.attributes)==null?void 0:C.required)&&o.jsx("small",{className:"error",children:(x=e==null?void 0:e.validationMesssage)==null?void 0:x[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(w=e==null?void 0:e.helperText)==null?void 0:w[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Rle,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(Ti,{...t,fieldWrap:h})]})},Gle=t=>{var Y,oe,be,Ce,ve,ye,te,L,le,ie,ue,Ne,_e,me,se,we,ke,R,Ae,Se,fe;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isPreview:u,isRenderView:d,isAdmin:f}=Wt(),{taskRegisterData:h,updateTaskRegisterData:g,updateTaskProgressValue:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,TASK_PUBLISHED:S,task_status:T}=wr(),{userSelectedLanguage:C,fieldSettingUpdate:x}=on(),[w,I]=F.useState(null),[_,N]=F.useState(!1),[O,k]=F.useState(null),[M,j]=F.useState(0),[P,$]=F.useState(!1),[K,ce]=F.useState(!1),X=()=>{ce(!0)},ne=()=>{ce(!1)},he=()=>{var ge,pe;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ve=[...a.repeatableFields],De=Et.findIndex(Ve,function(He){return He.uuid===(e==null?void 0:e.uuid)});De>=0&&Ve[De].fieldData?k(Number(Ve[De].fieldData)||null):k(null)}}else{const Ve=A;if(Ve!=null&&Ve.length){for(const De of Ve)if(De.fieldId===t.field.uuid&&((ge=De==null?void 0:De.postData)!=null&&ge.length)){k(Number((pe=De==null?void 0:De.postData[0])==null?void 0:pe.postValue)||null);break}}}$(!0)};F.useEffect(()=>{P||he();const ge=Qt.addListener("clearRepeatableFields",it=>{it===(a==null?void 0:a.uuid)&&(k(null),j(0),e.isValid=0,x(i,r,s,l,n,e))}),pe=Qt.addListener("onSubmitUserForm",()=>{var it;(it=e==null?void 0:e.attributes)!=null&&it.required?O?e.isValid=1:e.isValid=0:e.isValid=1}),Ve=Qt.addListener("OnInvalidFieldCatch",it=>{e.uuid===(it==null?void 0:it.fieldId)?j(1):j(0)}),De=Qt.addListener("OnGetFieldValue",it=>{var dt;const ut=(dt=it==null?void 0:it.repeatableColumn)==null?void 0:dt.filter(Bt=>(Bt==null?void 0:Bt.fieldUuid)===(e==null?void 0:e.uuid));ut!=null&&ut.length}),He=Qt.addListener("formFieldAdded",it=>{w===null&&I(it.uuid)});return()=>{pe.remove(),Ve.remove(),De.remove(),ge.remove(),He.remove()}}),F.useEffect(()=>(w!==null&&setTimeout(()=>{I(null)},1e3),()=>{}),[w]);const q=ge=>{N(ge)},W=()=>{N(!1)},Q=ge=>{const pe=A,Ve=Et.cloneDeep(h);if(pe!==null){if(ge){if(Ve[e==null?void 0:e.uuid]=ge,(pe==null?void 0:pe.length)>0)for(const De of pe)De.fieldId===t.field.uuid&&(De.postData[0]={postValue:ge})}else if(delete Ve[e==null?void 0:e.uuid],(pe==null?void 0:pe.length)>0)for(const De of pe)De.fieldId===t.field.uuid&&(De.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){g(Ve);const De=Object.keys(Ve).length;v(De)}},Z=(ge,pe)=>{var Ve;if(A!=null&&A.length){const De=[...A],He=Et.findIndex(De,function(ut){return ut.rowId===(a==null?void 0:a.uuid)});let it=(Ve=A[He])==null?void 0:Ve.repeatableFields;it={...it,[ge==null?void 0:ge.uuid]:pe},De[He]={...De[He],repeatableFields:it},m(De)}k(pe),pe!==""?ge.isValid=1:ge.isValid=0},H=o.jsxs("div",{onMouseOver:X,onMouseOut:ne,children:[!d&&!u&&K&&o.jsx(Jr,{handleFieldSettingsSidebar:q,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" p-fluid py-6 px-4":" py-6 px-4"} ${w===(e==null?void 0:e.uuid)?" new-field ":" card "}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Y=e==null?void 0:e.headerText)==null?void 0:Y[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(fa,{...t}),((oe=e==null?void 0:e.attributes)==null?void 0:oe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[C==null?void 0:C.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(qi,{message:(Ce=e==null?void 0:e.toolTip)==null?void 0:Ce[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-"+((ye=(ve=e==null?void 0:e.icon)==null?void 0:ve.properties)==null?void 0:ye.name)}),o.jsx(ao,{readOnly:c,id:e==null?void 0:e.uuid,placeholder:(te=e==null?void 0:e.placeholder)==null?void 0:te[C==null?void 0:C.type],value:O,min:(L=e==null?void 0:e.attributes)==null?void 0:L.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(le=e==null?void 0:e.attributes)==null?void 0:le.prefix,showButtons:(ie=e==null?void 0:e.attributes)==null?void 0:ie.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(ue=e==null?void 0:e.attributes)==null?void 0:ue.minFractionDigits,maxFractionDigits:(Ne=e==null?void 0:e.attributes)==null?void 0:Ne.maxFractionDigits,locale:(_e=e==null?void 0:e.attributes)==null?void 0:_e.locale,mode:(me=e==null?void 0:e.attributes)==null?void 0:me.mode,currency:(se=e==null?void 0:e.attributes)==null?void 0:se.currency,currencyDisplay:(we=e==null?void 0:e.attributes)==null?void 0:we.currencyDisplay,useGrouping:(ke=e==null?void 0:e.attributes)==null?void 0:ke.useGrouping,onFocus:()=>j(1),onChange:ge=>{a!=null&&a.rowIsRepeatable?Z(e,ge.value):Q(ge.value)},className:M===1&&((R=e==null?void 0:e.attributes)!=null&&R.required)?O?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("small",{className:"error",children:M===1&&!O?(Se=e==null?void 0:e.validationMesssage)==null?void 0:Se.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(fe=e==null?void 0:e.helperText)==null?void 0:fe[C==null?void 0:C.type]})})]})]})}),f&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[_===!0&&o.jsx(ea,{visibilty:_,closeSettingFieldSidebar:W,...t}),o.jsx(Ti,{...t,fieldWrap:H})]})},vb=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],n4=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,mu=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+\$,\\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/;function zO(t){try{JSON.parse(t)}catch{return!1}return!0}function HO(t){if(t<26)return vb[t];{const e=Math.floor(t/26)-1,n=t%26;return vb[e]+vb[n]}}const Wle=t=>{var Q,Z,H,Y,oe,be,Ce,ve,ye,te,L;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,row:a,update:s,value:l,isDisabled:c}=t,{isPreview:u,isAdmin:d,isRenderView:f}=Wt(),{task_status:h,taskRegisterData:g,updateTaskRegisterData:v,updateTaskProgressValue:m,updateUserFormDataSubmit:A,userTaskSubmitFormData:S,TASK_PUBLISHED:T}=wr(),{userSelectedLanguage:C}=on(),[x,w]=F.useState(!1),[I,_]=F.useState(""),[N,O]=F.useState(0),[k,M]=F.useState(!1),j=()=>{M(!0)},P=()=>{M(!1)};F.useEffect(()=>{x||ne();const le=Qt.addListener("clearRepeatableFields",ue=>{ue===(a==null?void 0:a.uuid)&&(_(""),O(0),e.isValid=0)}),ie=Qt.addListener("onSubmitUserForm",()=>{var ue;(ue=e==null?void 0:e.attributes)!=null&&ue.required?I!==""&&n4.test(I)===!0?e.isValid=1:e.isValid=0:e.isValid=1});return()=>{ie.remove(),le.remove()}});const[$,K]=F.useState(!1),ce=le=>{K(le)},X=()=>{K(!1)},ne=()=>{var le,ie,ue;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ne=[...a.repeatableFields],_e=Et.findIndex(Ne,function(me){return me.uuid===(e==null?void 0:e.uuid)});_e>=0&&Ne[_e].fieldData?_(Ne[_e].fieldData):_("")}}else{const Ne=S;if(Ne!=null&&Ne.length){for(const _e of Ne)if(_e.fieldId===t.field.uuid&&((le=_e==null?void 0:_e.postData[0])==null?void 0:le.postValue)!==""&&((ie=_e==null?void 0:_e.postData[0])!=null&&ie.postValue)){_((ue=_e==null?void 0:_e.postData[0])==null?void 0:ue.postValue),w(!0);break}}}w(!0)},he=le=>{_(le);const ie=S,ue=Et.cloneDeep(g);if(ie!==null){if(le!==""&&n4.test(le)===!0){if(ue[e==null?void 0:e.uuid]=le,(ie==null?void 0:ie.length)>0)for(const Ne of ie)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:le})}else if(delete ue[e==null?void 0:e.uuid],(ie==null?void 0:ie.length)>0)for(const Ne of ie)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){v(ue);const Ne=Object.keys(ue).length;m(Ne)}},q=(le,ie,ue,Ne)=>{var _e;if(_(Ne),S!==null){const me=[...S],se=Et.findIndex(me,function(ke){return ke.rowId===(a==null?void 0:a.uuid)});let we=(_e=S[se])==null?void 0:_e.repeatableFields;we={...we,[ue==null?void 0:ue.uuid]:Ne},me[se]={...me[se],repeatableFields:we},A(me),Ne!==""&&n4.test(Ne)===!0?e.isValid=1:e.isValid=0}},W=o.jsxs("div",{onMouseOver:j,onMouseOut:P,children:[!f&&!u&&k&&o.jsx(Jr,{handleFieldSettingsSidebar:ce,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Q=e==null?void 0:e.headerText)==null?void 0:Q[C==null?void 0:C.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(fa,{...t,update:s,value:l}),((Z=e==null?void 0:e.attributes)==null?void 0:Z.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(H=e==null?void 0:e.label)==null?void 0:H[C==null?void 0:C.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-2",children:(e==null?void 0:e.showToolTip)&&o.jsx(o.Fragment,{children:o.jsx(qi,{message:(Y=e==null?void 0:e.toolTip)==null?void 0:Y[C==null?void 0:C.type],position:"right"})})})]}),o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((be=(oe=e==null?void 0:e.icon)==null?void 0:oe.properties)==null?void 0:be.name)}),o.jsx(wn,{id:e==null?void 0:e.uuid,placeholder:(Ce=e==null?void 0:e.placeholder)==null?void 0:Ce[C==null?void 0:C.type],value:I,onFocus:()=>O(1),onChange:le=>{a!=null&&a.rowIsRepeatable?q(r,i,{uuid:e.uuid},le.target.value):he(le.target.value)},className:N===1&&((ve=e==null?void 0:e.attributes)!=null&&ve.required)?I?"valid":"invalid":"valid'",readOnly:c})]}),((ye=e==null?void 0:e.attributes)==null?void 0:ye.required)&&o.jsx("div",{children:o.jsx("small",{className:"error",children:N===1&&(I===null||I==="")?(te=e==null?void 0:e.validationMesssage)==null?void 0:te[C==null?void 0:C.language]:""})}),I!==""&&N===1&&n4.test(I)===!1&&o.jsx("small",{className:"error",children:"Please enter correct email"}),(e==null?void 0:e.showHelperText)&&o.jsx("div",{children:o.jsx("small",{children:(L=e==null?void 0:e.helperText)==null?void 0:L[C==null?void 0:C.type]})})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]});return o.jsxs(o.Fragment,{children:[$===!0&&o.jsx(ea,{visibilty:$,closeSettingFieldSidebar:X,...t},e==null?void 0:e.uuid),o.jsx(Ti,{...t,fieldWrap:W})]})},Qle=t=>{var Y,oe,be,Ce,ve,ye,te,L,le;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,row:l,isDisabled:c}=t,{isRenderView:u,isAdmin:d,isPreview:f}=Wt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=on(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:S,updateUserFormDataSubmit:T,userTaskSubmitFormData:C,TASK_PUBLISHED:x}=wr(),[w,I]=F.useState(!1),[_,N]=F.useState(""),[O,k]=F.useState(0),[M,j]=F.useState(!1),[P,$]=F.useState(!1),[K,ce]=F.useState(!1),X=()=>{$(!0)},ne=()=>{$(!1)},he=ie=>{I(ie)},q=()=>{I(!1)},W=()=>{var ue,Ne,_e;const ie=C;if(l!=null&&l.rowIsRepeatable){if(l!=null&&l.repeatableFields){const me=[...l.repeatableFields],se=Et.findIndex(me,function(we){return we.uuid===(e==null?void 0:e.uuid)});se>=0&&me[se].fieldData?N(me[se].fieldData):(e.isValid=0,N(""))}}else if(ie!=null&&ie.length){for(const me of ie)if(me.fieldId===t.field.uuid&&((ue=me==null?void 0:me.postData[0])!=null&&ue.postValue)&&((Ne=me==null?void 0:me.postData[0])==null?void 0:Ne.postValue)!==""){N((_e=me==null?void 0:me.postData[0])==null?void 0:_e.postValue),j(!0);break}}j(!0)},Q=(ie,ue,Ne,_e)=>{var me;if(C!=null&&C.length){const se=[...C],we=Et.findIndex(se,function(R){return R.rowId===(l==null?void 0:l.uuid)});let ke=(me=C[we])==null?void 0:me.repeatableFields;ke={...ke,[Ne==null?void 0:Ne.uuid]:_e},se[we]={...se[we],repeatableFields:ke},T(se)}N(_e),_e!==""?e.isValid=1:e.isValid=0,g(ie,ue,a,s,n,e)};F.useEffect(()=>{M||W();const ie=Qt.addListener("clearRepeatableFields",se=>{se===(l==null?void 0:l.uuid)&&(N(""),k(0),e.isValid=0)}),ue=Qt.addListener("onSubmitUserForm",()=>{var se;(se=e==null?void 0:e.attributes)!=null&&se.required?_?e.isValid=1:e.isValid=0:e.isValid=1}),Ne=Qt.addListener("OnInvalidFieldCatch",se=>{e.uuid===(se==null?void 0:se.fieldId)?k(1):k(0)}),_e=Qt.addListener("OnGetFieldValue",se=>{var ke;const we=(ke=se==null?void 0:se.repeatableColumn)==null?void 0:ke.filter(R=>(R==null?void 0:R.fieldUuid)===(e==null?void 0:e.uuid));we!=null&&we.length}),me=Qt.addListener("onUpdateField",()=>{ce(!K)});return()=>{me.remove(),ue.remove(),Ne.remove(),_e.remove(),ie.remove()}});const Z=ie=>{var _e,me;N(ie.target.value);const ue=C,Ne=Et.cloneDeep(m);if(ue!==null){if((_e=ie==null?void 0:ie.target)!=null&&_e.value){if(Ne[e==null?void 0:e.uuid]=(me=ie==null?void 0:ie.target)==null?void 0:me.value,(ue==null?void 0:ue.length)>0)for(const se of ue)se.fieldId===t.field.uuid&&(se.postData[0]={postValue:ie.target.value})}else if(delete Ne[e==null?void 0:e.uuid],(ue==null?void 0:ue.length)>0)for(const se of ue)se.fieldId===t.field.uuid&&(se.postData[0]={postValue:""})}if(!(l!=null&&l.rowIsRepeatable)){A(Ne);const se=Object.keys(Ne).length;S(se)}},H=o.jsxs("div",{onMouseOver:X,onMouseOut:ne,children:[!u&&!f&&P&&o.jsx(Jr,{handleFieldSettingsSidebar:he,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?"card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"col-12 field-form-builder ",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Y=e==null?void 0:e.headerText)==null?void 0:Y[h==null?void 0:h.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(fa,{...t}),((oe=e==null?void 0:e.attributes)==null?void 0:oe.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(la,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(qi,{message:(Ce=e==null?void 0:e.toolTip)==null?void 0:Ce[h==null?void 0:h.type],position:"right"})})]}),o.jsx(fo,{rows:e==null?void 0:e.textareaRows,cols:e==null?void 0:e.textareaCols,autoResize:e==null?void 0:e.resizable,id:e==null?void 0:e.uuid,placeholder:(ve=e==null?void 0:e.placeholder)==null?void 0:ve[h==null?void 0:h.type],value:_,onFocus:()=>k(1),onChange:ie=>{l!=null&&l.rowIsRepeatable?Q(r,i,e,ie.target.value):Z(ie)},className:O===1&&((ye=e==null?void 0:e.attributes)!=null&&ye.required)?_?"valid":"invalid":"valid",readOnly:c}),o.jsx("div",{children:((te=e==null?void 0:e.attributes)==null?void 0:te.required)&&o.jsx("small",{className:"error",children:O===1&&!_?(L=e==null?void 0:e.validationMesssage)==null?void 0:L[h==null?void 0:h.type]:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(le=e==null?void 0:e.helperText)==null?void 0:le[h==null?void 0:h.type]})})]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Pi,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[w===!0&&o.jsx(ea,{visibilty:w,closeSettingFieldSidebar:q,...t},e==null?void 0:e.uuid),o.jsx(Ti,{...t,fieldWrap:H})]})},Jle={},bb=t=>{var _,N,O,k;const{isAdmin:e,isAdvanceView:n,isPreview:r}=Wt(),{handleDrop:i}=on(),{data:a,path:s,pageIndex:l,sectionIndex:c,rowIndex:u,columnIndex:d,conditionIndex:f,ruleIndex:h,condition:g,page:v,section:m,row:A,column:S}=t,T=F.useRef(null),[{isDragging:C},x]=sa({type:iT,item:{type:iT,uuid:a.uuid,children:a.children,path:s},collect:M=>({isDragging:M.isDragging()})}),w=C?0:1;x(T);const I=(M,j,P,$,K,ce,X)=>{const ne=t!=null&&t.fieldContainer?t==null?void 0:t.fieldContainer:"inline-condition-container";return o.jsx(Yc,{type:"inline-conditional",field:M,data:M,path:j,page:v,section:m,row:A,column:S,pageIndex:P,sectionIndex:$,rowIndex:K,columnIndex:ce,fieldIndex:X,isAdmin:e,fieldContainer:ne},M.uuid)};return o.jsxs("div",{ref:r===!1?T:null,style:{...Jle,opacity:w},className:"draggable column",children:[g&&((_=g.children)==null?void 0:_.length)===0&&o.jsx("p",{className:"text-primary text-center",children:"Drag item here"}),g&&g.children&&((N=g.children)==null?void 0:N.length)>0&&g.children.map((M,j)=>{var P;return o.jsxs(F.Fragment,{children:[r===!1&&o.jsx(kr,{isAdvanceView:n,data:{path:`${s}-${h}-${f}-${j}`,childrenCount:(P=g==null?void 0:g.children)==null?void 0:P.length,droppedField:g},onDrop:i}),I(M,`${s}-${h}-${f}-${j}`,l,c,u,d,j)]},M.uuid)}),r===!1&&o.jsx(kr,{isAdvanceView:n,fieldDropArea:!0,data:{path:`${s}-${h}-${f}-${(O=g==null?void 0:g.children)==null?void 0:O.length}`,childrenCount:(k=g==null?void 0:g.children)==null?void 0:k.length,droppedField:g},onDrop:i,isLast:!0})]})},s0=t=>{const{inputValue:e,condition:n,ruleIndex:r,conditionIndex:i,field:a,section:s,page:l,row:c,pageIndex:u,sectionIndex:d,rowIndex:f,columnIndex:h,isConditionTrue:g}=t,{taskRegisterData:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,updateProgressDataValuesHook:S}=wr(),T=F.useCallback((C,x,w)=>{var _,N,O;const I=A;if(I!=null&&I.length){const k=v,M=(_=a==null?void 0:a.inlineConditionalRules)==null?void 0:_.rules[x].conditions[w].children;for(const[P,$]of M.entries()){(N=$==null?void 0:$.attributes)!=null&&N.required;const K=Et.findIndex(I,function(ce){return ce.fieldId===$.uuid});C?K===-1&&(I.push({postData:[],tabId:l.uuid,tabIndex:u,...a.inlineConditionalRules?{inlineConditionalRules:a.inlineConditionalRules}:{},...a.conditionalTabRules?{conditionalTabRules:a.conditionalTabRules}:{},...a.conditionalSectionRules?{conditionalSectionRules:a.conditionalSectionRules}:{},sectionId:s.uuid,sectionIndex:d,sectionHeading:s.heading,subHeadingText:s.subHeadingText,reviewerChecklist:a==null?void 0:a.reviewerChecklist,rowId:c.uuid,rowIndex:f,columnId:s.uuid,columnIndex:h,inlineConditionalField:!0,fieldIndex:P,fieldId:$.uuid,fieldInputType:a.componentType,fieldTitle:(O=a.label)==null?void 0:O.english,fieldDescription:a.description||null,fieldHelperText:a.helperText||null,fieldHeaderText:a.headerText||null,fieldFooterText:a.footerText||null,fieldTitleAbb:a.abbreviationLabel||a.label,question_abb_table:a.textForTable||null,language:"english",isHiddenfield:a.isHidden&&a.isHidden===1?1:0,isHiddenSection:s.isHidden&&s.isHidden===1?1:0}),k[$==null?void 0:$.uuid]&&delete k[$==null?void 0:$.uuid]):(k[$==null?void 0:$.uuid]&&delete k[$==null?void 0:$.uuid],K>=0&&I.splice(K,1))}const j=Object.keys(k).length;S({progressMaxValue:I==null?void 0:I.length,progressValue:j}),m(I)}},[h,a.abbreviationLabel,a.componentType,a.conditionalSectionRules,a.conditionalTabRules,a.description,a.footerText,a.headerText,a.helperText,a.inlineConditionalRules,a.isHidden,a.label,a==null?void 0:a.reviewerChecklist,a.textForTable,l.uuid,u,c.uuid,f,s.heading,s.isHidden,s.subHeadingText,s.uuid,d,v,S,m,A]);return F.useEffect(()=>(T(g,r,i),()=>{}),[i,e,g,r,T]),o.jsx("div",{children:g&&o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(bb,{...t,ruleIndex:r,conditionIndex:i,condition:n,data:a})})},i)})};function A2(t){"@babel/helpers - typeof";return A2=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},A2(t)}function Zle(t,e){if(A2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(A2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ece(t){var e=Zle(t,"string");return A2(e)=="symbol"?e:e+""}function yb(t,e,n){return(e=ece(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var tce={value:"p-tag-value",icon:"p-tag-icon",root:function(e){var n=e.props;return ht("p-tag p-component",yb(yb({},"p-tag-".concat(n.severity),n.severity!==null),"p-tag-rounded",n.rounded))}},nce=`
2394
2394
  @layer primereact {
2395
2395
  .p-tag {
2396
2396
  display: inline-flex;
@@ -4373,7 +4373,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
4373
4373
  stroke: #ffa700;
4374
4374
  }
4375
4375
  }
4376
- `,rTe={spinner:function(e){var n=e.props;return{animationDuration:n.animationDuration}}},Z5=Un.extend({defaultProps:{__TYPE:"ProgressSpinner",id:null,style:null,className:null,strokeWidth:"2",fill:"none",animationDuration:"2s",children:void 0},css:{classes:tTe,styles:nTe,inlineStyles:rTe}}),Vj=b.memo(b.forwardRef(function(t,e){var n=Rn(),r=b.useContext(or),i=Z5.getProps(t,r),a=b.useRef(null),s=Z5.setMetaData({props:i}),l=s.ptm,c=s.cx,u=s.sx,d=s.isUnstyled;ui(Z5.css.styles,d,{name:"progressspinner"}),b.useImperativeHandle(e,function(){return{props:i,getElement:function(){return a.current}}});var f=n({id:i.id,ref:a,style:i.style,className:ht(i.className,c("root")),role:"progressbar","aria-busy":!0},Z5.getOtherProps(i),l("root")),h=n({className:c("spinner"),viewBox:"25 25 50 50",style:u("spinner")},l("spinner")),g=n({className:c("circle"),cx:"50",cy:"50",r:"20",fill:i.fill,strokeWidth:i.strokeWidth,strokeMiterlimit:"10"},l("circle"));return b.createElement("div",f,b.createElement("svg",h,b.createElement("circle",g)))}));Vj.displayName="ProgressSpinner";const iTe=()=>{const{renderType:t,componentList:e,sectionsList:n,exam:r}=Wt(),{userSelectedLanguage:i,formBuilderFormLayout:a}=on(),s=4,l=0,c=1,u=2,d=5,f=()=>{const K=t;let ce=0;return K===Jd?ce=s:K===xm?ce=d:K===Cm||K===W9||K===af?ce=u:K===j0||K===fp?ce=c:K===z0&&(ce=l),ce},h=F.useRef(),g=r!=null&&r.getPaginatedAssessmentQuestionBankList?r==null?void 0:r.getPaginatedAssessmentQuestionBankList:()=>{},v=r!=null&&r.getPaginatedAssessmentQuestionBankListFromStore?r==null?void 0:r.getPaginatedAssessmentQuestionBankListFromStore:[],m=r!=null&&r.updateQuestionBankStates?r==null?void 0:r.updateQuestionBankStates:()=>{},A=r!=null&&r.assessmentSearchFilterCourseCategoryId?r==null?void 0:r.assessmentSearchFilterCourseCategoryId:null,S=r!=null&&r.assessmentSearchFilterCourseSubjectId?r==null?void 0:r.assessmentSearchFilterCourseSubjectId:null,T=r!=null&&r.AssessmentQuestionBankLoading?r==null?void 0:r.AssessmentQuestionBankLoading:!1,C=r!=null&&r.AssessmentQuestionBankPaginator?r==null?void 0:r.AssessmentQuestionBankPaginator:()=>o.jsx(o.Fragment,{});r!=null&&r.courseCategoryList&&(r==null||r.courseCategoryList);const x=r!=null&&r.getCourseCategoryList?r==null?void 0:r.getCourseCategoryList:()=>{};r!=null&&r.subjectList&&(r==null||r.subjectList);const w=r!=null&&r.getSubjectList?r==null?void 0:r.getSubjectList:()=>{},[I,_]=F.useState([]),[N,O]=F.useState("");F.useEffect(()=>(t===Jd&&(x(),w()),()=>{}),[t]);const k=F.useCallback(()=>{const K=v.map(ce=>{var he;const X=JSON.parse(ce.question_meta_data),ne=JSON.parse(ce.meta_data);return{label:(he=X==null?void 0:X.questionText)==null?void 0:he[i==null?void 0:i.type],icon:"pi pi-fw pi-trash",element:"radio",schema:{uuid:tt(),componentType:"question",questionText:X==null?void 0:X.questionText,questionTextImage:ne==null?void 0:ne.questionImage,answerInputType:X!=null&&X.answerInputType?X==null?void 0:X.answerInputType:"radio",answerOptions:X==null?void 0:X.answerOptions,isHidden:!1,subject_title:ce==null?void 0:ce.subject_title,course_category_title:ce==null?void 0:ce.course_category_title,subject_id:ce==null?void 0:ce.subject_id,course_category_id:ce==null?void 0:ce.course_category_id,created_by_id:null,date_created:ce==null?void 0:ce.created_at},subject_title:ce==null?void 0:ce.subject_title,course_category_title:ce==null?void 0:ce.course_category_title,uuid:tt(),type:nr,componentType:"question"}});_(K)},[v,i==null?void 0:i.type]);F.useEffect(()=>{k()},[]);const M=()=>{h.current&&h.current};F.useEffect(()=>(t===Jd&&g(),()=>{}),[t,A,S]);const j=()=>{m({filter:N,page:1,per_page:10,sort:"created_at|desc"})},[P,$]=F.useState(f());return F.useEffect(()=>{$(f())},[t]),o.jsx(o.Fragment,{children:o.jsxs(as,{activeIndex:P,onTabChange:K=>$(K.index),scrollable:!0,children:[t===z0&&o.jsx(Sr,{header:"Survey",children:CQ.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"xl:col-6 lg:col-12 md:col-12 sm:col-12",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))}),(t===j0||t===fp)&&o.jsx(Sr,{header:"Form",children:wQ.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid scroll-height-300",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"xl:col-6 lg:col-12 md:col-12 sm:col-12",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))}),(t===Cm||t===W9||t===af)&&o.jsx(Sr,{header:"Layout",children:AK.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid scroll-height-300",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))}),(t===z0||t===j0||t===fp)&&o.jsx(Sr,{header:"Layout",children:SQ.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid scroll-height-300",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))}),t===Jd&&o.jsx(Sr,{header:"Question bank",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-12",children:yK.map((K,ce)=>o.jsx("div",{className:"grid scroll-height-300",children:K==null?void 0:K.items.map((X,ne)=>{const he=Et.cloneDeep(X);return o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:he},X.uuid)},"form_elements_"+ne)})},`new-quiz-${ce}`))}),o.jsx("div",{className:"col-12 ",children:o.jsxs("div",{className:"p-inputgroup",children:[o.jsx(wn,{placeholder:"Keyword",onChange:K=>{O(K.target.value),K.target.value||(m({filter:"",page:1,per_page:10,sort:"created_at|desc"}),g())},onKeyDown:K=>K.key==="Enter"?j():null}),o.jsx(Vt,{icon:"pi pi-search",className:"p-button-info",onClick:()=>j()})]})}),T?o.jsx(Vj,{}):o.jsx("div",{className:"scroll-height-500 w-full",children:I.map((K,ce)=>{var X,ne,he,q,W;return o.jsx("div",{onScroll:M,ref:h,className:"col-12 ",children:o.jsx(kd,{tags:[{severity:"success",label:K==null?void 0:K.subject_title},{severity:"info",label:K==null?void 0:K.course_category_title}],showIcon:(W=(q=(he=(ne=(X=a[0])==null?void 0:X.children[0])==null?void 0:ne.children[0])==null?void 0:he.children[0])==null?void 0:q.children)==null?void 0:W.some(Q=>{var Z,H,Y;return((Z=Q==null?void 0:Q.questionText)==null?void 0:Z[i.type])===((Y=(H=K==null?void 0:K.schema)==null?void 0:H.questionText)==null?void 0:Y[i.type])}),data:K},ce)},"question_elements_"+ce)})}),o.jsx(C,{})]})}),t===xm&&o.jsx(Sr,{header:"Training",children:xQ.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid scroll-height-300",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))}),(t===z0||t===j0||t===fp)&&o.jsxs(Sr,{header:"Custom",children:[o.jsx("h6",{children:"Custom Sections"}),o.jsx("div",{className:"grid",children:(n==null?void 0:n.length)>0&&n.map((K,ce)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:{label:K==null?void 0:K.builder_element_title,element:"reusable_builder_section",schema:K==null?void 0:K.reusable_template_schema,uuid:tt(),type:aa}},K.uuid)},"reusable_elements_"+ce))}),o.jsx("h6",{children:"Custom Matrix"}),o.jsx("div",{className:"grid",children:(e==null?void 0:e.length)>0&&e.map((K,ce)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:{label:K==null?void 0:K.custom_component_title,element:"custom_component",schema:JSON.parse(K==null?void 0:K.custom_component_schema),uuid:tt(),type:nr}},K.uuid)},"custom_component"+ce))})]})]})})};function qj(t){return t}function aTe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var sTe=800,oTe=16,lTe=Date.now;function cTe(t){var e=0,n=0;return function(){var r=lTe(),i=oTe-(r-n);if(n=r,i>0){if(++e>=sTe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function uTe(t){return function(){return t}}var dTe=j3?function(t,e){return j3(t,"toString",{configurable:!0,enumerable:!1,value:uTe(e),writable:!0})}:qj,fTe=cTe(dTe),Uj=Math.max;function hTe(t,e,n){return e=Uj(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=Uj(r.length-e,0),s=Array(a);++i<a;)s[i]=r[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=r[i];return l[e]=n(s),aTe(t,this,l)}}function pTe(t,e){return fTe(hTe(t,e,qj),t+"")}function gTe(t,e,n){if(!a0(n))return!1;var r=typeof e;return(r=="number"?z3(n)&&MN(e,n.length):r=="string"&&e in n)?o2(n[e],t):!1}function mTe(t){return pTe(function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&gTe(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var l=n[r];l&&t(e,l,r,a)}return e})}var vTe="__lodash_hash_undefined__";function bTe(t){return this.__data__.set(t,vTe),this}function yTe(t){return this.__data__.has(t)}function e9(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new sd;++e<n;)this.add(t[e])}e9.prototype.add=e9.prototype.push=bTe,e9.prototype.has=yTe;function ATe(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function wTe(t,e){return t.has(e)}var STe=1,CTe=2;function $j(t,e,n,r,i,a){var s=n&STe,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var f=-1,h=!0,g=n&CTe?new e9:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var v=t[f],m=e[f];if(r)var A=s?r(m,v,f,e,t,a):r(v,m,f,t,e,a);if(A!==void 0){if(A)continue;h=!1;break}if(g){if(!ATe(e,function(S,T){if(!wTe(g,T)&&(v===S||i(v,S,n,r,a)))return g.push(T)})){h=!1;break}}else if(!(v===m||i(v,m,n,r,a))){h=!1;break}}return a.delete(t),a.delete(e),h}function xTe(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function TTe(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var ETe=1,ITe=2,_Te="[object Boolean]",DTe="[object Date]",NTe="[object Error]",OTe="[object Map]",FTe="[object Number]",kTe="[object RegExp]",PTe="[object Set]",MTe="[object String]",LTe="[object Symbol]",BTe="[object ArrayBuffer]",VTe="[object DataView]",jj=fu?fu.prototype:void 0,US=jj?jj.valueOf:void 0;function qTe(t,e,n,r,i,a,s){switch(n){case VTe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case BTe:return!(t.byteLength!=e.byteLength||!a(new H3(t),new H3(e)));case _Te:case DTe:case FTe:return o2(+t,+e);case NTe:return t.name==e.name&&t.message==e.message;case kTe:case MTe:return t==e+"";case OTe:var l=xTe;case PTe:var c=r&ETe;if(l||(l=TTe),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=ITe,s.set(t,e);var d=$j(l(t),l(e),r,i,a,s);return s.delete(t),d;case LTe:if(US)return US.call(t)==US.call(e)}return!1}var UTe=1,$Te=Object.prototype,jTe=$Te.hasOwnProperty;function zTe(t,e,n,r,i,a){var s=n&UTe,l=R7(t),c=l.length,u=R7(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:jTe.call(e,h)))return!1}var g=a.get(t),v=a.get(e);if(g&&v)return g==e&&v==t;var m=!0;a.set(t,e),a.set(e,t);for(var A=s;++f<c;){h=l[f];var S=t[h],T=e[h];if(r)var C=s?r(T,S,h,e,t,a):r(S,T,h,t,e,a);if(!(C===void 0?S===T||i(S,T,n,r,a):C)){m=!1;break}A||(A=h=="constructor")}if(m&&!A){var x=t.constructor,w=e.constructor;x!=w&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(m=!1)}return a.delete(t),a.delete(e),m}var HTe=1,zj="[object Arguments]",Hj="[object Array]",t9="[object Object]",YTe=Object.prototype,Yj=YTe.hasOwnProperty;function KTe(t,e,n,r,i,a){var s=od(t),l=od(e),c=s?Hj:Nc(t),u=l?Hj:Nc(e);c=c==zj?t9:c,u=u==zj?t9:u;var d=c==t9,f=u==t9,h=c==u;if(h&&d2(t)){if(!d2(e))return!1;s=!0,d=!1}if(h&&!d)return a||(a=new pu),s||j7(t)?$j(t,e,n,r,i,a):qTe(t,e,c,n,r,i,a);if(!(n&HTe)){var g=d&&Yj.call(t,"__wrapped__"),v=f&&Yj.call(e,"__wrapped__");if(g||v){var m=g?t.value():t,A=v?e.value():e;return a||(a=new pu),i(m,A,n,r,a)}}return h?(a||(a=new pu),zTe(t,e,n,r,i,a)):!1}function Kj(t,e,n,r,i){return t===e?!0:t==null||e==null||!hu(t)&&!hu(e)?t!==t&&e!==e:KTe(t,e,n,r,Kj,i)}function RTe(t){return function(e,n,r){for(var i=-1,a=Object(e),s=r(e),l=s.length;l--;){var c=s[++i];if(n(a[c],c,a)===!1)break}return e}}var XTe=RTe();function $S(t,e,n){(n!==void 0&&!o2(t[e],n)||n===void 0&&!(e in t))&&V7(t,e,n)}function GTe(t){return hu(t)&&z3(t)}function jS(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function WTe(t){return u2(t,h2(t))}function QTe(t,e,n,r,i,a,s){var l=jS(t,n),c=jS(e,n),u=s.get(c);if(u){$S(t,n,u);return}var d=a?a(l,c,n+"",t,e,s):void 0,f=d===void 0;if(f){var h=od(c),g=!h&&d2(c),v=!h&&!g&&j7(c);d=c,h||g||v?od(l)?d=l:GTe(l)?d=Y7(l):g?(f=!1,d=HN(c,!0)):v?(f=!1,d=rO(c,!0)):d=[]:M7(c)||q7(c)?(d=l,q7(l)?d=WTe(l):(!a0(l)||L7(l))&&(d=aO(c))):f=!1}f&&(s.set(c,d),i(d,c,r,a,s),s.delete(c)),$S(t,n,d)}function Rj(t,e,n,r,i){t!==e&&XTe(e,function(a,s){if(i||(i=new pu),a0(a))QTe(t,e,s,n,Rj,r,i);else{var l=r?r(jS(t,s),a,s+"",t,e,i):void 0;l===void 0&&(l=a),$S(t,s,l)}},h2)}function zS(t,e){return Kj(t,e)}var E0=mTe(function(t,e,n){Rj(t,e,n)}),dr=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(dr||{});class Vu{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const i=dr.TYPE&dr.ATTRIBUTE;this.scope=r.scope!=null?r.scope&dr.LEVEL|i:dr.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class Rh extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Xj=class Tx{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,n=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(n){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,n)}return null}create(e,n,r){const i=this.query(n);if(i==null)throw new Rh(`Unable to create ${n} blot`);const a=i,s=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),l=new a(e,s,r);return Tx.blots.set(l.domNode,l),l}find(e,n=!1){return Tx.find(e,n)}query(e,n=dr.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&dr.LEVEL&dr.BLOCK?r=this.types.block:e&dr.LEVEL&dr.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(i=>(r=this.classes[i],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&dr.LEVEL&r.scope&&n&dr.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,i="attrName"in n;if(!r&&!i)throw new Rh("Invalid definition");if(r&&n.blotName==="abstract")throw new Rh("Cannot register abstract class");const a=r?n.blotName:i?n.attrName:void 0;return this.types[a]=n,i?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):r&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(s=>s.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(s=>{(this.tags[s]==null||n.className==null)&&(this.tags[s]=n)}))),n})}};Xj.blots=new WeakMap;let Xh=Xj;function Gj(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class JTe extends Vu{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(e,n){return this.canAdd(e,n)?(this.remove(e),e.classList.add(`${this.keyName}-${n}`),!0):!1}remove(e){Gj(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(Gj(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Kc=JTe;function HS(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class ZTe extends Vu{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[HS(this.keyName)]=n,!0):!1}remove(e){e.style[HS(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[HS(this.keyName)];return this.canAdd(e,n)?n:""}}const I0=ZTe;class eEe{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,n){n?e.add(this.domNode,n)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Xh.find(this.domNode);if(e==null)return;const n=Vu.keys(this.domNode),r=Kc.keys(this.domNode),i=I0.keys(this.domNode);n.concat(r).concat(i).forEach(a=>{const s=e.scroll.query(a,dr.ATTRIBUTE);s instanceof Vu&&(this.attributes[s.attrName]=s)})}copy(e){Object.keys(this.attributes).forEach(n=>{const r=this.attributes[n].value(this.domNode);e.format(n,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,n)=>(e[n]=this.attributes[n].value(this.domNode),e),{})}}const n9=eEe,Wj=class{constructor(e,n){this.scroll=e,this.domNode=n,Xh.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Rh("Blot definition missing tagName");let n,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?n=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?n=document.createElement(r):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Xh.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,i){const a=this.isolate(e,n);if(this.scroll.query(r,dr.BLOT)!=null&&i)a.wrap(r,i);else if(this.scroll.query(r,dr.ATTRIBUTE)!=null){const s=this.scroll.create(this.statics.scope);a.wrap(s),s.format(r,i)}}insertAt(e,n,r){const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(i,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Rh(`Cannot wrap ${e}`);return r.appendChild(this),r}};Wj.blotName="abstract";let Qj=Wj;const Jj=class extends Qj{static value(e){return!0}index(e,n){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(e,n){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Jj.scope=dr.INLINE_BLOT;const yo=Jj;class tEe{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),i=0;for(;r;){if(r===e)return i;i+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let i=r();for(;i;){const a=i.length();if(e<a||n&&e===a&&(i.next==null||i.next.length()!==0))return[i,e];e-=a,i=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[i,a]=this.find(e);let s=e-a;const l=this.iterator(i);let c=l();for(;c&&s<e+n;){const u=c.length();e>s?r(c,e-s,Math.min(n,s+u-e)):r(c,0,Math.min(u,e+n-s)),s+=u,c=l()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let i=r();for(;i;)n=e(n,i),i=r();return n}}function Zj(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(dr.INLINE);return Array.from(t.childNodes).forEach(i=>{r.domNode.appendChild(i)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const ez=class U0 extends Qj{constructor(e,n){super(e,n),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,U0.uiClass&&this.uiNode.classList.add(U0.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new tEe,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=Zj(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof Rh)return;throw n}})}deleteAt(e,n){if(e===0&&n===this.length())return this.remove();this.children.forEachAt(e,n,(r,i,a)=>{r.deleteAt(i,a)})}descendant(e,n=0){const[r,i]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof U0?r.descendant(e,i):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let i=[],a=r;return this.children.forEachAt(n,r,(s,l,c)=>{(e.blotName==null&&e(s)||e.blotName!=null&&s instanceof e)&&i.push(s),s instanceof U0&&(i=i.concat(s.descendants(e,l,a))),a-=c}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===dr.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof U0?n.unwrap():n.remove())})}formatAt(e,n,r,i){this.children.forEachAt(e,n,(a,s,l)=>{a.formatAt(s,l,r,i)})}insertAt(e,n,r){const[i,a]=this.children.find(e);if(i)i.insertAt(a,n,r);else{const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(s)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,i]=this.children.find(e,n),a=[[this,e]];return r instanceof U0?a.concat(r.path(i,n)):(r!=null&&a.push([r,i]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof U0&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(i,a,s)=>{const l=i.split(a,n);l!=null&&r.appendChild(l)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],i=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),i.push(...a.removedNodes))}),i.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const s=this.scroll.find(a);s!=null&&(s.domNode.parentNode==null||s.domNode.parentNode===this.domNode)&&s.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,s)=>a===s?0:a.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let s=null;a.nextSibling!=null&&(s=this.scroll.find(a.nextSibling));const l=Zj(a,this.scroll);(l.next!==s||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,s||void 0))}),this.enforceAllowedChildren()}};ez.uiClass="";const Rc=ez;function nEe(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}const Gh=class dp extends Rc{static create(e){return super.create(e)}static formats(e,n){const r=n.query(dp.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new n9(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof dp||(r=r.wrap(dp.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,dr.INLINE);if(r==null)return;r instanceof Vu?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,i){this.formats()[r]!=null||this.scroll.query(r,dr.ATTRIBUTE)?this.isolate(e,n).format(r,i):super.formatAt(e,n,r,i)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof dp&&r.prev===this&&nEe(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof dp&&this.attributes.move(r),r}};Gh.allowedChildren=[Gh,yo],Gh.blotName="inline",Gh.scope=dr.INLINE_BLOT,Gh.tagName="SPAN";const YS=Gh,Wh=class Ex extends Rc{static create(e){return super.create(e)}static formats(e,n){const r=n.query(Ex.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new n9(this.domNode)}format(e,n){const r=this.scroll.query(e,dr.BLOCK);r!=null&&(r instanceof Vu?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(Ex.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,i){this.scroll.query(r,dr.BLOCK)!=null?this.format(r,i):super.formatAt(e,n,r,i)}insertAt(e,n,r){if(r==null||this.scroll.query(n,dr.INLINE)!=null)super.insertAt(e,n,r);else{const i=this.split(e);if(i!=null){const a=this.scroll.create(n,r);i.parent.insertBefore(a,i)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};Wh.blotName="block",Wh.scope=dr.BLOCK_BLOT,Wh.tagName="P",Wh.allowedChildren=[YS,Wh,yo];const Hg=Wh,KS=class extends Rc{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,n){super.deleteAt(e,n),this.enforceAllowedChildren()}formatAt(e,n,r,i){super.formatAt(e,n,r,i),this.enforceAllowedChildren()}insertAt(e,n,r){super.insertAt(e,n,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};KS.blotName="container",KS.scope=dr.BLOCK_BLOT;const r9=KS;class rEe extends yo{static formats(e,n){}format(e,n){super.formatAt(0,this.length(),e,n)}formatAt(e,n,r,i){e===0&&n===this.length()?this.format(r,i):super.formatAt(e,n,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Pl=rEe,iEe={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},aEe=100,Qh=class extends Rc{constructor(e,n){super(null,n),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,iEe),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=dr.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,i){this.update(),super.formatAt(e,n,r,i)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const a=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&a(c.parent))},s=c=>{r.has(c.domNode)&&(c instanceof Rc&&c.children.forEach(s),r.delete(c.domNode),c.optimize(n))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=aEe)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(u=>{const d=this.find(u.target,!0);d!=null&&(d.domNode===u.target&&(u.type==="childList"?(a(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(f=>{const h=this.find(f,!1);a(h,!1),h instanceof Rc&&h.children.forEach(g=>{a(g,!1)})})):u.type==="attributes"&&a(d.prev)),a(d))}),this.children.forEach(s),l=Array.from(this.observer.takeRecords()),i=l.slice();i.length>0;)e.push(i.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const a=this.find(i.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(i),null):(r.set(a.domNode,[i]),a)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};Qh.blotName="scroll",Qh.defaultChild=Hg,Qh.allowedChildren=[Hg,r9],Qh.scope=dr.BLOCK_BLOT,Qh.tagName="DIV";const RS=Qh,XS=class YY extends yo{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,n){super(e,n),this.text=this.statics.value(this.domNode)}deleteAt(e,n){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+n)}index(e,n){return this.domNode===e?n:-1}insertAt(e,n,r){r==null?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,n,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof YY&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,n=!1){return[this.domNode,e]}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,n){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};XS.blotName="text",XS.scope=dr.INLINE_BLOT;const i9=XS,tz=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Vu,AttributorStore:n9,BlockBlot:Hg,ClassAttributor:Kc,ContainerBlot:r9,EmbedBlot:Pl,InlineBlot:YS,LeafBlot:yo,ParentBlot:Rc,Registry:Xh,Scope:dr,ScrollBlot:RS,StyleAttributor:I0,TextBlot:i9},Symbol.toStringTag,{value:"Module"}));var GS={exports:{}},Ml=-1,qo=1,Ns=0;function Yg(t,e,n,r,i){if(t===e)return t?[[Ns,t]]:[];if(n!=null){var a=pEe(t,e,n);if(a)return a}var s=WS(t,e),l=t.substring(0,s);t=t.substring(s),e=e.substring(s),s=a9(t,e);var c=t.substring(t.length-s);t=t.substring(0,t.length-s),e=e.substring(0,e.length-s);var u=sEe(t,e);return l&&u.unshift([Ns,l]),c&&u.push([Ns,c]),QS(u,i),r&&cEe(u),u}function sEe(t,e){var n;if(!t)return[[qo,e]];if(!e)return[[Ml,t]];var r=t.length>e.length?t:e,i=t.length>e.length?e:t,a=r.indexOf(i);if(a!==-1)return n=[[qo,r.substring(0,a)],[Ns,i],[qo,r.substring(a+i.length)]],t.length>e.length&&(n[0][0]=n[2][0]=Ml),n;if(i.length===1)return[[Ml,t],[qo,e]];var s=lEe(t,e);if(s){var l=s[0],c=s[1],u=s[2],d=s[3],f=s[4],h=Yg(l,u),g=Yg(c,d);return h.concat([[Ns,f]],g)}return oEe(t,e)}function oEe(t,e){for(var n=t.length,r=e.length,i=Math.ceil((n+r)/2),a=i,s=2*i,l=new Array(s),c=new Array(s),u=0;u<s;u++)l[u]=-1,c[u]=-1;l[a+1]=0,c[a+1]=0;for(var d=n-r,f=d%2!==0,h=0,g=0,v=0,m=0,A=0;A<i;A++){for(var S=-A+h;S<=A-g;S+=2){var T=a+S,C;S===-A||S!==A&&l[T-1]<l[T+1]?C=l[T+1]:C=l[T-1]+1;for(var x=C-S;C<n&&x<r&&t.charAt(C)===e.charAt(x);)C++,x++;if(l[T]=C,C>n)g+=2;else if(x>r)h+=2;else if(f){var w=a+d-S;if(w>=0&&w<s&&c[w]!==-1){var I=n-c[w];if(C>=I)return nz(t,e,C,x)}}}for(var _=-A+v;_<=A-m;_+=2){var w=a+_,I;_===-A||_!==A&&c[w-1]<c[w+1]?I=c[w+1]:I=c[w-1]+1;for(var N=I-_;I<n&&N<r&&t.charAt(n-I-1)===e.charAt(r-N-1);)I++,N++;if(c[w]=I,I>n)m+=2;else if(N>r)v+=2;else if(!f){var T=a+d-_;if(T>=0&&T<s&&l[T]!==-1){var C=l[T],x=a+C-T;if(I=n-I,C>=I)return nz(t,e,C,x)}}}}return[[Ml,t],[qo,e]]}function nz(t,e,n,r){var i=t.substring(0,n),a=e.substring(0,r),s=t.substring(n),l=e.substring(r),c=Yg(i,a),u=Yg(s,l);return c.concat(u)}function WS(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;n<i;)t.substring(a,i)==e.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return oz(t.charCodeAt(i-1))&&i--,i}function rz(t,e){var n=t.length,r=e.length;if(n==0||r==0)return 0;n>r?t=t.substring(n-r):n<r&&(e=e.substring(0,n));var i=Math.min(n,r);if(t==e)return i;for(var a=0,s=1;;){var l=t.substring(i-s),c=e.indexOf(l);if(c==-1)return a;s+=c,(c==0||t.substring(i-s)==e.substring(0,s))&&(a=s,s++)}}function a9(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;n<i;)t.substring(t.length-i,t.length-a)==e.substring(e.length-i,e.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return lz(t.charCodeAt(t.length-i))&&i--,i}function lEe(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||r.length*2<n.length)return null;function i(g,v,m){for(var A=g.substring(m,m+Math.floor(g.length/4)),S=-1,T="",C,x,w,I;(S=v.indexOf(A,S+1))!==-1;){var _=WS(g.substring(m),v.substring(S)),N=a9(g.substring(0,m),v.substring(0,S));T.length<N+_&&(T=v.substring(S-N,S)+v.substring(S,S+_),C=g.substring(0,m-N),x=g.substring(m+_),w=v.substring(0,S-N),I=v.substring(S+_))}return T.length*2>=g.length?[C,x,w,I,T]:null}var a=i(n,r,Math.ceil(n.length/4)),s=i(n,r,Math.ceil(n.length/2)),l;if(!a&&!s)return null;s?a?l=a[4].length>s[4].length?a:s:l=s:l=a;var c,u,d,f;t.length>e.length?(c=l[0],u=l[1],d=l[2],f=l[3]):(d=l[0],f=l[1],c=l[2],u=l[3]);var h=l[4];return[c,u,d,f,h]}function cEe(t){for(var e=!1,n=[],r=0,i=null,a=0,s=0,l=0,c=0,u=0;a<t.length;)t[a][0]==Ns?(n[r++]=a,s=c,l=u,c=0,u=0,i=t[a][1]):(t[a][0]==qo?c+=t[a][1].length:u+=t[a][1].length,i&&i.length<=Math.max(s,l)&&i.length<=Math.max(c,u)&&(t.splice(n[r-1],0,[Ml,i]),t[n[r-1]+1][0]=qo,r--,r--,a=r>0?n[r-1]:-1,s=0,l=0,c=0,u=0,i=null,e=!0)),a++;for(e&&QS(t),fEe(t),a=1;a<t.length;){if(t[a-1][0]==Ml&&t[a][0]==qo){var d=t[a-1][1],f=t[a][1],h=rz(d,f),g=rz(f,d);h>=g?(h>=d.length/2||h>=f.length/2)&&(t.splice(a,0,[Ns,f.substring(0,h)]),t[a-1][1]=d.substring(0,d.length-h),t[a+1][1]=f.substring(h),a++):(g>=d.length/2||g>=f.length/2)&&(t.splice(a,0,[Ns,d.substring(0,g)]),t[a-1][0]=qo,t[a-1][1]=f.substring(0,f.length-g),t[a+1][0]=Ml,t[a+1][1]=d.substring(g),a++),a++}a++}}var iz=/[^a-zA-Z0-9]/,az=/\s/,sz=/[\r\n]/,uEe=/\n\r?\n$/,dEe=/^\r?\n\r?\n/;function fEe(t){function e(g,v){if(!g||!v)return 6;var m=g.charAt(g.length-1),A=v.charAt(0),S=m.match(iz),T=A.match(iz),C=S&&m.match(az),x=T&&A.match(az),w=C&&m.match(sz),I=x&&A.match(sz),_=w&&g.match(uEe),N=I&&v.match(dEe);return _||N?5:w||I?4:S&&!C&&x?3:C||x?2:S||T?1:0}for(var n=1;n<t.length-1;){if(t[n-1][0]==Ns&&t[n+1][0]==Ns){var r=t[n-1][1],i=t[n][1],a=t[n+1][1],s=a9(r,i);if(s){var l=i.substring(i.length-s);r=r.substring(0,r.length-s),i=l+i.substring(0,i.length-s),a=l+a}for(var c=r,u=i,d=a,f=e(r,i)+e(i,a);i.charAt(0)===a.charAt(0);){r+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var h=e(r,i)+e(i,a);h>=f&&(f=h,c=r,u=i,d=a)}t[n-1][1]!=c&&(c?t[n-1][1]=c:(t.splice(n-1,1),n--),t[n][1]=u,d?t[n+1][1]=d:(t.splice(n+1,1),n--))}n++}}function QS(t,e){t.push([Ns,""]);for(var n=0,r=0,i=0,a="",s="",l;n<t.length;){if(n<t.length-1&&!t[n][1]){t.splice(n,1);continue}switch(t[n][0]){case qo:i++,s+=t[n][1],n++;break;case Ml:r++,a+=t[n][1],n++;break;case Ns:var c=n-i-r-1;if(e){if(c>=0&&uz(t[c][1])){var u=t[c][1].slice(-1);if(t[c][1]=t[c][1].slice(0,-1),a=u+a,s=u+s,!t[c][1]){t.splice(c,1),n--;var d=c-1;t[d]&&t[d][0]===qo&&(i++,s=t[d][1]+s,d--),t[d]&&t[d][0]===Ml&&(r++,a=t[d][1]+a,d--),c=d}}if(cz(t[n][1])){var u=t[n][1].charAt(0);t[n][1]=t[n][1].slice(1),a+=u,s+=u}}if(n<t.length-1&&!t[n][1]){t.splice(n,1);break}if(a.length>0||s.length>0){a.length>0&&s.length>0&&(l=WS(s,a),l!==0&&(c>=0?t[c][1]+=s.substring(0,l):(t.splice(0,0,[Ns,s.substring(0,l)]),n++),s=s.substring(l),a=a.substring(l)),l=a9(s,a),l!==0&&(t[n][1]=s.substring(s.length-l)+t[n][1],s=s.substring(0,s.length-l),a=a.substring(0,a.length-l)));var f=i+r;a.length===0&&s.length===0?(t.splice(n-f,f),n=n-f):a.length===0?(t.splice(n-f,f,[qo,s]),n=n-f+1):s.length===0?(t.splice(n-f,f,[Ml,a]),n=n-f+1):(t.splice(n-f,f,[Ml,a],[qo,s]),n=n-f+2)}n!==0&&t[n-1][0]===Ns?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,i=0,r=0,a="",s="";break}}t[t.length-1][1]===""&&t.pop();var h=!1;for(n=1;n<t.length-1;)t[n-1][0]===Ns&&t[n+1][0]===Ns&&(t[n][1].substring(t[n][1].length-t[n-1][1].length)===t[n-1][1]?(t[n][1]=t[n-1][1]+t[n][1].substring(0,t[n][1].length-t[n-1][1].length),t[n+1][1]=t[n-1][1]+t[n+1][1],t.splice(n-1,1),h=!0):t[n][1].substring(0,t[n+1][1].length)==t[n+1][1]&&(t[n-1][1]+=t[n+1][1],t[n][1]=t[n][1].substring(t[n+1][1].length)+t[n+1][1],t.splice(n+1,1),h=!0)),n++;h&&QS(t,e)}function oz(t){return t>=55296&&t<=56319}function lz(t){return t>=56320&&t<=57343}function cz(t){return lz(t.charCodeAt(0))}function uz(t){return oz(t.charCodeAt(t.length-1))}function hEe(t){for(var e=[],n=0;n<t.length;n++)t[n][1].length>0&&e.push(t[n]);return e}function JS(t,e,n,r){return uz(t)||cz(r)?null:hEe([[Ns,t],[Ml,e],[qo,n],[Ns,r]])}function pEe(t,e,n){var r=typeof n=="number"?{index:n,length:0}:n.oldRange,i=typeof n=="number"?null:n.newRange,a=t.length,s=e.length;if(r.length===0&&(i===null||i.length===0)){var l=r.index,c=t.slice(0,l),u=t.slice(l),d=i?i.index:null;e:{var f=l+s-a;if(d!==null&&d!==f||f<0||f>s)break e;var h=e.slice(0,f),g=e.slice(f);if(g!==u)break e;var v=Math.min(l,f),m=c.slice(0,v),A=h.slice(0,v);if(m!==A)break e;var S=c.slice(v),T=h.slice(v);return JS(m,S,T,u)}e:{if(d!==null&&d!==l)break e;var C=l,h=e.slice(0,C),g=e.slice(C);if(h!==c)break e;var x=Math.min(a-C,s-C),w=u.slice(u.length-x),I=g.slice(g.length-x);if(w!==I)break e;var S=u.slice(0,u.length-x),T=g.slice(0,g.length-x);return JS(c,S,T,w)}}if(r.length>0&&i&&i.length===0)e:{var m=t.slice(0,r.index),w=t.slice(r.index+r.length),v=m.length,x=w.length;if(s<v+x)break e;var A=e.slice(0,v),I=e.slice(s-x);if(m!==A||w!==I)break e;var S=t.slice(v,a-x),T=e.slice(v,s-x);return JS(m,S,T,w)}return null}function s9(t,e,n,r){return Yg(t,e,n,r,!0)}s9.INSERT=qo,s9.DELETE=Ml,s9.EQUAL=Ns;var gEe=s9,o9={exports:{}};o9.exports,function(t,e){var n=200,r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",d="[object Function]",f="[object GeneratorFunction]",h="[object Map]",g="[object Number]",v="[object Object]",m="[object Promise]",A="[object RegExp]",S="[object Set]",T="[object String]",C="[object Symbol]",x="[object WeakMap]",w="[object ArrayBuffer]",I="[object DataView]",_="[object Float32Array]",N="[object Float64Array]",O="[object Int8Array]",k="[object Int16Array]",M="[object Int32Array]",j="[object Uint8Array]",P="[object Uint8ClampedArray]",$="[object Uint16Array]",K="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,X=/\w*$/,ne=/^\[object .+?Constructor\]$/,he=/^(?:0|[1-9]\d*)$/,q={};q[a]=q[s]=q[w]=q[I]=q[l]=q[c]=q[_]=q[N]=q[O]=q[k]=q[M]=q[h]=q[g]=q[v]=q[A]=q[S]=q[T]=q[C]=q[j]=q[P]=q[$]=q[K]=!0,q[u]=q[d]=q[x]=!1;var W=typeof ki=="object"&&ki&&ki.Object===Object&&ki,Q=typeof self=="object"&&self&&self.Object===Object&&self,Z=W||Q||Function("return this")(),H=e&&!e.nodeType&&e,Y=H&&!0&&t&&!t.nodeType&&t,oe=Y&&Y.exports===H;function be(re,Le){return re.set(Le[0],Le[1]),re}function Ce(re,Le){return re.add(Le),re}function ve(re,Le){for(var rt=-1,qt=re?re.length:0;++rt<qt&&Le(re[rt],rt,re)!==!1;);return re}function ye(re,Le){for(var rt=-1,qt=Le.length,Er=re.length;++rt<qt;)re[Er+rt]=Le[rt];return re}function te(re,Le,rt,qt){for(var Er=-1,sr=re?re.length:0;++Er<sr;)rt=Le(rt,re[Er],Er,re);return rt}function L(re,Le){for(var rt=-1,qt=Array(re);++rt<re;)qt[rt]=Le(rt);return qt}function le(re,Le){return re==null?void 0:re[Le]}function ie(re){var Le=!1;if(re!=null&&typeof re.toString!="function")try{Le=!!(re+"")}catch{}return Le}function ue(re){var Le=-1,rt=Array(re.size);return re.forEach(function(qt,Er){rt[++Le]=[Er,qt]}),rt}function Ne(re,Le){return function(rt){return re(Le(rt))}}function _e(re){var Le=-1,rt=Array(re.size);return re.forEach(function(qt){rt[++Le]=qt}),rt}var me=Array.prototype,se=Function.prototype,we=Object.prototype,ke=Z["__core-js_shared__"],R=function(){var re=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return re?"Symbol(src)_1."+re:""}(),Ae=se.toString,Se=we.hasOwnProperty,fe=we.toString,ge=RegExp("^"+Ae.call(Se).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pe=oe?Z.Buffer:void 0,Ve=Z.Symbol,De=Z.Uint8Array,He=Ne(Object.getPrototypeOf,Object),it=Object.create,ut=we.propertyIsEnumerable,dt=me.splice,Bt=Object.getOwnPropertySymbols,ln=pe?pe.isBuffer:void 0,Ft=Ne(Object.keys,Object),mn=Ei(Z,"DataView"),Vn=Ei(Z,"Map"),xt=Ei(Z,"Promise"),je=Ei(Z,"Set"),Ye=Ei(Z,"WeakMap"),st=Ei(Object,"create"),Jt=qr(mn),Xt=qr(Vn),Zt=qr(xt),yn=qr(je),vt=qr(Ye),Be=Ve?Ve.prototype:void 0,nt=Be?Be.valueOf:void 0;function Tt(re){var Le=-1,rt=re?re.length:0;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Mt(){this.__data__=st?st(null):{}}function Nn(re){return this.has(re)&&delete this.__data__[re]}function kn(re){var Le=this.__data__;if(st){var rt=Le[re];return rt===r?void 0:rt}return Se.call(Le,re)?Le[re]:void 0}function Qn(re){var Le=this.__data__;return st?Le[re]!==void 0:Se.call(Le,re)}function Jn(re,Le){var rt=this.__data__;return rt[re]=st&&Le===void 0?r:Le,this}Tt.prototype.clear=Mt,Tt.prototype.delete=Nn,Tt.prototype.get=kn,Tt.prototype.has=Qn,Tt.prototype.set=Jn;function br(re){var Le=-1,rt=re?re.length:0;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Or(){this.__data__=[]}function Sn(re){var Le=this.__data__,rt=ae(Le,re);if(rt<0)return!1;var qt=Le.length-1;return rt==qt?Le.pop():dt.call(Le,rt,1),!0}function ot(re){var Le=this.__data__,rt=ae(Le,re);return rt<0?void 0:Le[rt][1]}function ct(re){return ae(this.__data__,re)>-1}function yt(re,Le){var rt=this.__data__,qt=ae(rt,re);return qt<0?rt.push([re,Le]):rt[qt][1]=Le,this}br.prototype.clear=Or,br.prototype.delete=Sn,br.prototype.get=ot,br.prototype.has=ct,br.prototype.set=yt;function Nt(re){var Le=-1,rt=re?re.length:0;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Cn(){this.__data__={hash:new Tt,map:new(Vn||br),string:new Tt}}function On(re){return ji(this,re).delete(re)}function _t(re){return ji(this,re).get(re)}function Fe(re){return ji(this,re).has(re)}function Qe(re,Le){return ji(this,re).set(re,Le),this}Nt.prototype.clear=Cn,Nt.prototype.delete=On,Nt.prototype.get=_t,Nt.prototype.has=Fe,Nt.prototype.set=Qe;function At(re){this.__data__=new br(re)}function zt(){this.__data__=new br}function Rt(re){return this.__data__.delete(re)}function nn(re){return this.__data__.get(re)}function xn(re){return this.__data__.has(re)}function Ln(re,Le){var rt=this.__data__;if(rt instanceof br){var qt=rt.__data__;if(!Vn||qt.length<n-1)return qt.push([re,Le]),this;rt=this.__data__=new Nt(qt)}return rt.set(re,Le),this}At.prototype.clear=zt,At.prototype.delete=Rt,At.prototype.get=nn,At.prototype.has=xn,At.prototype.set=Ln;function Hn(re,Le){var rt=It(re)||Ke(re)?L(re.length,String):[],qt=rt.length,Er=!!qt;for(var sr in re)Se.call(re,sr)&&!(Er&&(sr=="length"||zn(sr,qt)))&&rt.push(sr);return rt}function at(re,Le,rt){var qt=re[Le];(!(Se.call(re,Le)&&An(qt,rt))||rt===void 0&&!(Le in re))&&(re[Le]=rt)}function ae(re,Le){for(var rt=re.length;rt--;)if(An(re[rt][0],Le))return rt;return-1}function Me(re,Le){return re&&fi(Le,wo(Le),re)}function We(re,Le,rt,qt,Er,sr,Wr){var Fr;if(qt&&(Fr=sr?qt(re,Er,sr,Wr):qt(re)),Fr!==void 0)return Fr;if(!pa(re))return re;var Tr=It(re);if(Tr){if(Fr=pn(re),!Le)return oi(re,Fr)}else{var Qr=Yi(re),Ii=Qr==d||Qr==f;if(yr(re))return Yn(re,Le);if(Qr==v||Qr==a||Ii&&!sr){if(ie(re))return sr?re:{};if(Fr=$e(Ii?{}:re),!Le)return Mi(re,Me(Fr,re))}else{if(!q[Qr])return sr?re:{};Fr=Kt(re,Qr,We,Le)}}Wr||(Wr=new At);var Qa=Wr.get(re);if(Qa)return Qa;if(Wr.set(re,Fr),!Tr)var Ki=rt?rr(re):wo(re);return ve(Ki||re,function(vi,Ca){Ki&&(Ca=vi,vi=re[Ca]),at(Fr,Ca,We(vi,Le,rt,qt,Ca,re,Wr))}),Fr}function ft(re){return pa(re)?it(re):{}}function Ct(re,Le,rt){var qt=Le(re);return It(re)?qt:ye(qt,rt(re))}function Gt(re){return fe.call(re)}function Dn(re){if(!pa(re)||Pr(re))return!1;var Le=Mr(re)||ie(re)?ge:ne;return Le.test(qr(re))}function Pn(re){if(!Wa(re))return Ft(re);var Le=[];for(var rt in Object(re))Se.call(re,rt)&&rt!="constructor"&&Le.push(rt);return Le}function Yn(re,Le){if(Le)return re.slice();var rt=new re.constructor(re.length);return re.copy(rt),rt}function Lr(re){var Le=new re.constructor(re.byteLength);return new De(Le).set(new De(re)),Le}function Xr(re,Le){var rt=Le?Lr(re.buffer):re.buffer;return new re.constructor(rt,re.byteOffset,re.byteLength)}function $n(re,Le,rt){var qt=Le?rt(ue(re),!0):ue(re);return te(qt,be,new re.constructor)}function Fn(re){var Le=new re.constructor(re.source,X.exec(re));return Le.lastIndex=re.lastIndex,Le}function lr(re,Le,rt){var qt=Le?rt(_e(re),!0):_e(re);return te(qt,Ce,new re.constructor)}function Br(re){return nt?Object(nt.call(re)):{}}function mi(re,Le){var rt=Le?Lr(re.buffer):re.buffer;return new re.constructor(rt,re.byteOffset,re.length)}function oi(re,Le){var rt=-1,qt=re.length;for(Le||(Le=Array(qt));++rt<qt;)Le[rt]=re[rt];return Le}function fi(re,Le,rt,qt){rt||(rt={});for(var Er=-1,sr=Le.length;++Er<sr;){var Wr=Le[Er],Fr=void 0;at(rt,Wr,Fr===void 0?re[Wr]:Fr)}return rt}function Mi(re,Le){return fi(re,Ci(re),Le)}function rr(re){return Ct(re,wo,Ci)}function ji(re,Le){var rt=re.__data__;return zr(Le)?rt[typeof Le=="string"?"string":"hash"]:rt.map}function Ei(re,Le){var rt=le(re,Le);return Dn(rt)?rt:void 0}var Ci=Bt?Ne(Bt,Object):Gr,Yi=Gt;(mn&&Yi(new mn(new ArrayBuffer(1)))!=I||Vn&&Yi(new Vn)!=h||xt&&Yi(xt.resolve())!=m||je&&Yi(new je)!=S||Ye&&Yi(new Ye)!=x)&&(Yi=function(re){var Le=fe.call(re),rt=Le==v?re.constructor:void 0,qt=rt?qr(rt):void 0;if(qt)switch(qt){case Jt:return I;case Xt:return h;case Zt:return m;case yn:return S;case vt:return x}return Le});function pn(re){var Le=re.length,rt=re.constructor(Le);return Le&&typeof re[0]=="string"&&Se.call(re,"index")&&(rt.index=re.index,rt.input=re.input),rt}function $e(re){return typeof re.constructor=="function"&&!Wa(re)?ft(He(re)):{}}function Kt(re,Le,rt,qt){var Er=re.constructor;switch(Le){case w:return Lr(re);case l:case c:return new Er(+re);case I:return Xr(re,qt);case _:case N:case O:case k:case M:case j:case P:case $:case K:return mi(re,qt);case h:return $n(re,qt,rt);case g:case T:return new Er(re);case A:return Fn(re);case S:return lr(re,qt,rt);case C:return Br(re)}}function zn(re,Le){return Le=Le??i,!!Le&&(typeof re=="number"||he.test(re))&&re>-1&&re%1==0&&re<Le}function zr(re){var Le=typeof re;return Le=="string"||Le=="number"||Le=="symbol"||Le=="boolean"?re!=="__proto__":re===null}function Pr(re){return!!R&&R in re}function Wa(re){var Le=re&&re.constructor,rt=typeof Le=="function"&&Le.prototype||we;return re===rt}function qr(re){if(re!=null){try{return Ae.call(re)}catch{}try{return re+""}catch{}}return""}function Os(re){return We(re,!0,!0)}function An(re,Le){return re===Le||re!==re&&Le!==Le}function Ke(re){return er(re)&&Se.call(re,"callee")&&(!ut.call(re,"callee")||fe.call(re)==a)}var It=Array.isArray;function en(re){return re!=null&&ua(re.length)&&!Mr(re)}function er(re){return zs(re)&&en(re)}var yr=ln||hi;function Mr(re){var Le=pa(re)?fe.call(re):"";return Le==d||Le==f}function ua(re){return typeof re=="number"&&re>-1&&re%1==0&&re<=i}function pa(re){var Le=typeof re;return!!re&&(Le=="object"||Le=="function")}function zs(re){return!!re&&typeof re=="object"}function wo(re){return en(re)?Hn(re):Pn(re)}function Gr(){return[]}function hi(){return!1}t.exports=Os}(o9,o9.exports);var dz=o9.exports,l9={exports:{}};l9.exports,function(t,e){var n=200,r="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",f="[object Date]",h="[object Error]",g="[object Function]",v="[object GeneratorFunction]",m="[object Map]",A="[object Number]",S="[object Null]",T="[object Object]",C="[object Promise]",x="[object Proxy]",w="[object RegExp]",I="[object Set]",_="[object String]",N="[object Symbol]",O="[object Undefined]",k="[object WeakMap]",M="[object ArrayBuffer]",j="[object DataView]",P="[object Float32Array]",$="[object Float64Array]",K="[object Int8Array]",ce="[object Int16Array]",X="[object Int32Array]",ne="[object Uint8Array]",he="[object Uint8ClampedArray]",q="[object Uint16Array]",W="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,Z=/^\[object .+?Constructor\]$/,H=/^(?:0|[1-9]\d*)$/,Y={};Y[P]=Y[$]=Y[K]=Y[ce]=Y[X]=Y[ne]=Y[he]=Y[q]=Y[W]=!0,Y[l]=Y[c]=Y[M]=Y[d]=Y[j]=Y[f]=Y[h]=Y[g]=Y[m]=Y[A]=Y[T]=Y[w]=Y[I]=Y[_]=Y[k]=!1;var oe=typeof ki=="object"&&ki&&ki.Object===Object&&ki,be=typeof self=="object"&&self&&self.Object===Object&&self,Ce=oe||be||Function("return this")(),ve=e&&!e.nodeType&&e,ye=ve&&!0&&t&&!t.nodeType&&t,te=ye&&ye.exports===ve,L=te&&oe.process,le=function(){try{return L&&L.binding&&L.binding("util")}catch{}}(),ie=le&&le.isTypedArray;function ue(re,Le){for(var rt=-1,qt=re==null?0:re.length,Er=0,sr=[];++rt<qt;){var Wr=re[rt];Le(Wr,rt,re)&&(sr[Er++]=Wr)}return sr}function Ne(re,Le){for(var rt=-1,qt=Le.length,Er=re.length;++rt<qt;)re[Er+rt]=Le[rt];return re}function _e(re,Le){for(var rt=-1,qt=re==null?0:re.length;++rt<qt;)if(Le(re[rt],rt,re))return!0;return!1}function me(re,Le){for(var rt=-1,qt=Array(re);++rt<re;)qt[rt]=Le(rt);return qt}function se(re){return function(Le){return re(Le)}}function we(re,Le){return re.has(Le)}function ke(re,Le){return re==null?void 0:re[Le]}function R(re){var Le=-1,rt=Array(re.size);return re.forEach(function(qt,Er){rt[++Le]=[Er,qt]}),rt}function Ae(re,Le){return function(rt){return re(Le(rt))}}function Se(re){var Le=-1,rt=Array(re.size);return re.forEach(function(qt){rt[++Le]=qt}),rt}var fe=Array.prototype,ge=Function.prototype,pe=Object.prototype,Ve=Ce["__core-js_shared__"],De=ge.toString,He=pe.hasOwnProperty,it=function(){var re=/[^.]+$/.exec(Ve&&Ve.keys&&Ve.keys.IE_PROTO||"");return re?"Symbol(src)_1."+re:""}(),ut=pe.toString,dt=RegExp("^"+De.call(He).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=te?Ce.Buffer:void 0,ln=Ce.Symbol,Ft=Ce.Uint8Array,mn=pe.propertyIsEnumerable,Vn=fe.splice,xt=ln?ln.toStringTag:void 0,je=Object.getOwnPropertySymbols,Ye=Bt?Bt.isBuffer:void 0,st=Ae(Object.keys,Object),Jt=Ci(Ce,"DataView"),Xt=Ci(Ce,"Map"),Zt=Ci(Ce,"Promise"),yn=Ci(Ce,"Set"),vt=Ci(Ce,"WeakMap"),Be=Ci(Object,"create"),nt=qr(Jt),Tt=qr(Xt),Mt=qr(Zt),Nn=qr(yn),kn=qr(vt),Qn=ln?ln.prototype:void 0,Jn=Qn?Qn.valueOf:void 0;function br(re){var Le=-1,rt=re==null?0:re.length;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Or(){this.__data__=Be?Be(null):{},this.size=0}function Sn(re){var Le=this.has(re)&&delete this.__data__[re];return this.size-=Le?1:0,Le}function ot(re){var Le=this.__data__;if(Be){var rt=Le[re];return rt===r?void 0:rt}return He.call(Le,re)?Le[re]:void 0}function ct(re){var Le=this.__data__;return Be?Le[re]!==void 0:He.call(Le,re)}function yt(re,Le){var rt=this.__data__;return this.size+=this.has(re)?0:1,rt[re]=Be&&Le===void 0?r:Le,this}br.prototype.clear=Or,br.prototype.delete=Sn,br.prototype.get=ot,br.prototype.has=ct,br.prototype.set=yt;function Nt(re){var Le=-1,rt=re==null?0:re.length;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Cn(){this.__data__=[],this.size=0}function On(re){var Le=this.__data__,rt=Yn(Le,re);if(rt<0)return!1;var qt=Le.length-1;return rt==qt?Le.pop():Vn.call(Le,rt,1),--this.size,!0}function _t(re){var Le=this.__data__,rt=Yn(Le,re);return rt<0?void 0:Le[rt][1]}function Fe(re){return Yn(this.__data__,re)>-1}function Qe(re,Le){var rt=this.__data__,qt=Yn(rt,re);return qt<0?(++this.size,rt.push([re,Le])):rt[qt][1]=Le,this}Nt.prototype.clear=Cn,Nt.prototype.delete=On,Nt.prototype.get=_t,Nt.prototype.has=Fe,Nt.prototype.set=Qe;function At(re){var Le=-1,rt=re==null?0:re.length;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function zt(){this.size=0,this.__data__={hash:new br,map:new(Xt||Nt),string:new br}}function Rt(re){var Le=Ei(this,re).delete(re);return this.size-=Le?1:0,Le}function nn(re){return Ei(this,re).get(re)}function xn(re){return Ei(this,re).has(re)}function Ln(re,Le){var rt=Ei(this,re),qt=rt.size;return rt.set(re,Le),this.size+=rt.size==qt?0:1,this}At.prototype.clear=zt,At.prototype.delete=Rt,At.prototype.get=nn,At.prototype.has=xn,At.prototype.set=Ln;function Hn(re){var Le=-1,rt=re==null?0:re.length;for(this.__data__=new At;++Le<rt;)this.add(re[Le])}function at(re){return this.__data__.set(re,r),this}function ae(re){return this.__data__.has(re)}Hn.prototype.add=Hn.prototype.push=at,Hn.prototype.has=ae;function Me(re){var Le=this.__data__=new Nt(re);this.size=Le.size}function We(){this.__data__=new Nt,this.size=0}function ft(re){var Le=this.__data__,rt=Le.delete(re);return this.size=Le.size,rt}function Ct(re){return this.__data__.get(re)}function Gt(re){return this.__data__.has(re)}function Dn(re,Le){var rt=this.__data__;if(rt instanceof Nt){var qt=rt.__data__;if(!Xt||qt.length<n-1)return qt.push([re,Le]),this.size=++rt.size,this;rt=this.__data__=new At(qt)}return rt.set(re,Le),this.size=rt.size,this}Me.prototype.clear=We,Me.prototype.delete=ft,Me.prototype.get=Ct,Me.prototype.has=Gt,Me.prototype.set=Dn;function Pn(re,Le){var rt=Ke(re),qt=!rt&&An(re),Er=!rt&&!qt&&en(re),sr=!rt&&!qt&&!Er&&zs(re),Wr=rt||qt||Er||sr,Fr=Wr?me(re.length,String):[],Tr=Fr.length;for(var Qr in re)He.call(re,Qr)&&!(Wr&&(Qr=="length"||Er&&(Qr=="offset"||Qr=="parent")||sr&&(Qr=="buffer"||Qr=="byteLength"||Qr=="byteOffset")||Kt(Qr,Tr)))&&Fr.push(Qr);return Fr}function Yn(re,Le){for(var rt=re.length;rt--;)if(Os(re[rt][0],Le))return rt;return-1}function Lr(re,Le,rt){var qt=Le(re);return Ke(re)?qt:Ne(qt,rt(re))}function Xr(re){return re==null?re===void 0?O:S:xt&&xt in Object(re)?Yi(re):Wa(re)}function $n(re){return pa(re)&&Xr(re)==l}function Fn(re,Le,rt,qt,Er){return re===Le?!0:re==null||Le==null||!pa(re)&&!pa(Le)?re!==re&&Le!==Le:lr(re,Le,rt,qt,Fn,Er)}function lr(re,Le,rt,qt,Er,sr){var Wr=Ke(re),Fr=Ke(Le),Tr=Wr?c:$e(re),Qr=Fr?c:$e(Le);Tr=Tr==l?T:Tr,Qr=Qr==l?T:Qr;var Ii=Tr==T,Qa=Qr==T,Ki=Tr==Qr;if(Ki&&en(re)){if(!en(Le))return!1;Wr=!0,Ii=!1}if(Ki&&!Ii)return sr||(sr=new Me),Wr||zs(re)?fi(re,Le,rt,qt,Er,sr):Mi(re,Le,Tr,rt,qt,Er,sr);if(!(rt&i)){var vi=Ii&&He.call(re,"__wrapped__"),Ca=Qa&&He.call(Le,"__wrapped__");if(vi||Ca){var os=vi?re.value():re,xa=Ca?Le.value():Le;return sr||(sr=new Me),Er(os,xa,rt,qt,sr)}}return Ki?(sr||(sr=new Me),rr(re,Le,rt,qt,Er,sr)):!1}function Br(re){if(!ua(re)||zr(re))return!1;var Le=yr(re)?dt:Z;return Le.test(qr(re))}function mi(re){return pa(re)&&Mr(re.length)&&!!Y[Xr(re)]}function oi(re){if(!Pr(re))return st(re);var Le=[];for(var rt in Object(re))He.call(re,rt)&&rt!="constructor"&&Le.push(rt);return Le}function fi(re,Le,rt,qt,Er,sr){var Wr=rt&i,Fr=re.length,Tr=Le.length;if(Fr!=Tr&&!(Wr&&Tr>Fr))return!1;var Qr=sr.get(re);if(Qr&&sr.get(Le))return Qr==Le;var Ii=-1,Qa=!0,Ki=rt&a?new Hn:void 0;for(sr.set(re,Le),sr.set(Le,re);++Ii<Fr;){var vi=re[Ii],Ca=Le[Ii];if(qt)var os=Wr?qt(Ca,vi,Ii,Le,re,sr):qt(vi,Ca,Ii,re,Le,sr);if(os!==void 0){if(os)continue;Qa=!1;break}if(Ki){if(!_e(Le,function(xa,zi){if(!we(Ki,zi)&&(vi===xa||Er(vi,xa,rt,qt,sr)))return Ki.push(zi)})){Qa=!1;break}}else if(!(vi===Ca||Er(vi,Ca,rt,qt,sr))){Qa=!1;break}}return sr.delete(re),sr.delete(Le),Qa}function Mi(re,Le,rt,qt,Er,sr,Wr){switch(rt){case j:if(re.byteLength!=Le.byteLength||re.byteOffset!=Le.byteOffset)return!1;re=re.buffer,Le=Le.buffer;case M:return!(re.byteLength!=Le.byteLength||!sr(new Ft(re),new Ft(Le)));case d:case f:case A:return Os(+re,+Le);case h:return re.name==Le.name&&re.message==Le.message;case w:case _:return re==Le+"";case m:var Fr=R;case I:var Tr=qt&i;if(Fr||(Fr=Se),re.size!=Le.size&&!Tr)return!1;var Qr=Wr.get(re);if(Qr)return Qr==Le;qt|=a,Wr.set(re,Le);var Ii=fi(Fr(re),Fr(Le),qt,Er,sr,Wr);return Wr.delete(re),Ii;case N:if(Jn)return Jn.call(re)==Jn.call(Le)}return!1}function rr(re,Le,rt,qt,Er,sr){var Wr=rt&i,Fr=ji(re),Tr=Fr.length,Qr=ji(Le),Ii=Qr.length;if(Tr!=Ii&&!Wr)return!1;for(var Qa=Tr;Qa--;){var Ki=Fr[Qa];if(!(Wr?Ki in Le:He.call(Le,Ki)))return!1}var vi=sr.get(re);if(vi&&sr.get(Le))return vi==Le;var Ca=!0;sr.set(re,Le),sr.set(Le,re);for(var os=Wr;++Qa<Tr;){Ki=Fr[Qa];var xa=re[Ki],zi=Le[Ki];if(qt)var ka=Wr?qt(zi,xa,Ki,Le,re,sr):qt(xa,zi,Ki,re,Le,sr);if(!(ka===void 0?xa===zi||Er(xa,zi,rt,qt,sr):ka)){Ca=!1;break}os||(os=Ki=="constructor")}if(Ca&&!os){var Ha=re.constructor,bi=Le.constructor;Ha!=bi&&"constructor"in re&&"constructor"in Le&&!(typeof Ha=="function"&&Ha instanceof Ha&&typeof bi=="function"&&bi instanceof bi)&&(Ca=!1)}return sr.delete(re),sr.delete(Le),Ca}function ji(re){return Lr(re,wo,pn)}function Ei(re,Le){var rt=re.__data__;return zn(Le)?rt[typeof Le=="string"?"string":"hash"]:rt.map}function Ci(re,Le){var rt=ke(re,Le);return Br(rt)?rt:void 0}function Yi(re){var Le=He.call(re,xt),rt=re[xt];try{re[xt]=void 0;var qt=!0}catch{}var Er=ut.call(re);return qt&&(Le?re[xt]=rt:delete re[xt]),Er}var pn=je?function(re){return re==null?[]:(re=Object(re),ue(je(re),function(Le){return mn.call(re,Le)}))}:Gr,$e=Xr;(Jt&&$e(new Jt(new ArrayBuffer(1)))!=j||Xt&&$e(new Xt)!=m||Zt&&$e(Zt.resolve())!=C||yn&&$e(new yn)!=I||vt&&$e(new vt)!=k)&&($e=function(re){var Le=Xr(re),rt=Le==T?re.constructor:void 0,qt=rt?qr(rt):"";if(qt)switch(qt){case nt:return j;case Tt:return m;case Mt:return C;case Nn:return I;case kn:return k}return Le});function Kt(re,Le){return Le=Le??s,!!Le&&(typeof re=="number"||H.test(re))&&re>-1&&re%1==0&&re<Le}function zn(re){var Le=typeof re;return Le=="string"||Le=="number"||Le=="symbol"||Le=="boolean"?re!=="__proto__":re===null}function zr(re){return!!it&&it in re}function Pr(re){var Le=re&&re.constructor,rt=typeof Le=="function"&&Le.prototype||pe;return re===rt}function Wa(re){return ut.call(re)}function qr(re){if(re!=null){try{return De.call(re)}catch{}try{return re+""}catch{}}return""}function Os(re,Le){return re===Le||re!==re&&Le!==Le}var An=$n(function(){return arguments}())?$n:function(re){return pa(re)&&He.call(re,"callee")&&!mn.call(re,"callee")},Ke=Array.isArray;function It(re){return re!=null&&Mr(re.length)&&!yr(re)}var en=Ye||hi;function er(re,Le){return Fn(re,Le)}function yr(re){if(!ua(re))return!1;var Le=Xr(re);return Le==g||Le==v||Le==u||Le==x}function Mr(re){return typeof re=="number"&&re>-1&&re%1==0&&re<=s}function ua(re){var Le=typeof re;return re!=null&&(Le=="object"||Le=="function")}function pa(re){return re!=null&&typeof re=="object"}var zs=ie?se(ie):mi;function wo(re){return It(re)?Pn(re):oi(re)}function Gr(){return[]}function hi(){return!1}t.exports=er}(l9,l9.exports);var fz=l9.exports,ZS={};Object.defineProperty(ZS,"__esModule",{value:!0});const mEe=dz,vEe=fz;var eC;(function(t){function e(a={},s={},l=!1){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});let c=mEe(s);l||(c=Object.keys(c).reduce((u,d)=>(c[d]!=null&&(u[d]=c[d]),u),{}));for(const u in a)a[u]!==void 0&&s[u]===void 0&&(c[u]=a[u]);return Object.keys(c).length>0?c:void 0}t.compose=e;function n(a={},s={}){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});const l=Object.keys(a).concat(Object.keys(s)).reduce((c,u)=>(vEe(a[u],s[u])||(c[u]=s[u]===void 0?null:s[u]),c),{});return Object.keys(l).length>0?l:void 0}t.diff=n;function r(a={},s={}){a=a||{};const l=Object.keys(s).reduce((c,u)=>(s[u]!==a[u]&&a[u]!==void 0&&(c[u]=s[u]),c),{});return Object.keys(a).reduce((c,u)=>(a[u]!==s[u]&&s[u]===void 0&&(c[u]=null),c),l)}t.invert=r;function i(a,s,l=!1){if(typeof a!="object")return s;if(typeof s!="object")return;if(!l)return s;const c=Object.keys(s).reduce((u,d)=>(a[d]===void 0&&(u[d]=s[d]),u),{});return Object.keys(c).length>0?c:void 0}t.transform=i})(eC||(eC={})),ZS.default=eC;var c9={};Object.defineProperty(c9,"__esModule",{value:!0});var tC;(function(t){function e(n){return typeof n.delete=="number"?n.delete:typeof n.retain=="number"?n.retain:typeof n.retain=="object"&&n.retain!==null?1:typeof n.insert=="string"?n.insert.length:1}t.length=e})(tC||(tC={})),c9.default=tC;var nC={};Object.defineProperty(nC,"__esModule",{value:!0});const hz=c9;class bEe{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const n=this.ops[this.index];if(n){const r=this.offset,i=hz.default.length(n);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,typeof n.delete=="number")return{delete:e};{const a={};return n.attributes&&(a.attributes=n.attributes),typeof n.retain=="number"?a.retain=e:typeof n.retain=="object"&&n.retain!==null?a.retain=n.retain:typeof n.insert=="string"?a.insert=n.insert.substr(r,e):a.insert=n.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?hz.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?typeof e.delete=="number"?"delete":typeof e.retain=="number"||typeof e.retain=="object"&&e.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const e=this.offset,n=this.index,r=this.next(),i=this.ops.slice(this.index);return this.offset=e,this.index=n,[r].concat(i)}}else return[]}}nC.default=bEe,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=gEe,r=dz,i=fz,a=ZS;e.AttributeMap=a.default;const s=c9;e.Op=s.default;const l=nC;e.OpIterator=l.default;const c="\0",u=(f,h)=>{if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const g=Object.keys(f)[0];if(!g||g!==Object.keys(h)[0])throw new Error(`embed types not matched: ${g} != ${Object.keys(h)[0]}`);return[g,f[g],h[g]]};class d{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,g){this.handlers[h]=g}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const g=this.handlers[h];if(!g)throw new Error(`no handlers for embed type "${h}"`);return g}insert(h,g){const v={};return typeof h=="string"&&h.length===0?this:(v.insert=h,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(v.attributes=g),this.push(v))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,g){if(typeof h=="number"&&h<=0)return this;const v={retain:h};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(v.attributes=g),this.push(v)}push(h){let g=this.ops.length,v=this.ops[g-1];if(h=r(h),typeof v=="object"){if(typeof h.delete=="number"&&typeof v.delete=="number")return this.ops[g-1]={delete:v.delete+h.delete},this;if(typeof v.delete=="number"&&h.insert!=null&&(g-=1,v=this.ops[g-1],typeof v!="object"))return this.ops.unshift(h),this;if(i(h.attributes,v.attributes)){if(typeof h.insert=="string"&&typeof v.insert=="string")return this.ops[g-1]={insert:v.insert+h.insert},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof v.retain=="number")return this.ops[g-1]={retain:v.retain+h.retain},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this}}return g===this.ops.length?this.ops.push(h):this.ops.splice(g,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const g=[],v=[];return this.forEach(m=>{(h(m)?g:v).push(m)}),[g,v]}reduce(h,g){return this.ops.reduce(h,g)}changeLength(){return this.reduce((h,g)=>g.insert?h+s.default.length(g):g.delete?h-g.delete:h,0)}length(){return this.reduce((h,g)=>h+s.default.length(g),0)}slice(h=0,g=1/0){const v=[],m=new l.default(this.ops);let A=0;for(;A<g&&m.hasNext();){let S;A<h?S=m.next(h-A):(S=m.next(g-A),v.push(S)),A+=s.default.length(S)}return new d(v)}compose(h){const g=new l.default(this.ops),v=new l.default(h.ops),m=[],A=v.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){let T=A.retain;for(;g.peekType()==="insert"&&g.peekLength()<=T;)T-=g.peekLength(),m.push(g.next());A.retain-T>0&&v.next(A.retain-T)}const S=new d(m);for(;g.hasNext()||v.hasNext();)if(v.peekType()==="insert")S.push(v.next());else if(g.peekType()==="delete")S.push(g.next());else{const T=Math.min(g.peekLength(),v.peekLength()),C=g.next(T),x=v.next(T);if(x.retain){const w={};if(typeof C.retain=="number")w.retain=typeof x.retain=="number"?T:x.retain;else if(typeof x.retain=="number")C.retain==null?w.insert=C.insert:w.retain=C.retain;else{const _=C.retain==null?"insert":"retain",[N,O,k]=u(C[_],x.retain),M=d.getHandler(N);w[_]={[N]:M.compose(O,k,_==="retain")}}const I=a.default.compose(C.attributes,x.attributes,typeof C.retain=="number");if(I&&(w.attributes=I),S.push(w),!v.hasNext()&&i(S.ops[S.ops.length-1],w)){const _=new d(g.rest());return S.concat(_).chop()}}else typeof x.delete=="number"&&(typeof C.retain=="number"||typeof C.retain=="object"&&C.retain!==null)&&S.push(x)}return S.chop()}concat(h){const g=new d(this.ops.slice());return h.ops.length>0&&(g.push(h.ops[0]),g.ops=g.ops.concat(h.ops.slice(1))),g}diff(h,g){if(this.ops===h.ops)return new d;const v=[this,h].map(C=>C.map(x=>{if(x.insert!=null)return typeof x.insert=="string"?x.insert:c;const w=C===h?"on":"with";throw new Error("diff() called "+w+" non-document")}).join("")),m=new d,A=n(v[0],v[1],g,!0),S=new l.default(this.ops),T=new l.default(h.ops);return A.forEach(C=>{let x=C[1].length;for(;x>0;){let w=0;switch(C[0]){case n.INSERT:w=Math.min(T.peekLength(),x),m.push(T.next(w));break;case n.DELETE:w=Math.min(x,S.peekLength()),S.next(w),m.delete(w);break;case n.EQUAL:w=Math.min(S.peekLength(),T.peekLength(),x);const I=S.next(w),_=T.next(w);i(I.insert,_.insert)?m.retain(w,a.default.diff(I.attributes,_.attributes)):m.push(_).delete(w);break}x-=w}}),m.chop()}eachLine(h,g=`
4376
+ `,rTe={spinner:function(e){var n=e.props;return{animationDuration:n.animationDuration}}},Z5=Un.extend({defaultProps:{__TYPE:"ProgressSpinner",id:null,style:null,className:null,strokeWidth:"2",fill:"none",animationDuration:"2s",children:void 0},css:{classes:tTe,styles:nTe,inlineStyles:rTe}}),Vj=b.memo(b.forwardRef(function(t,e){var n=Rn(),r=b.useContext(or),i=Z5.getProps(t,r),a=b.useRef(null),s=Z5.setMetaData({props:i}),l=s.ptm,c=s.cx,u=s.sx,d=s.isUnstyled;ui(Z5.css.styles,d,{name:"progressspinner"}),b.useImperativeHandle(e,function(){return{props:i,getElement:function(){return a.current}}});var f=n({id:i.id,ref:a,style:i.style,className:ht(i.className,c("root")),role:"progressbar","aria-busy":!0},Z5.getOtherProps(i),l("root")),h=n({className:c("spinner"),viewBox:"25 25 50 50",style:u("spinner")},l("spinner")),g=n({className:c("circle"),cx:"50",cy:"50",r:"20",fill:i.fill,strokeWidth:i.strokeWidth,strokeMiterlimit:"10"},l("circle"));return b.createElement("div",f,b.createElement("svg",h,b.createElement("circle",g)))}));Vj.displayName="ProgressSpinner";const iTe=()=>{const{renderType:t,componentList:e,sectionsList:n,exam:r}=Wt(),{userSelectedLanguage:i,formBuilderFormLayout:a}=on(),s=4,l=0,c=1,u=2,d=5,f=()=>{const K=t;let ce=0;return K===Jd?ce=s:K===xm?ce=d:K===Cm||K===W9||K===af?ce=u:K===j0||K===fp?ce=c:K===z0&&(ce=l),ce},h=F.useRef(),g=r!=null&&r.getPaginatedAssessmentQuestionBankList?r==null?void 0:r.getPaginatedAssessmentQuestionBankList:()=>{},v=r!=null&&r.getPaginatedAssessmentQuestionBankListFromStore?r==null?void 0:r.getPaginatedAssessmentQuestionBankListFromStore:[],m=r!=null&&r.updateQuestionBankStates?r==null?void 0:r.updateQuestionBankStates:()=>{},A=r!=null&&r.assessmentSearchFilterCourseCategoryId?r==null?void 0:r.assessmentSearchFilterCourseCategoryId:null,S=r!=null&&r.assessmentSearchFilterCourseSubjectId?r==null?void 0:r.assessmentSearchFilterCourseSubjectId:null,T=r!=null&&r.AssessmentQuestionBankLoading?r==null?void 0:r.AssessmentQuestionBankLoading:!1,C=r!=null&&r.AssessmentQuestionBankPaginator?r==null?void 0:r.AssessmentQuestionBankPaginator:()=>o.jsx(o.Fragment,{});r!=null&&r.courseCategoryList&&(r==null||r.courseCategoryList);const x=r!=null&&r.getCourseCategoryList?r==null?void 0:r.getCourseCategoryList:()=>{};r!=null&&r.subjectList&&(r==null||r.subjectList);const w=r!=null&&r.getSubjectList?r==null?void 0:r.getSubjectList:()=>{},[I,_]=F.useState([]),[N,O]=F.useState("");F.useEffect(()=>(t===Jd&&(x(),w()),()=>{}),[t]);const k=F.useCallback(()=>{const K=v.map(ce=>{var he;const X=JSON.parse(ce.question_meta_data),ne=JSON.parse(ce.meta_data);return{label:(he=X==null?void 0:X.questionText)==null?void 0:he[i==null?void 0:i.type],icon:"pi pi-fw pi-trash",element:"radio",schema:{uuid:tt(),componentType:"question",questionText:X==null?void 0:X.questionText,questionTextImage:ne==null?void 0:ne.questionImage,answerInputType:X!=null&&X.answerInputType?X==null?void 0:X.answerInputType:"radio",answerOptions:X==null?void 0:X.answerOptions,isHidden:!1,subject_title:ce==null?void 0:ce.subject_title,course_category_title:ce==null?void 0:ce.course_category_title,subject_id:ce==null?void 0:ce.subject_id,course_category_id:ce==null?void 0:ce.course_category_id,created_by_id:null,date_created:ce==null?void 0:ce.created_at},subject_title:ce==null?void 0:ce.subject_title,course_category_title:ce==null?void 0:ce.course_category_title,uuid:tt(),type:nr,componentType:"question"}});_(K)},[v,i==null?void 0:i.type]);F.useEffect(()=>{k()},[]);const M=()=>{h.current&&h.current};F.useEffect(()=>(t===Jd&&g(),()=>{}),[t,A,S]);const j=()=>{m({filter:N,page:1,per_page:10,sort:"created_at|desc"})},[P,$]=F.useState(f());return F.useEffect(()=>{$(f())},[t]),o.jsx(o.Fragment,{children:o.jsxs(as,{activeIndex:P,onTabChange:K=>$(K.index),scrollable:!0,children:[t===z0&&o.jsx(Sr,{header:"Survey",children:CQ.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid scroll-height-300",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"xl:col-6 lg:col-12 md:col-12 sm:col-12",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))}),(t===j0||t===fp)&&o.jsx(Sr,{header:"Form",children:o.jsx("div",{className:"scroll-height-300",children:wQ.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"xl:col-6 lg:col-12 md:col-12 sm:col-12",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))})}),(t===Cm||t===W9||t===af)&&o.jsx(Sr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-300",children:AK.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))})}),(t===z0||t===j0||t===fp)&&o.jsx(Sr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-300",children:SQ.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))})}),t===Jd&&o.jsx(Sr,{header:"Question bank",children:o.jsxs("div",{className:"grid scroll-height-300",children:[o.jsx("div",{className:"col-12",children:yK.map((K,ce)=>o.jsx("div",{className:"grid",children:K==null?void 0:K.items.map((X,ne)=>{const he=Et.cloneDeep(X);return o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:he},X.uuid)},"form_elements_"+ne)})},`new-quiz-${ce}`))}),o.jsx("div",{className:"col-12 ",children:o.jsxs("div",{className:"p-inputgroup",children:[o.jsx(wn,{placeholder:"Keyword",onChange:K=>{O(K.target.value),K.target.value||(m({filter:"",page:1,per_page:10,sort:"created_at|desc"}),g())},onKeyDown:K=>K.key==="Enter"?j():null}),o.jsx(Vt,{icon:"pi pi-search",className:"p-button-info",onClick:()=>j()})]})}),T?o.jsx(Vj,{}):o.jsx("div",{className:"scroll-height-500 w-full",children:I.map((K,ce)=>{var X,ne,he,q,W;return o.jsx("div",{onScroll:M,ref:h,className:"col-12 ",children:o.jsx(kd,{tags:[{severity:"success",label:K==null?void 0:K.subject_title},{severity:"info",label:K==null?void 0:K.course_category_title}],showIcon:(W=(q=(he=(ne=(X=a[0])==null?void 0:X.children[0])==null?void 0:ne.children[0])==null?void 0:he.children[0])==null?void 0:q.children)==null?void 0:W.some(Q=>{var Z,H,Y;return((Z=Q==null?void 0:Q.questionText)==null?void 0:Z[i.type])===((Y=(H=K==null?void 0:K.schema)==null?void 0:H.questionText)==null?void 0:Y[i.type])}),data:K},ce)},"question_elements_"+ce)})}),o.jsx(C,{})]})}),t===xm&&o.jsx(Sr,{header:"Training",children:o.jsx("div",{className:"scroll-height-300",children:xQ.map((K,ce)=>o.jsx(di,{header:K==null?void 0:K.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:K==null?void 0:K.items.map((X,ne)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:X},X.uuid)},"form_elements_"+ne))})},`pannel-tab-${ce}`))})}),(t===z0||t===j0||t===fp)&&o.jsxs(Sr,{header:"Custom",children:[o.jsx("h6",{children:"Custom Sections"}),o.jsx("div",{className:"grid",children:(n==null?void 0:n.length)>0&&n.map((K,ce)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:{label:K==null?void 0:K.builder_element_title,element:"reusable_builder_section",schema:K==null?void 0:K.reusable_template_schema,uuid:tt(),type:aa}},K.uuid)},"reusable_elements_"+ce))}),o.jsx("h6",{children:"Custom Matrix"}),o.jsx("div",{className:"grid",children:(e==null?void 0:e.length)>0&&e.map((K,ce)=>o.jsx("div",{className:"col-6",children:o.jsx(kd,{data:{label:K==null?void 0:K.custom_component_title,element:"custom_component",schema:JSON.parse(K==null?void 0:K.custom_component_schema),uuid:tt(),type:nr}},K.uuid)},"custom_component"+ce))})]})]})})};function qj(t){return t}function aTe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var sTe=800,oTe=16,lTe=Date.now;function cTe(t){var e=0,n=0;return function(){var r=lTe(),i=oTe-(r-n);if(n=r,i>0){if(++e>=sTe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function uTe(t){return function(){return t}}var dTe=j3?function(t,e){return j3(t,"toString",{configurable:!0,enumerable:!1,value:uTe(e),writable:!0})}:qj,fTe=cTe(dTe),Uj=Math.max;function hTe(t,e,n){return e=Uj(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=Uj(r.length-e,0),s=Array(a);++i<a;)s[i]=r[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=r[i];return l[e]=n(s),aTe(t,this,l)}}function pTe(t,e){return fTe(hTe(t,e,qj),t+"")}function gTe(t,e,n){if(!a0(n))return!1;var r=typeof e;return(r=="number"?z3(n)&&MN(e,n.length):r=="string"&&e in n)?o2(n[e],t):!1}function mTe(t){return pTe(function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&gTe(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var l=n[r];l&&t(e,l,r,a)}return e})}var vTe="__lodash_hash_undefined__";function bTe(t){return this.__data__.set(t,vTe),this}function yTe(t){return this.__data__.has(t)}function e9(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new sd;++e<n;)this.add(t[e])}e9.prototype.add=e9.prototype.push=bTe,e9.prototype.has=yTe;function ATe(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function wTe(t,e){return t.has(e)}var STe=1,CTe=2;function $j(t,e,n,r,i,a){var s=n&STe,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var f=-1,h=!0,g=n&CTe?new e9:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var v=t[f],m=e[f];if(r)var A=s?r(m,v,f,e,t,a):r(v,m,f,t,e,a);if(A!==void 0){if(A)continue;h=!1;break}if(g){if(!ATe(e,function(S,T){if(!wTe(g,T)&&(v===S||i(v,S,n,r,a)))return g.push(T)})){h=!1;break}}else if(!(v===m||i(v,m,n,r,a))){h=!1;break}}return a.delete(t),a.delete(e),h}function xTe(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function TTe(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var ETe=1,ITe=2,_Te="[object Boolean]",DTe="[object Date]",NTe="[object Error]",OTe="[object Map]",FTe="[object Number]",kTe="[object RegExp]",PTe="[object Set]",MTe="[object String]",LTe="[object Symbol]",BTe="[object ArrayBuffer]",VTe="[object DataView]",jj=fu?fu.prototype:void 0,US=jj?jj.valueOf:void 0;function qTe(t,e,n,r,i,a,s){switch(n){case VTe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case BTe:return!(t.byteLength!=e.byteLength||!a(new H3(t),new H3(e)));case _Te:case DTe:case FTe:return o2(+t,+e);case NTe:return t.name==e.name&&t.message==e.message;case kTe:case MTe:return t==e+"";case OTe:var l=xTe;case PTe:var c=r&ETe;if(l||(l=TTe),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=ITe,s.set(t,e);var d=$j(l(t),l(e),r,i,a,s);return s.delete(t),d;case LTe:if(US)return US.call(t)==US.call(e)}return!1}var UTe=1,$Te=Object.prototype,jTe=$Te.hasOwnProperty;function zTe(t,e,n,r,i,a){var s=n&UTe,l=R7(t),c=l.length,u=R7(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:jTe.call(e,h)))return!1}var g=a.get(t),v=a.get(e);if(g&&v)return g==e&&v==t;var m=!0;a.set(t,e),a.set(e,t);for(var A=s;++f<c;){h=l[f];var S=t[h],T=e[h];if(r)var C=s?r(T,S,h,e,t,a):r(S,T,h,t,e,a);if(!(C===void 0?S===T||i(S,T,n,r,a):C)){m=!1;break}A||(A=h=="constructor")}if(m&&!A){var x=t.constructor,w=e.constructor;x!=w&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(m=!1)}return a.delete(t),a.delete(e),m}var HTe=1,zj="[object Arguments]",Hj="[object Array]",t9="[object Object]",YTe=Object.prototype,Yj=YTe.hasOwnProperty;function KTe(t,e,n,r,i,a){var s=od(t),l=od(e),c=s?Hj:Nc(t),u=l?Hj:Nc(e);c=c==zj?t9:c,u=u==zj?t9:u;var d=c==t9,f=u==t9,h=c==u;if(h&&d2(t)){if(!d2(e))return!1;s=!0,d=!1}if(h&&!d)return a||(a=new pu),s||j7(t)?$j(t,e,n,r,i,a):qTe(t,e,c,n,r,i,a);if(!(n&HTe)){var g=d&&Yj.call(t,"__wrapped__"),v=f&&Yj.call(e,"__wrapped__");if(g||v){var m=g?t.value():t,A=v?e.value():e;return a||(a=new pu),i(m,A,n,r,a)}}return h?(a||(a=new pu),zTe(t,e,n,r,i,a)):!1}function Kj(t,e,n,r,i){return t===e?!0:t==null||e==null||!hu(t)&&!hu(e)?t!==t&&e!==e:KTe(t,e,n,r,Kj,i)}function RTe(t){return function(e,n,r){for(var i=-1,a=Object(e),s=r(e),l=s.length;l--;){var c=s[++i];if(n(a[c],c,a)===!1)break}return e}}var XTe=RTe();function $S(t,e,n){(n!==void 0&&!o2(t[e],n)||n===void 0&&!(e in t))&&V7(t,e,n)}function GTe(t){return hu(t)&&z3(t)}function jS(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function WTe(t){return u2(t,h2(t))}function QTe(t,e,n,r,i,a,s){var l=jS(t,n),c=jS(e,n),u=s.get(c);if(u){$S(t,n,u);return}var d=a?a(l,c,n+"",t,e,s):void 0,f=d===void 0;if(f){var h=od(c),g=!h&&d2(c),v=!h&&!g&&j7(c);d=c,h||g||v?od(l)?d=l:GTe(l)?d=Y7(l):g?(f=!1,d=HN(c,!0)):v?(f=!1,d=rO(c,!0)):d=[]:M7(c)||q7(c)?(d=l,q7(l)?d=WTe(l):(!a0(l)||L7(l))&&(d=aO(c))):f=!1}f&&(s.set(c,d),i(d,c,r,a,s),s.delete(c)),$S(t,n,d)}function Rj(t,e,n,r,i){t!==e&&XTe(e,function(a,s){if(i||(i=new pu),a0(a))QTe(t,e,s,n,Rj,r,i);else{var l=r?r(jS(t,s),a,s+"",t,e,i):void 0;l===void 0&&(l=a),$S(t,s,l)}},h2)}function zS(t,e){return Kj(t,e)}var E0=mTe(function(t,e,n){Rj(t,e,n)}),dr=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(dr||{});class Vu{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const i=dr.TYPE&dr.ATTRIBUTE;this.scope=r.scope!=null?r.scope&dr.LEVEL|i:dr.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class Rh extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Xj=class Tx{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,n=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(n){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,n)}return null}create(e,n,r){const i=this.query(n);if(i==null)throw new Rh(`Unable to create ${n} blot`);const a=i,s=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),l=new a(e,s,r);return Tx.blots.set(l.domNode,l),l}find(e,n=!1){return Tx.find(e,n)}query(e,n=dr.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&dr.LEVEL&dr.BLOCK?r=this.types.block:e&dr.LEVEL&dr.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(i=>(r=this.classes[i],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&dr.LEVEL&r.scope&&n&dr.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,i="attrName"in n;if(!r&&!i)throw new Rh("Invalid definition");if(r&&n.blotName==="abstract")throw new Rh("Cannot register abstract class");const a=r?n.blotName:i?n.attrName:void 0;return this.types[a]=n,i?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):r&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(s=>s.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(s=>{(this.tags[s]==null||n.className==null)&&(this.tags[s]=n)}))),n})}};Xj.blots=new WeakMap;let Xh=Xj;function Gj(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class JTe extends Vu{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(e,n){return this.canAdd(e,n)?(this.remove(e),e.classList.add(`${this.keyName}-${n}`),!0):!1}remove(e){Gj(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(Gj(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Kc=JTe;function HS(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class ZTe extends Vu{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[HS(this.keyName)]=n,!0):!1}remove(e){e.style[HS(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[HS(this.keyName)];return this.canAdd(e,n)?n:""}}const I0=ZTe;class eEe{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,n){n?e.add(this.domNode,n)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Xh.find(this.domNode);if(e==null)return;const n=Vu.keys(this.domNode),r=Kc.keys(this.domNode),i=I0.keys(this.domNode);n.concat(r).concat(i).forEach(a=>{const s=e.scroll.query(a,dr.ATTRIBUTE);s instanceof Vu&&(this.attributes[s.attrName]=s)})}copy(e){Object.keys(this.attributes).forEach(n=>{const r=this.attributes[n].value(this.domNode);e.format(n,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,n)=>(e[n]=this.attributes[n].value(this.domNode),e),{})}}const n9=eEe,Wj=class{constructor(e,n){this.scroll=e,this.domNode=n,Xh.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Rh("Blot definition missing tagName");let n,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?n=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?n=document.createElement(r):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Xh.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,i){const a=this.isolate(e,n);if(this.scroll.query(r,dr.BLOT)!=null&&i)a.wrap(r,i);else if(this.scroll.query(r,dr.ATTRIBUTE)!=null){const s=this.scroll.create(this.statics.scope);a.wrap(s),s.format(r,i)}}insertAt(e,n,r){const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(i,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Rh(`Cannot wrap ${e}`);return r.appendChild(this),r}};Wj.blotName="abstract";let Qj=Wj;const Jj=class extends Qj{static value(e){return!0}index(e,n){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(e,n){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Jj.scope=dr.INLINE_BLOT;const yo=Jj;class tEe{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),i=0;for(;r;){if(r===e)return i;i+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let i=r();for(;i;){const a=i.length();if(e<a||n&&e===a&&(i.next==null||i.next.length()!==0))return[i,e];e-=a,i=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[i,a]=this.find(e);let s=e-a;const l=this.iterator(i);let c=l();for(;c&&s<e+n;){const u=c.length();e>s?r(c,e-s,Math.min(n,s+u-e)):r(c,0,Math.min(u,e+n-s)),s+=u,c=l()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let i=r();for(;i;)n=e(n,i),i=r();return n}}function Zj(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(dr.INLINE);return Array.from(t.childNodes).forEach(i=>{r.domNode.appendChild(i)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const ez=class U0 extends Qj{constructor(e,n){super(e,n),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,U0.uiClass&&this.uiNode.classList.add(U0.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new tEe,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=Zj(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof Rh)return;throw n}})}deleteAt(e,n){if(e===0&&n===this.length())return this.remove();this.children.forEachAt(e,n,(r,i,a)=>{r.deleteAt(i,a)})}descendant(e,n=0){const[r,i]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof U0?r.descendant(e,i):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let i=[],a=r;return this.children.forEachAt(n,r,(s,l,c)=>{(e.blotName==null&&e(s)||e.blotName!=null&&s instanceof e)&&i.push(s),s instanceof U0&&(i=i.concat(s.descendants(e,l,a))),a-=c}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===dr.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof U0?n.unwrap():n.remove())})}formatAt(e,n,r,i){this.children.forEachAt(e,n,(a,s,l)=>{a.formatAt(s,l,r,i)})}insertAt(e,n,r){const[i,a]=this.children.find(e);if(i)i.insertAt(a,n,r);else{const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(s)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,i]=this.children.find(e,n),a=[[this,e]];return r instanceof U0?a.concat(r.path(i,n)):(r!=null&&a.push([r,i]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof U0&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(i,a,s)=>{const l=i.split(a,n);l!=null&&r.appendChild(l)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],i=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),i.push(...a.removedNodes))}),i.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const s=this.scroll.find(a);s!=null&&(s.domNode.parentNode==null||s.domNode.parentNode===this.domNode)&&s.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,s)=>a===s?0:a.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let s=null;a.nextSibling!=null&&(s=this.scroll.find(a.nextSibling));const l=Zj(a,this.scroll);(l.next!==s||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,s||void 0))}),this.enforceAllowedChildren()}};ez.uiClass="";const Rc=ez;function nEe(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}const Gh=class dp extends Rc{static create(e){return super.create(e)}static formats(e,n){const r=n.query(dp.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new n9(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof dp||(r=r.wrap(dp.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,dr.INLINE);if(r==null)return;r instanceof Vu?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,i){this.formats()[r]!=null||this.scroll.query(r,dr.ATTRIBUTE)?this.isolate(e,n).format(r,i):super.formatAt(e,n,r,i)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof dp&&r.prev===this&&nEe(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof dp&&this.attributes.move(r),r}};Gh.allowedChildren=[Gh,yo],Gh.blotName="inline",Gh.scope=dr.INLINE_BLOT,Gh.tagName="SPAN";const YS=Gh,Wh=class Ex extends Rc{static create(e){return super.create(e)}static formats(e,n){const r=n.query(Ex.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new n9(this.domNode)}format(e,n){const r=this.scroll.query(e,dr.BLOCK);r!=null&&(r instanceof Vu?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(Ex.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,i){this.scroll.query(r,dr.BLOCK)!=null?this.format(r,i):super.formatAt(e,n,r,i)}insertAt(e,n,r){if(r==null||this.scroll.query(n,dr.INLINE)!=null)super.insertAt(e,n,r);else{const i=this.split(e);if(i!=null){const a=this.scroll.create(n,r);i.parent.insertBefore(a,i)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};Wh.blotName="block",Wh.scope=dr.BLOCK_BLOT,Wh.tagName="P",Wh.allowedChildren=[YS,Wh,yo];const Hg=Wh,KS=class extends Rc{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,n){super.deleteAt(e,n),this.enforceAllowedChildren()}formatAt(e,n,r,i){super.formatAt(e,n,r,i),this.enforceAllowedChildren()}insertAt(e,n,r){super.insertAt(e,n,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};KS.blotName="container",KS.scope=dr.BLOCK_BLOT;const r9=KS;class rEe extends yo{static formats(e,n){}format(e,n){super.formatAt(0,this.length(),e,n)}formatAt(e,n,r,i){e===0&&n===this.length()?this.format(r,i):super.formatAt(e,n,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Pl=rEe,iEe={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},aEe=100,Qh=class extends Rc{constructor(e,n){super(null,n),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,iEe),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=dr.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,i){this.update(),super.formatAt(e,n,r,i)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const a=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&a(c.parent))},s=c=>{r.has(c.domNode)&&(c instanceof Rc&&c.children.forEach(s),r.delete(c.domNode),c.optimize(n))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=aEe)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(u=>{const d=this.find(u.target,!0);d!=null&&(d.domNode===u.target&&(u.type==="childList"?(a(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(f=>{const h=this.find(f,!1);a(h,!1),h instanceof Rc&&h.children.forEach(g=>{a(g,!1)})})):u.type==="attributes"&&a(d.prev)),a(d))}),this.children.forEach(s),l=Array.from(this.observer.takeRecords()),i=l.slice();i.length>0;)e.push(i.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const a=this.find(i.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(i),null):(r.set(a.domNode,[i]),a)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};Qh.blotName="scroll",Qh.defaultChild=Hg,Qh.allowedChildren=[Hg,r9],Qh.scope=dr.BLOCK_BLOT,Qh.tagName="DIV";const RS=Qh,XS=class YY extends yo{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,n){super(e,n),this.text=this.statics.value(this.domNode)}deleteAt(e,n){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+n)}index(e,n){return this.domNode===e?n:-1}insertAt(e,n,r){r==null?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,n,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof YY&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,n=!1){return[this.domNode,e]}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,n){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};XS.blotName="text",XS.scope=dr.INLINE_BLOT;const i9=XS,tz=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Vu,AttributorStore:n9,BlockBlot:Hg,ClassAttributor:Kc,ContainerBlot:r9,EmbedBlot:Pl,InlineBlot:YS,LeafBlot:yo,ParentBlot:Rc,Registry:Xh,Scope:dr,ScrollBlot:RS,StyleAttributor:I0,TextBlot:i9},Symbol.toStringTag,{value:"Module"}));var GS={exports:{}},Ml=-1,qo=1,Ns=0;function Yg(t,e,n,r,i){if(t===e)return t?[[Ns,t]]:[];if(n!=null){var a=pEe(t,e,n);if(a)return a}var s=WS(t,e),l=t.substring(0,s);t=t.substring(s),e=e.substring(s),s=a9(t,e);var c=t.substring(t.length-s);t=t.substring(0,t.length-s),e=e.substring(0,e.length-s);var u=sEe(t,e);return l&&u.unshift([Ns,l]),c&&u.push([Ns,c]),QS(u,i),r&&cEe(u),u}function sEe(t,e){var n;if(!t)return[[qo,e]];if(!e)return[[Ml,t]];var r=t.length>e.length?t:e,i=t.length>e.length?e:t,a=r.indexOf(i);if(a!==-1)return n=[[qo,r.substring(0,a)],[Ns,i],[qo,r.substring(a+i.length)]],t.length>e.length&&(n[0][0]=n[2][0]=Ml),n;if(i.length===1)return[[Ml,t],[qo,e]];var s=lEe(t,e);if(s){var l=s[0],c=s[1],u=s[2],d=s[3],f=s[4],h=Yg(l,u),g=Yg(c,d);return h.concat([[Ns,f]],g)}return oEe(t,e)}function oEe(t,e){for(var n=t.length,r=e.length,i=Math.ceil((n+r)/2),a=i,s=2*i,l=new Array(s),c=new Array(s),u=0;u<s;u++)l[u]=-1,c[u]=-1;l[a+1]=0,c[a+1]=0;for(var d=n-r,f=d%2!==0,h=0,g=0,v=0,m=0,A=0;A<i;A++){for(var S=-A+h;S<=A-g;S+=2){var T=a+S,C;S===-A||S!==A&&l[T-1]<l[T+1]?C=l[T+1]:C=l[T-1]+1;for(var x=C-S;C<n&&x<r&&t.charAt(C)===e.charAt(x);)C++,x++;if(l[T]=C,C>n)g+=2;else if(x>r)h+=2;else if(f){var w=a+d-S;if(w>=0&&w<s&&c[w]!==-1){var I=n-c[w];if(C>=I)return nz(t,e,C,x)}}}for(var _=-A+v;_<=A-m;_+=2){var w=a+_,I;_===-A||_!==A&&c[w-1]<c[w+1]?I=c[w+1]:I=c[w-1]+1;for(var N=I-_;I<n&&N<r&&t.charAt(n-I-1)===e.charAt(r-N-1);)I++,N++;if(c[w]=I,I>n)m+=2;else if(N>r)v+=2;else if(!f){var T=a+d-_;if(T>=0&&T<s&&l[T]!==-1){var C=l[T],x=a+C-T;if(I=n-I,C>=I)return nz(t,e,C,x)}}}}return[[Ml,t],[qo,e]]}function nz(t,e,n,r){var i=t.substring(0,n),a=e.substring(0,r),s=t.substring(n),l=e.substring(r),c=Yg(i,a),u=Yg(s,l);return c.concat(u)}function WS(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;n<i;)t.substring(a,i)==e.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return oz(t.charCodeAt(i-1))&&i--,i}function rz(t,e){var n=t.length,r=e.length;if(n==0||r==0)return 0;n>r?t=t.substring(n-r):n<r&&(e=e.substring(0,n));var i=Math.min(n,r);if(t==e)return i;for(var a=0,s=1;;){var l=t.substring(i-s),c=e.indexOf(l);if(c==-1)return a;s+=c,(c==0||t.substring(i-s)==e.substring(0,s))&&(a=s,s++)}}function a9(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;n<i;)t.substring(t.length-i,t.length-a)==e.substring(e.length-i,e.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return lz(t.charCodeAt(t.length-i))&&i--,i}function lEe(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||r.length*2<n.length)return null;function i(g,v,m){for(var A=g.substring(m,m+Math.floor(g.length/4)),S=-1,T="",C,x,w,I;(S=v.indexOf(A,S+1))!==-1;){var _=WS(g.substring(m),v.substring(S)),N=a9(g.substring(0,m),v.substring(0,S));T.length<N+_&&(T=v.substring(S-N,S)+v.substring(S,S+_),C=g.substring(0,m-N),x=g.substring(m+_),w=v.substring(0,S-N),I=v.substring(S+_))}return T.length*2>=g.length?[C,x,w,I,T]:null}var a=i(n,r,Math.ceil(n.length/4)),s=i(n,r,Math.ceil(n.length/2)),l;if(!a&&!s)return null;s?a?l=a[4].length>s[4].length?a:s:l=s:l=a;var c,u,d,f;t.length>e.length?(c=l[0],u=l[1],d=l[2],f=l[3]):(d=l[0],f=l[1],c=l[2],u=l[3]);var h=l[4];return[c,u,d,f,h]}function cEe(t){for(var e=!1,n=[],r=0,i=null,a=0,s=0,l=0,c=0,u=0;a<t.length;)t[a][0]==Ns?(n[r++]=a,s=c,l=u,c=0,u=0,i=t[a][1]):(t[a][0]==qo?c+=t[a][1].length:u+=t[a][1].length,i&&i.length<=Math.max(s,l)&&i.length<=Math.max(c,u)&&(t.splice(n[r-1],0,[Ml,i]),t[n[r-1]+1][0]=qo,r--,r--,a=r>0?n[r-1]:-1,s=0,l=0,c=0,u=0,i=null,e=!0)),a++;for(e&&QS(t),fEe(t),a=1;a<t.length;){if(t[a-1][0]==Ml&&t[a][0]==qo){var d=t[a-1][1],f=t[a][1],h=rz(d,f),g=rz(f,d);h>=g?(h>=d.length/2||h>=f.length/2)&&(t.splice(a,0,[Ns,f.substring(0,h)]),t[a-1][1]=d.substring(0,d.length-h),t[a+1][1]=f.substring(h),a++):(g>=d.length/2||g>=f.length/2)&&(t.splice(a,0,[Ns,d.substring(0,g)]),t[a-1][0]=qo,t[a-1][1]=f.substring(0,f.length-g),t[a+1][0]=Ml,t[a+1][1]=d.substring(g),a++),a++}a++}}var iz=/[^a-zA-Z0-9]/,az=/\s/,sz=/[\r\n]/,uEe=/\n\r?\n$/,dEe=/^\r?\n\r?\n/;function fEe(t){function e(g,v){if(!g||!v)return 6;var m=g.charAt(g.length-1),A=v.charAt(0),S=m.match(iz),T=A.match(iz),C=S&&m.match(az),x=T&&A.match(az),w=C&&m.match(sz),I=x&&A.match(sz),_=w&&g.match(uEe),N=I&&v.match(dEe);return _||N?5:w||I?4:S&&!C&&x?3:C||x?2:S||T?1:0}for(var n=1;n<t.length-1;){if(t[n-1][0]==Ns&&t[n+1][0]==Ns){var r=t[n-1][1],i=t[n][1],a=t[n+1][1],s=a9(r,i);if(s){var l=i.substring(i.length-s);r=r.substring(0,r.length-s),i=l+i.substring(0,i.length-s),a=l+a}for(var c=r,u=i,d=a,f=e(r,i)+e(i,a);i.charAt(0)===a.charAt(0);){r+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var h=e(r,i)+e(i,a);h>=f&&(f=h,c=r,u=i,d=a)}t[n-1][1]!=c&&(c?t[n-1][1]=c:(t.splice(n-1,1),n--),t[n][1]=u,d?t[n+1][1]=d:(t.splice(n+1,1),n--))}n++}}function QS(t,e){t.push([Ns,""]);for(var n=0,r=0,i=0,a="",s="",l;n<t.length;){if(n<t.length-1&&!t[n][1]){t.splice(n,1);continue}switch(t[n][0]){case qo:i++,s+=t[n][1],n++;break;case Ml:r++,a+=t[n][1],n++;break;case Ns:var c=n-i-r-1;if(e){if(c>=0&&uz(t[c][1])){var u=t[c][1].slice(-1);if(t[c][1]=t[c][1].slice(0,-1),a=u+a,s=u+s,!t[c][1]){t.splice(c,1),n--;var d=c-1;t[d]&&t[d][0]===qo&&(i++,s=t[d][1]+s,d--),t[d]&&t[d][0]===Ml&&(r++,a=t[d][1]+a,d--),c=d}}if(cz(t[n][1])){var u=t[n][1].charAt(0);t[n][1]=t[n][1].slice(1),a+=u,s+=u}}if(n<t.length-1&&!t[n][1]){t.splice(n,1);break}if(a.length>0||s.length>0){a.length>0&&s.length>0&&(l=WS(s,a),l!==0&&(c>=0?t[c][1]+=s.substring(0,l):(t.splice(0,0,[Ns,s.substring(0,l)]),n++),s=s.substring(l),a=a.substring(l)),l=a9(s,a),l!==0&&(t[n][1]=s.substring(s.length-l)+t[n][1],s=s.substring(0,s.length-l),a=a.substring(0,a.length-l)));var f=i+r;a.length===0&&s.length===0?(t.splice(n-f,f),n=n-f):a.length===0?(t.splice(n-f,f,[qo,s]),n=n-f+1):s.length===0?(t.splice(n-f,f,[Ml,a]),n=n-f+1):(t.splice(n-f,f,[Ml,a],[qo,s]),n=n-f+2)}n!==0&&t[n-1][0]===Ns?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,i=0,r=0,a="",s="";break}}t[t.length-1][1]===""&&t.pop();var h=!1;for(n=1;n<t.length-1;)t[n-1][0]===Ns&&t[n+1][0]===Ns&&(t[n][1].substring(t[n][1].length-t[n-1][1].length)===t[n-1][1]?(t[n][1]=t[n-1][1]+t[n][1].substring(0,t[n][1].length-t[n-1][1].length),t[n+1][1]=t[n-1][1]+t[n+1][1],t.splice(n-1,1),h=!0):t[n][1].substring(0,t[n+1][1].length)==t[n+1][1]&&(t[n-1][1]+=t[n+1][1],t[n][1]=t[n][1].substring(t[n+1][1].length)+t[n+1][1],t.splice(n+1,1),h=!0)),n++;h&&QS(t,e)}function oz(t){return t>=55296&&t<=56319}function lz(t){return t>=56320&&t<=57343}function cz(t){return lz(t.charCodeAt(0))}function uz(t){return oz(t.charCodeAt(t.length-1))}function hEe(t){for(var e=[],n=0;n<t.length;n++)t[n][1].length>0&&e.push(t[n]);return e}function JS(t,e,n,r){return uz(t)||cz(r)?null:hEe([[Ns,t],[Ml,e],[qo,n],[Ns,r]])}function pEe(t,e,n){var r=typeof n=="number"?{index:n,length:0}:n.oldRange,i=typeof n=="number"?null:n.newRange,a=t.length,s=e.length;if(r.length===0&&(i===null||i.length===0)){var l=r.index,c=t.slice(0,l),u=t.slice(l),d=i?i.index:null;e:{var f=l+s-a;if(d!==null&&d!==f||f<0||f>s)break e;var h=e.slice(0,f),g=e.slice(f);if(g!==u)break e;var v=Math.min(l,f),m=c.slice(0,v),A=h.slice(0,v);if(m!==A)break e;var S=c.slice(v),T=h.slice(v);return JS(m,S,T,u)}e:{if(d!==null&&d!==l)break e;var C=l,h=e.slice(0,C),g=e.slice(C);if(h!==c)break e;var x=Math.min(a-C,s-C),w=u.slice(u.length-x),I=g.slice(g.length-x);if(w!==I)break e;var S=u.slice(0,u.length-x),T=g.slice(0,g.length-x);return JS(c,S,T,w)}}if(r.length>0&&i&&i.length===0)e:{var m=t.slice(0,r.index),w=t.slice(r.index+r.length),v=m.length,x=w.length;if(s<v+x)break e;var A=e.slice(0,v),I=e.slice(s-x);if(m!==A||w!==I)break e;var S=t.slice(v,a-x),T=e.slice(v,s-x);return JS(m,S,T,w)}return null}function s9(t,e,n,r){return Yg(t,e,n,r,!0)}s9.INSERT=qo,s9.DELETE=Ml,s9.EQUAL=Ns;var gEe=s9,o9={exports:{}};o9.exports,function(t,e){var n=200,r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",d="[object Function]",f="[object GeneratorFunction]",h="[object Map]",g="[object Number]",v="[object Object]",m="[object Promise]",A="[object RegExp]",S="[object Set]",T="[object String]",C="[object Symbol]",x="[object WeakMap]",w="[object ArrayBuffer]",I="[object DataView]",_="[object Float32Array]",N="[object Float64Array]",O="[object Int8Array]",k="[object Int16Array]",M="[object Int32Array]",j="[object Uint8Array]",P="[object Uint8ClampedArray]",$="[object Uint16Array]",K="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,X=/\w*$/,ne=/^\[object .+?Constructor\]$/,he=/^(?:0|[1-9]\d*)$/,q={};q[a]=q[s]=q[w]=q[I]=q[l]=q[c]=q[_]=q[N]=q[O]=q[k]=q[M]=q[h]=q[g]=q[v]=q[A]=q[S]=q[T]=q[C]=q[j]=q[P]=q[$]=q[K]=!0,q[u]=q[d]=q[x]=!1;var W=typeof ki=="object"&&ki&&ki.Object===Object&&ki,Q=typeof self=="object"&&self&&self.Object===Object&&self,Z=W||Q||Function("return this")(),H=e&&!e.nodeType&&e,Y=H&&!0&&t&&!t.nodeType&&t,oe=Y&&Y.exports===H;function be(re,Le){return re.set(Le[0],Le[1]),re}function Ce(re,Le){return re.add(Le),re}function ve(re,Le){for(var rt=-1,qt=re?re.length:0;++rt<qt&&Le(re[rt],rt,re)!==!1;);return re}function ye(re,Le){for(var rt=-1,qt=Le.length,Er=re.length;++rt<qt;)re[Er+rt]=Le[rt];return re}function te(re,Le,rt,qt){for(var Er=-1,sr=re?re.length:0;++Er<sr;)rt=Le(rt,re[Er],Er,re);return rt}function L(re,Le){for(var rt=-1,qt=Array(re);++rt<re;)qt[rt]=Le(rt);return qt}function le(re,Le){return re==null?void 0:re[Le]}function ie(re){var Le=!1;if(re!=null&&typeof re.toString!="function")try{Le=!!(re+"")}catch{}return Le}function ue(re){var Le=-1,rt=Array(re.size);return re.forEach(function(qt,Er){rt[++Le]=[Er,qt]}),rt}function Ne(re,Le){return function(rt){return re(Le(rt))}}function _e(re){var Le=-1,rt=Array(re.size);return re.forEach(function(qt){rt[++Le]=qt}),rt}var me=Array.prototype,se=Function.prototype,we=Object.prototype,ke=Z["__core-js_shared__"],R=function(){var re=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return re?"Symbol(src)_1."+re:""}(),Ae=se.toString,Se=we.hasOwnProperty,fe=we.toString,ge=RegExp("^"+Ae.call(Se).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pe=oe?Z.Buffer:void 0,Ve=Z.Symbol,De=Z.Uint8Array,He=Ne(Object.getPrototypeOf,Object),it=Object.create,ut=we.propertyIsEnumerable,dt=me.splice,Bt=Object.getOwnPropertySymbols,ln=pe?pe.isBuffer:void 0,Ft=Ne(Object.keys,Object),mn=Ei(Z,"DataView"),Vn=Ei(Z,"Map"),xt=Ei(Z,"Promise"),je=Ei(Z,"Set"),Ye=Ei(Z,"WeakMap"),st=Ei(Object,"create"),Jt=qr(mn),Xt=qr(Vn),Zt=qr(xt),yn=qr(je),vt=qr(Ye),Be=Ve?Ve.prototype:void 0,nt=Be?Be.valueOf:void 0;function Tt(re){var Le=-1,rt=re?re.length:0;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Mt(){this.__data__=st?st(null):{}}function Nn(re){return this.has(re)&&delete this.__data__[re]}function kn(re){var Le=this.__data__;if(st){var rt=Le[re];return rt===r?void 0:rt}return Se.call(Le,re)?Le[re]:void 0}function Qn(re){var Le=this.__data__;return st?Le[re]!==void 0:Se.call(Le,re)}function Jn(re,Le){var rt=this.__data__;return rt[re]=st&&Le===void 0?r:Le,this}Tt.prototype.clear=Mt,Tt.prototype.delete=Nn,Tt.prototype.get=kn,Tt.prototype.has=Qn,Tt.prototype.set=Jn;function br(re){var Le=-1,rt=re?re.length:0;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Or(){this.__data__=[]}function Sn(re){var Le=this.__data__,rt=ae(Le,re);if(rt<0)return!1;var qt=Le.length-1;return rt==qt?Le.pop():dt.call(Le,rt,1),!0}function ot(re){var Le=this.__data__,rt=ae(Le,re);return rt<0?void 0:Le[rt][1]}function ct(re){return ae(this.__data__,re)>-1}function yt(re,Le){var rt=this.__data__,qt=ae(rt,re);return qt<0?rt.push([re,Le]):rt[qt][1]=Le,this}br.prototype.clear=Or,br.prototype.delete=Sn,br.prototype.get=ot,br.prototype.has=ct,br.prototype.set=yt;function Nt(re){var Le=-1,rt=re?re.length:0;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Cn(){this.__data__={hash:new Tt,map:new(Vn||br),string:new Tt}}function On(re){return ji(this,re).delete(re)}function _t(re){return ji(this,re).get(re)}function Fe(re){return ji(this,re).has(re)}function Qe(re,Le){return ji(this,re).set(re,Le),this}Nt.prototype.clear=Cn,Nt.prototype.delete=On,Nt.prototype.get=_t,Nt.prototype.has=Fe,Nt.prototype.set=Qe;function At(re){this.__data__=new br(re)}function zt(){this.__data__=new br}function Rt(re){return this.__data__.delete(re)}function nn(re){return this.__data__.get(re)}function xn(re){return this.__data__.has(re)}function Ln(re,Le){var rt=this.__data__;if(rt instanceof br){var qt=rt.__data__;if(!Vn||qt.length<n-1)return qt.push([re,Le]),this;rt=this.__data__=new Nt(qt)}return rt.set(re,Le),this}At.prototype.clear=zt,At.prototype.delete=Rt,At.prototype.get=nn,At.prototype.has=xn,At.prototype.set=Ln;function Hn(re,Le){var rt=It(re)||Ke(re)?L(re.length,String):[],qt=rt.length,Er=!!qt;for(var sr in re)Se.call(re,sr)&&!(Er&&(sr=="length"||zn(sr,qt)))&&rt.push(sr);return rt}function at(re,Le,rt){var qt=re[Le];(!(Se.call(re,Le)&&An(qt,rt))||rt===void 0&&!(Le in re))&&(re[Le]=rt)}function ae(re,Le){for(var rt=re.length;rt--;)if(An(re[rt][0],Le))return rt;return-1}function Me(re,Le){return re&&fi(Le,wo(Le),re)}function We(re,Le,rt,qt,Er,sr,Wr){var Fr;if(qt&&(Fr=sr?qt(re,Er,sr,Wr):qt(re)),Fr!==void 0)return Fr;if(!pa(re))return re;var Tr=It(re);if(Tr){if(Fr=pn(re),!Le)return oi(re,Fr)}else{var Qr=Yi(re),Ii=Qr==d||Qr==f;if(yr(re))return Yn(re,Le);if(Qr==v||Qr==a||Ii&&!sr){if(ie(re))return sr?re:{};if(Fr=$e(Ii?{}:re),!Le)return Mi(re,Me(Fr,re))}else{if(!q[Qr])return sr?re:{};Fr=Kt(re,Qr,We,Le)}}Wr||(Wr=new At);var Qa=Wr.get(re);if(Qa)return Qa;if(Wr.set(re,Fr),!Tr)var Ki=rt?rr(re):wo(re);return ve(Ki||re,function(vi,Ca){Ki&&(Ca=vi,vi=re[Ca]),at(Fr,Ca,We(vi,Le,rt,qt,Ca,re,Wr))}),Fr}function ft(re){return pa(re)?it(re):{}}function Ct(re,Le,rt){var qt=Le(re);return It(re)?qt:ye(qt,rt(re))}function Gt(re){return fe.call(re)}function Dn(re){if(!pa(re)||Pr(re))return!1;var Le=Mr(re)||ie(re)?ge:ne;return Le.test(qr(re))}function Pn(re){if(!Wa(re))return Ft(re);var Le=[];for(var rt in Object(re))Se.call(re,rt)&&rt!="constructor"&&Le.push(rt);return Le}function Yn(re,Le){if(Le)return re.slice();var rt=new re.constructor(re.length);return re.copy(rt),rt}function Lr(re){var Le=new re.constructor(re.byteLength);return new De(Le).set(new De(re)),Le}function Xr(re,Le){var rt=Le?Lr(re.buffer):re.buffer;return new re.constructor(rt,re.byteOffset,re.byteLength)}function $n(re,Le,rt){var qt=Le?rt(ue(re),!0):ue(re);return te(qt,be,new re.constructor)}function Fn(re){var Le=new re.constructor(re.source,X.exec(re));return Le.lastIndex=re.lastIndex,Le}function lr(re,Le,rt){var qt=Le?rt(_e(re),!0):_e(re);return te(qt,Ce,new re.constructor)}function Br(re){return nt?Object(nt.call(re)):{}}function mi(re,Le){var rt=Le?Lr(re.buffer):re.buffer;return new re.constructor(rt,re.byteOffset,re.length)}function oi(re,Le){var rt=-1,qt=re.length;for(Le||(Le=Array(qt));++rt<qt;)Le[rt]=re[rt];return Le}function fi(re,Le,rt,qt){rt||(rt={});for(var Er=-1,sr=Le.length;++Er<sr;){var Wr=Le[Er],Fr=void 0;at(rt,Wr,Fr===void 0?re[Wr]:Fr)}return rt}function Mi(re,Le){return fi(re,Ci(re),Le)}function rr(re){return Ct(re,wo,Ci)}function ji(re,Le){var rt=re.__data__;return zr(Le)?rt[typeof Le=="string"?"string":"hash"]:rt.map}function Ei(re,Le){var rt=le(re,Le);return Dn(rt)?rt:void 0}var Ci=Bt?Ne(Bt,Object):Gr,Yi=Gt;(mn&&Yi(new mn(new ArrayBuffer(1)))!=I||Vn&&Yi(new Vn)!=h||xt&&Yi(xt.resolve())!=m||je&&Yi(new je)!=S||Ye&&Yi(new Ye)!=x)&&(Yi=function(re){var Le=fe.call(re),rt=Le==v?re.constructor:void 0,qt=rt?qr(rt):void 0;if(qt)switch(qt){case Jt:return I;case Xt:return h;case Zt:return m;case yn:return S;case vt:return x}return Le});function pn(re){var Le=re.length,rt=re.constructor(Le);return Le&&typeof re[0]=="string"&&Se.call(re,"index")&&(rt.index=re.index,rt.input=re.input),rt}function $e(re){return typeof re.constructor=="function"&&!Wa(re)?ft(He(re)):{}}function Kt(re,Le,rt,qt){var Er=re.constructor;switch(Le){case w:return Lr(re);case l:case c:return new Er(+re);case I:return Xr(re,qt);case _:case N:case O:case k:case M:case j:case P:case $:case K:return mi(re,qt);case h:return $n(re,qt,rt);case g:case T:return new Er(re);case A:return Fn(re);case S:return lr(re,qt,rt);case C:return Br(re)}}function zn(re,Le){return Le=Le??i,!!Le&&(typeof re=="number"||he.test(re))&&re>-1&&re%1==0&&re<Le}function zr(re){var Le=typeof re;return Le=="string"||Le=="number"||Le=="symbol"||Le=="boolean"?re!=="__proto__":re===null}function Pr(re){return!!R&&R in re}function Wa(re){var Le=re&&re.constructor,rt=typeof Le=="function"&&Le.prototype||we;return re===rt}function qr(re){if(re!=null){try{return Ae.call(re)}catch{}try{return re+""}catch{}}return""}function Os(re){return We(re,!0,!0)}function An(re,Le){return re===Le||re!==re&&Le!==Le}function Ke(re){return er(re)&&Se.call(re,"callee")&&(!ut.call(re,"callee")||fe.call(re)==a)}var It=Array.isArray;function en(re){return re!=null&&ua(re.length)&&!Mr(re)}function er(re){return zs(re)&&en(re)}var yr=ln||hi;function Mr(re){var Le=pa(re)?fe.call(re):"";return Le==d||Le==f}function ua(re){return typeof re=="number"&&re>-1&&re%1==0&&re<=i}function pa(re){var Le=typeof re;return!!re&&(Le=="object"||Le=="function")}function zs(re){return!!re&&typeof re=="object"}function wo(re){return en(re)?Hn(re):Pn(re)}function Gr(){return[]}function hi(){return!1}t.exports=Os}(o9,o9.exports);var dz=o9.exports,l9={exports:{}};l9.exports,function(t,e){var n=200,r="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",f="[object Date]",h="[object Error]",g="[object Function]",v="[object GeneratorFunction]",m="[object Map]",A="[object Number]",S="[object Null]",T="[object Object]",C="[object Promise]",x="[object Proxy]",w="[object RegExp]",I="[object Set]",_="[object String]",N="[object Symbol]",O="[object Undefined]",k="[object WeakMap]",M="[object ArrayBuffer]",j="[object DataView]",P="[object Float32Array]",$="[object Float64Array]",K="[object Int8Array]",ce="[object Int16Array]",X="[object Int32Array]",ne="[object Uint8Array]",he="[object Uint8ClampedArray]",q="[object Uint16Array]",W="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,Z=/^\[object .+?Constructor\]$/,H=/^(?:0|[1-9]\d*)$/,Y={};Y[P]=Y[$]=Y[K]=Y[ce]=Y[X]=Y[ne]=Y[he]=Y[q]=Y[W]=!0,Y[l]=Y[c]=Y[M]=Y[d]=Y[j]=Y[f]=Y[h]=Y[g]=Y[m]=Y[A]=Y[T]=Y[w]=Y[I]=Y[_]=Y[k]=!1;var oe=typeof ki=="object"&&ki&&ki.Object===Object&&ki,be=typeof self=="object"&&self&&self.Object===Object&&self,Ce=oe||be||Function("return this")(),ve=e&&!e.nodeType&&e,ye=ve&&!0&&t&&!t.nodeType&&t,te=ye&&ye.exports===ve,L=te&&oe.process,le=function(){try{return L&&L.binding&&L.binding("util")}catch{}}(),ie=le&&le.isTypedArray;function ue(re,Le){for(var rt=-1,qt=re==null?0:re.length,Er=0,sr=[];++rt<qt;){var Wr=re[rt];Le(Wr,rt,re)&&(sr[Er++]=Wr)}return sr}function Ne(re,Le){for(var rt=-1,qt=Le.length,Er=re.length;++rt<qt;)re[Er+rt]=Le[rt];return re}function _e(re,Le){for(var rt=-1,qt=re==null?0:re.length;++rt<qt;)if(Le(re[rt],rt,re))return!0;return!1}function me(re,Le){for(var rt=-1,qt=Array(re);++rt<re;)qt[rt]=Le(rt);return qt}function se(re){return function(Le){return re(Le)}}function we(re,Le){return re.has(Le)}function ke(re,Le){return re==null?void 0:re[Le]}function R(re){var Le=-1,rt=Array(re.size);return re.forEach(function(qt,Er){rt[++Le]=[Er,qt]}),rt}function Ae(re,Le){return function(rt){return re(Le(rt))}}function Se(re){var Le=-1,rt=Array(re.size);return re.forEach(function(qt){rt[++Le]=qt}),rt}var fe=Array.prototype,ge=Function.prototype,pe=Object.prototype,Ve=Ce["__core-js_shared__"],De=ge.toString,He=pe.hasOwnProperty,it=function(){var re=/[^.]+$/.exec(Ve&&Ve.keys&&Ve.keys.IE_PROTO||"");return re?"Symbol(src)_1."+re:""}(),ut=pe.toString,dt=RegExp("^"+De.call(He).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=te?Ce.Buffer:void 0,ln=Ce.Symbol,Ft=Ce.Uint8Array,mn=pe.propertyIsEnumerable,Vn=fe.splice,xt=ln?ln.toStringTag:void 0,je=Object.getOwnPropertySymbols,Ye=Bt?Bt.isBuffer:void 0,st=Ae(Object.keys,Object),Jt=Ci(Ce,"DataView"),Xt=Ci(Ce,"Map"),Zt=Ci(Ce,"Promise"),yn=Ci(Ce,"Set"),vt=Ci(Ce,"WeakMap"),Be=Ci(Object,"create"),nt=qr(Jt),Tt=qr(Xt),Mt=qr(Zt),Nn=qr(yn),kn=qr(vt),Qn=ln?ln.prototype:void 0,Jn=Qn?Qn.valueOf:void 0;function br(re){var Le=-1,rt=re==null?0:re.length;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Or(){this.__data__=Be?Be(null):{},this.size=0}function Sn(re){var Le=this.has(re)&&delete this.__data__[re];return this.size-=Le?1:0,Le}function ot(re){var Le=this.__data__;if(Be){var rt=Le[re];return rt===r?void 0:rt}return He.call(Le,re)?Le[re]:void 0}function ct(re){var Le=this.__data__;return Be?Le[re]!==void 0:He.call(Le,re)}function yt(re,Le){var rt=this.__data__;return this.size+=this.has(re)?0:1,rt[re]=Be&&Le===void 0?r:Le,this}br.prototype.clear=Or,br.prototype.delete=Sn,br.prototype.get=ot,br.prototype.has=ct,br.prototype.set=yt;function Nt(re){var Le=-1,rt=re==null?0:re.length;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function Cn(){this.__data__=[],this.size=0}function On(re){var Le=this.__data__,rt=Yn(Le,re);if(rt<0)return!1;var qt=Le.length-1;return rt==qt?Le.pop():Vn.call(Le,rt,1),--this.size,!0}function _t(re){var Le=this.__data__,rt=Yn(Le,re);return rt<0?void 0:Le[rt][1]}function Fe(re){return Yn(this.__data__,re)>-1}function Qe(re,Le){var rt=this.__data__,qt=Yn(rt,re);return qt<0?(++this.size,rt.push([re,Le])):rt[qt][1]=Le,this}Nt.prototype.clear=Cn,Nt.prototype.delete=On,Nt.prototype.get=_t,Nt.prototype.has=Fe,Nt.prototype.set=Qe;function At(re){var Le=-1,rt=re==null?0:re.length;for(this.clear();++Le<rt;){var qt=re[Le];this.set(qt[0],qt[1])}}function zt(){this.size=0,this.__data__={hash:new br,map:new(Xt||Nt),string:new br}}function Rt(re){var Le=Ei(this,re).delete(re);return this.size-=Le?1:0,Le}function nn(re){return Ei(this,re).get(re)}function xn(re){return Ei(this,re).has(re)}function Ln(re,Le){var rt=Ei(this,re),qt=rt.size;return rt.set(re,Le),this.size+=rt.size==qt?0:1,this}At.prototype.clear=zt,At.prototype.delete=Rt,At.prototype.get=nn,At.prototype.has=xn,At.prototype.set=Ln;function Hn(re){var Le=-1,rt=re==null?0:re.length;for(this.__data__=new At;++Le<rt;)this.add(re[Le])}function at(re){return this.__data__.set(re,r),this}function ae(re){return this.__data__.has(re)}Hn.prototype.add=Hn.prototype.push=at,Hn.prototype.has=ae;function Me(re){var Le=this.__data__=new Nt(re);this.size=Le.size}function We(){this.__data__=new Nt,this.size=0}function ft(re){var Le=this.__data__,rt=Le.delete(re);return this.size=Le.size,rt}function Ct(re){return this.__data__.get(re)}function Gt(re){return this.__data__.has(re)}function Dn(re,Le){var rt=this.__data__;if(rt instanceof Nt){var qt=rt.__data__;if(!Xt||qt.length<n-1)return qt.push([re,Le]),this.size=++rt.size,this;rt=this.__data__=new At(qt)}return rt.set(re,Le),this.size=rt.size,this}Me.prototype.clear=We,Me.prototype.delete=ft,Me.prototype.get=Ct,Me.prototype.has=Gt,Me.prototype.set=Dn;function Pn(re,Le){var rt=Ke(re),qt=!rt&&An(re),Er=!rt&&!qt&&en(re),sr=!rt&&!qt&&!Er&&zs(re),Wr=rt||qt||Er||sr,Fr=Wr?me(re.length,String):[],Tr=Fr.length;for(var Qr in re)He.call(re,Qr)&&!(Wr&&(Qr=="length"||Er&&(Qr=="offset"||Qr=="parent")||sr&&(Qr=="buffer"||Qr=="byteLength"||Qr=="byteOffset")||Kt(Qr,Tr)))&&Fr.push(Qr);return Fr}function Yn(re,Le){for(var rt=re.length;rt--;)if(Os(re[rt][0],Le))return rt;return-1}function Lr(re,Le,rt){var qt=Le(re);return Ke(re)?qt:Ne(qt,rt(re))}function Xr(re){return re==null?re===void 0?O:S:xt&&xt in Object(re)?Yi(re):Wa(re)}function $n(re){return pa(re)&&Xr(re)==l}function Fn(re,Le,rt,qt,Er){return re===Le?!0:re==null||Le==null||!pa(re)&&!pa(Le)?re!==re&&Le!==Le:lr(re,Le,rt,qt,Fn,Er)}function lr(re,Le,rt,qt,Er,sr){var Wr=Ke(re),Fr=Ke(Le),Tr=Wr?c:$e(re),Qr=Fr?c:$e(Le);Tr=Tr==l?T:Tr,Qr=Qr==l?T:Qr;var Ii=Tr==T,Qa=Qr==T,Ki=Tr==Qr;if(Ki&&en(re)){if(!en(Le))return!1;Wr=!0,Ii=!1}if(Ki&&!Ii)return sr||(sr=new Me),Wr||zs(re)?fi(re,Le,rt,qt,Er,sr):Mi(re,Le,Tr,rt,qt,Er,sr);if(!(rt&i)){var vi=Ii&&He.call(re,"__wrapped__"),Ca=Qa&&He.call(Le,"__wrapped__");if(vi||Ca){var os=vi?re.value():re,xa=Ca?Le.value():Le;return sr||(sr=new Me),Er(os,xa,rt,qt,sr)}}return Ki?(sr||(sr=new Me),rr(re,Le,rt,qt,Er,sr)):!1}function Br(re){if(!ua(re)||zr(re))return!1;var Le=yr(re)?dt:Z;return Le.test(qr(re))}function mi(re){return pa(re)&&Mr(re.length)&&!!Y[Xr(re)]}function oi(re){if(!Pr(re))return st(re);var Le=[];for(var rt in Object(re))He.call(re,rt)&&rt!="constructor"&&Le.push(rt);return Le}function fi(re,Le,rt,qt,Er,sr){var Wr=rt&i,Fr=re.length,Tr=Le.length;if(Fr!=Tr&&!(Wr&&Tr>Fr))return!1;var Qr=sr.get(re);if(Qr&&sr.get(Le))return Qr==Le;var Ii=-1,Qa=!0,Ki=rt&a?new Hn:void 0;for(sr.set(re,Le),sr.set(Le,re);++Ii<Fr;){var vi=re[Ii],Ca=Le[Ii];if(qt)var os=Wr?qt(Ca,vi,Ii,Le,re,sr):qt(vi,Ca,Ii,re,Le,sr);if(os!==void 0){if(os)continue;Qa=!1;break}if(Ki){if(!_e(Le,function(xa,zi){if(!we(Ki,zi)&&(vi===xa||Er(vi,xa,rt,qt,sr)))return Ki.push(zi)})){Qa=!1;break}}else if(!(vi===Ca||Er(vi,Ca,rt,qt,sr))){Qa=!1;break}}return sr.delete(re),sr.delete(Le),Qa}function Mi(re,Le,rt,qt,Er,sr,Wr){switch(rt){case j:if(re.byteLength!=Le.byteLength||re.byteOffset!=Le.byteOffset)return!1;re=re.buffer,Le=Le.buffer;case M:return!(re.byteLength!=Le.byteLength||!sr(new Ft(re),new Ft(Le)));case d:case f:case A:return Os(+re,+Le);case h:return re.name==Le.name&&re.message==Le.message;case w:case _:return re==Le+"";case m:var Fr=R;case I:var Tr=qt&i;if(Fr||(Fr=Se),re.size!=Le.size&&!Tr)return!1;var Qr=Wr.get(re);if(Qr)return Qr==Le;qt|=a,Wr.set(re,Le);var Ii=fi(Fr(re),Fr(Le),qt,Er,sr,Wr);return Wr.delete(re),Ii;case N:if(Jn)return Jn.call(re)==Jn.call(Le)}return!1}function rr(re,Le,rt,qt,Er,sr){var Wr=rt&i,Fr=ji(re),Tr=Fr.length,Qr=ji(Le),Ii=Qr.length;if(Tr!=Ii&&!Wr)return!1;for(var Qa=Tr;Qa--;){var Ki=Fr[Qa];if(!(Wr?Ki in Le:He.call(Le,Ki)))return!1}var vi=sr.get(re);if(vi&&sr.get(Le))return vi==Le;var Ca=!0;sr.set(re,Le),sr.set(Le,re);for(var os=Wr;++Qa<Tr;){Ki=Fr[Qa];var xa=re[Ki],zi=Le[Ki];if(qt)var ka=Wr?qt(zi,xa,Ki,Le,re,sr):qt(xa,zi,Ki,re,Le,sr);if(!(ka===void 0?xa===zi||Er(xa,zi,rt,qt,sr):ka)){Ca=!1;break}os||(os=Ki=="constructor")}if(Ca&&!os){var Ha=re.constructor,bi=Le.constructor;Ha!=bi&&"constructor"in re&&"constructor"in Le&&!(typeof Ha=="function"&&Ha instanceof Ha&&typeof bi=="function"&&bi instanceof bi)&&(Ca=!1)}return sr.delete(re),sr.delete(Le),Ca}function ji(re){return Lr(re,wo,pn)}function Ei(re,Le){var rt=re.__data__;return zn(Le)?rt[typeof Le=="string"?"string":"hash"]:rt.map}function Ci(re,Le){var rt=ke(re,Le);return Br(rt)?rt:void 0}function Yi(re){var Le=He.call(re,xt),rt=re[xt];try{re[xt]=void 0;var qt=!0}catch{}var Er=ut.call(re);return qt&&(Le?re[xt]=rt:delete re[xt]),Er}var pn=je?function(re){return re==null?[]:(re=Object(re),ue(je(re),function(Le){return mn.call(re,Le)}))}:Gr,$e=Xr;(Jt&&$e(new Jt(new ArrayBuffer(1)))!=j||Xt&&$e(new Xt)!=m||Zt&&$e(Zt.resolve())!=C||yn&&$e(new yn)!=I||vt&&$e(new vt)!=k)&&($e=function(re){var Le=Xr(re),rt=Le==T?re.constructor:void 0,qt=rt?qr(rt):"";if(qt)switch(qt){case nt:return j;case Tt:return m;case Mt:return C;case Nn:return I;case kn:return k}return Le});function Kt(re,Le){return Le=Le??s,!!Le&&(typeof re=="number"||H.test(re))&&re>-1&&re%1==0&&re<Le}function zn(re){var Le=typeof re;return Le=="string"||Le=="number"||Le=="symbol"||Le=="boolean"?re!=="__proto__":re===null}function zr(re){return!!it&&it in re}function Pr(re){var Le=re&&re.constructor,rt=typeof Le=="function"&&Le.prototype||pe;return re===rt}function Wa(re){return ut.call(re)}function qr(re){if(re!=null){try{return De.call(re)}catch{}try{return re+""}catch{}}return""}function Os(re,Le){return re===Le||re!==re&&Le!==Le}var An=$n(function(){return arguments}())?$n:function(re){return pa(re)&&He.call(re,"callee")&&!mn.call(re,"callee")},Ke=Array.isArray;function It(re){return re!=null&&Mr(re.length)&&!yr(re)}var en=Ye||hi;function er(re,Le){return Fn(re,Le)}function yr(re){if(!ua(re))return!1;var Le=Xr(re);return Le==g||Le==v||Le==u||Le==x}function Mr(re){return typeof re=="number"&&re>-1&&re%1==0&&re<=s}function ua(re){var Le=typeof re;return re!=null&&(Le=="object"||Le=="function")}function pa(re){return re!=null&&typeof re=="object"}var zs=ie?se(ie):mi;function wo(re){return It(re)?Pn(re):oi(re)}function Gr(){return[]}function hi(){return!1}t.exports=er}(l9,l9.exports);var fz=l9.exports,ZS={};Object.defineProperty(ZS,"__esModule",{value:!0});const mEe=dz,vEe=fz;var eC;(function(t){function e(a={},s={},l=!1){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});let c=mEe(s);l||(c=Object.keys(c).reduce((u,d)=>(c[d]!=null&&(u[d]=c[d]),u),{}));for(const u in a)a[u]!==void 0&&s[u]===void 0&&(c[u]=a[u]);return Object.keys(c).length>0?c:void 0}t.compose=e;function n(a={},s={}){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});const l=Object.keys(a).concat(Object.keys(s)).reduce((c,u)=>(vEe(a[u],s[u])||(c[u]=s[u]===void 0?null:s[u]),c),{});return Object.keys(l).length>0?l:void 0}t.diff=n;function r(a={},s={}){a=a||{};const l=Object.keys(s).reduce((c,u)=>(s[u]!==a[u]&&a[u]!==void 0&&(c[u]=s[u]),c),{});return Object.keys(a).reduce((c,u)=>(a[u]!==s[u]&&s[u]===void 0&&(c[u]=null),c),l)}t.invert=r;function i(a,s,l=!1){if(typeof a!="object")return s;if(typeof s!="object")return;if(!l)return s;const c=Object.keys(s).reduce((u,d)=>(a[d]===void 0&&(u[d]=s[d]),u),{});return Object.keys(c).length>0?c:void 0}t.transform=i})(eC||(eC={})),ZS.default=eC;var c9={};Object.defineProperty(c9,"__esModule",{value:!0});var tC;(function(t){function e(n){return typeof n.delete=="number"?n.delete:typeof n.retain=="number"?n.retain:typeof n.retain=="object"&&n.retain!==null?1:typeof n.insert=="string"?n.insert.length:1}t.length=e})(tC||(tC={})),c9.default=tC;var nC={};Object.defineProperty(nC,"__esModule",{value:!0});const hz=c9;class bEe{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const n=this.ops[this.index];if(n){const r=this.offset,i=hz.default.length(n);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,typeof n.delete=="number")return{delete:e};{const a={};return n.attributes&&(a.attributes=n.attributes),typeof n.retain=="number"?a.retain=e:typeof n.retain=="object"&&n.retain!==null?a.retain=n.retain:typeof n.insert=="string"?a.insert=n.insert.substr(r,e):a.insert=n.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?hz.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?typeof e.delete=="number"?"delete":typeof e.retain=="number"||typeof e.retain=="object"&&e.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const e=this.offset,n=this.index,r=this.next(),i=this.ops.slice(this.index);return this.offset=e,this.index=n,[r].concat(i)}}else return[]}}nC.default=bEe,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=gEe,r=dz,i=fz,a=ZS;e.AttributeMap=a.default;const s=c9;e.Op=s.default;const l=nC;e.OpIterator=l.default;const c="\0",u=(f,h)=>{if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const g=Object.keys(f)[0];if(!g||g!==Object.keys(h)[0])throw new Error(`embed types not matched: ${g} != ${Object.keys(h)[0]}`);return[g,f[g],h[g]]};class d{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,g){this.handlers[h]=g}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const g=this.handlers[h];if(!g)throw new Error(`no handlers for embed type "${h}"`);return g}insert(h,g){const v={};return typeof h=="string"&&h.length===0?this:(v.insert=h,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(v.attributes=g),this.push(v))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,g){if(typeof h=="number"&&h<=0)return this;const v={retain:h};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(v.attributes=g),this.push(v)}push(h){let g=this.ops.length,v=this.ops[g-1];if(h=r(h),typeof v=="object"){if(typeof h.delete=="number"&&typeof v.delete=="number")return this.ops[g-1]={delete:v.delete+h.delete},this;if(typeof v.delete=="number"&&h.insert!=null&&(g-=1,v=this.ops[g-1],typeof v!="object"))return this.ops.unshift(h),this;if(i(h.attributes,v.attributes)){if(typeof h.insert=="string"&&typeof v.insert=="string")return this.ops[g-1]={insert:v.insert+h.insert},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof v.retain=="number")return this.ops[g-1]={retain:v.retain+h.retain},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this}}return g===this.ops.length?this.ops.push(h):this.ops.splice(g,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const g=[],v=[];return this.forEach(m=>{(h(m)?g:v).push(m)}),[g,v]}reduce(h,g){return this.ops.reduce(h,g)}changeLength(){return this.reduce((h,g)=>g.insert?h+s.default.length(g):g.delete?h-g.delete:h,0)}length(){return this.reduce((h,g)=>h+s.default.length(g),0)}slice(h=0,g=1/0){const v=[],m=new l.default(this.ops);let A=0;for(;A<g&&m.hasNext();){let S;A<h?S=m.next(h-A):(S=m.next(g-A),v.push(S)),A+=s.default.length(S)}return new d(v)}compose(h){const g=new l.default(this.ops),v=new l.default(h.ops),m=[],A=v.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){let T=A.retain;for(;g.peekType()==="insert"&&g.peekLength()<=T;)T-=g.peekLength(),m.push(g.next());A.retain-T>0&&v.next(A.retain-T)}const S=new d(m);for(;g.hasNext()||v.hasNext();)if(v.peekType()==="insert")S.push(v.next());else if(g.peekType()==="delete")S.push(g.next());else{const T=Math.min(g.peekLength(),v.peekLength()),C=g.next(T),x=v.next(T);if(x.retain){const w={};if(typeof C.retain=="number")w.retain=typeof x.retain=="number"?T:x.retain;else if(typeof x.retain=="number")C.retain==null?w.insert=C.insert:w.retain=C.retain;else{const _=C.retain==null?"insert":"retain",[N,O,k]=u(C[_],x.retain),M=d.getHandler(N);w[_]={[N]:M.compose(O,k,_==="retain")}}const I=a.default.compose(C.attributes,x.attributes,typeof C.retain=="number");if(I&&(w.attributes=I),S.push(w),!v.hasNext()&&i(S.ops[S.ops.length-1],w)){const _=new d(g.rest());return S.concat(_).chop()}}else typeof x.delete=="number"&&(typeof C.retain=="number"||typeof C.retain=="object"&&C.retain!==null)&&S.push(x)}return S.chop()}concat(h){const g=new d(this.ops.slice());return h.ops.length>0&&(g.push(h.ops[0]),g.ops=g.ops.concat(h.ops.slice(1))),g}diff(h,g){if(this.ops===h.ops)return new d;const v=[this,h].map(C=>C.map(x=>{if(x.insert!=null)return typeof x.insert=="string"?x.insert:c;const w=C===h?"on":"with";throw new Error("diff() called "+w+" non-document")}).join("")),m=new d,A=n(v[0],v[1],g,!0),S=new l.default(this.ops),T=new l.default(h.ops);return A.forEach(C=>{let x=C[1].length;for(;x>0;){let w=0;switch(C[0]){case n.INSERT:w=Math.min(T.peekLength(),x),m.push(T.next(w));break;case n.DELETE:w=Math.min(x,S.peekLength()),S.next(w),m.delete(w);break;case n.EQUAL:w=Math.min(S.peekLength(),T.peekLength(),x);const I=S.next(w),_=T.next(w);i(I.insert,_.insert)?m.retain(w,a.default.diff(I.attributes,_.attributes)):m.push(_).delete(w);break}x-=w}}),m.chop()}eachLine(h,g=`
4377
4377
  `){const v=new l.default(this.ops);let m=new d,A=0;for(;v.hasNext();){if(v.peekType()!=="insert")return;const S=v.peek(),T=s.default.length(S)-v.peekLength(),C=typeof S.insert=="string"?S.insert.indexOf(g,T)-T:-1;if(C<0)m.push(v.next());else if(C>0)m.push(v.next(C));else{if(h(m,v.next(1).attributes||{},A)===!1)return;A+=1,m=new d}}m.length()>0&&h(m,{},A)}invert(h){const g=new d;return this.reduce((v,m)=>{if(m.insert)g.delete(s.default.length(m));else{if(typeof m.retain=="number"&&m.attributes==null)return g.retain(m.retain),v+m.retain;if(m.delete||typeof m.retain=="number"){const A=m.delete||m.retain;return h.slice(v,v+A).forEach(T=>{m.delete?g.push(T):m.retain&&m.attributes&&g.retain(s.default.length(T),a.default.invert(m.attributes,T.attributes))}),v+A}else if(typeof m.retain=="object"&&m.retain!==null){const A=h.slice(v,v+1),S=new l.default(A.ops).next(),[T,C,x]=u(m.retain,S.insert),w=d.getHandler(T);return g.retain({[T]:w.invert(C,x)},a.default.invert(m.attributes,S.attributes)),v+1}}return v},0),g.chop()}transform(h,g=!1){if(g=!!g,typeof h=="number")return this.transformPosition(h,g);const v=h,m=new l.default(this.ops),A=new l.default(v.ops),S=new d;for(;m.hasNext()||A.hasNext();)if(m.peekType()==="insert"&&(g||A.peekType()!=="insert"))S.retain(s.default.length(m.next()));else if(A.peekType()==="insert")S.push(A.next());else{const T=Math.min(m.peekLength(),A.peekLength()),C=m.next(T),x=A.next(T);if(C.delete)continue;if(x.delete)S.push(x);else{const w=C.retain,I=x.retain;let _=typeof I=="object"&&I!==null?I:T;if(typeof w=="object"&&w!==null&&typeof I=="object"&&I!==null){const N=Object.keys(w)[0];if(N===Object.keys(I)[0]){const O=d.getHandler(N);O&&(_={[N]:O.transform(w[N],I[N],g)})}}S.retain(_,a.default.transform(C.attributes,x.attributes,g))}}return S.chop()}transformPosition(h,g=!1){g=!!g;const v=new l.default(this.ops);let m=0;for(;v.hasNext()&&m<=h;){const A=v.peekLength(),S=v.peekType();if(v.next(),S==="delete"){h-=Math.min(A,h-m);continue}else S==="insert"&&(m<h||!g)&&(h+=A);m+=A}return h}}d.Op=s.default,d.OpIterator=l.default,d.AttributeMap=a.default,d.handlers={},e.default=d,t.exports=d,t.exports.default=d}(GS,GS.exports);var oc=GS.exports;const cr=Ps(oc);class Xc extends Pl{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Xc.blotName="break",Xc.tagName="BR";let Gc=class extends i9{};function u9(t){return t.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}const $u=class $u extends YS{static compare(e,n){const r=$u.order.indexOf(e),i=$u.order.indexOf(n);return r>=0||i>=0?r-i:e===n?0:e<n?-1:1}formatAt(e,n,r,i){if($u.compare(this.statics.blotName,r)<0&&this.scroll.query(r,dr.BLOT)){const a=this.isolate(e,n);i&&a.wrap(r,i)}else super.formatAt(e,n,r,i)}optimize(e){if(super.optimize(e),this.parent instanceof $u&&$u.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};Gn($u,"allowedChildren",[$u,Xc,Pl,Gc]),Gn($u,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let qu=$u;const pz=1;class eo extends Hg{constructor(){super(...arguments);Gn(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=gz(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,i,a){r<=0||(this.scroll.query(i,dr.BLOCK)?n+r===this.length()&&this.format(i,a):super.formatAt(n,Math.min(r,this.length()-n-1),i,a),this.cache={})}insertAt(n,r,i){if(i!=null){super.insertAt(n,r,i),this.cache={};return}if(r.length===0)return;const a=r.split(`
4378
4378
  `),s=a.shift();s.length>0&&(n<this.length()-1||this.children.tail==null?super.insertAt(Math.min(n,this.length()-1),s):this.children.tail.insertAt(this.children.tail.length(),s),this.cache={});let l=this;a.reduce((c,u)=>(l=l.split(c,!0),l.insertAt(0,u),u.length),n+s.length)}insertBefore(n,r){const{head:i}=this.children;super.insertBefore(n,r),i instanceof Xc&&i.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+pz),this.cache.length}moveChildren(n,r){super.moveChildren(n,r),this.cache={}}optimize(n){super.optimize(n),this.cache={}}path(n){return super.path(n,!0)}removeChild(n){super.removeChild(n),this.cache={}}split(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(r&&(n===0||n>=this.length()-pz)){const a=this.clone();return n===0?(this.parent.insertBefore(a,this),this):(this.parent.insertBefore(a,this.next),a)}const i=super.split(n,r);return this.cache={},i}}eo.blotName="block",eo.tagName="P",eo.defaultChild=Xc,eo.allowedChildren=[Xc,qu,Pl,Gc];class lc extends Pl{attach(){super.attach(),this.attributes=new n9(this.domNode)}delta(){return new cr().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,n){const r=this.scroll.query(e,dr.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,n)}formatAt(e,n,r,i){this.format(r,i)}insertAt(e,n,r){if(r!=null){super.insertAt(e,n,r);return}const i=n.split(`
4379
4379
  `),a=i.pop(),s=i.map(c=>{const u=this.scroll.create(eo.blotName);return u.insertAt(0,c),u}),l=this.split(e);s.forEach(c=>{this.parent.insertBefore(c,l)}),a&&this.parent.insertBefore(this.scroll.create("text",a),l)}}lc.scope=dr.BLOCK_BLOT;function gz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(yo).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),cc(r,{},e)),new cr).insert(`
@@ -55222,7 +55222,7 @@ const Hi = (t) => {
55222
55222
  return /* @__PURE__ */ c(Te, { children: /* @__PURE__ */ E(
55223
55223
  "div",
55224
55224
  {
55225
- 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`,
55225
+ 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-2 justify-content-center"} flex quick-setting`,
55226
55226
  children: [
55227
55227
  /* @__PURE__ */ c(Te, { 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 && /* @__PURE__ */ E("div", { className: " ", children: [
55228
55228
  /* @__PURE__ */ c(
@@ -58641,7 +58641,7 @@ var bde = function() {
58641
58641
  theme: i.theme,
58642
58642
  formats: i.formats
58643
58643
  };
58644
- bde ? A(new Quill(d.current, M)) : import("./quill-OMa0HMRU.js").then(function(q) {
58644
+ bde ? A(new Quill(d.current, M)) : import("./quill-BHBoGF6p.js").then(function(q) {
58645
58645
  if (q && Ee.isExist(d.current)) {
58646
58646
  var k;
58647
58647
  q.default ? k = new q.default(d.current, M) : k = new q(d.current, M), A(k);
@@ -131287,7 +131287,7 @@ const DIe = () => {
131287
131287
  header: H == null ? void 0 : H.label,
131288
131288
  toggleable: !0,
131289
131289
  style: { marginBottom: 10 },
131290
- children: /* @__PURE__ */ c("div", { className: "grid", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c(
131290
+ children: /* @__PURE__ */ c("div", { className: "grid scroll-height-300", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c(
131291
131291
  "div",
131292
131292
  {
131293
131293
  className: "xl:col-6 lg:col-12 md:col-12 sm:col-12",
@@ -131304,7 +131304,7 @@ const DIe = () => {
131304
131304
  },
131305
131305
  `pannel-tab-${le}`
131306
131306
  )) }),
131307
- (t === E1 || t === ip) && /* @__PURE__ */ c(mr, { header: "Form", children: vZ.map((H, le) => (
131307
+ (t === E1 || t === ip) && /* @__PURE__ */ c(mr, { header: "Form", children: /* @__PURE__ */ c("div", { className: "scroll-height-300", children: vZ.map((H, le) => (
131308
131308
  // Temporary solution to fix linters. Need to ask meer
131309
131309
  /* @__PURE__ */ c(
131310
131310
  Jr,
@@ -131312,7 +131312,7 @@ const DIe = () => {
131312
131312
  header: H == null ? void 0 : H.label,
131313
131313
  toggleable: !0,
131314
131314
  style: { marginBottom: 10 },
131315
- children: /* @__PURE__ */ c("div", { className: "grid scroll-height-300", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c(
131315
+ children: /* @__PURE__ */ c("div", { className: "grid", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c(
131316
131316
  "div",
131317
131317
  {
131318
131318
  className: "xl:col-6 lg:col-12 md:col-12 sm:col-12",
@@ -131329,14 +131329,14 @@ const DIe = () => {
131329
131329
  },
131330
131330
  `pannel-tab-${le}`
131331
131331
  )
131332
- )) }),
131333
- (t === O3 || t === t7 || t === yf) && /* @__PURE__ */ c(mr, { header: "Layout", children: mX.map((H, le) => /* @__PURE__ */ c(
131332
+ )) }) }),
131333
+ (t === O3 || t === t7 || t === yf) && /* @__PURE__ */ c(mr, { header: "Layout", children: /* @__PURE__ */ c("div", { className: "scroll-height-300", children: mX.map((H, le) => /* @__PURE__ */ c(
131334
131334
  Jr,
131335
131335
  {
131336
131336
  header: H == null ? void 0 : H.label,
131337
131337
  toggleable: !0,
131338
131338
  style: { marginBottom: 10 },
131339
- children: /* @__PURE__ */ c("div", { className: "grid scroll-height-300", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c("div", { className: "col-6", children: /* @__PURE__ */ c(
131339
+ children: /* @__PURE__ */ c("div", { className: "grid", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c("div", { className: "col-6", children: /* @__PURE__ */ c(
131340
131340
  $u,
131341
131341
  {
131342
131342
  data: K
@@ -131345,14 +131345,14 @@ const DIe = () => {
131345
131345
  ) }, "form_elements_" + ee)) })
131346
131346
  },
131347
131347
  `pannel-tab-${le}`
131348
- )) }),
131349
- (t === I1 || t === E1 || t === ip) && /* @__PURE__ */ c(mr, { header: "Layout", children: bZ.map((H, le) => /* @__PURE__ */ c(
131348
+ )) }) }),
131349
+ (t === I1 || t === E1 || t === ip) && /* @__PURE__ */ c(mr, { header: "Layout", children: /* @__PURE__ */ c("div", { className: "scroll-height-300", children: bZ.map((H, le) => /* @__PURE__ */ c(
131350
131350
  Jr,
131351
131351
  {
131352
131352
  header: H == null ? void 0 : H.label,
131353
131353
  toggleable: !0,
131354
131354
  style: { marginBottom: 10 },
131355
- children: /* @__PURE__ */ c("div", { className: "grid scroll-height-300", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c("div", { className: "col-6", children: /* @__PURE__ */ c(
131355
+ children: /* @__PURE__ */ c("div", { className: "grid", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c("div", { className: "col-6", children: /* @__PURE__ */ c(
131356
131356
  $u,
131357
131357
  {
131358
131358
  data: K
@@ -131361,12 +131361,12 @@ const DIe = () => {
131361
131361
  ) }, "form_elements_" + ee)) })
131362
131362
  },
131363
131363
  `pannel-tab-${le}`
131364
- )) }),
131365
- t === Rd && /* @__PURE__ */ c(mr, { header: "Question bank", children: /* @__PURE__ */ E("div", { className: "grid", children: [
131364
+ )) }) }),
131365
+ t === Rd && /* @__PURE__ */ c(mr, { header: "Question bank", children: /* @__PURE__ */ E("div", { className: "grid scroll-height-300", children: [
131366
131366
  /* @__PURE__ */ c("div", { className: "col-12", children: pX.map((H, le) => /* @__PURE__ */ c(
131367
131367
  "div",
131368
131368
  {
131369
- className: "grid scroll-height-300",
131369
+ className: "grid",
131370
131370
  children: H == null ? void 0 : H.items.map((K, ee) => {
131371
131371
  const fe = St.cloneDeep(K);
131372
131372
  return /* @__PURE__ */ c(
@@ -131451,13 +131451,13 @@ const DIe = () => {
131451
131451
  ) }),
131452
131452
  /* @__PURE__ */ c(S, {})
131453
131453
  ] }) }),
131454
- t === F3 && /* @__PURE__ */ c(mr, { header: "Training", children: AZ.map((H, le) => /* @__PURE__ */ c(
131454
+ t === F3 && /* @__PURE__ */ c(mr, { header: "Training", children: /* @__PURE__ */ c("div", { className: "scroll-height-300", children: AZ.map((H, le) => /* @__PURE__ */ c(
131455
131455
  Jr,
131456
131456
  {
131457
131457
  header: H == null ? void 0 : H.label,
131458
131458
  toggleable: !0,
131459
131459
  style: { marginBottom: 10 },
131460
- children: /* @__PURE__ */ c("div", { className: "grid scroll-height-300", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c("div", { className: "col-6", children: /* @__PURE__ */ c(
131460
+ children: /* @__PURE__ */ c("div", { className: "grid", children: H == null ? void 0 : H.items.map((K, ee) => /* @__PURE__ */ c("div", { className: "col-6", children: /* @__PURE__ */ c(
131461
131461
  $u,
131462
131462
  {
131463
131463
  data: K
@@ -131466,7 +131466,7 @@ const DIe = () => {
131466
131466
  ) }, "form_elements_" + ee)) })
131467
131467
  },
131468
131468
  `pannel-tab-${le}`
131469
- )) }),
131469
+ )) }) }),
131470
131470
  (t === I1 || t === E1 || t === ip) && /* @__PURE__ */ E(mr, { header: "Custom", children: [
131471
131471
  /* @__PURE__ */ c("h6", { children: "Custom Sections" }),
131472
131472
  /* @__PURE__ */ c("div", { className: "grid", children: (n == null ? void 0 : n.length) > 0 && n.map(
@@ -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-DIbjtdit.js";
4
+ import { d as ti, i as Rr, a as Hi, b as Dl, e as Br, M as Ul, S as ei, U as si, g as ni, c as ri, f as fr, h as zs, j as $i, k as Vs, l as dr, m as Pl, n as jl, o as Fi, p as Hl, q as $l, r as Fl, s as zl, t as ii, u as Kl, v as Gl, w as Ft, x as zi, y as xe } from "./main-Bmz4AfP2.js";
5
5
  function Ki(n) {
6
6
  return n;
7
7
  }
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cft-builder",
3
- "version": "0.2.139",
3
+ "version": "0.2.141",
4
4
  "type": "module",
5
5
  "types": "dist/types/index",
6
6
  "files": [