@zealicsolutions/web-ui 1.0.140-beta.228 → 1.0.140-beta.229

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1028,7 +1028,7 @@
1028
1028
  position: relative;
1029
1029
  gap: ${({gap:e})=>e?"number"==typeof e?`${e}px`:e:"0"};
1030
1030
  ${({scrollable:e})=>e?"\n overflow-y: auto;\n overflow-x: hidden;\n min-height: 0; /* Important for flex children to respect overflow */\n ":""}
1031
- `,Gpt=e=>{if("menu_item"===e.type){const t=e;if(!t.sx)return!1;const r=e=>!!e&&(Array.isArray(e)?e.some(r):"function"!=typeof e&&("object"==typeof e&&("absolute"===e.position||"fixed"===e.position)));return r(t.sx)}return!1},Kpt=({currentWebpageId:t,anchor:r="left",variant:o="persistent",open:n=!1,onClose:a,items:i=[],withButton:s=!0,buttonText:l="",buttonVariant:c="contained",buttonTextColor:u,buttonFontSize:d,buttonFontWeight:p,buttonFontFamily:h,buttonDisabled:f=!1,buttonGap:m=0,buttonStartIcon:y,buttonEndIcon:g,buttonBorderRadius:v="0px",buttonPaddingTop:x="0px",buttonPaddingRight:b="0px",buttonPaddingBottom:w="0px",buttonPaddingLeft:k="0px",buttonMarginTop:_="0px",buttonMarginRight:C="0px",buttonMarginBottom:M="0px",buttonMarginLeft:S="0px",buttonIconOnly:D,buttonElevation:O,buttonFillColor:P,buttonFillColorDisabled:E,buttonFillColorHover:j,buttonFillColorPressed:T,buttonBorderColor:N,buttonBorderColorDisabled:R,buttonBorderColorHover:I,buttonBorderColorPressed:F,buttonTextColorDisabled:A,buttonTextColorHover:z,buttonTextColorPressed:L,buttonColor:B="#1976d2",buttonDisabledColor:V,withCloseIcon:$=!0,closeIconColor:H=no.colors.gray2,closeIconName:q="x",closeIconSize:W=18,closeIconBackgroundColor:U="rgba(255, 255, 255, 0.9)",closeIconVisible:G=!1,closeIconTop:K="16px",closeIconLeft:Y="16px",closeIconBorderRadius:Z="50%",closeIconElevation:X=2,moleculeId:Q,configurationItemInfo:J,sx:ee,contentSx:te,scrollable:re=!1,paddingTop:oe,paddingRight:ne,paddingBottom:ae,paddingLeft:ie,height:se,width:le,mobileWidth:ce,backgroundColor:ue="#fff",gap:de="8px",marginTop:pe="0px",marginRight:he="0px",marginBottom:fe="0px",marginLeft:me="0px"})=>{const ye=Ge(),{isConfigurationMode:ge,selectedConfigurationItemId:ve,onConfigurationItemClicked:xe,onInternalNavigation:be}=IC(),{updateDrawer:we,drawerContainerRef:ke,headerHeight:_e,isMobile:Ce}=DC(),[Me,Se]=e.useState(n),[De]=(()=>{try{return zpt()}catch{return[new URLSearchParams,()=>{}]}})(),Oe=e.useMemo(()=>{if(t)return t;const e=De.get(U7e),r=De.get(W7e);let o=null,n=null;if("undefined"!=typeof window)try{const e=new URLSearchParams(window.location.search);o=e.get(U7e),n=e.get(W7e)}catch(_Je){}return e||r||o||n||""},[t,De]);e.useEffect(()=>{Se(n)},[n]);const Pe=Boolean(ge&&(ve===Q||i.some(e=>e.id===ve))),Ee=()=>"permanent"===o||(ge?Pe:s?Me:n);e.useEffect(()=>{const e=Ee(),t="left"===r||"right"===r,n=Ce&&void 0!==ce?ce:le;let a=0;if(void 0!==n)if("number"==typeof n)a=n;else if("string"==typeof n){const e=parseFloat(n);Number.isNaN(e)||(a=e)}let i=0;if(t&&!Ce)switch(o){case"permanent":i=a;break;case"persistent":default:i=e?a:0;break;case"temporary":i=0}return we({isOpen:e,position:r,width:i}),()=>{we({isOpen:!1,width:0})}},[Me,n,Pe,ge,s,r,le,ce,Ce,o,we]);const je=()=>{"permanent"!==o&&Se(!0)},Te=(e,t)=>{"permanent"!==o&&(Se(!1),a?.(e,t))},Ne=e=>{const t=ve===e.id,r={entityId:e.id,entity:"molecule_item",entityType:e.type},o=ge?{onClick:e=>{e.stopPropagation(),xe?.(r,!1)},onDoubleClick:e=>{e.stopPropagation(),xe?.(r,!0)},"data-organism-id":e.id,css:trt({theme:ye,selected:t})}:{};switch(e.type){case"menu_item":{const t=e;e.id;const r=(e=>{const t=e?.link;if(!t||!t.internalLink)return!1;const r=i9e(t.internalLink);return!(!r||!Oe)&&r===Oe})(t),n={backgroundColor:t.backgroundColor||"transparent",paddingTop:t.paddingTop||"8px",paddingRight:t.paddingRight||"16px",paddingBottom:t.paddingBottom||"8px",paddingLeft:t.paddingLeft||"16px",opacity:t.disabled?.6:1,pointerEvents:t.disabled?"none":"auto","&:hover":{backgroundColor:t.disabled?t.backgroundColor||"transparent":"rgba(0, 0, 0, 0.08)"}},a=t.sx?[n,t.sx]:n;return nt(yx,{sx:a,selected:r,onClick:()=>{if(t?.link){e9e(t.link)?be?.({link:t.link?.internalLink||""}):Q7e(t.link?.externalLink)}},disabled:t.disabled,...o,children:[t.startIcon&&ot(EGe,{iconName:t.startIcon,color:t.textColor}),ot(Sd,{sx:{ml:t.startIcon?1:0,mr:t.endIcon?1:0,color:t.textColor||"inherit",fontSize:t.fontSize||"inherit",fontWeight:t.fontWeight||"normal",fontFamily:t.fontFamily||"inherit",whiteSpace:t.wrap?"normal":"nowrap",width:"100%",textAlign:t.textAlign||"left"},children:t.text}),t.endIcon&&ot(EGe,{iconName:t.endIcon,color:t.textColor})]},t.id)}case"divider_item":{const t=e;return ot(dpt,{moleculeId:t.id,variant:t.variant,lineWeight:t.lineWeight,orientation:t.orientation,borderColor:t.borderColor,borderRadius:t.borderRadius,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft,configurationItemInfo:o},t.id)}case"text_item":{const t=e;return ot(mpt,{id:t.id,text:t.text,align:t.align,color:t.color,wrap:t.wrap,variant:"string"==typeof t.variant&&["inherit","body1","body2","caption","button","overline","subtitle1","subtitle2","h1","h2","h3","h4","h5","h6"].includes(t.variant)?t.variant:void 0,fontSize:t.fontSize??"",fontWeight:["normal","bold"].includes(t.fontWeight)?t.fontWeight:void 0,fontFamily:t.fontFamily??"",marginTop:t.marginTop||"",marginRight:t.marginRight||"",marginBottom:t.marginBottom||"",marginLeft:t.marginLeft||"",paddingTop:t.paddingTop||"",paddingRight:t.paddingRight||"",paddingBottom:t.paddingBottom||"",paddingLeft:t.paddingLeft||"",configurationsItemInfo:o},t.id)}case"rich_text_item":{const t=e;return ot(fpt,{htmlElementId:t.id,text:t.text,isRichText:!0,marginTop:t.marginTop||"",marginRight:t.marginRight||"",marginBottom:t.marginBottom||"",marginLeft:t.marginLeft||"",paddingTop:t.paddingTop||"",paddingRight:t.paddingRight||"",paddingBottom:t.paddingBottom||"",paddingLeft:t.paddingLeft||"",configurationItemInfo:o},t.id)}case"image_item":{const t=e;return ot(ppt,{src:t.src,alt:t.alt||"Drawer image",height:t.height,width:t.width,raised:t.raised,borderRadius:t.borderRadius||"0",marginTop:t.marginTop||"0",marginRight:t.marginRight||"0",marginBottom:t.marginBottom||"0",marginLeft:t.marginLeft||"0",paddingTop:t.paddingTop||"0",paddingRight:t.paddingRight||"0",paddingBottom:t.paddingBottom||"0",paddingLeft:t.paddingLeft||"0",onClick:()=>{if(t?.link){e9e(t.link)?be?.({link:t.link?.internalLink||""}):Q7e(t.link?.externalLink)}},moleculeId:t.id,configurationItemInfo:o},t.id)}default:return null}},Re=Ce&&void 0!==ce?ce:le,Ie=ot(Vpt,{anchor:r,variant:o,open:Ee(),onClose:Te,paddingTop:oe,paddingRight:ne,paddingBottom:ae,paddingLeft:ie,height:se,width:Re,backgroundColor:ue,marginTop:`calc(${_e} + ${pe})`,marginRight:he,marginBottom:fe,marginLeft:me,container:ke,sx:ee,children:nt(qpt,{scrollable:re,sx:te,...J&&Object.keys(J).length?{...J,"data-testid":"drawer-content-config","aria-label":"drawer-content"}:{},children:[(Ee()||"permanent"===o)&&i.length>0?nt(rt,{children:[ot(Upt,{gap:de,scrollable:re,children:i.filter(e=>!Gpt(e)).map(Ne)}),i.filter(e=>Gpt(e)).map(Ne)]}):null,!!$&&(!!G||Ee())&&ot(Wpt,{top:K,left:Y,borderRadius:Z,elevation:X,backgroundColor:U,onClick:e=>{e.stopPropagation();Ee()?Te(e,"closeIconClicked"):je()},"data-testid":"close-icon",children:ot(EGe,{"data-testid":"icon-renderer",iconName:q,size:W,color:H})})]})});return s&&"permanent"!==o?nt(rt,{children:[ot(eKe,{moleculeId:Q,gap:m,text:l,variant:c,textColor:u,fontSize:d,fontWeight:["normal","bold"].includes(p)?p:void 0,fontFamily:h,disabled:f,startIcon:y,endIcon:g,marginTop:_,marginRight:C,marginBottom:M,marginLeft:S,paddingTop:x,paddingRight:b,paddingBottom:w,paddingLeft:k,borderRadius:v,iconOnly:D,elevation:O,fillColor:P||B,fillColorDisabled:E||V,fillColorHover:j,fillColorPressed:T,borderColor:N,borderColorDisabled:R,borderColorHover:I,borderColorPressed:F,textColorDisabled:A,textColorHover:z,textColorPressed:L,externalOnClick:e=>Me?Te(e,"buttonClicked"):je(),configurationItemInfo:J}),ot(Hpt,{children:Ie})]}):ot(Hpt,{children:Ie})},Ypt=e.forwardRef((e,t)=>{const{inputRef:r,...o}=e;return ot(GKe,{...o,ref:e=>{"function"==typeof r&&r(e?e.inputElement:null)},mask:aYe,guide:!0,placeholderChar:" "})}),Zpt=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0},Xpt=({masked:e,errorMsg:t,inputSx:r,labelSx:o,sx:n,variant:a="outlined",...i})=>{const s=e?{inputComponent:Ypt}:{};return ot(oC,{...i,variant:a,error:!!t,helperText:t||null,type:"text",sx:{...n},slotProps:{input:{sx:{...r,...n},...s},inputLabel:{sx:{...o,...n}}}})},Qpt=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="Email is required",validationErrorText:n="Invalid email address",text:a,placeholderText:i,masked:s=!1,multiLine:l=!1,backgroundColor:c,borderColor:u,color:d="inherit",fontSize:p="16px",fontFamily:h="inherit",fontWeight:f="normal",textAlign:m="left",marginLeft:y="0",marginTop:g="0",marginRight:v="0",marginBottom:x="0",paddingLeft:b="0",paddingTop:w="0",paddingRight:k="0",paddingBottom:_="0",width:C,height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P,sx:E,name:j,sourceDataModelField:T,configurationItemInfo:N,inputSize:R="medium",labelOffset:I,hideLabel:F=!1,variant:A="outlined"})=>{const z=Ut(),L=z?.control,B=!(!L||!j),{localStateObject:V}=IC(),{stateConfig:$}=WC(),H=dt(),q=V||$,W=T?q?.[T]?.value:void 0,U=T?H?.getDmfValue(T):void 0;e.useState("");const[G,K]=e.useState(""),Y={required:!!r&&o,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:n}},Z=e.useMemo(()=>{if(F)return;if(void 0!==I)return I;const e=Zpt(w),t=Zpt(_);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=Zpt(M)||Zpt(S)||Zpt(D);if(!o&&!e&&!t)return;const n="number"==typeof p?1.5*p:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[M,S,D,I,R,p,w,_,F]),X=e.useMemo(()=>{if(F)return;const e="small"===R?-6:-9,t=Zpt(M)||Zpt(S)||Zpt(D);return!t||t>=36?e:-6},[M,S,D,R,F]);if(t){let e="";e=void 0!==U?String(U??""):B?z.watch(j)||"":W||"";const t=e||i||"-";return nt("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...N,children:[a&&ot(vg,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,marginLeft:0,marginBottom:"4px",...E},children:a}),ot(Sd,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_,backgroundColor:c,border:`1px solid ${u||"#ccc"}`,borderRadius:"4px",minWidth:"120px",textAlign:m,...E},children:t})]})}const Q={backgroundColor:c,color:d,fontSize:p,fontFamily:h,fontWeight:f,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},"& .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-input":{textAlign:m,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_}},J={color:d,"&.Mui-focused":{color:d},...F&&{display:"none"},...void 0!==Z&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${Z}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${X}px) scale(0.75)`}}},ee=l?3:1,te={...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}};return ot("div",B?{style:{marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},sx:{"& .MuiTextField-root":{width:C||"100%",height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...E},children:ot(Jt,{name:j,rules:Y,control:L,defaultValue:"",render:({field:e,fieldState:t})=>ot(Xpt,{masked:s,required:r,errorMsg:t.error?.message,inputSx:Q,labelSx:J,sx:{...te,...E},size:R,variant:A,label:F?void 0:a,placeholder:i,multiline:l,minRows:ee,value:e.value||"",onChange:e.onChange,...N||{}})})}:{style:{marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},sx:{"& .MuiTextField-root":{width:C||"100%",height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...E},children:ot(Xpt,{masked:s,required:r,errorMsg:void 0,inputSx:Q,labelSx:J,sx:{...te,...E},size:R,variant:A,label:F?void 0:a,placeholder:i,multiline:l,minRows:ee,value:G,onChange:e=>K(e.target.value),...N||{}})})},Jpt=({src:t,text:r,type:o,link:n,sourceDataModelField:a,color:i=no.colors.deepBlue,disabled:s=!1,disabledColor:l,underline:c="hover",variant:u="body2",margin:d="0",padding:p="0",moleculeId:h,configurationItemInfo:f,marginTop:m="0",marginRight:y="0",marginBottom:g="0",marginLeft:v="0",paddingTop:x="0",paddingRight:b="0",paddingBottom:w="0",paddingLeft:k="0",fontFamily:_,fontWeight:C,fontSize:M,align:S,target:D,sx:O,borderColor:P,borderWidth:E,borderStyle:j,borderRadius:T,iconOnly:N,ariaLabel:R,iconName:I,iconSize:F,validationErrorText:A})=>{const{onStateChange:z}=KC(),{onInternalNavigation:L,isConfigurationMode:B,localStateObject:V}=IC();WC();const $=dt(),H=n&&t9e(n),q=e.useMemo(()=>H?r9e(n,$?.rawItemDataByDmfId):null,[n,H,$?.rawItemDataByDmfId]),W=H&&!q,U=e.useMemo(()=>{if(q)return q.destination;const e=n?e9e(n):"internalLink"===o||"internal_link"===o,r=n?e?n.internalLink:n.externalLink:void 0;return t??r??void 0},[q,n,o,t]),G=e.useMemo(()=>q?!q.isExternal:!!n&&e9e(n),[q,n]),K=e.useMemo(()=>D||(q?q.isExternal?"_blank":"_self":G?"_self":"_blank"),[D,q,G]),Y=s||W,Z=Y?l||to(i):i,X=B||Y?void 0:U,Q=Boolean(I),J="regular"===C?"normal":C,ee=N?ot(EGe,{iconName:I||"external-link",size:F??16}):nt(rt,{children:[ot("span",{children:r}),Q&&ot(EGe,{iconName:I,size:F??16})]}),{onClick:te,onDoubleClick:re,...oe}=f||{},ne=ot(pv,{href:X,component:"a",target:K,onClick:e=>{z({id:h,type:"clicked"});if(!s&&!W&&!B)return q?(e.preventDefault(),void(q.isExternal?Q7e(q.destination):L?.({link:q.destination,webpageAlias:q.webpageAlias,query:q.recordId?{rwoRecordId:q.recordId}:void 0}))):G&&U?(e.preventDefault(),void L?.({link:U})):void(!G&&U&&(e.preventDefault(),Q7e(U)));e.preventDefault()},onClickCapture:te||void 0,onDoubleClickCapture:re||void 0,"aria-label":N?R||r||"link":void 0,sx:{color:Z,textDecorationColor:Z,margin:d,padding:p,marginTop:m,marginRight:y,marginBottom:g,marginLeft:v,paddingTop:x,paddingRight:b,paddingBottom:w,paddingLeft:k,fontFamily:_,fontWeight:J,fontSize:M,textAlign:S,alignItems:"center",cursor:Y?"not-allowed":"pointer",borderColor:P,borderWidth:E,borderStyle:j,borderRadius:T,display:N||Q?"inline-flex":void 0,gap:Q&&!N?"4px":void 0,"& .MuiLink-root":{color:"inherit",textDecorationColor:"inherit"},"&:hover":{color:Y?Z:to(Z,.8),textDecorationColor:Y?Z:to(Z,.8)},"&:active":{color:Y?Z:to(Z,.6),textDecorationColor:Y?Z:to(Z,.6)},"&.Mui-disabled":{color:l||to(i),textDecorationColor:l||to(i),cursor:"not-allowed"},...O},align:S,variant:u,underline:c,...oe,children:ee});return ne},eht=e=>({justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}),tht=({popover:t=!0,items:r,marginTop:o="0",marginRight:n="0",marginBottom:a="0",marginLeft:i="0",paddingTop:s="0",paddingRight:l="0",paddingBottom:c="0",paddingLeft:u="0",cornerRadius:d="4px",backgroundColor:p="#fff",width:h="100%",height:f="auto",borderColor:m="#ccc",borderWeight:y="1px",buttonText:g="Open Menu",buttonVariant:v="contained",buttonTextColor:x,buttonFontSize:b,buttonFontWeight:w,buttonFontFamily:k,buttonDisabled:_=!1,buttonGap:C=0,buttonStartIcon:M,buttonEndIcon:S,buttonCornerRadius:D="0",buttonMarginTop:O="0",buttonMarginRight:P="0",buttonMarginBottom:E="0",buttonMarginLeft:j="0",buttonPaddingTop:T="0",buttonPaddingRight:N="0",buttonPaddingBottom:R="0",buttonPaddingLeft:I="0",buttonIconOnly:F,buttonElevation:A,buttonFillColor:z,buttonFillColorDisabled:L,buttonFillColorHover:B,buttonFillColorPressed:V,buttonBorderColor:$,buttonBorderColorDisabled:H,buttonBorderColorHover:q,buttonBorderColorPressed:W,buttonTextColorDisabled:U,buttonTextColorHover:G,buttonTextColorPressed:K,buttonColor:Y="#1976d2",anchorOriginVertical:Z="bottom",anchorOriginHorizontal:X="left",transformOriginVertical:Q="top",transformOriginHorizontal:J="left",elevation:ee=3,sx:te,moleculeId:re,configurationItemInfo:oe})=>{const ne=Ge(),{isConfigurationMode:ae,selectedConfigurationItemId:ie,onConfigurationItemClicked:se,onInternalNavigation:le}=IC(),ce=dt?.(),[ue,de]=e.useState(null),[pe,he]=e.useState(!1),[fe]=(()=>{try{return zpt()}catch{return[new URLSearchParams,()=>{}]}})(),me=e.useMemo(()=>{const e=fe.get(U7e),t=fe.get(W7e);let r=null,o=null;if("undefined"!=typeof window)try{const e=new URLSearchParams(window.location.search);r=e.get(U7e),o=e.get(W7e)}catch(_Je){}return e||t||r||o||""},[fe]),ye=e=>{const t=e?.link;if(!t||!t.internalLink)return!1;const r=i9e(t.internalLink);return!(!r||!me)&&r===me},ge=Boolean(ae&&(ie===re||r.some(e=>e.id===ie))),ve=()=>he(!0),xe=()=>he(!1),be={marginTop:o,marginRight:n,marginBottom:a,marginLeft:i,paddingTop:s,paddingRight:l,paddingBottom:c,paddingLeft:u,"& .MuiMenu-paper":{backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3]},"& .MuiMenu-list":{padding:0,width:h,height:f,overflow:"hidden"},"& .MuiMenuItem-root":{minHeight:"auto",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px"},"& .MuiListItemButton-root":{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px"},"& .MuiListItemText-primary":{fontSize:"14px",fontFamily:"inherit"},"& .MuiTypography-root":{fontSize:"14px",fontFamily:"inherit"},...t?{display:"inline-block",zIndex:ne?.zIndex?.drawer}:{width:h,height:f,backgroundColor:p,display:"block",overflow:"hidden",border:`${y} solid ${m}`,borderRadius:d},...te};return t?nt(Gf,{children:[ot(eKe,{ref:de,text:g,variant:v,moleculeId:re,textColor:x,fontSize:b,fontWeight:w,fontFamily:k,disabled:_,gap:C,startIcon:M,endIcon:S,onClick:ve,marginTop:O,marginRight:P,marginBottom:E,marginLeft:j,paddingTop:T,paddingRight:N,paddingBottom:R,paddingLeft:I,borderRadius:D,iconOnly:F,elevation:A,fillColor:z||Y,fillColorDisabled:L,fillColorHover:B,fillColorPressed:V,borderColor:$,borderColorDisabled:H,borderColorHover:q,borderColorPressed:W,textColorDisabled:U,textColorHover:G,textColorPressed:K,configurationItemInfo:oe}),ot(dx,{open:ae?ge:pe,variant:"menu",anchorEl:ue,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:xe,anchorOrigin:{vertical:Z,horizontal:X},transformOrigin:{vertical:Q,horizontal:J},elevation:ee,slotProps:{paper:{sx:{backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3],"& .MuiMenu-list":be["& .MuiMenu-list"],"& .MuiMenuItem-root":be["& .MuiMenuItem-root"],"& .MuiListItemText-primary":be["& .MuiListItemText-primary"],"& .MuiTypography-root":be["& .MuiTypography-root"]}}},sx:{...be,"& .MuiMenu-paper":be["& .MuiMenu-paper"]},children:r.map(e=>{const t=ie===e.id,r=ye(e),o=e.link&&t9e(e.link)?r9e(e.link,ce?.rawItemDataByDmfId):null,n=e.link&&t9e(e.link)&&!o,a={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},i=ae?e=>{e.stopPropagation(),se?.(a,!1)}:void 0,s=ae?e=>{e.stopPropagation(),se?.(a,!0)}:void 0,l=ae?{onClick:i,onDoubleClick:s,"data-organism-id":e.id,css:trt({theme:ne,selected:t})}:{};return nt(yx,{sx:eht(e),selected:r,disabled:e.disabled||n,onClick:()=>{e?.link&&(o?o.isExternal?Q7e(o.destination):le?.({link:o.destination,webpageAlias:o.webpageAlias,query:o.recordId?{rwoRecordId:o.recordId}:void 0}):e9e(e.link)?le?.({link:e.link?.internalLink||""}):Q7e(e.link?.externalLink)),xe()},...l,children:[e.startIcon&&ot(EGe,{iconName:e.startIcon,color:e.textColor}),ot(Sd,{sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"},children:e.text}),e.endIcon&&ot(EGe,{iconName:e.endIcon,color:e.textColor})]},e.id)})})]}):ot(Qc,{id:re,sx:{...be,backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3]},elevation:ee,...oe,children:ot(vv,{disablePadding:!0,children:r.map(e=>{const t=ie===e.id,r=ye(e),o=e.link&&t9e(e.link)?r9e(e.link,ce?.rawItemDataByDmfId):null,n=e.link&&t9e(e.link)&&!o,a={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},i=ae?e=>{e.stopPropagation(),se?.(a,!1)}:void 0,s=ae?e=>{e.stopPropagation(),se?.(a,!0)}:void 0,l=ae?{onClick:i,onDoubleClick:s,"data-organism-id":e.id,css:trt({theme:ne,selected:t})}:{};return nt(Cv,{disabled:e.disabled||n,sx:eht(e),selected:r,onClick:()=>{e?.link&&(o?o.isExternal?Q7e(o.destination):le?.({link:o.destination,webpageAlias:o.webpageAlias,query:o.recordId?{rwoRecordId:o.recordId}:void 0}):e9e(e.link)?le?.({link:e.link?.internalLink||""}):Q7e(e.link?.externalLink))},...l,children:[e.startIcon&&ot(EGe,{iconName:e.startIcon,color:e.textColor}),ot($v,{primary:ot(Sd,{sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"},children:e.text})}),e.endIcon&&ot(EGe,{iconName:e.endIcon,color:e.textColor})]},e.id)})})})},rht=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0};const oht=({errorMsg:e,stepValue:t,minValue:r,allowNegative:o,inputSx:n,labelSx:a,variant:i="outlined",...s})=>ot(oC,{...s,variant:i,type:"number",error:!!e,helperText:e||null,inputProps:{step:t,min:o?void 0:r},slotProps:{input:{sx:n},inputLabel:{sx:a}}}),nht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="This field is required",validationErrorText:n="Invalid numeric value",text:a,placeholderText:i,backgroundColor:s,borderColor:l,textColor:c="#000",fontSize:u,fontFamily:d,fontWeight:p,allowNegative:h=!1,numericPrecision:f="1",name:m,sourceDataModelField:y,marginLeft:g="0",marginTop:v="0",marginRight:x="0",marginBottom:b="0",paddingLeft:w="0",paddingTop:k="0",paddingRight:_="0",paddingBottom:C="0",width:M,height:S,configurationItemInfo:D,textAlign:O,minHeight:P,maxHeight:E,minWidth:j,maxWidth:T,sx:N,inputSize:R="medium",labelOffset:I,hideLabel:F=!1,variant:A="outlined"})=>{const z=Ut(),L=z?.control,B=!(!L||!m),{localStateObject:V}=IC(),{stateConfig:$}=WC(),H=dt(),q=V||$,W=y?q?.[y]?.value:void 0,U=y?H?.getDmfValue(y):void 0,[G,K]=e.useState(""),Y=parseFloat(f),Z=h?void 0:0,X={required:!!r&&o,pattern:{value:h?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:n}};h||(X.min={value:0,message:"Value cannot be less than zero"});const Q=e.useMemo(()=>{if(F)return;if(void 0!==I)return I;const e=rht(k),t=rht(C);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=rht(S)||rht(P)||rht(E);if(!o&&!e&&!t)return;const n="number"==typeof u?1.5*u:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[S,P,E,I,R,u,k,C,F]),J=e.useMemo(()=>{if(F)return;const e="small"===R?-6:-9,t=rht(S)||rht(P)||rht(E);return!t||t>=36?e:-6},[S,P,E,R,F]);if(t){let e="";e=void 0!==U?String(U??""):B?z.watch(m)||"":W;const t=e?function(e,t,r){if(!e)return"";const o=parseFloat(e);if(Number.isNaN(o))return e;if(!r&&o<0)return"0";if(t){const e=(t.split(".")[1]||"").length;if(e>0)return o.toFixed(e)}return e}(e,f,h):i||"-";return nt("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E}},sx:N,...D,children:[a&&ot(vg,{sx:{fontSize:u,fontFamily:d,fontWeight:p,color:c,marginBottom:"4px"},children:a}),ot(Sd,{sx:{fontSize:u,fontFamily:d,fontWeight:p,color:c,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,backgroundColor:s,border:`1px solid ${l||"#ccc"}`,borderRadius:"4px",minWidth:"60px"},children:t})]})}const ee={backgroundColor:s,color:c,fontSize:u,fontFamily:d,fontWeight:p,...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},"& .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"}},te={color:c,"&.Mui-focused":{color:c},...F&&{display:"none"},...void 0!==Q&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${Q}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${J}px) scale(0.75)`}}},re={...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E}};return ot(rg,B?{required:r,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,width:"fit-content",...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},...N},...D,children:ot(Jt,{name:m,rules:X,control:L,defaultValue:"",render:({field:e,fieldState:t})=>ot(oht,{errorMsg:t.error?.message,label:F?void 0:a,placeholder:i,stepValue:Y,minValue:Z,allowNegative:h,inputSx:ee,labelSx:te,sx:re,size:R,variant:A,value:e.value||"",onChange:t=>e.onChange(t.target.value)})})}:{required:r,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,width:"fit-content",...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},...N},...D,children:ot(oht,{errorMsg:void 0,label:F?void 0:a,placeholder:i,stepValue:Y,minValue:Z,allowNegative:h,inputSx:ee,labelSx:te,sx:re,size:R,variant:A,value:G,onChange:e=>K(e.target.value)})})},aht=e=>{const t={text:e.label,validate:()=>!0},{rule:r}=e,o=iht(r);if(o||sht(r)){const e=((e,t)=>(r=0)=>e?r<=t:r>=t)(o,o?r.MAX:r.MIN);switch(r.type){case"COUNT":t.validate=t=>e(t?.length);break;case"NUMBER_COUNT":t.validate=t=>e(t?.replace(/\D/g,"").length);break;case"CAPITAL_COUNT":t.validate=t=>e((t?.match(/[A-Z]/g)||[]).length);break;case"SPECIAL_CHARACTERS_COUNT":t.validate=t=>e(t?.replace(/[a-z]|\d|\s/gi,"").length);break;case"LOWER_CASE_COUNT":t.validate=t=>e((t?.match(/[a-z]/g)||[]).length)}}return t},iht=e=>!!e?.MAX,sht=e=>!!e?.MIN,lht=({gap:t="0",inputProps:r,validations:o,htmlElementId:n,validationState:a,overridesProperties:i,configurationItemInfo:s,width:l,height:c,minWidth:u,maxWidth:d,minHeight:p,maxHeight:h,marginLeft:f="0",marginTop:m="0",marginRight:y="0",marginBottom:g="0",sx:v,...x})=>{const{watch:b,formState:w,setError:k}=Ut()||{},{text:_,subText:C,placeholderText:M,subPlaceholderText:S,validationText:D}=i,O=o.map(aht),P="password",E=`reEnter${P}`,j=b?.(P),T=b?.(E);return e.useEffect(()=>{j!==T&&k(E,{type:"manual",message:"Passwords do not match"})},[j,T,k,E]),nt(Gf,{id:n,sx:{width:"100%",display:"flex",flexDirection:"column",gap:t,marginLeft:f,marginTop:m,marginRight:y,marginBottom:g,...l&&{width:l},...c&&{height:c},...u&&{minWidth:u},...d&&{maxWidth:d},...p&&{minHeight:p},...h&&{maxHeight:h},...v},...s,...x,children:[ot(crt,{...r,inputType:"password",text:_?.text,name:P,placeholderText:M?.text}),ot(crt,{...r,inputType:"password",text:C?.text,name:E,placeholderText:S?.text}),ot(LKe,{rules:O,value:j,label:D?.text,isSubmitted:w?.isDirty,validationState:a})]})},cht=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],uht=e.forwardRef((e,t)=>{const{inputRef:r,...o}=e;return ot(GKe,{...o,ref:e=>{"function"==typeof r&&r(e?e.inputElement:null)},mask:cht,guide:!0,placeholderChar:" "})}),dht=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0};function pht(e){const t=(e??"").replace(/\D+/g,"");if(!t)return"";let r="",o=0;return tYe.forEach(e=>{"string"==typeof e?r+=e:o<t.length?(r+=t[o],o+=1):r+="_"}),r}const hht=({masked:e,errorMsg:t,inputSx:r,labelSx:o,variant:n="outlined",...a})=>ot(oC,{...a,variant:n,error:!!t,helperText:t||null,slotProps:{input:{sx:r,...e?{inputComponent:uht}:{}},inputLabel:{sx:o}}}),fht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="Phone is required",validationErrorText:n="Invalid phone number",text:a,placeholderText:i,masked:s=!0,multiLine:l=!1,backgroundColor:c,borderColor:u,textColor:d="#000",fontSize:p,fontFamily:h,fontWeight:f,textAlign:m,marginLeft:y="0",marginTop:g="0",marginRight:v="0",marginBottom:x="0",paddingLeft:b="0",paddingTop:w="0",paddingRight:k="0",paddingBottom:_="0",width:C,height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P,name:E,sourceDataModelField:j,configurationItemInfo:T,sx:N,inputSize:R="medium",labelOffset:I,hideLabel:F=!1,variant:A="outlined"})=>{const z=Ut(),L=z?.control,B=!(!L||!E),{localStateObject:V}=IC(),{stateConfig:$}=WC(),H=dt(),q=V||$,W=j?q?.[j]?.value:void 0,U=j?H?.getDmfValue(j):void 0,[G,K]=e.useState(""),Y={required:!!r&&o,pattern:{value:/^\d{10}$/,message:n}},Z=e.useMemo(()=>{if(F)return;if(void 0!==I)return I;const e=dht(w),t=dht(_);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=dht(M)||dht(S)||dht(D);if(!o&&!e&&!t)return;const n="number"==typeof p?1.5*p:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[M,S,D,I,R,p,w,_,F]),X=e.useMemo(()=>{if(F)return;const e="small"===R?-6:-9,t=dht(M)||dht(S)||dht(D);return!t||t>=36?e:-6},[M,S,D,R,F]);if(t){let e="";e=void 0!==U?String(U??""):B?z.watch(E)||"":String(W??"");const t=(s?pht(e):e)||i||"-";return nt("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}},...T,children:[a&&ot(vg,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,marginLeft:0,marginBottom:"4px",...N},children:a}),ot(Sd,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_,backgroundColor:c,border:`1px solid ${u||"#ccc"}`,borderRadius:"4px",minWidth:"120px",...N},children:t})]})}const Q={backgroundColor:c,color:d,fontSize:p,fontFamily:h,fontWeight:f,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},"& .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"}},J={color:d,"&.Mui-focused":{color:d},...F&&{display:"none"},...void 0!==Z&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${Z}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${X}px) scale(0.75)`}}},ee={marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,width:"fit-content",...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}};return ot(rg,B?{required:r,sx:{...ee,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},...N},...T,children:ot(Jt,{name:E,rules:Y,control:L,defaultValue:"",render:({field:e,fieldState:t})=>ot(hht,{masked:s,errorMsg:t.error?.message,inputSx:Q,labelSx:J,size:R,variant:A,label:F?void 0:a,placeholder:i,value:e.value||"",onChange:t=>{const r=(t?.target?.value??"").toString().replace(/\D+/g,"");e.onChange(r)}})})}:{required:r,sx:{...ee,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},...N},...T,children:ot(hht,{masked:s,errorMsg:void 0,inputSx:Q,labelSx:J,size:R,variant:A,label:F?void 0:a,placeholder:i,value:G,onChange:e=>{const t=(e?.target?.value??"").toString();K(t.replace(/\D+/g,""))}})})},mht=({text:t,name:r,isDisplayOnly:o=!1,required:n=!1,requiredErrorText:a="This field is required",validationErrorText:i="Invalid rating",placeholderText:s="",hoverFeedback:l=!1,sourceDataModelField:c,textAlign:u="left",color:d="black",textColor:p,selectColor:h,fontSize:f=14,fontFamily:m="Arial, sans-serif",fontWeight:y="normal",marginLeft:g="0",marginTop:v="0",marginRight:x="0",marginBottom:b="0",paddingLeft:w="0",paddingTop:k="0",paddingRight:_="0",paddingBottom:C="0",width:M,height:S,minHeight:D,maxHeight:O,minWidth:P,maxWidth:E,placement:j="right",configurationItemInfo:T={},disabled:N=!1,maxValue:R=5,ratingPrecision:I=.5,sx:F,...A})=>{const z=Ut(),L=z?.control,B=!!z&&!!L&&!!r,{localStateObject:V}=IC(),{stateConfig:$}=WC(),H=dt(),q=V||$,W=c?q?.[c]?.value:void 0;!B||z.formState.errors;const[U,G]=e.useState(null),[K,Y]=e.useState(-1),Z=l&&-1!==K;if(o){const e=c?H?.getDmfValue(c):void 0;let r=null;const o=e=>"number"!=typeof e||Number.isNaN(e)?"string"!=typeof e||Number.isNaN(Number(e))?null:Number(e):e;if(void 0!==e)r=o(e);else if(c&&q?.[c]){const e=q?.[c]?.value;r=o(e)}return nt(rg,{required:n,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,display:"inline-flex",...M&&{width:M},...S&&{height:S},...D&&{minHeight:D},...O&&{maxHeight:O},...P&&{minWidth:P},...E&&{maxWidth:E},...F},...T,children:[t&&ot(Sd,{variant:"subtitle1",sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,marginBottom:"4px"},children:t}),ot(yb,{value:r,max:R,precision:I,readOnly:!0,sx:{"& .MuiRating-iconEmpty":{color:d},"& .MuiRating-iconFilled":{color:h||d},...F},...A})]})}const X={required:!!n&&a,validate:e=>!n||null!==e&&0!==e||a};return nt(rg,{required:n,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,display:"inline-flex",...M&&{width:M},...S&&{height:S},...D&&{minHeight:D},...O&&{maxHeight:O},...P&&{minWidth:P},...E&&{maxWidth:E},...F},...T,children:[t&&ot(Sd,{variant:"subtitle1",sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,marginBottom:"4px"},children:t}),nt(Gf,{sx:{display:"flex",alignItems:"center"},children:["left"===j&&ot(Sd,{sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,minWidth:"2em"},children:Z?K:B?z.getValues(r)??W??"":U??W??""}),ot(Jt,{name:r,control:L,defaultValue:"number"==typeof W?W:null,rules:X,render:({field:e,fieldState:{error:t}})=>nt(rt,{children:[ot(yb,{value:e.value??W??0,max:R,precision:I,disabled:N,onChange:(t,r)=>e.onChange(r),onChangeActive:l?(e,t)=>Y(t??-1):void 0,sx:{"& .MuiRating-iconEmpty":{color:d},"& .MuiRating-iconFilled":{color:h||d},marginX:l?1:0,...F},...A}),t&&ot(vg,{error:!0,sx:{marginTop:"4px"},children:"required"===t.type?a:i})]})}),"right"===j&&ot(Sd,{sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,minWidth:"2em"},children:Z?K:B?z.getValues(r)??W??"":U??W??""})]})]})},yht=({open:t,text:o,disabled:n,sx:a,placeholderText:i,required:s=!1,requiredErrorText:l="This field is required",validationErrorText:c="Invalid format",isDisplayOnly:u=!1,displayText:d,visible:p=!0,fontSize:h,fontFamily:f,fontWeight:m,textColor:y,textAlign:g,borderColor:v,color:x,backgroundColor:b,marginLeft:w="0",marginTop:k="0",marginRight:_="0",marginBottom:C="0",paddingLeft:M,paddingTop:S,paddingRight:D,paddingBottom:O,width:P,height:E,minHeight:j,maxHeight:T,minWidth:N,maxWidth:R,configurationItemInfo:I={},name:F,sourceDataModelField:A,predefinedValue:z,hideWhenNoValue:L=!1,inputSize:B="medium",hideLabel:V=!1,variant:$="outlined",native:H=!1,options:q,publishToWebpageContext:W=!1,webpageContextKey:U})=>{const G="regular"===m?"normal":m,K=e=>""!==e&&null!=e,Y=u?void 0:A,{dataModelFieldOptions:Z,isLoading:X}=(e=>{const{pickList:t}=ct(),{data:o=[],refetch:n,isLoading:a}=r.useQuery({queryKey:[TGe,e],queryFn:()=>t.get(e),select:e=>{const t=e?.data;return Array.isArray(t)?t:t&&Array.isArray(t.data)?t.data:[]},enabled:Boolean(e),refetchOnWindowFocus:!0,refetchOnMount:!0});return{dataModelFieldOptions:o,refetch:n,isLoading:a}})(Y),Q=q&&q.length>0?q:Z,J=e.useMemo(()=>(Q||[]).map(e=>"string"==typeof e?{id:e,label:e}:e),[Q]),ee=Ut(),te=!!ee?.control&&!!F,[re,oe]=e.useState(""),[ne,ae]=e.useState(!1),{localStateObject:ie,setLocalStateValue:se,isConfigurationMode:le,selectedConfigurationItemId:ce}=IC(),{stateConfig:ue}=WC(),de=dt(),pe=GC(),he=ie||ue,fe=A?he?.[A]:void 0,me=fe?.value||("string"==typeof fe||"number"==typeof fe?fe:void 0),ye=A?de?.getDmfValue(A):void 0,ge="string"==typeof ye||"number"==typeof ye?ye:ye&&"object"==typeof ye?ye.value??ye.label??ye.id:void 0,ve=null!=z&&""!==z,xe=Boolean(n)||ve;e.useEffect(()=>{ve&&null!=z&&(te?ee?.setValue(F,z):oe(z))},[ve,z,te,ee,F]);const be=ge??me;if(e.useEffect(()=>{W&&U&&pe?.setDynamicContextValue&&void 0!==be&&pe.setDynamicContextValue(U,be)},[W,U,be,pe]),!p)return null;if(u&&L&&!(ge??me))return null;if(u){const e=d??(null!=ge?String(ge):void 0)??(null!=me?String(me):void 0)??(i||"-");return nt("div",{style:{display:"inline-flex",flexDirection:"column",...K(k)&&{marginTop:k},...K(_)&&{marginRight:_},...K(C)&&{marginBottom:C},...K(w)&&{marginLeft:w},...K(P)?{width:P}:{width:"fit-content"},...K(E)&&{height:E},...K(j)&&{minHeight:j},...K(T)&&{maxHeight:T},...K(N)&&{minWidth:N},...K(R)&&{maxWidth:R}},...I,children:[o&&ot(vg,{sx:{...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G},color:K(y)?y:"#000",marginLeft:0,marginBottom:"4px",...K(g)&&{textAlign:g}},children:o}),ot(Sd,{sx:{...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G},...K(y)&&{color:y},...K(g)&&{textAlign:g},...K(M)&&{paddingLeft:M},...K(S)&&{paddingTop:S},...K(D)&&{paddingRight:D},...K(O)&&{paddingBottom:O},...K(b)&&{backgroundColor:b},border:`1px solid ${K(v)?v:"#ccc"}`,borderRadius:"4px"},children:e})]})}const we="small"===B?40:56,ke={position:"relative",display:K(P)?"block":"inline-block",...K(P)&&{width:P},...K(N)&&{minWidth:N},...K(R)&&{maxWidth:R},...K(w)&&{marginLeft:w},...K(k)&&{marginTop:k},...K(_)&&{marginRight:_},...K(C)&&{marginBottom:C}},_e={width:"100%",...K(E)&&{height:E},...K(j)&&{minHeight:j},...K(T)&&{maxHeight:T},...!K(P)&&!K(N)&&{minWidth:"240px"},...a},Ce=K(y)?y:K(x)?x:void 0,Me={..."small"===B&&!E&&{height:`${we}px`},...K(b)&&{backgroundColor:b},...Ce&&{color:Ce},...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G},...K(v)&&{"& .MuiOutlinedInput-notchedOutline":{borderColor:v},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:v},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:v}},..."filled"===$&&K(v)&&{"&:before":{borderColor:v},"&:after":{borderColor:v},"&:hover:not(.Mui-disabled):before":{borderColor:v}},..."standard"===$&&K(v)&&{"&:before":{borderColor:v},"&:after":{borderColor:v},"&:hover:not(.Mui-disabled):before":{borderColor:v}},"& .MuiSelect-select":{...K(g)&&{textAlign:g},...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G},...K(S)&&{paddingTop:S},...K(O)&&{paddingBottom:O},...K(M)&&{paddingLeft:M},...K(D)&&{paddingRight:D}}},Se={...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G}},De=te?ee.watch(F)||"":re,Oe=te?ee.formState?.errors?.[F]:void 0;return ot("div",{style:ke,...I,onClick:e=>{le&&I&&"onClick"in I&&(e.stopPropagation(),e.preventDefault(),I.onClick())},children:nt(rg,{variant:$,size:B,sx:_e,disabled:xe,required:s,error:!!Oe,children:[!V&&ot(Wg,{id:`${F}-label`,shrink:H?ne||!!De:void 0,sx:Se,children:o}),ot(Tb,{value:De,onChange:e=>{var t;le||(t=e.target.value,oe(t),te&&ee.setValue(F,t),A&&se&&se(A,{id:t}))},onFocus:()=>ae(!0),onBlur:()=>ae(!1),...le&&{open:!1},labelId:V?void 0:`${F}-label`,label:V?void 0:o,disabled:xe,native:H,sx:Me,children:H?[ot("option",{value:""},"__placeholder__"),...X?[ot("option",{disabled:!0,children:"Loading..."},"__loading__")]:J.map(e=>ot("option",{value:e.id,children:e.label},e.id))]:X?nt(yx,{disabled:!0,children:[ot(ed,{size:20,sx:{mr:1}}),"Loading..."]}):J.map(e=>ot(yx,{value:e.id,children:e.label},e.id))}),Oe&&ot(vg,{error:!0,children:Oe?.message||l})]})})};const ght=({text:e,name:t,isDisplayOnly:r=!1,required:o=!1,requiredErrorText:n="This field is required",validationErrorText:a="Invalid value",placeholderText:i="",startIcon:s,endIcon:l,borderColor:c,selectLineColor:u,lineWeight:d=1,orientation:p="horizontal",textColor:h,fontSize:f,fontFamily:m,fontWeight:y,valueFormat:g,valueDisplay:v="auto",iconSize:x,selectColor:b,iconColor:w,minValue:k=0,maxValue:_=100,step:C,labelPlacement:M="top",marginLeft:S="0",marginTop:D="0",marginRight:O="0",marginBottom:P="0",paddingLeft:E="0",paddingTop:j="0",paddingRight:T="0",paddingBottom:N="0",width:R,height:I,minHeight:F,maxHeight:A,minWidth:z,maxWidth:L,sx:B,configurationItemInfo:V,sourceDataModelField:$,disabled:H=!1,...q})=>{const W=Ut(),U=W?.control,{localStateObject:G}=IC(),{stateConfig:K}=WC(),Y=dt(),Z=G||K,X=$?Z?.[$]?.value:void 0,Q=$?Y?.getDmfValue($):void 0,J={required:!!o&&n,validate:e=>!o||null!=e||n},ee=e=>function(e,t){if(null==e)return"";switch(t){case"$0.00":return`$${e.toFixed(2)}`;case"$123":return`$${e}`;case"%0.00":return`${e.toFixed(2)}%`;case"%123":return`${e}%`;case"0.0":return e.toFixed(1);case"0.00":return e.toFixed(2);default:return e.toString()}}(e,g),te={width:"100%","& .MuiSlider-root":{width:"100%"},"& .MuiSlider-rail":{backgroundColor:c||"#ccc",..."vertical"===p?{width:`${d}px`}:{height:`${d}px`}},"& .MuiSlider-track":{backgroundColor:u||"#2196f3",border:`1px solid ${u||"#2196f3"}`,..."vertical"===p?{width:`${d}px`}:{height:`${d}px`}},"& .MuiSlider-thumb":{backgroundColor:b||"#2196f3",width:x||"16px",height:x||"16px",boxShadow:"none","&:focus, &:hover, &.Mui-active, &.Mui-focusVisible":{boxShadow:"none"}},"& .MuiSlider-valueLabel":{backgroundColor:b||"#2196f3",color:"#ffffff",borderRadius:"4px",fontSize:"12px",fontWeight:500},"& .MuiSlider-mark":{backgroundColor:c||"#ccc",width:"2px",height:"2px",borderRadius:"50%"},"& .MuiSlider-markActive":{backgroundColor:b||"#2196f3"},...B};if(r){let t=null;const r=e=>"number"!=typeof e||Number.isNaN(e)?"string"!=typeof e||Number.isNaN(Number(e))?null:Number(e):e;if(void 0!==Q)t=r(Q);else if($&&Z?.[$]){const e=Z?.[$]?.value;t=r(e)}return nt(rg,{required:o,sx:{marginLeft:S,marginTop:D,marginRight:O,marginBottom:P,paddingLeft:E,paddingTop:j,paddingRight:T,paddingBottom:N,display:"inline-flex",...R&&{width:R},...I&&{height:I},...F&&{minHeight:F},...A&&{maxHeight:A},...z&&{minWidth:z},...L&&{maxWidth:L},...B},...V,children:[e&&ot(Cg,{children:e}),nt(Gf,{display:"flex",flexDirection:"top"===M?"column":"row",alignItems:"center",mt:"top"===M?1:0,children:[s&&ot(Gf,{mr:"horizontal"===p?1:0,mb:"vertical"===p?1:0,children:ot(EGe,{iconName:s,color:w})}),ot(fw,{value:t??void 0,min:k,max:_,step:C,orientation:p,valueLabelDisplay:v,valueLabelFormat:ee,sx:te,disabled:!0,...q}),l&&ot(Gf,{ml:"horizontal"===p?1:0,mt:"vertical"===p?1:0,children:ot(EGe,{iconName:l,color:w})}),ot(Sd,{sx:{ml:1,fontSize:f,fontFamily:m,fontWeight:y,color:h},children:t})]})]})}return nt(rg,{required:o,sx:{marginLeft:S,marginTop:D,marginRight:O,marginBottom:P,paddingLeft:E,paddingTop:j,paddingRight:T,paddingBottom:N,display:"inline-flex",...R&&{width:R},...I&&{height:I},...F&&{minHeight:F},...A&&{maxHeight:A},...z&&{minWidth:z},...L&&{maxWidth:L},...B},...V,children:[e&&ot(Cg,{children:e}),ot(Jt,{name:t||"",control:U,defaultValue:"number"==typeof X?X:k,rules:J,render:({field:e,fieldState:t})=>nt(rt,{children:[ot(fw,{...e,min:k,max:_,step:C,orientation:p,valueLabelDisplay:v,valueLabelFormat:ee,sx:te,onChange:(t,r)=>e.onChange(r),...q}),t.error&&ot(vg,{error:!0,sx:{mt:1},children:"required"===t.error.type?n:a})]})})]})},vht=({direction:t="up",size:r="medium",ariaLabel:o="Speed Dial",openIconName:n="plus",closeIconName:a="x",openIconColor:i="#fff",closeIconColor:s="#fff",backgroundColor:l="#1976d2",items:c=[],configurationItemInfo:u={},tooltipOpen:d=!1,tooltipPlacement:p,showBackdrop:h=!1,openOnHover:f=!1,paddingTop:m,paddingRight:y,paddingBottom:g,paddingLeft:v,marginTop:x,marginRight:b,marginBottom:w,marginLeft:k,moleculeId:_,gap:C,sx:M,...S})=>{const D=Ge(),[O,P]=e.useState(!1),{isConfigurationMode:E,onConfigurationItemClicked:j,selectedConfigurationItemId:T,onInternalNavigation:N}=IC();e.useEffect(()=>{if(!O)return;const e=e=>{"Escape"!==e.key||E||P(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[O,E]);const R=()=>P(!0),I=()=>P(!1);let F={};F=f&&!h?{onMouseEnter:R,onMouseLeave:I,onFocus:R,onBlur:I}:{onClick:e=>{P(e=>!e)}};const A={bgcolor:l,paddingTop:m,paddingRight:y,paddingBottom:g,paddingLeft:v,marginTop:x,marginRight:b,marginBottom:w,marginLeft:k},z=O||E&&(T===_||c.some(e=>e.id===T));return nt("div",{role:"presentation",children:[h&&ot(Ff,{open:O}),ot(Mw,{ariaLabel:o,direction:t,icon:ot(Yw,{icon:ot(EGe,{iconName:n,color:i,size:24}),openIcon:ot(EGe,{iconName:a,color:s,size:24})}),open:z,onOpen:f&&!h?R:void 0,onClose:f&&!h?I:void 0,FabProps:{color:"primary",sx:A,size:r,gap:C},slotProps:{fab:{"data-testid":"speed-dial-fab","aria-label":o}},sx:{"& .MuiSpeedDial-fab":{backgroundColor:l,...A},"& .MuiSpeedDial-actions":{gap:C||8},"& .MuiSpeedDialIcon-icon":{fontSize:"small"===r?"18px":"large"===r?"24px":"20px",color:"inherit"},"& .MuiSpeedDialIcon-openIcon":{fontSize:"small"===r?"18px":"large"===r?"24px":"20px",color:"inherit"},"& .MuiSpeedDialAction-fab":{backgroundColor:"#fff",color:"#757575","&:hover":{backgroundColor:"#f5f5f5"}},"& .MuiSpeedDialAction-staticTooltip":{backgroundColor:"rgba(97, 97, 97, 0.9)",color:"#fff",fontSize:"12px",padding:"4px 8px",borderRadius:"4px"},"& .MuiSpeedDialAction-staticTooltipLabel":{fontSize:"12px",fontWeight:500},...M},...F,...u,...S,children:c.map(e=>{const{text:t,link:o}=e.properties??{},{iconName:n="plus",disabled:a=!1,iconColor:i="#757575",tooltipText:s,backgroundColor:l="#fff"}=e.config?.props??{},c=String(t?.text||s||"Action"),u=E&&T===e.id,h={entityId:e.id,entity:"molecule_item",entityType:"speed_dial_action_item"},f=E?{onClick:e=>{e.stopPropagation(),j?.(h,!1)},onDoubleClick:e=>{e.stopPropagation(),j?.(h,!0)},"data-organism-id":e.id,css:trt({theme:D,selected:u})}:{};return ot(Hw,{icon:ot(EGe,{iconName:n,color:i,size:24}),tooltipOpen:d,tooltipTitle:c,tooltipPlacement:p,FabProps:{sx:{color:i,backgroundColor:l},size:r,disabled:a,"aria-label":c,onClick:e=>{e.stopPropagation(),o?(e9e(o)?N?.({link:o.internalLink??""}):Q7e(o.externalLink),P(!1)):P(!1)},...f}},e.id)})})]})},xht=({items:e,gap:t,stepGap:r,isMobile:o=!1,iconSize:n="24px",orientation:a="horizontal",activeStep:i=0,lineColor:s,lineWidth:l,lineRadius:c,marginTop:u="0",marginRight:d="0",marginBottom:p="0",marginLeft:h="0",paddingTop:f="0",paddingRight:m="0",paddingBottom:y="0",paddingLeft:g="0",borderRadius:v="0",configurationItemInfo:x,backgroundColor:b="transparent",sx:w,...k})=>{const _=Ge(),C=o?"vertical":a,{isConfigurationMode:M,onConfigurationItemClicked:S,selectedConfigurationItemId:D}=IC();return ot(zk,{sx:{gap:t,width:"100%",overflow:"hidden",marginTop:u,marginRight:d,marginBottom:p,marginLeft:h,paddingTop:f,paddingRight:m,paddingBottom:y,paddingLeft:g,borderRadius:v,backgroundColor:b,"& .MuiStep-root":{padding:"8px"},"& .MuiStepLabel-root":{gap:r,alignItems:"flex-start"},"& .MuiStepLabel-label":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"},"& .MuiStepConnector-root":{flex:"1 1 auto"},"& .MuiStepConnector-line":{borderColor:s,borderWidth:l,borderRadius:c},"& .MuiStepConnector-vertical":{width:n||"24px",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:"4px"},"& .MuiStepConnector-horizontal":{marginLeft:"8px",marginRight:"8px"},"& .MuiStepContent-root":{margin:0,padding:0,marginTop:"4px",borderLeft:"none"},"& .MuiTypography-root":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"},...w},activeStep:i,orientation:C,connector:ot(Ok,{sx:{[`&.${Ck.vertical}`]:{width:n||"24px",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:"4px"},[`&.${Ck.vertical} .${Ck.line}`]:{borderColor:s,borderWidth:l,borderRadius:c},[`&.${Ck.horizontal} .${Ck.line}`]:{borderColor:s,borderWidth:l,borderRadius:c}}}),...x,...k,children:e.map((e,t)=>{const o=D===e.id,a=t===i,s={entityId:e.id,entity:"molecule_item",entityType:"stepper_item"},l=M?{onClick:e=>{M&&(e.stopPropagation(),S?.(s,!1))},onDoubleClick:e=>{M&&(e.stopPropagation(),S?.(s,!0))},"data-organism-id":e.id,css:trt({theme:_,selected:o})}:{},c=e.color||(a?"#000":"#555");return ot(ak,{...l,children:nt(kk,{sx:{gap:r,"& .MuiStepLabel-iconContainer":{marginRight:"8px",display:"flex",alignItems:"center",justifyContent:"center"},"& .MuiStepLabel-labelContainer":{display:"flex",flexDirection:"column",alignItems:"flex-start"}},icon:e?.iconName?ot(EGe,{size:n,color:e.iconColor||"#000",iconName:e.iconName,borderRadius:e?.iconBorderRadius||0,backgroundColor:e.iconBackgroundColor||"transparent"}):void 0,children:[ot(Sd,{variant:"body1",sx:{padding:"4px",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",color:c,borderRadius:e.borderRadius||"0",display:"inline-block","&.MuiTypography-body1":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"}},children:e.title}),e.subText&&ot(Nk,{sx:{margin:0,padding:0,marginTop:"4px",borderLeft:"none","& .MuiStepContent-root":{margin:0,padding:0,marginTop:"4px",borderLeft:"none"}},transitionDuration:{enter:400,exit:400},children:ot(Sd,{variant:"body2",sx:{padding:"4px",fontSize:e.subTextFontSize||"inherit",fontWeight:e.subTextFontWeight||"normal",fontFamily:e.subTextFontFamily||"inherit",color:e.subTextColor||"#666",borderRadius:e.borderRadius||"0",display:"inline-block",..."horizontal"===C&&{maxWidth:"300px"},"&.MuiTypography-body2":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"}},children:e.subText})})]})},e.id)})})},bht=fl(Uk)(({thumbColor:e="#ff0000",thumbCheckedColor:t="#00ff00",trackColor:r="#0000ff",disabledThumbColor:o="#9e9e9e",sx:n})=>({"& .MuiSwitch-thumb":{backgroundColor:e,width:20,height:20},"& .MuiSwitch-switchBase.Mui-checked .MuiSwitch-thumb":{backgroundColor:t},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"& .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"&.Mui-disabled .MuiSwitch-thumb":{backgroundColor:o},"&.Mui-disabled .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"& .MuiSwitch-switchBase":{padding:"9px","&.Mui-checked":{transform:"translateX(16px)"}},"& .MuiSwitch-colorPrimary":{"&.Mui-checked":{color:t}},"& .MuiSwitch-colorSecondary":{"&.Mui-checked":{color:t}},...n})),wht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="This field is required",validationErrorText:n="Invalid value",text:a="",thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,labelPlacement:u="top",marginLeft:d="0",marginTop:p="0",marginRight:h="0",marginBottom:f="0",paddingLeft:m="0",paddingTop:y="0",paddingRight:g="0",paddingBottom:v="0",width:x,height:b,minHeight:w,maxHeight:k,minWidth:_,maxWidth:C,name:M,sourceDataModelField:S,disabled:D=!1,sx:O,configurationItemInfo:P,...E})=>{const j=Ut(),T=j?.control,N=!!T&&!!M,R={required:!!r&&o,validate:e=>!(r&&!e)||o},{localStateObject:I}=IC(),{stateConfig:F}=WC(),A=dt(),z=I||F,L=S?z?.[S]?.value:void 0,[B,V]=e.useState(!1);if(t){const e=S?A?.getDmfValue(S):void 0;let t=!1;return t=void 0!==e?"true"===String(e).toLowerCase()||!0===e:N?!!j.watch(M):!!L,nt(rg,{required:r,sx:{marginLeft:d,marginTop:p,marginRight:h,marginBottom:f,paddingLeft:m,paddingTop:y,paddingRight:g,paddingBottom:v,display:"inline-flex",...x&&{width:x},...b&&{height:b},...w&&{minHeight:w},...k&&{maxHeight:k},..._&&{minWidth:_},...C&&{maxWidth:C},"& .MuiFormLabel-root":{fontSize:"14px",fontWeight:500,color:"#333",marginBottom:"8px"},"& .MuiSwitch-root":{marginTop:"8px"},"& .MuiSwitch-switchBase":{padding:"9px"},"& .MuiSwitch-thumb":{width:"18px",height:"18px",borderRadius:"9px"},"& .MuiSwitch-track":{borderRadius:"9px",height:"14px"},"& .MuiTypography-root":{marginLeft:"8px",fontSize:"14px",fontWeight:500,color:"#333"},...O},...P,children:[a&&ot(Cg,{component:"legend",children:a}),nt(Gf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:[ot(bht,{disabled:!0,checked:t,thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{pointerEvents:"none"}},...E}),ot(Sd,{sx:{ml:1},children:t?"ON":"OFF"})]})]})}return nt(rg,{required:r,sx:{marginLeft:d,marginTop:p,marginRight:h,marginBottom:f,paddingLeft:m,paddingTop:y,paddingRight:g,paddingBottom:v,display:"inline-flex",...x&&{width:x},...b&&{height:b},...w&&{minHeight:w},...k&&{maxHeight:k},..._&&{minWidth:_},...C&&{maxWidth:C},"& .MuiFormLabel-root":{fontSize:"14px",fontWeight:500,color:"#333",marginBottom:"8px"},"& .MuiSwitch-root":{marginTop:"8px"},"& .MuiSwitch-switchBase":{padding:"9px"},"& .MuiSwitch-thumb":{width:"18px",height:"18px",borderRadius:"9px"},"& .MuiSwitch-track":{borderRadius:"9px",height:"14px"},"& .MuiFormHelperText-root":{marginTop:"4px",fontSize:"12px",color:"#d32f2f"},...O},...P,children:[a&&ot(Cg,{component:"legend",children:a}),N?ot(Jt,{name:M,rules:R,control:T,defaultValue:!1,render:({field:e,fieldState:t})=>nt(rt,{children:[ot(Gf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:ot(bht,{checked:!!e.value,disabled:D,onChange:(t,r)=>e.onChange(r),thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)"}}},...E})}),t.error&&ot(vg,{error:!0,sx:{marginTop:"4px"},children:"required"===t.error.type?o:n})]})}):ot(Gf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:ot(bht,{checked:B,disabled:D,onChange:(e,t)=>{V(t)},thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)"}}},...E})})]})},kht=({items:t,onTabChange:r,activeTabKey:o,isMobile:n=!1,marginTop:a,marginRight:i,marginBottom:s,marginLeft:l,paddingTop:c,paddingRight:u,paddingBottom:d,paddingLeft:p,buttonPaddingTop:h,buttonPaddingRight:f,buttonPaddingBottom:m,buttonPaddingLeft:y,width:g,height:v,backgroundColor:x,borderRadius:b,elevation:w=1,gap:k,indicatorVisible:_=!0,indicatorColor:C,lineWidth:M="2px",orientation:S="horizontal",activeTextColor:D="#1976d2",inactiveTextColor:O="#000",fontSize:P,fontWeight:E,fontFamily:j,wrapText:T,textAlign:N,iconName:R,iconColor:I,iconSize:F,iconPlacement:A="left",hoverTextColor:z,itemBorder:L,itemBorderRadius:B,itemBackgroundColor:V,itemSelectedBackgroundColor:$,itemHoverBackgroundColor:H,selectedItemElevation:q=0,itemDisableRipple:W,configurationItemInfo:U,sx:G})=>{const K=Ge(),{isConfigurationMode:Y,onConfigurationItemClicked:Z,selectedConfigurationItemId:X}=IC(),[Q,J]=e.useState(null),ee=e=>J(e.currentTarget),te=()=>J(null),re={marginTop:a,marginRight:i,marginBottom:s,marginLeft:l,paddingTop:c,paddingRight:u,paddingBottom:d,paddingLeft:p,width:g,height:v,backgroundColor:x,borderRadius:b,display:"flex",overflow:"visible !important"},oe=e=>{const t=e?D:O,r=e&&$||V;return{color:t,fontSize:P,fontWeight:E,fontFamily:j,textAlign:N,whiteSpace:T?"normal":"nowrap",border:L,borderRadius:B,backgroundColor:r,boxShadow:e?K.shadows[q]:void 0,paddingTop:h,paddingRight:f,paddingBottom:m,paddingLeft:y,"&:hover":{color:z||t,backgroundColor:H||r}}},ne=e=>{r?.({newTabKey:e.tabKey,link:e.link})},ae=e=>{if(!Y)return{};const t=e.id===X,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:e=>{e.stopPropagation(),Z?.(r,!1)},onDoubleClick:e=>{e.stopPropagation(),Z?.(r,!0)},"data-organism-id":e.id,css:trt({theme:K,selected:t})}},ie=e=>{const t=e.tabKey===o,r=oe(t);return nt(yx,{onClick:()=>{ne(e),te()},sx:{...r,display:"flex",alignItems:"center"},...ae(e),children:[e.iconName&&ot(EGe,{iconName:e.iconName,sx:{fontSize:P,color:t?D:O,mr:1}}),ot(Gf,{component:"span",children:e.label})]},e.id)};if(n)return nt(Qc,{elevation:w,style:re,sx:G,...U,children:[ot(id,{onClick:ee,children:ot(EGe,{size:F,color:I,iconName:R})}),ot(dx,{anchorEl:Q,open:Boolean(Q),onClose:te,children:t.map(ie)})]});const se=t.findIndex(e=>e.tabKey===o);return ot(Qc,{elevation:w,style:re,sx:G,...U,children:ot(Q_,{value:se<0?0:se,onChange:(e,r)=>Y?null:ne(t[r]),orientation:S,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:k}},TabIndicatorProps:{style:_?{height:M,borderRadius:b,backgroundColor:C||D}:{display:"none"}},children:t.map(e=>{const t=e.tabKey===o,r={...oe(t),"&.Mui-selected":{color:t?D:O}};return ot(Xk,{label:e.label,disableRipple:W,sx:{...r,textTransform:"none"},onClick:()=>ne(e),iconPosition:"right"===A?"end":"start",icon:e.iconName?ot(EGe,{iconName:e.iconName,sx:{fontSize:P,color:t?D:O}}):void 0,...ae(e)},e.id)})})})},_ht=e=>{if(!e)return null;if(e instanceof Date)return vot(e)?e:null;if("object"==typeof e&&null!==e&&"function"==typeof e.toDate){const t=e.toDate();return t instanceof Date&&vot(t)?t:null}if("string"==typeof e){const t=e.trim();if(!t)return null;const r=t.match(/(\d{1,2}:\d{2}(?::\d{2})?)/),o=r?r[1]:t,n=new Date,a=["HH:mm:ss","H:mm:ss","HH:mm","H:mm","hh:mm a","h:mm a","hh a","h a","HHmm","Hmm","HH","H"];for(const e of a){const t=Cnt(o,e,n);if(vot(t))return t}return null}return null},Cht=({name:t,text:r,isDisplayOnly:o=!1,sourceDataModelField:n,configurationItemInfo:a={},placeholderText:i,displayFormat:s="HH:mm",required:l=!1,requiredErrorText:c="This field is required",validationErrorText:u,sx:d,width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,...v})=>{const x=Ut(),b=x?.control,w=!!b&&!!t,{localStateObject:k}=IC(),{stateConfig:_}=WC(),C=dt(),M=k||_,S=n?M?.[n]?.value:void 0,D=_ht(S);e.useRef();const[O,P]=e.useState(D);if(o){const e=n?C?.getDmfValue(n):void 0,o=void 0!==e?e:w?x.watch(t):S,l=_ht(o),c=l&&vot(l)?Cot(l,s):"";return nt(Gf,{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiFormHelperText-root":{marginBottom:"4px"},"& .MuiTypography-root":{border:"1px solid #ced4da",borderRadius:"4px",padding:"8px",minWidth:"100px"},...d},children:[r&&ot(vg,{children:r}),ot(Sd,{children:c||i||"-"})]})}return ot(Gf,w?{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiTimePicker-root":{width:"100%"},"& .MuiTextField-root":{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g},"& .MuiInputBase-root":{fontSize:"14px"},"& .MuiInputLabel-root":{fontSize:"14px"},"& .MuiFormHelperText-root":{fontSize:"12px"},"& .MuiSvgIcon-root":{fontSize:"20px"},...d},children:ot(Jt,{name:t,control:b,defaultValue:D??null,rules:{required:!!l&&(c||"This field is required"),validate:e=>{if(null==e||""===e)return!0;const t=_ht(e);return t&&vot(t)||u||"Invalid time"}},render:({field:{onChange:e,value:t},fieldState:o})=>ot(Ydt,{...v,enableAccessibleFieldDOMStructure:!1,value:_ht(t),onChange:t=>{const r=_ht(t);e(r?Cot(r,"HH:mm"):null)},slots:{textField:oC},slotProps:{textField:{label:r,placeholder:i,error:!!o.error,helperText:o.error?.message,onMouseDown:e=>e.stopPropagation(),sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g}}}})})}:{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiTimePicker-root":{width:"100%"},"& .MuiTextField-root":{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g},"& .MuiInputBase-root":{fontSize:"14px"},"& .MuiInputLabel-root":{fontSize:"14px"},"& .MuiFormHelperText-root":{fontSize:"12px"},"& .MuiSvgIcon-root":{fontSize:"20px"},...d},children:ot(Ydt,{...v,enableAccessibleFieldDOMStructure:!1,value:O,onChange:e=>P(_ht(e)),slots:{textField:oC},slotProps:{textField:{label:r,placeholder:i,onMouseDown:e=>e.stopPropagation(),sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g}}}})})},Mht=({src:t,poster:r,controls:o=!1,loop:n=!1,autoplay:a=!1,raised:i=!1,alt:s="",height:l="100%",width:c="100%",borderRadius:u="0",margin:d=0,padding:p=0,moleculeId:h,enableCoverImage:f,configurationItemInfo:m,marginTop:y="0px",marginRight:g="0px",marginBottom:v="0px",marginLeft:x="0px",paddingTop:b="0px",paddingRight:w="0px",paddingBottom:k="0px",paddingLeft:_="0px",sx:C})=>{const[M,S]=e.useState(!1),{onStateChange:D}=KC(),O=()=>{D({id:h,type:"started"})};return ot(Sht,{id:h,raised:i,onClick:O,sx:{borderRadius:`${u}px`,margin:d,padding:p,marginTop:y,marginRight:g,marginBottom:v,marginLeft:x,paddingTop:b,paddingRight:w,paddingBottom:k,paddingLeft:_,"& .MuiCard-root":{display:"inline-block",overflow:"hidden"},"& .MuiCardMedia-root":{height:l,width:c,objectFit:"cover"},"& .MuiCardMedia-media":{height:"100%",width:"100%",objectFit:"cover"},...C},...m,children:M?ot(Sd,{component:"div",sx:{height:l,width:c,display:"flex",justifyContent:"center",alignItems:"center",fontSize:"16px",color:"gray",textAlign:"center"},children:s||"Video unavailable"}):ot(gm,{component:"video",src:t,poster:f?r:void 0,controls:o,loop:n,autoPlay:a,muted:a,"aria-label":s,sx:{height:l,width:c,objectFit:"cover","& .MuiCardMedia-media":{height:"100%",width:"100%",objectFit:"cover"}},onPlay:O,onEnded:()=>{D({id:h,type:"completed"})},onError:()=>{S(!0)}})})},Sht=Po(dm)`
1031
+ `,Gpt=e=>{if("menu_item"===e.type){const t=e;if(!t.sx)return!1;const r=e=>!!e&&(Array.isArray(e)?e.some(r):"function"!=typeof e&&("object"==typeof e&&("absolute"===e.position||"fixed"===e.position)));return r(t.sx)}return!1},Kpt=({currentWebpageId:t,anchor:r="left",variant:o="persistent",open:n=!1,onClose:a,items:i=[],withButton:s=!0,buttonText:l="",buttonVariant:c="contained",buttonTextColor:u,buttonFontSize:d,buttonFontWeight:p,buttonFontFamily:h,buttonDisabled:f=!1,buttonGap:m=0,buttonStartIcon:y,buttonEndIcon:g,buttonBorderRadius:v="0px",buttonPaddingTop:x="0px",buttonPaddingRight:b="0px",buttonPaddingBottom:w="0px",buttonPaddingLeft:k="0px",buttonMarginTop:_="0px",buttonMarginRight:C="0px",buttonMarginBottom:M="0px",buttonMarginLeft:S="0px",buttonIconOnly:D,buttonElevation:O,buttonFillColor:P,buttonFillColorDisabled:E,buttonFillColorHover:j,buttonFillColorPressed:T,buttonBorderColor:N,buttonBorderColorDisabled:R,buttonBorderColorHover:I,buttonBorderColorPressed:F,buttonTextColorDisabled:A,buttonTextColorHover:z,buttonTextColorPressed:L,buttonColor:B="#1976d2",buttonDisabledColor:V,withCloseIcon:$=!0,closeIconColor:H=no.colors.gray2,closeIconName:q="x",closeIconSize:W=18,closeIconBackgroundColor:U="rgba(255, 255, 255, 0.9)",closeIconVisible:G=!1,closeIconTop:K="16px",closeIconLeft:Y="16px",closeIconBorderRadius:Z="50%",closeIconElevation:X=2,moleculeId:Q,configurationItemInfo:J,sx:ee,contentSx:te,scrollable:re=!1,paddingTop:oe,paddingRight:ne,paddingBottom:ae,paddingLeft:ie,height:se,width:le,mobileWidth:ce,backgroundColor:ue="#fff",gap:de="8px",marginTop:pe="0px",marginRight:he="0px",marginBottom:fe="0px",marginLeft:me="0px"})=>{const ye=Ge(),{isConfigurationMode:ge,selectedConfigurationItemId:ve,onConfigurationItemClicked:xe,onInternalNavigation:be}=IC(),{updateDrawer:we,drawerContainerRef:ke,headerHeight:_e,isMobile:Ce}=DC(),[Me,Se]=e.useState(n),[De]=(()=>{try{return zpt()}catch{return[new URLSearchParams,()=>{}]}})(),Oe=e.useMemo(()=>{if(t)return t;const e=De.get(U7e),r=De.get(W7e);let o=null,n=null;if("undefined"!=typeof window)try{const e=new URLSearchParams(window.location.search);o=e.get(U7e),n=e.get(W7e)}catch(_Je){}return e||r||o||n||""},[t,De]);e.useEffect(()=>{Se(n)},[n]);const Pe=Boolean(ge&&(ve===Q||i.some(e=>e.id===ve))),Ee=()=>"permanent"===o||(ge?Pe:s?Me:n);e.useEffect(()=>{const e=Ee(),t="left"===r||"right"===r,n=Ce&&void 0!==ce?ce:le;let a=0;if(void 0!==n)if("number"==typeof n)a=n;else if("string"==typeof n){const e=parseFloat(n);Number.isNaN(e)||(a=e)}let i=0;if(t&&!Ce)switch(o){case"permanent":i=a;break;case"persistent":default:i=e?a:0;break;case"temporary":i=0}return we({isOpen:e,position:r,width:i}),()=>{we({isOpen:!1,width:0})}},[Me,n,Pe,ge,s,r,le,ce,Ce,o,we]);const je=()=>{"permanent"!==o&&Se(!0)},Te=(e,t)=>{"permanent"!==o&&(Se(!1),a?.(e,t))},Ne=e=>{const t=ve===e.id,r={entityId:e.id,entity:"molecule_item",entityType:e.type},o=ge?{onClick:e=>{e.stopPropagation(),xe?.(r,!1)},onDoubleClick:e=>{e.stopPropagation(),xe?.(r,!0)},"data-organism-id":e.id,css:trt({theme:ye,selected:t})}:{};switch(e.type){case"menu_item":{const t=e;e.id;const r=(e=>{const t=e?.link;if(!t||!t.internalLink)return!1;const r=i9e(t.internalLink);return!(!r||!Oe)&&r===Oe})(t),n={backgroundColor:t.backgroundColor||"transparent",paddingTop:t.paddingTop||"8px",paddingRight:t.paddingRight||"16px",paddingBottom:t.paddingBottom||"8px",paddingLeft:t.paddingLeft||"16px",opacity:t.disabled?.6:1,pointerEvents:t.disabled?"none":"auto","&:hover":{backgroundColor:t.disabled?t.backgroundColor||"transparent":"rgba(0, 0, 0, 0.08)"}},a=t.sx?[n,t.sx]:n;return nt(yx,{sx:a,selected:r,onClick:()=>{if(t?.link){e9e(t.link)?be?.({link:t.link?.internalLink||""}):Q7e(t.link?.externalLink)}},disabled:t.disabled,...o,children:[t.startIcon&&ot(EGe,{iconName:t.startIcon,color:t.textColor}),ot(Sd,{sx:{ml:t.startIcon?1:0,mr:t.endIcon?1:0,color:t.textColor||"inherit",fontSize:t.fontSize||"inherit",fontWeight:t.fontWeight||"normal",fontFamily:t.fontFamily||"inherit",whiteSpace:t.wrap?"normal":"nowrap",width:"100%",textAlign:t.textAlign||"left"},children:t.text}),t.endIcon&&ot(EGe,{iconName:t.endIcon,color:t.textColor})]},t.id)}case"divider_item":{const t=e;return ot(dpt,{moleculeId:t.id,variant:t.variant,lineWeight:t.lineWeight,orientation:t.orientation,borderColor:t.borderColor,borderRadius:t.borderRadius,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft,configurationItemInfo:o},t.id)}case"text_item":{const t=e;return ot(mpt,{id:t.id,text:t.text,align:t.align,color:t.color,wrap:t.wrap,variant:"string"==typeof t.variant&&["inherit","body1","body2","caption","button","overline","subtitle1","subtitle2","h1","h2","h3","h4","h5","h6"].includes(t.variant)?t.variant:void 0,fontSize:t.fontSize??"",fontWeight:["normal","bold"].includes(t.fontWeight)?t.fontWeight:void 0,fontFamily:t.fontFamily??"",marginTop:t.marginTop||"",marginRight:t.marginRight||"",marginBottom:t.marginBottom||"",marginLeft:t.marginLeft||"",paddingTop:t.paddingTop||"",paddingRight:t.paddingRight||"",paddingBottom:t.paddingBottom||"",paddingLeft:t.paddingLeft||"",configurationsItemInfo:o},t.id)}case"rich_text_item":{const t=e;return ot(fpt,{htmlElementId:t.id,text:t.text,isRichText:!0,marginTop:t.marginTop||"",marginRight:t.marginRight||"",marginBottom:t.marginBottom||"",marginLeft:t.marginLeft||"",paddingTop:t.paddingTop||"",paddingRight:t.paddingRight||"",paddingBottom:t.paddingBottom||"",paddingLeft:t.paddingLeft||"",configurationItemInfo:o},t.id)}case"image_item":{const t=e;return ot(ppt,{src:t.src,alt:t.alt||"Drawer image",height:t.height,width:t.width,raised:t.raised,borderRadius:t.borderRadius||"0",marginTop:t.marginTop||"0",marginRight:t.marginRight||"0",marginBottom:t.marginBottom||"0",marginLeft:t.marginLeft||"0",paddingTop:t.paddingTop||"0",paddingRight:t.paddingRight||"0",paddingBottom:t.paddingBottom||"0",paddingLeft:t.paddingLeft||"0",onClick:()=>{if(t?.link){e9e(t.link)?be?.({link:t.link?.internalLink||""}):Q7e(t.link?.externalLink)}},moleculeId:t.id,configurationItemInfo:o},t.id)}default:return null}},Re=Ce&&void 0!==ce?ce:le,Ie=ot(Vpt,{anchor:r,variant:o,open:Ee(),onClose:Te,paddingTop:oe,paddingRight:ne,paddingBottom:ae,paddingLeft:ie,height:se,width:Re,backgroundColor:ue,marginTop:`calc(${_e} + ${pe})`,marginRight:he,marginBottom:fe,marginLeft:me,container:ke,sx:ee,children:nt(qpt,{scrollable:re,sx:te,...J&&Object.keys(J).length?{...J,"data-testid":"drawer-content-config","aria-label":"drawer-content"}:{},children:[(Ee()||"permanent"===o)&&i.length>0?nt(rt,{children:[ot(Upt,{gap:de,scrollable:re,children:i.filter(e=>!Gpt(e)).map(Ne)}),i.filter(e=>Gpt(e)).map(Ne)]}):null,!!$&&(!!G||Ee())&&ot(Wpt,{top:K,left:Y,borderRadius:Z,elevation:X,backgroundColor:U,onClick:e=>{e.stopPropagation();Ee()?Te(e,"closeIconClicked"):je()},"data-testid":"close-icon",children:ot(EGe,{"data-testid":"icon-renderer",iconName:q,size:W,color:H})})]})});return s&&"permanent"!==o?nt(rt,{children:[ot(eKe,{moleculeId:Q,gap:m,text:l,variant:c,textColor:u,fontSize:d,fontWeight:["normal","bold"].includes(p)?p:void 0,fontFamily:h,disabled:f,startIcon:y,endIcon:g,marginTop:_,marginRight:C,marginBottom:M,marginLeft:S,paddingTop:x,paddingRight:b,paddingBottom:w,paddingLeft:k,borderRadius:v,iconOnly:D,elevation:O,fillColor:P||B,fillColorDisabled:E||V,fillColorHover:j,fillColorPressed:T,borderColor:N,borderColorDisabled:R,borderColorHover:I,borderColorPressed:F,textColorDisabled:A,textColorHover:z,textColorPressed:L,externalOnClick:e=>Me?Te(e,"buttonClicked"):je(),configurationItemInfo:J}),ot(Hpt,{children:Ie})]}):ot(Hpt,{children:Ie})},Ypt=e.forwardRef((e,t)=>{const{inputRef:r,...o}=e;return ot(GKe,{...o,ref:e=>{"function"==typeof r&&r(e?e.inputElement:null)},mask:aYe,guide:!0,placeholderChar:" "})}),Zpt=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0},Xpt=({masked:e,errorMsg:t,inputSx:r,labelSx:o,sx:n,variant:a="outlined",...i})=>{const s=e?{inputComponent:Ypt}:{};return ot(oC,{...i,variant:a,error:!!t,helperText:t||null,type:"text",sx:{...n},slotProps:{input:{sx:{...r,...n},...s},inputLabel:{sx:{...o,...n}}}})},Qpt=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="Email is required",validationErrorText:n="Invalid email address",text:a,placeholderText:i,masked:s=!1,multiLine:l=!1,backgroundColor:c,borderColor:u,color:d="inherit",fontSize:p="16px",fontFamily:h="inherit",fontWeight:f="normal",textAlign:m="left",marginLeft:y="0",marginTop:g="0",marginRight:v="0",marginBottom:x="0",paddingLeft:b="0",paddingTop:w="0",paddingRight:k="0",paddingBottom:_="0",width:C,height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P,sx:E,name:j,sourceDataModelField:T,configurationItemInfo:N,inputSize:R="medium",labelOffset:I,hideLabel:F=!1,variant:A="outlined"})=>{const z=Ut(),L=z?.control,B=!(!L||!j),{localStateObject:V}=IC(),{stateConfig:$}=WC(),H=dt(),q=V||$,W=T?q?.[T]?.value:void 0,U=T?H?.getDmfValue(T):void 0;e.useState("");const[G,K]=e.useState(""),Y={required:!!r&&o,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:n}},Z=e.useMemo(()=>{if(F)return;if(void 0!==I)return I;const e=Zpt(w),t=Zpt(_);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=Zpt(M)||Zpt(S)||Zpt(D);if(!o&&!e&&!t)return;const n="number"==typeof p?1.5*p:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[M,S,D,I,R,p,w,_,F]),X=e.useMemo(()=>{if(F)return;const e="small"===R?-6:-9,t=Zpt(M)||Zpt(S)||Zpt(D);return!t||t>=36?e:-6},[M,S,D,R,F]);if(t){let e="";e=void 0!==U?String(U??""):B?z.watch(j)||"":W||"";const t=e||i||"-";return nt("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...N,children:[a&&ot(vg,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,marginLeft:0,marginBottom:"4px",...E},children:a}),ot(Sd,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_,backgroundColor:c,border:`1px solid ${u||"#ccc"}`,borderRadius:"4px",minWidth:"120px",textAlign:m,...E},children:t})]})}const Q={backgroundColor:c,color:d,fontSize:p,fontFamily:h,fontWeight:f,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},"& .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-input":{textAlign:m,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_}},J={color:d,"&.Mui-focused":{color:d},...F&&{display:"none"},...void 0!==Z&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${Z}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${X}px) scale(0.75)`}}},ee=l?3:1,te={...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}};return ot("div",B?{style:{marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},sx:{"& .MuiTextField-root":{width:C||"100%",height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...E},children:ot(Jt,{name:j,rules:Y,control:L,defaultValue:"",render:({field:e,fieldState:t})=>ot(Xpt,{masked:s,required:r,errorMsg:t.error?.message,inputSx:Q,labelSx:J,sx:{...te,...E},size:R,variant:A,label:F?void 0:a,placeholder:i,multiline:l,minRows:ee,value:e.value||"",onChange:e.onChange,...N||{}})})}:{style:{marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},sx:{"& .MuiTextField-root":{width:C||"100%",height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...E},children:ot(Xpt,{masked:s,required:r,errorMsg:void 0,inputSx:Q,labelSx:J,sx:{...te,...E},size:R,variant:A,label:F?void 0:a,placeholder:i,multiline:l,minRows:ee,value:G,onChange:e=>K(e.target.value),...N||{}})})},Jpt=({src:t,text:r,type:o,link:n,sourceDataModelField:a,color:i=no.colors.deepBlue,disabled:s=!1,disabledColor:l,underline:c="hover",variant:u="body2",margin:d="0",padding:p="0",moleculeId:h,configurationItemInfo:f,marginTop:m="0",marginRight:y="0",marginBottom:g="0",marginLeft:v="0",paddingTop:x="0",paddingRight:b="0",paddingBottom:w="0",paddingLeft:k="0",fontFamily:_,fontWeight:C,fontSize:M,align:S,target:D,sx:O,borderColor:P,borderWidth:E,borderStyle:j,borderRadius:T,iconOnly:N,ariaLabel:R,iconName:I,iconSize:F,validationErrorText:A})=>{const{onStateChange:z}=KC(),{onInternalNavigation:L,isConfigurationMode:B,localStateObject:V}=IC();WC();const $=dt(),H=n&&t9e(n),q=e.useMemo(()=>H?r9e(n,$?.rawItemDataByDmfId):null,[n,H,$?.rawItemDataByDmfId]),W=H&&!q,U=e.useMemo(()=>{if(q)return q.destination;const e=n?e9e(n):"internalLink"===o||"internal_link"===o,r=n?e?n.internalLink:n.externalLink:void 0;return t??r??void 0},[q,n,o,t]),G=e.useMemo(()=>q?!q.isExternal:!!n&&e9e(n),[q,n]),K=e.useMemo(()=>D||(q?q.isExternal?"_blank":"_self":G?"_self":"_blank"),[D,q,G]),Y=s||W,Z=Y?l||to(i):i,X=B||Y?void 0:U,Q=Boolean(I),J="regular"===C?"normal":C,ee=N?ot(EGe,{iconName:I||"external-link",size:F??16}):nt(rt,{children:[ot("span",{children:r}),Q&&ot(EGe,{iconName:I,size:F??16})]}),{onClick:te,onDoubleClick:re,...oe}=f||{},ne=ot(pv,{href:X,component:"a",target:K,onClick:e=>{z({id:h,type:"clicked"});if(!s&&!W&&!B)return q?(e.preventDefault(),void(q.isExternal?Q7e(q.destination):L?.({link:q.destination,webpageAlias:q.webpageAlias,query:q.recordId?{rwoRecordId:q.recordId}:void 0}))):G&&U?(e.preventDefault(),void L?.({link:U})):void(!G&&U&&(e.preventDefault(),Q7e(U)));e.preventDefault()},onClickCapture:te||void 0,onDoubleClickCapture:re||void 0,"aria-label":N?R||r||"link":void 0,sx:{color:Z,textDecorationColor:Z,margin:d,padding:p,marginTop:m,marginRight:y,marginBottom:g,marginLeft:v,paddingTop:x,paddingRight:b,paddingBottom:w,paddingLeft:k,fontFamily:_,fontWeight:J,fontSize:M,textAlign:S,alignItems:"center",cursor:Y?"not-allowed":"pointer",borderColor:P,borderWidth:E,borderStyle:j,borderRadius:T,display:N||Q?"inline-flex":void 0,gap:Q&&!N?"4px":void 0,"& .MuiLink-root":{color:"inherit",textDecorationColor:"inherit"},"&:hover":{color:Y?Z:to(Z,.8),textDecorationColor:Y?Z:to(Z,.8)},"&:active":{color:Y?Z:to(Z,.6),textDecorationColor:Y?Z:to(Z,.6)},"&.Mui-disabled":{color:l||to(i),textDecorationColor:l||to(i),cursor:"not-allowed"},...O},align:S,variant:u,underline:c,...oe,children:ee});return ne},eht=e=>({justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}),tht=({popover:t=!0,items:r,marginTop:o="0",marginRight:n="0",marginBottom:a="0",marginLeft:i="0",paddingTop:s="0",paddingRight:l="0",paddingBottom:c="0",paddingLeft:u="0",cornerRadius:d="4px",backgroundColor:p="#fff",width:h="100%",height:f="auto",borderColor:m="#ccc",borderWeight:y="1px",buttonText:g="Open Menu",buttonVariant:v="contained",buttonTextColor:x,buttonFontSize:b,buttonFontWeight:w,buttonFontFamily:k,buttonDisabled:_=!1,buttonGap:C=0,buttonStartIcon:M,buttonEndIcon:S,buttonCornerRadius:D="0",buttonMarginTop:O="0",buttonMarginRight:P="0",buttonMarginBottom:E="0",buttonMarginLeft:j="0",buttonPaddingTop:T="0",buttonPaddingRight:N="0",buttonPaddingBottom:R="0",buttonPaddingLeft:I="0",buttonIconOnly:F,buttonElevation:A,buttonFillColor:z,buttonFillColorDisabled:L,buttonFillColorHover:B,buttonFillColorPressed:V,buttonBorderColor:$,buttonBorderColorDisabled:H,buttonBorderColorHover:q,buttonBorderColorPressed:W,buttonTextColorDisabled:U,buttonTextColorHover:G,buttonTextColorPressed:K,buttonColor:Y="#1976d2",anchorOriginVertical:Z="bottom",anchorOriginHorizontal:X="left",transformOriginVertical:Q="top",transformOriginHorizontal:J="left",elevation:ee=3,sx:te,moleculeId:re,configurationItemInfo:oe})=>{const ne=Ge(),{isConfigurationMode:ae,selectedConfigurationItemId:ie,onConfigurationItemClicked:se,onInternalNavigation:le}=IC(),ce=dt?.(),[ue,de]=e.useState(null),[pe,he]=e.useState(!1),[fe]=(()=>{try{return zpt()}catch{return[new URLSearchParams,()=>{}]}})(),me=e.useMemo(()=>{const e=fe.get(U7e),t=fe.get(W7e);let r=null,o=null;if("undefined"!=typeof window)try{const e=new URLSearchParams(window.location.search);r=e.get(U7e),o=e.get(W7e)}catch(_Je){}return e||t||r||o||""},[fe]),ye=e=>{const t=e?.link;if(!t||!t.internalLink)return!1;const r=i9e(t.internalLink);return!(!r||!me)&&r===me},ge=Boolean(ae&&(ie===re||r.some(e=>e.id===ie))),ve=()=>he(!0),xe=()=>he(!1),be={marginTop:o,marginRight:n,marginBottom:a,marginLeft:i,paddingTop:s,paddingRight:l,paddingBottom:c,paddingLeft:u,"& .MuiMenu-paper":{backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3]},"& .MuiMenu-list":{padding:0,width:h,height:f,overflow:"hidden"},"& .MuiMenuItem-root":{minHeight:"auto",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px"},"& .MuiListItemButton-root":{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px"},"& .MuiListItemText-primary":{fontSize:"14px",fontFamily:"inherit"},"& .MuiTypography-root":{fontSize:"14px",fontFamily:"inherit"},...t?{display:"inline-block",zIndex:ne?.zIndex?.drawer}:{width:h,height:f,backgroundColor:p,display:"block",overflow:"hidden",border:`${y} solid ${m}`,borderRadius:d},...te};return t?nt(Gf,{children:[ot(eKe,{ref:de,text:g,variant:v,moleculeId:re,textColor:x,fontSize:b,fontWeight:w,fontFamily:k,disabled:_,gap:C,startIcon:M,endIcon:S,onClick:ve,marginTop:O,marginRight:P,marginBottom:E,marginLeft:j,paddingTop:T,paddingRight:N,paddingBottom:R,paddingLeft:I,borderRadius:D,iconOnly:F,elevation:A,fillColor:z||Y,fillColorDisabled:L,fillColorHover:B,fillColorPressed:V,borderColor:$,borderColorDisabled:H,borderColorHover:q,borderColorPressed:W,textColorDisabled:U,textColorHover:G,textColorPressed:K,configurationItemInfo:oe}),ot(dx,{open:ae?ge:pe,variant:"menu",anchorEl:ue,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:xe,anchorOrigin:{vertical:Z,horizontal:X},transformOrigin:{vertical:Q,horizontal:J},elevation:ee,slotProps:{paper:{sx:{backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3],"& .MuiMenu-list":be["& .MuiMenu-list"],"& .MuiMenuItem-root":be["& .MuiMenuItem-root"],"& .MuiListItemText-primary":be["& .MuiListItemText-primary"],"& .MuiTypography-root":be["& .MuiTypography-root"]}}},sx:{...be,"& .MuiMenu-paper":be["& .MuiMenu-paper"]},children:r.map(e=>{const t=ie===e.id,r=ye(e),o=e.link&&t9e(e.link)?r9e(e.link,ce?.rawItemDataByDmfId):null,n=e.link&&t9e(e.link)&&!o,a={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},i=ae?e=>{e.stopPropagation(),se?.(a,!1)}:void 0,s=ae?e=>{e.stopPropagation(),se?.(a,!0)}:void 0,l=ae?{onClick:i,onDoubleClick:s,"data-organism-id":e.id,css:trt({theme:ne,selected:t})}:{};return nt(yx,{sx:eht(e),selected:r,disabled:e.disabled||n,onClick:()=>{e?.link&&(o?o.isExternal?Q7e(o.destination):le?.({link:o.destination,webpageAlias:o.webpageAlias,query:o.recordId?{rwoRecordId:o.recordId}:void 0}):e9e(e.link)?le?.({link:e.link?.internalLink||""}):Q7e(e.link?.externalLink)),xe()},...l,children:[e.startIcon&&ot(EGe,{iconName:e.startIcon,color:e.textColor}),ot(Sd,{sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"},children:e.text}),e.endIcon&&ot(EGe,{iconName:e.endIcon,color:e.textColor})]},e.id)})})]}):ot(Qc,{id:re,sx:{...be,backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3]},elevation:ee,...oe,children:ot(vv,{disablePadding:!0,children:r.map(e=>{const t=ie===e.id,r=ye(e),o=e.link&&t9e(e.link)?r9e(e.link,ce?.rawItemDataByDmfId):null,n=e.link&&t9e(e.link)&&!o,a={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},i=ae?e=>{e.stopPropagation(),se?.(a,!1)}:void 0,s=ae?e=>{e.stopPropagation(),se?.(a,!0)}:void 0,l=ae?{onClick:i,onDoubleClick:s,"data-organism-id":e.id,css:trt({theme:ne,selected:t})}:{};return nt(Cv,{disabled:e.disabled||n,sx:eht(e),selected:r,onClick:()=>{e?.link&&(o?o.isExternal?Q7e(o.destination):le?.({link:o.destination,webpageAlias:o.webpageAlias,query:o.recordId?{rwoRecordId:o.recordId}:void 0}):e9e(e.link)?le?.({link:e.link?.internalLink||""}):Q7e(e.link?.externalLink))},...l,children:[e.startIcon&&ot(EGe,{iconName:e.startIcon,color:e.textColor}),ot($v,{primary:ot(Sd,{sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"},children:e.text})}),e.endIcon&&ot(EGe,{iconName:e.endIcon,color:e.textColor})]},e.id)})})})},rht=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0};const oht=({errorMsg:e,stepValue:t,minValue:r,allowNegative:o,inputSx:n,labelSx:a,variant:i="outlined",...s})=>ot(oC,{...s,variant:i,type:"number",error:!!e,helperText:e||null,inputProps:{step:t,min:o?void 0:r},slotProps:{input:{sx:n},inputLabel:{sx:a}}}),nht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="This field is required",validationErrorText:n="Invalid numeric value",text:a,placeholderText:i,backgroundColor:s,borderColor:l,textColor:c="#000",fontSize:u,fontFamily:d,fontWeight:p,allowNegative:h=!1,numericPrecision:f="1",name:m,sourceDataModelField:y,marginLeft:g="0",marginTop:v="0",marginRight:x="0",marginBottom:b="0",paddingLeft:w="0",paddingTop:k="0",paddingRight:_="0",paddingBottom:C="0",width:M,height:S,configurationItemInfo:D,textAlign:O,minHeight:P,maxHeight:E,minWidth:j,maxWidth:T,sx:N,inputSize:R="medium",labelOffset:I,hideLabel:F=!1,variant:A="outlined"})=>{const z=Ut(),L=z?.control,B=!(!L||!m),{localStateObject:V}=IC(),{stateConfig:$}=WC(),H=dt(),q=V||$,W=y?q?.[y]?.value:void 0,U=y?H?.getDmfValue(y):void 0,[G,K]=e.useState(""),Y=parseFloat(f),Z=h?void 0:0,X={required:!!r&&o,pattern:{value:h?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:n}};h||(X.min={value:0,message:"Value cannot be less than zero"});const Q=e.useMemo(()=>{if(F)return;if(void 0!==I)return I;const e=rht(k),t=rht(C);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=rht(S)||rht(P)||rht(E);if(!o&&!e&&!t)return;const n="number"==typeof u?1.5*u:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[S,P,E,I,R,u,k,C,F]),J=e.useMemo(()=>{if(F)return;const e="small"===R?-6:-9,t=rht(S)||rht(P)||rht(E);return!t||t>=36?e:-6},[S,P,E,R,F]);if(t){let e="";e=void 0!==U?String(U??""):B?z.watch(m)||"":W;const t=e?function(e,t,r){if(!e)return"";const o=parseFloat(e);if(Number.isNaN(o))return e;if(!r&&o<0)return"0";if(t){const e=(t.split(".")[1]||"").length;if(e>0)return o.toFixed(e)}return e}(e,f,h):i||"-";return nt("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E}},sx:N,...D,children:[a&&ot(vg,{sx:{fontSize:u,fontFamily:d,fontWeight:p,color:c,marginBottom:"4px"},children:a}),ot(Sd,{sx:{fontSize:u,fontFamily:d,fontWeight:p,color:c,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,backgroundColor:s,border:`1px solid ${l||"#ccc"}`,borderRadius:"4px",minWidth:"60px"},children:t})]})}const ee={backgroundColor:s,color:c,fontSize:u,fontFamily:d,fontWeight:p,...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},"& .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"}},te={color:c,"&.Mui-focused":{color:c},...F&&{display:"none"},...void 0!==Q&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${Q}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${J}px) scale(0.75)`}}},re={...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E}};return ot(rg,B?{required:r,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,width:"fit-content",...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},...N},...D,children:ot(Jt,{name:m,rules:X,control:L,defaultValue:"",render:({field:e,fieldState:t})=>ot(oht,{errorMsg:t.error?.message,label:F?void 0:a,placeholder:i,stepValue:Y,minValue:Z,allowNegative:h,inputSx:ee,labelSx:te,sx:re,size:R,variant:A,value:e.value||"",onChange:t=>e.onChange(t.target.value)})})}:{required:r,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,width:"fit-content",...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},...N},...D,children:ot(oht,{errorMsg:void 0,label:F?void 0:a,placeholder:i,stepValue:Y,minValue:Z,allowNegative:h,inputSx:ee,labelSx:te,sx:re,size:R,variant:A,value:G,onChange:e=>K(e.target.value)})})},aht=e=>{const t={text:e.label,validate:()=>!0},{rule:r}=e,o=iht(r);if(o||sht(r)){const e=((e,t)=>(r=0)=>e?r<=t:r>=t)(o,o?r.MAX:r.MIN);switch(r.type){case"COUNT":t.validate=t=>e(t?.length);break;case"NUMBER_COUNT":t.validate=t=>e(t?.replace(/\D/g,"").length);break;case"CAPITAL_COUNT":t.validate=t=>e((t?.match(/[A-Z]/g)||[]).length);break;case"SPECIAL_CHARACTERS_COUNT":t.validate=t=>e(t?.replace(/[a-z]|\d|\s/gi,"").length);break;case"LOWER_CASE_COUNT":t.validate=t=>e((t?.match(/[a-z]/g)||[]).length)}}return t},iht=e=>!!e?.MAX,sht=e=>!!e?.MIN,lht=({gap:t="0",inputProps:r,validations:o,htmlElementId:n,validationState:a,overridesProperties:i,configurationItemInfo:s,width:l,height:c,minWidth:u,maxWidth:d,minHeight:p,maxHeight:h,marginLeft:f="0",marginTop:m="0",marginRight:y="0",marginBottom:g="0",sx:v,...x})=>{const{watch:b,formState:w,setError:k}=Ut()||{},{text:_,subText:C,placeholderText:M,subPlaceholderText:S,validationText:D}=i,O=o.map(aht),P="password",E=`reEnter${P}`,j=b?.(P),T=b?.(E);return e.useEffect(()=>{j!==T&&k(E,{type:"manual",message:"Passwords do not match"})},[j,T,k,E]),nt(Gf,{id:n,sx:{width:"100%",display:"flex",flexDirection:"column",gap:t,marginLeft:f,marginTop:m,marginRight:y,marginBottom:g,...l&&{width:l},...c&&{height:c},...u&&{minWidth:u},...d&&{maxWidth:d},...p&&{minHeight:p},...h&&{maxHeight:h},...v},...s,...x,children:[ot(crt,{...r,inputType:"password",text:_?.text,name:P,placeholderText:M?.text}),ot(crt,{...r,inputType:"password",text:C?.text,name:E,placeholderText:S?.text}),ot(LKe,{rules:O,value:j,label:D?.text,isSubmitted:w?.isDirty,validationState:a})]})},cht=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],uht=e.forwardRef((e,t)=>{const{inputRef:r,...o}=e;return ot(GKe,{...o,ref:e=>{"function"==typeof r&&r(e?e.inputElement:null)},mask:cht,guide:!0,placeholderChar:" "})}),dht=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0};function pht(e){const t=(e??"").replace(/\D+/g,"");if(!t)return"";let r="",o=0;return tYe.forEach(e=>{"string"==typeof e?r+=e:o<t.length?(r+=t[o],o+=1):r+="_"}),r}const hht=({masked:e,errorMsg:t,inputSx:r,labelSx:o,variant:n="outlined",...a})=>ot(oC,{...a,variant:n,error:!!t,helperText:t||null,slotProps:{input:{sx:r,...e?{inputComponent:uht}:{}},inputLabel:{sx:o}}}),fht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="Phone is required",validationErrorText:n="Invalid phone number",text:a,placeholderText:i,masked:s=!0,multiLine:l=!1,backgroundColor:c,borderColor:u,textColor:d="#000",fontSize:p,fontFamily:h,fontWeight:f,textAlign:m,marginLeft:y="0",marginTop:g="0",marginRight:v="0",marginBottom:x="0",paddingLeft:b="0",paddingTop:w="0",paddingRight:k="0",paddingBottom:_="0",width:C,height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P,name:E,sourceDataModelField:j,configurationItemInfo:T,sx:N,inputSize:R="medium",labelOffset:I,hideLabel:F=!1,variant:A="outlined"})=>{const z=Ut(),L=z?.control,B=!(!L||!E),{localStateObject:V}=IC(),{stateConfig:$}=WC(),H=dt(),q=V||$,W=j?q?.[j]?.value:void 0,U=j?H?.getDmfValue(j):void 0,[G,K]=e.useState(""),Y={required:!!r&&o,pattern:{value:/^\d{10}$/,message:n}},Z=e.useMemo(()=>{if(F)return;if(void 0!==I)return I;const e=dht(w),t=dht(_);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=dht(M)||dht(S)||dht(D);if(!o&&!e&&!t)return;const n="number"==typeof p?1.5*p:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[M,S,D,I,R,p,w,_,F]),X=e.useMemo(()=>{if(F)return;const e="small"===R?-6:-9,t=dht(M)||dht(S)||dht(D);return!t||t>=36?e:-6},[M,S,D,R,F]);if(t){let e="";e=void 0!==U?String(U??""):B?z.watch(E)||"":String(W??"");const t=(s?pht(e):e)||i||"-";return nt("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}},...T,children:[a&&ot(vg,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,marginLeft:0,marginBottom:"4px",...N},children:a}),ot(Sd,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_,backgroundColor:c,border:`1px solid ${u||"#ccc"}`,borderRadius:"4px",minWidth:"120px",...N},children:t})]})}const Q={backgroundColor:c,color:d,fontSize:p,fontFamily:h,fontWeight:f,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},"& .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"}},J={color:d,"&.Mui-focused":{color:d},...F&&{display:"none"},...void 0!==Z&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${Z}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${X}px) scale(0.75)`}}},ee={marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,width:"fit-content",...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}};return ot(rg,B?{required:r,sx:{...ee,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},...N},...T,children:ot(Jt,{name:E,rules:Y,control:L,defaultValue:"",render:({field:e,fieldState:t})=>ot(hht,{masked:s,errorMsg:t.error?.message,inputSx:Q,labelSx:J,size:R,variant:A,label:F?void 0:a,placeholder:i,value:e.value||"",onChange:t=>{const r=(t?.target?.value??"").toString().replace(/\D+/g,"");e.onChange(r)}})})}:{required:r,sx:{...ee,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},...N},...T,children:ot(hht,{masked:s,errorMsg:void 0,inputSx:Q,labelSx:J,size:R,variant:A,label:F?void 0:a,placeholder:i,value:G,onChange:e=>{const t=(e?.target?.value??"").toString();K(t.replace(/\D+/g,""))}})})},mht=({text:t,name:r,isDisplayOnly:o=!1,required:n=!1,requiredErrorText:a="This field is required",validationErrorText:i="Invalid rating",placeholderText:s="",hoverFeedback:l=!1,sourceDataModelField:c,textAlign:u="left",color:d="black",textColor:p,selectColor:h,fontSize:f=14,fontFamily:m="Arial, sans-serif",fontWeight:y="normal",marginLeft:g="0",marginTop:v="0",marginRight:x="0",marginBottom:b="0",paddingLeft:w="0",paddingTop:k="0",paddingRight:_="0",paddingBottom:C="0",width:M,height:S,minHeight:D,maxHeight:O,minWidth:P,maxWidth:E,placement:j="right",configurationItemInfo:T={},disabled:N=!1,maxValue:R=5,ratingPrecision:I=.5,sx:F,...A})=>{const z=Ut(),L=z?.control,B=!!z&&!!L&&!!r,{localStateObject:V}=IC(),{stateConfig:$}=WC(),H=dt(),q=V||$,W=c?q?.[c]?.value:void 0;!B||z.formState.errors;const[U,G]=e.useState(null),[K,Y]=e.useState(-1),Z=l&&-1!==K;if(o){const e=c?H?.getDmfValue(c):void 0;let r=null;const o=e=>"number"!=typeof e||Number.isNaN(e)?"string"!=typeof e||Number.isNaN(Number(e))?null:Number(e):e;if(void 0!==e)r=o(e);else if(c&&q?.[c]){const e=q?.[c]?.value;r=o(e)}return nt(rg,{required:n,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,display:"inline-flex",...M&&{width:M},...S&&{height:S},...D&&{minHeight:D},...O&&{maxHeight:O},...P&&{minWidth:P},...E&&{maxWidth:E},...F},...T,children:[t&&ot(Sd,{variant:"subtitle1",sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,marginBottom:"4px"},children:t}),ot(yb,{value:r,max:R,precision:I,readOnly:!0,sx:{"& .MuiRating-iconEmpty":{color:d},"& .MuiRating-iconFilled":{color:h||d},...F},...A})]})}const X={required:!!n&&a,validate:e=>!n||null!==e&&0!==e||a};return nt(rg,{required:n,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,display:"inline-flex",...M&&{width:M},...S&&{height:S},...D&&{minHeight:D},...O&&{maxHeight:O},...P&&{minWidth:P},...E&&{maxWidth:E},...F},...T,children:[t&&ot(Sd,{variant:"subtitle1",sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,marginBottom:"4px"},children:t}),nt(Gf,{sx:{display:"flex",alignItems:"center"},children:["left"===j&&ot(Sd,{sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,minWidth:"2em"},children:Z?K:B?z.getValues(r)??W??"":U??W??""}),ot(Jt,{name:r,control:L,defaultValue:"number"==typeof W?W:null,rules:X,render:({field:e,fieldState:{error:t}})=>nt(rt,{children:[ot(yb,{value:e.value??W??0,max:R,precision:I,disabled:N,onChange:(t,r)=>e.onChange(r),onChangeActive:l?(e,t)=>Y(t??-1):void 0,sx:{"& .MuiRating-iconEmpty":{color:d},"& .MuiRating-iconFilled":{color:h||d},marginX:l?1:0,...F},...A}),t&&ot(vg,{error:!0,sx:{marginTop:"4px"},children:"required"===t.type?a:i})]})}),"right"===j&&ot(Sd,{sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,minWidth:"2em"},children:Z?K:B?z.getValues(r)??W??"":U??W??""})]})]})},yht=({open:t,text:o,disabled:n,sx:a,placeholderText:i,required:s=!1,requiredErrorText:l="This field is required",validationErrorText:c="Invalid format",isDisplayOnly:u=!1,displayText:d,visible:p=!0,fontSize:h,fontFamily:f,fontWeight:m,textColor:y,textAlign:g,borderColor:v,color:x,backgroundColor:b,marginLeft:w="0",marginTop:k="0",marginRight:_="0",marginBottom:C="0",paddingLeft:M,paddingTop:S,paddingRight:D,paddingBottom:O,width:P,height:E,minHeight:j,maxHeight:T,minWidth:N,maxWidth:R,configurationItemInfo:I={},name:F,sourceDataModelField:A,predefinedValue:z,hideWhenNoValue:L=!1,inputSize:B="medium",hideLabel:V=!1,variant:$="outlined",native:H=!1,options:q,publishToWebpageContext:W=!1,webpageContextKey:U})=>{const G="regular"===m?"normal":m,K=e=>""!==e&&null!=e,Y=u?void 0:A,{dataModelFieldOptions:Z,isLoading:X}=(e=>{const{pickList:t}=ct(),{data:o=[],refetch:n,isLoading:a}=r.useQuery({queryKey:[TGe,e],queryFn:()=>t.get(e),select:e=>{const t=e?.data;return Array.isArray(t)?t:t&&Array.isArray(t.data)?t.data:[]},enabled:Boolean(e),refetchOnWindowFocus:!0,refetchOnMount:!0});return{dataModelFieldOptions:o,refetch:n,isLoading:a}})(Y),Q=q&&q.length>0?q:Z,J=e.useMemo(()=>(Q||[]).map(e=>"string"==typeof e?{id:e,value:e}:e),[Q]),ee=Ut(),te=!!ee?.control&&!!F,[re,oe]=e.useState(""),[ne,ae]=e.useState(!1),{localStateObject:ie,setLocalStateValue:se,isConfigurationMode:le,selectedConfigurationItemId:ce}=IC(),{stateConfig:ue}=WC(),de=dt(),pe=GC(),he=ie||ue,fe=A?he?.[A]:void 0,me=fe?.value||("string"==typeof fe||"number"==typeof fe?fe:void 0),ye=A?de?.getDmfValue(A):void 0,ge="string"==typeof ye||"number"==typeof ye?ye:ye&&"object"==typeof ye?ye.value??ye.label??ye.id:void 0,ve=null!=z&&""!==z,xe=Boolean(n)||ve;e.useEffect(()=>{ve&&null!=z&&(te?ee?.setValue(F,z):oe(z))},[ve,z,te,ee,F]);const be=ge??me;if(e.useEffect(()=>{W&&U&&pe?.setDynamicContextValue&&void 0!==be&&pe.setDynamicContextValue(U,be)},[W,U,be,pe]),!p)return null;if(u&&L&&!(ge??me))return null;if(u){const e=d??(null!=ge?String(ge):void 0)??(null!=me?String(me):void 0)??(i||"-");return nt("div",{style:{display:"inline-flex",flexDirection:"column",...K(k)&&{marginTop:k},...K(_)&&{marginRight:_},...K(C)&&{marginBottom:C},...K(w)&&{marginLeft:w},...K(P)?{width:P}:{width:"fit-content"},...K(E)&&{height:E},...K(j)&&{minHeight:j},...K(T)&&{maxHeight:T},...K(N)&&{minWidth:N},...K(R)&&{maxWidth:R}},...I,children:[o&&ot(vg,{sx:{...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G},color:K(y)?y:"#000",marginLeft:0,marginBottom:"4px",...K(g)&&{textAlign:g}},children:o}),ot(Sd,{sx:{...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G},...K(y)&&{color:y},...K(g)&&{textAlign:g},...K(M)&&{paddingLeft:M},...K(S)&&{paddingTop:S},...K(D)&&{paddingRight:D},...K(O)&&{paddingBottom:O},...K(b)&&{backgroundColor:b},border:`1px solid ${K(v)?v:"#ccc"}`,borderRadius:"4px"},children:e})]})}const we="small"===B?40:56,ke={position:"relative",display:K(P)?"block":"inline-block",...K(P)&&{width:P},...K(N)&&{minWidth:N},...K(R)&&{maxWidth:R},...K(w)&&{marginLeft:w},...K(k)&&{marginTop:k},...K(_)&&{marginRight:_},...K(C)&&{marginBottom:C}},_e={width:"100%",...K(E)&&{height:E},...K(j)&&{minHeight:j},...K(T)&&{maxHeight:T},...!K(P)&&!K(N)&&{minWidth:"240px"},...a},Ce=K(y)?y:K(x)?x:void 0,Me={..."small"===B&&!E&&{height:`${we}px`},...K(b)&&{backgroundColor:b},...Ce&&{color:Ce},...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G},...K(v)&&{"& .MuiOutlinedInput-notchedOutline":{borderColor:v},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:v},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:v}},..."filled"===$&&K(v)&&{"&:before":{borderColor:v},"&:after":{borderColor:v},"&:hover:not(.Mui-disabled):before":{borderColor:v}},..."standard"===$&&K(v)&&{"&:before":{borderColor:v},"&:after":{borderColor:v},"&:hover:not(.Mui-disabled):before":{borderColor:v}},"& .MuiSelect-select":{...K(g)&&{textAlign:g},...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G},...K(S)&&{paddingTop:S},...K(O)&&{paddingBottom:O},...K(M)&&{paddingLeft:M},...K(D)&&{paddingRight:D}}},Se={...K(h)&&{fontSize:h},...K(f)&&{fontFamily:f},...G&&{fontWeight:G}},De=te?ee.watch(F)||"":re,Oe=te?ee.formState?.errors?.[F]:void 0;return ot("div",{style:ke,...I,onClick:e=>{le&&I&&"onClick"in I&&(e.stopPropagation(),e.preventDefault(),I.onClick())},children:nt(rg,{variant:$,size:B,sx:_e,disabled:xe,required:s,error:!!Oe,children:[!V&&ot(Wg,{id:`${F}-label`,shrink:H?ne||!!De:void 0,sx:Se,children:o}),ot(Tb,{value:De,onChange:e=>{var t;le||(t=e.target.value,oe(t),te&&ee.setValue(F,t),A&&se&&se(A,{id:t}))},onFocus:()=>ae(!0),onBlur:()=>ae(!1),...le&&{open:!1},labelId:V?void 0:`${F}-label`,label:V?void 0:o,disabled:xe,native:H,sx:Me,children:H?[ot("option",{value:""},"__placeholder__"),...X?[ot("option",{disabled:!0,children:"Loading..."},"__loading__")]:J.map(e=>ot("option",{value:e.id,children:e.value},e.id))]:X?nt(yx,{disabled:!0,children:[ot(ed,{size:20,sx:{mr:1}}),"Loading..."]}):J.map(e=>ot(yx,{value:e.id,children:e.value},e.id))}),Oe&&ot(vg,{error:!0,children:Oe?.message||l})]})})};const ght=({text:e,name:t,isDisplayOnly:r=!1,required:o=!1,requiredErrorText:n="This field is required",validationErrorText:a="Invalid value",placeholderText:i="",startIcon:s,endIcon:l,borderColor:c,selectLineColor:u,lineWeight:d=1,orientation:p="horizontal",textColor:h,fontSize:f,fontFamily:m,fontWeight:y,valueFormat:g,valueDisplay:v="auto",iconSize:x,selectColor:b,iconColor:w,minValue:k=0,maxValue:_=100,step:C,labelPlacement:M="top",marginLeft:S="0",marginTop:D="0",marginRight:O="0",marginBottom:P="0",paddingLeft:E="0",paddingTop:j="0",paddingRight:T="0",paddingBottom:N="0",width:R,height:I,minHeight:F,maxHeight:A,minWidth:z,maxWidth:L,sx:B,configurationItemInfo:V,sourceDataModelField:$,disabled:H=!1,...q})=>{const W=Ut(),U=W?.control,{localStateObject:G}=IC(),{stateConfig:K}=WC(),Y=dt(),Z=G||K,X=$?Z?.[$]?.value:void 0,Q=$?Y?.getDmfValue($):void 0,J={required:!!o&&n,validate:e=>!o||null!=e||n},ee=e=>function(e,t){if(null==e)return"";switch(t){case"$0.00":return`$${e.toFixed(2)}`;case"$123":return`$${e}`;case"%0.00":return`${e.toFixed(2)}%`;case"%123":return`${e}%`;case"0.0":return e.toFixed(1);case"0.00":return e.toFixed(2);default:return e.toString()}}(e,g),te={width:"100%","& .MuiSlider-root":{width:"100%"},"& .MuiSlider-rail":{backgroundColor:c||"#ccc",..."vertical"===p?{width:`${d}px`}:{height:`${d}px`}},"& .MuiSlider-track":{backgroundColor:u||"#2196f3",border:`1px solid ${u||"#2196f3"}`,..."vertical"===p?{width:`${d}px`}:{height:`${d}px`}},"& .MuiSlider-thumb":{backgroundColor:b||"#2196f3",width:x||"16px",height:x||"16px",boxShadow:"none","&:focus, &:hover, &.Mui-active, &.Mui-focusVisible":{boxShadow:"none"}},"& .MuiSlider-valueLabel":{backgroundColor:b||"#2196f3",color:"#ffffff",borderRadius:"4px",fontSize:"12px",fontWeight:500},"& .MuiSlider-mark":{backgroundColor:c||"#ccc",width:"2px",height:"2px",borderRadius:"50%"},"& .MuiSlider-markActive":{backgroundColor:b||"#2196f3"},...B};if(r){let t=null;const r=e=>"number"!=typeof e||Number.isNaN(e)?"string"!=typeof e||Number.isNaN(Number(e))?null:Number(e):e;if(void 0!==Q)t=r(Q);else if($&&Z?.[$]){const e=Z?.[$]?.value;t=r(e)}return nt(rg,{required:o,sx:{marginLeft:S,marginTop:D,marginRight:O,marginBottom:P,paddingLeft:E,paddingTop:j,paddingRight:T,paddingBottom:N,display:"inline-flex",...R&&{width:R},...I&&{height:I},...F&&{minHeight:F},...A&&{maxHeight:A},...z&&{minWidth:z},...L&&{maxWidth:L},...B},...V,children:[e&&ot(Cg,{children:e}),nt(Gf,{display:"flex",flexDirection:"top"===M?"column":"row",alignItems:"center",mt:"top"===M?1:0,children:[s&&ot(Gf,{mr:"horizontal"===p?1:0,mb:"vertical"===p?1:0,children:ot(EGe,{iconName:s,color:w})}),ot(fw,{value:t??void 0,min:k,max:_,step:C,orientation:p,valueLabelDisplay:v,valueLabelFormat:ee,sx:te,disabled:!0,...q}),l&&ot(Gf,{ml:"horizontal"===p?1:0,mt:"vertical"===p?1:0,children:ot(EGe,{iconName:l,color:w})}),ot(Sd,{sx:{ml:1,fontSize:f,fontFamily:m,fontWeight:y,color:h},children:t})]})]})}return nt(rg,{required:o,sx:{marginLeft:S,marginTop:D,marginRight:O,marginBottom:P,paddingLeft:E,paddingTop:j,paddingRight:T,paddingBottom:N,display:"inline-flex",...R&&{width:R},...I&&{height:I},...F&&{minHeight:F},...A&&{maxHeight:A},...z&&{minWidth:z},...L&&{maxWidth:L},...B},...V,children:[e&&ot(Cg,{children:e}),ot(Jt,{name:t||"",control:U,defaultValue:"number"==typeof X?X:k,rules:J,render:({field:e,fieldState:t})=>nt(rt,{children:[ot(fw,{...e,min:k,max:_,step:C,orientation:p,valueLabelDisplay:v,valueLabelFormat:ee,sx:te,onChange:(t,r)=>e.onChange(r),...q}),t.error&&ot(vg,{error:!0,sx:{mt:1},children:"required"===t.error.type?n:a})]})})]})},vht=({direction:t="up",size:r="medium",ariaLabel:o="Speed Dial",openIconName:n="plus",closeIconName:a="x",openIconColor:i="#fff",closeIconColor:s="#fff",backgroundColor:l="#1976d2",items:c=[],configurationItemInfo:u={},tooltipOpen:d=!1,tooltipPlacement:p,showBackdrop:h=!1,openOnHover:f=!1,paddingTop:m,paddingRight:y,paddingBottom:g,paddingLeft:v,marginTop:x,marginRight:b,marginBottom:w,marginLeft:k,moleculeId:_,gap:C,sx:M,...S})=>{const D=Ge(),[O,P]=e.useState(!1),{isConfigurationMode:E,onConfigurationItemClicked:j,selectedConfigurationItemId:T,onInternalNavigation:N}=IC();e.useEffect(()=>{if(!O)return;const e=e=>{"Escape"!==e.key||E||P(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[O,E]);const R=()=>P(!0),I=()=>P(!1);let F={};F=f&&!h?{onMouseEnter:R,onMouseLeave:I,onFocus:R,onBlur:I}:{onClick:e=>{P(e=>!e)}};const A={bgcolor:l,paddingTop:m,paddingRight:y,paddingBottom:g,paddingLeft:v,marginTop:x,marginRight:b,marginBottom:w,marginLeft:k},z=O||E&&(T===_||c.some(e=>e.id===T));return nt("div",{role:"presentation",children:[h&&ot(Ff,{open:O}),ot(Mw,{ariaLabel:o,direction:t,icon:ot(Yw,{icon:ot(EGe,{iconName:n,color:i,size:24}),openIcon:ot(EGe,{iconName:a,color:s,size:24})}),open:z,onOpen:f&&!h?R:void 0,onClose:f&&!h?I:void 0,FabProps:{color:"primary",sx:A,size:r,gap:C},slotProps:{fab:{"data-testid":"speed-dial-fab","aria-label":o}},sx:{"& .MuiSpeedDial-fab":{backgroundColor:l,...A},"& .MuiSpeedDial-actions":{gap:C||8},"& .MuiSpeedDialIcon-icon":{fontSize:"small"===r?"18px":"large"===r?"24px":"20px",color:"inherit"},"& .MuiSpeedDialIcon-openIcon":{fontSize:"small"===r?"18px":"large"===r?"24px":"20px",color:"inherit"},"& .MuiSpeedDialAction-fab":{backgroundColor:"#fff",color:"#757575","&:hover":{backgroundColor:"#f5f5f5"}},"& .MuiSpeedDialAction-staticTooltip":{backgroundColor:"rgba(97, 97, 97, 0.9)",color:"#fff",fontSize:"12px",padding:"4px 8px",borderRadius:"4px"},"& .MuiSpeedDialAction-staticTooltipLabel":{fontSize:"12px",fontWeight:500},...M},...F,...u,...S,children:c.map(e=>{const{text:t,link:o}=e.properties??{},{iconName:n="plus",disabled:a=!1,iconColor:i="#757575",tooltipText:s,backgroundColor:l="#fff"}=e.config?.props??{},c=String(t?.text||s||"Action"),u=E&&T===e.id,h={entityId:e.id,entity:"molecule_item",entityType:"speed_dial_action_item"},f=E?{onClick:e=>{e.stopPropagation(),j?.(h,!1)},onDoubleClick:e=>{e.stopPropagation(),j?.(h,!0)},"data-organism-id":e.id,css:trt({theme:D,selected:u})}:{};return ot(Hw,{icon:ot(EGe,{iconName:n,color:i,size:24}),tooltipOpen:d,tooltipTitle:c,tooltipPlacement:p,FabProps:{sx:{color:i,backgroundColor:l},size:r,disabled:a,"aria-label":c,onClick:e=>{e.stopPropagation(),o?(e9e(o)?N?.({link:o.internalLink??""}):Q7e(o.externalLink),P(!1)):P(!1)},...f}},e.id)})})]})},xht=({items:e,gap:t,stepGap:r,isMobile:o=!1,iconSize:n="24px",orientation:a="horizontal",activeStep:i=0,lineColor:s,lineWidth:l,lineRadius:c,marginTop:u="0",marginRight:d="0",marginBottom:p="0",marginLeft:h="0",paddingTop:f="0",paddingRight:m="0",paddingBottom:y="0",paddingLeft:g="0",borderRadius:v="0",configurationItemInfo:x,backgroundColor:b="transparent",sx:w,...k})=>{const _=Ge(),C=o?"vertical":a,{isConfigurationMode:M,onConfigurationItemClicked:S,selectedConfigurationItemId:D}=IC();return ot(zk,{sx:{gap:t,width:"100%",overflow:"hidden",marginTop:u,marginRight:d,marginBottom:p,marginLeft:h,paddingTop:f,paddingRight:m,paddingBottom:y,paddingLeft:g,borderRadius:v,backgroundColor:b,"& .MuiStep-root":{padding:"8px"},"& .MuiStepLabel-root":{gap:r,alignItems:"flex-start"},"& .MuiStepLabel-label":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"},"& .MuiStepConnector-root":{flex:"1 1 auto"},"& .MuiStepConnector-line":{borderColor:s,borderWidth:l,borderRadius:c},"& .MuiStepConnector-vertical":{width:n||"24px",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:"4px"},"& .MuiStepConnector-horizontal":{marginLeft:"8px",marginRight:"8px"},"& .MuiStepContent-root":{margin:0,padding:0,marginTop:"4px",borderLeft:"none"},"& .MuiTypography-root":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"},...w},activeStep:i,orientation:C,connector:ot(Ok,{sx:{[`&.${Ck.vertical}`]:{width:n||"24px",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:"4px"},[`&.${Ck.vertical} .${Ck.line}`]:{borderColor:s,borderWidth:l,borderRadius:c},[`&.${Ck.horizontal} .${Ck.line}`]:{borderColor:s,borderWidth:l,borderRadius:c}}}),...x,...k,children:e.map((e,t)=>{const o=D===e.id,a=t===i,s={entityId:e.id,entity:"molecule_item",entityType:"stepper_item"},l=M?{onClick:e=>{M&&(e.stopPropagation(),S?.(s,!1))},onDoubleClick:e=>{M&&(e.stopPropagation(),S?.(s,!0))},"data-organism-id":e.id,css:trt({theme:_,selected:o})}:{},c=e.color||(a?"#000":"#555");return ot(ak,{...l,children:nt(kk,{sx:{gap:r,"& .MuiStepLabel-iconContainer":{marginRight:"8px",display:"flex",alignItems:"center",justifyContent:"center"},"& .MuiStepLabel-labelContainer":{display:"flex",flexDirection:"column",alignItems:"flex-start"}},icon:e?.iconName?ot(EGe,{size:n,color:e.iconColor||"#000",iconName:e.iconName,borderRadius:e?.iconBorderRadius||0,backgroundColor:e.iconBackgroundColor||"transparent"}):void 0,children:[ot(Sd,{variant:"body1",sx:{padding:"4px",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",color:c,borderRadius:e.borderRadius||"0",display:"inline-block","&.MuiTypography-body1":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"}},children:e.title}),e.subText&&ot(Nk,{sx:{margin:0,padding:0,marginTop:"4px",borderLeft:"none","& .MuiStepContent-root":{margin:0,padding:0,marginTop:"4px",borderLeft:"none"}},transitionDuration:{enter:400,exit:400},children:ot(Sd,{variant:"body2",sx:{padding:"4px",fontSize:e.subTextFontSize||"inherit",fontWeight:e.subTextFontWeight||"normal",fontFamily:e.subTextFontFamily||"inherit",color:e.subTextColor||"#666",borderRadius:e.borderRadius||"0",display:"inline-block",..."horizontal"===C&&{maxWidth:"300px"},"&.MuiTypography-body2":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"}},children:e.subText})})]})},e.id)})})},bht=fl(Uk)(({thumbColor:e="#ff0000",thumbCheckedColor:t="#00ff00",trackColor:r="#0000ff",disabledThumbColor:o="#9e9e9e",sx:n})=>({"& .MuiSwitch-thumb":{backgroundColor:e,width:20,height:20},"& .MuiSwitch-switchBase.Mui-checked .MuiSwitch-thumb":{backgroundColor:t},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"& .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"&.Mui-disabled .MuiSwitch-thumb":{backgroundColor:o},"&.Mui-disabled .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"& .MuiSwitch-switchBase":{padding:"9px","&.Mui-checked":{transform:"translateX(16px)"}},"& .MuiSwitch-colorPrimary":{"&.Mui-checked":{color:t}},"& .MuiSwitch-colorSecondary":{"&.Mui-checked":{color:t}},...n})),wht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="This field is required",validationErrorText:n="Invalid value",text:a="",thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,labelPlacement:u="top",marginLeft:d="0",marginTop:p="0",marginRight:h="0",marginBottom:f="0",paddingLeft:m="0",paddingTop:y="0",paddingRight:g="0",paddingBottom:v="0",width:x,height:b,minHeight:w,maxHeight:k,minWidth:_,maxWidth:C,name:M,sourceDataModelField:S,disabled:D=!1,sx:O,configurationItemInfo:P,...E})=>{const j=Ut(),T=j?.control,N=!!T&&!!M,R={required:!!r&&o,validate:e=>!(r&&!e)||o},{localStateObject:I}=IC(),{stateConfig:F}=WC(),A=dt(),z=I||F,L=S?z?.[S]?.value:void 0,[B,V]=e.useState(!1);if(t){const e=S?A?.getDmfValue(S):void 0;let t=!1;return t=void 0!==e?"true"===String(e).toLowerCase()||!0===e:N?!!j.watch(M):!!L,nt(rg,{required:r,sx:{marginLeft:d,marginTop:p,marginRight:h,marginBottom:f,paddingLeft:m,paddingTop:y,paddingRight:g,paddingBottom:v,display:"inline-flex",...x&&{width:x},...b&&{height:b},...w&&{minHeight:w},...k&&{maxHeight:k},..._&&{minWidth:_},...C&&{maxWidth:C},"& .MuiFormLabel-root":{fontSize:"14px",fontWeight:500,color:"#333",marginBottom:"8px"},"& .MuiSwitch-root":{marginTop:"8px"},"& .MuiSwitch-switchBase":{padding:"9px"},"& .MuiSwitch-thumb":{width:"18px",height:"18px",borderRadius:"9px"},"& .MuiSwitch-track":{borderRadius:"9px",height:"14px"},"& .MuiTypography-root":{marginLeft:"8px",fontSize:"14px",fontWeight:500,color:"#333"},...O},...P,children:[a&&ot(Cg,{component:"legend",children:a}),nt(Gf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:[ot(bht,{disabled:!0,checked:t,thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{pointerEvents:"none"}},...E}),ot(Sd,{sx:{ml:1},children:t?"ON":"OFF"})]})]})}return nt(rg,{required:r,sx:{marginLeft:d,marginTop:p,marginRight:h,marginBottom:f,paddingLeft:m,paddingTop:y,paddingRight:g,paddingBottom:v,display:"inline-flex",...x&&{width:x},...b&&{height:b},...w&&{minHeight:w},...k&&{maxHeight:k},..._&&{minWidth:_},...C&&{maxWidth:C},"& .MuiFormLabel-root":{fontSize:"14px",fontWeight:500,color:"#333",marginBottom:"8px"},"& .MuiSwitch-root":{marginTop:"8px"},"& .MuiSwitch-switchBase":{padding:"9px"},"& .MuiSwitch-thumb":{width:"18px",height:"18px",borderRadius:"9px"},"& .MuiSwitch-track":{borderRadius:"9px",height:"14px"},"& .MuiFormHelperText-root":{marginTop:"4px",fontSize:"12px",color:"#d32f2f"},...O},...P,children:[a&&ot(Cg,{component:"legend",children:a}),N?ot(Jt,{name:M,rules:R,control:T,defaultValue:!1,render:({field:e,fieldState:t})=>nt(rt,{children:[ot(Gf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:ot(bht,{checked:!!e.value,disabled:D,onChange:(t,r)=>e.onChange(r),thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)"}}},...E})}),t.error&&ot(vg,{error:!0,sx:{marginTop:"4px"},children:"required"===t.error.type?o:n})]})}):ot(Gf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:ot(bht,{checked:B,disabled:D,onChange:(e,t)=>{V(t)},thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)"}}},...E})})]})},kht=({items:t,onTabChange:r,activeTabKey:o,isMobile:n=!1,marginTop:a,marginRight:i,marginBottom:s,marginLeft:l,paddingTop:c,paddingRight:u,paddingBottom:d,paddingLeft:p,buttonPaddingTop:h,buttonPaddingRight:f,buttonPaddingBottom:m,buttonPaddingLeft:y,width:g,height:v,backgroundColor:x,borderRadius:b,elevation:w=1,gap:k,indicatorVisible:_=!0,indicatorColor:C,lineWidth:M="2px",orientation:S="horizontal",activeTextColor:D="#1976d2",inactiveTextColor:O="#000",fontSize:P,fontWeight:E,fontFamily:j,wrapText:T,textAlign:N,iconName:R,iconColor:I,iconSize:F,iconPlacement:A="left",hoverTextColor:z,itemBorder:L,itemBorderRadius:B,itemBackgroundColor:V,itemSelectedBackgroundColor:$,itemHoverBackgroundColor:H,selectedItemElevation:q=0,itemDisableRipple:W,configurationItemInfo:U,sx:G})=>{const K=Ge(),{isConfigurationMode:Y,onConfigurationItemClicked:Z,selectedConfigurationItemId:X}=IC(),[Q,J]=e.useState(null),ee=e=>J(e.currentTarget),te=()=>J(null),re={marginTop:a,marginRight:i,marginBottom:s,marginLeft:l,paddingTop:c,paddingRight:u,paddingBottom:d,paddingLeft:p,width:g,height:v,backgroundColor:x,borderRadius:b,display:"flex",overflow:"visible !important"},oe=e=>{const t=e?D:O,r=e&&$||V;return{color:t,fontSize:P,fontWeight:E,fontFamily:j,textAlign:N,whiteSpace:T?"normal":"nowrap",border:L,borderRadius:B,backgroundColor:r,boxShadow:e?K.shadows[q]:void 0,paddingTop:h,paddingRight:f,paddingBottom:m,paddingLeft:y,"&:hover":{color:z||t,backgroundColor:H||r}}},ne=e=>{r?.({newTabKey:e.tabKey,link:e.link})},ae=e=>{if(!Y)return{};const t=e.id===X,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:e=>{e.stopPropagation(),Z?.(r,!1)},onDoubleClick:e=>{e.stopPropagation(),Z?.(r,!0)},"data-organism-id":e.id,css:trt({theme:K,selected:t})}},ie=e=>{const t=e.tabKey===o,r=oe(t);return nt(yx,{onClick:()=>{ne(e),te()},sx:{...r,display:"flex",alignItems:"center"},...ae(e),children:[e.iconName&&ot(EGe,{iconName:e.iconName,sx:{fontSize:P,color:t?D:O,mr:1}}),ot(Gf,{component:"span",children:e.label})]},e.id)};if(n)return nt(Qc,{elevation:w,style:re,sx:G,...U,children:[ot(id,{onClick:ee,children:ot(EGe,{size:F,color:I,iconName:R})}),ot(dx,{anchorEl:Q,open:Boolean(Q),onClose:te,children:t.map(ie)})]});const se=t.findIndex(e=>e.tabKey===o);return ot(Qc,{elevation:w,style:re,sx:G,...U,children:ot(Q_,{value:se<0?0:se,onChange:(e,r)=>Y?null:ne(t[r]),orientation:S,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:k}},TabIndicatorProps:{style:_?{height:M,borderRadius:b,backgroundColor:C||D}:{display:"none"}},children:t.map(e=>{const t=e.tabKey===o,r={...oe(t),"&.Mui-selected":{color:t?D:O}};return ot(Xk,{label:e.label,disableRipple:W,sx:{...r,textTransform:"none"},onClick:()=>ne(e),iconPosition:"right"===A?"end":"start",icon:e.iconName?ot(EGe,{iconName:e.iconName,sx:{fontSize:P,color:t?D:O}}):void 0,...ae(e)},e.id)})})})},_ht=e=>{if(!e)return null;if(e instanceof Date)return vot(e)?e:null;if("object"==typeof e&&null!==e&&"function"==typeof e.toDate){const t=e.toDate();return t instanceof Date&&vot(t)?t:null}if("string"==typeof e){const t=e.trim();if(!t)return null;const r=t.match(/(\d{1,2}:\d{2}(?::\d{2})?)/),o=r?r[1]:t,n=new Date,a=["HH:mm:ss","H:mm:ss","HH:mm","H:mm","hh:mm a","h:mm a","hh a","h a","HHmm","Hmm","HH","H"];for(const e of a){const t=Cnt(o,e,n);if(vot(t))return t}return null}return null},Cht=({name:t,text:r,isDisplayOnly:o=!1,sourceDataModelField:n,configurationItemInfo:a={},placeholderText:i,displayFormat:s="HH:mm",required:l=!1,requiredErrorText:c="This field is required",validationErrorText:u,sx:d,width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,...v})=>{const x=Ut(),b=x?.control,w=!!b&&!!t,{localStateObject:k}=IC(),{stateConfig:_}=WC(),C=dt(),M=k||_,S=n?M?.[n]?.value:void 0,D=_ht(S);e.useRef();const[O,P]=e.useState(D);if(o){const e=n?C?.getDmfValue(n):void 0,o=void 0!==e?e:w?x.watch(t):S,l=_ht(o),c=l&&vot(l)?Cot(l,s):"";return nt(Gf,{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiFormHelperText-root":{marginBottom:"4px"},"& .MuiTypography-root":{border:"1px solid #ced4da",borderRadius:"4px",padding:"8px",minWidth:"100px"},...d},children:[r&&ot(vg,{children:r}),ot(Sd,{children:c||i||"-"})]})}return ot(Gf,w?{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiTimePicker-root":{width:"100%"},"& .MuiTextField-root":{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g},"& .MuiInputBase-root":{fontSize:"14px"},"& .MuiInputLabel-root":{fontSize:"14px"},"& .MuiFormHelperText-root":{fontSize:"12px"},"& .MuiSvgIcon-root":{fontSize:"20px"},...d},children:ot(Jt,{name:t,control:b,defaultValue:D??null,rules:{required:!!l&&(c||"This field is required"),validate:e=>{if(null==e||""===e)return!0;const t=_ht(e);return t&&vot(t)||u||"Invalid time"}},render:({field:{onChange:e,value:t},fieldState:o})=>ot(Ydt,{...v,enableAccessibleFieldDOMStructure:!1,value:_ht(t),onChange:t=>{const r=_ht(t);e(r?Cot(r,"HH:mm"):null)},slots:{textField:oC},slotProps:{textField:{label:r,placeholder:i,error:!!o.error,helperText:o.error?.message,onMouseDown:e=>e.stopPropagation(),sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g}}}})})}:{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiTimePicker-root":{width:"100%"},"& .MuiTextField-root":{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g},"& .MuiInputBase-root":{fontSize:"14px"},"& .MuiInputLabel-root":{fontSize:"14px"},"& .MuiFormHelperText-root":{fontSize:"12px"},"& .MuiSvgIcon-root":{fontSize:"20px"},...d},children:ot(Ydt,{...v,enableAccessibleFieldDOMStructure:!1,value:O,onChange:e=>P(_ht(e)),slots:{textField:oC},slotProps:{textField:{label:r,placeholder:i,onMouseDown:e=>e.stopPropagation(),sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g}}}})})},Mht=({src:t,poster:r,controls:o=!1,loop:n=!1,autoplay:a=!1,raised:i=!1,alt:s="",height:l="100%",width:c="100%",borderRadius:u="0",margin:d=0,padding:p=0,moleculeId:h,enableCoverImage:f,configurationItemInfo:m,marginTop:y="0px",marginRight:g="0px",marginBottom:v="0px",marginLeft:x="0px",paddingTop:b="0px",paddingRight:w="0px",paddingBottom:k="0px",paddingLeft:_="0px",sx:C})=>{const[M,S]=e.useState(!1),{onStateChange:D}=KC(),O=()=>{D({id:h,type:"started"})};return ot(Sht,{id:h,raised:i,onClick:O,sx:{borderRadius:`${u}px`,margin:d,padding:p,marginTop:y,marginRight:g,marginBottom:v,marginLeft:x,paddingTop:b,paddingRight:w,paddingBottom:k,paddingLeft:_,"& .MuiCard-root":{display:"inline-block",overflow:"hidden"},"& .MuiCardMedia-root":{height:l,width:c,objectFit:"cover"},"& .MuiCardMedia-media":{height:"100%",width:"100%",objectFit:"cover"},...C},...m,children:M?ot(Sd,{component:"div",sx:{height:l,width:c,display:"flex",justifyContent:"center",alignItems:"center",fontSize:"16px",color:"gray",textAlign:"center"},children:s||"Video unavailable"}):ot(gm,{component:"video",src:t,poster:f?r:void 0,controls:o,loop:n,autoPlay:a,muted:a,"aria-label":s,sx:{height:l,width:c,objectFit:"cover","& .MuiCardMedia-media":{height:"100%",width:"100%",objectFit:"cover"}},onPlay:O,onEnded:()=>{D({id:h,type:"completed"})},onError:()=>{S(!0)}})})},Sht=Po(dm)`
1032
1032
  display: inline-block;
1033
1033
  overflow: hidden;
1034
1034
  `,Dht=({width:e="100%",height:t,fontSize:r="16px",marginLeft:o="0",marginTop:n="0",marginRight:a="0",marginBottom:i="0",sx:s})=>ot(Bb,{variant:"text",animation:"wave",sx:{width:e,height:t||("number"==typeof r?1.5*r+"px":"24px"),marginLeft:o,marginTop:n,marginRight:a,marginBottom:i,...s}}),Oht=Dht,Pht=({text:e,width:t,height:r,fontSize:o="16px",borderColor:n="#ccc",backgroundColor:a,marginLeft:i="0",marginTop:s="0",marginRight:l="0",marginBottom:c="0",paddingLeft:u,paddingTop:d,paddingRight:p,paddingBottom:h,sx:f})=>nt(Gf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:i,marginTop:s,marginRight:l,marginBottom:c,width:t||"fit-content",...f},children:[e&&ot(Bb,{variant:"text",animation:"wave",sx:{width:"60px",height:"14px",marginBottom:"4px"}}),ot(Bb,{variant:"rounded",animation:"wave",sx:{width:t||"150px",height:(()=>{if(r)return r;const e="number"==typeof o?o:parseInt(o,10);return Number.isNaN(e)?"32px":`${Math.round(1.2*e+16)}px`})(),borderRadius:"4px",backgroundColor:a,border:`1px solid ${n}`}})]}),Eht=Pht,jht=Pht,Tht=Pht,Nht=Pht,Rht=({text:e,width:t,height:r,borderColor:o="#ccc",backgroundColor:n,marginLeft:a="0",marginTop:i="0",marginRight:s="0",marginBottom:l="0",paddingLeft:c,paddingTop:u,paddingRight:d,paddingBottom:p,sx:h})=>nt(Gf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:a,marginTop:i,marginRight:s,marginBottom:l,width:t||"fit-content",...h},children:[e&&ot(Bb,{variant:"text",animation:"wave",sx:{width:"80px",height:"14px",marginBottom:"4px"}}),ot(Bb,{variant:"rounded",animation:"wave",sx:{width:t||"180px",height:r||"32px",borderRadius:"4px",backgroundColor:n,border:`1px solid ${o}`}})]}),Iht=({text:e,maxValue:t=5,marginLeft:r="0",marginTop:o="0",marginRight:n="0",marginBottom:a="0",sx:i})=>nt(Gf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:r,marginTop:o,marginRight:n,marginBottom:a,...i},children:[e&&ot(Bb,{variant:"text",animation:"wave",sx:{width:"80px",height:"20px",marginBottom:"4px"}}),ot(Gf,{sx:{display:"flex",gap:"4px"},children:Array.from({length:t}).map((e,t)=>ot(Bb,{variant:"circular",animation:"wave",sx:{width:"24px",height:"24px"}},t))})]}),Fht=({text:e,marginLeft:t="0",marginTop:r="0",marginRight:o="0",marginBottom:n="0",sx:a})=>nt(Gf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:t,marginTop:r,marginRight:o,marginBottom:n,...a},children:[e&&ot(Bb,{variant:"text",animation:"wave",sx:{width:"60px",height:"16px",marginBottom:"8px"}}),nt(Gf,{sx:{display:"flex",alignItems:"center",gap:"8px"},children:[ot(Bb,{variant:"rounded",animation:"wave",sx:{width:"42px",height:"26px",borderRadius:"13px"}}),ot(Bb,{variant:"text",animation:"wave",sx:{width:"30px",height:"16px"}})]})]}),Aht=({text:e,width:t,orientation:r="horizontal",marginLeft:o="0",marginTop:n="0",marginRight:a="0",marginBottom:i="0",sx:s})=>nt(Gf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:o,marginTop:n,marginRight:a,marginBottom:i,width:t||"200px",...s},children:[e&&ot(Bb,{variant:"text",animation:"wave",sx:{width:"60px",height:"16px",marginBottom:"8px"}}),nt(Gf,{sx:{display:"flex",alignItems:"center",flexDirection:"vertical"===r?"column":"row",gap:"8px"},children:[ot(Bb,{variant:"rounded",animation:"wave",sx:{width:"horizontal"===r?"100%":"4px",height:"horizontal"===r?"4px":"100px",borderRadius:"2px"}}),ot(Bb,{variant:"text",animation:"wave",sx:{width:"24px",height:"16px"}})]})]}),zht=({text:e,width:t,height:r,borderColor:o="#ced4da",backgroundColor:n,marginLeft:a="0",marginTop:i="0",marginRight:s="0",marginBottom:l="0",sx:c})=>nt(Gf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:a,marginTop:i,marginRight:s,marginBottom:l,width:t||"fit-content",...c},children:[e&&ot(Bb,{variant:"text",animation:"wave",sx:{width:"60px",height:"14px",marginBottom:"4px"}}),ot(Bb,{variant:"rounded",animation:"wave",sx:{width:t||"120px",height:r||"32px",borderRadius:"4px",backgroundColor:n,border:`1px solid ${o}`}})]}),Lht=({text:e,width:t,height:r,borderColor:o="#ced4da",marginLeft:n="0",marginTop:a="0",marginRight:i="0",marginBottom:s="0",sx:l})=>nt(Gf,{sx:{marginLeft:n,marginTop:a,marginRight:i,marginBottom:s,width:t||"fit-content",...l},children:[e&&ot(Bb,{variant:"text",animation:"wave",sx:{width:"60px",height:"14px",marginBottom:"4px"}}),ot(Bb,{variant:"rounded",animation:"wave",sx:{width:t||"100px",height:r||"32px",borderRadius:"4px",border:`1px solid ${o}`}})]}),Bht=({width:e,height:t,marginLeft:r="0",marginTop:o="0",marginRight:n="0",marginBottom:a="0",sx:i})=>nt(Gf,{sx:{marginLeft:r,marginTop:o,marginRight:n,marginBottom:a,width:e||"320px",...i},children:[ot(Bb,{variant:"rectangular",animation:"wave",sx:{width:"100%",height:"48px",borderRadius:"8px 8px 0 0",marginBottom:"8px"}}),ot(Gf,{sx:{display:"flex",justifyContent:"space-between",marginBottom:"8px"},children:Array.from({length:7}).map((e,t)=>ot(Bb,{variant:"circular",animation:"wave",sx:{width:"32px",height:"24px"}},t))}),Array.from({length:6}).map((e,t)=>ot(Gf,{sx:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:Array.from({length:7}).map((e,t)=>ot(Bb,{variant:"circular",animation:"wave",sx:{width:"32px",height:"32px"}},t))},t))]}),Vht=({text:e,subText:t,width:r,height:o,backgroundColor:n,marginLeft:a="0",marginTop:i="0",marginRight:s="0",marginBottom:l="0",sx:c})=>ot(Bb,{variant:"rounded",animation:"wave",sx:{width:r||"100%",height:o||(e&&t?"72px":"48px"),borderRadius:"4px",marginLeft:a,marginTop:i,marginRight:s,marginBottom:l,backgroundColor:n,...c}}),$ht=({size:e=24,marginLeft:t="0",marginTop:r="0",marginRight:o="0",marginBottom:n="0",sx:a})=>nt(Gf,{sx:{position:"relative",display:"inline-flex",marginLeft:t,marginTop:r,marginRight:o,marginBottom:n,...a},children:[ot(Bb,{variant:"circular",animation:"wave",sx:{width:e,height:e}}),ot(Bb,{variant:"circular",animation:"wave",sx:{position:"absolute",top:-4,right:-4,width:16,height:16}})]}),Hht=({size:e="medium",width:t,backgroundColor:r,marginLeft:o="0",marginTop:n="0",marginRight:a="0",marginBottom:i="0",sx:s})=>ot(Bb,{variant:"rounded",animation:"wave",sx:{width:t||("small"===e?"60px":"80px"),height:"small"===e?"24px":"32px",borderRadius:"16px",marginLeft:o,marginTop:n,marginRight:a,marginBottom:i,backgroundColor:r,...s}}),qht=({width:e,fontSize:t="14px",marginLeft:r="0",marginTop:o="0",marginRight:n="0",marginBottom:a="0",sx:i})=>ot(Bb,{variant:"text",animation:"wave",sx:{width:e||"100px",height:"number"==typeof t?1.2*t+"px":"18px",marginLeft:r,marginTop:o,marginRight:n,marginBottom:a,...i}}),Wht=({size:e=40,marginLeft:t="0",marginTop:r="0",marginRight:o="0",marginBottom:n="0",sx:a})=>ot(Bb,{variant:"circular",animation:"wave",sx:{width:e,height:e,marginLeft:t,marginTop:r,marginRight:o,marginBottom:n,...a}}),Uht=["simple_text","text","basic_text_display_field","email_display_field","phone_number_display_field","numeric_display_field","currency_display_field","select_display_field","rating_display_field","switch_display_field","slider_display_field","date_display_field","time_picker_display","date_calendar_display","alert","badge","chip","link","avatar"],Ght=e=>Uht.includes(e),Kht=({type:e,props:t={}})=>{const r={width:t.width,height:t.height,marginLeft:t.marginLeft||"0",marginTop:t.marginTop||"0",marginRight:t.marginRight||"0",marginBottom:t.marginBottom||"0",sx:t.sx};switch(e){case"simple_text":case"text":return ot(Dht,{...r,fontSize:t.fontSize});case"basic_text_display_field":return ot(Pht,{...r,text:t.text,fontSize:t.fontSize,borderColor:t.borderColor,backgroundColor:t.backgroundColor,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom});case"email_display_field":return ot(Eht,{...r,text:t.text,borderColor:t.borderColor});case"phone_number_display_field":return ot(jht,{...r,text:t.text,borderColor:t.borderColor});case"numeric_display_field":return ot(Tht,{...r,text:t.text,borderColor:t.borderColor});case"currency_display_field":return ot(Nht,{...r,text:t.text,borderColor:t.borderColor});case"select_display_field":return ot(Rht,{...r,text:t.text,borderColor:t.borderColor});case"rating_display_field":return ot(Iht,{...r,text:t.text,maxValue:t.maxValue});case"switch_display_field":return ot(Fht,{...r,text:t.text});case"slider_display_field":return ot(Aht,{...r,text:t.text,orientation:t.orientation});case"date_display_field":return ot(zht,{...r,text:t.text,borderColor:t.borderColor});case"time_picker_display":return ot(Lht,{...r,text:t.text,borderColor:t.borderColor});case"date_calendar_display":return ot(Bht,{...r});case"alert":return ot(Vht,{...r,text:t.text,subText:t.subText,backgroundColor:t.backgroundColor});case"badge":return ot($ht,{...r,size:t.size});case"chip":return ot(Hht,{...r,size:t.size,backgroundColor:t.backgroundColor});case"link":return ot(qht,{...r,fontSize:t.fontSize});case"avatar":return ot(Wht,{...r,size:t.size});default:return ot(Bb,{variant:"rounded",animation:"wave",sx:{width:r.width||"100%",height:r.height||"40px",marginLeft:r.marginLeft,marginTop:r.marginTop,marginRight:r.marginRight,marginBottom:r.marginBottom,...r.sx}})}},Yht=({children:e,additionalInfo:t})=>{try{return ot(rt,{children:e})}catch(r){return console.error(`Render error in SafeRender - ${t} :`,r),ot("div",{style:{color:"red",padding:24},children:"Render Error"})}};function Zht(e,t,r,o){const n={...e};return 0===r.length?{...e,...t}:(t&&o&&r.forEach(e=>{void 0!==t[e]&&(n[e]=t[e])}),n)}function Xht(e,t,r=!1){return t&&r?yn(e,t):e}const Qht=({id:t,type:r,name:o,form:n,config:a,formData:i,isMobile:s,children:l,tabsProps:c,properties:u,moleculeLibraryId:d,organismLibraryMoleculeId:p,parentStyleVariantConfig:h,parentContainerWithVariantsId:f,parentContainerActiveVariant:m})=>{const y=Ge(),g=SC("xs"),v=s||g,{formId:x,isPreview:b=!1,validations:w,submitHandler:k,isConfigurationMode:_,onConfigurationItemClicked:C,selectedConfigurationItemId:M,currentStyleProperties:S,currentContentProperties:D,onInternalNavigation:O,organismMetadata:P,organismInfo:E,localState:j,isLoadingData:T}=IC(),{stateConfig:N}=WC(),R=N,I=dt(),F=m??I.activeVariant,A=e.useMemo(()=>((e,t)=>{if(!e)return{};if(t){const r=e[t];if(r&&"object"==typeof r&&"props"in r){const e=r.props;if(e&&"object"==typeof e)return e}}return e.props||{}})(a,F??null),[a,F]),z=a?.props?.dataCaptureName||u?.dataCapture?.dataCaptureName||t,L=e.useMemo(()=>{return x&&I?.nestedPathSegments?.length?(e=I.nestedPathSegments,t=z,e&&0!==e.length?[...e.map(e=>void 0!==e.index?`${e.dmfId}.${e.index}`:e.dmfId),t].filter(Boolean).join("."):t):z;var e,t},[x,I?.nestedPathSegments,z]),B=u?.dataCapture?.sourceDataModelFieldId,V=u?.dataCapture?.predefinedValue,$=M===t,{isStateDisabled:H,isStateVisible:q}=(({stateListenerId:e})=>{const{localStateObject:t}=IC(),{stateConfig:r}=WC(),o=t||r;let n=!0,a=!1;if(!e)return{isStateDisabled:a,isStateVisible:n};const i=o?.[e]||{},{visible:s=!0,disabled:l=!1}=i||{};return e in o&&(n=Boolean(s),a=Boolean(l)),{isStateDisabled:a,isStateVisible:n,stateValue:i}})({stateListenerId:t}),W=e.useMemo(()=>({entityType:r,entity:"molecule",entityName:o,entityId:t,organismLibraryMoleculeId:p,libraryEntityId:d,activeStyleVariant:F,parentReplicatorWithVariants:f||I.containerId||null,parentStyleVariantConfig:h||void 0}),[r,o,t,p,d,F,I.containerId,f,h]),U=e.useCallback(e=>{e?.stopPropagation(),C(W,!1)},[C,W]),G=e.useCallback(e=>{e?.stopPropagation(),C(W,!0)},[C,W]),K=_?{onClick:U,onDoubleClick:G,"data-configuration-id":t,css:trt({theme:y,selected:$})}:{},Y=_||H;if(!q)return null;if(T&&Ght(r)){const e={width:A.width,height:A.height,marginLeft:A.marginLeft||"0",marginTop:A.marginTop||"0",marginRight:A.marginRight||"0",marginBottom:A.marginBottom||"0",paddingLeft:A.paddingLeft,paddingTop:A.paddingTop,paddingRight:A.paddingRight,paddingBottom:A.paddingBottom,fontSize:A.fontSize,borderColor:A.borderColor,backgroundColor:A.backgroundColor,size:A.size,text:u?.text?.text,subText:u?.subText?.text,maxValue:A.maxValue,orientation:A.orientation,sx:A.sx};return ot(Kht,{type:r,props:e})}return(()=>{switch(r){case"simple_text":{const e={text:u?.text},r=["text"],{text:o}=Zht(e,D,r,$),n=Xht(A,S,$);return ot(mpt,{...n,text:o?.text||"",htmlElementId:t,configurationsItemInfo:K})}case"text":{const e={text:u?.text},r=Object.keys(e),{text:o}=Zht(e,D,r,$),n=Xht(A,S,$);return ot(fpt,{...o,...n,htmlElementId:t,configurationItemInfo:K})}case"consent":{const e=Zht(u,D,[],$),r=Xht(A,S,$)||{};return ot(frt,{...r,htmlElementId:t,properties:e,configurationItemInfo:K})}case"signup_password_fields":{const e={text:u?.text,subText:u?.subText,placeholderText:u?.placeholderText,subPlaceholderText:u?.subPlaceholderText,validationText:u?.validationText},r=Object.keys(e),o=Zht(e,D,r,$),{state:n,gap:i,...s}=Xht(a?.props,S,$);return ot(lht,{gap:i,inputProps:s,validations:w||[],htmlElementId:t,validationState:n,overridesProperties:o,configurationItemInfo:K})}case"stepper":{const e=Xht(A,S,$),r=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{},a={title:r?.title,subText:r?.subText},i=Object.keys(a),{title:s,subText:l}=Zht(a,D,i,t);return{...n,...Xht(o?.props,S,t),title:s?.text||"",subText:l?.text||""}});return ot(xht,{...e,items:r||[],isMobile:v,moleculeId:t,configurationItemInfo:K})}case"checklist":{const e=Xht(A,S,$)||{},r=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{};switch(e.type){case"checklist_item":{const a={label:r?.label,objectState:r?.objectState},i=Object.keys(a),s=Zht(a,D,i,t),l=Xht(o?.props,S,t)||{},c=s.label?.text||"",u=!!s.objectState?.pmiObjectId;return{...n,...l,type:"checklist_item",label:c,textColor:l.textColor||"#000",fontSize:l.fontSize||"14px",fontFamily:l.fontFamily||"inherit",fontWeight:l.fontWeight||"normal",textAlign:l.textAlign||"left",isSystemDriven:u,disabled:u,interacted:R?.[e.id]?.interacted||"unchecked"}}case"divider_item":{const e=Xht(o?.props,S,t)||{};return{...n,...e,type:"divider_item"}}case"text_item":{const e={text:r?.text},a=Object.keys(e),i=Zht(e,D,a,t),s=Xht(o?.props,S,t)||{},l=i.text?.text||"";return{...n,...s,type:"text_item",text:l}}case"rich_text_item":{const e={text:r?.text},a=Object.keys(e),i=Zht(e,D,a,t),s=Xht(o?.props,S,t)||{},l=i.text?.text||r5e;return{...n,...s,type:"rich_text_item",text:l}}default:return{...n,type:e.type}}});return ot(prt,{...e,items:r||[],moleculeId:t,configurationItemInfo:K})}case"accordion":{const e=Xht(A,S,$),r=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{},a={text:r?.text,subText:r?.subText,bodyText:r?.bodyText},i=Object.keys(a),{text:s,subText:l,bodyText:c}=Zht(a,D,i,t);return{...n,...Xht(o?.props,S,t),text:s?.text||"",subText:l?.text||"",bodyText:c?.text||""}});return ot(ort,{...e,items:r||[],moleculeId:t,configurationItemInfo:K})}case"menu":{const e={text:u?.text,disabled:u?.disabled},r=Object.keys(e),{text:o,disabled:n}=Zht(e,D,r,$),a=Xht(A,S,$),i=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{},a={disabled:r&&"disabled"in r?r.disabled:void 0,text:r&&"text"in r?r.text:void 0,link:r&&"link"in r?r.link:void 0},i=Object.keys(a),{text:s,disabled:l,link:c}=Zht(a,D,i,t),u=Xht(o?.props,S,t);return{...n,...u,disabled:R?.[e.id]?R?.[e.id]?.disabled:l?.value||u?.disabled||!1,text:s?.text||"Menu Item",link:c}});return ot(tht,{...a,items:i||[],moleculeId:t,buttonText:o?.text||"Open Menu",configurationItemInfo:K,buttonDisabled:R?.[t]?R?.[t]?.disabled:n?.value||a?.disabled||!1})}case"tabs":{const e=Xht(A,S,$),r=l?.map(e=>{const t=M===e.id,{properties:r,config:o}=e||{},n={label:r?.label,link:r?.link},a=Object.keys(n),{label:i,link:s}=Zht(n,D,a,t);return{...Xht(o?.props,S,t),id:e.id,tabKey:e9e(s)?G7e($7e,s?.internalLink):void 0,label:i?.text||"",link:s}}),o=c?.tabs.map(e=>{const{text:t,...r}=e;return{...r,label:t||""}}),n=Boolean(e?.isTabsSystemDerived),a=n?o:r,i=c?.activeTabKey||a?.[0]?.tabKey||"";return ot(kht,{...e,items:a||[],isMobile:v,moleculeId:t,activeTabKey:i,configurationItemInfo:K,onTabChange:_?void 0:({newTabKey:e,link:t})=>{n?c?.onTabChange?.(e):e9e(t)?O?.({link:t?.internalLink||""}):Q7e(t?.externalLink)}})}case"divider":{const e=Xht(A,S,$);return ot(dpt,{moleculeId:t,configurationItemInfo:K,...e})}case"link":{const e={text:u?.text,link:u?.link},r=Object.keys(e),{text:o,link:n}=Zht(e,D,r,$),a=n,i=Xht(A,S,$);return ot(Jpt,{moleculeId:t,...i,link:a,type:a?.type,src:Y?void 0:n9e(a,b)||"",text:o?.text||"",disabled:i?.disabled||H,configurationItemInfo:K})}case"data_driven_link":{const e={text:u?.text},r=Object.keys(e),{text:o}=Zht(e,D,r,$),n=Xht(A,S,$);return ot(Jpt,{moleculeId:t,...n,text:o?.text||"",sourceDataModelField:B,disabled:n?.disabled||H,configurationItemInfo:K})}case"video":{const e={video:u?.video,coverImage:u?.coverImage},r=Object.keys(e),{video:o,coverImage:n}=Zht(e,D,r,$),a=Xht(A,S,$);return ot(Mht,{...a,moleculeId:t,poster:n?.imageFile?.url,src:o?.videoSource??o?.videoFile?.url??"",configurationItemInfo:K})}case"badge":{const e=Xht(A,S,$);return ot(irt,{...e,configurationItemInfo:K})}case"alert":{const e={text:u?.text,subText:u?.subText},t=Object.keys(e),{text:r,subText:o}=Zht(e,D,t,$),n=Xht(A,S,$);return ot(nrt,{text:r?.text||"",subText:o?.text||"",...n,configurationItemInfo:K})}case"chip":{const e={text:u?.text},t=Object.keys(e),{text:r}=Zht(e,D,t,$),o=Xht(A,S,$);return ot(hrt,{text:r?.text||"",...o,configurationItemInfo:K})}case"email_display_field":case"email_input_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=Zht(e,D,t,$),l=Xht(A,S,$);return ot(Qpt,{name:L,text:o?.text||"",placeholderText:n?.text||"",sourceDataModelField:B,required:a?.value,isDisplayOnly:"email_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,...l,configurationItemInfo:K})}case"phone_number_display_field":case"phone_number_input_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=Zht(e,D,t,$),l=Xht(A,S,$);return ot(fht,{name:L,text:o?.text||"",required:a?.value,requiredErrorText:i?.text,validationErrorText:s?.text,placeholderText:n?.text||"",sourceDataModelField:B,isDisplayOnly:"phone_number_display_field"===r,...l,configurationItemInfo:K})}case"numeric_display_field":case"numeric_input_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=Zht(e,D,t,$),l=Xht(A,S,$);return ot(nht,{name:L,text:o?.text||"",required:a?.value,isDisplayOnly:"numeric_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,placeholderText:n?.text||"",sourceDataModelField:B,...l,configurationItemInfo:K})}case"currency_display_field":case"currency_input_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=Zht(e,D,t,$),l=Xht(A,S,$);return ot(vrt,{name:L,text:o?.text||"",required:a?.value,isDisplayOnly:"currency_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,placeholderText:n?.text||"",sourceDataModelField:B,...l,configurationItemInfo:K})}case"basic_text_display_field":case"basic_text_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=Zht(e,D,t,$),l=Xht(A,S,$);return ot(crt,{name:L,text:o?.text||"",required:a?.value,isDisplayOnly:"basic_text_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,placeholderText:n?.text||"",sourceDataModelField:B,...l,configurationItemInfo:K})}case"rating_display_field":case"rating":{const e={text:u?.text,dataCapture:u?.dataCapture,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,required:n,requiredErrorText:a,validationErrorText:i}=Zht(e,D,t,$),s=Xht(A,S,$);return ot(mht,{name:L,text:o?.text||"",required:n?.value,requiredErrorText:a?.text,validationErrorText:i?.text,sourceDataModelField:B,isDisplayOnly:"rating_display_field"===r,...s,configurationItemInfo:K})}case"switch_display_field":case"switch":{const e={text:u?.text,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},o=Object.keys(e),{text:n,required:a,requiredErrorText:i,validationErrorText:s}=Zht(e,D,o,$),l=Xht(A,S,$);return ot(wht,{name:L,moleculeId:t,text:n?.text||"",required:a?.value,isDisplayOnly:"switch_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,sourceDataModelField:B,...l,configurationItemInfo:K})}case"slider_display_field":case"slider":{const e={text:u?.text,required:u?.required,placeholderText:u?.placeholderText,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,required:n,requiredErrorText:a,validationErrorText:i,placeholderText:s}=Zht(e,D,t,$),l=Xht(A,S,$);return ot(ght,{name:L,text:o?.text||"",required:n?.value,isDisplayOnly:"slider_display_field"===r,requiredErrorText:a?.text,validationErrorText:i?.text,placeholderText:s?.text,sourceDataModelField:B,...l,configurationItemInfo:K})}case"date_display_field":case"date_picker":{const e={text:u?.text,required:u?.required,placeholderText:u?.placeholderText,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},o=Object.keys(e),{text:n,required:a,placeholderText:i,requiredErrorText:s,validationErrorText:l}=Zht(e,D,o,$),c=Xht(A,S,$);return ot(Tat,{dateAdapter:jnt,children:ot(upt,{moleculeId:t,name:L,text:n?.text||"",required:a?.value,placeholderText:i?.text||"",isDisplayOnly:"date_display_field"===r,requiredErrorText:s?.text,validationErrorText:l?.text,sourceDataModelField:B,...c,configurationItemInfo:K})})}case"time_picker_display":case"time_picker":{const e={text:u?.text,placeholderText:u?.placeholderText,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText,required:u?.required},t=Object.keys(e),{text:o,placeholderText:n,requiredErrorText:a,validationErrorText:i,required:s}=Zht(e,D,t,$),l=Xht(A,S,$);return ot(Tat,{dateAdapter:jnt,children:ot(Cht,{...l,name:L,text:o?.text||"",placeholderText:n?.text||"",required:s?.value,requiredErrorText:a?.text,validationErrorText:i?.text,isDisplayOnly:"time_picker_display"===r,sourceDataModelField:B,configurationItemInfo:K})})}case"select_display_field":case"select":{const e={text:u?.text,required:u?.required,placeholderText:u?.placeholderText,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,required:n,placeholderText:a,requiredErrorText:i,validationErrorText:s}=Zht(e,D,t,$),l=Xht(A,S,$),c="select_display_field"===r;return ot(yht,{name:L,text:o?.text||"",required:n?.value,isDisplayOnly:c,predefinedValue:V,placeholderText:a?.text||"",requiredErrorText:i?.text,validationErrorText:s?.text,sourceDataModelField:B,...l,configurationItemInfo:K})}case"image":{const e={image:u?.image,link:u?.link},r=Object.keys(e),{image:o,link:n}=Zht(e,D,r,$),a=Xht(A,S,$);return ot(ppt,{...a,src:o?.imageSource||o?.imageFile?.url||o?.imageFile?.id||"",onClick:n?()=>e9e(n)?O?.({link:n?.internalLink||""}):Q7e(n?.externalLink):void 0,moleculeId:t,configurationItemInfo:K,properties:{image:o,link:n}})}case"button":{const e={text:u?.text,action:u?.action},r=Object.keys(e),{text:o,action:n}=Zht(e,D,r,$),a=Xht(A,S,$);return ot(eKe,{moleculeId:t,text:o?.text||"",sourceDataModelField:B,...a,disabled:a?.disabled||H,configurationItemInfo:K,properties:{text:o,action:n}})}case"avatar":{const e=Xht(A,S,$);return ot(art,{...e,sourceDataModelField:B,configurationItemInfo:K})}case"drawer":{const e={text:u?.text,disabled:u?.disabled},r=Object.keys(e),{text:o,disabled:n}=Zht(e,D,r,$),a=Xht(A,S,$),i=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{};let a={},i=[];switch(e.type){case"menu_item":{const e=r;a={disabled:e?.disabled,text:e?.text,link:e?.link},i=Object.keys(a);break}case"text_item":{const e=r;a={text:e?.text},i=Object.keys(a);break}case"rich_text_item":{const e=r;a={text:e?.text},i=Object.keys(a);break}case"image_item":{const e=r;a={image:e?.image,alt:e?.alt,link:e?.link},i=Object.keys(a);break}default:a={},i=[]}const s=Zht(a,D,i,t),l=Xht(o?.props,S,t),c={...n,...l};switch(e.type){case"menu_item":return{...c,disabled:R?.[e.id]?R?.[e.id]?.disabled:s?.disabled?.value||l?.disabled||!1,text:s?.text?.text||"Menu Item",link:s?.link,sx:l?.sx||c.sx};case"text_item":return{...c,text:s?.text?.text||""};case"rich_text_item":return{...c,text:s?.text?.text||r5e};case"image_item":{const e=s?.image?.imageSource||s?.image?.imageFile?.url||"";return{...c,src:e,alt:s?.alt?.text||"Drawer image",link:s?.link}}default:return c}});return ot(Kpt,{...a,items:i||[],moleculeId:t,buttonText:o?.text||a?.buttonText,buttonDisabled:R?.[t]?R?.[t]?.disabled:n?.value||a?.disabled||!1,configurationItemInfo:K})}case"speed_dial":{const e=Xht(A,S,$),r=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{},a={link:r?.link,text:r?.text},i=Object.keys(a),s=Zht(a,D,i,t),l=Xht(o?.props,S,t);return{...n,config:{props:{...o?.props,...l,tooltipText:l?.tooltipText||""}},properties:{link:s?.link||r?.link,text:s?.text||r?.text}}});return ot(vht,{...e,items:r||[],moleculeId:t,configurationItemInfo:K})}case"checkbox":case"checkbox_display":{const e={label:u?.label,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},o=Object.keys(e),{label:n,required:a,requiredErrorText:i,validationErrorText:s}=Zht(e,D,o,$),l=Xht(A,S,$);return ot(drt,{name:L,moleculeId:t,label:n?.text||"",required:a?.value,requiredErrorText:i?.text,validationErrorText:s?.text,sourceDataModelField:B,isDisplayOnly:"checkbox_display"===r,...l,configurationItemInfo:K})}case"binary_radio_buttons":case"binary_radio_buttons_display":{const e={confirmText:u?.confirmText,rejectText:u?.rejectText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},o=Object.keys(e),{confirmText:n,rejectText:a,required:i,requiredErrorText:s,validationErrorText:l}=Zht(e,D,o,$),c=Xht(A,S,$);return ot(urt,{name:L,moleculeId:t,confirmText:n?.text||"Yes",rejectText:a?.text||"No",required:i?.value,requiredErrorText:s?.text,validationErrorText:l?.text,sourceDataModelField:B,isDisplayOnly:"binary_radio_buttons_display"===r,...c,configurationItemInfo:K})}case"date_calendar":case"date_calendar_display":{const e={required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{required:o,requiredErrorText:n,validationErrorText:a}=Zht(e,D,t,$),i=Xht(A,S,$);return ot(Hst,{...i,name:L,required:o?.value,requiredErrorText:n?.text,validationErrorText:a?.text,isDisplayOnly:"date_calendar_display"===r,sourceDataModelField:B,configurationItemInfo:K})}default:return ot(rt,{children:"There is no such type of molecule yet."})}})()},Jht=({nestedPathSegments:t})=>{const{localStateObject:r}=IC(),o=dt();return e.useMemo(()=>{if(o?.itemDataByDmfId)return o.itemDataByDmfId;const e=(e=>{if(null!=e){if("object"==typeof e&&!Array.isArray(e)&&"viewType"in e&&"data"in e){const t=e.data;if(null==t)return;return t}return e}})(r);return void 0!==e?0===t.length||Array.isArray(e)?e:jGe(e,t):void 0},[o?.itemDataByDmfId,r,t])},eft=e=>"container"===e.instance&&"empty_state"===e.type,tft=e=>{if("container"!==e.instance)return;const t=e;return t.replicatorFieldId||t.config?.props?.replicatorFieldId},rft=(e,t)=>{if(!e)return!0;if(Array.isArray(e))return 0===e.length;return(e=>null==e||Array.isArray(e)&&0===e.length||"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length)(e[t])},oft=e.memo(({item:t,tabsProps:r,formData:o,setFormData:n,isMobile:a,parentId:i,nestedPathSegments:s=[],parentStyleVariantConfig:l,parentContainerWithVariantsId:c,parentContainerActiveVariant:u})=>{const d=Ut(),{organismMetadata:p}=IC(),h="items"in t?t.items:void 0,f=(({items:t})=>{const{stateConfig:r}=WC(),{localStateObject:o}=IC(),n=o||r;return e.useMemo(()=>t&&0!==t.length?t.filter(e=>{const t=e.config?.props?.visible??!0,r=n?.[e.id]?.visible??!0;return t&&r}):[],[t,n])})({items:h}),{filteredItems:m}=(({containerItems:t,visibleItems:r,nestedPathSegments:o})=>{const{isLoadingData:n,isEmptyDataState:a,forceEmptyStatePreview:i,previewingEmptyStates:s,isConfigurationMode:l}=IC(),c=Jht({nestedPathSegments:o});return e.useMemo(()=>{if(!t||0===t.length)return{filteredItems:r,showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1};const e=t.filter(eft);if(0===e.length)return{filteredItems:r,showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1};const o=s&&s.length>0;if(l&&!i&&!o)return{filteredItems:r,showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1};if(n&&!i&&!o)return{filteredItems:r.filter(e=>!eft(e)),showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1};const u=new Set;let d=!1;return e.forEach(e=>{const t=tft(e);i||(t?s?.includes(t):s?.includes("__organism__"))?t?u.add(t):d=!0:l||(t?rft(c,t)&&u.add(t):a&&(d=!0))}),d||0!==u.size?{filteredItems:r.filter(e=>{if(eft(e)){const t=tft(e);return t?u.has(t):d}return!1}),showingEmptyStateForFields:u,showOrganismLevelEmptyState:d}:{filteredItems:r.filter(e=>!eft(e)),showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1}},[t,r,c,n,a,i,s,l])})({containerItems:h,visibleItems:f,nestedPathSegments:s});if("molecule"===t.instance)return ot(Yht,{additionalInfo:`molecule: ${t.id}`,children:ot(Qht,{...t,form:d,isMobile:a,formData:o,parentId:i,tabsProps:r,setFormData:n,metadata:{...t.metadata,stateListenerId:p?.stateListenerId||t.id},parentStyleVariantConfig:l,parentContainerWithVariantsId:c,parentContainerActiveVariant:u})});const y=!(!h||!h.length),g="form"===t.type&&t.config.props?.activeChildrenIds||[];return y?g.length?ot(Yht,{additionalInfo:`form: ${t.id}`,children:ot(hft,{item:t,activeChildrenIds:g,formData:o,setFormData:n,isMobile:a})}):ot(Yht,{additionalInfo:`container: ${t.id}`,children:ot(dft,{...t,isMobile:a,nestedPathSegments:s,parentStyleVariantConfig:l,parentContainerWithVariantsId:c,parentContainerActiveVariant:u,config:t.config?{...t.config,props:t.config.props||{},wide:t.config.wide||{},compact:t.config.compact||{}}:{props:{},wide:{},compact:{}},children:m?.map(e=>ot(oft,{item:e,parentId:e.id,formData:o,setFormData:n,isMobile:a,tabsProps:r,nestedPathSegments:s},e.id))})}):null}),nft=({order:t=0,id:r,formStepStyles:o,containerProps:n={hasOwnButton:!1}})=>{const a=Ut(),[i,s]=e.useState({}),{formId:l,submitHandler:c,isFormInEditMode:u,organismMetadata:d,organismInfo:p}=IC(),{groupStepItemsByStepContainer:h}=IC();Object.keys(d?.popupPayload??{})[0];const{currentStep:f,canGoToNextStep:m,canGoToPrevStep:y,goToNextStep:g,goToPrevStep:v,reset:x,setStep:b}=Xr(),w=h(),{submitForm:k}=FGe(),{forms:_}=ct(),C=t+1,M=w.get(r)||[];return f!==C?null:ot("div",{style:o,children:nt(rt,{children:[M.map(e=>ot(oft,{item:e,setFormData:s,formData:i},e.id)),(!n?.hasOwnButton||d?.isFormInsidePopUp)&&u&&nt("div",{style:{display:"flex",gap:"16px"},children:[ot(eKe,{text:y?"Back":"Cancel",variant:"outlined",onClick:()=>{y?v():(x(),b(1))}}),ot(eKe,{text:m?"Next":"Submit",variant:"contained",onClick:async()=>{const e=await a.trigger();if(!e)return void F6e({message:"Please fill all required fields",type:"error"});if(m)return void g();const t=a.getValues();if(e&&l){const e={formId:l,data:t,pmiObjectId:p?.pmiObjectId};c?await c(e):_?.submit&&await k(e)}}})]})]})})},aft=e=>Object.entries(e).reduce((e,[t,r])=>(e[t]=(e=>e&&"object"==typeof e&&"value"in e&&!Array.isArray(e)?e.value:e)(r),e),{}),ift=(e,t)=>{if(!e?.enabled||!e.sourceDataModelFieldId)return null;if(!t)return null;const r=t[e.sourceDataModelFieldId];if(null==r)return null;let o=null;if("string"==typeof r)o=r;else if("object"==typeof r)if("id"in r&&"string"==typeof r.id)o=r.id;else if("value"in r){const e=r.value;"string"==typeof e?o=e:"object"==typeof e&&e&&"id"in e&&(o=e.id)}return o},sft=(e,t,r)=>{if(!e)return{};if(t){const o=e[t];if(o&&"object"==typeof o&&r in o){const e=o[r];if(e&&"object"==typeof e){const{containerStyle:t}=e;return t&&"object"==typeof t?t:e}}}const o=e[r];if(o&&"object"==typeof o){const{containerStyle:e}=o;return e&&"object"==typeof e?e:o}return{}},lft=e.memo(({containerId:e,replicatorFieldId:t,nestedPathSegments:r=[],children:o,properties:n,config:a,renderWrapper:i})=>{const{localStateObject:s,formId:l,isLoadingData:c}=IC(),u=dt(),d=LC(),p=n?.styleVariantConfig||a?.styleVariantConfig;if(Boolean(l&&d)&&d){const{fieldArrayMethods:{fields:n}}=d;return ot(rt,{children:n.map((n,a)=>{const s=[...r,{dmfId:t||"default",index:a}],l=n,c=ift(p,l),u={containerId:e||`replicator-${t||"default"}-${a}`,nestedPathSegments:s,itemIndex:a,itemDataByDmfId:l,rawItemDataByDmfId:l,activeVariant:c},d=i?i(a,o,c):o;return ot("div",{"data-replicator-instance":`${t||"default"}-${a}`,children:ot(pt,{value:u,children:d})},n.id)})})}if(c)return ot(rt,{children:Array.from({length:3}).map((n,a)=>{const s=[...r,{dmfId:t||"default",index:a}];return ot(pt,{value:{containerId:e||`replicator-${t||"default"}-${a}`,nestedPathSegments:s,itemIndex:a,itemDataByDmfId:{},rawItemDataByDmfId:{},activeVariant:null},children:i?i(a,o,null):o},`${t||"default"}-loading-${a}`)})});const h=s||{},f=u?.itemDataByDmfId?u.itemDataByDmfId:jGe(h,r),m=t?f?.[t]:f;if(!m||"object"!=typeof m){const n=t?[...r,{dmfId:t}]:r;return ot(pt,{value:{containerId:e||`replicator-${t||"default"}`,nestedPathSegments:n,itemDataByDmfId:{},activeVariant:null},children:i?i(void 0,o,null):o})}if(Array.isArray(m))return ot(rt,{children:m.map((n,a)=>{const s=[...r,{dmfId:t||"default",index:a}],l=aft(n),c=ift(p,n);return ot(pt,{value:{containerId:e||`replicator-${t||"default"}-${a}`,nestedPathSegments:s,itemIndex:a,itemDataByDmfId:l,rawItemDataByDmfId:n,activeVariant:c},children:i?i(a,o,c):o},`${t||"default"}-${a}`)})});const y=t?[...r,{dmfId:t}]:r,g=aft(m),v=ift(p,m);return ot(pt,{value:{containerId:e||`replicator-${t||"default"}`,nestedPathSegments:y,itemDataByDmfId:g,rawItemDataByDmfId:m,activeVariant:v},children:i?i(void 0,o,v):o})}),cft=({replicatorFieldId:t,nestedPathSegments:r=[],minInstances:o=1,maxInstances:n=50,children:a})=>{const{control:i,getValues:s}=Ut(),c=$C(),{prefillData:u}=IC(),d=e.useRef(!1),p=r.map(e=>void 0!==e.index?`${e.dmfId}.${e.index}`:e.dmfId).filter(Boolean).join(".");const h=p?`${p}.${t}`:t,f=function(e){const t=Ut(),{control:r=t.control,name:o,keyName:n="id",shouldUnregister:a,rules:i}=e,[s,c]=l.default.useState(r._getFieldArray(o)),u=l.default.useRef(r._getFieldArray(o).map(Lr)),d=l.default.useRef(s),p=l.default.useRef(o),h=l.default.useRef(!1);p.current=o,d.current=s,r._names.array.add(o),i&&r.register(o,i),Yt(()=>r._subjects.array.subscribe({next:({values:e,name:t})=>{if(t===p.current||!t){const t=Dt(e,p.current);Array.isArray(t)&&(c(t),u.current=t.map(Lr))}}}).unsubscribe,[r]);const f=l.default.useCallback(e=>{h.current=!0,r._setFieldArray(o,e)},[r,o]);return l.default.useEffect(()=>{if(r._state.action=!1,Pr(o,r._names)&&r._subjects.state.next({...r._formState}),h.current&&(!Sr(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!Sr(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([o]).then(e=>{const t=Dt(e.errors,o),n=Dt(r._formState.errors,o);(n?!t&&n.type||t&&(n.type!==t.type||n.message!==t.message):t&&t.type)&&(t?Pt(r._formState.errors,o,t):pr(r._formState.errors,o),r._subjects.state.next({errors:r._formState.errors}))});else{const e=Dt(r._fields,o);!e||!e._f||Sr(r._options.reValidateMode).isOnSubmit&&Sr(r._options.mode).isOnSubmit||Fr(e,r._names.disabled,r._formValues,r._options.criteriaMode===At,r._options.shouldUseNativeValidation,!0).then(e=>!ar(e)&&r._subjects.state.next({errors:Tr(r._formState.errors,e,o)}))}r._subjects.state.next({name:o,values:kt(r._formValues)}),r._names.focus&&Er(r._fields,(e,t)=>{if(r._names.focus&&t.startsWith(r._names.focus)&&e.focus)return e.focus(),1}),r._names.focus="",r._setValid(),h.current=!1},[s,o,r]),l.default.useEffect(()=>(!Dt(r._formValues,o)&&r._setFieldArray(o),()=>{r._options.shouldUnregister||a?r.unregister(o):((e,t)=>{const o=Dt(r._fields,e);o&&o._f&&(o._f.mount=t)})(o,!1)}),[o,r,n,a]),{swap:l.default.useCallback((e,t)=>{const n=r._getFieldArray(o);Gr(n,e,t),Gr(u.current,e,t),f(n),c(n),r._setFieldArray(o,n,Gr,{argA:e,argB:t},!1)},[f,o,r]),move:l.default.useCallback((e,t)=>{const n=r._getFieldArray(o);qr(n,e,t),qr(u.current,e,t),f(n),c(n),r._setFieldArray(o,n,qr,{argA:e,argB:t},!1)},[f,o,r]),prepend:l.default.useCallback((e,t)=>{const n=tr(kt(e)),a=Wr(r._getFieldArray(o),n);r._names.focus=Br(o,0,t),u.current=Wr(u.current,n.map(Lr)),f(a),c(a),r._setFieldArray(o,a,Wr,{argA:$r(e)})},[f,o,r]),append:l.default.useCallback((e,t)=>{const n=tr(kt(e)),a=Vr(r._getFieldArray(o),n);r._names.focus=Br(o,a.length-1,t),u.current=Vr(u.current,n.map(Lr)),f(a),c(a),r._setFieldArray(o,a,Vr,{argA:$r(e)})},[f,o,r]),remove:l.default.useCallback(e=>{const t=Ur(r._getFieldArray(o),e);u.current=Ur(u.current,e),f(t),c(t),!Array.isArray(Dt(r._fields,o))&&Pt(r._fields,o,void 0),r._setFieldArray(o,t,Ur,{argA:e})},[f,o,r]),insert:l.default.useCallback((e,t,n)=>{const a=tr(kt(t)),i=Hr(r._getFieldArray(o),e,a);r._names.focus=Br(o,e,n),u.current=Hr(u.current,e,a.map(Lr)),f(i),c(i),r._setFieldArray(o,i,Hr,{argA:e,argB:$r(t)})},[f,o,r]),update:l.default.useCallback((e,t)=>{const n=kt(t),a=Kr(r._getFieldArray(o),e,n);u.current=[...a].map((t,r)=>t&&r!==e?u.current[r]:Lr()),f(a),c([...a]),r._setFieldArray(o,a,Kr,{argA:e,argB:n},!0,!1)},[f,o,r]),replace:l.default.useCallback(e=>{const t=tr(kt(e));u.current=t.map(Lr),f([...t]),c([...t]),r._setFieldArray(o,[...t],e=>e,{},!0,!1)},[f,o,r]),fields:l.default.useMemo(()=>s.map((e,t)=>({...e,[n]:u.current[t]||Lr()})),[s,n])}}({control:i,name:h}),{fields:m,append:y,replace:g}=f,v=u?.[t],x=Array.isArray(v)&&v.length>0;return e.useEffect(()=>{if(d.current)return;d.current=!0;const e=s(h),t=Array.isArray(e)&&e.length>0;if(!(x||t||m.length>0)&&o>0){Array.from({length:o},()=>({})).forEach(e=>{y(e,{shouldFocus:!1})})}},[]),e.useEffect(()=>{x&&m.length!==v.length&&g(v)},[x,v,m.length,g]),e.useEffect(()=>{if(c)return c.register({replicatorFieldId:t,fieldArrayName:h,fieldArrayMethods:f,minInstances:o,maxInstances:n}),()=>{c.unregister(t)}},[c,t,h,f,o,n]),ot(BC,{replicatorFieldId:t,fieldArrayName:h,fieldArrayMethods:f,minInstances:o,maxInstances:n,children:a})},uft={dots:!0,infinite:!1,autoplay:!1,autoplaySpeed:5e3,arrows:!0,slidesToShow:1,slidesToScroll:1,adaptiveHeight:!0,swipeToSlide:!0},dft=e.memo(({id:t,type:r,name:o,config:n,children:a,metadata:i,isMobile:s,properties:l,nestedPathSegments:c=[],replicatorFieldId:u,parentStyleVariantConfig:d,parentContainerWithVariantsId:p,parentContainerActiveVariant:h})=>{const f=Ge(),{props:m,wide:y,compact:g}=n||{},v=u||m?.replicatorFieldId,{isConfigurationMode:x,onConfigurationItemClicked:b,selectedConfigurationItemId:w,currentStyleProperties:k,currentContentProperties:_,formId:C,localState:M}=IC(),S=dt(),{activeVariant:D,containerId:O}=S,P=Ut(),E=Boolean(C&&P),j=e.useMemo(()=>{if("replicator"===r)return;const e=l?.styleVariantConfig,t=e&&"object"==typeof e&&"data"in e?e.data:e;return t?.enabled&&t?.sourceDataModelFieldId?t:void 0},[r,l]),T=e.useMemo(()=>{return j?.sourceDataModelFieldId&&E?(e=S.nestedPathSegments||c,t=j.sourceDataModelFieldId,e&&0!==e.length?[...e.map(e=>void 0!==e.index?`${e.dmfId}.${e.index}`:e.dmfId),t].filter(Boolean).join("."):t):"";var e,t},[j?.sourceDataModelFieldId,E,S.nestedPathSegments,c]),N=T?P?.watch?.(T):void 0,R=e.useMemo(()=>{if(!j?.sourceDataModelFieldId)return null;const e=j.sourceDataModelFieldId;if(E&&void 0!==N){const t="string"==typeof N||"number"==typeof N?{id:String(N),value:N}:N,r=ift(j,{[e]:t});if(r)return r}const t=M?.[e];if(void 0!==t){const r=ift(j,{[e]:t});if(r)return r}const r=S.rawItemDataByDmfId?.[e],o=S.getDmfValue(e),n=r??o;if(void 0!==n){const t=ift(j,{[e]:n});if(t)return t}return null},[j,S,E,M,N]),I=d,F=R??(h??D??null),A=(j&&j.enabled?t:p)||O||null,z=e.useMemo(()=>{const r=j&&j.enabled,o=r?j:I,n=F,i=(r?t:p)||t;return void 0!==o||null!==n||void 0!==p?e.Children.map(a,t=>e.isValidElement(t)?e.cloneElement(t,{...t.props,parentStyleVariantConfig:o,parentContainerWithVariantsId:i,parentContainerActiveVariant:n}):t):a},[a,j,F,I,t,p]),L=w===t,B=L?{backgroundImage:_?.backgroundImage??l?.backgroundImage??{imageFile:{url:""}}}:l,{containerProps:V={},containerStyle:$={}}=y||{};let H={...$};const{containerProps:q={},containerStyle:W={}}=g||{};let U={...W};k&&L&&(U={...W,...k},H={...$,...k});const G=SC("xs"),K=s??G;let Y=K?U:H;if(F&&n){const e=sft(n,F,K?"compact":"wide");Object.keys(e).length>0&&(Y={...Y,...e})}const Z=K?q:V,X={...m,...Z,enableBackgroundImage:Y?.enableBackgroundImage},Q=e.useMemo(()=>({entityId:t,entityType:r,entityName:o,entity:"container",libraryEntityId:i?.containerLibraryId||void 0,activeStyleVariant:F,parentReplicatorWithVariants:A,parentStyleVariantConfig:j&&j.enabled?j:I}),[r,o,t,i,F,A,j,I]),J=x?{onClick:e=>{e&&e.stopPropagation(),b(Q,!1)},onDoubleClick:e=>{e?.stopPropagation(),b(Q,!0)}}:{},ee=`${t}.${K?"mobile":"desktop"}`,te=bo`