cft-builder 0.2.311 → 0.2.313

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-CiatLq_t.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-C6vCpGOY.js";
2
2
  export {
3
3
  s as BuilderItems,
4
4
  o as BuilderItemsRender,
@@ -3511,7 +3511,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3511
3511
  }
3512
3512
  }
3513
3513
  `,Ide={root:function(e){var n=e.props;return n.showClear&&!n.disabled&&{position:"relative"}},itemGroup:function(e){var n=e.scrollerOptions;return{height:n.props?n.props.itemSize:void 0}}},v2=Vn.extend({defaultProps:{__TYPE:"MultiSelect",appendTo:null,ariaLabelledBy:null,checkboxIcon:null,className:null,clearIcon:null,closeIcon:null,dataKey:null,disabled:!1,display:"comma",dropdownIcon:null,emptyFilterMessage:null,emptyMessage:null,filter:!1,filterBy:null,filterDelay:300,filterInputAutoFocus:!0,filterLocale:void 0,selectOnFocus:!1,focusOnHover:!0,autoOptionFocus:!1,filterMatchMode:"contains",filterPlaceholder:null,filterTemplate:null,fixedPlaceholder:!1,flex:!1,id:null,inline:!1,inputId:null,inputRef:null,invalid:!1,variant:null,itemCheckboxIcon:null,itemClassName:null,itemTemplate:null,loading:!1,loadingIcon:null,maxSelectedLabels:null,name:null,onBlur:null,onChange:null,onClick:null,onFilter:null,onFocus:null,onHide:null,onRemove:null,onSelectAll:null,onShow:null,optionDisabled:null,optionGroupChildren:null,optionGroupLabel:null,optionGroupTemplate:null,optionLabel:null,optionValue:null,options:null,overlayVisible:!1,panelClassName:null,panelFooterTemplate:null,panelHeaderTemplate:null,panelStyle:null,placeholder:null,removeIcon:null,resetFilterOnHide:!1,scrollHeight:"200px",selectAll:!1,selectAllLabel:null,selectedItemTemplate:null,selectedItemsLabel:void 0,selectionLimit:null,showClear:!1,showSelectAll:!0,style:null,tabIndex:0,tooltip:null,tooltipOptions:null,transitionOptions:null,useOptionAsValue:!1,value:null,virtualScrollerOptions:null,children:void 0},css:{classes:Tde,styles:Ede,inlineStyles:Ide}}),_de={box:"p-checkbox-box",input:"p-checkbox-input",icon:"p-checkbox-icon",root:function(e){var n=e.props,r=e.checked,i=e.context;return ft("p-checkbox p-component",{"p-highlight":r,"p-disabled":n.disabled,"p-invalid":n.invalid,"p-variant-filled":n.variant?n.variant==="filled":i&&i.inputStyle==="filled"})}},s4=Vn.extend({defaultProps:{__TYPE:"Checkbox",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,icon:null,id:null,inputId:null,inputRef:null,invalid:!1,variant:null,name:null,onChange:null,onContextMenu:null,onMouseDown:null,readOnly:!1,required:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,value:null,children:void 0},css:{classes:_de}});function PO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function MO(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var gb=b.memo(b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=s4.getProps(t,r),a=b.useState(!1),s=cd(a,2),l=s[0],c=s[1],u=s4.setMetaData({props:i,state:{focused:l},context:{checked:i.checked===i.trueValue,disabled:i.disabled}}),d=u.ptm,f=u.cx,h=u.isUnstyled;li(s4.css.styles,h,{name:"checkbox"});var g=b.useRef(null),v=b.useRef(i.inputRef),m=function(){return i.checked===i.trueValue},A=function(F){if(!(i.disabled||i.readOnly)&&i.onChange){var P,H=m(),N=H?i.falseValue:i.trueValue,z={originalEvent:F,value:i.value,checked:N,stopPropagation:function(){F==null||F.stopPropagation()},preventDefault:function(){F==null||F.preventDefault()},target:{type:"checkbox",name:i.name,id:i.id,value:i.value,checked:N}};if(i==null||(P=i.onChange)===null||P===void 0||P.call(i,z),F.defaultPrevented)return;xe.focus(v.current)}},w=function(F){var P;c(!0),i==null||(P=i.onFocus)===null||P===void 0||P.call(i,F)},C=function(F){var P;c(!1),i==null||(P=i.onBlur)===null||P===void 0||P.call(i,F)};b.useImperativeHandle(e,function(){return{props:i,focus:function(){return xe.focus(v.current)},getElement:function(){return g.current},getInput:function(){return v.current}}}),b.useEffect(function(){ke.combinedRefs(v,i.inputRef)},[v,i.inputRef]),fr(function(){v.current.checked=m()},[i.checked,i.trueValue]),Li(function(){i.autoFocus&&xe.focus(v.current,i.autoFocus)});var S=m(),T=ke.isNotEmpty(i.tooltip),x=s4.getOtherProps(i),E=n({id:i.id,className:ft(i.className,f("root",{checked:S,context:r})),style:i.style,"data-p-highlight":S,"data-p-disabled":i.disabled,onContextMenu:i.onContextMenu,onMouseDown:i.onMouseDown},x,d("root")),_=function(){var F=ke.reduceKeys(x,xe.ARIA_PROPS),P=n(MO({id:i.inputId,type:"checkbox",className:f("input"),name:i.name,tabIndex:i.tabIndex,onFocus:function(N){return w(N)},onBlur:function(N){return C(N)},onChange:function(N){return A(N)},disabled:i.disabled,readOnly:i.readOnly,required:i.required,"aria-invalid":i.invalid,checked:S},F),d("input"));return b.createElement("input",ks({ref:v},P))},M=function(){var F=n({className:f("icon")},d("icon")),P=n({className:f("box",{checked:S}),"data-p-highlight":S,"data-p-disabled":i.disabled},d("box")),H=S?i.icon||b.createElement(vc,F):null,N=nr.getJSXIcon(H,MO({},F),{props:i,checked:S});return b.createElement("div",P,N)};return b.createElement(b.Fragment,null,b.createElement("div",ks({ref:g},E),_(),M()),T&&b.createElement(cn,ks({target:g,content:i.tooltip,pt:d("tooltip")},i.tooltipOptions)))}));gb.displayName="Checkbox";function LO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function o4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?LO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):LO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var BO=b.memo(function(t){var e=Kn(),n=t.ptm,r=t.cx,i=t.isUnstyled,a={filter:function(P){return l(P)},reset:function(){return t.resetFilter()}},s=function(P,H){return n(P,o4({hostName:t.hostName},H))},l=function(P){t.onFilter&&t.onFilter({originalEvent:P,query:P.target.value})},c=function(P){if(t.onSelectAll)t.onSelectAll({originalEvent:P,checked:t.selectAll});else{var H=t.isAllSelected()?[]:t.visibleOptions.filter(function(N){return t.isValidOption(N)}).map(function(N){return t.getOptionValue(N)});t.updateModel(P,H,H)}},u=function(){var P=e({className:r("filterIcon")},s("filterIcon")),H=t.filterIcon||b.createElement(M6,P),N=nr.getJSXIcon(H,o4({},P),{props:t});if(t.filter){var z=e({className:r("filterContainer")},s("filterContainer")),U=b.createElement("div",z,b.createElement(wn,{ref:t.filterRef,type:"text",role:"searchbox",value:t.filterValue,onChange:l,className:"p-multiselect-filter",placeholder:t.filterPlaceholder,pt:n("filterInput"),unstyled:t.unstyled,__parentMetadata:{parent:t.metaData}}),N);if(t.filterTemplate){var ce={className:z.className,element:U,filterOptions:a,onFilter:l,filterIconClassName:t.filterIconClassName,props:t};U=ke.getJSXElement(t.filterTemplate,ce)}return b.createElement(b.Fragment,null,U)}return null},d=u(),f=t.id?t.id+"_selectall":So(),h=e({htmlFor:f,className:r("headerSelectAllLabel")},s("headerSelectAllLabel")),g=e({className:r("headerCheckboxIcon")},s("headerCheckbox.icon")),v=e({className:r("headerCheckboxContainer")},s("headerCheckboxContainer")),m=t.itemCheckboxIcon||b.createElement(vc,g),A=nr.getJSXIcon(m,o4({},g),{selected:t.selected}),w=t.showSelectAll&&b.createElement("div",v,b.createElement(gb,{id:f,checked:t.selectAll,onChange:c,role:"checkbox","aria-checked":t.selectAll,icon:A,pt:n("headerCheckbox"),unstyled:i()}),!t.filter&&b.createElement("label",h,t.selectAllLabel)),C=e({className:r("closeIcon"),"aria-hidden":!0},s("closeIcon")),S=t.closeIcon||b.createElement(mc,C),T=nr.getJSXIcon(S,o4({},C),{props:t}),x=e({className:r("header")},s("header")),E=e({type:"button",className:r("closeButton"),"aria-label":pa("close"),onClick:t.onClose},s("closeButton")),_=b.createElement("button",E,T,b.createElement(Qt,null)),M=b.createElement("div",x,w,d,_);if(t.template){var O={className:"p-multiselect-header",checkboxElement:w,checked:t.selectAll,onChange:c,filterElement:d,closeElement:_,closeElementClassName:"p-multiselect-close p-link",closeIconClassName:"p-multiselect-close-icon",onCloseClick:t.onClose,element:M,itemCheckboxIcon:A,props:t};return ke.getJSXElement(t.template,O)}return M});BO.displayName="MultiSelectHeader";function VO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Dde(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?VO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):VO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var qO=b.memo(function(t){var e=b.useState(!1),n=cd(e,2),r=n[0],i=n[1],a=b.useRef(null),s=Kn(),l=t.ptm,c=t.cx,u=t.isUnstyled,d=function(x){return l(x,{hostName:t.hostName,context:{selected:t.selected,disabled:t.disabled,focused:r,focusedIndex:t.focusedIndex,index:t.index}})},f=function(x){var E;i(!0),a==null||(E=a.current)===null||E===void 0||E.getInput().focus()},h=function(x){i(!1)},g=function(x){t.onClick&&t.onClick(x,t.option),x.preventDefault(),x.stopPropagation()},v=s({className:c("checkboxIcon")},d("checkbox.icon")),m=t.checkboxIcon||b.createElement(vc,v),A=t.selected?nr.getJSXIcon(m,Dde({},v),{selected:t.selected}):null,w=t.template?ke.getJSXElement(t.template,t.option):t.label,C=s({className:c("checkboxContainer")},d("checkboxContainer")),S=s({className:ft(t.className,t.option.className,c("item",{itemProps:t})),style:t.style,onClick:g,onFocus:f,onBlur:h,onMouseMove:function(x){return t==null?void 0:t.onMouseMove(x,t.index)},role:"option","aria-selected":t.selected,"data-p-highlight":t.selected,"data-p-disabled":t.disabled},d("item"));return b.createElement("li",ks({},S,{key:t.index+"_multiselectitem"}),b.createElement("div",C,b.createElement(gb,{ref:a,checked:t.selected,icon:A,pt:l("checkbox"),unstyled:u(),tabIndex:-1})),b.createElement("span",null,w),b.createElement(Qt,null))});qO.displayName="MultiSelectItem";function UO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function i1(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?UO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):UO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var $O=b.memo(b.forwardRef(function(t,e){var n=b.useRef(null),r=b.useRef(null),i=Kn(),a=b.useContext(ar),s=t.ptm,l=t.cx,c=t.sx,u=t.isUnstyled,d=function(F,P){return s(F,i1({hostName:t.hostName},P))},f=function(){t.onEnter(function(){if(n.current){var F=t.getSelectedOptionIndex();F!==-1&&setTimeout(function(){return n.current.scrollToIndex(F)},0)}})},h=function(){t.onEntered(function(){t.filter&&t.filterInputAutoFocus&&r.current&&xe.focus(r.current,!1)})},g=function(F){n.current&&n.current.scrollToIndex(0),t.onFilterInputChange&&t.onFilterInputChange(F)},v=function(){return!(t.visibleOptions&&t.visibleOptions.length)&&t.hasFilter},m=function(){return b.createElement(BO,{hostName:t.hostName,id:t.id,filter:t.filter,filterRef:r,filterValue:t.filterValue,filterTemplate:t.filterTemplate,visibleOptions:t.visibleOptions,isValidOption:t.isValidOption,getOptionValue:t.getOptionValue,updateModel:t.updateModel,onFilter:g,filterPlaceholder:t.filterPlaceholder,onClose:t.onCloseClick,showSelectAll:t.showSelectAll,selectAll:t.isAllSelected(),selectAllLabel:t.selectAllLabel,onSelectAll:t.onSelectAll,template:t.panelHeaderTemplate,resetFilter:t.resetFilter,closeIcon:t.closeIcon,filterIcon:t.filterIcon,itemCheckboxIcon:t.itemCheckboxIcon,ptm:s,cx:l,isUnstyled:u,metaData:t.metaData})},A=function(){if(t.panelFooterTemplate){var F=ke.getJSXElement(t.panelFooterTemplate,t,t.onOverlayHide);return b.createElement("div",{className:"p-multiselect-footer"},F)}return null},w=function(F,P){if(t.focusOnHover){var H;t==null||(H=t.changeFocusedOptionIndex)===null||H===void 0||H.call(t,F,P)}},C=function(){var F=ke.getJSXElement(t.emptyFilterMessage,t)||ni("emptyFilterMessage"),P=i({className:l("emptyMessage")},d("emptyMessage"));return b.createElement("li",ks({},P,{key:"emptyFilterMessage"}),F)},S=function(){var F=ke.getJSXElement(t.emptyMessage,t)||ni("emptyMessage"),P=i({className:l("emptyMessage")},d("emptyMessage"));return b.createElement("li",ks({},P,{key:"emptyMessage"}),F)},T=function(F,P){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N={height:H.props?H.props.itemSize:void 0},z=F.group===!0&&t.optionGroupLabel;if(z){var U=t.optionGroupTemplate?ke.getJSXElement(t.optionGroupTemplate,F,P):t.getOptionGroupLabel(F),ce=P+"_"+t.getOptionGroupRenderKey(F),X=i({className:l("itemGroup"),style:c("itemGroup",{scrollerOptions:H})},d("itemGroup"));return b.createElement("li",ks({key:ce},X),U)}var R=t.getOptionLabel(F),ue=P+"_"+t.getOptionRenderKey(F),Y=t.isOptionDisabled(F),ie=t.isSelected(F);return b.createElement(qO,{hostName:t.hostName,key:ue,focusedOptionIndex:t.focusedOptionIndex,label:R,option:F,style:N,index:P,template:t.itemTemplate,selected:ie,onClick:t.onOptionSelect,onMouseMove:w,disabled:Y,className:t.itemClassName,checkboxIcon:t.checkboxIcon,isUnstyled:u,ptm:s,cx:l})},x=function(){return ke.isNotEmpty(t.visibleOptions)?t.visibleOptions.map(T):t.hasFilter?C():S()},E=function(){if(t.virtualScrollerOptions){var F=i1(i1({},t.virtualScrollerOptions),{style:i1(i1({},t.virtualScrollerOptions.style),{height:t.scrollHeight}),className:ft("p-multiselect-items-wrapper",t.virtualScrollerOptions.className),items:t.visibleOptions,autoSize:!0,onLazyLoad:function(U){return t.virtualScrollerOptions.onLazyLoad(i1(i1({},U),{filter:t.filterValue}))},itemTemplate:function(U,ce){return U&&T(U,ce.index,ce)},contentTemplate:function(U){var ce=v()?C():U.children,X=i({ref:U.contentRef,style:U.style,className:ft(U.className,l("list",{virtualScrollerProps:t.virtualScrollerOptions})),role:"listbox","aria-multiselectable":!0},d("list"));return b.createElement("ul",X,ce)}});return b.createElement(Om,ks({ref:n},F,{pt:s("virtualScroller"),__parentMetadata:{parent:t.metaData}}))}var P=x(),H=i({className:l("wrapper"),style:{maxHeight:t.scrollHeight}},d("wrapper")),N=i({className:l("list"),role:"listbox","aria-multiselectable":!0},d("list"));return b.createElement("div",H,b.createElement("ul",N,P))},_=function(){var F=t.allowOptionSelect(),P=m(),H=E(),N=A(),z=i({className:ft(t.panelClassName,l("panel",{panelProps:t,context:a,allowOptionSelect:F})),style:t.panelStyle,onClick:t.onClick},d("panel"));if(t.inline)return b.createElement("div",ks({ref:e},z),H,N);var U=i({classNames:l("transition"),in:t.in,timeout:{enter:120,exit:100},options:t.transitionOptions,appear:!0,unmountOnExit:!0,onEnter:f,onEntered:h,onExit:t.onExit,onExited:t.onExited},d("transition")),ce=i({ref:t.firstHiddenFocusableElementOnOverlay,role:"presentation",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:t.onFirstHiddenFocus,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},s("hiddenFirstFocusableEl")),X=i({ref:t.lastHiddenFocusableElementOnOverlay,role:"presentation",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:t.onLastHiddenFocus,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},s("hiddenLastFocusableEl"));return b.createElement(Ro,ks({nodeRef:e},U),b.createElement("div",ks({ref:e},z),b.createElement("span",ce),P,H,N,b.createElement("span",X)))},M=_();return t.inline?M:b.createElement(Vl,{element:M,appendTo:t.appendTo})}));$O.displayName="MultiSelectPanel";function jO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function bl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jO(Object(n),!0).forEach(function(r){_f(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zO(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Nde(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3514
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,a=u},f:function(){try{s||n.return==null||n.return()}finally{if(l)throw a}}}}function Nde(t,e){if(t){if(typeof t=="string")return HO(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HO(t,e):void 0}}function HO(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var YO=b.memo(b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=v2.getProps(t,r),a=b.useState(null),s=cd(a,2),l=s[0],c=s[1],u=b.useState(!1),d=cd(u,2),f=d[0],h=d[1],g=jx("",i.filterDelay||0),v=cd(g,3),m=v[0],A=v[1],w=v[2],C=b.useState(-1),S=cd(C,2),T=S[0],x=S[1],E=b.useState(!1),_=cd(E,2),M=_[0],O=_[1],F=b.useState(i.inline),P=cd(F,2),H=P[0],N=P[1],z=b.useRef(null),U=b.useRef(null),ce=b.useRef(null),X=b.useRef(null),R=b.useRef(null),ue=b.useRef(i.inputRef),Y=b.useRef(null),ie=b.useRef(null),re=b.useRef(null),Z=A&&A.trim().length>0,K=ke.isEmpty(i.value),W=i.optionValue?null:i.dataKey,ge={props:i,state:{filterState:A,focused:M,overlayVisible:H}},ye=v2.setMetaData(ge),Ee=ye.ptm,Ae=ye.cx,fe=ye.sx,ne=ye.isUnstyled;li(v2.css.styles,ne,{name:"multiselect"});var q=ep({target:z,overlay:ie,listener:function(Ye,Et){var Wt=Et.type,Jn=Et.valid;Jn&&(Wt==="outside"?!Ke(Ye)&&!st(Ye)&&ot():r.hideOverlaysOnDocumentScrolling?ot():xe.isDocument(Ye.target)||wt())},when:H}),ee=cd(q,2),oe=ee[0],he=ee[1],De=function(Ye){var Et=Ye.relatedTarget===ue.current?xe.getFirstFocusableElement(ie.current,':not([data-p-hidden-focusable="true"])'):ue.current;xe.focus(Et)},Ne=function(Ye){var Et=Ye.relatedTarget===ue.current?xe.getLastFocusableElement(ie.current,':not([data-p-hidden-focusable="true"])'):ue.current;xe.focus(Et)},ve=function(Ye){ws.emit("overlay-click",{originalEvent:Ye,target:z.current})},Se=function(){return!i.selectionLimit||!i.value||i.value&&i.value.length<i.selectionLimit},Be=function(Ye){var Et=Xt()&&Ye<er.length-1?er.slice(Ye+1).findIndex(function(Wt){return zn(Wt)}):-1;return Et>-1?Et+Ye+1:-1},Te=function(Ye){var Et=Xt()&&Ye>0?ke.findLastIndex(er.slice(0,Ye),function(Wt){return zn(Wt)}):-1;return Et>-1?Et:-1},$=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=-1;return Xt()&&(Et?(Wt=Te(Ye),Wt=Wt===-1?Be(Ye):Wt):(Wt=Be(Ye),Wt=Wt===-1?Te(Ye):Wt)),Wt>-1?Wt:Ye},pe=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,Wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(Et===-1&&(Et=$(Wt,!0)),Wt===-1&&(Wt=$(Et)),Et!==-1&&Wt!==-1){var Jn=Math.min(Et,Wt),br=Math.max(Et,Wt),Pr=er.slice(Jn,br+1).filter(function(oa){return Ln(oa)}).map(function(oa){return Nt(oa)});mn(Ye,Pr,Pr)}},me=function(Ye,Et){var Wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(!(i.disabled||Qe(Et))){var Jn=Wn(Et),br=null;Jn?br=i.value.filter(function(Pr){return!ke.equals(Pr,Nt(Et),W)}):br=[].concat(Ade(i.value||[]),[Nt(Et)]),mn(Ye,br,Et),Wt!==-1&&c(Wt)}},ae=function(Ye){!i.inline&&!i.disabled&&!i.loading&&!vt(Ye)&&!Ke(Ye)&&(H?ot():He(),xe.focus(ue.current),Ye.preventDefault()),h(!0)},le=function(Ye){if(!H)He(),i.editable&&kn(Ye,at());else{var Et=l!==-1?xt(l):f?We():se();Ye.shiftKey&&pe(Ye,T,Et),kn(Ye,Et)}Ye.preventDefault()},be=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ye.altKey&&!Et)l!==-1&&me(Ye,er[l]),H&&ot(),Ye.preventDefault();else{var Wt=l!==-1?Rt(l):f?dt():Me();kn(Ye,Wt),!H&&He(),Ye.preventDefault()}},Ie=function(Ye){H?l!==-1&&(Ye.shiftKey?pe(Ye,l):me(Ye,er[l])):(c(-1),le(Ye)),Ye.preventDefault()},Pe=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=Ye.currentTarget;if(Et){var Jn=Wt.value.length;Wt.setSelectionRange(0,Ye.shiftKey?Jn:0),c(-1)}else{var br=Ye.metaKey||Ye.ctrlKey,Pr=We();Ye.shiftKey&&br&&pe(Ye,Pr,T),kn(Ye,Pr),!H&&He()}Ye.preventDefault()},ze=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=Ye.currentTarget;if(Et){var Jn=Wt.value.length;Wt.setSelectionRange(Ye.shiftKey?0:Jn,Jn),wde("focusedOptionIndex")}else{var br=Ye.metaKey||Ye.ctrlKey,Pr=dt();Ye.shiftKey&&br&&pe(Ye,T,Pr),kn(Ye,Pr),!H&&He()}Ye.preventDefault()},Ze=function(Ye){Ye.preventDefault()},nt=function(Ye){Ye.preventDefault()},ht=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Et||(H&&Zt()?(xe.focus(Ye.shiftKey?R.current:X.current),Ye.preventDefault()):(l!==-1&&me(Ye,er[l]),H&&ot(filter)))},Ut=function(){x(l)},fn=function(Ye){var Et=Ye.metaKey||Ye.ctrlKey;switch(Ye.code){case"ArrowUp":if(i.inline)break;be(Ye);break;case"ArrowDown":if(i.inline)break;le(Ye);break;case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;Ie(Ye);break;case"Home":if(i.inline)break;Pe(Ye),Ye.preventDefault();break;case"End":if(i.inline)break;ze(Ye),Ye.preventDefault();break;case"PageDown":nt(Ye);break;case"PageUp":Ze(Ye);break;case"Escape":if(i.inline)break;ot();break;case"Tab":ht(Ye);break;case"ShiftLeft":case"ShiftRight":Ut();break;default:if(Ye.key==="a"&&Et){var Wt=er.filter(function(Jn){return Ln(Jn)}).map(function(Jn){return Nt(Jn)});mn(Ye,Wt,Wt),Ye.preventDefault();break}!Et&&ke.isPrintableCharacter(Ye.key)&&(!H&&He(),Dn(Ye),Ye.preventDefault());break}h(!1)},$t=function(Ye){if(i.onSelectAll)i.onSelectAll(Ye);else{var Et=null;if(Ye.checked)Et=[];else{var Wt=er.filter(function(Jn){return Ln(Jn)&&!Qe(Jn)});Wt&&(Et=Wt.map(function(Jn){return Nt(Jn)}))}i.selectionLimit&&Et&&Et.length&&(Et=Et.slice(0,i.selectionLimit)),mn(Ye.originalEvent,Et,Et)}},mn=function(Ye,Et,Wt){i.onChange&&(i.onChange({originalEvent:Ye,value:Et,selectedOption:Wt,stopPropagation:function(){Ye==null||Ye.stopPropagation()},preventDefault:function(){Ye==null||Ye.preventDefault()},target:{name:i.name,id:i.id,value:Et}}),xe.focus(ue.current))},En=function(Ye){var Et=Ye.query;w(Et),i.onFilter&&i.onFilter({originalEvent:Ye,filter:Et})},Tt=function(){w(""),i.onFilter&&i.onFilter({filter:""})},je=function(Ye){if(H){var Et;Ye?Et=Ye.currentTarget:Et=xe.findSingle(ie.current,'li[data-p-highlight="true"]'),Et&&Et.scrollIntoView&&Et.scrollIntoView({block:"nearest",inline:"nearest"})}},He=function(){N(!0),c(l!==-1?l:i.autoOptionFocus?se():at()),xe.focus(ue.current)},ot=function(){c(-1),N(!1),h(!1)},rn=function(Ye){Di.set("overlay",ie.current,r&&r.autoZIndex||Yn.autoZIndex,r&&r.zIndex.overlay||Yn.zIndex.overlay),xe.addStyles(ie.current,{position:"absolute",top:"0",left:"0"}),wt(),je(),Ye&&Ye()},nn=function(Ye){Ye&&Ye(),oe(),i.onShow&&i.onShow()},Jt=function(){he()},_n=function(){i.filter&&i.resetFilterOnHide&&Tt(),Di.clear(ie.current),i.onHide&&i.onHide()},wt=function(){!i.inline&&xe.alignOverlay(ie.current,Y.current.parentElement,i.appendTo||r&&r.appendTo||Yn.appendTo)},Ke=function(Ye){return xe.getAttribute(Ye.target,"data-pc-section")==="clearicon"},st=function(Ye){return xe.getAttribute(Ye.target,"data-pc-section")==="headercheckboxcontainer"},vt=function(Ye){return ie.current&&ie.current.contains(Ye.target)},Vt=function(Ye){ot(),xe.focus(ue.current),Ye.preventDefault(),Ye.stopPropagation()},On=function(){if(i.value!=null&&i.options){if(i.optionGroupLabel){var Ye=0,Et=i.options.findIndex(function(Wt,Jn){return(Ye=Jn)&&$n(i.value,Fe(Wt))!==-1});return Et!==-1?{group:Ye,option:Et}:-1}return $n(i.value,i.options)}return-1},$n=function(Ye,Et){return Et.findIndex(function(Wt){return Ye.some(function(Jn){return ke.equals(Jn,Nt(Wt),W)})})},lr=function(Ye,Et){return ke.equals(Ye,Et,W)},Wn=function(Ye){if(i.value){var Et=Nt(Ye),Wt=At(Ye);return i.value.some(function(Jn){return ke.equals(Wt?Jn:Nt(Jn),Et,W)})}return!1},vr=function(Ye){var Et;if(i.options)if(i.optionGroupLabel){var Wt=zO(i.options),Jn;try{for(Wt.s();!(Jn=Wt.n()).done;){var br=Jn.value;if(Et=Nr(Ye,Fe(br)),Et)break}}catch(Pr){Wt.e(Pr)}finally{Wt.f()}}else Et=Nr(Ye,i.options),ke.isEmpty(Et)&&(Et=Nr(Ye,i.value));return Et?yt(Et):null},Nr=function(Ye,Et){return Et.find(function(Wt){return ke.equals(Nt(Wt),Ye,W)})},yn=function(Ye){O(!0),i.onFocus&&i.onFocus(Ye)},lt=function(Ye){O(!1),i.onBlur&&i.onBlur(Ye)},ut=function(){if(i.onSelectAll)return i.selectAll;if(ke.isEmpty(er))return!1;var Ye=er.filter(function(Et){return!Qe(Et)&&Ln(Et)});return!Ye.some(function(Et){return!Wn(Et)})},yt=function(Ye){return i.optionLabel?ke.resolveFieldData(Ye,i.optionLabel):Ye&&Ye.label!==void 0?Ye.label:Ye},Nt=function(Ye){return i.useOptionAsValue?Ye:i.optionValue?ke.resolveFieldData(Ye,i.optionValue):Ye&&Ye.value!==void 0?Ye.value:Ye},An=function(Ye){return i.dataKey?ke.resolveFieldData(Ye,i.dataKey):yt(Ye)},Nn=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupLabel)},It=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupLabel)},Fe=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupChildren)},Qe=function(Ye){var Et;if(!Se()&&!Wn(Ye))return!0;var Wt=i.optionDisabled;return Wt?ke.isFunction(Wt)?Wt(Ye):ke.resolveFieldData(Ye,Wt):Ye&&((Et=Ye.disabled)!==null&&Et!==void 0?Et:!1)},At=function(Ye){return!i.useOptionAsValue&&i.optionValue||Ye&&Ye.value!==void 0},jt=function(Ye){return i.optionGroupLabel&&Ye.group},Xt=function(){return ke.isNotEmpty(i.value)},Zt=function(){return xe.getFocusableElements(ie.current,':not([data-p-hidden-focusable="true"])').length>0},Sn=function(Ye){var Et;return Ln(Ye)&&((Et=yt(Ye))===null||Et===void 0?void 0:Et.toLocaleLowerCase(i.filterLocale).startsWith(U.current.toLocaleLowerCase(i.filterLocale)))},Ln=function(Ye){return ke.isNotEmpty(Ye)&&!(Qe(Ye)||jt(Ye))},zn=function(Ye){return Ln(Ye)&&Wn(Ye)},at=function(){if(Xt()){for(var Ye=function(){var br=i.value[Wt],Pr=er.findIndex(function(oa){return zn(oa)&&lr(br,Nt(oa))});if(Pr>-1)return{v:Pr}},Et,Wt=i.value.length-1;Wt>=0;Wt--)if(Et=Ye(),Et)return Et.v}return-1},se=function(){var Ye=at();return Ye<0?We():Ye},Me=function(){var Ye=at();return Ye<0?dt():Ye},We=function(){return er.findIndex(function(Ye){return Ln(Ye)})},dt=function(){return ke.findLastIndex(er,function(Ye){return Ln(Ye)})},xt=function(Ye){var Et=Ye<er.length-1?er.slice(Ye+1).findIndex(function(Wt){return Ln(Wt)}):-1;return Et>-1?Et+Ye+1:Ye},Rt=function(Ye){var Et=Ye>0?ke.findLastIndex(er.slice(0,Ye),function(Wt){return Ln(Wt)}):-1;return Et>-1?Et:Ye},Dn=function(Ye){U.current=(U.current||"")+Ye.key;var Et=-1;ke.isNotEmpty(U.current)&&(l!==-1?(Et=er.slice(l).findIndex(function(Wt){return Sn(Wt)}),Et=Et===-1?er.slice(0,l).findIndex(function(Wt){return Sn(Wt)}):Et+l):Et=er.findIndex(function(Wt){return Sn(Wt)}),Et===-1&&l===-1&&(Et=se()),Et!==-1&&kn(Ye,Et)),ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){U.current="",ce.current=null},500)},kn=function(Ye,Et){l!==Et&&(c(Et),je(Ye),i.selectOnFocus&&me(Ye,er[Et],!1))},Hn=function(Ye,Et){if(Ye.stopPropagation(),!!Mr(Ye.currentTarget)){var Wt=i.value.filter(function(Jn){return!ke.equals(Jn,Et,W)});i.onRemove&&i.onRemove({originalEvent:Ye,value:Wt}),mn(Ye,Wt,Et)}},Mr=function(Ye){var Et=re.current,Wt=Et.clientWidth<Et.scrollWidth;if(!Wt)return!0;var Jn=Ye.closest('[data-pc-section="token"]'),br=window.getComputedStyle(Et),Pr=window.getComputedStyle(Jn),oa=Et.clientWidth-parseFloat(br.paddingLeft)-parseFloat(br.paddingRight),da=Jn.getBoundingClientRect().right+parseFloat(Pr.marginRight)-Et.getBoundingClientRect().left;return da<=oa},Kr=function(){var Ye=/{(.*?)}/,Et=i.selectedItemsLabel||ni("selectionMessage"),Wt=i.value?i.value.length:0;return Ye.test(Et)?Et.replace(Et.match(Ye)[0],Wt+""):Et},qn=function(){var Ye;if(!K&&!i.fixedPlaceholder){var Et;return ke.isNotEmpty(i.maxSelectedLabels)&&((Et=i.value)===null||Et===void 0?void 0:Et.length)>i.maxSelectedLabels?Kr():ke.isArray(i.value)?i.value.reduce(function(Wt,Jn,br){return Wt+(br!==0?", ":"")+vr(Jn)},""):""}return Ye},Fn=function(){var Ye=i.value?i.value.length:0;if(ke.isNotEmpty(i.maxSelectedLabels)&&Ye>i.maxSelectedLabels)return Kr();if(i.selectedItemTemplate)return K?ke.getJSXElement(i.selectedItemTemplate):i.value.map(function(Wt,Jn){var br=ke.getJSXElement(i.selectedItemTemplate,Wt);return b.createElement(b.Fragment,{key:Jn},br)});if(i.display==="chip"&&!K){var Et=i.value.slice(0,i.maxSelectedLabels||Ye);return Et.map(function(Wt,Jn){var br={context:{value:Wt,index:Jn}},Pr=vr(Wt),oa=Pr+"_"+Jn,da=n({"aria-label":ni("removeTokenIcon"),className:Ae("removeTokenIcon"),onClick:function(te){return Hn(te,Wt)},onKeyDown:function(te){return ai(te,Wt)},tabIndex:i.tabIndex||"0"},Ee("removeTokenIcon",br)),Vs=!i.disabled&&(i.removeIcon?nr.getJSXIcon(i.removeIcon,bl({},da),{props:i}):b.createElement(hb,da)),mo=n({className:Ae("token")},Ee("token",br)),Xr=n({className:Ae("tokenLabel")},Ee("tokenLabel",br));return b.createElement("div",ks({},mo,{key:oa}),b.createElement("span",Xr,Pr),Vs)})}return qn()},sr=function(){var Ye=i.optionGroupLabel?Lr(i.options):i.options;if(Z){var Et=A.trim().toLocaleLowerCase(i.filterLocale),Wt=i.filterBy?i.filterBy.split(","):[i.optionLabel||"label"];if(i.optionGroupLabel){var Jn=[],br=zO(i.options),Pr;try{for(br.s();!(Pr=br.n()).done;){var oa=Pr.value,da=P0.filter(Fe(oa),Wt,Et,i.filterMatchMode,i.filterLocale);da&&da.length&&Jn.push(bl(bl({},oa),_f({},i.optionGroupChildren,da)))}}catch(Vs){br.e(Vs)}finally{br.f()}return Lr(Jn)}return P0.filter(Ye,Wt,Et,i.filterMatchMode,i.filterLocale)}return Ye},Lr=function(Ye){return(Ye||[]).reduce(function(Et,Wt,Jn){Et.push(bl(bl({},Wt),{},{group:!0,index:Jn}));var br=Fe(Wt);return br&&br.forEach(function(Pr){return Et.push(Pr)}),Et},[])},pi=function(Ye){switch(Ye.code){case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;mn(Ye,[],[]),Ye.preventDefault(),Ye.stopPropagation();break}},ai=function(Ye,Et){switch(Ye.code){case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;Hn(Ye,Et),Ye.preventDefault(),Ye.stopPropagation();break}};b.useImperativeHandle(e,function(){return{props:i,show:He,hide:ot,focus:function(){return xe.focus(ue.current)},getElement:function(){return z.current},getOverlay:function(){return ie.current},getInput:function(){return ue.current}}}),Li(function(){wt()}),b.useEffect(function(){ke.combinedRefs(ue,i.inputRef)},[ue,i.inputRef]),b.useEffect(function(){i.overlayVisible===!0?He():i.overlayVisible===!1&&ot()},[i.overlayVisible]),fr(function(){H&&A&&Z&&wt()},[H,A,Z]),ja(function(){Di.clear(ie.current)});var ui=function(){var Ye=n({className:Ae("clearIcon"),"aria-label":ni("clear"),onClick:function(br){return mn(br,[],[])},onKeyDown:function(br){return pi(br)},tabIndex:i.tabIndex||"0"},Ee("clearIcon")),Et=i.clearIcon||b.createElement(mc,Ye),Wt=nr.getJSXIcon(Et,bl({},Ye),{props:i});return!K&&i.showClear&&!i.disabled?Wt:null},Pi=function(){var Ye=Fn(),Et=n({ref:Y,className:Ae("labelContainer")},Ee("labelContainer")),Wt=n({ref:re,className:Ae("label",{empty:K})},Ee("label"));return b.createElement("div",Et,b.createElement("div",Wt,Ye||i.placeholder||i.emptyMessage||"empty"))},er=sr(),Ui=ke.isNotEmpty(i.tooltip),Ti=v2.getOtherProps(i),Si=ke.reduceKeys(Ti,xe.ARIA_PROPS),Hi=n({className:Ae("triggerIcon")},Ee("triggerIcon")),hn=n({className:Ae("trigger")},Ee("trigger")),Ue=i.loadingIcon?nr.getJSXIcon(i.loadingIcon,bl({},Hi),{props:i}):b.createElement(R1,ks({spin:!0},Hi)),Kt=i.dropdownIcon?nr.getJSXIcon(i.dropdownIcon,bl({},Hi),{props:i}):b.createElement(Yd,Hi),jn=b.createElement("div",hn,i.loading?Ue:Kt),jr=!i.inline&&Pi(),kr=!i.inline&&ui(),Ka=n(bl(bl({ref:z,id:i.id,style:bl(bl({},i.style),fe("root")),className:ft(i.className,Ae("root",{focusedState:M,context:r,overlayVisibleState:H}))},Ti),{},{onClick:ae}),v2.getOtherProps(i),Ee("root")),Vr=n({className:"p-hidden-accessible","data-p-hidden-accessible":!0},Ee("hiddenInputWrapper")),Es=n(bl({ref:ue,id:i.inputId,name:i.name,type:"text",onFocus:yn,onBlur:lt,onKeyDown:fn,role:"combobox","aria-expanded":H,disabled:i.disabled,tabIndex:i.disabled?-1:i.tabIndex,value:qn()},Si),Ee("input"));return b.createElement(b.Fragment,null,b.createElement("div",Ka,b.createElement("div",Vr,b.createElement("input",ks({},Es,{readOnly:!0}))),!i.inline&&b.createElement(b.Fragment,null,jr,kr,jn),b.createElement($O,ks({hostName:"MultiSelect",ref:ie,visibleOptions:er},i,{onClick:ve,onOverlayHide:ot,filterValue:m,focusedOptionIndex:l,onFirstHiddenFocus:De,onLastHiddenFocus:Ne,firstHiddenFocusableElementOnOverlay:X,lastHiddenFocusableElementOnOverlay:R,setFocusedOptionIndex:c,hasFilter:Z,isValidOption:Ln,getOptionValue:Nt,updateModel:mn,onFilterInputChange:En,resetFilter:Tt,onCloseClick:Vt,onSelectAll:$t,getOptionLabel:yt,getOptionRenderKey:An,isOptionDisabled:Qe,getOptionGroupChildren:Fe,getOptionGroupLabel:It,getOptionGroupRenderKey:Nn,isSelected:Wn,getSelectedOptionIndex:On,isAllSelected:ut,onOptionSelect:me,allowOptionSelect:Se,in:H,onEnter:rn,onEntered:nn,onExit:Jt,onExited:_n,ptm:Ee,cx:Ae,sx:fe,isUnstyled:ne,metaData:ge,changeFocusedOptionIndex:kn}))),Ui&&b.createElement(cn,ks({target:z,content:i.tooltip,pt:Ee("tooltip")},i.tooltipOptions)))}));YO.displayName="MultiSelect";const Ode=t=>{var Ee,Ae,fe,ne,q,ee,oe,he,De,Ne;const{field:e,fieldIndex:n,row:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isBuilderMode:u,isAdmin:d}=Ht(),[f,h]=k.useState([]),[g,v]=k.useState(!1),[m,A]=k.useState(!1),{userSelectedLanguage:w,formBuilderFormLayout:C,sectionSettingUpdate:S,pageSettingUpdate:T,fieldSettingUpdate:x}=sn(),{taskRegisterData:E,updateTaskRegisterData:_,updateTaskProgressValue:M,userTaskSubmitFormData:O,updateUserFormDataSubmit:F,task_status:P,TASK_PUBLISHED:H}=Ar(),[N,z]=k.useState(0),[U,ce]=k.useState(!1),X=()=>{ce(!0)},R=()=>{ce(!1)},ue=ve=>{A(ve)},Y=()=>{A(!1)},ie=ve=>{h(ve.value),r!=null&&r.rowIsRepeatable?W(i,a,e,ve.value):K(ve.value)},re=ve=>{e==null||e.conditionalTabRules.rules.map(Se=>{var Be;(Be=Se==null?void 0:Se.conditions)==null||Be.map(Te=>{var $;if(($=ve.value)!=null&&$.some(pe=>pe===Te.option)){const pe=_t.findIndex(C,ae=>{var le;return ae.uuid===((le=Te==null?void 0:Te.tab)==null?void 0:le.uuid)}),me=C[pe];me.isHidden=!1,T(pe,me)}else{const pe=_t.findIndex(C,ae=>{var le;return ae.uuid===((le=Te==null?void 0:Te.tab)==null?void 0:le.uuid)}),me=C[pe];me.isHidden=!0,T(pe,me)}})})},Z=ve=>{e==null||e.conditionalSectionRules.rules.map(Se=>{var Be;(Be=Se==null?void 0:Se.conditions)==null||Be.map(Te=>{var $;if(($=ve.value)!=null&&$.some(pe=>pe===Te.option)){const pe=_t.findIndex(C,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.tab)==null?void 0:be.uuid)}),me=_t.findIndex(C[pe].children,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.section)==null?void 0:be.uuid)}),ae=C[pe].children[me];ae.isHidden=!1,S(pe,me,ae)}else{const pe=_t.findIndex(C,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.tab)==null?void 0:be.uuid)}),me=_t.findIndex(C[pe].children,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.section)==null?void 0:be.uuid)}),ae=C[pe].children[me];ae.isHidden=!0,S(pe,me,ae)}})})},K=ve=>{const Se=O,Be=_t.cloneDeep(E);if((ve==null?void 0:ve.length)>0&&(Se==null?void 0:Se.length)>0){Be[e==null?void 0:e.uuid]=ve;for(const Te of Se)Te.fieldId===t.field.uuid&&(Te.postData[0]={postValue:ve})}else if(delete Be[e==null?void 0:e.uuid],(Se==null?void 0:Se.length)>0)for(const Te of Se)Te.fieldId===t.field.uuid&&(Te.postData[0]={postValue:[]});if(!(r!=null&&r.rowIsRepeatable)){_(Be);const Te=Object.keys(Be).length;M(Te)}},W=(ve,Se,Be,Te)=>{var $;if(h(Te),O){const pe=[...O],me=_t.findIndex(pe,function(be){return be.rowId===(r==null?void 0:r.uuid)});let ae=($=O[me])==null?void 0:$.repeatableFields,le="<ol class='card '>";Te==null||Te.map(be=>{le=le+`<li>${be}</li>`}),le=le+"</ol>",ae={...ae,[Be==null?void 0:Be.uuid]:le},pe[me]={...pe[me],repeatableFields:ae},F(pe)}(Te==null?void 0:Te.length)>0?Be.isValid=1:Be.isValid=0,x(ve,Se,s,l,n,Be)},ge=()=>{var ve,Se,Be;if(r!=null&&r.rowIsRepeatable){if(r!=null&&r.repeatableFields){const Te=[...r.repeatableFields],$=_t.findIndex(Te,function(pe){return pe.uuid===(e==null?void 0:e.uuid)});$>=0&&Te[$].fieldData?h(pe=>[...pe,Te[$].fieldData]):(e.isValid=0,h([]))}}else{const Te=O,$=_t.cloneDeep(E);if(Te!=null&&Te.length){for(const pe of Te)if(pe.fieldId===t.field.uuid&&((ve=pe==null?void 0:pe.postData)!=null&&ve.length)){h((Se=pe==null?void 0:pe.postData[0])==null?void 0:Se.postValue),$[e==null?void 0:e.uuid]=(Be=pe==null?void 0:pe.postData[0])==null?void 0:Be.postValue;const me=Object.keys($).length;M(me);break}}}v(!0)};k.useEffect(()=>{!g&&(O==null?void 0:O.length)>0&&ge();const ve=Gt.addListener("onSubmitUserForm",()=>{var Te;(Te=e==null?void 0:e.attributes)!=null&&Te.required?(f==null?void 0:f.length)>0?e.isValid=1:e.isValid=0:e.isValid=1}),Se=Gt.addListener("clearRepeatableFields",Te=>{Te===(r==null?void 0:r.uuid)&&(h([]),z(0),e.isValid=0)}),Be=Gt.addListener("OnInvalidFieldCatch",Te=>{e.uuid===(Te==null?void 0:Te.fieldId)?z(1):z(0)});return()=>{ve.remove(),Be.remove(),Se.remove()}});const ye=o.jsxs("div",{onMouseOver:X,onMouseOut:R,children:[u&&U&&o.jsx(Wr,{handleFieldSettingsSidebar:ue,...t}),o.jsxs("div",{className:`field ${u&&" py-3 px-4 builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:u?"col-12 p-fluid field-form-builder":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Ee=e==null?void 0:e.headerText)==null?void 0:Ee[w==null?void 0:w.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(fe=e==null?void 0:e.label)==null?void 0:fe[w==null?void 0:w.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{message:(ne=e==null?void 0:e.toolTip)==null?void 0:ne[w==null?void 0:w.type],position:"right"})})]}),o.jsx(YO,{onFocus:()=>z(1),value:f,onChange:ve=>{ie(ve),re(ve),Z(ve)},options:e==null?void 0:e.options,optionLabel:`optionText.${w.type}`,placeholder:(q=e==null?void 0:e.placeholder)==null?void 0:q[w==null?void 0:w.type],display:"chip",disabled:d||c}),((ee=e==null?void 0:e.attributes)==null?void 0:ee.required)&&o.jsx("small",{className:"error",children:N===1&&!((f==null?void 0:f.length)>0)?(oe=e==null?void 0:e.validationMesssage)==null?void 0:oe.english:""})]}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(he=e==null?void 0:e.helperText)==null?void 0:he[w==null?void 0:w.type]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]}),((De=e==null?void 0:e.inlineConditionalRules)==null?void 0:De.rules.length)>0&&u===!0&&o.jsx("p",{children:"Inline conditional rules"}),(Ne=e==null?void 0:e.inlineConditionalRules)==null?void 0:Ne.rules.map((ve,Se)=>u===!1?o.jsx("div",{children:ve==null?void 0:ve.conditions.map((Be,Te)=>{if(f!=null&&f.some($=>$===Be.value)||u)return o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(cb,{data:e,ruleIndex:Se,conditionIndex:Te,condition:Be,...t})})},Te)})},`rule-${Se}`):o.jsx(ci,{className:"mt-4",header:`Rule ${Se+1}`,children:o.jsx("div",{children:ve==null?void 0:ve.conditions.map((Be,Te)=>{if(f!=null&&f.some($=>$===Be.value)||u)return o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(cb,{data:e,...t,ruleIndex:Se,conditionIndex:Te,condition:Be})})},Te)})},`rule-${Se}`)},Se))]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Qi,{visibilty:m,closeSettingFieldSidebar:Y,...t},e==null?void 0:e.uuid),o.jsx(xi,{...t,fieldWrap:ye})]})},Fde=t=>{const{options:e,title:n}=t,r=e.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",i=`${e.className} justify-content-start`,a=`${e.titleClassName} pl-1`;return o.jsxs("div",{className:i,children:[o.jsxs("button",{className:e.togglerClassName,onClick:e.onTogglerClick,children:[o.jsx("span",{className:r}),o.jsx(Qt,{})]}),o.jsx("span",{className:a,children:n})]})},KO=t=>{const e=k.useRef(null),{optionIndex:n,option:r,field:i,fieldIndex:a,pageIndex:s,sectionIndex:l,rowIndex:c,columnIndex:u,path:d}=t,{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),[m,A]=k.useState(r==null?void 0:r.optionText[f==null?void 0:f.type]);k.useEffect(()=>(A(r==null?void 0:r.optionText[f==null?void 0:f.type]),()=>{}),[i]),k.useEffect(()=>{const S=setTimeout(()=>{C("optionText",r.uuid,m,f)},1500);return()=>{clearTimeout(S)}},[m]);const w=S=>{const T=d.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(T[fa],T[ha],T[Ca],T[xa],T[Ta],T[Fa],T[Xo],T[wo],S):(T==null?void 0:T.length)>Fa&&(T==null?void 0:T.length)===Bl+1&&(i!=null&&i.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(T[fa],T[ha],T[Ca],T[xa],T[Ta],T[5],T[6],T[7],S):h(s,l,c,u,a,{...S})},C=(S,T,x,E)=>{if(i!=null&&i.options){const _=[...i.options];_[n][S][E==null?void 0:E.type]=x,w({...i,options:_})}};return o.jsx(o.Fragment,{children:o.jsx(N3,{id:r==null?void 0:r.uuid,style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:m||"",disabled:!1,onChange:S=>{A(S.target.value)},tagName:"article"},r==null?void 0:r.uuid)})},XO=t=>{const{optionId:e,field:n,fieldIndex:r,columnIndex:i,sectionIndex:a,rowIndex:s,pageIndex:l,path:c}=t,{fieldSettingUpdate:u,fieldSettingUpdateInlineConditional:d,gridComponentFieldSettingUpdate:f}=sn(),h=m=>{const A=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?d(A[fa],A[ha],A[Ca],A[xa],A[Ta],A[Fa],A[Xo],A[wo],m):(A==null?void 0:A.length)>Fa&&(A==null?void 0:A.length)===Bl+1&&(m!=null&&m.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?f(A[fa],A[ha],A[Ca],A[xa],A[Ta],A[5],A[6],A[7],m):u(l,a,s,i,r,m)},g=()=>{const m=n==null?void 0:n.options.filter(function(w){return(w==null?void 0:w.uuid)!==e}),A={...n,options:m};h(A)},v=()=>{const m=_t.cloneDeep(n),A={...m,options:[...m.options,{uuid:rt(),optionText:{english:"Unititled"},value:rt(),score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]};h(A)};return o.jsxs(o.Fragment,{children:[o.jsx(Ft,{text:!0,label:"Add",className:"w-5rem ml-3 mr-3",onClick:()=>v(),size:"small"}),o.jsx(Ft,{text:!0,className:"w-3rem",size:"small",onClick:()=>{g()},icon:"pi pi-trash"})]})},kde=t=>{var Ne,ve,Se,Be,Te,$,pe,me,ae;const[e,n]=k.useState([]),[r,i]=k.useState(0),{taskRegisterData:a,updateTaskRegisterData:s,updateTaskProgressValue:l,userTaskSubmitFormData:c,task_status:u,updateUserFormDataSubmit:d,taskFieldUpdateHook:f,TASK_PUBLISHED:h,updateProgressDataValuesHook:g}=Ar(),{globalAlignment:v,isBuilderMode:m,isRenderView:A,isAdmin:w}=Ht(),{sectionSettingUpdate:C,userSelectedLanguage:S,fieldSettingUpdate:T,formBuilderFormLayout:x,pageSettingUpdate:E}=sn(),{field:_,fieldIndex:M,sectionIndex:O,pageIndex:F,row:P,rowIndex:H,columnIndex:N,section:z,page:U,isDisabled:ce}=t,[X,R]=k.useState(!1),[ue,Y]=k.useState(!1),[ie,re]=k.useState(!1),Z=()=>{re(!0)},K=()=>{re(!1)},W=le=>{R(le)},ge=()=>{R(!1)},ye=le=>{const be=[...e];le.checked?be.push(le.value):be.splice(be.indexOf(le.value),1),n(be),P!=null&&P.rowIsRepeatable?c&&oe(F,O,_,be):(Ee(le),fe(be),c&&(q(be),(be==null?void 0:be.length)>0?_.isValid=1:_.isValid=0,f(F,O,H,N,M,_)))},Ee=le=>{var Ie;const be=(Ie=le==null?void 0:le.value)==null?void 0:Ie.value;_==null||_.conditionalTabRules.rules.map(Pe=>{var ze;(ze=Pe==null?void 0:Pe.conditions)==null||ze.map(Ze=>{if(be===(Ze==null?void 0:Ze.option)&&(le!=null&&le.checked)){const nt=_t.findIndex(x,Ut=>{var fn;return Ut.uuid===((fn=Ze==null?void 0:Ze.tab)==null?void 0:fn.uuid)}),ht=x[nt];ht.isHidden=!1,E(nt,ht)}else if(be===(Ze==null?void 0:Ze.option)&&!(le!=null&&le.checked)){const nt=_t.findIndex(x,Ut=>{var fn;return Ut.uuid===((fn=Ze==null?void 0:Ze.tab)==null?void 0:fn.uuid)}),ht=x[nt];ht.isHidden=!0,E(nt,ht)}})})},Ae=k.useCallback((le,be)=>{var Ie;if((c==null?void 0:c.length)>0){const Pe=c;if(Pe!=null&&Pe.length){const ze=a;for(const[nt,ht]of be.children.entries())for(const[,Ut]of ht.children.entries())for(const[fn,$t]of Ut.children.entries())if(ht!=null&&ht.rowIsRepeatable){if((ht==null?void 0:ht.rowIsRepeatable)===!0){const mn=_t.findIndex(Pe,function(En){return En.rowId===ht.uuid});le===!0?mn===-1&&(Pe.push({postData:[],tabId:U.uuid,rowId:ht==null?void 0:ht.uuid,tabIndex:F,sectionId:z.uuid,minimumEntries:z==null?void 0:z.minimumEntries,sectionIndex:O,sectionHeading:z.heading,subHeadingText:z.subHeadingText,repeatableFields:{},repeatableFieldsData:[],language:"english",isHiddenSection:z.isHidden&&z.isHidden===1?1:0,reviewerChecklist:ht==null?void 0:ht.reviewerChecklist}),ze[ht==null?void 0:ht.uuid]&&delete ze[ht==null?void 0:ht.uuid]):(ze[ht==null?void 0:ht.uuid]&&delete ze[ht==null?void 0:ht.uuid],mn>=0&&Pe.splice(mn,1))}}else{const mn=_t.findIndex(Pe,function(En){return En.fieldId===$t.uuid});le?mn===-1&&(Pe.push({postData:[],tabId:U.uuid,tabIndex:F,...$t.inlineConditionalRules?{inlineConditionalRules:$t.inlineConditionalRules}:{},...$t.conditionalTabRules?{conditionalTabRules:$t.conditionalTabRules}:{},...$t.conditionalSectionRules?{conditionalSectionRules:$t.conditionalSectionRules}:{},sectionId:z.uuid,sectionIndex:O,sectionHeading:z.heading,subHeadingText:z.subHeadingText,reviewerChecklist:$t==null?void 0:$t.reviewerChecklist,rowId:ht.uuid,rowIndex:nt,columnId:z.uuid,columnIndex:N,inlineConditionalField:!0,fieldIndex:fn,fieldId:$t.uuid,fieldInputType:$t.componentType,fieldTitle:(Ie=$t.label)==null?void 0:Ie.english,fieldDescription:$t.description||null,fieldHelperText:$t.helperText||null,fieldHeaderText:$t.headerText||null,fieldFooterText:$t.footerText||null,fieldTitleAbb:$t.abbreviationLabel||$t.label,question_abb_table:$t.textForTable||null,language:"english",isHiddenfield:$t.isHidden&&$t.isHidden===1?1:0,isHiddenSection:z.isHidden&&z.isHidden===1?1:0}),ze[$t==null?void 0:$t.uuid]&&delete ze[$t==null?void 0:$t.uuid]):(ze[$t==null?void 0:$t.uuid]&&delete ze[$t==null?void 0:$t.uuid],mn>=0&&Pe.splice(mn,1))}const Ze=Object.keys(ze).length;g({progressMaxValue:Pe==null?void 0:Pe.length,progressValue:Ze}),d([...Pe])}}},[N,_==null?void 0:_.abbreviationLabel,_==null?void 0:_.componentType,_==null?void 0:_.conditionalSectionRules,_==null?void 0:_.conditionalTabRules,_==null?void 0:_.description,_==null?void 0:_.footerText,_==null?void 0:_.headerText,_==null?void 0:_.helperText,_==null?void 0:_.inlineConditionalRules,_==null?void 0:_.isHidden,_==null?void 0:_.label,_==null?void 0:_.reviewerChecklist,_==null?void 0:_.textForTable,U==null?void 0:U.uuid,F,P==null?void 0:P.uuid,H,z==null?void 0:z.heading,z==null?void 0:z.isHidden,z==null?void 0:z.subHeadingText,z==null?void 0:z.uuid,O,a,g,d,c]),fe=le=>{_==null||_.conditionalSectionRules.rules.map(be=>{var Ie;(Ie=be==null?void 0:be.conditions)==null||Ie.map(Pe=>{if(le!=null&&le.some(ze=>ze.value===Pe.option)){const ze=_t.findIndex(x,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.tab)==null?void 0:Ut.uuid)}),Ze=_t.findIndex(x[ze].children,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.section)==null?void 0:Ut.uuid)}),nt=x[ze].children[Ze];nt.isHidden=!1,Ae(!0,x[ze].children[Ze]),C(ze,Ze,nt)}else{const ze=_t.findIndex(x,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.tab)==null?void 0:Ut.uuid)}),Ze=_t.findIndex(x[ze].children,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.section)==null?void 0:Ut.uuid)}),nt=x[ze].children[Ze];nt.isHidden=!0,Ae(!1,x[ze].children[Ze]),C(ze,Ze,nt)}})})},ne=()=>{var be,Ie,Pe,ze;const le=c;if((le==null?void 0:le.length)>0){for(const Ze of le)if(Ze.fieldId===t.field.uuid){n(((be=Ze==null?void 0:Ze.postData[0])==null?void 0:be.postValue.length)>0?(Ie=Ze==null?void 0:Ze.postData[0])==null?void 0:Ie.postValue:[]);const nt=((Pe=Ze==null?void 0:Ze.postData[0])==null?void 0:Pe.postValue.length)>0?(ze=Ze==null?void 0:Ze.postData[0])==null?void 0:ze.postValue:[];_==null||_.conditionalTabRules.rules.map(ht=>{var Ut;(Ut=ht==null?void 0:ht.conditions)==null||Ut.map(fn=>{if(nt.some($t=>$t.value===(fn==null?void 0:fn.option))){const $t=_t.findIndex(x,En=>{var Tt;return En.uuid===((Tt=fn==null?void 0:fn.tab)==null?void 0:Tt.uuid)}),mn=x[$t];mn.isHidden=!1,E($t,mn)}})}),Y(!0);break}}},q=le=>{const be=c,Ie=_t.cloneDeep(a);if((le==null?void 0:le.length)>0&&(be==null?void 0:be.length)>0){Ie[_==null?void 0:_.uuid]=le;for(const ze of be)ze.fieldId===t.field.uuid&&(ze.postData[0]={postValue:le});s(Ie);const Pe=Object.keys(Ie).length;l(Pe)}else{if(delete Ie[_==null?void 0:_.uuid],(be==null?void 0:be.length)>0)for(const ze of be)ze.fieldId===t.field.uuid&&(ze.postData[0]={postValue:[]});s(Ie);const Pe=Object.keys(Ie).length;l(Pe)}},ee=()=>{const le=[];return _==null||_.options.map((be,Ie)=>{var ze,Ze,nt,ht;const Pe=e;le.push(o.jsxs("div",{className:`field ${m&&" py-3 px-4 builder-element-wrapper "}${(_==null?void 0:_.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"flex align-items-center gap-2",children:[o.jsx(Yr,{id:`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`,onFocus:()=>i(1),disabled:w||ce,onChange:Ut=>{ye(Ut)},value:be,checked:Pe==null?void 0:Pe.some(Ut=>Ut.uuid===be.uuid)}),((ze=be==null?void 0:be.hyperlinkText)==null?void 0:ze[S==null?void 0:S.type])===""?o.jsxs("label",{htmlFor:`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`,children:[_!=null&&_.showAlphabetList?o.jsxs("span",{className:"mx-2",children:[" ",_O(Ie)," "]}):o.jsx(o.Fragment,{}),m?o.jsx(o.Fragment,{children:o.jsx(KO,{...t,option:be,optionIndex:Ie})}):o.jsx(o.Fragment,{children:(Ze=be==null?void 0:be.optionText)==null?void 0:Ze[S==null?void 0:S.type]})]}):o.jsx("label",{children:o.jsx("a",{href:(nt=be==null?void 0:be.hyperlinkText)==null?void 0:nt[S==null?void 0:S.type],target:"_blank",rel:"noreferrer",children:(ht=be==null?void 0:be.optionText)==null?void 0:ht[S==null?void 0:S.type]})})]}),m&&o.jsx("div",{className:"builder-radio-option-settings",children:o.jsx(XO,{optionId:be==null?void 0:be.uuid,...t})})]},`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`))}),le};k.useEffect(()=>{ue||ne();const le=Gt.addListener("clearRepeatableFields",Pe=>{Pe===(P==null?void 0:P.uuid)&&(n([]),i(0),_.isValid=0,T(F,O,H,N,M,_))}),be=Gt.addListener("onSubmitUserForm",()=>{var ze;const Pe=e;(ze=_==null?void 0:_.attributes)!=null&&ze.required?(Pe.length>0?_.isValid=1:_.isValid=0,f(F,O,H,N,M,_)):_.isValid=1}),Ie=Gt.addListener("OnInvalidFieldCatch",Pe=>{_.uuid===(Pe==null?void 0:Pe.fieldId)?i(1):i(0)});return()=>{be.remove(),Ie.remove(),le.remove()}});const oe=(le,be,Ie,Pe)=>{var Ut;n(Pe);const ze=[...c],Ze=_t.findIndex(ze,function(fn){return fn.rowId===(P==null?void 0:P.uuid)});let nt=(Ut=c[Ze])==null?void 0:Ut.repeatableFields,ht="<ol class='card '>";Pe==null||Pe.map(fn=>{ht=ht+`<li>${fn.value}</li>`}),ht=ht+"</ol>",nt={...nt,[Ie==null?void 0:Ie.uuid]:ht},ze[Ze]={...ze[Ze],repeatableFields:nt},d(ze),(Pe==null?void 0:Pe.length)>0?Ie.isValid=1:Ie.isValid=0,T(le,be,H,N,Ze,Ie)},he=o.jsxs("div",{onMouseOver:Z,onMouseOut:K,children:[m&&ie&&o.jsx(Wr,{handleFieldSettingsSidebar:W,...t}),o.jsx("div",{className:`field ${m&&" py-3 px-4 builder-element-wrapper "}${(_==null?void 0:_.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-12",children:[(_==null?void 0:_.showHeaderText)&&o.jsx("h6",{children:(Ne=_==null?void 0:_.headerText)==null?void 0:Ne[S==null?void 0:S.type]}),(_==null?void 0:_.showLabel)&&o.jsxs("label",{htmlFor:`${M}`,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((ve=_==null?void 0:_.attributes)==null?void 0:ve.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",m?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(Se=_==null?void 0:_.label)==null?void 0:Se[S==null?void 0:S.type]}),o.jsx("span",{className:"ml-3",children:(_==null?void 0:_.showToolTip)&&o.jsx(zi,{message:(Be=_==null?void 0:_.toolTip)==null?void 0:Be[S==null?void 0:S.type],position:"right"})})]}),ee(),o.jsx("div",{children:((Te=_==null?void 0:_.attributes)==null?void 0:Te.required)&&o.jsx("small",{className:"error",children:r===1&&!(e&&(e==null?void 0:e.length)>0)?($=_==null?void 0:_.validationMesssage)==null?void 0:$.language:""})}),o.jsx("div",{children:(_==null?void 0:_.showHelperText)&&o.jsx("small",{children:(pe=_==null?void 0:_.helperText)==null?void 0:pe[S==null?void 0:S.type]})}),((me=_==null?void 0:_.inlineConditionalRules)==null?void 0:me.rules.length)>0&&m===!0&&o.jsx("p",{children:"Inline conditional rules"}),(ae=_==null?void 0:_.inlineConditionalRules)==null?void 0:ae.rules.map((le,be)=>{if(m===!1){const Ie=e;return o.jsx("div",{children:le==null?void 0:le.conditions.map((Pe,ze)=>o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:Ie==null?void 0:Ie.some(Ze=>Ze.value===Pe.value),inputValue:e,condition:Pe,ruleIndex:be,conditionIndex:ze,field:_,section:z,page:U,row:P,pageIndex:F,sectionIndex:O,rowIndex:H,columnIndex:N,...t})},`select-rule-${be}-`+ze))},`rule-${be}`)}else return o.jsx(ci,{className:"mt-4",header:`Rule ${be+1}`,children:o.jsx("div",{children:le==null?void 0:le.conditions.map((Ie,Pe)=>o.jsx(k.Fragment,{children:o.jsxs("div",{className:"card",children:[o.jsx(fu,{style:{marginTop:-20},className:"mr-2",severity:"success",value:`Condition: ${Ie==null?void 0:Ie.value}`,rounded:!0}),o.jsx(e0,{isConditionTrue:(e==null?void 0:e.some(ze=>ze.value===Ie.value))||m,inputValue:e,condition:Ie,ruleIndex:be,conditionIndex:Pe,field:_,section:z,page:U,row:P,pageIndex:F,sectionIndex:O,rowIndex:H,columnIndex:N,...t})]})},`select-rule-${be}-`+Pe))},`rule-${be}`)},be)})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]}),De=()=>{let le="";return m&&(le=le+" field-form-builder"),u===h&&w===!0&&(le=le+" card"),le};return o.jsxs(o.Fragment,{children:[X===!0&&o.jsx(Qi,{visibilty:X,closeSettingFieldSidebar:ge,...t},_==null?void 0:_.uuid),o.jsx("div",{className:De(),dir:v,children:u===h&&w===!0?o.jsx(ci,{headerTemplate:le=>{var be;return o.jsx(Fde,{options:le,title:(be=_==null?void 0:_.label)==null?void 0:be[S==null?void 0:S.type]})},toggleable:!0,children:he}):he})]})},Pde=6,Mde=t=>{var ne,q,ee,oe,he,De,Ne,ve,Se,Be,Te;const{task_status:e,taskRegisterData:n,updateTaskRegisterData:r,updateTaskProgressValue:i,userTaskSubmitFormData:a,updateUserFormDataSubmit:s,updateProgressDataValuesHook:l,TASK_PUBLISHED:c}=Ar(),{field:u,row:d,pageIndex:f,sectionIndex:h,section:g,page:v,rowIndex:m,columnIndex:A,isDisabled:w=!1}=t,{isAdmin:C,isBuilderMode:S}=Ht(),{pageSettingUpdate:T,formBuilderFormLayout:x,sectionSettingUpdate:E,userSelectedLanguage:_}=sn(),[M,O]=k.useState(!1),[F,P]=k.useState(null),[H,N]=k.useState(0),[z,U]=k.useState(!1),[ce,X]=k.useState(!1),R=()=>{X(!0)},ue=()=>{X(!1)},Y=$=>{O($)},ie=()=>{O(!1)},re=()=>{var $,pe,me,ae;if((a==null?void 0:a.length)>0)if(d!=null&&d.rowIsRepeatable){if(d!=null&&d.repeatableFields){const le=[...d.repeatableFields],be=_t.findIndex(le,function(Ie){return Ie.uuid===(u==null?void 0:u.uuid)});be>=0&&le[be].fieldData?P(le[be].fieldData):(u.isValid=0,P(null))}}else{const le=a,be=_t.cloneDeep(n);let Ie=null;if(le!=null&&le.length){for(const Pe of le)if(Pe.fieldId===t.field.uuid&&(($=Pe==null?void 0:Pe.postData)!=null&&$.length)){Ie=(pe=Pe==null?void 0:Pe.postData[0])==null?void 0:pe.postValue,P((me=Pe==null?void 0:Pe.postData[0])==null?void 0:me.postValue),be[u==null?void 0:u.uuid]=(ae=Pe==null?void 0:Pe.postData[0])==null?void 0:ae.postValue;const ze=Object.keys(be).length;i(ze);break}}Z({value:Ie}),W({value:Ie})}setTimeout(()=>{U(!0)},2e3)},Z=$=>{const pe=$.value;u==null||u.conditionalTabRules.rules.map(me=>{var ae;(ae=me==null?void 0:me.conditions)==null||ae.map(le=>{const be=_t.findIndex(x,Ie=>{var Pe;return Ie.uuid===((Pe=le==null?void 0:le.tab)==null?void 0:Pe.uuid)});if(pe===(le==null?void 0:le.option)){const Ie=x[be];Ie.isHidden=!1,T(be,Ie)}else{let Ie=x[be];Ie={...Ie,isHidden:!0},T(be,Ie)}})})},K=k.useCallback(($,pe)=>{var me;if((a==null?void 0:a.length)>0){const ae=a;if(ae!=null&&ae.length){const le=n;for(const[Ie,Pe]of pe.children.entries())for(const[,ze]of Pe.children.entries())for(const[Ze,nt]of ze.children.entries())if(Pe!=null&&Pe.rowIsRepeatable){if((Pe==null?void 0:Pe.rowIsRepeatable)===!0){const ht=_t.findIndex(ae,function(Ut){return Ut.rowId===Pe.uuid});$===!0?ht===-1&&(ae.push({postData:[],tabId:v.uuid,rowId:Pe==null?void 0:Pe.uuid,tabIndex:f,sectionId:g.uuid,minimumEntries:g==null?void 0:g.minimumEntries,sectionIndex:h,sectionHeading:g.heading,subHeadingText:g.subHeadingText,repeatableFields:{},repeatableFieldsData:[],language:"english",isHiddenSection:!!(g.isHidden&&g.isHidden===!0),reviewerChecklist:Pe==null?void 0:Pe.reviewerChecklist}),le[Pe==null?void 0:Pe.uuid]&&delete le[Pe==null?void 0:Pe.uuid]):(le[Pe==null?void 0:Pe.uuid]&&delete le[Pe==null?void 0:Pe.uuid],ht>=0&&ae.splice(ht,1))}}else{const ht=_t.findIndex(ae,function(Ut){return Ut.fieldId===nt.uuid});$?ht===-1&&(ae.push({postData:[],tabId:v.uuid,tabIndex:f,...nt.inlineConditionalRules?{inlineConditionalRules:nt.inlineConditionalRules}:{},...nt.conditionalTabRules?{conditionalTabRules:nt.conditionalTabRules}:{},...nt.conditionalSectionRules?{conditionalSectionRules:nt.conditionalSectionRules}:{},sectionId:g.uuid,sectionIndex:h,sectionHeading:g.heading,subHeadingText:g.subHeadingText,reviewerChecklist:nt==null?void 0:nt.reviewerChecklist,rowId:Pe.uuid,rowIndex:Ie,columnId:g.uuid,columnIndex:A,inlineConditionalField:!0,fieldIndex:Ze,fieldId:nt.uuid,fieldInputType:nt.componentType,fieldTitle:(me=nt.label)==null?void 0:me.english,fieldDescription:nt.description||null,fieldHelperText:nt.helperText||null,fieldHeaderText:nt.headerText||null,fieldFooterText:nt.footerText||null,fieldTitleAbb:nt.abbreviationLabel||nt.label,question_abb_table:nt.textForTable||null,language:"english",isHiddenfield:nt.isHidden&&nt.isHidden===1?1:0,isHiddenSection:!!(g.isHidden&&g.isHidden===!0)}),le[nt==null?void 0:nt.uuid]&&delete le[nt==null?void 0:nt.uuid]):(le[nt==null?void 0:nt.uuid]&&delete le[nt==null?void 0:nt.uuid],ht>=0&&ae.splice(ht,1))}const be=Object.keys(le).length;l({progressMaxValue:ae==null?void 0:ae.length,progressValue:be}),s([...ae])}}},[A,u==null?void 0:u.abbreviationLabel,u==null?void 0:u.componentType,u==null?void 0:u.conditionalSectionRules,u==null?void 0:u.conditionalTabRules,u==null?void 0:u.description,u==null?void 0:u.footerText,u==null?void 0:u.headerText,u==null?void 0:u.helperText,u==null?void 0:u.inlineConditionalRules,u==null?void 0:u.isHidden,u==null?void 0:u.label,u==null?void 0:u.reviewerChecklist,u==null?void 0:u.textForTable,v==null?void 0:v.uuid,f,d==null?void 0:d.uuid,m,g==null?void 0:g.heading,g==null?void 0:g.isHidden,g==null?void 0:g.subHeadingText,g==null?void 0:g.uuid,h,n,l,s,a]),W=$=>{const pe=$.value;u==null||u.conditionalSectionRules.rules.map(me=>{var ae;(ae=me==null?void 0:me.conditions)==null||ae.map(le=>{if((pe==null?void 0:pe.value)===(le==null?void 0:le.option)){const be=_t.findIndex(x,ze=>{var Ze;return ze.uuid===((Ze=le==null?void 0:le.tab)==null?void 0:Ze.uuid)}),Ie=_t.findIndex(x[be].children,ze=>{var Ze;return ze.uuid===((Ze=le==null?void 0:le.section)==null?void 0:Ze.uuid)}),Pe=x[be].children[Ie];Pe.isHidden=!1,K(!0,x[be].children[Ie]),E(be,Ie,Pe)}else{const be=_t.findIndex(x,ze=>{var Ze;return(ze==null?void 0:ze.uuid)===((Ze=le==null?void 0:le.tab)==null?void 0:Ze.uuid)}),Ie=_t.findIndex(x[be].children,ze=>{var Ze;return(ze==null?void 0:ze.uuid)===((Ze=le==null?void 0:le.section)==null?void 0:Ze.uuid)}),Pe=x[be].children[Ie];Pe.isHidden=!0,K(!1,x[be].children[Ie]),E(be,Ie,Pe)}})})};k.useEffect(()=>{z||re();const $=Gt.addListener("clearRepeatableFields",ae=>{ae===(d==null?void 0:d.uuid)&&(P(""),N(0),u.isValid=1)}),pe=Gt.addListener("onSubmitUserForm",()=>{var ae;if((ae=u==null?void 0:u.attributes)!=null&&ae.required){const le=F;le!=null&&le.uuid&&(le!=null&&le.value)?u.isValid=1:u.isValid=0}else u.isValid=1}),me=Gt.addListener("OnInvalidFieldCatch",ae=>{(u==null?void 0:u.uuid)===(ae==null?void 0:ae.fieldId)?N(1):N(0)});return()=>{pe.remove(),me.remove(),$.remove()}});const ge=($,pe)=>{var me;if(a){const ae=[...a],le=_t.findIndex(ae,function(Ie){return Ie.rowId===(d==null?void 0:d.uuid)});let be=(me=a[le])==null?void 0:me.repeatableFields;be={...be,[$==null?void 0:$.uuid]:pe},ae[le]={...ae[le],repeatableFields:be},s(ae)}P(pe),pe!==null?$.isValid=1:$.isValid=0},ye=$=>{var pe;P($.target.value),Z($),W($),d!=null&&d.rowIsRepeatable?ge(u,(pe=$==null?void 0:$.target)==null?void 0:pe.value):Ae($),setTimeout(()=>{Gt.emit("updatePageRender","complete")},1e3)},Ee=()=>{var $;if((($=u==null?void 0:u.fieldType)==null?void 0:$.type)==="radio"){const pe=[];return u==null||u.options.map((me,ae)=>{var be,Ie,Pe,ze;const le=F;pe.push(o.jsxs("div",{className:`field-radiobutton ${u!=null&&u.showButtonLayout?"col-6 field-radiobutton-builder":""}`,onClick:()=>{(!C||!w)&&e!==Pde&&ye({value:me,target:{value:me}})},style:(le==null?void 0:le.uuid)===(me==null?void 0:me.uuid)&&(u!=null&&u.showButtonLayout)?{backgroundColor:"#0F8BFD",padding:5,borderRadius:8}:{padding:5},children:[o.jsx(ia,{onFocus:()=>{(!C||!w)&&N(1)},inputId:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder-radio":"preview"}`,onChange:Ze=>{(!C||!w)&&ye(Ze)},value:me,name:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder":"preview"}`,checked:(le==null?void 0:le.uuid)===(me==null?void 0:me.uuid),disabled:C||w,readOnly:C||w}),((be=me==null?void 0:me.hyperlinkText)==null?void 0:be[_==null?void 0:_.type])===""?o.jsxs("label",{htmlFor:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder-label":"preview"}`,children:[u!=null&&u.showAlphabetList?o.jsxs("span",{className:"mx-2",children:[" ",_O(ae)," "]}):"",S?o.jsx(o.Fragment,{children:o.jsx(KO,{...t,option:me,optionIndex:ae})}):o.jsxs(o.Fragment,{children:[" ",(Ie=me==null?void 0:me.optionText)==null?void 0:Ie[_==null?void 0:_.type]]})]}):o.jsx("label",{children:o.jsx("a",{href:(Pe=me==null?void 0:me.hyperlinkText)==null?void 0:Pe[_==null?void 0:_.type],target:"_blank",rel:"noreferrer",children:(ze=me==null?void 0:me.optionText)==null?void 0:ze[_==null?void 0:_.type]})}),S&&o.jsx("div",{className:"builder-radio-option-settings",children:o.jsx(XO,{optionId:me==null?void 0:me.uuid,...t})})]},"li-item-"+ae))}),pe}},Ae=$=>{var be,Ie;P($.target.value);const pe={value:$.target.value};Z(pe),W(pe);const me=a,ae=_t.cloneDeep(n);if((be=$==null?void 0:$.target)!=null&&be.value&&(me==null?void 0:me.length)>0)for(const Pe of me)Pe.fieldId===t.field.uuid&&(ae[u==null?void 0:u.uuid]=(Ie=$==null?void 0:$.target)==null?void 0:Ie.value,Pe.postData[0]={postValue:$.target.value});else delete ae[u==null?void 0:u.uuid];r(ae);const le=Object.keys(ae).length;i(le)},fe=o.jsxs("div",{onMouseOver:R,onMouseOut:ue,children:[S&&ce&&o.jsx(Wr,{handleFieldSettingsSidebar:Y,...t}),o.jsx("div",{className:`field ${S&&" py-3 px-4 builder-element-wrapper "}${(u==null?void 0:u.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-12",children:[(u==null?void 0:u.showHeaderText)&&o.jsx("h6",{children:(ne=u==null?void 0:u.headerText)==null?void 0:ne[_==null?void 0:_.type]}),(u==null?void 0:u.showLabel)&&o.jsxs("label",{htmlFor:u.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((q=u==null?void 0:u.attributes)==null?void 0:q.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",S?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(ee=u==null?void 0:u.label)==null?void 0:ee[_==null?void 0:_.type]}),o.jsx("span",{className:"ml-3",children:u!=null&&u.showToolTip?o.jsx(o.Fragment,{children:o.jsx(zi,{message:(oe=u==null?void 0:u.toolTip)==null?void 0:oe[_==null?void 0:_.type],position:"right"})}):""})]}),(u==null?void 0:u.showButtonLayout)===!0?o.jsxs("div",{className:"grid",children:[Ee()," "]}):Ee(),o.jsx("div",{children:((he=u==null?void 0:u.attributes)==null?void 0:he.required)&&o.jsx("small",{className:"error",children:H===1&&F!==null?(De=u==null?void 0:u.validationMesssage)==null?void 0:De.language:""})}),o.jsx("div",{children:(u==null?void 0:u.showHelperText)&&o.jsx("small",{children:(Ne=u==null?void 0:u.helperText)==null?void 0:Ne[_==null?void 0:_.type]})}),((ve=u==null?void 0:u.inlineConditionalRules)==null?void 0:ve.rules.length)>0&&S===!0&&o.jsx("p",{children:"Inline conditional rules"}),z===!0&&((Be=(Se=u==null?void 0:u.inlineConditionalRules)==null?void 0:Se.rules)==null?void 0:Be.length)>0&&((Te=u==null?void 0:u.inlineConditionalRules)==null?void 0:Te.rules.map(($,pe)=>{const me=F;return S===!1?o.jsx("div",{children:$==null?void 0:$.conditions.map((ae,le)=>o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:!!((me==null?void 0:me.value)===ae.value||S),inputValue:F,condition:ae,ruleIndex:pe,conditionIndex:le,field:u,section:g,page:v,row:d,pageIndex:f,sectionIndex:h,rowIndex:m,columnIndex:A,isAdmin:C,...t})},`select-rule-${pe}-`+le))},`rule-${pe}`):o.jsx(ci,{className:"mt-4",header:`Rule ${pe+1}`,children:o.jsx("div",{children:$==null?void 0:$.conditions.map((ae,le)=>{const be=F;return o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:!!((be==null?void 0:be.value)===ae.value||S),inputValue:F,condition:ae,ruleIndex:pe,conditionIndex:le,field:u,section:g,page:v,row:d,pageIndex:f,sectionIndex:h,rowIndex:m,columnIndex:A,...t})},`select-rule-${pe}-`+le)})},`rule-${pe}`)},pe)}))]}),C&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]});return o.jsxs(o.Fragment,{children:[M===!0&&o.jsx(Qi,{visibilty:M,closeSettingFieldSidebar:ie,...t},u==null?void 0:u.uuid),o.jsx(xi,{...t,fieldWrap:fe})]})},Lde=k.memo(Mde),Bde=t=>{var i,a;const{language:e,onHandleChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Text"}),o.jsx(wn,{value:(i=r.text)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("text",e,s.target.value),placeholder:"Heading text",id:r==null?void 0:r.uuid})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(wn,{value:(a=r.hrefLink)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("hrefLink",e,s.target.value),placeholder:"Link"})]})]})},Vde=t=>{const{onHandleChangeHeadingTypeSetttings:e,fieldState:n}=t,r=[{name:"H1",type:"h1"},{name:"H2",type:"h2"},{name:"H3",type:"h3"},{name:"H4",type:"h4"},{name:"H5",type:"h5"}];return o.jsxs("form",{className:"p-fluid",children:[o.jsx("h3",{children:"Select heading type"}),r.map((i,a)=>o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:i==null?void 0:i.type,name:"heading",value:i==null?void 0:i.type,onChange:s=>e(s),checked:n.headingType===i.type}),o.jsx("label",{htmlFor:i.type,children:i.name})]},a))]})},qde=t=>{const{fieldSettingUpdate:e,formBuilderSchemaLanguages:n,formBuilderPublishedStatus:r,fieldSettingUpdateInlineConditional:i,gridComponentFieldSettingUpdate:a}=sn(),{path:s,visibilty:l,field:c,closeSettingFieldSidebar:u,pageIndex:d,sectionIndex:f,rowIndex:h,columnIndex:g,fieldIndex:v,typeName:m}=t,[A,w]=k.useState(c),{updateGlobalToast:C}=Ht(),S=(E,_,M)=>{w(O=>({...O,[E]:{...O[E],[_==null?void 0:_.type]:M}}))},T=E=>{w(_=>({..._,headingType:E==null?void 0:E.value}))},x=()=>{const E=s.split("-").map(Number);(E==null?void 0:E.length)>5&&(E==null?void 0:E.length)===8&&(A!=null&&A.inlineConditionalRules)?i(E[fa],E[ha],E[Ca],E[xa],E[Ta],E[Fa],E[Xo],E[wo],A):(E==null?void 0:E.length)>Fa&&(E==null?void 0:E.length)===Bl+1&&(A!=null&&A.componentType)?a(E[fa],E[ha],E[Ca],E[xa],E[Ta],E[lx],E[cx],E[ux],A):e(d,f,h,g,v,A),C({showToast:!0,toastMessage:"Updated",toastDetail:`${m} updated`,toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"750px"},visible:l,position:"left",className:"p-sidebar-lg",onHide:()=>u(),header:()=>o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[t==null?void 0:t.typeName," settings"]})}),children:[o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:n!=null&&n.length?n.map((E,_)=>o.jsx(io,{tabIndex:_,header:E==null?void 0:E.language,children:o.jsx(Bde,{language:E,fieldState:A,onHandleChange:S,...t})},_)):""})}),o.jsx(wr,{header:"Setting",children:o.jsx(Vde,{onHandleChangeHeadingTypeSetttings:T,fieldState:A})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[!r&&o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>x(),"aria-label":"Update"}),o.jsx(Ft,{label:"Close",type:"button",onClick:()=>u(),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Ude=t=>{var v,m;const{field:e}=t,{isBuilderMode:n}=Ht(),{userSelectedLanguage:r}=sn(),[i,a]=k.useState(!1),[s,l]=k.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=A=>{a(A)},f=()=>{a(!1)},h=()=>{var A,w,C,S,T,x;return(e==null?void 0:e.headingType)==="h1"?o.jsx("h1",{children:(A=e==null?void 0:e.text)==null?void 0:A[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h2"?o.jsx("h2",{children:(w=e==null?void 0:e.text)==null?void 0:w[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h3"?o.jsx("h3",{children:(C=e==null?void 0:e.text)==null?void 0:C[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h4"?o.jsx("h4",{children:(S=e==null?void 0:e.text)==null?void 0:S[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h5"?o.jsx("h5",{children:(T=e==null?void 0:e.text)==null?void 0:T[r==null?void 0:r.type]}):o.jsx("h1",{children:(x=e==null?void 0:e.text)==null?void 0:x[r==null?void 0:r.type]})},g=o.jsxs("div",{className:n?"builder-element-wrapper":"",onMouseOver:c,onMouseOut:u,children:[n&&s&&o.jsx(Wr,{handleFieldSettingsSidebar:d,...t}),o.jsx("div",{className:n?"field-form-builder px-2":" px-2",children:o.jsx("div",{className:"col-12",children:((v=e==null?void 0:e.hrefLink)==null?void 0:v[r==null?void 0:r.type])!==""?o.jsx("a",{href:(m=e==null?void 0:e.hrefLink)==null?void 0:m[r==null?void 0:r.type],target:"_blank",rel:"noreferrer",children:h()}):h()})})]});return o.jsxs(o.Fragment,{children:[i&&o.jsx(qde,{visibilty:i,closeSettingFieldSidebar:f,...t},e==null?void 0:e.uuid),o.jsx(xi,{...t,fieldWrap:g})]})},$de=t=>{var i,a;const{language:e,onHandleQuestionTextChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Question text"}),o.jsx(wn,{placeholder:"Enter question",value:(i=r.questionText)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("questionText",e.type,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Correct answer"}),o.jsx(wn,{placeholder:"Enter correct answer",value:(a=r.correctAnswerComment)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("correctAnswerComment",e.type,s.target.value)})]})]})},jde=t=>{var i;const{onHandleChange:e,fieldState:n,onHandleChangeAttributesSetttings:r}=t;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field",style:{display:"inline-block",width:"150px"},children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Time limit"}),o.jsxs("div",{className:"p-inputgroup",children:[o.jsx(eo,{inputId:"horizontal",showButtons:!0,buttonLayout:"horizontal",step:1,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},value:n==null?void 0:n.timeLimit,onChange:a=>e("timeLimit",a.value)}),o.jsx("span",{className:"p-inputgroup-addon",children:"mins"})]})]})}),o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field",style:{display:"inline-block",width:"100px"},children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Score"}),o.jsx("div",{className:"p-inputgroup",children:o.jsx(eo,{inputId:"horizontal",showButtons:!0,buttonLayout:"horizontal",step:1,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},value:n==null?void 0:n.score,onChange:a=>e("score",a.value)})})]})}),o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"required",checked:(i=n==null?void 0:n.attributes)==null?void 0:i.required,onChange:a=>r("required",a.checked)}),o.jsx("label",{htmlFor:"required",children:"Is complusory?"})]})})]})},zde=t=>{const{onHandleChange:e,fieldState:n}=t,[r,i]=k.useState([{type:"radio"},{type:"checkbox"}]);return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field field-checkbox",children:[o.jsx(Yr,{inputId:"isAllowMultipleAnswer",value:"isAllowMultipleAnswer",onChange:a=>{e("isAllowMultipleAnswer",a==null?void 0:a.checked),a!=null&&a.checked?(i([{type:"checkbox"}]),e("answerInputType","checkbox")):(i([{type:"radio"}]),e("answerInputType","radio"))},checked:n==null?void 0:n.isAllowMultipleAnswer}),o.jsx("label",{htmlFor:"isAllowMultipleAnswer",className:"p-checkbox-label ",children:"Allow multiple answer"})]}),(n==null?void 0:n.isAllowMultipleAnswer)&&o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Number of options"}),o.jsx(wn,{type:"number",value:(n==null?void 0:n.noOfMultpleAnswer)||0,onChange:a=>{var s;e("noOfMultpleAnswer",(s=a==null?void 0:a.target)==null?void 0:s.value)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Answer input type"}),r.map((a,s)=>o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:a.type,name:"answerInputType",value:a.type,onChange:()=>{if(e("answerInputType",a.type),a.type==="checkbox"&&e("isAllowMultipleAnswer",!0),a.type==="radio"){let l=[...(n==null?void 0:n.answerOptions)||[]];l=l.map(c=>({...c,isCorrect:!1})),e("answerOptions",l),e("isAllowMultipleAnswer",!1)}},checked:(n==null?void 0:n.answerInputType)===a.type}),o.jsx("label",{htmlFor:a.type,children:a.type})]},s))]})]})},Hde=t=>{const{fieldState:e,setFieldState:n,language:r}=t,i=()=>{var g;let f=!1;const h=(g=e==null?void 0:e.answerOptions)==null?void 0:g.filter(v=>(v==null?void 0:v.isCorrect)===!0);return(h==null?void 0:h.length)===parseInt(e==null?void 0:e.noOfMultpleAnswer)&&(f=!0),f},a=f=>o.jsx(o.Fragment,{children:o.jsx(Ft,{text:!0,type:"button",className:"p-button-danger left-space",onClick:()=>d((f==null?void 0:f.uuid)||""),icon:"pi pi-trash"})}),s=f=>o.jsx(o.Fragment,{children:o.jsx(wn,{value:f==null?void 0:f.answersText[r],onChange:h=>c("answersText",(f==null?void 0:f.uuid)||"",h.target.value)})}),l=(f,h)=>o.jsx(o.Fragment,{children:o.jsx(Yr,{inputId:"binary",checked:(f==null?void 0:f.isCorrect)||!1,onChange:g=>{g.checked&&i()||u("isCorrect",(f==null?void 0:f.uuid)||"",g.checked,h)}})}),c=(f,h,g)=>{n(v=>({...v,answerOptions:v!=null&&v.answerOptions?v==null?void 0:v.answerOptions.map(m=>m.uuid!==h?m:{...m,[f]:{...m[f],[r]:g}}):[]}))},u=(f,h,g,v)=>{n(m=>{const{answerOptions:A,isAllowMultipleAnswer:w,answerInputType:C}=m,S=v.rowIndex,T=A.map((x,E)=>{const _=E===S;return w||C==="checkbox"?_?{...x,[f]:g}:x:{...x,[f]:_?g:!1}});return{...m,answerOptions:T}})},d=f=>{const h=_t.findIndex(e==null?void 0:e.answerOptions,v=>v.uuid===f),g=(e==null?void 0:e.answerOptions)&&(e==null?void 0:e.answerOptions.filter(function(v,m){return m!==h}));g!=null&&g.length&&(g==null?void 0:g.length)>0&&n(v=>({...v,answerOptions:g}))};return o.jsx("div",{children:o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.answerOptions,scrollable:!0,children:[o.jsx(xr,{header:"Answer text",body:f=>s(f),headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}}),o.jsx(xr,{body:(f,h)=>l(f,h),header:"Is answer ?",headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}}),o.jsx(xr,{header:"Action",body:f=>a(f),headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}})]})})})},Yde=t=>{const e=[],[n]=k.useState([]),{onHandleChange:r,fieldState:i}=t;return k.useEffect(()=>{},[]),o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field mt-3 w-full",children:[o.jsx("label",{children:"Subject"}),o.jsx(Pa,{id:"subject",name:"subject",optionLabel:"subject_title",value:(n==null?void 0:n.length)>0&&(i==null?void 0:i.subject_id)!==null?n.filter(a=>(i==null?void 0:i.subject_id)===(a==null?void 0:a.subject_id))[0]:null,placeholder:"Select a Subject",options:n,className:"w-full",onChange:a=>{var s;r("subject_id",(s=a==null?void 0:a.value)==null?void 0:s.subject_id)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Course category"}),o.jsx(Pa,{id:"course_category",name:"course_category",optionLabel:"course_category_title",value:(e==null?void 0:e.length)>0&&(i==null?void 0:i.course_category_id)!==null?e.filter(a=>(i==null?void 0:i.course_category_id)===(a==null?void 0:a.course_category_id))[0]:null,placeholder:"Select a category",options:e,className:"w-full",onChange:a=>{var s;r("course_category_id",(s=a==null?void 0:a.value)==null?void 0:s.course_category_id)}})]})]})},Kde=t=>{const{formBuilderSchemaLanguages:e,fieldSettingUpdate:n}=sn(),{visibilty:r,setVisibility:i,rowIndex:a,columnIndex:s,fieldIndex:l,pageIndex:c,sectionIndex:u,field:d,typeName:f}=t,[h,g]=k.useState(d),{updateGlobalToast:v}=Ht(),m=(x,E)=>{g(_=>({..._,attributes:{..._.attributes,[x]:E}}))},A=(x,E,_)=>{g(M=>({...M,[x]:{[E]:_}}))},w=(x,E)=>{g(_=>({..._,[x]:E}))},C=()=>{const x=[],_=((h==null?void 0:h.answerOptions)||[]).filter(P=>P.isCorrect===!0),{answerInputType:M,isAllowMultipleAnswer:O,noOfMultpleAnswer:F}=h||{};if(M==="radio")_.length!==1&&x.push("Please select one answer");else if(M==="checkbox"){const P=O?parseInt(F,10)||0:1;_.length!==P&&x.push(P>1?`Select ${P} answers`:"Please select one answer")}return x.length?(v({showToast:!0,toastMessage:"Validation error",toastDetail:x.join(", "),toastType:"error"}),!1):!0},S=()=>{C()&&(n(c,u,a,s,l,h),v({showToast:!0,toastMessage:"Updated",toastDetail:`${f} updated`,toastType:"success"}))},T=()=>{g(x=>Object.assign({},x,{answerOptions:[...x.answerOptions||[],{uuid:rt(),answersText:{english:""},isCorrect:!1}]}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{visible:r,position:"left",className:"p-sidebar-lg",onHide:()=>i(!1),children:[o.jsx("div",{className:"flex justify-content-between flex-wrap card-container ",children:o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{children:[t==null?void 0:t.typeName," settings"," "]})," "]})}),o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:e!=null&&e.length?e.map((x,E)=>o.jsx(io,{tabIndex:E,header:x==null?void 0:x.language,children:o.jsx($de,{language:x,fieldState:h,onHandleQuestionTextChange:A,...t})},E)):""})}),o.jsx(wr,{header:"Advance",children:o.jsx(jde,{fieldState:h,onHandleChangeAttributesSetttings:m,onHandleChange:w,...t})}),o.jsx(wr,{header:"Answers",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(zde,{fieldState:h,onHandleChange:w,...t}),o.jsxs("div",{className:"flex justify-content-between mb-2",children:[o.jsx("h4",{children:"Answers options"}),o.jsx(Ft,{className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>T(),"aria-label":"Add"})]}),(h==null?void 0:h.answerOptions)!==void 0&&o.jsx(o.Fragment,{children:o.jsx(ao,{activeIndex:0,children:e!=null&&e.length?e.map((x,E)=>o.jsx(io,{tabIndex:E,header:x==null?void 0:x.language,children:o.jsx(Hde,{language:x==null?void 0:x.type,fieldState:h,setFieldState:g})},E)):""})})]})}),o.jsx(wr,{header:"Information",children:o.jsx(Yde,{fieldState:h,onHandleChange:w})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>S(),"aria-label":"Update"}),o.jsx(Ft,{label:"Close",type:"button",onClick:()=>i(!1),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Xde=t=>{var O,F,P,H,N,z;const{isBuilderMode:e}=Ht(),{field:n}=t,{taskRegisterData:r,updateTaskRegisterData:i,updateTaskProgressValue:a,userTaskSubmitFormData:s}=Ar(),{userSelectedLanguage:l}=sn(),{media:c}=Ht(),u=(O=c==null?void 0:c.image)!=null&&O.MediaImage?(F=c==null?void 0:c.image)==null?void 0:F.MediaImage:o.jsx(o.Fragment,{}),[d,f]=k.useState(!1),[h,g]=k.useState([]),[v,m]=k.useState(!1),A=U=>{m(U)},w=()=>{m(!1)},C=()=>{f(!0)},S=()=>{f(!1)},T=U=>{var ue;const ce=_t.cloneDeep(r),X=[...h];U.checked?(ce[n==null?void 0:n.uuid]=(ue=U==null?void 0:U.target)==null?void 0:ue.value,X.push(U.value)):(delete ce[n==null?void 0:n.uuid],X.splice(X.indexOf(U.value),1)),g(X),x(U,X),i(ce);const R=Object.keys(ce).length;a(R)},x=(U,ce)=>{const X=s;if((X==null?void 0:X.length)>0&&U!=null&&U.value)for(const R of X)R.fieldId===t.field.uuid&&(R.postData[0]={postValue:ce})},E=U=>{var ue;const ce=s,X=_t.cloneDeep(r);if((ce==null?void 0:ce.length)>0)if((ue=U==null?void 0:U.target)!=null&&ue.value)for(const Y of ce)Y.fieldId===t.field.uuid&&(X[n==null?void 0:n.uuid]=U==null?void 0:U.value,Y.postData[0]={postValue:U.value});else delete X[n==null?void 0:n.uuid];i(X);const R=Object.keys(X).length;a(R)};k.useEffect(()=>{g([])},[n==null?void 0:n.answerInputType]);const _=()=>{const U=[];return(n==null?void 0:n.answerInputType)==="radio"?n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var ue,Y,ie,re;const R=h;U.push(o.jsxs("div",{className:"flex align-items-center p-field-radiobutton mb-3",children:[o.jsx(ia,{inputId:`${X}`,onChange:Z=>{g(Z.target.value),E(Z)},checked:(R==null?void 0:R.uuid)===(ce==null?void 0:ce.uuid),name:"category",value:ce}),"  ",((ue=ce.answersTextImage)==null?void 0:ue[l==null?void 0:l.type])&&((Y=ce.answersTextImage)==null?void 0:Y[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(ie=ce.answersTextImage)==null?void 0:ie[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),o.jsx("label",{htmlFor:`${X}`,children:(re=ce==null?void 0:ce.answersText)==null?void 0:re[l==null?void 0:l.type]})]},X))})):(n==null?void 0:n.answerInputType)==="checkbox"?n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var R;U.push(o.jsxs("div",{className:"p-field-radiobutton mb-3",children:[o.jsx(Yr,{inputId:`${X}`,name:"category",onChange:ue=>{T(ue)},value:ce,checked:h!=null&&h.length?h==null?void 0:h.some(ue=>ue.uuid===ce.uuid):!1}),"  ",o.jsx("label",{htmlFor:`${X}`,children:(R=ce==null?void 0:ce.answersText)==null?void 0:R[l==null?void 0:l.type]})]},X))})):n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var ue,Y,ie,re,Z,K,W;const R=h;U.push(o.jsxs("div",{className:"p-field-radiobutton mb-3",children:[o.jsx(ia,{inputId:`${X}`,onChange:ge=>{g(ge.target.value),E(ge)},checked:(R==null?void 0:R.uuid)===(ce==null?void 0:ce.uuid),name:"category",value:ce}),"  ",((ue=ce.answersTextImage)==null?void 0:ue[l==null?void 0:l.type])&&((Y=ce.answersTextImage)==null?void 0:Y[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(ie=ce.answersTextImage)==null?void 0:ie[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),o.jsxs("label",{htmlFor:`${X}`,children:[((re=ce.answersTextImage)==null?void 0:re[l==null?void 0:l.type])&&((Z=ce.answersTextImage)==null?void 0:Z[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(K=ce.answersTextImage)==null?void 0:K[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),(W=ce==null?void 0:ce.answersText)==null?void 0:W[l==null?void 0:l.type]]})]},X))})),U},M=o.jsxs("div",{onMouseOver:C,onMouseOut:S,children:[e&&d&&o.jsx(Wr,{handleFieldSettingsSidebar:A,...t}),o.jsx("div",{className:`field ${e&&" py-3 px-4 builder-element-wrapper "}${(n==null?void 0:n.isFluid)===!0&&" p-fluid"}`,children:o.jsx("div",{className:"grid",children:o.jsxs("div",{className:"col-12 p-fluid",children:[((P=n==null?void 0:n.questionTextImage)==null?void 0:P[l==null?void 0:l.type])&&((H=n==null?void 0:n.questionTextImage)==null?void 0:H[l==null?void 0:l.type])!==""&&o.jsx("div",{className:"text-center assessment_image_container",children:o.jsx(u,{mediaId:(N=n==null?void 0:n.questionTextImage)==null?void 0:N[l==null?void 0:l.type],style:{height:"100px",width:"100px",objectFit:"cover",borderRadius:100},className:"text-center",alt:"questionImage"})}),o.jsx("h5",{children:(z=n==null?void 0:n.questionText)==null?void 0:z[l==null?void 0:l.type]}),_()]})})})]});return o.jsxs(o.Fragment,{children:[v===!0&&o.jsx(Kde,{visibilty:v,setVisibility:w,...t},n==null?void 0:n.uuid),o.jsx(xi,{...t,fieldWrap:M})]})},Rde=t=>{var i,a;const{onHandleChange:e,fieldState:n,language:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Title"}),o.jsx(wn,{value:(i=n.title)==null?void 0:i[r==null?void 0:r.type],onChange:s=>e("title",r,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Image Url"}),o.jsx(wn,{value:(a=n.media_url)==null?void 0:a[r==null?void 0:r.type],onChange:s=>e("media_url",r,s.target.value)})]})]})};class RO{constructor(){Rn(this,"formatBytes",(e,n=2)=>{if(e===0||e===void 0||e===null)return"0 Bytes";const r=1024,i=n<0?0:n,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,s)).toFixed(i))+" "+a[s]})}}function b2(t){"@babel/helpers - typeof";return b2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b2(t)}function Gde(t,e){if(b2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(b2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wde(t){var e=Gde(t,"string");return b2(e)=="symbol"?e:e+""}function GO(t,e,n){return(e=Wde(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qde={root:function(e){var n=e.props;return ft("p-badge p-component",GO({"p-badge-no-gutter":ke.isNotEmpty(n.value)&&String(n.value).length===1,"p-badge-dot":ke.isEmpty(n.value),"p-badge-lg":n.size==="large","p-badge-xl":n.size==="xlarge"},"p-badge-".concat(n.severity),n.severity!==null))}},Jde=`
3514
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,a=u},f:function(){try{s||n.return==null||n.return()}finally{if(l)throw a}}}}function Nde(t,e){if(t){if(typeof t=="string")return HO(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HO(t,e):void 0}}function HO(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var YO=b.memo(b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=v2.getProps(t,r),a=b.useState(null),s=cd(a,2),l=s[0],c=s[1],u=b.useState(!1),d=cd(u,2),f=d[0],h=d[1],g=jx("",i.filterDelay||0),v=cd(g,3),m=v[0],A=v[1],w=v[2],C=b.useState(-1),S=cd(C,2),T=S[0],x=S[1],E=b.useState(!1),_=cd(E,2),M=_[0],O=_[1],F=b.useState(i.inline),P=cd(F,2),H=P[0],N=P[1],z=b.useRef(null),U=b.useRef(null),ce=b.useRef(null),X=b.useRef(null),R=b.useRef(null),ue=b.useRef(i.inputRef),Y=b.useRef(null),ie=b.useRef(null),re=b.useRef(null),Z=A&&A.trim().length>0,K=ke.isEmpty(i.value),W=i.optionValue?null:i.dataKey,ge={props:i,state:{filterState:A,focused:M,overlayVisible:H}},ye=v2.setMetaData(ge),Ee=ye.ptm,Ae=ye.cx,fe=ye.sx,ne=ye.isUnstyled;li(v2.css.styles,ne,{name:"multiselect"});var q=ep({target:z,overlay:ie,listener:function(Ye,Et){var Wt=Et.type,Jn=Et.valid;Jn&&(Wt==="outside"?!Ke(Ye)&&!st(Ye)&&ot():r.hideOverlaysOnDocumentScrolling?ot():xe.isDocument(Ye.target)||wt())},when:H}),ee=cd(q,2),oe=ee[0],he=ee[1],De=function(Ye){var Et=Ye.relatedTarget===ue.current?xe.getFirstFocusableElement(ie.current,':not([data-p-hidden-focusable="true"])'):ue.current;xe.focus(Et)},Ne=function(Ye){var Et=Ye.relatedTarget===ue.current?xe.getLastFocusableElement(ie.current,':not([data-p-hidden-focusable="true"])'):ue.current;xe.focus(Et)},ve=function(Ye){ws.emit("overlay-click",{originalEvent:Ye,target:z.current})},Se=function(){return!i.selectionLimit||!i.value||i.value&&i.value.length<i.selectionLimit},Be=function(Ye){var Et=Xt()&&Ye<er.length-1?er.slice(Ye+1).findIndex(function(Wt){return zn(Wt)}):-1;return Et>-1?Et+Ye+1:-1},Te=function(Ye){var Et=Xt()&&Ye>0?ke.findLastIndex(er.slice(0,Ye),function(Wt){return zn(Wt)}):-1;return Et>-1?Et:-1},$=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=-1;return Xt()&&(Et?(Wt=Te(Ye),Wt=Wt===-1?Be(Ye):Wt):(Wt=Be(Ye),Wt=Wt===-1?Te(Ye):Wt)),Wt>-1?Wt:Ye},pe=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,Wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(Et===-1&&(Et=$(Wt,!0)),Wt===-1&&(Wt=$(Et)),Et!==-1&&Wt!==-1){var Jn=Math.min(Et,Wt),br=Math.max(Et,Wt),Pr=er.slice(Jn,br+1).filter(function(oa){return Ln(oa)}).map(function(oa){return Nt(oa)});mn(Ye,Pr,Pr)}},me=function(Ye,Et){var Wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(!(i.disabled||Qe(Et))){var Jn=Wn(Et),br=null;Jn?br=i.value.filter(function(Pr){return!ke.equals(Pr,Nt(Et),W)}):br=[].concat(Ade(i.value||[]),[Nt(Et)]),mn(Ye,br,Et),Wt!==-1&&c(Wt)}},ae=function(Ye){!i.inline&&!i.disabled&&!i.loading&&!vt(Ye)&&!Ke(Ye)&&(H?ot():He(),xe.focus(ue.current),Ye.preventDefault()),h(!0)},le=function(Ye){if(!H)He(),i.editable&&kn(Ye,at());else{var Et=l!==-1?xt(l):f?We():se();Ye.shiftKey&&pe(Ye,T,Et),kn(Ye,Et)}Ye.preventDefault()},be=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ye.altKey&&!Et)l!==-1&&me(Ye,er[l]),H&&ot(),Ye.preventDefault();else{var Wt=l!==-1?Rt(l):f?dt():Me();kn(Ye,Wt),!H&&He(),Ye.preventDefault()}},Ie=function(Ye){H?l!==-1&&(Ye.shiftKey?pe(Ye,l):me(Ye,er[l])):(c(-1),le(Ye)),Ye.preventDefault()},Pe=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=Ye.currentTarget;if(Et){var Jn=Wt.value.length;Wt.setSelectionRange(0,Ye.shiftKey?Jn:0),c(-1)}else{var br=Ye.metaKey||Ye.ctrlKey,Pr=We();Ye.shiftKey&&br&&pe(Ye,Pr,T),kn(Ye,Pr),!H&&He()}Ye.preventDefault()},ze=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=Ye.currentTarget;if(Et){var Jn=Wt.value.length;Wt.setSelectionRange(Ye.shiftKey?0:Jn,Jn),wde("focusedOptionIndex")}else{var br=Ye.metaKey||Ye.ctrlKey,Pr=dt();Ye.shiftKey&&br&&pe(Ye,T,Pr),kn(Ye,Pr),!H&&He()}Ye.preventDefault()},Ze=function(Ye){Ye.preventDefault()},nt=function(Ye){Ye.preventDefault()},ht=function(Ye){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Et||(H&&Zt()?(xe.focus(Ye.shiftKey?R.current:X.current),Ye.preventDefault()):(l!==-1&&me(Ye,er[l]),H&&ot(filter)))},Ut=function(){x(l)},fn=function(Ye){var Et=Ye.metaKey||Ye.ctrlKey;switch(Ye.code){case"ArrowUp":if(i.inline)break;be(Ye);break;case"ArrowDown":if(i.inline)break;le(Ye);break;case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;Ie(Ye);break;case"Home":if(i.inline)break;Pe(Ye),Ye.preventDefault();break;case"End":if(i.inline)break;ze(Ye),Ye.preventDefault();break;case"PageDown":nt(Ye);break;case"PageUp":Ze(Ye);break;case"Escape":if(i.inline)break;ot();break;case"Tab":ht(Ye);break;case"ShiftLeft":case"ShiftRight":Ut();break;default:if(Ye.key==="a"&&Et){var Wt=er.filter(function(Jn){return Ln(Jn)}).map(function(Jn){return Nt(Jn)});mn(Ye,Wt,Wt),Ye.preventDefault();break}!Et&&ke.isPrintableCharacter(Ye.key)&&(!H&&He(),Dn(Ye),Ye.preventDefault());break}h(!1)},$t=function(Ye){if(i.onSelectAll)i.onSelectAll(Ye);else{var Et=null;if(Ye.checked)Et=[];else{var Wt=er.filter(function(Jn){return Ln(Jn)&&!Qe(Jn)});Wt&&(Et=Wt.map(function(Jn){return Nt(Jn)}))}i.selectionLimit&&Et&&Et.length&&(Et=Et.slice(0,i.selectionLimit)),mn(Ye.originalEvent,Et,Et)}},mn=function(Ye,Et,Wt){i.onChange&&(i.onChange({originalEvent:Ye,value:Et,selectedOption:Wt,stopPropagation:function(){Ye==null||Ye.stopPropagation()},preventDefault:function(){Ye==null||Ye.preventDefault()},target:{name:i.name,id:i.id,value:Et}}),xe.focus(ue.current))},En=function(Ye){var Et=Ye.query;w(Et),i.onFilter&&i.onFilter({originalEvent:Ye,filter:Et})},Tt=function(){w(""),i.onFilter&&i.onFilter({filter:""})},je=function(Ye){if(H){var Et;Ye?Et=Ye.currentTarget:Et=xe.findSingle(ie.current,'li[data-p-highlight="true"]'),Et&&Et.scrollIntoView&&Et.scrollIntoView({block:"nearest",inline:"nearest"})}},He=function(){N(!0),c(l!==-1?l:i.autoOptionFocus?se():at()),xe.focus(ue.current)},ot=function(){c(-1),N(!1),h(!1)},rn=function(Ye){Di.set("overlay",ie.current,r&&r.autoZIndex||Yn.autoZIndex,r&&r.zIndex.overlay||Yn.zIndex.overlay),xe.addStyles(ie.current,{position:"absolute",top:"0",left:"0"}),wt(),je(),Ye&&Ye()},nn=function(Ye){Ye&&Ye(),oe(),i.onShow&&i.onShow()},Jt=function(){he()},_n=function(){i.filter&&i.resetFilterOnHide&&Tt(),Di.clear(ie.current),i.onHide&&i.onHide()},wt=function(){!i.inline&&xe.alignOverlay(ie.current,Y.current.parentElement,i.appendTo||r&&r.appendTo||Yn.appendTo)},Ke=function(Ye){return xe.getAttribute(Ye.target,"data-pc-section")==="clearicon"},st=function(Ye){return xe.getAttribute(Ye.target,"data-pc-section")==="headercheckboxcontainer"},vt=function(Ye){return ie.current&&ie.current.contains(Ye.target)},Vt=function(Ye){ot(),xe.focus(ue.current),Ye.preventDefault(),Ye.stopPropagation()},On=function(){if(i.value!=null&&i.options){if(i.optionGroupLabel){var Ye=0,Et=i.options.findIndex(function(Wt,Jn){return(Ye=Jn)&&$n(i.value,Fe(Wt))!==-1});return Et!==-1?{group:Ye,option:Et}:-1}return $n(i.value,i.options)}return-1},$n=function(Ye,Et){return Et.findIndex(function(Wt){return Ye.some(function(Jn){return ke.equals(Jn,Nt(Wt),W)})})},lr=function(Ye,Et){return ke.equals(Ye,Et,W)},Wn=function(Ye){if(i.value){var Et=Nt(Ye),Wt=At(Ye);return i.value.some(function(Jn){return ke.equals(Wt?Jn:Nt(Jn),Et,W)})}return!1},vr=function(Ye){var Et;if(i.options)if(i.optionGroupLabel){var Wt=zO(i.options),Jn;try{for(Wt.s();!(Jn=Wt.n()).done;){var br=Jn.value;if(Et=Nr(Ye,Fe(br)),Et)break}}catch(Pr){Wt.e(Pr)}finally{Wt.f()}}else Et=Nr(Ye,i.options),ke.isEmpty(Et)&&(Et=Nr(Ye,i.value));return Et?yt(Et):null},Nr=function(Ye,Et){return Et.find(function(Wt){return ke.equals(Nt(Wt),Ye,W)})},yn=function(Ye){O(!0),i.onFocus&&i.onFocus(Ye)},lt=function(Ye){O(!1),i.onBlur&&i.onBlur(Ye)},ut=function(){if(i.onSelectAll)return i.selectAll;if(ke.isEmpty(er))return!1;var Ye=er.filter(function(Et){return!Qe(Et)&&Ln(Et)});return!Ye.some(function(Et){return!Wn(Et)})},yt=function(Ye){return i.optionLabel?ke.resolveFieldData(Ye,i.optionLabel):Ye&&Ye.label!==void 0?Ye.label:Ye},Nt=function(Ye){return i.useOptionAsValue?Ye:i.optionValue?ke.resolveFieldData(Ye,i.optionValue):Ye&&Ye.value!==void 0?Ye.value:Ye},An=function(Ye){return i.dataKey?ke.resolveFieldData(Ye,i.dataKey):yt(Ye)},Nn=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupLabel)},It=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupLabel)},Fe=function(Ye){return ke.resolveFieldData(Ye,i.optionGroupChildren)},Qe=function(Ye){var Et;if(!Se()&&!Wn(Ye))return!0;var Wt=i.optionDisabled;return Wt?ke.isFunction(Wt)?Wt(Ye):ke.resolveFieldData(Ye,Wt):Ye&&((Et=Ye.disabled)!==null&&Et!==void 0?Et:!1)},At=function(Ye){return!i.useOptionAsValue&&i.optionValue||Ye&&Ye.value!==void 0},jt=function(Ye){return i.optionGroupLabel&&Ye.group},Xt=function(){return ke.isNotEmpty(i.value)},Zt=function(){return xe.getFocusableElements(ie.current,':not([data-p-hidden-focusable="true"])').length>0},Sn=function(Ye){var Et;return Ln(Ye)&&((Et=yt(Ye))===null||Et===void 0?void 0:Et.toLocaleLowerCase(i.filterLocale).startsWith(U.current.toLocaleLowerCase(i.filterLocale)))},Ln=function(Ye){return ke.isNotEmpty(Ye)&&!(Qe(Ye)||jt(Ye))},zn=function(Ye){return Ln(Ye)&&Wn(Ye)},at=function(){if(Xt()){for(var Ye=function(){var br=i.value[Wt],Pr=er.findIndex(function(oa){return zn(oa)&&lr(br,Nt(oa))});if(Pr>-1)return{v:Pr}},Et,Wt=i.value.length-1;Wt>=0;Wt--)if(Et=Ye(),Et)return Et.v}return-1},se=function(){var Ye=at();return Ye<0?We():Ye},Me=function(){var Ye=at();return Ye<0?dt():Ye},We=function(){return er.findIndex(function(Ye){return Ln(Ye)})},dt=function(){return ke.findLastIndex(er,function(Ye){return Ln(Ye)})},xt=function(Ye){var Et=Ye<er.length-1?er.slice(Ye+1).findIndex(function(Wt){return Ln(Wt)}):-1;return Et>-1?Et+Ye+1:Ye},Rt=function(Ye){var Et=Ye>0?ke.findLastIndex(er.slice(0,Ye),function(Wt){return Ln(Wt)}):-1;return Et>-1?Et:Ye},Dn=function(Ye){U.current=(U.current||"")+Ye.key;var Et=-1;ke.isNotEmpty(U.current)&&(l!==-1?(Et=er.slice(l).findIndex(function(Wt){return Sn(Wt)}),Et=Et===-1?er.slice(0,l).findIndex(function(Wt){return Sn(Wt)}):Et+l):Et=er.findIndex(function(Wt){return Sn(Wt)}),Et===-1&&l===-1&&(Et=se()),Et!==-1&&kn(Ye,Et)),ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){U.current="",ce.current=null},500)},kn=function(Ye,Et){l!==Et&&(c(Et),je(Ye),i.selectOnFocus&&me(Ye,er[Et],!1))},Hn=function(Ye,Et){if(Ye.stopPropagation(),!!Mr(Ye.currentTarget)){var Wt=i.value.filter(function(Jn){return!ke.equals(Jn,Et,W)});i.onRemove&&i.onRemove({originalEvent:Ye,value:Wt}),mn(Ye,Wt,Et)}},Mr=function(Ye){var Et=re.current,Wt=Et.clientWidth<Et.scrollWidth;if(!Wt)return!0;var Jn=Ye.closest('[data-pc-section="token"]'),br=window.getComputedStyle(Et),Pr=window.getComputedStyle(Jn),oa=Et.clientWidth-parseFloat(br.paddingLeft)-parseFloat(br.paddingRight),da=Jn.getBoundingClientRect().right+parseFloat(Pr.marginRight)-Et.getBoundingClientRect().left;return da<=oa},Kr=function(){var Ye=/{(.*?)}/,Et=i.selectedItemsLabel||ni("selectionMessage"),Wt=i.value?i.value.length:0;return Ye.test(Et)?Et.replace(Et.match(Ye)[0],Wt+""):Et},qn=function(){var Ye;if(!K&&!i.fixedPlaceholder){var Et;return ke.isNotEmpty(i.maxSelectedLabels)&&((Et=i.value)===null||Et===void 0?void 0:Et.length)>i.maxSelectedLabels?Kr():ke.isArray(i.value)?i.value.reduce(function(Wt,Jn,br){return Wt+(br!==0?", ":"")+vr(Jn)},""):""}return Ye},Fn=function(){var Ye=i.value?i.value.length:0;if(ke.isNotEmpty(i.maxSelectedLabels)&&Ye>i.maxSelectedLabels)return Kr();if(i.selectedItemTemplate)return K?ke.getJSXElement(i.selectedItemTemplate):i.value.map(function(Wt,Jn){var br=ke.getJSXElement(i.selectedItemTemplate,Wt);return b.createElement(b.Fragment,{key:Jn},br)});if(i.display==="chip"&&!K){var Et=i.value.slice(0,i.maxSelectedLabels||Ye);return Et.map(function(Wt,Jn){var br={context:{value:Wt,index:Jn}},Pr=vr(Wt),oa=Pr+"_"+Jn,da=n({"aria-label":ni("removeTokenIcon"),className:Ae("removeTokenIcon"),onClick:function(te){return Hn(te,Wt)},onKeyDown:function(te){return ai(te,Wt)},tabIndex:i.tabIndex||"0"},Ee("removeTokenIcon",br)),Vs=!i.disabled&&(i.removeIcon?nr.getJSXIcon(i.removeIcon,bl({},da),{props:i}):b.createElement(hb,da)),mo=n({className:Ae("token")},Ee("token",br)),Xr=n({className:Ae("tokenLabel")},Ee("tokenLabel",br));return b.createElement("div",ks({},mo,{key:oa}),b.createElement("span",Xr,Pr),Vs)})}return qn()},sr=function(){var Ye=i.optionGroupLabel?Lr(i.options):i.options;if(Z){var Et=A.trim().toLocaleLowerCase(i.filterLocale),Wt=i.filterBy?i.filterBy.split(","):[i.optionLabel||"label"];if(i.optionGroupLabel){var Jn=[],br=zO(i.options),Pr;try{for(br.s();!(Pr=br.n()).done;){var oa=Pr.value,da=P0.filter(Fe(oa),Wt,Et,i.filterMatchMode,i.filterLocale);da&&da.length&&Jn.push(bl(bl({},oa),_f({},i.optionGroupChildren,da)))}}catch(Vs){br.e(Vs)}finally{br.f()}return Lr(Jn)}return P0.filter(Ye,Wt,Et,i.filterMatchMode,i.filterLocale)}return Ye},Lr=function(Ye){return(Ye||[]).reduce(function(Et,Wt,Jn){Et.push(bl(bl({},Wt),{},{group:!0,index:Jn}));var br=Fe(Wt);return br&&br.forEach(function(Pr){return Et.push(Pr)}),Et},[])},pi=function(Ye){switch(Ye.code){case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;mn(Ye,[],[]),Ye.preventDefault(),Ye.stopPropagation();break}},ai=function(Ye,Et){switch(Ye.code){case"Space":case"NumpadEnter":case"Enter":if(i.inline)break;Hn(Ye,Et),Ye.preventDefault(),Ye.stopPropagation();break}};b.useImperativeHandle(e,function(){return{props:i,show:He,hide:ot,focus:function(){return xe.focus(ue.current)},getElement:function(){return z.current},getOverlay:function(){return ie.current},getInput:function(){return ue.current}}}),Li(function(){wt()}),b.useEffect(function(){ke.combinedRefs(ue,i.inputRef)},[ue,i.inputRef]),b.useEffect(function(){i.overlayVisible===!0?He():i.overlayVisible===!1&&ot()},[i.overlayVisible]),fr(function(){H&&A&&Z&&wt()},[H,A,Z]),ja(function(){Di.clear(ie.current)});var ui=function(){var Ye=n({className:Ae("clearIcon"),"aria-label":ni("clear"),onClick:function(br){return mn(br,[],[])},onKeyDown:function(br){return pi(br)},tabIndex:i.tabIndex||"0"},Ee("clearIcon")),Et=i.clearIcon||b.createElement(mc,Ye),Wt=nr.getJSXIcon(Et,bl({},Ye),{props:i});return!K&&i.showClear&&!i.disabled?Wt:null},Pi=function(){var Ye=Fn(),Et=n({ref:Y,className:Ae("labelContainer")},Ee("labelContainer")),Wt=n({ref:re,className:Ae("label",{empty:K})},Ee("label"));return b.createElement("div",Et,b.createElement("div",Wt,Ye||i.placeholder||i.emptyMessage||"empty"))},er=sr(),Ui=ke.isNotEmpty(i.tooltip),Ti=v2.getOtherProps(i),Si=ke.reduceKeys(Ti,xe.ARIA_PROPS),Hi=n({className:Ae("triggerIcon")},Ee("triggerIcon")),hn=n({className:Ae("trigger")},Ee("trigger")),Ue=i.loadingIcon?nr.getJSXIcon(i.loadingIcon,bl({},Hi),{props:i}):b.createElement(R1,ks({spin:!0},Hi)),Kt=i.dropdownIcon?nr.getJSXIcon(i.dropdownIcon,bl({},Hi),{props:i}):b.createElement(Yd,Hi),jn=b.createElement("div",hn,i.loading?Ue:Kt),jr=!i.inline&&Pi(),kr=!i.inline&&ui(),Ka=n(bl(bl({ref:z,id:i.id,style:bl(bl({},i.style),fe("root")),className:ft(i.className,Ae("root",{focusedState:M,context:r,overlayVisibleState:H}))},Ti),{},{onClick:ae}),v2.getOtherProps(i),Ee("root")),Vr=n({className:"p-hidden-accessible","data-p-hidden-accessible":!0},Ee("hiddenInputWrapper")),Es=n(bl({ref:ue,id:i.inputId,name:i.name,type:"text",onFocus:yn,onBlur:lt,onKeyDown:fn,role:"combobox","aria-expanded":H,disabled:i.disabled,tabIndex:i.disabled?-1:i.tabIndex,value:qn()},Si),Ee("input"));return b.createElement(b.Fragment,null,b.createElement("div",Ka,b.createElement("div",Vr,b.createElement("input",ks({},Es,{readOnly:!0}))),!i.inline&&b.createElement(b.Fragment,null,jr,kr,jn),b.createElement($O,ks({hostName:"MultiSelect",ref:ie,visibleOptions:er},i,{onClick:ve,onOverlayHide:ot,filterValue:m,focusedOptionIndex:l,onFirstHiddenFocus:De,onLastHiddenFocus:Ne,firstHiddenFocusableElementOnOverlay:X,lastHiddenFocusableElementOnOverlay:R,setFocusedOptionIndex:c,hasFilter:Z,isValidOption:Ln,getOptionValue:Nt,updateModel:mn,onFilterInputChange:En,resetFilter:Tt,onCloseClick:Vt,onSelectAll:$t,getOptionLabel:yt,getOptionRenderKey:An,isOptionDisabled:Qe,getOptionGroupChildren:Fe,getOptionGroupLabel:It,getOptionGroupRenderKey:Nn,isSelected:Wn,getSelectedOptionIndex:On,isAllSelected:ut,onOptionSelect:me,allowOptionSelect:Se,in:H,onEnter:rn,onEntered:nn,onExit:Jt,onExited:_n,ptm:Ee,cx:Ae,sx:fe,isUnstyled:ne,metaData:ge,changeFocusedOptionIndex:kn}))),Ui&&b.createElement(cn,ks({target:z,content:i.tooltip,pt:Ee("tooltip")},i.tooltipOptions)))}));YO.displayName="MultiSelect";const Ode=t=>{var Ee,Ae,fe,ne,q,ee,oe,he,De,Ne;const{field:e,fieldIndex:n,row:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isBuilderMode:u,isAdmin:d}=Ht(),[f,h]=k.useState([]),[g,v]=k.useState(!1),[m,A]=k.useState(!1),{userSelectedLanguage:w,formBuilderFormLayout:C,sectionSettingUpdate:S,pageSettingUpdate:T,fieldSettingUpdate:x}=sn(),{taskRegisterData:E,updateTaskRegisterData:_,updateTaskProgressValue:M,userTaskSubmitFormData:O,updateUserFormDataSubmit:F,task_status:P,TASK_PUBLISHED:H}=Ar(),[N,z]=k.useState(0),[U,ce]=k.useState(!1),X=()=>{ce(!0)},R=()=>{ce(!1)},ue=ve=>{A(ve)},Y=()=>{A(!1)},ie=ve=>{h(ve.value),r!=null&&r.rowIsRepeatable?W(i,a,e,ve.value):K(ve.value)},re=ve=>{e==null||e.conditionalTabRules.rules.map(Se=>{var Be;(Be=Se==null?void 0:Se.conditions)==null||Be.map(Te=>{var $;if(($=ve.value)!=null&&$.some(pe=>pe===Te.option)){const pe=_t.findIndex(C,ae=>{var le;return ae.uuid===((le=Te==null?void 0:Te.tab)==null?void 0:le.uuid)}),me=C[pe];me.isHidden=!1,T(pe,me)}else{const pe=_t.findIndex(C,ae=>{var le;return ae.uuid===((le=Te==null?void 0:Te.tab)==null?void 0:le.uuid)}),me=C[pe];me.isHidden=!0,T(pe,me)}})})},Z=ve=>{e==null||e.conditionalSectionRules.rules.map(Se=>{var Be;(Be=Se==null?void 0:Se.conditions)==null||Be.map(Te=>{var $;if(($=ve.value)!=null&&$.some(pe=>pe===Te.option)){const pe=_t.findIndex(C,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.tab)==null?void 0:be.uuid)}),me=_t.findIndex(C[pe].children,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.section)==null?void 0:be.uuid)}),ae=C[pe].children[me];ae.isHidden=!1,S(pe,me,ae)}else{const pe=_t.findIndex(C,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.tab)==null?void 0:be.uuid)}),me=_t.findIndex(C[pe].children,le=>{var be;return le.uuid===((be=Te==null?void 0:Te.section)==null?void 0:be.uuid)}),ae=C[pe].children[me];ae.isHidden=!0,S(pe,me,ae)}})})},K=ve=>{const Se=O,Be=_t.cloneDeep(E);if((ve==null?void 0:ve.length)>0&&(Se==null?void 0:Se.length)>0){Be[e==null?void 0:e.uuid]=ve;for(const Te of Se)Te.fieldId===t.field.uuid&&(Te.postData[0]={postValue:ve})}else if(delete Be[e==null?void 0:e.uuid],(Se==null?void 0:Se.length)>0)for(const Te of Se)Te.fieldId===t.field.uuid&&(Te.postData[0]={postValue:[]});if(!(r!=null&&r.rowIsRepeatable)){_(Be);const Te=Object.keys(Be).length;M(Te)}},W=(ve,Se,Be,Te)=>{var $;if(h(Te),O){const pe=[...O],me=_t.findIndex(pe,function(be){return be.rowId===(r==null?void 0:r.uuid)});let ae=($=O[me])==null?void 0:$.repeatableFields,le="<ol class='card '>";Te==null||Te.map(be=>{le=le+`<li>${be}</li>`}),le=le+"</ol>",ae={...ae,[Be==null?void 0:Be.uuid]:le},pe[me]={...pe[me],repeatableFields:ae},F(pe)}(Te==null?void 0:Te.length)>0?Be.isValid=1:Be.isValid=0,x(ve,Se,s,l,n,Be)},ge=()=>{var ve,Se,Be;if(r!=null&&r.rowIsRepeatable){if(r!=null&&r.repeatableFields){const Te=[...r.repeatableFields],$=_t.findIndex(Te,function(pe){return pe.uuid===(e==null?void 0:e.uuid)});$>=0&&Te[$].fieldData?h(pe=>[...pe,Te[$].fieldData]):(e.isValid=0,h([]))}}else{const Te=O,$=_t.cloneDeep(E);if(Te!=null&&Te.length){for(const pe of Te)if(pe.fieldId===t.field.uuid&&((ve=pe==null?void 0:pe.postData)!=null&&ve.length)){h((Se=pe==null?void 0:pe.postData[0])==null?void 0:Se.postValue),$[e==null?void 0:e.uuid]=(Be=pe==null?void 0:pe.postData[0])==null?void 0:Be.postValue;const me=Object.keys($).length;M(me);break}}}v(!0)};k.useEffect(()=>{!g&&(O==null?void 0:O.length)>0&&ge();const ve=Gt.addListener("onSubmitUserForm",()=>{var Te;(Te=e==null?void 0:e.attributes)!=null&&Te.required?(f==null?void 0:f.length)>0?e.isValid=1:e.isValid=0:e.isValid=1}),Se=Gt.addListener("clearRepeatableFields",Te=>{Te===(r==null?void 0:r.uuid)&&(h([]),z(0),e.isValid=0)}),Be=Gt.addListener("OnInvalidFieldCatch",Te=>{e.uuid===(Te==null?void 0:Te.fieldId)?z(1):z(0)});return()=>{ve.remove(),Be.remove(),Se.remove()}});const ye=o.jsxs("div",{onMouseOver:X,onMouseOut:R,children:[u&&U&&o.jsx(Wr,{handleFieldSettingsSidebar:ue,...t}),o.jsxs("div",{className:`field ${u&&" py-3 px-4 builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:u?"col-12 p-fluid field-form-builder":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(Ee=e==null?void 0:e.headerText)==null?void 0:Ee[w==null?void 0:w.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(fe=e==null?void 0:e.label)==null?void 0:fe[w==null?void 0:w.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{message:(ne=e==null?void 0:e.toolTip)==null?void 0:ne[w==null?void 0:w.type],position:"right"})})]}),o.jsx(YO,{onFocus:()=>z(1),value:f,onChange:ve=>{ie(ve),re(ve),Z(ve)},options:e==null?void 0:e.options,optionLabel:`optionText.${w.type}`,placeholder:(q=e==null?void 0:e.placeholder)==null?void 0:q[w==null?void 0:w.type],display:"chip",disabled:d||c}),((ee=e==null?void 0:e.attributes)==null?void 0:ee.required)&&o.jsx("small",{className:"error",children:N===1&&!((f==null?void 0:f.length)>0)?(oe=e==null?void 0:e.validationMesssage)==null?void 0:oe.english:""})]}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(he=e==null?void 0:e.helperText)==null?void 0:he[w==null?void 0:w.type]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]}),((De=e==null?void 0:e.inlineConditionalRules)==null?void 0:De.rules.length)>0&&u===!0&&o.jsx("p",{children:"Inline conditional rules"}),(Ne=e==null?void 0:e.inlineConditionalRules)==null?void 0:Ne.rules.map((ve,Se)=>u===!1?o.jsx("div",{children:ve==null?void 0:ve.conditions.map((Be,Te)=>{if(f!=null&&f.some($=>$===Be.value)||u)return o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(cb,{data:e,ruleIndex:Se,conditionIndex:Te,condition:Be,...t})})},Te)})},`rule-${Se}`):o.jsx(ci,{className:"mt-4",header:`Rule ${Se+1}`,children:o.jsx("div",{children:ve==null?void 0:ve.conditions.map((Be,Te)=>{if(f!=null&&f.some($=>$===Be.value)||u)return o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(cb,{data:e,...t,ruleIndex:Se,conditionIndex:Te,condition:Be})})},Te)})},`rule-${Se}`)},Se))]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Qi,{visibilty:m,closeSettingFieldSidebar:Y,...t},e==null?void 0:e.uuid),o.jsx(xi,{...t,fieldWrap:ye})]})},Fde=t=>{const{options:e,title:n}=t,r=e.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",i=`${e.className} justify-content-start`,a=`${e.titleClassName} pl-1`;return o.jsxs("div",{className:i,children:[o.jsxs("button",{className:e.togglerClassName,onClick:e.onTogglerClick,children:[o.jsx("span",{className:r}),o.jsx(Qt,{})]}),o.jsx("span",{className:a,children:n})]})},KO=t=>{const e=k.useRef(null),{optionIndex:n,option:r,field:i,fieldIndex:a,pageIndex:s,sectionIndex:l,rowIndex:c,columnIndex:u,path:d}=t,{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),[m,A]=k.useState(r==null?void 0:r.optionText[f==null?void 0:f.type]);k.useEffect(()=>(A(r==null?void 0:r.optionText[f==null?void 0:f.type]),()=>{}),[i]),k.useEffect(()=>{const S=setTimeout(()=>{C("optionText",r.uuid,m,f)},1500);return()=>{clearTimeout(S)}},[m]);const w=S=>{const T=d.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(T[fa],T[ha],T[Ca],T[xa],T[Ta],T[Fa],T[Xo],T[wo],S):(T==null?void 0:T.length)>Fa&&(T==null?void 0:T.length)===Bl+1&&(i!=null&&i.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(T[fa],T[ha],T[Ca],T[xa],T[Ta],T[5],T[6],T[7],S):h(s,l,c,u,a,{...S})},C=(S,T,x,E)=>{if(i!=null&&i.options){const _=[...i.options];_[n][S][E==null?void 0:E.type]=x,w({...i,options:_})}};return o.jsx(o.Fragment,{children:o.jsx(N3,{id:r==null?void 0:r.uuid,style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:m||"",disabled:!1,onChange:S=>{A(S.target.value)},tagName:"article"},r==null?void 0:r.uuid)})},XO=t=>{const{optionId:e,field:n,fieldIndex:r,columnIndex:i,sectionIndex:a,rowIndex:s,pageIndex:l,path:c}=t,{fieldSettingUpdate:u,fieldSettingUpdateInlineConditional:d,gridComponentFieldSettingUpdate:f}=sn(),h=m=>{const A=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?d(A[fa],A[ha],A[Ca],A[xa],A[Ta],A[Fa],A[Xo],A[wo],m):(A==null?void 0:A.length)>Fa&&(A==null?void 0:A.length)===Bl+1&&(m!=null&&m.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?f(A[fa],A[ha],A[Ca],A[xa],A[Ta],A[5],A[6],A[7],m):u(l,a,s,i,r,m)},g=()=>{const m=n==null?void 0:n.options.filter(function(w){return(w==null?void 0:w.uuid)!==e}),A={...n,options:m};h(A)},v=()=>{const m=_t.cloneDeep(n),A={...m,options:[...m.options,{uuid:rt(),optionText:{english:"Unititled"},value:rt(),score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]};h(A)};return o.jsxs(o.Fragment,{children:[o.jsx(Ft,{text:!0,label:"Add",className:"w-5rem ml-3 mr-3",onClick:()=>v(),size:"small"}),o.jsx(Ft,{text:!0,className:"w-3rem",size:"small",onClick:()=>{g()},icon:"pi pi-trash"})]})},kde=t=>{var Ne,ve,Se,Be,Te,$,pe,me,ae;const[e,n]=k.useState([]),[r,i]=k.useState(0),{taskRegisterData:a,updateTaskRegisterData:s,updateTaskProgressValue:l,userTaskSubmitFormData:c,task_status:u,updateUserFormDataSubmit:d,taskFieldUpdateHook:f,TASK_PUBLISHED:h,updateProgressDataValuesHook:g}=Ar(),{globalAlignment:v,isBuilderMode:m,isRenderView:A,isAdmin:w}=Ht(),{sectionSettingUpdate:C,userSelectedLanguage:S,fieldSettingUpdate:T,formBuilderFormLayout:x,pageSettingUpdate:E}=sn(),{field:_,fieldIndex:M,sectionIndex:O,pageIndex:F,row:P,rowIndex:H,columnIndex:N,section:z,page:U,isDisabled:ce}=t,[X,R]=k.useState(!1),[ue,Y]=k.useState(!1),[ie,re]=k.useState(!1),Z=()=>{re(!0)},K=()=>{re(!1)},W=le=>{R(le)},ge=()=>{R(!1)},ye=le=>{const be=[...e];le.checked?be.push(le.value):be.splice(be.indexOf(le.value),1),n(be),P!=null&&P.rowIsRepeatable?c&&oe(F,O,_,be):(Ee(le),fe(be),c&&(q(be),(be==null?void 0:be.length)>0?_.isValid=1:_.isValid=0,f(F,O,H,N,M,_)))},Ee=le=>{var Ie;const be=(Ie=le==null?void 0:le.value)==null?void 0:Ie.value;_==null||_.conditionalTabRules.rules.map(Pe=>{var ze;(ze=Pe==null?void 0:Pe.conditions)==null||ze.map(Ze=>{if(be===(Ze==null?void 0:Ze.option)&&(le!=null&&le.checked)){const nt=_t.findIndex(x,Ut=>{var fn;return Ut.uuid===((fn=Ze==null?void 0:Ze.tab)==null?void 0:fn.uuid)}),ht=x[nt];ht.isHidden=!1,E(nt,ht)}else if(be===(Ze==null?void 0:Ze.option)&&!(le!=null&&le.checked)){const nt=_t.findIndex(x,Ut=>{var fn;return Ut.uuid===((fn=Ze==null?void 0:Ze.tab)==null?void 0:fn.uuid)}),ht=x[nt];ht.isHidden=!0,E(nt,ht)}})})},Ae=k.useCallback((le,be)=>{var Ie;if((c==null?void 0:c.length)>0){const Pe=c;if(Pe!=null&&Pe.length){const ze=a;for(const[nt,ht]of be.children.entries())for(const[,Ut]of ht.children.entries())for(const[fn,$t]of Ut.children.entries())if(ht!=null&&ht.rowIsRepeatable){if((ht==null?void 0:ht.rowIsRepeatable)===!0){const mn=_t.findIndex(Pe,function(En){return En.rowId===ht.uuid});le===!0?mn===-1&&(Pe.push({postData:[],tabId:U.uuid,rowId:ht==null?void 0:ht.uuid,tabIndex:F,sectionId:z.uuid,minimumEntries:z==null?void 0:z.minimumEntries,sectionIndex:O,sectionHeading:z.heading,subHeadingText:z.subHeadingText,repeatableFields:{},repeatableFieldsData:[],language:"english",isHiddenSection:z.isHidden&&z.isHidden===1?1:0,reviewerChecklist:ht==null?void 0:ht.reviewerChecklist}),ze[ht==null?void 0:ht.uuid]&&delete ze[ht==null?void 0:ht.uuid]):(ze[ht==null?void 0:ht.uuid]&&delete ze[ht==null?void 0:ht.uuid],mn>=0&&Pe.splice(mn,1))}}else{const mn=_t.findIndex(Pe,function(En){return En.fieldId===$t.uuid});le?mn===-1&&(Pe.push({postData:[],tabId:U.uuid,tabIndex:F,...$t.inlineConditionalRules?{inlineConditionalRules:$t.inlineConditionalRules}:{},...$t.conditionalTabRules?{conditionalTabRules:$t.conditionalTabRules}:{},...$t.conditionalSectionRules?{conditionalSectionRules:$t.conditionalSectionRules}:{},sectionId:z.uuid,sectionIndex:O,sectionHeading:z.heading,subHeadingText:z.subHeadingText,reviewerChecklist:$t==null?void 0:$t.reviewerChecklist,rowId:ht.uuid,rowIndex:nt,columnId:z.uuid,columnIndex:N,inlineConditionalField:!0,fieldIndex:fn,fieldId:$t.uuid,fieldInputType:$t.componentType,fieldTitle:(Ie=$t.label)==null?void 0:Ie.english,fieldDescription:$t.description||null,fieldHelperText:$t.helperText||null,fieldHeaderText:$t.headerText||null,fieldFooterText:$t.footerText||null,fieldTitleAbb:$t.abbreviationLabel||$t.label,question_abb_table:$t.textForTable||null,language:"english",isHiddenfield:$t.isHidden&&$t.isHidden===1?1:0,isHiddenSection:z.isHidden&&z.isHidden===1?1:0}),ze[$t==null?void 0:$t.uuid]&&delete ze[$t==null?void 0:$t.uuid]):(ze[$t==null?void 0:$t.uuid]&&delete ze[$t==null?void 0:$t.uuid],mn>=0&&Pe.splice(mn,1))}const Ze=Object.keys(ze).length;g({progressMaxValue:Pe==null?void 0:Pe.length,progressValue:Ze}),d([...Pe])}}},[N,_==null?void 0:_.abbreviationLabel,_==null?void 0:_.componentType,_==null?void 0:_.conditionalSectionRules,_==null?void 0:_.conditionalTabRules,_==null?void 0:_.description,_==null?void 0:_.footerText,_==null?void 0:_.headerText,_==null?void 0:_.helperText,_==null?void 0:_.inlineConditionalRules,_==null?void 0:_.isHidden,_==null?void 0:_.label,_==null?void 0:_.reviewerChecklist,_==null?void 0:_.textForTable,U==null?void 0:U.uuid,F,P==null?void 0:P.uuid,H,z==null?void 0:z.heading,z==null?void 0:z.isHidden,z==null?void 0:z.subHeadingText,z==null?void 0:z.uuid,O,a,g,d,c]),fe=le=>{_==null||_.conditionalSectionRules.rules.map(be=>{var Ie;(Ie=be==null?void 0:be.conditions)==null||Ie.map(Pe=>{if(le!=null&&le.some(ze=>ze.value===Pe.option)){const ze=_t.findIndex(x,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.tab)==null?void 0:Ut.uuid)}),Ze=_t.findIndex(x[ze].children,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.section)==null?void 0:Ut.uuid)}),nt=x[ze].children[Ze];nt.isHidden=!1,Ae(!0,x[ze].children[Ze]),C(ze,Ze,nt)}else{const ze=_t.findIndex(x,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.tab)==null?void 0:Ut.uuid)}),Ze=_t.findIndex(x[ze].children,ht=>{var Ut;return ht.uuid===((Ut=Pe==null?void 0:Pe.section)==null?void 0:Ut.uuid)}),nt=x[ze].children[Ze];nt.isHidden=!0,Ae(!1,x[ze].children[Ze]),C(ze,Ze,nt)}})})},ne=()=>{var be,Ie,Pe,ze;const le=c;if((le==null?void 0:le.length)>0){for(const Ze of le)if(Ze.fieldId===t.field.uuid){n(((be=Ze==null?void 0:Ze.postData[0])==null?void 0:be.postValue.length)>0?(Ie=Ze==null?void 0:Ze.postData[0])==null?void 0:Ie.postValue:[]);const nt=((Pe=Ze==null?void 0:Ze.postData[0])==null?void 0:Pe.postValue.length)>0?(ze=Ze==null?void 0:Ze.postData[0])==null?void 0:ze.postValue:[];_==null||_.conditionalTabRules.rules.map(ht=>{var Ut;(Ut=ht==null?void 0:ht.conditions)==null||Ut.map(fn=>{if(nt.some($t=>$t.value===(fn==null?void 0:fn.option))){const $t=_t.findIndex(x,En=>{var Tt;return En.uuid===((Tt=fn==null?void 0:fn.tab)==null?void 0:Tt.uuid)}),mn=x[$t];mn.isHidden=!1,E($t,mn)}})}),Y(!0);break}}},q=le=>{const be=c,Ie=_t.cloneDeep(a);if((le==null?void 0:le.length)>0&&(be==null?void 0:be.length)>0){Ie[_==null?void 0:_.uuid]=le;for(const ze of be)ze.fieldId===t.field.uuid&&(ze.postData[0]={postValue:le});s(Ie);const Pe=Object.keys(Ie).length;l(Pe)}else{if(delete Ie[_==null?void 0:_.uuid],(be==null?void 0:be.length)>0)for(const ze of be)ze.fieldId===t.field.uuid&&(ze.postData[0]={postValue:[]});s(Ie);const Pe=Object.keys(Ie).length;l(Pe)}},ee=()=>{const le=[];return _==null||_.options.map((be,Ie)=>{var ze,Ze,nt,ht;const Pe=e;le.push(o.jsxs("div",{className:`field ${m&&" py-3 px-4 builder-element-wrapper "}${(_==null?void 0:_.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"flex align-items-center gap-2",children:[o.jsx(Yr,{id:`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`,onFocus:()=>i(1),disabled:w||ce,onChange:Ut=>{ye(Ut)},value:be,checked:Pe==null?void 0:Pe.some(Ut=>Ut.uuid===be.uuid)}),((ze=be==null?void 0:be.hyperlinkText)==null?void 0:ze[S==null?void 0:S.type])===""?o.jsxs("label",{htmlFor:`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`,children:[_!=null&&_.showAlphabetList?o.jsxs("span",{className:"mx-2",children:[" ",_O(Ie)," "]}):o.jsx(o.Fragment,{}),m?o.jsx(o.Fragment,{children:o.jsx(KO,{...t,option:be,optionIndex:Ie})}):o.jsx(o.Fragment,{children:(Ze=be==null?void 0:be.optionText)==null?void 0:Ze[S==null?void 0:S.type]})]}):o.jsx("label",{children:o.jsx("a",{href:(nt=be==null?void 0:be.hyperlinkText)==null?void 0:nt[S==null?void 0:S.type],target:"_blank",rel:"noreferrer",children:(ht=be==null?void 0:be.optionText)==null?void 0:ht[S==null?void 0:S.type]})})]}),m&&o.jsx("div",{className:"builder-radio-option-settings",children:o.jsx(XO,{optionId:be==null?void 0:be.uuid,...t})})]},`checkbox-option-${Ie}-${be==null?void 0:be.uuid}-${m?"builder":"preview"}`))}),le};k.useEffect(()=>{ue||ne();const le=Gt.addListener("clearRepeatableFields",Pe=>{Pe===(P==null?void 0:P.uuid)&&(n([]),i(0),_.isValid=0,T(F,O,H,N,M,_))}),be=Gt.addListener("onSubmitUserForm",()=>{var ze;const Pe=e;(ze=_==null?void 0:_.attributes)!=null&&ze.required?(Pe.length>0?_.isValid=1:_.isValid=0,f(F,O,H,N,M,_)):_.isValid=1}),Ie=Gt.addListener("OnInvalidFieldCatch",Pe=>{_.uuid===(Pe==null?void 0:Pe.fieldId)?i(1):i(0)});return()=>{be.remove(),Ie.remove(),le.remove()}});const oe=(le,be,Ie,Pe)=>{var Ut;n(Pe);const ze=[...c],Ze=_t.findIndex(ze,function(fn){return fn.rowId===(P==null?void 0:P.uuid)});let nt=(Ut=c[Ze])==null?void 0:Ut.repeatableFields,ht="<ol class='card '>";Pe==null||Pe.map(fn=>{ht=ht+`<li>${fn.value}</li>`}),ht=ht+"</ol>",nt={...nt,[Ie==null?void 0:Ie.uuid]:ht},ze[Ze]={...ze[Ze],repeatableFields:nt},d(ze),(Pe==null?void 0:Pe.length)>0?Ie.isValid=1:Ie.isValid=0,T(le,be,H,N,Ze,Ie)},he=o.jsxs("div",{onMouseOver:Z,onMouseOut:K,children:[m&&ie&&o.jsx(Wr,{handleFieldSettingsSidebar:W,...t}),o.jsx("div",{className:`field ${m&&" py-3 px-4 builder-element-wrapper "}${(_==null?void 0:_.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-12",children:[(_==null?void 0:_.showHeaderText)&&o.jsx("h6",{children:(Ne=_==null?void 0:_.headerText)==null?void 0:Ne[S==null?void 0:S.type]}),(_==null?void 0:_.showLabel)&&o.jsxs("label",{htmlFor:`${M}`,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((ve=_==null?void 0:_.attributes)==null?void 0:ve.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",m?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(Se=_==null?void 0:_.label)==null?void 0:Se[S==null?void 0:S.type]}),o.jsx("span",{className:"ml-3",children:(_==null?void 0:_.showToolTip)&&o.jsx(zi,{message:(Be=_==null?void 0:_.toolTip)==null?void 0:Be[S==null?void 0:S.type],position:"right"})})]}),ee(),o.jsx("div",{children:((Te=_==null?void 0:_.attributes)==null?void 0:Te.required)&&o.jsx("small",{className:"error",children:r===1&&!(e&&(e==null?void 0:e.length)>0)?($=_==null?void 0:_.validationMesssage)==null?void 0:$.language:""})}),o.jsx("div",{children:(_==null?void 0:_.showHelperText)&&o.jsx("small",{children:(pe=_==null?void 0:_.helperText)==null?void 0:pe[S==null?void 0:S.type]})}),((me=_==null?void 0:_.inlineConditionalRules)==null?void 0:me.rules.length)>0&&m===!0&&o.jsx("p",{children:"Inline conditional rules"}),(ae=_==null?void 0:_.inlineConditionalRules)==null?void 0:ae.rules.map((le,be)=>{if(m===!1){const Ie=e;return o.jsx("div",{children:le==null?void 0:le.conditions.map((Pe,ze)=>o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:Ie==null?void 0:Ie.some(Ze=>Ze.value===Pe.value),inputValue:e,condition:Pe,ruleIndex:be,conditionIndex:ze,field:_,section:z,page:U,row:P,pageIndex:F,sectionIndex:O,rowIndex:H,columnIndex:N,...t})},`select-rule-${be}-`+ze))},`rule-${be}`)}else return o.jsx(ci,{className:"mt-4",header:`Rule ${be+1}`,children:o.jsx("div",{children:le==null?void 0:le.conditions.map((Ie,Pe)=>o.jsx(k.Fragment,{children:o.jsxs("div",{className:"card",children:[o.jsx(fu,{style:{marginTop:-20},className:"mr-2",severity:"success",value:`Condition: ${Ie==null?void 0:Ie.value}`,rounded:!0}),o.jsx(e0,{isConditionTrue:(e==null?void 0:e.some(ze=>ze.value===Ie.value))||m,inputValue:e,condition:Ie,ruleIndex:be,conditionIndex:Pe,field:_,section:z,page:U,row:P,pageIndex:F,sectionIndex:O,rowIndex:H,columnIndex:N,...t})]})},`select-rule-${be}-`+Pe))},`rule-${be}`)},be)})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]}),De=()=>{let le="";return m&&(le=le+" field-form-builder"),u===h&&w===!0&&(le=le+" card"),le};return o.jsxs(o.Fragment,{children:[X===!0&&o.jsx(Qi,{visibilty:X,closeSettingFieldSidebar:ge,...t},_==null?void 0:_.uuid),o.jsx("div",{className:De(),dir:v,children:u===h&&w===!0?o.jsx(ci,{headerTemplate:le=>{var be;return o.jsx(Fde,{options:le,title:(be=_==null?void 0:_.label)==null?void 0:be[S==null?void 0:S.type]})},toggleable:!0,children:he}):he})]})},Pde=6,Mde=t=>{var ne,q,ee,oe,he,De,Ne,ve,Se,Be,Te;const{task_status:e,taskRegisterData:n,updateTaskRegisterData:r,updateTaskProgressValue:i,userTaskSubmitFormData:a,updateUserFormDataSubmit:s,updateProgressDataValuesHook:l,TASK_PUBLISHED:c}=Ar(),{field:u,row:d,pageIndex:f,sectionIndex:h,section:g,page:v,rowIndex:m,columnIndex:A,isDisabled:w=!1}=t,{isAdmin:C,isBuilderMode:S}=Ht(),{pageSettingUpdate:T,formBuilderFormLayout:x,sectionSettingUpdate:E,selectedLanguage:_}=sn(),[M,O]=k.useState(!1),[F,P]=k.useState(null),[H,N]=k.useState(0),[z,U]=k.useState(!1),[ce,X]=k.useState(!1),R=()=>{X(!0)},ue=()=>{X(!1)},Y=$=>{O($)},ie=()=>{O(!1)},re=()=>{var $,pe,me,ae;if((a==null?void 0:a.length)>0)if(d!=null&&d.rowIsRepeatable){if(d!=null&&d.repeatableFields){const le=[...d.repeatableFields],be=_t.findIndex(le,function(Ie){return Ie.uuid===(u==null?void 0:u.uuid)});be>=0&&le[be].fieldData?P(le[be].fieldData):(u.isValid=0,P(null))}}else{const le=a,be=_t.cloneDeep(n);let Ie=null;if(le!=null&&le.length){for(const Pe of le)if(Pe.fieldId===t.field.uuid&&(($=Pe==null?void 0:Pe.postData)!=null&&$.length)){Ie=(pe=Pe==null?void 0:Pe.postData[0])==null?void 0:pe.postValue,P((me=Pe==null?void 0:Pe.postData[0])==null?void 0:me.postValue),be[u==null?void 0:u.uuid]=(ae=Pe==null?void 0:Pe.postData[0])==null?void 0:ae.postValue;const ze=Object.keys(be).length;i(ze);break}}Z({value:Ie}),W({value:Ie})}setTimeout(()=>{U(!0)},2e3)},Z=$=>{const pe=$.value;u==null||u.conditionalTabRules.rules.map(me=>{var ae;(ae=me==null?void 0:me.conditions)==null||ae.map(le=>{const be=_t.findIndex(x,Ie=>{var Pe;return Ie.uuid===((Pe=le==null?void 0:le.tab)==null?void 0:Pe.uuid)});if(pe===(le==null?void 0:le.option)){const Ie=x[be];Ie.isHidden=!1,T(be,Ie)}else{let Ie=x[be];Ie={...Ie,isHidden:!0},T(be,Ie)}})})},K=k.useCallback(($,pe)=>{var me;if((a==null?void 0:a.length)>0){const ae=a;if(ae!=null&&ae.length){const le=n;for(const[Ie,Pe]of pe.children.entries())for(const[,ze]of Pe.children.entries())for(const[Ze,nt]of ze.children.entries())if(Pe!=null&&Pe.rowIsRepeatable){if((Pe==null?void 0:Pe.rowIsRepeatable)===!0){const ht=_t.findIndex(ae,function(Ut){return Ut.rowId===Pe.uuid});$===!0?ht===-1&&(ae.push({postData:[],tabId:v.uuid,rowId:Pe==null?void 0:Pe.uuid,tabIndex:f,sectionId:g.uuid,minimumEntries:g==null?void 0:g.minimumEntries,sectionIndex:h,sectionHeading:g.heading,subHeadingText:g.subHeadingText,repeatableFields:{},repeatableFieldsData:[],language:"english",isHiddenSection:!!(g.isHidden&&g.isHidden===!0),reviewerChecklist:Pe==null?void 0:Pe.reviewerChecklist}),le[Pe==null?void 0:Pe.uuid]&&delete le[Pe==null?void 0:Pe.uuid]):(le[Pe==null?void 0:Pe.uuid]&&delete le[Pe==null?void 0:Pe.uuid],ht>=0&&ae.splice(ht,1))}}else{const ht=_t.findIndex(ae,function(Ut){return Ut.fieldId===nt.uuid});$?ht===-1&&(ae.push({postData:[],tabId:v.uuid,tabIndex:f,...nt.inlineConditionalRules?{inlineConditionalRules:nt.inlineConditionalRules}:{},...nt.conditionalTabRules?{conditionalTabRules:nt.conditionalTabRules}:{},...nt.conditionalSectionRules?{conditionalSectionRules:nt.conditionalSectionRules}:{},sectionId:g.uuid,sectionIndex:h,sectionHeading:g.heading,subHeadingText:g.subHeadingText,reviewerChecklist:nt==null?void 0:nt.reviewerChecklist,rowId:Pe.uuid,rowIndex:Ie,columnId:g.uuid,columnIndex:A,inlineConditionalField:!0,fieldIndex:Ze,fieldId:nt.uuid,fieldInputType:nt.componentType,fieldTitle:(me=nt.label)==null?void 0:me.english,fieldDescription:nt.description||null,fieldHelperText:nt.helperText||null,fieldHeaderText:nt.headerText||null,fieldFooterText:nt.footerText||null,fieldTitleAbb:nt.abbreviationLabel||nt.label,question_abb_table:nt.textForTable||null,language:"english",isHiddenfield:nt.isHidden&&nt.isHidden===1?1:0,isHiddenSection:!!(g.isHidden&&g.isHidden===!0)}),le[nt==null?void 0:nt.uuid]&&delete le[nt==null?void 0:nt.uuid]):(le[nt==null?void 0:nt.uuid]&&delete le[nt==null?void 0:nt.uuid],ht>=0&&ae.splice(ht,1))}const be=Object.keys(le).length;l({progressMaxValue:ae==null?void 0:ae.length,progressValue:be}),s([...ae])}}},[A,u==null?void 0:u.abbreviationLabel,u==null?void 0:u.componentType,u==null?void 0:u.conditionalSectionRules,u==null?void 0:u.conditionalTabRules,u==null?void 0:u.description,u==null?void 0:u.footerText,u==null?void 0:u.headerText,u==null?void 0:u.helperText,u==null?void 0:u.inlineConditionalRules,u==null?void 0:u.isHidden,u==null?void 0:u.label,u==null?void 0:u.reviewerChecklist,u==null?void 0:u.textForTable,v==null?void 0:v.uuid,f,d==null?void 0:d.uuid,m,g==null?void 0:g.heading,g==null?void 0:g.isHidden,g==null?void 0:g.subHeadingText,g==null?void 0:g.uuid,h,n,l,s,a]),W=$=>{const pe=$.value;u==null||u.conditionalSectionRules.rules.map(me=>{var ae;(ae=me==null?void 0:me.conditions)==null||ae.map(le=>{if((pe==null?void 0:pe.value)===(le==null?void 0:le.option)){const be=_t.findIndex(x,ze=>{var Ze;return ze.uuid===((Ze=le==null?void 0:le.tab)==null?void 0:Ze.uuid)}),Ie=_t.findIndex(x[be].children,ze=>{var Ze;return ze.uuid===((Ze=le==null?void 0:le.section)==null?void 0:Ze.uuid)}),Pe=x[be].children[Ie];Pe.isHidden=!1,K(!0,x[be].children[Ie]),E(be,Ie,Pe)}else{const be=_t.findIndex(x,ze=>{var Ze;return(ze==null?void 0:ze.uuid)===((Ze=le==null?void 0:le.tab)==null?void 0:Ze.uuid)}),Ie=_t.findIndex(x[be].children,ze=>{var Ze;return(ze==null?void 0:ze.uuid)===((Ze=le==null?void 0:le.section)==null?void 0:Ze.uuid)}),Pe=x[be].children[Ie];Pe.isHidden=!0,K(!1,x[be].children[Ie]),E(be,Ie,Pe)}})})};k.useEffect(()=>{z||re();const $=Gt.addListener("clearRepeatableFields",ae=>{ae===(d==null?void 0:d.uuid)&&(P(""),N(0),u.isValid=1)}),pe=Gt.addListener("onSubmitUserForm",()=>{var ae;if((ae=u==null?void 0:u.attributes)!=null&&ae.required){const le=F;le!=null&&le.uuid&&(le!=null&&le.value)?u.isValid=1:u.isValid=0}else u.isValid=1}),me=Gt.addListener("OnInvalidFieldCatch",ae=>{(u==null?void 0:u.uuid)===(ae==null?void 0:ae.fieldId)?N(1):N(0)});return()=>{pe.remove(),me.remove(),$.remove()}});const ge=($,pe)=>{var me;if(a){const ae=[...a],le=_t.findIndex(ae,function(Ie){return Ie.rowId===(d==null?void 0:d.uuid)});let be=(me=a[le])==null?void 0:me.repeatableFields;be={...be,[$==null?void 0:$.uuid]:pe==null?void 0:pe.optionText[_]},ae[le]={...ae[le],repeatableFields:be},s(ae)}P(pe),pe!==null?$.isValid=1:$.isValid=0},ye=$=>{var pe;P($.target.value),Z($),W($),d!=null&&d.rowIsRepeatable?ge(u,(pe=$==null?void 0:$.target)==null?void 0:pe.value):Ae($),setTimeout(()=>{Gt.emit("updatePageRender","complete")},1e3)},Ee=()=>{var $;if((($=u==null?void 0:u.fieldType)==null?void 0:$.type)==="radio"){const pe=[];return u==null||u.options.map((me,ae)=>{var be,Ie,Pe,ze;const le=F;pe.push(o.jsxs("div",{className:`field-radiobutton ${u!=null&&u.showButtonLayout?"col-6 field-radiobutton-builder":""}`,onClick:()=>{(!C||!w)&&e!==Pde&&ye({value:me,target:{value:me}})},style:(le==null?void 0:le.uuid)===(me==null?void 0:me.uuid)&&(u!=null&&u.showButtonLayout)?{backgroundColor:"#0F8BFD",padding:5,borderRadius:8}:{padding:5},children:[o.jsx(ia,{onFocus:()=>{(!C||!w)&&N(1)},inputId:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder-radio":"preview"}`,onChange:Ze=>{(!C||!w)&&ye(Ze)},value:me,name:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder":"preview"}`,checked:(le==null?void 0:le.uuid)===(me==null?void 0:me.uuid),disabled:C||w,readOnly:C||w}),((be=me==null?void 0:me.hyperlinkText)==null?void 0:be[_])===""?o.jsxs("label",{htmlFor:`radio-option-${ae}-${me==null?void 0:me.uuid}-${S?"builder-label":"preview"}`,children:[u!=null&&u.showAlphabetList?o.jsxs("span",{className:"mx-2",children:[" ",_O(ae)," "]}):"",S?o.jsx(o.Fragment,{children:o.jsx(KO,{...t,option:me,optionIndex:ae})}):o.jsxs(o.Fragment,{children:[" ",(Ie=me==null?void 0:me.optionText)==null?void 0:Ie[_]]})]}):o.jsx("label",{children:o.jsx("a",{href:(Pe=me==null?void 0:me.hyperlinkText)==null?void 0:Pe[_],target:"_blank",rel:"noreferrer",children:(ze=me==null?void 0:me.optionText)==null?void 0:ze[_]})}),S&&o.jsx("div",{className:"builder-radio-option-settings",children:o.jsx(XO,{optionId:me==null?void 0:me.uuid,...t})})]},"li-item-"+ae))}),pe}},Ae=$=>{var be,Ie;P($.target.value);const pe={value:$.target.value};Z(pe),W(pe);const me=a,ae=_t.cloneDeep(n);if((be=$==null?void 0:$.target)!=null&&be.value&&(me==null?void 0:me.length)>0)for(const Pe of me)Pe.fieldId===t.field.uuid&&(ae[u==null?void 0:u.uuid]=(Ie=$==null?void 0:$.target)==null?void 0:Ie.value,Pe.postData[0]={postValue:$.target.value});else delete ae[u==null?void 0:u.uuid];r(ae);const le=Object.keys(ae).length;i(le)},fe=o.jsxs("div",{onMouseOver:R,onMouseOut:ue,children:[S&&ce&&o.jsx(Wr,{handleFieldSettingsSidebar:Y,...t}),o.jsx("div",{className:`field ${S&&" py-3 px-4 builder-element-wrapper "}${(u==null?void 0:u.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-12",children:[(u==null?void 0:u.showHeaderText)&&o.jsx("h6",{children:(ne=u==null?void 0:u.headerText)==null?void 0:ne[_]}),(u==null?void 0:u.showLabel)&&o.jsxs("label",{htmlFor:u.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((q=u==null?void 0:u.attributes)==null?void 0:q.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",S?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(ee=u==null?void 0:u.label)==null?void 0:ee[_]}),o.jsx("span",{className:"ml-3",children:u!=null&&u.showToolTip?o.jsx(o.Fragment,{children:o.jsx(zi,{message:(oe=u==null?void 0:u.toolTip)==null?void 0:oe[_],position:"right"})}):""})]}),(u==null?void 0:u.showButtonLayout)===!0?o.jsxs("div",{className:"grid",children:[Ee()," "]}):Ee(),o.jsx("div",{children:((he=u==null?void 0:u.attributes)==null?void 0:he.required)&&o.jsx("small",{className:"error",children:H===1&&F!==null?(De=u==null?void 0:u.validationMesssage)==null?void 0:De.language:""})}),o.jsx("div",{children:(u==null?void 0:u.showHelperText)&&o.jsx("small",{children:(Ne=u==null?void 0:u.helperText)==null?void 0:Ne[_]})}),((ve=u==null?void 0:u.inlineConditionalRules)==null?void 0:ve.rules.length)>0&&S===!0&&o.jsx("p",{children:"Inline conditional rules"}),z===!0&&((Be=(Se=u==null?void 0:u.inlineConditionalRules)==null?void 0:Se.rules)==null?void 0:Be.length)>0&&((Te=u==null?void 0:u.inlineConditionalRules)==null?void 0:Te.rules.map(($,pe)=>{const me=F;return S===!1?o.jsx("div",{children:$==null?void 0:$.conditions.map((ae,le)=>o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:!!((me==null?void 0:me.value)===ae.value||S),inputValue:F,condition:ae,ruleIndex:pe,conditionIndex:le,field:u,section:g,page:v,row:d,pageIndex:f,sectionIndex:h,rowIndex:m,columnIndex:A,isAdmin:C,...t})},`select-rule-${pe}-`+le))},`rule-${pe}`):o.jsx(ci,{className:"mt-4",header:`Rule ${pe+1}`,children:o.jsx("div",{children:$==null?void 0:$.conditions.map((ae,le)=>{const be=F;return o.jsx(k.Fragment,{children:o.jsx(e0,{isConditionTrue:!!((be==null?void 0:be.value)===ae.value||S),inputValue:F,condition:ae,ruleIndex:pe,conditionIndex:le,field:u,section:g,page:v,row:d,pageIndex:f,sectionIndex:h,rowIndex:m,columnIndex:A,...t})},`select-rule-${pe}-`+le)})},`rule-${pe}`)},pe)}))]}),C&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]});return o.jsxs(o.Fragment,{children:[M===!0&&o.jsx(Qi,{visibilty:M,closeSettingFieldSidebar:ie,...t},u==null?void 0:u.uuid),o.jsx(xi,{...t,fieldWrap:fe})]})},Lde=k.memo(Mde),Bde=t=>{var i,a;const{language:e,onHandleChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Text"}),o.jsx(wn,{value:(i=r.text)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("text",e,s.target.value),placeholder:"Heading text",id:r==null?void 0:r.uuid})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(wn,{value:(a=r.hrefLink)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("hrefLink",e,s.target.value),placeholder:"Link"})]})]})},Vde=t=>{const{onHandleChangeHeadingTypeSetttings:e,fieldState:n}=t,r=[{name:"H1",type:"h1"},{name:"H2",type:"h2"},{name:"H3",type:"h3"},{name:"H4",type:"h4"},{name:"H5",type:"h5"}];return o.jsxs("form",{className:"p-fluid",children:[o.jsx("h3",{children:"Select heading type"}),r.map((i,a)=>o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:i==null?void 0:i.type,name:"heading",value:i==null?void 0:i.type,onChange:s=>e(s),checked:n.headingType===i.type}),o.jsx("label",{htmlFor:i.type,children:i.name})]},a))]})},qde=t=>{const{fieldSettingUpdate:e,formBuilderSchemaLanguages:n,formBuilderPublishedStatus:r,fieldSettingUpdateInlineConditional:i,gridComponentFieldSettingUpdate:a}=sn(),{path:s,visibilty:l,field:c,closeSettingFieldSidebar:u,pageIndex:d,sectionIndex:f,rowIndex:h,columnIndex:g,fieldIndex:v,typeName:m}=t,[A,w]=k.useState(c),{updateGlobalToast:C}=Ht(),S=(E,_,M)=>{w(O=>({...O,[E]:{...O[E],[_==null?void 0:_.type]:M}}))},T=E=>{w(_=>({..._,headingType:E==null?void 0:E.value}))},x=()=>{const E=s.split("-").map(Number);(E==null?void 0:E.length)>5&&(E==null?void 0:E.length)===8&&(A!=null&&A.inlineConditionalRules)?i(E[fa],E[ha],E[Ca],E[xa],E[Ta],E[Fa],E[Xo],E[wo],A):(E==null?void 0:E.length)>Fa&&(E==null?void 0:E.length)===Bl+1&&(A!=null&&A.componentType)?a(E[fa],E[ha],E[Ca],E[xa],E[Ta],E[lx],E[cx],E[ux],A):e(d,f,h,g,v,A),C({showToast:!0,toastMessage:"Updated",toastDetail:`${m} updated`,toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"750px"},visible:l,position:"left",className:"p-sidebar-lg",onHide:()=>u(),header:()=>o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[t==null?void 0:t.typeName," settings"]})}),children:[o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:n!=null&&n.length?n.map((E,_)=>o.jsx(io,{tabIndex:_,header:E==null?void 0:E.language,children:o.jsx(Bde,{language:E,fieldState:A,onHandleChange:S,...t})},_)):""})}),o.jsx(wr,{header:"Setting",children:o.jsx(Vde,{onHandleChangeHeadingTypeSetttings:T,fieldState:A})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[!r&&o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>x(),"aria-label":"Update"}),o.jsx(Ft,{label:"Close",type:"button",onClick:()=>u(),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Ude=t=>{var v,m;const{field:e}=t,{isBuilderMode:n}=Ht(),{userSelectedLanguage:r}=sn(),[i,a]=k.useState(!1),[s,l]=k.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=A=>{a(A)},f=()=>{a(!1)},h=()=>{var A,w,C,S,T,x;return(e==null?void 0:e.headingType)==="h1"?o.jsx("h1",{children:(A=e==null?void 0:e.text)==null?void 0:A[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h2"?o.jsx("h2",{children:(w=e==null?void 0:e.text)==null?void 0:w[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h3"?o.jsx("h3",{children:(C=e==null?void 0:e.text)==null?void 0:C[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h4"?o.jsx("h4",{children:(S=e==null?void 0:e.text)==null?void 0:S[r==null?void 0:r.type]}):(e==null?void 0:e.headingType)==="h5"?o.jsx("h5",{children:(T=e==null?void 0:e.text)==null?void 0:T[r==null?void 0:r.type]}):o.jsx("h1",{children:(x=e==null?void 0:e.text)==null?void 0:x[r==null?void 0:r.type]})},g=o.jsxs("div",{className:n?"builder-element-wrapper":"",onMouseOver:c,onMouseOut:u,children:[n&&s&&o.jsx(Wr,{handleFieldSettingsSidebar:d,...t}),o.jsx("div",{className:n?"field-form-builder px-2":" px-2",children:o.jsx("div",{className:"col-12",children:((v=e==null?void 0:e.hrefLink)==null?void 0:v[r==null?void 0:r.type])!==""?o.jsx("a",{href:(m=e==null?void 0:e.hrefLink)==null?void 0:m[r==null?void 0:r.type],target:"_blank",rel:"noreferrer",children:h()}):h()})})]});return o.jsxs(o.Fragment,{children:[i&&o.jsx(qde,{visibilty:i,closeSettingFieldSidebar:f,...t},e==null?void 0:e.uuid),o.jsx(xi,{...t,fieldWrap:g})]})},$de=t=>{var i,a;const{language:e,onHandleQuestionTextChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Question text"}),o.jsx(wn,{placeholder:"Enter question",value:(i=r.questionText)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("questionText",e.type,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Correct answer"}),o.jsx(wn,{placeholder:"Enter correct answer",value:(a=r.correctAnswerComment)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("correctAnswerComment",e.type,s.target.value)})]})]})},jde=t=>{var i;const{onHandleChange:e,fieldState:n,onHandleChangeAttributesSetttings:r}=t;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field",style:{display:"inline-block",width:"150px"},children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Time limit"}),o.jsxs("div",{className:"p-inputgroup",children:[o.jsx(eo,{inputId:"horizontal",showButtons:!0,buttonLayout:"horizontal",step:1,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},value:n==null?void 0:n.timeLimit,onChange:a=>e("timeLimit",a.value)}),o.jsx("span",{className:"p-inputgroup-addon",children:"mins"})]})]})}),o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field",style:{display:"inline-block",width:"100px"},children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Score"}),o.jsx("div",{className:"p-inputgroup",children:o.jsx(eo,{inputId:"horizontal",showButtons:!0,buttonLayout:"horizontal",step:1,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},value:n==null?void 0:n.score,onChange:a=>e("score",a.value)})})]})}),o.jsx("div",{className:"p-fluid",children:o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{inputId:"required",checked:(i=n==null?void 0:n.attributes)==null?void 0:i.required,onChange:a=>r("required",a.checked)}),o.jsx("label",{htmlFor:"required",children:"Is complusory?"})]})})]})},zde=t=>{const{onHandleChange:e,fieldState:n}=t,[r,i]=k.useState([{type:"radio"},{type:"checkbox"}]);return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field field-checkbox",children:[o.jsx(Yr,{inputId:"isAllowMultipleAnswer",value:"isAllowMultipleAnswer",onChange:a=>{e("isAllowMultipleAnswer",a==null?void 0:a.checked),a!=null&&a.checked?(i([{type:"checkbox"}]),e("answerInputType","checkbox")):(i([{type:"radio"}]),e("answerInputType","radio"))},checked:n==null?void 0:n.isAllowMultipleAnswer}),o.jsx("label",{htmlFor:"isAllowMultipleAnswer",className:"p-checkbox-label ",children:"Allow multiple answer"})]}),(n==null?void 0:n.isAllowMultipleAnswer)&&o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Number of options"}),o.jsx(wn,{type:"number",value:(n==null?void 0:n.noOfMultpleAnswer)||0,onChange:a=>{var s;e("noOfMultpleAnswer",(s=a==null?void 0:a.target)==null?void 0:s.value)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Answer input type"}),r.map((a,s)=>o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:a.type,name:"answerInputType",value:a.type,onChange:()=>{if(e("answerInputType",a.type),a.type==="checkbox"&&e("isAllowMultipleAnswer",!0),a.type==="radio"){let l=[...(n==null?void 0:n.answerOptions)||[]];l=l.map(c=>({...c,isCorrect:!1})),e("answerOptions",l),e("isAllowMultipleAnswer",!1)}},checked:(n==null?void 0:n.answerInputType)===a.type}),o.jsx("label",{htmlFor:a.type,children:a.type})]},s))]})]})},Hde=t=>{const{fieldState:e,setFieldState:n,language:r}=t,i=()=>{var g;let f=!1;const h=(g=e==null?void 0:e.answerOptions)==null?void 0:g.filter(v=>(v==null?void 0:v.isCorrect)===!0);return(h==null?void 0:h.length)===parseInt(e==null?void 0:e.noOfMultpleAnswer)&&(f=!0),f},a=f=>o.jsx(o.Fragment,{children:o.jsx(Ft,{text:!0,type:"button",className:"p-button-danger left-space",onClick:()=>d((f==null?void 0:f.uuid)||""),icon:"pi pi-trash"})}),s=f=>o.jsx(o.Fragment,{children:o.jsx(wn,{value:f==null?void 0:f.answersText[r],onChange:h=>c("answersText",(f==null?void 0:f.uuid)||"",h.target.value)})}),l=(f,h)=>o.jsx(o.Fragment,{children:o.jsx(Yr,{inputId:"binary",checked:(f==null?void 0:f.isCorrect)||!1,onChange:g=>{g.checked&&i()||u("isCorrect",(f==null?void 0:f.uuid)||"",g.checked,h)}})}),c=(f,h,g)=>{n(v=>({...v,answerOptions:v!=null&&v.answerOptions?v==null?void 0:v.answerOptions.map(m=>m.uuid!==h?m:{...m,[f]:{...m[f],[r]:g}}):[]}))},u=(f,h,g,v)=>{n(m=>{const{answerOptions:A,isAllowMultipleAnswer:w,answerInputType:C}=m,S=v.rowIndex,T=A.map((x,E)=>{const _=E===S;return w||C==="checkbox"?_?{...x,[f]:g}:x:{...x,[f]:_?g:!1}});return{...m,answerOptions:T}})},d=f=>{const h=_t.findIndex(e==null?void 0:e.answerOptions,v=>v.uuid===f),g=(e==null?void 0:e.answerOptions)&&(e==null?void 0:e.answerOptions.filter(function(v,m){return m!==h}));g!=null&&g.length&&(g==null?void 0:g.length)>0&&n(v=>({...v,answerOptions:g}))};return o.jsx("div",{children:o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.answerOptions,scrollable:!0,children:[o.jsx(xr,{header:"Answer text",body:f=>s(f),headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}}),o.jsx(xr,{body:(f,h)=>l(f,h),header:"Is answer ?",headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}}),o.jsx(xr,{header:"Action",body:f=>a(f),headerStyle:{textAlign:"left"},bodyStyle:{textAlign:"left",overflow:"visible"}})]})})})},Yde=t=>{const e=[],[n]=k.useState([]),{onHandleChange:r,fieldState:i}=t;return k.useEffect(()=>{},[]),o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field mt-3 w-full",children:[o.jsx("label",{children:"Subject"}),o.jsx(Pa,{id:"subject",name:"subject",optionLabel:"subject_title",value:(n==null?void 0:n.length)>0&&(i==null?void 0:i.subject_id)!==null?n.filter(a=>(i==null?void 0:i.subject_id)===(a==null?void 0:a.subject_id))[0]:null,placeholder:"Select a Subject",options:n,className:"w-full",onChange:a=>{var s;r("subject_id",(s=a==null?void 0:a.value)==null?void 0:s.subject_id)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Course category"}),o.jsx(Pa,{id:"course_category",name:"course_category",optionLabel:"course_category_title",value:(e==null?void 0:e.length)>0&&(i==null?void 0:i.course_category_id)!==null?e.filter(a=>(i==null?void 0:i.course_category_id)===(a==null?void 0:a.course_category_id))[0]:null,placeholder:"Select a category",options:e,className:"w-full",onChange:a=>{var s;r("course_category_id",(s=a==null?void 0:a.value)==null?void 0:s.course_category_id)}})]})]})},Kde=t=>{const{formBuilderSchemaLanguages:e,fieldSettingUpdate:n}=sn(),{visibilty:r,setVisibility:i,rowIndex:a,columnIndex:s,fieldIndex:l,pageIndex:c,sectionIndex:u,field:d,typeName:f}=t,[h,g]=k.useState(d),{updateGlobalToast:v}=Ht(),m=(x,E)=>{g(_=>({..._,attributes:{..._.attributes,[x]:E}}))},A=(x,E,_)=>{g(M=>({...M,[x]:{[E]:_}}))},w=(x,E)=>{g(_=>({..._,[x]:E}))},C=()=>{const x=[],_=((h==null?void 0:h.answerOptions)||[]).filter(P=>P.isCorrect===!0),{answerInputType:M,isAllowMultipleAnswer:O,noOfMultpleAnswer:F}=h||{};if(M==="radio")_.length!==1&&x.push("Please select one answer");else if(M==="checkbox"){const P=O?parseInt(F,10)||0:1;_.length!==P&&x.push(P>1?`Select ${P} answers`:"Please select one answer")}return x.length?(v({showToast:!0,toastMessage:"Validation error",toastDetail:x.join(", "),toastType:"error"}),!1):!0},S=()=>{C()&&(n(c,u,a,s,l,h),v({showToast:!0,toastMessage:"Updated",toastDetail:`${f} updated`,toastType:"success"}))},T=()=>{g(x=>Object.assign({},x,{answerOptions:[...x.answerOptions||[],{uuid:rt(),answersText:{english:""},isCorrect:!1}]}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{visible:r,position:"left",className:"p-sidebar-lg",onHide:()=>i(!1),children:[o.jsx("div",{className:"flex justify-content-between flex-wrap card-container ",children:o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{children:[t==null?void 0:t.typeName," settings"," "]})," "]})}),o.jsxs(ts,{children:[o.jsx(wr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:e!=null&&e.length?e.map((x,E)=>o.jsx(io,{tabIndex:E,header:x==null?void 0:x.language,children:o.jsx($de,{language:x,fieldState:h,onHandleQuestionTextChange:A,...t})},E)):""})}),o.jsx(wr,{header:"Advance",children:o.jsx(jde,{fieldState:h,onHandleChangeAttributesSetttings:m,onHandleChange:w,...t})}),o.jsx(wr,{header:"Answers",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(zde,{fieldState:h,onHandleChange:w,...t}),o.jsxs("div",{className:"flex justify-content-between mb-2",children:[o.jsx("h4",{children:"Answers options"}),o.jsx(Ft,{className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>T(),"aria-label":"Add"})]}),(h==null?void 0:h.answerOptions)!==void 0&&o.jsx(o.Fragment,{children:o.jsx(ao,{activeIndex:0,children:e!=null&&e.length?e.map((x,E)=>o.jsx(io,{tabIndex:E,header:x==null?void 0:x.language,children:o.jsx(Hde,{language:x==null?void 0:x.type,fieldState:h,setFieldState:g})},E)):""})})]})}),o.jsx(wr,{header:"Information",children:o.jsx(Yde,{fieldState:h,onHandleChange:w})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ft,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>S(),"aria-label":"Update"}),o.jsx(Ft,{label:"Close",type:"button",onClick:()=>i(!1),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Xde=t=>{var O,F,P,H,N,z;const{isBuilderMode:e}=Ht(),{field:n}=t,{taskRegisterData:r,updateTaskRegisterData:i,updateTaskProgressValue:a,userTaskSubmitFormData:s}=Ar(),{userSelectedLanguage:l}=sn(),{media:c}=Ht(),u=(O=c==null?void 0:c.image)!=null&&O.MediaImage?(F=c==null?void 0:c.image)==null?void 0:F.MediaImage:o.jsx(o.Fragment,{}),[d,f]=k.useState(!1),[h,g]=k.useState([]),[v,m]=k.useState(!1),A=U=>{m(U)},w=()=>{m(!1)},C=()=>{f(!0)},S=()=>{f(!1)},T=U=>{var ue;const ce=_t.cloneDeep(r),X=[...h];U.checked?(ce[n==null?void 0:n.uuid]=(ue=U==null?void 0:U.target)==null?void 0:ue.value,X.push(U.value)):(delete ce[n==null?void 0:n.uuid],X.splice(X.indexOf(U.value),1)),g(X),x(U,X),i(ce);const R=Object.keys(ce).length;a(R)},x=(U,ce)=>{const X=s;if((X==null?void 0:X.length)>0&&U!=null&&U.value)for(const R of X)R.fieldId===t.field.uuid&&(R.postData[0]={postValue:ce})},E=U=>{var ue;const ce=s,X=_t.cloneDeep(r);if((ce==null?void 0:ce.length)>0)if((ue=U==null?void 0:U.target)!=null&&ue.value)for(const Y of ce)Y.fieldId===t.field.uuid&&(X[n==null?void 0:n.uuid]=U==null?void 0:U.value,Y.postData[0]={postValue:U.value});else delete X[n==null?void 0:n.uuid];i(X);const R=Object.keys(X).length;a(R)};k.useEffect(()=>{g([])},[n==null?void 0:n.answerInputType]);const _=()=>{const U=[];return(n==null?void 0:n.answerInputType)==="radio"?n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var ue,Y,ie,re;const R=h;U.push(o.jsxs("div",{className:"flex align-items-center p-field-radiobutton mb-3",children:[o.jsx(ia,{inputId:`${X}`,onChange:Z=>{g(Z.target.value),E(Z)},checked:(R==null?void 0:R.uuid)===(ce==null?void 0:ce.uuid),name:"category",value:ce}),"  ",((ue=ce.answersTextImage)==null?void 0:ue[l==null?void 0:l.type])&&((Y=ce.answersTextImage)==null?void 0:Y[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(ie=ce.answersTextImage)==null?void 0:ie[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),o.jsx("label",{htmlFor:`${X}`,children:(re=ce==null?void 0:ce.answersText)==null?void 0:re[l==null?void 0:l.type]})]},X))})):(n==null?void 0:n.answerInputType)==="checkbox"?n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var R;U.push(o.jsxs("div",{className:"p-field-radiobutton mb-3",children:[o.jsx(Yr,{inputId:`${X}`,name:"category",onChange:ue=>{T(ue)},value:ce,checked:h!=null&&h.length?h==null?void 0:h.some(ue=>ue.uuid===ce.uuid):!1}),"  ",o.jsx("label",{htmlFor:`${X}`,children:(R=ce==null?void 0:ce.answersText)==null?void 0:R[l==null?void 0:l.type]})]},X))})):n!=null&&n.answerOptions&&(n==null||n.answerOptions.map((ce,X)=>{var ue,Y,ie,re,Z,K,W;const R=h;U.push(o.jsxs("div",{className:"p-field-radiobutton mb-3",children:[o.jsx(ia,{inputId:`${X}`,onChange:ge=>{g(ge.target.value),E(ge)},checked:(R==null?void 0:R.uuid)===(ce==null?void 0:ce.uuid),name:"category",value:ce}),"  ",((ue=ce.answersTextImage)==null?void 0:ue[l==null?void 0:l.type])&&((Y=ce.answersTextImage)==null?void 0:Y[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(ie=ce.answersTextImage)==null?void 0:ie[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),o.jsxs("label",{htmlFor:`${X}`,children:[((re=ce.answersTextImage)==null?void 0:re[l==null?void 0:l.type])&&((Z=ce.answersTextImage)==null?void 0:Z[l==null?void 0:l.type])!==""&&o.jsx(u,{mediaId:(K=ce.answersTextImage)==null?void 0:K[l==null?void 0:l.type],className:"mx-3",alt:"questionImage",style:{width:"50px",height:"50px",borderRadius:50}}),(W=ce==null?void 0:ce.answersText)==null?void 0:W[l==null?void 0:l.type]]})]},X))})),U},M=o.jsxs("div",{onMouseOver:C,onMouseOut:S,children:[e&&d&&o.jsx(Wr,{handleFieldSettingsSidebar:A,...t}),o.jsx("div",{className:`field ${e&&" py-3 px-4 builder-element-wrapper "}${(n==null?void 0:n.isFluid)===!0&&" p-fluid"}`,children:o.jsx("div",{className:"grid",children:o.jsxs("div",{className:"col-12 p-fluid",children:[((P=n==null?void 0:n.questionTextImage)==null?void 0:P[l==null?void 0:l.type])&&((H=n==null?void 0:n.questionTextImage)==null?void 0:H[l==null?void 0:l.type])!==""&&o.jsx("div",{className:"text-center assessment_image_container",children:o.jsx(u,{mediaId:(N=n==null?void 0:n.questionTextImage)==null?void 0:N[l==null?void 0:l.type],style:{height:"100px",width:"100px",objectFit:"cover",borderRadius:100},className:"text-center",alt:"questionImage"})}),o.jsx("h5",{children:(z=n==null?void 0:n.questionText)==null?void 0:z[l==null?void 0:l.type]}),_()]})})})]});return o.jsxs(o.Fragment,{children:[v===!0&&o.jsx(Kde,{visibilty:v,setVisibility:w,...t},n==null?void 0:n.uuid),o.jsx(xi,{...t,fieldWrap:M})]})},Rde=t=>{var i,a;const{onHandleChange:e,fieldState:n,language:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Title"}),o.jsx(wn,{value:(i=n.title)==null?void 0:i[r==null?void 0:r.type],onChange:s=>e("title",r,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("span",{className:"must-required",children:"*"})," ",o.jsx("label",{children:"Image Url"}),o.jsx(wn,{value:(a=n.media_url)==null?void 0:a[r==null?void 0:r.type],onChange:s=>e("media_url",r,s.target.value)})]})]})};class RO{constructor(){Rn(this,"formatBytes",(e,n=2)=>{if(e===0||e===void 0||e===null)return"0 Bytes";const r=1024,i=n<0?0:n,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,s)).toFixed(i))+" "+a[s]})}}function b2(t){"@babel/helpers - typeof";return b2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b2(t)}function Gde(t,e){if(b2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(b2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wde(t){var e=Gde(t,"string");return b2(e)=="symbol"?e:e+""}function GO(t,e,n){return(e=Wde(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qde={root:function(e){var n=e.props;return ft("p-badge p-component",GO({"p-badge-no-gutter":ke.isNotEmpty(n.value)&&String(n.value).length===1,"p-badge-dot":ke.isEmpty(n.value),"p-badge-lg":n.size==="large","p-badge-xl":n.size==="xlarge"},"p-badge-".concat(n.severity),n.severity!==null))}},Jde=`
3515
3515
  @layer primereact {
3516
3516
  .p-badge {
3517
3517
  display: inline-block;
@@ -4164,7 +4164,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
4164
4164
  justify-content: center;
4165
4165
 
4166
4166
  margin-top: 20px;
4167
- `,j6e=t=>{const{onSetValue:e,row:n,items:r,setItems:i,isLoading:a,setIsLoading:s}=t,{processPending:l}=mh();k.useEffect(()=>{const d=Gt.addListener("clearRepeatableFields",f=>{f===(n==null?void 0:n.uuid)&&i([])});return()=>{d.remove()}});const c=d=>{const f=[...r,...d.items];i(f)};y5e(d=>c(d));const u=async()=>{s(!0),l()};return o.jsxs($6e,{children:[r.map(d=>o.jsx(U6e,{item:d,onSetValue:e,setIsLoading:s},d.id)),r.length?o.jsx(Ft,{text:!0,label:"Upload",className:"p-button-info",onClick:u,disabled:a,loading:a}):null]})},z6e=(t,e)=>{var q,ee,oe,he,De,Ne,ve;const{field:n,fieldIndex:r,row:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c,isDisabled:u}=t,{isAdmin:d,isBuilderMode:f,fileUploadParams:h}=Ht(),{userSelectedLanguage:g,fieldSettingUpdate:v}=sn(),{taskRegisterData:m,userTaskSubmitFormData:A,task_status:w,TASK_PUBLISHED:C,updateUserFormDataSubmit:S,updateTaskRegisterData:T,updateTaskProgressValue:x}=Ar(),[E,_]=k.useState(!1),[M,O]=k.useState([]),[F,P]=k.useState(!1),[H,N]=k.useState(0),[z,U]=k.useState([]),[ce,X]=k.useState(!1),[R,ue]=k.useState(!1),Y=()=>{ue(!0)},ie=()=>{ue(!1)};console.log("fileUploadParams",h);const re=Se=>{const Be=[...M];if((A==null?void 0:A.length)>0){const Te=[...A],$=_t.cloneDeep(m);Be.push(Se);for(const pe of Te)pe.fieldId===t.field.uuid&&(pe.postData=Be);if((Be==null?void 0:Be.length)>0?($[n==null?void 0:n.uuid]=Be,n.isValid=1):(delete $[n==null?void 0:n.uuid],n.isValid=0),!(i!=null&&i.rowIsRepeatable)){T($);const pe=Object.keys($).length;x(pe)}}O([...Be])},Z=()=>{var Se;if(!(i!=null&&i.rowIsRepeatable)){const Be=A;if((Be==null?void 0:Be.length)>0){for(const Te of Be)if(Te.fieldId===n.uuid&&((Se=Te==null?void 0:Te.postData)!=null&&Se.length)){O(Te==null?void 0:Te.postData),P(!0);break}}}};k.useEffect(()=>{F||Z();const Se=Gt.addListener("clearRepeatableFields",$=>{$===(i==null?void 0:i.uuid)&&(O([]),N(0),n.isValid=0,v(a,s,l,c,r,n))}),Be=Gt.addListener("onSubmitUserForm",$=>{var pe;(pe=n==null?void 0:n.attributes)!=null&&pe.required?(M==null?void 0:M.length)>0?n.isValid=1:n.isValid=0:n.isValid=1}),Te=Gt.addListener("OnInvalidFieldCatch",$=>{n.uuid===($==null?void 0:$.fieldId)?N(1):N(0)});return()=>{Be.remove(),Te.remove(),Se.remove()}});const K=Se=>{_(Se)},W=()=>{_(!1)},ge=OV(k.forwardRef((Se,Be)=>o.jsx(Ft,{text:!0,...Se,ref:Be,disabled:f||ce||u,children:"Select files"}))),ye=Se=>{var Be;if(!(i!=null&&i.rowIsRepeatable)){const Te=_t.cloneDeep(m);delete Te[n==null?void 0:n.uuid],T(Te);const $=Object.keys(Te).length;x($);const pe=A;if(pe!=null&&pe.length){for(const me of pe)if(me.fieldId===t.field.uuid&&((Be=me==null?void 0:me.postData)!=null&&Be.length)){let ae=me==null?void 0:me.postData;ae=ae.filter((be,Ie)=>Ie!==Se),me.postData=ae,(ae==null?void 0:ae.length)>0?n.isValid=1:n.isValid=0;const le=z.filter((be,Ie)=>Ie!==Se);U(le),O(ae),P(!0);break}}else{const me=M.filter((le,be)=>be!==Se),ae=z.filter((le,be)=>be!==Se);U(ae),O(me)}}},Ee=Se=>o.jsx(o.Fragment,{children:o.jsx(Ft,{text:!0,type:"button",className:"p-button-danger ",onClick:()=>ye(Se==null?void 0:Se.rowIndex),icon:"pi pi-trash",size:"small"})}),Ae=Se=>{var Te;const Be=[...M,{fileName:"image",fileSize:"20",fileType:"Mem"}];if((A==null?void 0:A.length)>0){const $=[...A],pe=_t.findIndex($,function(le){return le.rowId===(i==null?void 0:i.uuid)});let me=(Te=A[pe])==null?void 0:Te.repeatableFields,ae="<ol class='card '>";Be==null||Be.map(le=>{const be=le;ae=ae+`<li>${be==null?void 0:be.fileName}</li>`}),ae=ae+"</ol>",me={...me,[n==null?void 0:n.uuid]:ae},$[pe]={...$[pe],repeatableFields:me},S($)}(Be==null?void 0:Be.length)>0?(O(Be),n.isValid=1):n.isValid=0},fe=Se=>{i!=null&&i.rowIsRepeatable?Ae():re(Se),O([...M,Se])},ne=o.jsxs("div",{onMouseOver:Y,onMouseOut:ie,children:[f&&R&&o.jsx(Wr,{handleFieldSettingsSidebar:K,...t}),o.jsx("div",{className:`field ${f&&" py-3 px-4 builder-element-wrapper "}${(n==null?void 0:n.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:f?"col-12 field-form-builder":"col-12",children:[(n==null?void 0:n.showHeaderText)&&o.jsx("h6",{children:(q=n==null?void 0:n.headerText)==null?void 0:q[g==null?void 0:g.type]}),(n==null?void 0:n.showLabel)&&o.jsxs("label",{htmlFor:r,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((ee=n==null?void 0:n.attributes)==null?void 0:ee.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(oe=n==null?void 0:n.label)==null?void 0:oe[g==null?void 0:g.type]}),o.jsx("span",{className:"ml-3",children:(n==null?void 0:n.showToolTip)&&o.jsx(zi,{message:(he=n==null?void 0:n.toolTip)==null?void 0:he[g==null?void 0:g.type],position:"right"})})]}),o.jsx("div",{children:(n==null?void 0:n.showHelperText)&&o.jsx("small",{children:(De=n==null?void 0:n.helperText)==null?void 0:De[g==null?void 0:g.type]})}),o.jsxs("div",{className:"mt-3",children:[w!==C&&!d&&o.jsx(o.Fragment,{children:o.jsxs(r9e,{debug:!1,retries:10,chunkSize:35e3,multiple:!1,autoUpload:!1,destination:h,children:[o.jsx(ge,{}),o.jsx(j6e,{items:z,setItems:U,isLoading:ce,setIsLoading:X,row:i,inputValue:M,onSetValue:fe})]})}),((Ne=n==null?void 0:n.attributes)==null?void 0:Ne.required)&&o.jsx("small",{className:"error",children:H===1&&(M==null?void 0:M.length)===0?(ve=n==null?void 0:n.validationMesssage)==null?void 0:ve[g==null?void 0:g.type]:""}),o.jsx("div",{className:"mt-3",children:o.jsxs(ro,{value:M,emptyMessage:"No Files have been uploaded",children:[o.jsx(xr,{field:"fileName",header:"Filename"}),o.jsx(xr,{field:"fileSize",header:"Size"}),o.jsx(xr,{field:"fileType",header:"type"}),w!==C&&o.jsx(xr,{style:{width:"10%"},headerStyle:{textAlign:"center"},bodyStyle:{textAlign:"center",overflow:"visible"},body:Se=>Ee(Se)})]})})]})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]});return o.jsxs(o.Fragment,{children:[E===!0&&o.jsx(Qi,{visibilty:E,closeSettingFieldSidebar:W,...t}),o.jsx(xi,{...t,fieldWrap:ne})]})},H6e=t=>{const{isBuilderMode:e}=Ht(),{field:n}=t,[r,i]=k.useState(!1),a=()=>{i(!0)},s=()=>{i(!1)},[l,c]=k.useState(!1),u=f=>{c(f)},d=()=>{c(!1)};return o.jsxs("div",{onMouseOver:a,onMouseOut:s,children:[e&&l===!0&&o.jsx(sB,{visibilty:l,closeSettingFieldSidebar:d,...t}),o.jsxs("div",{dir:"ltr",className:e?"field-form-builder":"",children:[e&&r&&o.jsx(Wr,{handleFieldSettingsSidebar:u,...t}),o.jsx("div",{className:`field-${(n==null?void 0:n.isFluid)===!0?" p-fluid":" "}`,children:o.jsx("div",{className:"grid",children:o.jsxs("div",{className:e?"col-12 p-fluid":"col-12 ",children:[o.jsx("label",{className:"flex font-bold mb-3 text-gray-900 text-xl",children:"Document"}),o.jsx("ol",{children:n==null?void 0:n.documents.map(f=>o.jsx("li",{children:f==null?void 0:f.url},f==null?void 0:f.uuid))})]})})})]})]})};function vw(){return vw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},vw.apply(null,arguments)}var Oq=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",vw({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{d:"M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",fill:"currentColor"}),b.createElement("path",{d:"M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",fill:"currentColor"}),b.createElement("path",{d:"M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",fill:"currentColor"}))}));Oq.displayName="ExclamationTriangleIcon";function bw(){return bw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},bw.apply(null,arguments)}var Fq=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",bw({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",fill:"currentColor"}))}));Fq.displayName="InfoCircleIcon";function yw(){return yw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},yw.apply(null,arguments)}function Aw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Y6e(t){if(Array.isArray(t))return Aw(t)}function K6e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function kq(t,e){if(t){if(typeof t=="string")return Aw(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Aw(t,e):void 0}}function X6e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4167
+ `,j6e=t=>{const{onSetValue:e,row:n,items:r,setItems:i,isLoading:a,setIsLoading:s}=t,{processPending:l}=mh();k.useEffect(()=>{const d=Gt.addListener("clearRepeatableFields",f=>{f===(n==null?void 0:n.uuid)&&i([])});return()=>{d.remove()}});const c=d=>{const f=[...r,...d.items];i(f)};y5e(d=>c(d));const u=async()=>{s(!0),l()};return o.jsxs($6e,{children:[r.map(d=>o.jsx(U6e,{item:d,onSetValue:e,setIsLoading:s},d.id)),r.length?o.jsx(Ft,{type:"button",label:"Upload",className:"p-button-info",onClick:u,disabled:a,loading:a}):null]})},z6e=(t,e)=>{var q,ee,oe,he,De,Ne,ve;const{field:n,fieldIndex:r,row:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c,isDisabled:u}=t,{isAdmin:d,isBuilderMode:f,fileUploadParams:h}=Ht(),{userSelectedLanguage:g,fieldSettingUpdate:v}=sn(),{taskRegisterData:m,userTaskSubmitFormData:A,task_status:w,TASK_PUBLISHED:C,updateUserFormDataSubmit:S,updateTaskRegisterData:T,updateTaskProgressValue:x}=Ar(),[E,_]=k.useState(!1),[M,O]=k.useState([]),[F,P]=k.useState(!1),[H,N]=k.useState(0),[z,U]=k.useState([]),[ce,X]=k.useState(!1),[R,ue]=k.useState(!1),Y=()=>{ue(!0)},ie=()=>{ue(!1)};console.log("fileUploadParams",h);const re=Se=>{const Be=[...M];if((A==null?void 0:A.length)>0){const Te=[...A],$=_t.cloneDeep(m);Be.push(Se);for(const pe of Te)pe.fieldId===t.field.uuid&&(pe.postData=Be);if((Be==null?void 0:Be.length)>0?($[n==null?void 0:n.uuid]=Be,n.isValid=1):(delete $[n==null?void 0:n.uuid],n.isValid=0),!(i!=null&&i.rowIsRepeatable)){T($);const pe=Object.keys($).length;x(pe)}}O([...Be])},Z=()=>{var Se;if(!(i!=null&&i.rowIsRepeatable)){const Be=A;if((Be==null?void 0:Be.length)>0){for(const Te of Be)if(Te.fieldId===n.uuid&&((Se=Te==null?void 0:Te.postData)!=null&&Se.length)){O(Te==null?void 0:Te.postData),P(!0);break}}}};k.useEffect(()=>{F||Z();const Se=Gt.addListener("clearRepeatableFields",$=>{$===(i==null?void 0:i.uuid)&&(O([]),N(0),n.isValid=0,v(a,s,l,c,r,n))}),Be=Gt.addListener("onSubmitUserForm",$=>{var pe;(pe=n==null?void 0:n.attributes)!=null&&pe.required?(M==null?void 0:M.length)>0?n.isValid=1:n.isValid=0:n.isValid=1}),Te=Gt.addListener("OnInvalidFieldCatch",$=>{n.uuid===($==null?void 0:$.fieldId)?N(1):N(0)});return()=>{Be.remove(),Te.remove(),Se.remove()}});const K=Se=>{_(Se)},W=()=>{_(!1)},ge=OV(k.forwardRef((Se,Be)=>o.jsx(Ft,{size:"small",type:"button",...Se,ref:Be,disabled:f||ce||u,children:"Select files"}))),ye=Se=>{var Be;if(!(i!=null&&i.rowIsRepeatable)){const Te=_t.cloneDeep(m);delete Te[n==null?void 0:n.uuid],T(Te);const $=Object.keys(Te).length;x($);const pe=A;if(pe!=null&&pe.length){for(const me of pe)if(me.fieldId===t.field.uuid&&((Be=me==null?void 0:me.postData)!=null&&Be.length)){let ae=me==null?void 0:me.postData;ae=ae.filter((be,Ie)=>Ie!==Se),me.postData=ae,(ae==null?void 0:ae.length)>0?n.isValid=1:n.isValid=0;const le=z.filter((be,Ie)=>Ie!==Se);U(le),O(ae),P(!0);break}}else{const me=M.filter((le,be)=>be!==Se),ae=z.filter((le,be)=>be!==Se);U(ae),O(me)}}},Ee=Se=>o.jsx(o.Fragment,{children:o.jsx(Ft,{text:!0,type:"button",className:"p-button-danger ",onClick:()=>ye(Se==null?void 0:Se.rowIndex),icon:"pi pi-trash",size:"small"})}),Ae=Se=>{var Te;const Be=[...M,{fileName:"image",fileSize:"20",fileType:"Mem"}];if((A==null?void 0:A.length)>0){const $=[...A],pe=_t.findIndex($,function(le){return le.rowId===(i==null?void 0:i.uuid)});let me=(Te=A[pe])==null?void 0:Te.repeatableFields,ae="<ol class='card '>";Be==null||Be.map(le=>{const be=le;ae=ae+`<li>${be==null?void 0:be.fileName}</li>`}),ae=ae+"</ol>",me={...me,[n==null?void 0:n.uuid]:ae},$[pe]={...$[pe],repeatableFields:me},S($)}(Be==null?void 0:Be.length)>0?(O(Be),n.isValid=1):n.isValid=0},fe=Se=>{i!=null&&i.rowIsRepeatable?Ae():re(Se),O([...M,Se])},ne=o.jsxs("div",{onMouseOver:Y,onMouseOut:ie,children:[f&&R&&o.jsx(Wr,{handleFieldSettingsSidebar:K,...t}),o.jsx("div",{className:`field ${f&&" py-3 px-4 builder-element-wrapper "}${(n==null?void 0:n.isFluid)===!0&&" p-fluid"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:f?"col-12 field-form-builder":"col-12",children:[(n==null?void 0:n.showHeaderText)&&o.jsx("h6",{children:(q=n==null?void 0:n.headerText)==null?void 0:q[g==null?void 0:g.type]}),(n==null?void 0:n.showLabel)&&o.jsxs("label",{htmlFor:r,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((ee=n==null?void 0:n.attributes)==null?void 0:ee.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(oe=n==null?void 0:n.label)==null?void 0:oe[g==null?void 0:g.type]}),o.jsx("span",{className:"ml-3",children:(n==null?void 0:n.showToolTip)&&o.jsx(zi,{message:(he=n==null?void 0:n.toolTip)==null?void 0:he[g==null?void 0:g.type],position:"right"})})]}),o.jsx("div",{children:(n==null?void 0:n.showHelperText)&&o.jsx("small",{children:(De=n==null?void 0:n.helperText)==null?void 0:De[g==null?void 0:g.type]})}),o.jsxs("div",{className:"mt-3",children:[w!==C&&!d&&o.jsx(o.Fragment,{children:o.jsxs(r9e,{debug:!1,retries:10,chunkSize:35e3,multiple:!1,autoUpload:!1,destination:h,children:[o.jsx(ge,{}),o.jsx(j6e,{items:z,setItems:U,isLoading:ce,setIsLoading:X,row:i,inputValue:M,onSetValue:fe})]})}),((Ne=n==null?void 0:n.attributes)==null?void 0:Ne.required)&&o.jsx("small",{className:"error",children:H===1&&(M==null?void 0:M.length)===0?(ve=n==null?void 0:n.validationMesssage)==null?void 0:ve[g==null?void 0:g.type]:""}),o.jsx("div",{className:"mt-3",children:o.jsxs(ro,{value:M,emptyMessage:"No Files have been uploaded",children:[o.jsx(xr,{field:"fileName",header:"Filename"}),o.jsx(xr,{field:"fileSize",header:"Size"}),o.jsx(xr,{field:"fileType",header:"type"}),w!==C&&o.jsx(xr,{style:{width:"10%"},headerStyle:{textAlign:"center"},bodyStyle:{textAlign:"center",overflow:"visible"},body:Se=>Ee(Se)})]})})]})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})})]});return o.jsxs(o.Fragment,{children:[E===!0&&o.jsx(Qi,{visibilty:E,closeSettingFieldSidebar:W,...t}),o.jsx(xi,{...t,fieldWrap:ne})]})},H6e=t=>{const{isBuilderMode:e}=Ht(),{field:n}=t,[r,i]=k.useState(!1),a=()=>{i(!0)},s=()=>{i(!1)},[l,c]=k.useState(!1),u=f=>{c(f)},d=()=>{c(!1)};return o.jsxs("div",{onMouseOver:a,onMouseOut:s,children:[e&&l===!0&&o.jsx(sB,{visibilty:l,closeSettingFieldSidebar:d,...t}),o.jsxs("div",{dir:"ltr",className:e?"field-form-builder":"",children:[e&&r&&o.jsx(Wr,{handleFieldSettingsSidebar:u,...t}),o.jsx("div",{className:`field-${(n==null?void 0:n.isFluid)===!0?" p-fluid":" "}`,children:o.jsx("div",{className:"grid",children:o.jsxs("div",{className:e?"col-12 p-fluid":"col-12 ",children:[o.jsx("label",{className:"flex font-bold mb-3 text-gray-900 text-xl",children:"Document"}),o.jsx("ol",{children:n==null?void 0:n.documents.map(f=>o.jsx("li",{children:f==null?void 0:f.url},f==null?void 0:f.uuid))})]})})})]})]})};function vw(){return vw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},vw.apply(null,arguments)}var Oq=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",vw({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{d:"M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",fill:"currentColor"}),b.createElement("path",{d:"M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",fill:"currentColor"}),b.createElement("path",{d:"M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",fill:"currentColor"}))}));Oq.displayName="ExclamationTriangleIcon";function bw(){return bw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},bw.apply(null,arguments)}var Fq=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",bw({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",fill:"currentColor"}))}));Fq.displayName="InfoCircleIcon";function yw(){return yw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},yw.apply(null,arguments)}function Aw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Y6e(t){if(Array.isArray(t))return Aw(t)}function K6e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function kq(t,e){if(t){if(typeof t=="string")return Aw(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Aw(t,e):void 0}}function X6e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4168
4168
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ww(t){return Y6e(t)||K6e(t)||kq(t)||X6e()}function R6e(t){if(Array.isArray(t))return t}function G6e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function W6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4169
4169
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sw(t,e){return R6e(t)||G6e(t,e)||kq(t,e)||W6e()}function pg(t){"@babel/helpers - typeof";return pg=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},pg(t)}function Q6e(t,e){if(pg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(pg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function J6e(t){var e=Q6e(t,"string");return pg(e)=="symbol"?e:e+""}function Pq(t,e,n){return(e=J6e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Z6e=`
4170
4170
  @layer primereact {
@@ -60053,7 +60053,7 @@ var m0e = function() {
60053
60053
  theme: i.theme,
60054
60054
  formats: i.formats
60055
60055
  };
60056
- m0e ? w(new Quill(d.current, P)) : import("./quill-DV06ejMv.js").then(function(z) {
60056
+ m0e ? w(new Quill(d.current, P)) : import("./quill-3zhI8m0e.js").then(function(z) {
60057
60057
  if (z && Se.isExist(d.current)) {
60058
60058
  var F;
60059
60059
  z.default ? F = new z.default(d.current, P) : F = new z(d.current, P), w(F);
@@ -63359,7 +63359,7 @@ const k0e = (t) => {
63359
63359
  pageSettingUpdate: T,
63360
63360
  formBuilderFormLayout: w,
63361
63361
  sectionSettingUpdate: E,
63362
- userSelectedLanguage: D
63362
+ selectedLanguage: D
63363
63363
  } = nn(), [R, N] = Me(!1), [k, P] = Me(null), [z, F] = Me(0), [q, $] = Me(!1), [le, Y] = Me(!1), K = () => {
63364
63364
  Y(!0);
63365
63365
  }, ce = () => {
@@ -63632,7 +63632,7 @@ const k0e = (t) => {
63632
63632
  let ve = (ge = a[oe]) == null ? void 0 : ge.repeatableFields;
63633
63633
  ve = {
63634
63634
  ...ve,
63635
- [j == null ? void 0 : j.uuid]: he
63635
+ [j == null ? void 0 : j.uuid]: he == null ? void 0 : he.optionText[D]
63636
63636
  }, ie[oe] = {
63637
63637
  ...ie[oe],
63638
63638
  repeatableFields: ve
@@ -63689,7 +63689,7 @@ const k0e = (t) => {
63689
63689
  readOnly: S || x
63690
63690
  }
63691
63691
  ),
63692
- ((ve = ge == null ? void 0 : ge.hyperlinkText) == null ? void 0 : ve[D == null ? void 0 : D.type]) === "" ? /* @__PURE__ */ _(
63692
+ ((ve = ge == null ? void 0 : ge.hyperlinkText) == null ? void 0 : ve[D]) === "" ? /* @__PURE__ */ _(
63693
63693
  "label",
63694
63694
  {
63695
63695
  htmlFor: `radio-option-${ie}-${ge == null ? void 0 : ge.uuid}-${C ? "builder-label" : "preview"}`,
@@ -63701,17 +63701,17 @@ const k0e = (t) => {
63701
63701
  ] }) : "",
63702
63702
  C ? /* @__PURE__ */ c(Ce, { children: /* @__PURE__ */ c(wP, { ...t, option: ge, optionIndex: ie }) }) : /* @__PURE__ */ _(Ce, { children: [
63703
63703
  " ",
63704
- (_e = ge == null ? void 0 : ge.optionText) == null ? void 0 : _e[D == null ? void 0 : D.type]
63704
+ (_e = ge == null ? void 0 : ge.optionText) == null ? void 0 : _e[D]
63705
63705
  ] })
63706
63706
  ]
63707
63707
  }
63708
63708
  ) : /* @__PURE__ */ c("label", { children: /* @__PURE__ */ c(
63709
63709
  "a",
63710
63710
  {
63711
- href: (Pe = ge == null ? void 0 : ge.hyperlinkText) == null ? void 0 : Pe[D == null ? void 0 : D.type],
63711
+ href: (Pe = ge == null ? void 0 : ge.hyperlinkText) == null ? void 0 : Pe[D],
63712
63712
  target: "_blank",
63713
63713
  rel: "noreferrer",
63714
- children: (Ke = ge == null ? void 0 : ge.optionText) == null ? void 0 : Ke[D == null ? void 0 : D.type]
63714
+ children: (Ke = ge == null ? void 0 : ge.optionText) == null ? void 0 : Ke[D]
63715
63715
  }
63716
63716
  ) }),
63717
63717
  C && /* @__PURE__ */ c("div", { className: "builder-radio-option-settings", children: /* @__PURE__ */ c(CP, { optionId: ge == null ? void 0 : ge.uuid, ...t }) })
@@ -63757,7 +63757,7 @@ const k0e = (t) => {
63757
63757
  className: `field ${C && " py-3 px-4 builder-element-wrapper "}${(u == null ? void 0 : u.isFluid) === !0 && " p-fluid"}`,
63758
63758
  children: /* @__PURE__ */ _("div", { className: "grid", children: [
63759
63759
  /* @__PURE__ */ _("div", { className: "col-12", children: [
63760
- (u == null ? void 0 : u.showHeaderText) && /* @__PURE__ */ c("h6", { children: (te = u == null ? void 0 : u.headerText) == null ? void 0 : te[D == null ? void 0 : D.type] }),
63760
+ (u == null ? void 0 : u.showHeaderText) && /* @__PURE__ */ c("h6", { children: (te = u == null ? void 0 : u.headerText) == null ? void 0 : te[D] }),
63761
63761
  (u == null ? void 0 : u.showLabel) && /* @__PURE__ */ _(
63762
63762
  "label",
63763
63763
  {
@@ -63767,11 +63767,11 @@ const k0e = (t) => {
63767
63767
  /* @__PURE__ */ c(zi, { ...t }),
63768
63768
  ((B = u == null ? void 0 : u.attributes) == null ? void 0 : B.required) && /* @__PURE__ */ c("span", { className: "must-required mr-1", children: "*" }),
63769
63769
  " ",
63770
- C ? /* @__PURE__ */ c(ji, { ...t }) : /* @__PURE__ */ c(Ce, { children: (Z = u == null ? void 0 : u.label) == null ? void 0 : Z[D == null ? void 0 : D.type] }),
63770
+ C ? /* @__PURE__ */ c(ji, { ...t }) : /* @__PURE__ */ c(Ce, { children: (Z = u == null ? void 0 : u.label) == null ? void 0 : Z[D] }),
63771
63771
  /* @__PURE__ */ c("span", { className: "ml-3", children: u != null && u.showToolTip ? /* @__PURE__ */ c(Ce, { children: /* @__PURE__ */ c(
63772
63772
  Ti,
63773
63773
  {
63774
- message: (se = u == null ? void 0 : u.toolTip) == null ? void 0 : se[D == null ? void 0 : D.type],
63774
+ message: (se = u == null ? void 0 : u.toolTip) == null ? void 0 : se[D],
63775
63775
  position: "right"
63776
63776
  }
63777
63777
  ) }) : "" })
@@ -63783,7 +63783,7 @@ const k0e = (t) => {
63783
63783
  " "
63784
63784
  ] }) : Ie(),
63785
63785
  /* @__PURE__ */ c("div", { children: ((fe = u == null ? void 0 : u.attributes) == null ? void 0 : fe.required) && /* @__PURE__ */ c("small", { className: "error", children: z === 1 && k !== null ? (De = u == null ? void 0 : u.validationMesssage) == null ? void 0 : De.language : "" }) }),
63786
- /* @__PURE__ */ c("div", { children: (u == null ? void 0 : u.showHelperText) && /* @__PURE__ */ c("small", { children: (Oe = u == null ? void 0 : u.helperText) == null ? void 0 : Oe[D == null ? void 0 : D.type] }) }),
63786
+ /* @__PURE__ */ c("div", { children: (u == null ? void 0 : u.showHelperText) && /* @__PURE__ */ c("small", { children: (Oe = u == null ? void 0 : u.helperText) == null ? void 0 : Oe[D] }) }),
63787
63787
  ((me = u == null ? void 0 : u.inlineConditionalRules) == null ? void 0 : me.rules.length) > 0 && C === !0 && /* @__PURE__ */ c("p", { children: "Inline conditional rules" }),
63788
63788
  q === !0 && ((Le = (xe = u == null ? void 0 : u.inlineConditionalRules) == null ? void 0 : xe.rules) == null ? void 0 : Le.length) > 0 && ((Te = u == null ? void 0 : u.inlineConditionalRules) == null ? void 0 : Te.rules.map(
63789
63789
  (j, he) => {
@@ -109814,7 +109814,7 @@ const G8e = q2(NB)`
109814
109814
  r.length ? /* @__PURE__ */ c(
109815
109815
  Ft,
109816
109816
  {
109817
- text: !0,
109817
+ type: "button",
109818
109818
  label: "Upload",
109819
109819
  className: "p-button-info",
109820
109820
  onClick: u,
@@ -109910,7 +109910,7 @@ const G8e = q2(NB)`
109910
109910
  }, J = () => {
109911
109911
  D(!1);
109912
109912
  }, pe = sB(
109913
- X1((xe, Le) => /* @__PURE__ */ c(Ft, { text: !0, ...xe, ref: Le, disabled: f || le || u, children: "Select files" }))
109913
+ X1((xe, Le) => /* @__PURE__ */ c(Ft, { size: "small", type: "button", ...xe, ref: Le, disabled: f || le || u, children: "Select files" }))
109914
109914
  ), be = (xe) => {
109915
109915
  var Le;
109916
109916
  if (!(i != null && i.rowIsRepeatable)) {
@@ -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-CiatLq_t.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-C6vCpGOY.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.311",
3
+ "version": "0.2.313",
4
4
  "type": "module",
5
5
  "types": "dist/types/index",
6
6
  "files": [