cft-builder 0.2.266 → 0.2.267

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 { E as s, D as o, F as a, G as d, R as i, T as u, C as m, A as B, z as k, B as l } from "./main-d5BqYW7u.js";
1
+ import { E as s, D as o, F as a, G as d, R as i, T as u, C as m, A as B, z as k, B as l } from "./main-FC4vIcii.js";
2
2
  export {
3
3
  s as BuilderItems,
4
4
  o as BuilderItemsRender,
@@ -1591,7 +1591,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1591
1591
  }
1592
1592
  }
1593
1593
  `}}),r8=b.forwardRef(function(t,e){var n=Hn(),r=b.useContext(ar),i=zm.getProps(t,r),a=b.useState(i.id),s=CI(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=CI(u,2),f=d[0],h=d[1],g=i.toggleable?i.onToggle?i.collapsed:f:!1,v=b.useRef(null),m=b.useRef(null),w=l+"_header",A=l+"_content",x=zm.setMetaData({props:i,state:{id:l,collapsed:g}}),S=x.ptm,T=x.cx,C=x.isUnstyled;li(zm.css.styles,C,{name:"fieldset"});var E=function(R){i.toggleable&&(g?_(R):M(R),i.onToggle&&i.onToggle({originalEvent:R,value:!g})),R.preventDefault()},_=function(R){i.onToggle||h(!1),i.onExpand&&i.onExpand(R)},M=function(R){i.onToggle||h(!0),i.onCollapse&&i.onCollapse(R)};Li(function(){i.id||c(So())});var O=function(R){(R.code==="Enter"||R.code==="NumpadEnter"||R.code==="Space")&&(E(R),R.preventDefault())},F=function(){var R=n({className:T("content")},S("content")),le=n({ref:m,id:A,role:"region","aria-labelledby":w,className:T("toggleableContent")},S("toggleableContent")),Y=n({classNames:T("transition"),timeout:{enter:1e3,exit:450},in:!g,unmountOnExit:!0,options:i.transitionOptions},S("transition"));return b.createElement(Ro,jm({nodeRef:m},Y),b.createElement("div",le,b.createElement("div",R,i.children)))},P=function(){if(i.toggleable){var R=n({className:T("togglericon")},S("togglericon")),le=g?i.expandIcon||b.createElement(Lm,R):i.collapseIcon||b.createElement(n8,R),Y=nr.getJSXIcon(le,R,{props:i});return Y}return null},H=function(){var R=n({className:T("legendTitle")},S("legendTitle")),le=n({id:w,role:"button","aria-expanded":!g,"aria-controls":A,onKeyDown:O,onClick:E,"aria-label":i.legend,tabIndex:0},S("toggler"));if(i.toggleable){var Y=P();return b.createElement("a",le,Y,b.createElement("span",R,i.legend),b.createElement(Qt,null))}return b.createElement("span",jm({},R,{id:w}),i.legend)},N=function(){var R=n({className:T("legend")},S("legend"));if(i.legend!=null||i.toggleable){var le=H();return b.createElement("legend",R,le)}};b.useImperativeHandle(e,function(){return{props:i,getElement:function(){return v.current},getContent:function(){return m.current}}});var z=n({id:l,ref:v,style:i.style,className:ft(i.className,T("root")),onClick:i.onClick},zm.getOtherProps(i),S("root")),$=N(),oe=F();return b.createElement("fieldset",z,$,oe)});r8.displayName="Fieldset";const CG=t=>o.jsx(cn,{target:`.${t==null?void 0:t.element}`,position:"right",children:o.jsxs("div",{style:{width:400},className:"m-3",children:[o.jsx("div",{className:"text-900 font-medium text-2xl mb-2",children:t==null?void 0:t.label}),o.jsx("div",{children:"Dynamic listing component"}),o.jsx(ga,{}),o.jsxs("div",{className:"p-fluid",children:[o.jsx("div",{className:"mb-2",children:t==null?void 0:t.label}),o.jsxs("div",{children:[o.jsxs(r8,{children:[o.jsx("div",{className:"pi pi-circle",children:" Option 1"}),o.jsx("br",{})]}),o.jsx("br",{}),o.jsx(r8,{children:o.jsx("div",{className:"pi pi-circle",children:" Option 2"})})]})]})]})}),xG=t=>o.jsx(cn,{target:`.${t==null?void 0:t.element}`,position:"right",children:o.jsxs("div",{style:{width:400},className:"m-3",children:[o.jsx("div",{className:"text-900 font-medium text-2xl mb-2",children:t==null?void 0:t.label}),o.jsx("div",{children:"Documents"}),o.jsx(ga,{}),o.jsxs("div",{className:"p-fluid",children:[o.jsx("div",{className:"mb-2",children:t==null?void 0:t.label}),o.jsxs("div",{children:["1.Hr Cv.docx",o.jsx("br",{}),"2.Readme.txt",o.jsx("br",{}),"3.Cover.jpg"]})]})]})}),TG=[{label:"Free form inputs",icon:"pi pi-fw pi-file",expanded:!0,items:[{label:"Text",icon:"pi pi-fw pi-plus",element:"input",schema:hH,uuid:tt(),type:tr,toolTip:t=>zY(t)},{label:"Number",icon:"pi pi-fw pi-trash",element:"number",schema:fH,uuid:tt(),type:tr,toolTip:t=>HY(t)},{label:"Email",icon:"pi pi-fw pi-external-link",element:"email",schema:dH,uuid:tt(),type:tr,toolTip:t=>YY(t)},{label:"Text area",icon:"pi pi-fw pi-external-link",element:"textArea",schema:yH,uuid:tt(),type:tr,toolTip:t=>KY(t)},{label:"Text editor",icon:"pi pi-fw pi-external-link",element:"textHtmlEditor",schema:uH,uuid:tt(),type:tr,toolTip:t=>XY(t)},{label:"Date picker",icon:"pi pi-fw pi-user-plus",element:"date-picker",schema:iH,uuid:tt(),type:tr,toolTip:t=>YK(t)},{label:"Draw signature",icon:"pi pi-fw pi-trash",element:"signature",schema:Ax,uuid:tt(),type:tr,toolTip:t=>WK(t)},{label:"Type signature",icon:"pi pi-fw pi-trash",element:"type-signature",schema:AH,uuid:tt(),type:tr,toolTip:t=>QK(t)},{label:"File upload",icon:"pi pi-fw pi-trash",element:"file-upload",schema:oH,uuid:tt(),type:tr,toolTip:t=>JK(t)},{label:"Phone number",icon:"pi pi-fw pi-trash",element:"phone",schema:gH,uuid:tt(),type:tr,PhoneNumberToolTip:TT,toolTip:t=>TT(t)},{label:"Website url",icon:"pi pi-fw pi-trash",element:"web-url",schema:SH,uuid:tt(),type:tr,toolTip:t=>eX(t)},{label:"Hidden field",icon:"pi pi-fw pi-trash",element:"hidden-field",schema:cH,uuid:tt(),type:tr,toolTip:t=>FX(t)},{label:"Address",icon:"pi pi-fw pi-trash",element:"address",schema:nH,uuid:tt(),type:tr,toolTip:t=>kX(t)},{label:"Grid component",icon:"pi pi-fw pi-trash",element:"grid-component",schema:lH,uuid:tt(),type:tr,toolTip:t=>vG(t)},{label:"Matrix dropdown",icon:"pi pi-fw pi-trash",element:"matrix-dropdown",schema:pH,uuid:tt(),type:tr,toolTip:t=>bG(t)}]},{label:"Controlled inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Countries",icon:"pi pi-fw pi-align-left",element:"country",schema:ox,uuid:tt(),type:tr,toolTip:t=>bI(t)},{label:"Dropdown",icon:"pi pi-fw pi-align-left",element:"select",schema:yx,uuid:tt(),type:tr,toolTip:t=>yI(t)},{label:"Multi select",icon:"pi pi-fw pi-align-right",element:"multi-select",schema:gx,uuid:tt(),type:tr,toolTip:t=>AI(t)},{label:"Checkbox",icon:"pi pi-fw pi-align-left",element:"checkbox",schema:sx,uuid:tt(),type:tr,toolTip:t=>wI(t)},{label:"Radio button",icon:"pi pi-fw pi-align-left",element:"radio",schema:vx,uuid:tt(),type:tr,toolTip:t=>e8(t)},{label:"Hierarchal radio",icon:"pi pi-fw pi-align-left",element:"radio-hierarchal",schema:vH,uuid:tt(),type:tr,toolTip:t=>e8(t)},{label:"Dynamic radio",icon:"pi pi-fw pi-align-left",element:"dynamic-listing",schema:aH,uuid:tt(),type:tr,toolTip:t=>CG(t)}]},{label:"Rating inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Likert scale",icon:"pi pi-fw pi-trash",element:"likert-scale",schema:px,uuid:tt(),type:tr,toolTip:t=>YT(t)},{label:"Slider",icon:"pi pi-fw pi-trash",element:"slider",schema:wx,uuid:tt(),type:tr,toolTip:t=>MT(t)},{label:"Rating",icon:"pi pi-fw pi-trash",element:"rating",schema:bx,uuid:tt(),type:tr,toolTip:t=>FT(t)},{label:"Thumbs up and down",icon:"pi pi-fw pi-align-left",element:"thumbs",schema:Sx,uuid:tt(),type:tr,toolTip:t=>NX(t)},{label:"Likert emoji scale",icon:"pi pi-fw pi-align-left",element:"likert-emoji-scale",schema:hx,uuid:tt(),type:tr,toolTip:t=>OX(t)}]},{label:"Media",icon:"pi pi-fw pi-user",items:[{label:"Document",icon:"pi pi-fw pi-trash",element:"document",schema:lx,uuid:tt(),type:tr,toolTip:t=>xG(t)}]}],EG=[{label:"HTML",icon:"pi pi-fw pi-file",expanded:!0,items:[{label:"<a>",icon:"pi pi-fw pi-plus",element:"a",schema:dx,uuid:tt(),type:tr},{label:"<p>",icon:"pi pi-fw pi-trash",element:"paragraph",schema:mx,uuid:tt(),type:tr},{label:"<heading>",icon:"pi pi-fw pi-external-link",element:"h",schema:cx,uuid:tt(),type:tr},{label:"<li>",icon:"pi pi-fw pi-external-link",element:"list",schema:wH,uuid:tt(),type:tr},{label:"Divider",icon:"pi pi-fw pi-external-link",element:"hr",schema:ux,uuid:tt(),type:tr},{label:"Image",icon:"pi pi-fw pi-user-plus",element:"image",schema:x9,uuid:tt(),type:tr},{label:"Image gallery",icon:"pi pi-fw pi-user-plus",element:"image-gallery",schema:fx,uuid:tt(),type:tr},{label:"Video",icon:"pi pi-fw pi-user-minus",element:"video",schema:T9,uuid:tt(),type:tr}]}],IG=[{label:"Controlled inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Countries",icon:"pi pi-fw pi-align-left",element:"country",schema:ox,uuid:tt(),type:tr,toolTip:t=>bI(t)},{label:"Dropdown",icon:"pi pi-fw pi-align-left",element:"select",schema:yx,uuid:tt(),type:tr,toolTip:t=>yI(t)},{label:"Multi select",icon:"pi pi-fw pi-align-right",element:"multi-select",schema:gx,uuid:tt(),type:tr,toolTip:t=>AI(t)},{label:"Checkbox",icon:"pi pi-fw pi-align-left",element:"checkbox",schema:sx,uuid:tt(),type:tr,toolTip:t=>wI(t)},{label:"Radio button",icon:"pi pi-fw pi-align-left",element:"radio",schema:vx,uuid:tt(),type:tr,toolTip:t=>e8(t)}]},{label:"Rating inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Likert scale",icon:"pi pi-fw pi-trash",element:"likert-scale",schema:px,uuid:tt(),type:tr,toolTip:t=>YT(t)},{label:"Slider",icon:"pi pi-fw pi-trash",element:"slider",schema:wx,uuid:tt(),type:tr,toolTip:t=>MT(t)},{label:"Rating",icon:"pi pi-fw pi-trash",element:"rating",schema:bx,uuid:tt(),type:tr,toolTip:t=>FT(t)},{label:"Thumbs up and down",icon:"pi pi-fw pi-align-left",element:"thumbs",schema:Sx,uuid:tt(),type:tr},{label:"Likert emoji scale",icon:"pi pi-fw pi-align-left",element:"likert-emoji-scale",schema:hx,uuid:tt(),type:tr}]}],_G=[{label:"Media",icon:"pi pi-fw pi-user",items:[{label:"Image",icon:"pi pi-fw pi-user-plus",element:"image",schema:x9,uuid:tt(),type:tr},{label:"Video",icon:"pi pi-fw pi-user-minus",element:"video",schema:T9,uuid:tt(),type:tr},{label:"Quiz",icon:"pi pi-fw pi-trash",element:"quiz",schema:mH,uuid:tt(),type:tr},{label:"Document",icon:"pi pi-fw pi-trash",element:"document",schema:lx,uuid:tt(),type:tr}]}],DG=[{label:"Left",icon:"pi pi-align-left",value:"left"},{label:"Right",icon:"pi pi-align-right",value:"right"}],NG=[{key:1,language:"English",type:"english"},{key:2,language:"Urdu",type:"urdu"},{key:3,language:"Hindi",type:"hindi"},{key:4,language:"Arabic",type:"arabic"},{key:5,language:"French",type:"french"},{key:6,language:"Italian",type:"italian"},{key:7,language:"Spanish",type:"spanish"}],OG=[{name:"Bad Script",font:"bad-script"},{name:"Bilbo Swash Caps",font:"bilbo-swash-caps"},{name:"caveat",font:"caveat"},{name:"Covered By Your Grace",font:"covered-by-your-grace"},{name:"Dancing Script",font:"dancing-script"},{name:"Gochi Hand",font:"gochi-hand"},{name:"Great Vibes",font:"great-vibes"},{name:"Handlee",font:"handlee"},{name:"Just Another Hand",font:"just-another-hand"},{name:"Kalam",font:"kalam"},{name:"La Belle Aurore",font:"la-belle-aurore"},{name:"Marck Script",font:"marck-script"},{name:"Nothing You Could Do",font:"nothing-you-could-do"},{name:"Qwigley",font:"qwigley"},{name:"Sacramento",font:"sacramento"},{name:"Shadows Into Light",font:"shadows-into-light"},{name:"Stalemate",font:"stalemate"},{name:"Yellowtail",font:"yellowtail"}],Hm={type:tx,isCoverPage:!1,margin:{left:0,right:0,top:0,bottom:0},isVisible:!0,isHidden:!1,isValid:!1,displayRules:[],title:{english:"Page 1"}},lf={type:na,showSectionHeader:!1,isVisible:!0,isHidden:!1,isValid:!1,showSectionTitle:!1,showSectionSubTitle:!1,heading:{english:"Section header"},subHeadingText:{english:""},isCollapsed:!1},eu={type:Ao,isHidden:!1,isValid:!1,isRequired:!1,isCollapsed:!1,showRowTitle:!0,showRowSubTitle:!0,heading:{english:""},subHeadingText:{english:""},rowIsRepeatable:!1,repeatableFields:[],repeatableFieldsData:[],isMinimumEntries:!1,minimumEntries:5,addToListButtonLabel:{english:"Save"},reviewerChecklist:[]},wc={type:As,isCollapsed:!1},FG=t=>{let e=t;e={...e,uuid:tt()};const n=e.children.map(r=>({...r,uuid:tt(),children:r.children.map(i=>({...i,uuid:tt(),children:i.children.map(a=>{var s;return{...a,uuid:tt(),...((s=a==null?void 0:a.children)==null?void 0:s.length)>0?{children:a.children.map(l=>{var c;return{...l,uuid:tt(),...((c=l.options)==null?void 0:c.length)>0?{options:l.options.map(u=>({...u,uuid:tt()}))}:{}}})}:{}}})}))}));return e={...e,children:n},e};function kG(t){return e=>{const n={...Hm,uuid:tt(),title:{english:`Page ${t+1}`},children:[{...lf,uuid:tt(),children:[{...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[]}]}]}]};e({type:FC,payLoad:n})}}function PG(t){return e=>{const n=[];for(const[,i]of t.entries())for(const[,a]of i.children.entries())for(const[,s]of a.children.entries())for(const[,l]of s.children.entries())for(const[,c]of l.children.entries())s!=null&&s.rowIsRepeatable||n.push(c);e({type:QC,payLoad:{tableFields:n}})}}function MG(t,e){return(n,r)=>{const i=t;let a=It.cloneDeep(i);const{layout:s}=r;a={...a,title:{english:`Page ${(s==null?void 0:s.length)+1}`}},a=FG(a),n({type:LC,payLoad:{page:a,pageIndex:e}})}}function LG(t,e){return n=>{n({type:WC,payLoad:{pageIndex:t,page:e}})}}function BG(t){return e=>{e({type:TC,payLoad:{pageIndex:t}})}}const xI=t=>{let e=t;e={...e,uuid:tt()};const n=e.children.map(r=>({...r,uuid:tt(),children:r.children.map(i=>{var a;return{...i,uuid:tt(),...((a=i==null?void 0:i.children)==null?void 0:a.length)>0?{children:i.children.map(s=>{var l;return{...s,uuid:tt(),...((l=s.options)==null?void 0:l.length)>0?{options:s.options.map(c=>({...c,uuid:tt()}))}:{}}})}:{}}})}));return e={...e,children:n},e};function VG(t,e){return n=>{n({type:EC,payLoad:{pageIndex:t,sectionIndex:e}})}}function qG(t){return e=>{const n={...lf,uuid:tt(),children:[{...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[]}]}]};e({type:kC,payLoad:{pageIndex:t,section:n}})}}function UG(t,e,n){return r=>{const i={type:OC,payLoad:{pageIndex:t,sectionIndex:e,section:It.cloneDeep(n)}};r(i)}}function $G(t,e,n){return r=>{const i=t;let a=It.cloneDeep(i);a=xI(a),r({type:BC,payLoad:{section:a,pageIndex:e,sectionIndex:n}})}}function jG(t,e){return n=>{const r=t;let i=It.cloneDeep(r);i=xI(i),n({type:VC,payLoad:{section:i,pageIndex:e}})}}const zG=t=>{let e=t;e={...e,uuid:tt()};const n=e.children.map(r=>{var i;return{...r,uuid:tt(),...((i=r==null?void 0:r.children)==null?void 0:i.length)>0?{children:r.children.map(a=>{var s;return{...a,uuid:tt(),...((s=a.options)==null?void 0:s.length)>0?{options:a.options.map(l=>({...l,uuid:tt()}))}:{}}})}:{}}});return e={...e,children:n},e};function HG(t,e,n,r){return i=>{const a=t;let s=It.cloneDeep(a);s=zG(s),i({type:qC,payLoad:{row:s,pageIndex:e,sectionIndex:n,rowIndex:r}})}}function YG(t,e,n,r){return i=>{i({type:w9,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function KG(t,e,n){return r=>{r({type:IC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n}})}}function XG(t,e){return n=>{const r={...eu,uuid:tt(),isCollapsed:!1,children:[{...wc,uuid:tt(),children:[]}]};n({type:PC,payLoad:{pageIndex:t,sectionIndex:e,row:r}})}}function RG(t,e,n,r){return i=>{i({type:zC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,fieldItem:r}})}}const GG=t=>{var r;let e=t;e={...e,uuid:tt()};const n=((r=e==null?void 0:e.children)==null?void 0:r.length)>0?e.children.map((i,a)=>{var s;return{...i,uuid:tt(),...((s=i.options)==null?void 0:s.length)>0?{options:i.options.map((l,c)=>({...l,uuid:tt()}))}:{}}}):[];return e={...e,children:n},e};function WG(t,e,n){return r=>{const i={...wc,uuid:tt(),children:[]};r({type:MC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,column:i}})}}function QG(t,e,n,r,i){return a=>{const s=t;let l=It.cloneDeep(s);l=GG(l),a({type:UC,payLoad:{column:l,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i}})}}function JG(t,e,n,r){return i=>{i({type:_C,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r}})}}function TI(t,e,n,r){return i=>{i({type:w9,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function ZG(t,e,n,r,i){return(a,s)=>{var g,v,m,w;const{layout:l,tableFields:c}=s;let u=(g=l[t])==null?void 0:g.children[e].children[n];const d=(w=(m=(v=l[t])==null?void 0:v.children[e])==null?void 0:m.children[n])==null?void 0:w.children[r].children[i];if((u==null?void 0:u.rowIsRepeatable)===!0){const A=[...u.repeatableFields],x=It.findIndex(A,function(S){return S.uuid===(d==null?void 0:d.uuid)});A.splice(x,1),u={...u,repeatableFields:A},a(TI(t,e,n,u))}const f=It.findIndex(c,function(A){return A.uuid===(d==null?void 0:d.uuid)});c.splice(f,1),a({type:DC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i}})}}function eW(t,e,n,r,i,a){return(s,l)=>{var g,v,m,w;const{layout:c,tableFields:u}=l;let d=(g=c[t])==null?void 0:g.children[e].children[n];if((d==null?void 0:d.rowIsRepeatable)===!0){const A=(w=(m=(v=c[t])==null?void 0:v.children[e])==null?void 0:m.children[n])==null?void 0:w.children[r].children[i],x=[...d.repeatableFields],S=It.findIndex(x,function(T){return T.uuid===(A==null?void 0:A.uuid)});S===-1?x.splice(i,0,a):x[S]=a,x[S]=a,d={...d,repeatableFields:x},s(TI(t,e,n,d))}const f={type:NC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}},h=u.findIndex(A=>A.uuid===a.uuid);h>=0&&(u[h]=a),s(f)}}function tW(t,e,n,r,i,a){return s=>{var d;const l=t;let c=It.cloneDeep(l);if(c={...c,uuid:tt()},c!=null&&c.options&&((d=c==null?void 0:c.options)==null?void 0:d.length)>0){const f=c==null?void 0:c.options.map(h=>({...h,uuid:tt()}));c={...c,options:f}}s({type:$C,payLoad:{field:c,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i,fieldIndex:a}})}}function nW(t,e,n,r,i,a,s,l){return c=>{c({type:HC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,field:l}})}}function rW(t,e,n,r,i,a,s,l){return c=>{c({type:YC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridColumnIndex:s,gridRowIndex:a,field:l}})}}function iW(t,e,n,r,i,a,s,l,c){return u=>{u({type:RC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l,field:c}})}}function aW(t,e,n,r,i,a,s,l){return c=>{c({type:GC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l}})}}function sW(t,e,n,r,i,a,s,l,c){return u=>{u({type:KC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l,field:c}})}}function oW(t,e,n,r,i,a,s,l){return c=>{c({type:XC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l}})}}function lW(t){return e=>{e({type:j1,payLoad:{formSchema:t}})}}function cW(t){return e=>{e({type:j1,payLoad:{layout:t}})}}function uW(t){return(e,n)=>{const{languages:r}=n,i={type:j1,payLoad:{languages:[...r,t]}};e(i)}}function dW(t){return(e,n)=>{const{languages:r}=n,i=It.findIndex(r,l=>l.key===t.key),a=[...r];a.splice(i,1),e({type:j1,payLoad:{languages:a}})}}function fW(t){return e=>{const n={type:j1,payLoad:{userSelectedLanguage:t.value}};e(n)}}function hW(t){return e=>{e({type:em,payLoad:{formType:t}})}}function pW(t){return e=>{e({type:em,payLoad:t})}}function gW(t){return e=>{e({type:em,payLoad:{editing_by:t}})}}function mW(){return t=>{t({type:jC,payLoad:null})}}const i8={loading:!1,intro:"",editing_by:0,isChangesSaved:!1,enableReviewTask:!1,enableAutoSave:!1,enableAutoSaveBuilderSetting:!1,surveyQuestionSlide:!1,enableFormFluid:!0,showConditionalFields:!0,isAdvanceView:!1,models:[],fieldMappings:[],version_name:null,showIntroTab:!1,published_status:!1,formType:null,randomiseQuestions:!1,randomiseAnswers:!1,enableNoOfAssessmentQuestions:!1,noOfAssessmentQuestions:null,tableFields:[],tableConfiguration:{stripedRows:!1,gridLines:!1,flexScroll:!1,isResponsive:!1,rowReorder:!1},builderTemplateName:"",quizConfiguration:{quizPassMark:75,quizTimeLimit:2,quizMaxAttempts:99,quizSequentialAnswer:0,isAllCorrectMandatory:!0,quizRandomiseQuestions:1,quizUniqueAnswersPerAttempt:"1"},header:[],languages:[{key:1,language:"English",type:"english"}],userSelectedLanguage:{key:1,language:"English",type:"english"},layout:[{uuid:tt(),...Hm,children:[{uuid:tt(),...lf,children:[{uuid:tt(),...eu,children:[{uuid:tt(),...wc,children:[]}]}]}]}],conditionalTabsRules:[],conditionalSectionsRules:[]},vW=(t=i8,e)=>{var n,r;switch(e.type){case Zz:return{...t,...e.payLoad};case Jz:return{...t,...e.payLoad};case jC:return{...t,...i8};case j1:return{...t,...e.payLoad};case em:return{...t,...e.payLoad};case TC:{const{pageIndex:i}=e.payLoad;return{...t,layout:t.layout.filter((a,s)=>s!==i)}}case FC:return{...t,layout:[...t.layout,e.payLoad]};case kC:{const{pageIndex:i,section:a}=e.payLoad,s=[...t.layout];return s[i].children=[...s[i].children,a],{...t,layout:s}}case zC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,fieldItem:l}=e.payLoad,c=[...t.layout],u=Array.isArray((n=c[i].children[a].children[s])==null?void 0:n.repeatableFields)?[...((r=c[i].children[a].children[s])==null?void 0:r.repeatableFields)||[],l]:l?[l]:[];return c[i].children[a].children[s]={...c[i].children[a].children[s],repeatableFields:u},{...t,layout:c}}case eH:{const{fieldItem:i}=e.payLoad;let a=[...t.tableFields];return a=[...a,i],{...t,tableFields:a}}case QC:return{...t,...e.payLoad};case PC:{const{pageIndex:i,sectionIndex:a,row:s}=e.payLoad,l=[...t.layout];return l[i].children[a].children=[...l[i].children[a].children,s],{...t,layout:l}}case MC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,column:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s].children=[...c[i].children[a].children[s].children,l],{...t,layout:c}}case HC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,field:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children=[...h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children,f],{...t,layout:h}}case YC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,field:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].children.push({[`${u}-${d}`]:f}),{...t,layout:h}}case KC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f,field:h}=e.payLoad,g=[...t.layout];return g[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children[f]=h,{...t,layout:g}}case RC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,fieldChildrenIndex:f,field:h}=e.payLoad,g=[...t.layout];return g[i].children[a].children[s].children[l].children[c].children[f]={[`${u}-${d}`]:h},{...t,layout:g}}case XC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children.splice(f,1),{...t,layout:h}}case GC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,fieldChildrenIndex:u}=e.payLoad,d=[...t.layout];return d[i].children[a].children[s].children[l].children[c].children.splice(u,1),{...t,layout:d}}case EC:{const{pageIndex:i,sectionIndex:a}=e.payLoad,s=[...t.layout];return s[i].children.splice(a,1),{...t,layout:s}}case IC:{const{pageIndex:i,sectionIndex:a,rowIndex:s}=e.payLoad,l=[...t.layout];return l[i].children[a].children.splice(s,1),{...t,layout:l}}case _C:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s].children.splice(l,1),{...t,layout:c}}case DC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=e.payLoad,u=[...t.layout];return u[i].children[a].children[s].children[l].children.splice(c,1),{...t,layout:u}}case NC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,field:u}=e.payLoad,d=[...t.layout];return d[i].children[a].children[s].children[l].children[c]=u,{...t,layout:d}}case OC:{const{pageIndex:i,sectionIndex:a,section:s}=e.payLoad,l=[...t.layout];return l[i].children[a]=s,{...t,layout:l}}case w9:{const{pageIndex:i,sectionIndex:a,rowIndex:s,row:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s]=l,{...t,layout:c}}case WC:{const{pageIndex:i,page:a}=e.payLoad,s=[...t.layout];return s[i]=a,{...t,layout:s}}case LC:{const{page:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s.splice(a+1,0,i),{...t,layout:s}}case BC:{const{section:i,pageIndex:a,sectionIndex:s}=e.payLoad,l=[...t.layout];return l[a].children.splice(s+1,0,i),{...t,layout:l}}case VC:{const{section:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s[a].children.push(i),{...t,layout:s}}case qC:{const{row:i,pageIndex:a,sectionIndex:s,rowIndex:l}=e.payLoad,c=[...t.layout];return c[a].children[s].children.splice(l+1,0,i),{...t,layout:c}}case UC:{const{column:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c}=e.payLoad,u=[...t.layout];return u[a].children[s].children[l].children.splice(c+1,0,i),{...t,layout:u}}case $C:{const{field:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c,fieldIndex:u}=e.payLoad,d=[...t.layout];return d[a].children[s].children[l].children[c].children.splice(u+1,0,i),{...t,layout:d}}}return t},EI=k.createContext({dragDropManager:void 0});function tu(t){"@babel/helpers - typeof";return tu=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},tu(t)}function bW(t,e){if(tu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(tu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yW(t){var e=bW(t,"string");return tu(e)=="symbol"?e:e+""}function AW(t,e,n){return(e=yW(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function II(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _I(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?II(Object(n),!0).forEach(function(r){AW(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ql(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var DI=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),a8=function(){return Math.random().toString(36).substring(7).split("").join(".")},NI={INIT:"@@redux/INIT"+a8(),REPLACE:"@@redux/REPLACE"+a8(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+a8()}};function wW(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function SW(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(TW(t))return"date";if(xW(t))return"error";var n=CW(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function CW(t){return typeof t.constructor=="function"?t.constructor.name:null}function xW(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function TW(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function cf(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=SW(t)),e}function OI(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ql(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?ql(1):"Expected the enhancer to be a function. Instead, received: '"+cf(n)+"'");return n(OI)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?ql(2):"Expected the root reducer to be a function. Instead, received: '"+cf(t)+"'");var i=t,a=e,s=[],l=s,c=!1;function u(){l===s&&(l=s.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?ql(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function f(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?ql(4):"Expected the listener to be a function. Instead, received: '"+cf(m)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?ql(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var w=!0;return u(),l.push(m),function(){if(w){if(c)throw new Error(process.env.NODE_ENV==="production"?ql(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");w=!1,u();var x=l.indexOf(m);l.splice(x,1),s=null}}}function h(m){if(!wW(m))throw new Error(process.env.NODE_ENV==="production"?ql(7):"Actions must be plain objects. Instead, the actual type was: '"+cf(m)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?ql(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?ql(9):"Reducers may not dispatch actions.");try{c=!0,a=i(a,m)}finally{c=!1}for(var w=s=l,A=0;A<w.length;A++){var x=w[A];x()}return m}function g(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?ql(10):"Expected the nextReducer to be a function. Instead, received: '"+cf(m));i=m,h({type:NI.REPLACE})}function v(){var m,w=f;return m={subscribe:function(x){if(typeof x!="object"||x===null)throw new Error(process.env.NODE_ENV==="production"?ql(11):"Expected the observer to be an object. Instead, received: '"+cf(x)+"'");function S(){x.next&&x.next(d())}S();var T=w(S);return{unsubscribe:T}}},m[DI]=function(){return this},m}return h({type:NI.INIT}),r={dispatch:h,subscribe:f,getState:d,replaceReducer:g},r[DI]=v,r}function Hr(t,e,...n){if(EW()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function EW(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function IW(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function _W(t,e){return t.filter(n=>n!==e)}function FI(t){return typeof t=="object"}function DW(t,e){const n=new Map,r=a=>{n.set(a,n.has(a)?n.get(a)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((a,s)=>{a===1&&i.push(s)}),i}function NW(t,e){return t.filter(n=>e.indexOf(n)>-1)}const s8="dnd-core/INIT_COORDS",Ym="dnd-core/BEGIN_DRAG",o8="dnd-core/PUBLISH_DRAG_SOURCE",Km="dnd-core/HOVER",Xm="dnd-core/DROP",Rm="dnd-core/END_DRAG";function kI(t,e){return{type:s8,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const OW={type:s8,payload:{clientOffset:null,sourceClientOffset:null}};function FW(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:a,getSourceClientOffset:s}=r,l=t.getMonitor(),c=t.getRegistry();t.dispatch(kI(a)),kW(n,l,c);const u=LW(n,l);if(u==null){t.dispatch(OW);return}let d=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");PW(s),d=s(u)}t.dispatch(kI(a,d));const h=c.getSource(u).beginDrag(l,u);if(h==null)return;MW(h),c.pinSource(u);const g=c.getSourceType(u);return{type:Ym,payload:{itemType:g,item:h,sourceId:u,clientOffset:a||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function kW(t,e,n){Hr(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){Hr(n.getSource(r),"Expected sourceIds to be registered.")})}function PW(t){Hr(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function MW(t){Hr(FI(t),"Item must be an object.")}function LW(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function BW(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VW(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){BW(t,i,n[i])})}return t}function qW(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();UW(r),zW(r).forEach((s,l)=>{const c=$W(s,l,i,r),u={type:Xm,payload:{dropResult:VW({},n,c)}};t.dispatch(u)})}}function UW(t){Hr(t.isDragging(),"Cannot call drop while not dragging."),Hr(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function $W(t,e,n,r){const i=n.getTarget(t);let a=i?i.drop(r,t):void 0;return jW(a),typeof a>"u"&&(a=e===0?{}:r.getDropResult()),a}function jW(t){Hr(typeof t>"u"||FI(t),"Drop result must either be an object or undefined.")}function zW(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function HW(t){return function(){const n=t.getMonitor(),r=t.getRegistry();YW(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:Rm}}}function YW(t){Hr(t.isDragging(),"Cannot call endDrag while not dragging.")}function l8(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function KW(t){return function(n,{clientOffset:r}={}){XW(n);const i=n.slice(0),a=t.getMonitor(),s=t.getRegistry(),l=a.getItemType();return GW(i,s,l),RW(i,a,s),WW(i,a,s),{type:Km,payload:{targetIds:i,clientOffset:r||null}}}}function XW(t){Hr(Array.isArray(t),"Expected targetIds to be an array.")}function RW(t,e,n){Hr(e.isDragging(),"Cannot call hover while not dragging."),Hr(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];Hr(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const a=n.getTarget(i);Hr(a,"Expected targetIds to be registered.")}}function GW(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],a=e.getTargetType(i);l8(a,n)||t.splice(r,1)}}function WW(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function QW(t){return function(){if(t.getMonitor().isDragging())return{type:o8}}}function JW(t){return{beginDrag:FW(t),publishDragSource:QW(t),hover:KW(t),drop:qW(t),endDrag:HW(t)}}class ZW{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(a){return(...s)=>{const l=a.apply(e,s);typeof l<"u"&&n(l)}}const i=JW(this);return Object.keys(i).reduce((a,s)=>{const l=i[s];return a[s]=r(l),a},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function eQ(t,e){return{x:t.x+e.x,y:t.y+e.y}}function PI(t,e){return{x:t.x-e.x,y:t.y-e.y}}function tQ(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:PI(eQ(e,r),n)}function nQ(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:PI(e,n)}const Ap=[],c8=[];Ap.__IS_NONE__=!0,c8.__IS_ALL__=!0;function rQ(t,e){return t===Ap?!1:t===c8||typeof e>"u"?!0:NW(e,t).length>0}class iQ{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;Hr(typeof e=="function","listener must be a function."),Hr(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const a=()=>{const s=this.store.getState(),l=s.stateId;try{l===i||l===i+1&&!rQ(s.dirtyHandlerIds,r)||e()}finally{i=l}};return this.store.subscribe(a)}subscribeToOffsetChange(e){Hr(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return Hr(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(Hr(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),i=this.getItemType();return l8(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(Hr(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),a=this.getItemType();if(a&&!l8(i,a))return!1;const s=this.getTargetIds();if(!s.length)return!1;const l=s.indexOf(e);return r?l===s.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return tQ(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return nQ(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const MI=typeof global<"u"?global:self,LI=MI.MutationObserver||MI.WebKitMutationObserver;function BI(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function aQ(t){let e=1;const n=new LI(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const sQ=typeof LI=="function"?aQ:BI;class oQ{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=sQ(this.flush),this.requestErrorThrow=BI(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class lQ{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class cQ{create(e){const n=this.freeTasks,r=n.length?n.pop():new lQ(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const VI=new oQ,uQ=new cQ(VI.registerPendingError);function dQ(t){VI.enqueueTask(uQ.create(t))}const u8="dnd-core/ADD_SOURCE",d8="dnd-core/ADD_TARGET",f8="dnd-core/REMOVE_SOURCE",Gm="dnd-core/REMOVE_TARGET";function fQ(t){return{type:u8,payload:{sourceId:t}}}function hQ(t){return{type:d8,payload:{targetId:t}}}function pQ(t){return{type:f8,payload:{sourceId:t}}}function gQ(t){return{type:Gm,payload:{targetId:t}}}function mQ(t){Hr(typeof t.canDrag=="function","Expected canDrag to be a function."),Hr(typeof t.beginDrag=="function","Expected beginDrag to be a function."),Hr(typeof t.endDrag=="function","Expected endDrag to be a function.")}function vQ(t){Hr(typeof t.canDrop=="function","Expected canDrop to be a function."),Hr(typeof t.hover=="function","Expected hover to be a function."),Hr(typeof t.drop=="function","Expected beginDrag to be a function.")}function h8(t,e){if(e&&Array.isArray(t)){t.forEach(n=>h8(n,!1));return}Hr(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ul;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Ul||(Ul={}));let bQ=0;function yQ(){return bQ++}function AQ(t){const e=yQ().toString();switch(t){case Ul.SOURCE:return`S${e}`;case Ul.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function qI(t){switch(t[0]){case"S":return Ul.SOURCE;case"T":return Ul.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function UI(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,a]}=n.next();if(a===e)return!0;r=!!i}while(!r);return!1}class wQ{addSource(e,n){h8(e),mQ(n);const r=this.addHandler(Ul.SOURCE,e,n);return this.store.dispatch(fQ(r)),r}addTarget(e,n){h8(e,!0),vQ(n);const r=this.addHandler(Ul.TARGET,e,n);return this.store.dispatch(hQ(r)),r}containsHandler(e){return UI(this.dragSources,e)||UI(this.dropTargets,e)}getSource(e,n=!1){return Hr(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return Hr(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return Hr(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return Hr(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return qI(e)===Ul.SOURCE}isTargetId(e){return qI(e)===Ul.TARGET}removeSource(e){Hr(this.getSource(e),"Expected an existing source."),this.store.dispatch(pQ(e)),dQ(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){Hr(this.getTarget(e),"Expected an existing target."),this.store.dispatch(gQ(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);Hr(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){Hr(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=AQ(e);return this.types.set(i,n),e===Ul.SOURCE?this.dragSources.set(i,r):e===Ul.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const SQ=(t,e)=>t===e;function CQ(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function xQ(t,e,n=SQ){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function TQ(t=Ap,e){switch(e.type){case Km:break;case u8:case d8:case Gm:case f8:return Ap;case Ym:case o8:case Rm:case Xm:default:return c8}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=DW(n,r);if(!(i.length>0||!xQ(n,r)))return Ap;const s=r[r.length-1],l=n[n.length-1];return s!==l&&(s&&i.push(s),l&&i.push(l)),i}function EQ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function IQ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){EQ(t,i,n[i])})}return t}const $I={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function _Q(t=$I,e){const{payload:n}=e;switch(e.type){case s8:case Ym:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Km:return CQ(t.clientOffset,n.clientOffset)?t:IQ({},t,{clientOffset:n.clientOffset});case Rm:case Xm:return $I;default:return t}}function DQ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){DQ(t,i,n[i])})}return t}const NQ={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function OQ(t=NQ,e){const{payload:n}=e;switch(e.type){case Ym:return uf({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case o8:return uf({},t,{isSourcePublic:!0});case Km:return uf({},t,{targetIds:n.targetIds});case Gm:return t.targetIds.indexOf(n.targetId)===-1?t:uf({},t,{targetIds:_W(t.targetIds,n.targetId)});case Xm:return uf({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Rm:return uf({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function FQ(t=0,e){switch(e.type){case u8:case d8:return t+1;case f8:case Gm:return t-1;default:return t}}function kQ(t=0){return t+1}function PQ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function MQ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){PQ(t,i,n[i])})}return t}function LQ(t={},e){return{dirtyHandlerIds:TQ(t.dirtyHandlerIds,{type:e.type,payload:MQ({},e.payload,{prevTargetIds:IW(t,"dragOperation.targetIds",[])})}),dragOffset:_Q(t.dragOffset,e),refCount:FQ(t.refCount,e),dragOperation:OQ(t.dragOperation,e),stateId:kQ(t.stateId)}}function BQ(t,e=void 0,n={},r=!1){const i=VQ(r),a=new iQ(i,new wQ(i)),s=new ZW(i,a),l=t(s,e,n);return s.receiveBackend(l),s}function VQ(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return OI(LQ,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function qQ(t,e){if(t==null)return{};var n=UQ(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function UQ(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let jI=0;const Wm=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var wp=k.memo(function(e){var{children:n}=e,r=qQ(e,["children"]);const[i,a]=$Q(r);return k.useEffect(()=>{if(a){const s=zI();return++jI,()=>{--jI===0&&(s[Wm]=null)}}},[]),o.jsx(EI.Provider,{value:i,children:n})});function $Q(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=jQ(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function jQ(t,e=zI(),n,r){const i=e;return i[Wm]||(i[Wm]={dragDropManager:BQ(t,e,n,r)}),i[Wm]}function zI(){return typeof global<"u"?global:window}var HI=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(a=Object.keys(e),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var s=a[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const zQ=zs(HI),$0=typeof window<"u"?k.useLayoutEffect:k.useEffect;function HQ(t,e,n){const[r,i]=k.useState(()=>e(t)),a=k.useCallback(()=>{const s=e(t);zQ(r,s)||(i(s),n&&n())},[r,t,n]);return $0(a),[r,a]}function YQ(t,e,n){const[r,i]=HQ(t,e,n);return $0(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(i,{handlerIds:[s]})},[t,i]),r}function YI(t,e,n){return YQ(e,t||(()=>({})),()=>n.reconnect())}function KI(t,e){const n=[];return typeof t!="function"&&n.push(t),k.useMemo(()=>typeof t=="function"?t():t,n)}function KQ(t){return k.useMemo(()=>t.hooks.dragSource(),[t])}function XQ(t){return k.useMemo(()=>t.hooks.dragPreview(),[t])}let p8=!1,g8=!1;class RQ{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){Hr(!p8,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return p8=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{p8=!1}}isDragging(){if(!this.sourceId)return!1;Hr(!g8,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return g8=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{g8=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let m8=!1;class GQ{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;Hr(!m8,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return m8=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{m8=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function WQ(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function QQ(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function v8(t,e,n,r){let i;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const a=Object.keys(t),s=Object.keys(e);if(a.length!==s.length)return!1;const l=Object.prototype.hasOwnProperty.bind(e);for(let c=0;c<a.length;c++){const u=a[c];if(!l(u))return!1;const d=t[u],f=e[u];if(i=void 0,i===!1||i===void 0&&d!==f)return!1}return!0}function b8(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function JQ(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function ZQ(t){return(e=null,n=null)=>{if(!k.isValidElement(e)){const a=e;return t(a,n),a}const r=e;return JQ(r),eJ(r,n?a=>t(a,n):t)}}function XI(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=ZQ(r);e[n]=()=>i}}),e}function RI(t,e){typeof t=="function"?t(e):t.current=e}function eJ(t,e){const n=t.ref;return Hr(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?k.cloneElement(t,{ref:r=>{RI(n,r),RI(e,r)}}):k.cloneElement(t,{ref:e})}class tJ{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!v8(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!v8(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=XI({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,b8(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,b8(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class nJ{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!v8(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=XI({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,b8(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function df(){const{dragDropManager:t}=k.useContext(EI);return Hr(t!=null,"Expected drag drop context"),t}function rJ(t,e){const n=df(),r=k.useMemo(()=>new tJ(n.getBackend()),[n]);return $0(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),$0(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function iJ(){const t=df();return k.useMemo(()=>new RQ(t),[t])}class aJ{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,i=this.monitor,{isDragging:a}=r;return a?a(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function sJ(t,e,n){const r=k.useMemo(()=>new aJ(t,e,n),[e,n]);return k.useEffect(()=>{r.spec=t},[t]),r}function oJ(t){return k.useMemo(()=>{const e=t.type;return Hr(e!=null,"spec.type must be defined"),e},[t])}function lJ(t,e,n){const r=df(),i=sJ(t,e,n),a=oJ(t);$0(function(){if(a!=null){const[l,c]=QQ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c}},[r,e,n,i,a])}function ra(t,e){const n=KI(t);Hr(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=iJ(),i=rJ(n.options,n.previewOptions);return lJ(n,r,i),[YI(n.collect,r,i),KQ(i),XQ(i)]}function cJ(t){return k.useMemo(()=>t.hooks.dropTarget(),[t])}function uJ(t){const e=df(),n=k.useMemo(()=>new nJ(e.getBackend()),[e]);return $0(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function dJ(){const t=df();return k.useMemo(()=>new GQ(t),[t])}function fJ(t){const{accept:e}=t;return k.useMemo(()=>(Hr(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class hJ{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function pJ(t,e){const n=k.useMemo(()=>new hJ(t,e),[e]);return k.useEffect(()=>{n.spec=t},[t]),n}function gJ(t,e,n){const r=df(),i=pJ(t,e),a=fJ(t);$0(function(){const[l,c]=WQ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c},[r,e,i,n,a.map(s=>s.toString()).join("|")])}function mJ(t,e){const n=KI(t),r=dJ(),i=uJ(n.options);return gJ(n,r,i),[YI(n.collect,r,i),cJ(i)]}function GI(t){let e=null;return()=>(e==null&&(e=t()),e)}function vJ(t,e){return t.filter(n=>n!==e)}function bJ(t,e){const n=new Set,r=a=>n.add(a);t.forEach(r),e.forEach(r);const i=[];return n.forEach(a=>i.push(a)),i}class yJ{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=bJ(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=vJ(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class AJ{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const WI="__NATIVE_FILE__",QI="__NATIVE_URL__",JI="__NATIVE_TEXT__",ZI="__NATIVE_HTML__",e_=Object.freeze(Object.defineProperty({__proto__:null,FILE:WI,HTML:ZI,TEXT:JI,URL:QI},Symbol.toStringTag,{value:"Module"}));function y8(t,e,n){const r=e.reduce((i,a)=>i||t.getData(a),"");return r??n}const A8={[WI]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[ZI]:{exposeProperties:{html:(t,e)=>y8(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[QI]:{exposeProperties:{urls:(t,e)=>y8(t,e,"").split(`
1594
- `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[JI]:{exposeProperties:{text:(t,e)=>y8(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function wJ(t,e){const n=A8[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new AJ(n);return r.loadDataTransfer(e),r}function w8(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(A8).filter(n=>{const r=A8[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const SJ=GI(()=>/firefox/i.test(navigator.userAgent)),t_=GI(()=>!!window.safari);class n_{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,c3s:s}=this;let l=n.length-1;if(e===n[l])return r[l];let c=0,u=s.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const g=n[d];if(g<e)c=d+1;else if(g>e)u=d-1;else return r[d]}l=Math.max(0,u);const f=e-n[l],h=f*f;return r[l]+i[l]*f+a[l]*h+s[l]*f*h}constructor(e,n){const{length:r}=e,i=[];for(let g=0;g<r;g++)i.push(g);i.sort((g,v)=>e[g]<e[v]?-1:1);const a=[],s=[];let l,c;for(let g=0;g<r-1;g++)l=e[g+1]-e[g],c=n[g+1]-n[g],a.push(l),s.push(c/l);const u=[s[0]];for(let g=0;g<a.length-1;g++){const v=s[g],m=s[g+1];if(v*m<=0)u.push(0);else{l=a[g];const w=a[g+1],A=l+w;u.push(3*A/((A+w)/v+(A+l)/m))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let g=0;g<u.length-1;g++){h=s[g];const v=u[g],m=1/a[g],w=v+u[g+1]-h-h;d.push((h-v-w)*m),f.push(w*m*m)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const CJ=1;function r_(t){const e=t.nodeType===CJ?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Qm(t){return{x:t.clientX,y:t.clientY}}function xJ(t){var e;return t.nodeName==="IMG"&&(SJ()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function TJ(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return t_()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function EJ(t,e,n,r,i){const a=xJ(e),l=r_(a?t:e),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:u,offsetHeight:d}=t,{anchorX:f,anchorY:h}=r,{dragPreviewWidth:g,dragPreviewHeight:v}=TJ(a,e,u,d),m=()=>{let E=new n_([0,.5,1],[c.y,c.y/d*v,c.y+v-d]).interpolate(h);return t_()&&a&&(E+=(window.devicePixelRatio-1)*v),E},w=()=>new n_([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(f),{offsetX:A,offsetY:x}=i,S=A===0||A,T=x===0||x;return{x:S?A:w(),y:T?x:m()}}class IJ{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function _J(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){_J(t,i,n[i])})}return t}class DJ{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return i_({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return i_({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(e_).some(n=>e_[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=wJ(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const a=this.sourceNodes.get(i);return a&&r_(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=Qm(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:l}=i,c=w8(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||f;if(h){const{anchorX:g,anchorY:v,offsetX:m,offsetY:w}=this.getCurrentSourcePreviewNodeOptions(),S=EJ(f,h,s,{anchorX:g,anchorY:v},{offsetX:m,offsetY:w});l.setDragImage(h,S.x,S.y)}}try{l==null||l.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:l}=i,c=w8(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:Qm(i)}),a.some(l=>this.monitor.canDropOnTarget(l))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Qm(i),this.scheduleHover(a),(a||[]).some(l=>this.monitor.canDropOnTarget(l))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else w8(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:Qm(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new IJ(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new yJ(this.isNodeInDocument)}}const Sp=function(e,n,r){return new DJ(e,n,r)},a_=k.createContext(void 0),s_=({children:t,option:e,saveFormBuilderSchema:n,templateSchema:r,onChange:i,isHTML5BackendDisabled:a=!1})=>{const{isPreview:s,isAdmin:l,isRenderView:c,isBuilderMode:u,renderType:d,isAdvanceView:f,globalAlignment:h="ltr",emitSocketData:g,media:v,exam:m={},reusableComponent:w,saveFormProgress:A,showSettings:x,training:S,fileUploadParams:T}=e,C={...i8,formType:d,...r},[E,_]=k.useReducer(vW,C);return k.useEffect(()=>{const M=It.debounce(()=>{n&&n(E)},1e3);return M(),()=>M.cancel()},[E,n]),o.jsx(a_.Provider,{value:{media:v,isBuilderMode:u,isPreview:s,isAdmin:l,isRenderView:c,renderType:d,isAdvanceView:f,globalAlignment:h,exam:m,emitSocketData:g,reusableComponent:w,state:E,dispatch:_,onChange:i,saveFormProgress:A,showSettings:x,training:S,fileUploadParams:T},children:a?o.jsx(o.Fragment,{children:t}):o.jsx(wp,{backend:Sp,children:t})})},o_=()=>k.useContext(a_),NJ=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},OJ=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],FJ=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],l_=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return NJ(t,u,c)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=n.slice(1),l=r[i];return r[i]={...l,children:l_(l.children,a,s)},r},c_=(t,e)=>{if(e.length===1){const s=Number(e[0]);return OJ(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:c_(a.children,i)},n},S8=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return FJ(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:S8(s.children,a,n)},r},kJ=(t,e,n)=>{let r=[...t],i=r[n[fa]].children[n[ha]].children[n[Ca]].children[n[xa]].children[n[Ta]].inlineConditionalRules.rules[n[Fa]].conditions[n[Xo]].children[n[wo]];return r[n[fa]].children[n[ha]].children[n[Ca]].children[n[xa]].children[n[Ta]].inlineConditionalRules.rules[n[Fa]].conditions[n[Xo]].children.splice([n[wo]],1),r[e[fa]].children[e[ha]].children[e[Ca]].children[e[xa]].children[e[Ta]].inlineConditionalRules.rules[e[Fa]].conditions[e[Xo]].children.splice(e[wo],0,i),r},PJ=(t,e,n)=>l_(t,e,n),MJ=t=>{const e=[...t],n={type:As,uuid:tt(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},u_=(t,e,n,r)=>{var h,g,v,m,w,A;let i;const a={...wc,uuid:tt(),children:[r]},s={...eu,uuid:tt()},l={...eu,uuid:tt(),children:[a]},c={...lf,uuid:tt(),children:[l]},u={...Hm,uuid:tt(),children:[c]};switch(e.length){case 1:{r.type===tx?i={...c,children:[r]}:i={...c,children:[s]};break}case 2:{r.type===na?i={...u,children:[c]}:i={...u,children:[c]};break}case 3:{r.type===Ao?i={...c,children:[l]}:i={...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[r]}]};break}case 4:{r.type===z1?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(A=(w=(m=(v=(g=(h=d[n[fa]])==null?void 0:h.children[n[ha]])==null?void 0:g.children[n[Ca]])==null?void 0:v.children[n[xa]])==null?void 0:m.children[n[Ta]])==null?void 0:w.inlineConditionalRules)==null||A.rules[n[Fa]].conditions[n[Xo]].children.splice(n[wo],1):d=c_(d,n),d=MJ(d),d=S8(d,e,i),d},LJ=(t,e,n)=>{let r;switch(e.length){case 1:{r={...Hm,uuid:tt(),children:[{...lf,uuid:tt(),children:[{...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[n]}]}]}]};break}case 2:{r={...lf,uuid:tt(),children:[{...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[n]}]}]};break}case 3:{r={...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[n]}]};break}case 4:{r={...wc,uuid:tt(),children:[n]};break}default:r=n}return S8(t,e,r)},sn=()=>{const{state:t,dispatch:e,onChange:n,saveFormProgress:r}=o_(),{updateGlobalToast:i,emitSocketData:a}=Ht();if(t===void 0)throw new Error("Must be wrapped in builder provider");const s=t.builderTemplateName,l=t.isChangesSaved,c=t.editing_by,u=t.version_name,d=t.loading,f=t.published_status,h=t,g=t,v=t.formType,m=t==null?void 0:t.userSelectedLanguage,w=t==null?void 0:t.languages,A=t.layout,x=k.useCallback(fe=>lW(fe)(e),[e]),S=k.useCallback(fe=>PG(fe)(e),[e]),T=k.useCallback(fe=>cW(fe)(e),[e]),C=k.useCallback((fe,Te)=>{var xt,ze,He,ot,rn,nn,Jt,In,At;const Ee=fe.path.split("-"),U=Ee.slice(0,-1).join("-"),ve={uuid:Te.uuid,type:Te.type,reviewerChecklist:[]},he=0,ue=1,pe=2,xe=3,ke=4,Be=5,Ye=6,rt=8,it=7,ht=5,jt=6,pn=8;if(Te.type===na&&(Te==null?void 0:Te.schema)!==void 0){H(JSON.parse(Te==null?void 0:Te.schema),parseInt(Ee[he]));return}if(((xt=Te==null?void 0:Te.schema)==null?void 0:xt.componentType)==="question"&&((nn=(rn=(ot=(He=(ze=A[0])==null?void 0:ze.children[0])==null?void 0:He.children[0])==null?void 0:ot.children[0])==null?void 0:rn.children)!=null&&nn.some(Ue=>{var st,Dt,qt;return((st=Ue==null?void 0:Ue.questionText)==null?void 0:st[m.type])===((qt=(Dt=Te==null?void 0:Te.schema)==null?void 0:Dt.questionText)==null?void 0:qt[m.type])}))&&((Jt=Te==null?void 0:Te.schema.questionText)==null?void 0:Jt.english)!=="Sample Question"){alert("not allow"),i({showToast:!0,toastMessage:"Exist",toastDetail:"Question text cannot be same for more than one element",toastType:"warn"});return}if(Te.type===tr){let Ue={type:z1,reviewerChecklist:[],...It.cloneDeep(Te.schema)};if(Ue!=null&&Ue.options&&(Ue={...Ue,options:[{uuid:tt(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:tt(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),Ue.componentType==="grid-component"&&(Ue={...Ue,children:[],options:[{uuid:tt(),custom_values:{}}]}),Ue.componentType==="radio-hierarchal"&&(Ue={...Ue,type:"radio",children:[],options:[{uuid:tt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:tt(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),Ue={...Ue,uuid:tt()},Ee.length===rt){se(parseInt(Ee[he]),parseInt(Ee[ue]),parseInt(Ee[pe]),parseInt(Ee[xe]),parseInt(Ee[ke]),parseInt(Ee[Be]),parseInt(Ee[Ye]),Ue),a();return}if(Ee.length===it){ge(parseInt(Ee[he]),parseInt(Ee[ue]),parseInt(Ee[pe]),parseInt(Ee[xe]),parseInt(Ee[ke]),parseInt(Ee[ht]),parseInt(Ee[jt]),Ue),a();return}if((At=(In=A[Ee[he]].children[Ee[ue]])==null?void 0:In.children[Ee[pe]])!=null&&At.rowIsRepeatable&&(Ue==null?void 0:Ue.componentType)==="editor"){i({showToast:!0,toastMessage:"Forbidden",toastDetail:"This Field cannot be applied in repeatable",toastType:"error"});return}T(LJ(A,Ee,Ue)),a(),Ee.length>1&&ye(Ee[he],Ee[ue],Ee[pe],Ue);return}const kt=Te.path.split("-"),mn=kt.slice(0,-1).join("-");if(kt.length===Ee.length){if(mn===U){if((kt==null?void 0:kt.length)===pn){T(kJ(A,Ee,kt));return}T(PJ(A,Ee,kt));return}const Ue={...ve,...Te};(Te==null?void 0:Te.id)===void 0&&(Ue.id=tt()),T(u_(A,Ee,kt,Ue));return}if((kt==null?void 0:kt.length)===8){const Ue={type:z1,reviewerChecklist:[],...Te};ge(parseInt(Ee[he]),parseInt(Ee[ue]),parseInt(Ee[pe]),parseInt(Ee[xe]),parseInt(Ee[ke]),parseInt(Ee[ht]),parseInt(Ee[jt]),Ue),q(kt[fa],kt[ha],kt[Ca],kt[xa],kt[Ta],kt[ht],kt[jt],kt[Bl]);return}const Rn={...ve,...Te};(Te==null?void 0:Te.id)===void 0&&(Rn.id=tt()),T(u_(A,Ee,kt,Rn))},[A,m.type]),E=k.useCallback(()=>mW()(e),[e]),_=k.useCallback(fe=>uW(fe)(e,t),[e]),M=k.useCallback(fe=>dW(fe)(e,t),[e]),O=k.useCallback(fe=>fW(fe)(e),[e]),F=k.useCallback(fe=>kG(fe)(e),[e]),P=k.useCallback(fe=>qG(fe)(e),[e]),H=k.useCallback((fe,Te)=>jG(fe,Te)(e),[e]),N=k.useCallback((fe,Te)=>XG(fe,Te)(e),[e]),z=k.useCallback((fe,Te,Ee)=>WG(fe,Te,Ee)(e),[e]),$=k.useCallback(fe=>BG(fe)(e),[e]),oe=k.useCallback((fe,Te)=>VG(fe,Te)(e),[e]),X=k.useCallback((fe,Te,Ee)=>KG(fe,Te,Ee)(e),[e]),R=k.useCallback((fe,Te,Ee,U)=>JG(fe,Te,Ee,U)(e),[e]),le=k.useCallback((fe,Te,Ee,U,ve)=>ZG(fe,Te,Ee,U,ve)(e,t),[e]),Y=k.useCallback((fe,Te,Ee,U,ve,he)=>eW(fe,Te,Ee,U,ve,he)(e,t),[e]),ie=k.useCallback((fe,Te,Ee)=>UG(fe,Te,Ee)(e),[e]),re=k.useCallback((fe,Te,Ee,U)=>YG(fe,Te,Ee,U)(e),[e]),Z=k.useCallback((fe,Te)=>LG(fe,Te)(e),[e]),K=k.useCallback((fe,Te,Ee,U,ve,he)=>tW(fe,Te,Ee,U,ve,he)(e),[e]),W=k.useCallback((fe,Te,Ee,U,ve)=>QG(fe,Te,Ee,U,ve)(e),[e]),me=k.useCallback((fe,Te,Ee,U)=>HG(fe,Te,Ee,U)(e),[e]),Ae=k.useCallback((fe,Te,Ee)=>$G(fe,Te,Ee)(e),[e]),Ie=k.useCallback((fe,Te)=>MG(fe,Te)(e,t),[e]),ye=k.useCallback((fe,Te,Ee,U)=>RG(fe,Te,Ee,U)(e),[e]),de=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe,xe)=>sW(fe,Te,Ee,U,ve,he,ue,pe,xe)(e),[e]),ne=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe,xe)=>iW(fe,Te,Ee,U,ve,he,ue,pe,xe)(e),[e]),q=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe)=>aW(fe,Te,Ee,U,ve,he,ue,pe)(e),[e]),ee=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe)=>oW(fe,Te,Ee,U,ve,he,ue,pe)(e),[e]),se=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe)=>nW(fe,Te,Ee,U,ve,he,ue,pe)(e),[e]),ge=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe)=>rW(fe,Te,Ee,U,ve,he,ue,pe)(e),[e]),De=k.useCallback(fe=>hW(fe)(e),[e]),Ne=k.useCallback(fe=>pW(fe)(e),[e]),be=k.useCallback(fe=>gW(fe)(e),[e]);return{builderIsChangesSaved:l,builderTemplateName:s,formBuilderFormSchema:h,formBuilderFormLayout:A,formBuilderSchemaLanguages:w,saveFormTemplateNewVersion:g,userSelectedLanguage:m,formBuilderConfigurationType:v,formBuilderLoading:d,formBuilderPublishedStatus:f,builderEditingBy:c,builderVersionName:u,handleDrop:C,formatTableFieldsHook:S,saveFormBuilderSchema:x,removePage:$,removeSection:oe,removeRow:X,removeColumn:R,removeField:le,updateEditingBy:be,addTabs:F,addSection:P,addRow:N,addColumn:z,cloneField:K,cloneColumn:W,cloneRow:me,cloneSection:Ae,clonePage:Ie,sectionImport:H,setLayout:T,fieldSettingUpdate:Y,selectFormBuilderLanguage:_,unselectFormBuilderLanguage:M,updateUserFormSelectedLanguage:O,updateFormType:De,schemaBuilderUpdate:Ne,pageSettingUpdate:Z,saveFormProgress:r,sectionSettingUpdate:ie,rowSettingUpdate:re,clearBuilderSchema:E,addFieldToRowRepeaptable:ye,addFieldToInlineRuleCondtionFields:se,fieldSettingUpdateInlineConditional:de,fieldSettingDeleteInlineConditional:ee,addFieldToGridComponentHook:ge,gridComponentFieldSettingUpdate:ne,gridComponentFieldDelete:q}},Ht=()=>{var C,E,_;const{isPreview:t,isAdmin:e,isRenderView:n,renderType:r,isAdvanceView:i,isBuilderMode:a,media:s,exam:l,globalAlignment:c,reusableComponent:u,showSettings:d,training:f,fileUploadParams:h}=o_();if(t===void 0)throw new Error("Must be wrapped in builder provider");const g=r==null?void 0:r.key,{saveComponent:v,componentList:m,sectionsList:w}=u,A=()=>{},x=M=>{d!=null&&d.showToast&&(d==null||d.showToast(M))},S=((C=f==null?void 0:f.quiz)==null?void 0:C.quizList)||[],T=(E=f==null?void 0:f.quiz)!=null&&E.getQuizList?(_=f==null?void 0:f.quiz)==null?void 0:_.getQuizList:()=>{};return{quizlist:S,getQuizList:T,isPreview:t,isAdmin:e,isRenderView:n,renderType:g,isAdvanceView:i,isBuilderMode:a,globalAlignment:c,media:s,exam:l,saveComponent:v,componentList:m,sectionsList:w,fileUploadParams:h,emitSocketData:A,updateGlobalToast:x}},BJ="TASKS_LOADING",VJ="TASKS_ADD",qJ="TASKS_GET_PAGINATED_LIST",UJ="TASKS_DELETE",$J="TASKS_PAGNIATION_UPDATE",jJ="TASKS_UPDATE",zJ="TASKS_SUCCESS_GET",HJ="TASK_GET_TEMPLATE",YJ="TASK_SET_DATA",KJ="TASKS_FORM_SUBMIT",XJ="TASKS_FORM_HTTP_REQUEST",C8="TASK_SET_PROGRESS_VALUE",d_="TASK_SET_MAX_PROGRESS_VALUE",f_="TASK_SET_REGISTER_DATA",h_="TASK_SET_SCHEMA",x8="TASK_UPDATE_USER_FORM_SUBMIT_DATA",p_="CLEAR_TASK",g_="TASK_USER_SUBMIT_FORM_REPEATABLE_ADD",m_="TASK_USER_SUBMIT_FORM_REPEATABLE_REMOVE_INDEX",v_="TASK_USER_TRAINING_DATA",b_="TASK_FIELD_UPDATE",RJ=6,Jm=1,Cp="DISPLAY_TYPE_START_DETAILS",Zm="DISPLAY_TYPE_QUIZ",T8="DISPLAY_TYPE_START_TIMER";function GJ(t,e,n,r,i,a){return s=>{s({type:b_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}})}}function y_(t){return e=>{const n={type:x8,payLoad:{userTaskSubmitFormData:[...t]}};e(n)}}function WJ(t){return(e,n)=>{const{TasksReducer:r}=n(),{taskData:i}=r,a={type:x8,payLoad:{taskData:{...i,...t}}};e(a)}}function QJ(t,e){return(n,r)=>{const{userTaskSubmitFormData:i}=r,a=It.findIndex(i,function(l){return l.rowId===t});n({type:m_,payLoad:{userSubmitFormIndex:a,repeatableDataRowIndex:e}})}}function JJ(t,e){return(n,r)=>{const{userTaskSubmitFormData:i}=r,a=It.findIndex(i,function(l){return l.rowId===t});n({type:g_,payLoad:{userSubmitFormIndex:a,repeatableData:e}})}}function ZJ(){return t=>{t({type:p_,payLoad:null})}}const A_=t=>e=>{e({type:C8,payLoad:{progressValue:t}})},eZ=t=>e=>{e({type:C8,payLoad:t})},tZ=t=>e=>{e({type:v_,payLoad:{userTrainingSaveData:t}})},w_=t=>e=>{e({type:f_,payLoad:{registerData:t}})},nZ=(t,e,n)=>(r,i)=>{var u;const{userTaskSubmitFormData:a}=i,s=[...a],l=It.findIndex(s,function(d){var f;return d.rowId===((f=t==null?void 0:t.row)==null?void 0:f.uuid)});let c=(u=a[l])==null?void 0:u.repeatableFields;c={...c,[e==null?void 0:e.uuid]:`<div>${n}</div>`},s[l]={...s[l],repeatableFields:c},y_(s)(r)},rZ=(t,e,n)=>(r,i)=>{const{userTaskSubmitFormData:a,registerData:s}=i,l=a,c=It.cloneDeep(s);if(n&&(l==null?void 0:l.length)>0){c[e==null?void 0:e.uuid]=n;for(const d of l)d.fieldId===e.uuid&&(d.postData[0]={postValue:n})}else if((l==null?void 0:l.length)>0){for(const d of l)d.fieldId===e.uuid&&(d.postData[0]={postValue:""});delete c[e==null?void 0:e.uuid]}w_(c)(r);const u=Object.keys(c).length;A_(u)(r)},iZ=t=>e=>{e({type:d_,payLoad:{progressMaxValue:t}})},E8={submitting:!1,httpRequest:!1,taskData:null,taskUpdateLoading:!1,loading:!1,progressLoading:!1,list:[],filter:"",sort:"task.created_at|desc",total_records:0,page:1,per_page:10,success:!1,success_message:"",userTaskSubmitFormData:null,taskSchema:null,progressMaxValue:0,maxTabs:0,registerData:{},progressValue:0,tabNoOfFieldsData:[],noOfTotalElements:0,sortField:null,sortOrder:null,userTrainingSaveData:null,assessmentData:null,task_status:1},aZ=(t=E8,e)=>{switch(e.type){case p_:return{...t,...E8,list:[...t.list],page:t.page,per_page:t.per_page,filter:t.filter,sort:t.sort,total_records:t.total_records};case zJ:return{...t,...e.payLoad};case x8:return{...t,...e.payLoad};case h_:return{...t,...e.payLoad};case C8:return{...t,...e.payLoad};case f_:return{...t,registerData:e.payLoad.registerData};case d_:return{...t,...e.payLoad};case BJ:return{...t,...e.payLoad};case KJ:return{...t,...e.payLoad};case XJ:return{...t,...e.payLoad};case VJ:{const{record:n}=e.payLoad;return{...t,list:[...n,...t.list]}}case qJ:return{...t,...e.payLoad};case YJ:return{...t,taskData:e.payLoad};case $J:return{...t,...e.payLoad};case UJ:{const n=t.list.filter(r=>r.task_id!==e.payLoad.task_id);return{...t,list:[...n]}}case v_:return{...t,...e.payLoad};case b_:{const{pageIndex:n,sectionIndex:r,rowIndex:i,columnIndex:a,fieldIndex:s,field:l}=e.payLoad,c=[...t.taskSchema.layout];c[n].children[r].children[i].children[a].children[s]=l;const u={...t.taskSchema,layout:c};return{...t,taskSchema:u}}case g_:{const{userSubmitFormIndex:n,repeatableData:r}=e.payLoad,i=t.userTaskSubmitFormData[n].repeatableFieldsData?t.userTaskSubmitFormData[n].repeatableFieldsData:[];return i.push(r),t.userTaskSubmitFormData[n].repeatableFieldsData=i,t}case m_:{const{userSubmitFormIndex:n,repeatableDataRowIndex:r}=e.payLoad,i=[...t.userTaskSubmitFormData],a=[...i[n].repeatableFieldsData];return a.splice(r,1),i[n]={...i[n],repeatableFieldsData:a},{...t,userTaskSubmitFormData:i}}case jJ:{const{row:n,eventIndex:r}=e.payLoad,i=t.list[r];return t.list[r]={...i,...n},t}case HJ:return{...t,...e.payLoad}}return t},S_=k.createContext(void 0),sZ=({option:t,taskOptions:e,saveFormBuilderSchema:n,templateSchema:r,taskValue:i,children:a,isHTML5BackendDisabled:s=!1})=>{const[l,c]=k.useReducer(aZ,{...E8,...i}),{progressMaxValue:u=0,progressValue:d=0,registerData:f=null,...h}=i||{};return k.useEffect(()=>{c({type:h_,payLoad:h})},[i]),o.jsx(S_.Provider,{value:{taskOptions:e,state:l,dispatch:c},children:o.jsx(s_,{isHTML5BackendDisabled:s,option:t,saveFormBuilderSchema:n,templateSchema:r,onChange:()=>{},children:a})})},oZ=()=>k.useContext(S_),Ar=()=>{var de,ne,q,ee,se,ge,De,Ne;const{taskOptions:n,state:r,dispatch:i}=oZ();if(r===void 0)throw new Error("Must be wrapped in task render provider");const a=r.task_status,s=r.task_status,l=r.userTaskSubmitFormData,c=r.userTrainingSaveData,u=r.taskSchema,d=r.assessmentData,f=r.progressLoading,h=r.submitting,g=r.httpRequest,v=r.taskData,m=r.progressMaxValue,w=r.maxTabs,A=r.tabNoOfFieldsData,x=r.registerData,S=r.progressValue,T=r.noOfTotalElements,C=r.menuList,E=r.loading,_=r.submitting,M=r.success,O=r.success_message,F=(de=n==null?void 0:n.exam)!=null&&de.startQuiz?(ne=n==null?void 0:n.exam)==null?void 0:ne.startQuiz:()=>{},P=(q=n==null?void 0:n.exam)!=null&&q.AddUserAssessmentAnswer?(ee=n==null?void 0:n.exam)==null?void 0:ee.AddUserAssessmentAnswer:()=>{},H=(se=n==null?void 0:n.exam)!=null&&se.endQuiz?(ge=n==null?void 0:n.exam)==null?void 0:ge.endQuiz:()=>{},N=(De=n==null?void 0:n.exam)!=null&&De.examComplete?(Ne=n==null?void 0:n.exam)==null?void 0:Ne.examComplete:be=>{},z=n!=null&&n.updateTaskFormData?n==null?void 0:n.updateTaskFormData:(be,fe,Te,Ee,U,ve)=>{},$=n!=null&&n.submitTaskFormData?n==null?void 0:n.submitTaskFormData:(be,fe,Te)=>{},oe=k.useCallback(be=>i(WJ(be)),[i]),X=k.useCallback((be,fe,Te)=>{},[i]),R=k.useCallback(()=>ZJ()(i),[i]),le=k.useCallback((be,fe)=>JJ(be,fe)(i,r),[i]),Y=k.useCallback((be,fe)=>QJ(be,fe)(i,r),[i]),ie=k.useCallback(be=>{A_(be)(i)},[i]),re=k.useCallback(be=>{w_(be)(i)},[i]),Z=k.useCallback(be=>eZ(be)(i),[i]),K=k.useCallback(be=>y_(be)(i),[i]),W=k.useCallback(be=>iZ(be)(i),[i]),me=k.useCallback(be=>tZ(be)(i),[i]),Ae=k.useCallback((be,fe,Te)=>nZ(be,fe,Te)(i,r),[i]),Ie=k.useCallback((be,fe,Te)=>rZ(be,fe,Te)(i,r),[i]),ye=k.useCallback((be,fe,Te,Ee,U,ve)=>i(GJ(be,fe,Te,Ee,U,ve)),[i]);return{examComplete:N,taskOptions:n,TASK_PUBLISHED:6,TASK_PENDING:1,taskStatus:s,assessmentData:d,taskSchema:u,taskData:v,TasksList:C,TasksLoading:E,TasksSuccess:M,TasksSuccessMessage:O,taskProgressMaxValue:m,taskRegisterData:x,taskProgressValue:S,taskMaxTabs:w,noOfTotalElements:T,taskTabRequiredFieldsData:A,userTaskSubmitFormData:l,userTrainingSaveData:c,TasksSubmitLoading:_,updateTaskDataSchema:oe,submitTaskFormData:$,updateTaskFormData:z,TasksSubmit:h,TasksHTTPRequest:g,updateTaskRegisterData:re,updateTaskProgressValue:ie,updateTaskProgressMaxValue:W,updateUserFormDataSubmit:K,removeUserDataFormSectionRepeatableData:Y,addUserDataFormSectionRepeatableData:le,onSetValuetoRepeatableData:Ae,onSetValuetoPostDataHook:Ie,clearTaskSchema:R,taskProgressLoading:f,task_status:a,startQuiz:F,endQuiz:H,AddUserAssessmentAnswer:P,updateUserTraining:me,taskFieldUpdateHook:ye,updateProgressDataValuesHook:Z,saveProgressDataHook:X}};function xp(t){"@babel/helpers - typeof";return xp=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},xp(t)}function lZ(t,e){if(xp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(xp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cZ(t){var e=lZ(t,"string");return xp(e)=="symbol"?e:e+""}function uZ(t,e,n){return(e=cZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var dZ={root:function(e){var n=e.props;return ft("p-skeleton p-component",{"p-skeleton-circle":n.shape==="circle","p-skeleton-none":n.animation==="none"})}},fZ=`
1594
+ `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[JI]:{exposeProperties:{text:(t,e)=>y8(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function wJ(t,e){const n=A8[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new AJ(n);return r.loadDataTransfer(e),r}function w8(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(A8).filter(n=>{const r=A8[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const SJ=GI(()=>/firefox/i.test(navigator.userAgent)),t_=GI(()=>!!window.safari);class n_{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,c3s:s}=this;let l=n.length-1;if(e===n[l])return r[l];let c=0,u=s.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const g=n[d];if(g<e)c=d+1;else if(g>e)u=d-1;else return r[d]}l=Math.max(0,u);const f=e-n[l],h=f*f;return r[l]+i[l]*f+a[l]*h+s[l]*f*h}constructor(e,n){const{length:r}=e,i=[];for(let g=0;g<r;g++)i.push(g);i.sort((g,v)=>e[g]<e[v]?-1:1);const a=[],s=[];let l,c;for(let g=0;g<r-1;g++)l=e[g+1]-e[g],c=n[g+1]-n[g],a.push(l),s.push(c/l);const u=[s[0]];for(let g=0;g<a.length-1;g++){const v=s[g],m=s[g+1];if(v*m<=0)u.push(0);else{l=a[g];const w=a[g+1],A=l+w;u.push(3*A/((A+w)/v+(A+l)/m))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let g=0;g<u.length-1;g++){h=s[g];const v=u[g],m=1/a[g],w=v+u[g+1]-h-h;d.push((h-v-w)*m),f.push(w*m*m)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const CJ=1;function r_(t){const e=t.nodeType===CJ?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Qm(t){return{x:t.clientX,y:t.clientY}}function xJ(t){var e;return t.nodeName==="IMG"&&(SJ()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function TJ(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return t_()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function EJ(t,e,n,r,i){const a=xJ(e),l=r_(a?t:e),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:u,offsetHeight:d}=t,{anchorX:f,anchorY:h}=r,{dragPreviewWidth:g,dragPreviewHeight:v}=TJ(a,e,u,d),m=()=>{let E=new n_([0,.5,1],[c.y,c.y/d*v,c.y+v-d]).interpolate(h);return t_()&&a&&(E+=(window.devicePixelRatio-1)*v),E},w=()=>new n_([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(f),{offsetX:A,offsetY:x}=i,S=A===0||A,T=x===0||x;return{x:S?A:w(),y:T?x:m()}}class IJ{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function _J(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){_J(t,i,n[i])})}return t}class DJ{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return i_({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return i_({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(e_).some(n=>e_[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=wJ(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const a=this.sourceNodes.get(i);return a&&r_(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=Qm(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:l}=i,c=w8(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||f;if(h){const{anchorX:g,anchorY:v,offsetX:m,offsetY:w}=this.getCurrentSourcePreviewNodeOptions(),S=EJ(f,h,s,{anchorX:g,anchorY:v},{offsetX:m,offsetY:w});l.setDragImage(h,S.x,S.y)}}try{l==null||l.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:l}=i,c=w8(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:Qm(i)}),a.some(l=>this.monitor.canDropOnTarget(l))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Qm(i),this.scheduleHover(a),(a||[]).some(l=>this.monitor.canDropOnTarget(l))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else w8(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:Qm(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new IJ(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new yJ(this.isNodeInDocument)}}const Sp=function(e,n,r){return new DJ(e,n,r)},a_=k.createContext(void 0),s_=({children:t,option:e,saveFormBuilderSchema:n,templateSchema:r,onChange:i,isHTML5BackendDisabled:a=!1})=>{const{isPreview:s,isAdmin:l,isRenderView:c,isBuilderMode:u,renderType:d,isAdvanceView:f,globalAlignment:h="ltr",emitSocketData:g,media:v,exam:m={},reusableComponent:w,saveFormProgress:A,showSettings:x,training:S,fileUploadParams:T}=e,C={...i8,formType:d,...r},[E,_]=k.useReducer(vW,C);return k.useEffect(()=>{const M=It.debounce(()=>{n&&n(E)},1e3);return M(),()=>M.cancel()},[E,n]),o.jsx(a_.Provider,{value:{media:v,isBuilderMode:u,isPreview:s,isAdmin:l,isRenderView:c,renderType:d,isAdvanceView:f,globalAlignment:h,exam:m,emitSocketData:g,reusableComponent:w,state:E,dispatch:_,onChange:i,saveFormProgress:A,showSettings:x,training:S,fileUploadParams:T},children:a?o.jsx(o.Fragment,{children:t}):o.jsx(wp,{backend:Sp,children:t})})},o_=()=>k.useContext(a_),NJ=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},OJ=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],FJ=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],l_=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return NJ(t,u,c)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=n.slice(1),l=r[i];return r[i]={...l,children:l_(l.children,a,s)},r},c_=(t,e)=>{if(e.length===1){const s=Number(e[0]);return OJ(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:c_(a.children,i)},n},S8=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return FJ(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:S8(s.children,a,n)},r},kJ=(t,e,n)=>{let r=[...t],i=r[n[fa]].children[n[ha]].children[n[Ca]].children[n[xa]].children[n[Ta]].inlineConditionalRules.rules[n[Fa]].conditions[n[Xo]].children[n[wo]];return r[n[fa]].children[n[ha]].children[n[Ca]].children[n[xa]].children[n[Ta]].inlineConditionalRules.rules[n[Fa]].conditions[n[Xo]].children.splice([n[wo]],1),r[e[fa]].children[e[ha]].children[e[Ca]].children[e[xa]].children[e[Ta]].inlineConditionalRules.rules[e[Fa]].conditions[e[Xo]].children.splice(e[wo],0,i),r},PJ=(t,e,n)=>l_(t,e,n),MJ=t=>{const e=[...t],n={type:As,uuid:tt(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},u_=(t,e,n,r)=>{var h,g,v,m,w,A;let i;const a={...wc,uuid:tt(),children:[r]},s={...eu,uuid:tt()},l={...eu,uuid:tt(),children:[a]},c={...lf,uuid:tt(),children:[l]},u={...Hm,uuid:tt(),children:[c]};switch(e.length){case 1:{r.type===tx?i={...c,children:[r]}:i={...c,children:[s]};break}case 2:{r.type===na?i={...u,children:[c]}:i={...u,children:[c]};break}case 3:{r.type===Ao?i={...c,children:[l]}:i={...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[r]}]};break}case 4:{r.type===z1?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(A=(w=(m=(v=(g=(h=d[n[fa]])==null?void 0:h.children[n[ha]])==null?void 0:g.children[n[Ca]])==null?void 0:v.children[n[xa]])==null?void 0:m.children[n[Ta]])==null?void 0:w.inlineConditionalRules)==null||A.rules[n[Fa]].conditions[n[Xo]].children.splice(n[wo],1):d=c_(d,n),d=MJ(d),d=S8(d,e,i),d},LJ=(t,e,n)=>{let r;switch(e.length){case 1:{r={...Hm,uuid:tt(),children:[{...lf,uuid:tt(),children:[{...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[n]}]}]}]};break}case 2:{r={...lf,uuid:tt(),children:[{...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[n]}]}]};break}case 3:{r={...eu,uuid:tt(),children:[{...wc,uuid:tt(),children:[n]}]};break}case 4:{r={...wc,uuid:tt(),children:[n]};break}default:r=n}return S8(t,e,r)},sn=()=>{const{state:t,dispatch:e,onChange:n,saveFormProgress:r}=o_(),{updateGlobalToast:i,emitSocketData:a}=Ht();if(t===void 0)throw new Error("Must be wrapped in builder provider");const s=t.builderTemplateName,l=t.isChangesSaved,c=t.editing_by,u=t.version_name,d=t.loading,f=t.published_status,h=t,g=t,v=t.formType,m=t==null?void 0:t.userSelectedLanguage,w=t==null?void 0:t.languages,A=t.layout,x=k.useCallback(fe=>lW(fe)(e),[e]),S=k.useCallback(fe=>PG(fe)(e),[e]),T=k.useCallback(fe=>cW(fe)(e),[e]),C=k.useCallback((fe,Te)=>{var xt,ze,He,ot,rn,nn,Jt,In,At;const Ee=fe.path.split("-"),U=Ee.slice(0,-1).join("-"),ve={uuid:Te.uuid,type:Te.type,reviewerChecklist:[]},he=0,ue=1,pe=2,xe=3,ke=4,Be=5,Ye=6,rt=8,it=7,ht=5,jt=6,pn=8;if(Te.type===na&&(Te==null?void 0:Te.schema)!==void 0){H(JSON.parse(Te==null?void 0:Te.schema),parseInt(Ee[he]));return}if(((xt=Te==null?void 0:Te.schema)==null?void 0:xt.componentType)==="question"&&((nn=(rn=(ot=(He=(ze=A[0])==null?void 0:ze.children[0])==null?void 0:He.children[0])==null?void 0:ot.children[0])==null?void 0:rn.children)!=null&&nn.some(Ue=>{var st,Dt,qt;return((st=Ue==null?void 0:Ue.questionText)==null?void 0:st[m.type])===((qt=(Dt=Te==null?void 0:Te.schema)==null?void 0:Dt.questionText)==null?void 0:qt[m.type])}))&&((Jt=Te==null?void 0:Te.schema.questionText)==null?void 0:Jt.english)!=="Sample Question"){alert("not allow"),i({showToast:!0,toastMessage:"Exist",toastDetail:"Question text cannot be same for more than one element",toastType:"warn"});return}if(Te.type===tr){let Ue={type:z1,reviewerChecklist:[],...It.cloneDeep(Te.schema)};if(Ue!=null&&Ue.options&&(Ue={...Ue,options:[{uuid:tt(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:tt(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),Ue.componentType==="grid-component"&&(Ue={...Ue,children:[],options:[{uuid:tt(),custom_values:{}}]}),Ue.componentType==="radio-hierarchal"&&(Ue={...Ue,type:"radio",children:[],options:[{uuid:tt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:tt(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),Ue={...Ue,uuid:tt()},Ee.length===rt){se(parseInt(Ee[he]),parseInt(Ee[ue]),parseInt(Ee[pe]),parseInt(Ee[xe]),parseInt(Ee[ke]),parseInt(Ee[Be]),parseInt(Ee[Ye]),Ue),a();return}if(Ee.length===it){ge(parseInt(Ee[he]),parseInt(Ee[ue]),parseInt(Ee[pe]),parseInt(Ee[xe]),parseInt(Ee[ke]),parseInt(Ee[ht]),parseInt(Ee[jt]),Ue),a();return}if((At=(In=A[Ee[he]].children[Ee[ue]])==null?void 0:In.children[Ee[pe]])!=null&&At.rowIsRepeatable&&(Ue==null?void 0:Ue.componentType)==="editor"){i({showToast:!0,toastMessage:"Forbidden",toastDetail:"This Field cannot be applied in repeatable",toastType:"error"});return}T(LJ(A,Ee,Ue)),a(),Ee.length>1&&ye(Ee[he],Ee[ue],Ee[pe],Ue);return}const kt=Te.path.split("-"),mn=kt.slice(0,-1).join("-");if(kt.length===Ee.length){if(mn===U){if((kt==null?void 0:kt.length)===pn){T(kJ(A,Ee,kt));return}T(PJ(A,Ee,kt));return}const Ue={...ve,...Te};(Te==null?void 0:Te.id)===void 0&&(Ue.id=tt()),T(u_(A,Ee,kt,Ue));return}if((kt==null?void 0:kt.length)===8){const Ue={type:z1,reviewerChecklist:[],...Te};ge(parseInt(Ee[he]),parseInt(Ee[ue]),parseInt(Ee[pe]),parseInt(Ee[xe]),parseInt(Ee[ke]),parseInt(Ee[ht]),parseInt(Ee[jt]),Ue),q(kt[fa],kt[ha],kt[Ca],kt[xa],kt[Ta],kt[ht],kt[jt],kt[Bl]);return}const Rn={...ve,...Te};(Te==null?void 0:Te.id)===void 0&&(Rn.id=tt()),T(u_(A,Ee,kt,Rn))},[A,m.type]),E=k.useCallback(()=>mW()(e),[e]),_=k.useCallback(fe=>uW(fe)(e,t),[e]),M=k.useCallback(fe=>dW(fe)(e,t),[e]),O=k.useCallback(fe=>fW(fe)(e),[e]),F=k.useCallback(fe=>kG(fe)(e),[e]),P=k.useCallback(fe=>qG(fe)(e),[e]),H=k.useCallback((fe,Te)=>jG(fe,Te)(e),[e]),N=k.useCallback((fe,Te)=>XG(fe,Te)(e),[e]),z=k.useCallback((fe,Te,Ee)=>WG(fe,Te,Ee)(e),[e]),$=k.useCallback(fe=>BG(fe)(e),[e]),oe=k.useCallback((fe,Te)=>VG(fe,Te)(e),[e]),X=k.useCallback((fe,Te,Ee)=>KG(fe,Te,Ee)(e),[e]),R=k.useCallback((fe,Te,Ee,U)=>JG(fe,Te,Ee,U)(e),[e]),le=k.useCallback((fe,Te,Ee,U,ve)=>ZG(fe,Te,Ee,U,ve)(e,t),[e]),Y=k.useCallback((fe,Te,Ee,U,ve,he)=>eW(fe,Te,Ee,U,ve,he)(e,t),[e]),ie=k.useCallback((fe,Te,Ee)=>UG(fe,Te,Ee)(e),[e]),re=k.useCallback((fe,Te,Ee,U)=>YG(fe,Te,Ee,U)(e),[e]),Z=k.useCallback((fe,Te)=>LG(fe,Te)(e),[e]),K=k.useCallback((fe,Te,Ee,U,ve,he)=>tW(fe,Te,Ee,U,ve,he)(e),[e]),W=k.useCallback((fe,Te,Ee,U,ve)=>QG(fe,Te,Ee,U,ve)(e),[e]),me=k.useCallback((fe,Te,Ee,U)=>HG(fe,Te,Ee,U)(e),[e]),Ae=k.useCallback((fe,Te,Ee)=>$G(fe,Te,Ee)(e),[e]),Ie=k.useCallback((fe,Te)=>MG(fe,Te)(e,t),[e]),ye=k.useCallback((fe,Te,Ee,U)=>RG(fe,Te,Ee,U)(e),[e]),de=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe,xe)=>sW(fe,Te,Ee,U,ve,he,ue,pe,xe)(e),[e]),ne=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe,xe)=>iW(fe,Te,Ee,U,ve,he,ue,pe,xe)(e),[e]),q=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe)=>aW(fe,Te,Ee,U,ve,he,ue,pe)(e),[e]),ee=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe)=>oW(fe,Te,Ee,U,ve,he,ue,pe)(e),[e]),se=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe)=>nW(fe,Te,Ee,U,ve,he,ue,pe)(e),[e]),ge=k.useCallback((fe,Te,Ee,U,ve,he,ue,pe)=>rW(fe,Te,Ee,U,ve,he,ue,pe)(e),[e]),De=k.useCallback(fe=>hW(fe)(e),[e]),Ne=k.useCallback(fe=>pW(fe)(e),[e]),be=k.useCallback(fe=>gW(fe)(e),[e]);return{builderIsChangesSaved:l,builderTemplateName:s,formBuilderFormSchema:h,formBuilderFormLayout:A,formBuilderSchemaLanguages:w,saveFormTemplateNewVersion:g,userSelectedLanguage:m,formBuilderConfigurationType:v,formBuilderLoading:d,formBuilderPublishedStatus:f,builderEditingBy:c,builderVersionName:u,handleDrop:C,formatTableFieldsHook:S,saveFormBuilderSchema:x,removePage:$,removeSection:oe,removeRow:X,removeColumn:R,removeField:le,updateEditingBy:be,addTabs:F,addSection:P,addRow:N,addColumn:z,cloneField:K,cloneColumn:W,cloneRow:me,cloneSection:Ae,clonePage:Ie,sectionImport:H,setLayout:T,fieldSettingUpdate:Y,selectFormBuilderLanguage:_,unselectFormBuilderLanguage:M,updateUserFormSelectedLanguage:O,updateFormType:De,schemaBuilderUpdate:Ne,pageSettingUpdate:Z,saveFormProgress:r,sectionSettingUpdate:ie,rowSettingUpdate:re,clearBuilderSchema:E,addFieldToRowRepeaptable:ye,addFieldToInlineRuleCondtionFields:se,fieldSettingUpdateInlineConditional:de,fieldSettingDeleteInlineConditional:ee,addFieldToGridComponentHook:ge,gridComponentFieldSettingUpdate:ne,gridComponentFieldDelete:q}},Ht=()=>{var C,E,_;const{isPreview:t,isAdmin:e,isRenderView:n,renderType:r,isAdvanceView:i,isBuilderMode:a,media:s,exam:l,globalAlignment:c,reusableComponent:u,showSettings:d,training:f,fileUploadParams:h}=o_();if(t===void 0)throw new Error("Must be wrapped in builder provider");const g=r==null?void 0:r.key,{saveComponent:v,componentList:m,sectionsList:w}=u,A=()=>{},x=M=>{d!=null&&d.showToast&&(d==null||d.showToast(M))},S=((C=f==null?void 0:f.quiz)==null?void 0:C.quizList)||[],T=(E=f==null?void 0:f.quiz)!=null&&E.getQuizList?(_=f==null?void 0:f.quiz)==null?void 0:_.getQuizList:()=>{};return{quizlist:S,getQuizList:T,isPreview:t,isAdmin:e,isRenderView:n,renderType:g,isAdvanceView:i,isBuilderMode:a,globalAlignment:c,media:s,exam:l,saveComponent:v,componentList:m,sectionsList:w,fileUploadParams:h,emitSocketData:A,updateGlobalToast:x}},BJ="TASKS_LOADING",VJ="TASKS_ADD",qJ="TASKS_GET_PAGINATED_LIST",UJ="TASKS_DELETE",$J="TASKS_PAGNIATION_UPDATE",jJ="TASKS_UPDATE",zJ="TASKS_SUCCESS_GET",HJ="TASK_GET_TEMPLATE",YJ="TASK_SET_DATA",KJ="TASKS_FORM_SUBMIT",XJ="TASKS_FORM_HTTP_REQUEST",C8="TASK_SET_PROGRESS_VALUE",d_="TASK_SET_MAX_PROGRESS_VALUE",f_="TASK_SET_REGISTER_DATA",h_="TASK_SET_SCHEMA",x8="TASK_UPDATE_USER_FORM_SUBMIT_DATA",p_="CLEAR_TASK",g_="TASK_USER_SUBMIT_FORM_REPEATABLE_ADD",m_="TASK_USER_SUBMIT_FORM_REPEATABLE_REMOVE_INDEX",v_="TASK_USER_TRAINING_DATA",b_="TASK_FIELD_UPDATE",RJ=6,Jm=1,Cp="DISPLAY_TYPE_START_DETAILS",Zm="DISPLAY_TYPE_QUIZ",T8="DISPLAY_TYPE_START_TIMER";function GJ(t,e,n,r,i,a){return s=>{s({type:b_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}})}}function y_(t){return e=>{const n={type:x8,payLoad:{userTaskSubmitFormData:[...t]}};e(n)}}function WJ(t){return(e,n)=>{const{TasksReducer:r}=n(),{taskData:i}=r,a={type:x8,payLoad:{taskData:{...i,...t}}};e(a)}}function QJ(t,e){return(n,r)=>{const{userTaskSubmitFormData:i}=r,a=It.findIndex(i,function(l){return l.rowId===t});n({type:m_,payLoad:{userSubmitFormIndex:a,repeatableDataRowIndex:e}})}}function JJ(t,e){return(n,r)=>{const{userTaskSubmitFormData:i}=r,a=It.findIndex(i,function(l){return l.rowId===t});n({type:g_,payLoad:{userSubmitFormIndex:a,repeatableData:e}})}}function ZJ(){return t=>{t({type:p_,payLoad:null})}}const A_=t=>e=>{e({type:C8,payLoad:{progressValue:t}})},eZ=t=>e=>{e({type:C8,payLoad:t})},tZ=t=>e=>{e({type:v_,payLoad:{userTrainingSaveData:t}})},w_=t=>e=>{e({type:f_,payLoad:{registerData:t}})},nZ=(t,e,n)=>(r,i)=>{var u;const{userTaskSubmitFormData:a}=i,s=[...a],l=It.findIndex(s,function(d){var f;return d.rowId===((f=t==null?void 0:t.row)==null?void 0:f.uuid)});let c=(u=a[l])==null?void 0:u.repeatableFields;c={...c,[e==null?void 0:e.uuid]:`<div>${n}</div>`},s[l]={...s[l],repeatableFields:c},y_(s)(r)},rZ=(t,e,n)=>(r,i)=>{const{userTaskSubmitFormData:a,registerData:s}=i,l=a,c=It.cloneDeep(s);if(n&&(l==null?void 0:l.length)>0){c[e==null?void 0:e.uuid]=n;for(const d of l)d.fieldId===e.uuid&&(d.postData[0]={postValue:n})}else if((l==null?void 0:l.length)>0){for(const d of l)d.fieldId===e.uuid&&(d.postData[0]={postValue:""});delete c[e==null?void 0:e.uuid]}w_(c)(r);const u=Object.keys(c).length;A_(u)(r)},iZ=t=>e=>{e({type:d_,payLoad:{progressMaxValue:t}})},E8={submitting:!1,httpRequest:!1,taskData:null,taskUpdateLoading:!1,loading:!1,progressLoading:!1,list:[],filter:"",sort:"task.created_at|desc",total_records:0,page:1,per_page:10,success:!1,success_message:"",userTaskSubmitFormData:null,taskSchema:null,progressMaxValue:0,maxTabs:0,registerData:{},progressValue:0,tabNoOfFieldsData:[],noOfTotalElements:0,sortField:null,sortOrder:null,userTrainingSaveData:null,assessmentData:null,task_status:1},aZ=(t=E8,e)=>{var n,r;switch(e.type){case p_:return{...t,...E8,list:[...t.list],page:t.page,per_page:t.per_page,filter:t.filter,sort:t.sort,total_records:t.total_records};case zJ:return{...t,...e.payLoad};case x8:return{...t,...e.payLoad};case h_:return{...t,...e.payLoad};case C8:return{...t,...e.payLoad};case f_:return{...t,registerData:e.payLoad.registerData};case d_:return{...t,...e.payLoad};case BJ:return{...t,...e.payLoad};case KJ:return{...t,...e.payLoad};case XJ:return{...t,...e.payLoad};case VJ:{const{record:i}=e.payLoad;return{...t,list:[...i,...t.list]}}case qJ:return{...t,...e.payLoad};case YJ:return{...t,taskData:e.payLoad};case $J:return{...t,...e.payLoad};case UJ:{const i=t.list.filter(a=>a.task_id!==e.payLoad.task_id);return{...t,list:[...i]}}case v_:return{...t,...e.payLoad};case b_:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,field:u}=e.payLoad,d=[...t.taskSchema.layout];d[i].children[a].children[s].children[l].children[c]=u;const f={...t.taskSchema,layout:d};return{...t,taskSchema:f}}case g_:{console.log("TASK_USER_SUBMIT_FORM_REPEATABLE_ADD*******",e.payLoad);const{userSubmitFormIndex:i,repeatableData:a}=e.payLoad,s=t.userTaskSubmitFormData[i].repeatableFieldsData?(n=t.userTaskSubmitFormData[i])==null?void 0:n.repeatableFieldsData:[];return s.push(a),t.userTaskSubmitFormData[i].repeatableFieldsData=s,t}case m_:{const{userSubmitFormIndex:i,repeatableDataRowIndex:a}=e.payLoad,s=[...t.userTaskSubmitFormData],l=[...(r=s[i])==null?void 0:r.repeatableFieldsData];return l.splice(a,1),s[i]={...s[i],repeatableFieldsData:l},{...t,userTaskSubmitFormData:s}}case jJ:{const{row:i,eventIndex:a}=e.payLoad,s=t.list[a];return t.list[a]={...s,...i},t}case HJ:return{...t,...e.payLoad}}return t},S_=k.createContext(void 0),sZ=({option:t,taskOptions:e,saveFormBuilderSchema:n,templateSchema:r,taskValue:i,children:a,isHTML5BackendDisabled:s=!1})=>{const[l,c]=k.useReducer(aZ,{...E8,...i}),{progressMaxValue:u=0,progressValue:d=0,registerData:f=null,...h}=i||{};return k.useEffect(()=>{c({type:h_,payLoad:h})},[i]),o.jsx(S_.Provider,{value:{taskOptions:e,state:l,dispatch:c},children:o.jsx(s_,{isHTML5BackendDisabled:s,option:t,saveFormBuilderSchema:n,templateSchema:r,onChange:()=>{},children:a})})},oZ=()=>k.useContext(S_),Ar=()=>{var de,ne,q,ee,se,ge,De,Ne;const{taskOptions:n,state:r,dispatch:i}=oZ();if(r===void 0)throw new Error("Must be wrapped in task render provider");const a=r.task_status,s=r.task_status,l=r.userTaskSubmitFormData,c=r.userTrainingSaveData,u=r.taskSchema,d=r.assessmentData,f=r.progressLoading,h=r.submitting,g=r.httpRequest,v=r.taskData,m=r.progressMaxValue,w=r.maxTabs,A=r.tabNoOfFieldsData,x=r.registerData,S=r.progressValue,T=r.noOfTotalElements,C=r.menuList,E=r.loading,_=r.submitting,M=r.success,O=r.success_message,F=(de=n==null?void 0:n.exam)!=null&&de.startQuiz?(ne=n==null?void 0:n.exam)==null?void 0:ne.startQuiz:()=>{},P=(q=n==null?void 0:n.exam)!=null&&q.AddUserAssessmentAnswer?(ee=n==null?void 0:n.exam)==null?void 0:ee.AddUserAssessmentAnswer:()=>{},H=(se=n==null?void 0:n.exam)!=null&&se.endQuiz?(ge=n==null?void 0:n.exam)==null?void 0:ge.endQuiz:()=>{},N=(De=n==null?void 0:n.exam)!=null&&De.examComplete?(Ne=n==null?void 0:n.exam)==null?void 0:Ne.examComplete:be=>{},z=n!=null&&n.updateTaskFormData?n==null?void 0:n.updateTaskFormData:(be,fe,Te,Ee,U,ve)=>{},$=n!=null&&n.submitTaskFormData?n==null?void 0:n.submitTaskFormData:(be,fe,Te)=>{},oe=k.useCallback(be=>i(WJ(be)),[i]),X=k.useCallback((be,fe,Te)=>{},[i]),R=k.useCallback(()=>ZJ()(i),[i]),le=k.useCallback((be,fe)=>JJ(be,fe)(i,r),[i]),Y=k.useCallback((be,fe)=>QJ(be,fe)(i,r),[i]),ie=k.useCallback(be=>{A_(be)(i)},[i]),re=k.useCallback(be=>{w_(be)(i)},[i]),Z=k.useCallback(be=>eZ(be)(i),[i]),K=k.useCallback(be=>y_(be)(i),[i]),W=k.useCallback(be=>iZ(be)(i),[i]),me=k.useCallback(be=>tZ(be)(i),[i]),Ae=k.useCallback((be,fe,Te)=>nZ(be,fe,Te)(i,r),[i]),Ie=k.useCallback((be,fe,Te)=>rZ(be,fe,Te)(i,r),[i]),ye=k.useCallback((be,fe,Te,Ee,U,ve)=>i(GJ(be,fe,Te,Ee,U,ve)),[i]);return{examComplete:N,taskOptions:n,TASK_PUBLISHED:6,TASK_PENDING:1,taskStatus:s,assessmentData:d,taskSchema:u,taskData:v,TasksList:C,TasksLoading:E,TasksSuccess:M,TasksSuccessMessage:O,taskProgressMaxValue:m,taskRegisterData:x,taskProgressValue:S,taskMaxTabs:w,noOfTotalElements:T,taskTabRequiredFieldsData:A,userTaskSubmitFormData:l,userTrainingSaveData:c,TasksSubmitLoading:_,updateTaskDataSchema:oe,submitTaskFormData:$,updateTaskFormData:z,TasksSubmit:h,TasksHTTPRequest:g,updateTaskRegisterData:re,updateTaskProgressValue:ie,updateTaskProgressMaxValue:W,updateUserFormDataSubmit:K,removeUserDataFormSectionRepeatableData:Y,addUserDataFormSectionRepeatableData:le,onSetValuetoRepeatableData:Ae,onSetValuetoPostDataHook:Ie,clearTaskSchema:R,taskProgressLoading:f,task_status:a,startQuiz:F,endQuiz:H,AddUserAssessmentAnswer:P,updateUserTraining:me,taskFieldUpdateHook:ye,updateProgressDataValuesHook:Z,saveProgressDataHook:X}};function xp(t){"@babel/helpers - typeof";return xp=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},xp(t)}function lZ(t,e){if(xp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(xp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cZ(t){var e=lZ(t,"string");return xp(e)=="symbol"?e:e+""}function uZ(t,e,n){return(e=cZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var dZ={root:function(e){var n=e.props;return ft("p-skeleton p-component",{"p-skeleton-circle":n.shape==="circle","p-skeleton-none":n.animation==="none"})}},fZ=`
1595
1595
  @layer primereact {
1596
1596
  .p-skeleton {
1597
1597
  position: relative;
@@ -33684,6 +33684,7 @@ const bN = (t) => (e) => {
33684
33684
  assessmentData: null,
33685
33685
  task_status: 1
33686
33686
  }, tte = (t = S7, e) => {
33687
+ var n, r;
33687
33688
  switch (e.type) {
33688
33689
  case fN:
33689
33690
  return {
@@ -33715,8 +33716,8 @@ const bN = (t) => (e) => {
33715
33716
  case qee:
33716
33717
  return { ...t, ...e.payLoad };
33717
33718
  case Pee: {
33718
- const { record: n } = e.payLoad;
33719
- return { ...t, list: [...n, ...t.list] };
33719
+ const { record: i } = e.payLoad;
33720
+ return { ...t, list: [...i, ...t.list] };
33720
33721
  }
33721
33722
  case Mee:
33722
33723
  return { ...t, ...e.payLoad };
@@ -33725,10 +33726,10 @@ const bN = (t) => (e) => {
33725
33726
  case Lee:
33726
33727
  return { ...t, ...e.payLoad };
33727
33728
  case Ree: {
33728
- const n = t.list.filter(
33729
- (r) => r.task_id !== e.payLoad.task_id
33729
+ const i = t.list.filter(
33730
+ (a) => a.task_id !== e.payLoad.task_id
33730
33731
  );
33731
- return { ...t, list: [...n] };
33732
+ return { ...t, list: [...i] };
33732
33733
  }
33733
33734
  case mN:
33734
33735
  return {
@@ -33737,39 +33738,40 @@ const bN = (t) => (e) => {
33737
33738
  };
33738
33739
  case gN: {
33739
33740
  const {
33740
- pageIndex: n,
33741
- sectionIndex: r,
33742
- rowIndex: i,
33743
- columnIndex: a,
33744
- fieldIndex: s,
33745
- field: o
33746
- } = e.payLoad, l = [...t.taskSchema.layout];
33747
- l[n].children[r].children[i].children[a].children[s] = o;
33748
- const u = {
33741
+ pageIndex: i,
33742
+ sectionIndex: a,
33743
+ rowIndex: s,
33744
+ columnIndex: o,
33745
+ fieldIndex: l,
33746
+ field: u
33747
+ } = e.payLoad, d = [...t.taskSchema.layout];
33748
+ d[i].children[a].children[s].children[o].children[l] = u;
33749
+ const f = {
33749
33750
  ...t.taskSchema,
33750
- layout: l
33751
+ layout: d
33751
33752
  };
33752
33753
  return {
33753
33754
  ...t,
33754
- taskSchema: u
33755
+ taskSchema: f
33755
33756
  };
33756
33757
  }
33757
33758
  case hN: {
33758
- const { userSubmitFormIndex: n, repeatableData: r } = e.payLoad, i = t.userTaskSubmitFormData[n].repeatableFieldsData ? t.userTaskSubmitFormData[n].repeatableFieldsData : [];
33759
- return i.push(r), t.userTaskSubmitFormData[n].repeatableFieldsData = i, t;
33759
+ console.log("TASK_USER_SUBMIT_FORM_REPEATABLE_ADD*******", e.payLoad);
33760
+ const { userSubmitFormIndex: i, repeatableData: a } = e.payLoad, s = t.userTaskSubmitFormData[i].repeatableFieldsData ? (n = t.userTaskSubmitFormData[i]) == null ? void 0 : n.repeatableFieldsData : [];
33761
+ return s.push(a), t.userTaskSubmitFormData[i].repeatableFieldsData = s, t;
33760
33762
  }
33761
33763
  case pN: {
33762
- const { userSubmitFormIndex: n, repeatableDataRowIndex: r } = e.payLoad, i = [...t.userTaskSubmitFormData], a = [
33763
- ...i[n].repeatableFieldsData
33764
+ const { userSubmitFormIndex: i, repeatableDataRowIndex: a } = e.payLoad, s = [...t.userTaskSubmitFormData], o = [
33765
+ ...(r = s[i]) == null ? void 0 : r.repeatableFieldsData
33764
33766
  ];
33765
- return a.splice(r, 1), i[n] = {
33766
- ...i[n],
33767
- repeatableFieldsData: a
33768
- }, { ...t, userTaskSubmitFormData: i };
33767
+ return o.splice(a, 1), s[i] = {
33768
+ ...s[i],
33769
+ repeatableFieldsData: o
33770
+ }, { ...t, userTaskSubmitFormData: s };
33769
33771
  }
33770
33772
  case Vee: {
33771
- const { row: n, eventIndex: r } = e.payLoad, i = t.list[r];
33772
- return t.list[r] = { ...i, ...n }, t;
33773
+ const { row: i, eventIndex: a } = e.payLoad, s = t.list[a];
33774
+ return t.list[a] = { ...s, ...i }, t;
33773
33775
  }
33774
33776
  case $ee:
33775
33777
  return { ...t, ...e.payLoad };
@@ -60046,7 +60048,7 @@ var n0e = function() {
60046
60048
  theme: i.theme,
60047
60049
  formats: i.formats
60048
60050
  };
60049
- n0e ? C(new Quill(d.current, P)) : import("./quill-CVfPnpAT.js").then(function(z) {
60051
+ n0e ? C(new Quill(d.current, P)) : import("./quill-DZXb5Dtl.js").then(function(z) {
60050
60052
  if (z && we.isExist(d.current)) {
60051
60053
  var F;
60052
60054
  z.default ? F = new z.default(d.current, P) : F = new z(d.current, P), C(F);
@@ -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-d5BqYW7u.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-FC4vIcii.js";
5
5
  function Ki(n) {
6
6
  return n;
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cft-builder",
3
- "version": "0.2.266",
3
+ "version": "0.2.267",
4
4
  "type": "module",
5
5
  "types": "dist/types/index",
6
6
  "files": [