@epam/ai-dial-ui-kit 0.14.0-dev.30 → 0.14.0-dev.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./use-file-manager-tabs-CmpcHI2g.cjs"),Re=require("./Switch-CtdhpYik.cjs"),n=require("react/jsx-runtime"),h=require("react"),H=require("@tabler/icons-react"),se=require("classnames"),L=require("./DateCellRenderer-BdsPUuVy.cjs"),V=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-Dipy1Ih1.cjs"),F=require("./DateCellRenderer-BmzYCUIt.cjs"),w=require("./IconButton-BCbBgnzo.cjs"),qn=require("react-dom"),Ur=require("./editor-Ba3vCFHk.cjs"),ce=require("@floating-ui/react"),ne=require("./icon-DhjrDQ8I.cjs");function Zn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const gr=Zn(h),Be=({label:e,className:t,icon:r,selected:s,closable:a,onClick:i,onRemove:o})=>{const l=I.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",s?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return n.jsxs("div",{className:l,onClick:i,children:[n.jsx(L.DialIcon,{icon:r}),n.jsx(L.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(x.DialButton,{className:"p-0",iconAfter:n.jsx(H.IconX,{size:V.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},Jt=({label:e="Error",className:t})=>n.jsx(Be,{label:e,className:I.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var it=(e=>(e.Default="default",e.Compact="compact",e))(it||{});const Yn={[it.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[it.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},Xn=({title:e,value:t,description:r,variant:s=it.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:u,compareValues:d})=>{const f=Yn[s],g=c!==void 0?c:(l??0)>=0,p=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",f.container,o),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:f.title,children:e}),n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:p})]}):n.jsx("span",{className:f.title,children:e}),a?n.jsx(Jt,{className:"self-start"}):i?n.jsx(x.DialLoader,{fullWidth:!1,className:"self-start"}):d?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(L.DialEllipsisTooltip,{text:d[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:f.value,children:d[0].value})]}),n.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(L.DialEllipsisTooltip,{text:d[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:f.value,children:d[1].value})]})]}):n.jsx("span",{className:f.value,children:t}),!a&&!i&&f.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},er=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],Qn=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Jn=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},ut=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=er,className:l,titleClassName:c,valueClassName:u,inline:d,ariaLabel:f})=>{const g=e==null,p=!!(r||s||!g),m=Qn(g?0:e,t),v=Jn(m,o),b=i??(g?"—":e),y=f??(typeof a=="string"?a:void 0),C=r||s,N=r?n.jsx(Jt,{}):s?n.jsx(x.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",d?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),S=p?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":y,className:I.mergeClasses("w-full overflow-hidden rounded-sm",d?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!C&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:v}})}):null,D=n.jsx("span",{className:I.mergeClasses("dial-small-text text-primary",c),children:a});return d?n.jsxs("div",{className:I.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:D}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:S}),N]})]}):n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[D,N]}),S]})},Kr=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:u,contentClassName:d})=>{const f=s!==void 0,[g,p]=h.useState(a),m=o?!0:f?s:g,v=h.useId(),b=()=>{if(i)return;const y=!m;f||p(y),l?.(y)};return n.jsxs("div",{className:I.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":v,disabled:i||o,onClick:b,className:I.mergeClasses("flex w-full items-center gap-2 p-4 text-left",i?"cursor-not-allowed":"cursor-pointer",o&&"cursor-default",u),children:[!o&&n.jsx(L.DialIcon,{className:se("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(H.IconChevronRight,{size:V.DIAL_ICON_SIZE.SM})}),n.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&n.jsx("div",{id:v,role:"region",className:I.mergeClasses("px-4 pb-4",d),children:r})]})},es=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:u,isLoading:d,onBarClick:f,inline:g,barTitleClassName:p,barValueClassName:m,barClassName:v,barDescriptions:b,className:y})=>{const C=Object.entries(s),N=g?I.mergeClasses("text-secondary",p):p,S=i?"dial-tiny-text text-secondary":void 0,D=t?n.jsx(w.DialTooltip,{tooltip:t,children:e}):e,T=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],P="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary";return n.jsx(Kr,{title:D,description:r,defaultExpanded:c,nonCollapsible:u,className:y,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:d?n.jsx(x.DialLoader,{fullWidth:!1,className:"self-center"}):a?T.map(O=>{const E=O in s?s[O]:null,_=O in a?a[O]:null,R=typeof E=="number"&&typeof _=="number"?parseFloat((_-E).toFixed(3)):null,$=R!=null&&R!==0,U=$&&R>0,te=$?U?`+${R}`:String(R):null,B=b?.[O],k=n.jsx("span",{className:"dial-small-text text-secondary",children:O}),z=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[B?n.jsx(w.DialTooltip,{tooltip:B,children:k}):k,te!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",U?"bg-success text-success":"bg-error text-error"),children:te})]}),n.jsxs("div",{className:"flex flex-col gap-1.5 pl-2",children:[n.jsx(ut,{title:i?.[0],value:E,maxValue:o,colorMap:l,inline:g,titleClassName:S,className:v,ariaLabel:O}),n.jsx(ut,{title:i?.[1],value:_,maxValue:o,colorMap:l,inline:g,titleClassName:S,className:v,ariaLabel:`${O} compare`})]})]});return f?n.jsx("button",{type:"button",onClick:()=>f(O,E),className:I.mergeClasses("flex flex-col gap-1.5",P),children:z},O):n.jsx("div",{className:"flex flex-col gap-1.5",children:z},O)}):C.map(([O,E])=>{const _=n.jsx(ut,{title:O,value:E,maxValue:o,colorMap:l,inline:g,titleClassName:N,valueClassName:m,className:v}),j=f?n.jsx("button",{type:"button",onClick:()=>f(O,E),className:P,children:_}):_,R=b?.[O];return R?n.jsx(w.DialTooltip,{tooltip:R,triggerClassName:"flex flex-col",children:j},O):n.jsx(h.Fragment,{children:j},O)})})})},ts="#FF4E50",rs=(e,t)=>{let r=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=a)}),r},hr=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const u=rs(c,t);u>=0&&(r[u]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:ts,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,u)=>({from:c.from,to:c.to,color:c.color,count:r[u],ratio:i(r[u]),isZeroBucket:!1}));return[o,...l]},Wr=e=>e<=0?2:e%2===0?e:e+1,ns=e=>{const t=Wr(e);return[t,t/2,0]},Ot=e=>`${Math.round(e*100)/100}`,qr=(e,t)=>e===t?Ot(e):`${Ot(e)}-${Ot(t)}`,At=128,ss=(e,t)=>{const r=qr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},mr=(e,t,r,s,a)=>n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&n.jsx("strong",{children:e}),n.jsxs("span",{children:[t," out of ",r," ",s]}),n.jsx("span",{children:ss(a.from,a.to)})]}),as=({title:e,values:t,colorMap:r=er,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:u})=>{const d=hr(t,r),f=l?hr(l,r):void 0,g=t.length,p=l?.length??0,m=Math.max(g,p),v=Wr(m),b=ns(m),y=D=>D.map(T=>({...T,ratio:v>0?T.count/v:0})),C=y(d),N=f?y(f):void 0,S=(D,T,P,O)=>{if(D.count===0)return n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${D.ratio*100}%`}})});const E=O?{backgroundImage:`repeating-linear-gradient(135deg, ${D.color} 0px, ${D.color} 1px, transparent 1px, transparent 4px)`,borderColor:D.color}:{backgroundColor:D.color};return n.jsx(w.DialTooltip,{placement:"bottom",tooltip:T,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":P,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${D.ratio*100}%`,...E},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:D.count})})})};return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",o),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),i?n.jsx("div",{className:"flex items-center justify-center",style:{height:At},children:n.jsx(x.DialLoader,{fullWidth:!1})}):n.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[n.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:At},children:b.map((D,T)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${T/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:D},D))}),n.jsxs("div",{className:"relative min-w-0",children:[b.map((D,T)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${T/(b.length-1)*100}%`}},D)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:At},children:N?C.map((D,T)=>{const P=N[T],O=`${D.count} out of ${g} ${s}`,E=`${P.count} out of ${p} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[S(D,mr(c,D.count,g,s,D),O,!0),S(P,mr(u,P.count,p,s,P),E,!1)]},T)}):C.map((D,T)=>{const P=`${D.count} out of ${g} ${s}`;return D.count===0?n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${D.ratio*100}%`}})},T):n.jsx(w.DialTooltip,{placement:"bottom",tooltip:P,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":P,className:I.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${D.ratio*100}%`,backgroundColor:D.color},children:a&&D.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:D.count})})},T)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:C.map((D,T)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:qr(D.from,D.to)},T))})]})]})},is=({value:e,max:t=100,size:r=w.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const u=h.useId(),d=i??u,f=!!s?.label,g=f?s?.id??`${d}-label`:void 0,p=t>0?t:0,m=Number.isFinite(e)?e:0,v=Math.min(Math.max(m,0),p),b=p>0?v/p*100:0,y=n.jsx("div",{...c,id:d,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":p,"aria-labelledby":g,"aria-label":w.resolveAccessibleName(l,f?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===w.ElementSize.Small?"h-1":"h-2",o),children:n.jsx("div",{style:{width:`${b}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!f&&!a?y:n.jsxs("div",{className:"flex w-full flex-col gap-1",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(F.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),y]})},os=7,ls=2,cs=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var ft=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(ft||{});const ds=(e,t,r)=>e===t?"active":r<os||Math.abs(e-t)<=ls?"adjacent":"far",us=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=cs(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(w.DialIconButton,{icon:n.jsx(H.IconCaretLeftFilled,{size:V.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:w.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>r(e-1),"aria-label":"Previous page"}),n.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(i=>{const o=ds(i,e,t);return n.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":`Page ${i}`,"aria-current":i===e?"page":void 0,className:I.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",o===ft.Active&&"h-[8px] w-[32px]",o===ft.Adjacent&&"size-[8px]",o===ft.Far&&"size-[4px]")},i)})}),n.jsx(w.DialIconButton,{icon:n.jsx(H.IconCaretRightFilled,{size:V.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:w.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Gt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const u=h.useCallback(p=>{o?.(p.target.checked,t)},[o,t]),d=se("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${r||s?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",l),f=se("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx(H.IconMinus,{className:f,...V.BASE_ICON_PROPS}):r?n.jsx(H.IconCheck,{className:f,...V.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:d,htmlFor:t,"aria-description":c["aria-description"]||L.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(L.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:u,id:t,checked:r,"aria-checked":s?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:i,className:"invisible size-0"})]})};var De=(e=>(e.VALID="valid",e.ERROR="error",e))(De||{});const fs=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"border-accent-secondary text-primary";case De.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case De.VALID:return"border-primary text-primary";case De.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},ps=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-layer-4"}},gs=({step:e,index:t,currentStep:r,onChangeStep:s})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",i="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",o=()=>r===e.id&&e.status===De.ERROR?n.jsx(H.IconExclamationCircle,{stroke:2,size:V.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===De.VALID?n.jsx(H.IconCheck,{stroke:2,size:V.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:se(a,fs(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:se(i,ps(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},hs=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const i=e.findIndex(c=>c.id===t),o=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,o).every(c=>c.status===De.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(gs,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},_t=e=>(e.toString().split(".")[1]??"").length,ms=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:u,trackClassName:d,fillClassName:f,thumbClassName:g,labelsClassName:p,"aria-label":m,"aria-labelledby":v,...b})=>{const y=h.useRef(null),C=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),N=_t(s),S=l?l(e):e.toFixed(N),D=h.useCallback(E=>{const _=y.current;if(!_)return e;const j=_.getBoundingClientRect(),R=(E-j.left)/j.width,$=t+R*(r-t),U=_t(s),te=parseFloat((Math.round(($-t)/s)*s+t).toFixed(U));return Math.min(r,Math.max(t,te))},[t,r,s,e]),T=h.useCallback(E=>{a||(E.currentTarget.setPointerCapture(E.pointerId),c?.(D(E.clientX)))},[a,D,c]),P=h.useCallback(E=>{a||E.buttons===0||c?.(D(E.clientX))},[a,D,c]),O=h.useCallback(E=>{if(a)return;const _=_t(s),j=U=>parseFloat((Math.round((U-t)/s)*s+t).toFixed(_)),R=U=>Math.min(r,Math.max(t,U));let $=e;switch(E.key){case"ArrowRight":case"ArrowUp":$=R(j(e+s));break;case"ArrowLeft":case"ArrowDown":$=R(j(e-s));break;case"Home":$=t;break;case"End":$=r;break;default:return}E.preventDefault(),$!==e&&c?.($)},[a,e,s,t,r,c]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",u),...b,children:[i&&n.jsx(Re.DialLabel,{...i,htmlFor:b.id}),n.jsxs("div",{ref:y,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:T,onPointerMove:P,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",d)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",f),style:{width:`${C}%`}}),n.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":v,className:I.mergeClasses("dial-small-text absolute -translate-x-1/2 flex size-[38px] cursor-grab select-none items-center justify-center rounded-full bg-layer-3 text-primary shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",g),style:{left:`${C}%`},onKeyDown:O,children:S})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",p),children:o.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"flex-1 text-center",children:o[1]}),n.jsx("span",{children:o[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"ml-auto",children:o[1]})]})})]})},xs=({label:e,text:t,tooltip:r,children:s,postfix:a,className:i})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",s?"":"max-w-[200px]",i),children:[e&&n.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(w.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),Zr=h.createContext({dragDropManager:void 0});function Ne(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var xr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),br=function(){return Math.random().toString(36).substring(7).split("").join(".")},yr={INIT:"@@redux/INIT"+br(),REPLACE:"@@redux/REPLACE"+br()};function bs(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ys(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Cs(e))return"date";if(Ds(e))return"error";var r=vs(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function vs(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ds(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Cs(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ue(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=ys(e)),t}function Yr(e,t,r){var s;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ne(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(1):"Expected the enhancer to be a function. Instead, received: '"+Ue(r)+"'");return r(Yr)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(2):"Expected the root reducer to be a function. Instead, received: '"+Ue(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function u(){l===o&&(l=o.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(4):"Expected the listener to be a function. Instead, received: '"+Ue(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return u(),l.push(v),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,u();var C=l.indexOf(v);l.splice(C,1),o=null}}}function g(v){if(!bs(v))throw new Error(process.env.NODE_ENV==="production"?Ne(7):"Actions must be plain objects. Instead, the actual type was: '"+Ue(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ne(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,v)}finally{c=!1}for(var b=o=l,y=0;y<b.length;y++){var C=b[y];C()}return v}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(10):"Expected the nextReducer to be a function. Instead, received: '"+Ue(v));a=v,g({type:yr.REPLACE})}function m(){var v,b=f;return v={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?Ne(11):"Expected the observer to be an object. Instead, received: '"+Ue(C)+"'");function N(){C.next&&C.next(d())}N();var S=b(N);return{unsubscribe:S}}},v[xr]=function(){return this},v}return g({type:yr.INIT}),s={dispatch:g,subscribe:f,getState:d,replaceReducer:p},s[xr]=m,s}function K(e,t,...r){if(Ns()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;s=new Error(t.replace(/%s/g,function(){return r[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function Ns(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Is(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function Ss(e,t){return e.filter(r=>r!==t)}function Xr(e){return typeof e=="object"}function js(e,t){const r=new Map,s=i=>{r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((i,o)=>{i===1&&a.push(o)}),a}function Ts(e,t){return e.filter(r=>t.indexOf(r)>-1)}const tr="dnd-core/INIT_COORDS",vt="dnd-core/BEGIN_DRAG",rr="dnd-core/PUBLISH_DRAG_SOURCE",Dt="dnd-core/HOVER",Ct="dnd-core/DROP",Nt="dnd-core/END_DRAG";function vr(e,t){return{type:tr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const ws={type:tr,payload:{clientOffset:null,sourceClientOffset:null}};function Es(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(vr(i)),Os(r,l,c);const u=Rs(r,l);if(u==null){e.dispatch(ws);return}let d=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");As(o),d=o(u)}e.dispatch(vr(i,d));const g=c.getSource(u).beginDrag(l,u);if(g==null)return;_s(g),c.pinSource(u);const p=c.getSourceType(u);return{type:vt,payload:{itemType:p,item:g,sourceId:u,clientOffset:i||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function Os(e,t,r){K(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){K(r.getSource(s),"Expected sourceIds to be registered.")})}function As(e){K(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function _s(e){K(Xr(e),"Item must be an object.")}function Rs(e,t){let r=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){r=e[s];break}return r}function ks(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ps(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ks(e,a,r[a])})}return e}function Ls(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();Ms(s),zs(s).forEach((o,l)=>{const c=Fs(o,l,a,s),u={type:Ct,payload:{dropResult:Ps({},r,c)}};e.dispatch(u)})}}function Ms(e){K(e.isDragging(),"Cannot call drop while not dragging."),K(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Fs(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return Bs(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function Bs(e){K(typeof e>"u"||Xr(e),"Drop result must either be an object or undefined.")}function zs(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function $s(e){return function(){const r=e.getMonitor(),s=e.getRegistry();Hs(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Nt}}}function Hs(e){K(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ut(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Vs(e){return function(r,{clientOffset:s}={}){Gs(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return Ks(a,o,l),Us(a,i,o),Ws(a,i,o),{type:Dt,payload:{targetIds:a,clientOffset:s||null}}}}function Gs(e){K(Array.isArray(e),"Expected targetIds to be an array.")}function Us(e,t,r){K(t.isDragging(),"Cannot call hover while not dragging."),K(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];K(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);K(i,"Expected targetIds to be registered.")}}function Ks(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Ut(i,r)||e.splice(s,1)}}function Ws(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function qs(e){return function(){if(e.getMonitor().isDragging())return{type:rr}}}function Zs(e){return{beginDrag:Es(e),publishDragSource:qs(e),hover:Vs(e),drop:Ls(e),endDrag:$s(e)}}class Ys{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function s(i){return(...o)=>{const l=i.apply(t,o);typeof l<"u"&&r(l)}}const a=Zs(this);return Object.keys(a).reduce((i,o)=>{const l=a[o];return i[o]=s(l),i},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const s=this.store.getState().refCount>0;this.backend&&(s&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!s&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function Xs(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Qr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qs(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Qr(Xs(t,s),r)}function Js(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Qr(t,r)}const nt=[],nr=[];nt.__IS_NONE__=!0;nr.__IS_ALL__=!0;function ea(e,t){return e===nt?!1:e===nr||typeof t>"u"?!0:Ts(t,e).length>0}class ta{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;K(typeof t=="function","listener must be a function."),K(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const o=this.store.getState(),l=o.stateId;try{l===a||l===a+1&&!ea(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){K(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return K(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(K(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return Ut(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(K(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:s}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),i=this.getItemType();if(i&&!Ut(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const l=o.indexOf(t);return s?l===o.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Qs(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Js(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Dr=typeof global<"u"?global:self,Jr=Dr.MutationObserver||Dr.WebKitMutationObserver;function en(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function ra(e){let t=1;const r=new Jr(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const na=typeof Jr=="function"?ra:en;class sa{enqueueTask(t){const{queue:r,requestFlush:s}=this;r.length||(s(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let s=0,a=t.length-this.index;s<a;s++)t[s]=t[s+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=na(this.flush),this.requestErrorThrow=en(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class aa{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class ia{create(t){const r=this.freeTasks,s=r.length?r.pop():new aa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const tn=new sa,oa=new ia(tn.registerPendingError);function la(e){tn.enqueueTask(oa.create(e))}const sr="dnd-core/ADD_SOURCE",ar="dnd-core/ADD_TARGET",ir="dnd-core/REMOVE_SOURCE",It="dnd-core/REMOVE_TARGET";function ca(e){return{type:sr,payload:{sourceId:e}}}function da(e){return{type:ar,payload:{targetId:e}}}function ua(e){return{type:ir,payload:{sourceId:e}}}function fa(e){return{type:It,payload:{targetId:e}}}function pa(e){K(typeof e.canDrag=="function","Expected canDrag to be a function."),K(typeof e.beginDrag=="function","Expected beginDrag to be a function."),K(typeof e.endDrag=="function","Expected endDrag to be a function.")}function ga(e){K(typeof e.canDrop=="function","Expected canDrop to be a function."),K(typeof e.hover=="function","Expected hover to be a function."),K(typeof e.drop=="function","Expected beginDrag to be a function.")}function Kt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Kt(r,!1));return}K(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ie;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ie||(Ie={}));let ha=0;function ma(){return ha++}function xa(e){const t=ma().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Cr(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Nr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,i]}=r.next();if(i===t)return!0;s=!!a}while(!s);return!1}class ba{addSource(t,r){Kt(t),pa(r);const s=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(ca(s)),s}addTarget(t,r){Kt(t,!0),ga(r);const s=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(da(s)),s}containsHandler(t){return Nr(this.dragSources,t)||Nr(this.dropTargets,t)}getSource(t,r=!1){return K(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return K(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return K(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return K(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Cr(t)===Ie.SOURCE}isTargetId(t){return Cr(t)===Ie.TARGET}removeSource(t){K(this.getSource(t),"Expected an existing source."),this.store.dispatch(ua(t)),la(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){K(this.getTarget(t),"Expected an existing target."),this.store.dispatch(fa(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);K(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){K(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=xa(t);return this.types.set(a,r),t===Ie.SOURCE?this.dragSources.set(a,s):t===Ie.TARGET&&this.dropTargets.set(a,s),a}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const ya=(e,t)=>e===t;function va(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Da(e,t,r=ya){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!r(e[s],t[s]))return!1;return!0}function Ca(e=nt,t){switch(t.type){case Dt:break;case sr:case ar:case It:case ir:return nt;case vt:case rr:case Nt:case Ct:default:return nr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=js(r,s);if(!(a.length>0||!Da(r,s)))return nt;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function Na(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Na(e,a,r[a])})}return e}const Ir={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Sa(e=Ir,t){const{payload:r}=t;switch(t.type){case tr:case vt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Dt:return va(e.clientOffset,r.clientOffset)?e:Ia({},e,{clientOffset:r.clientOffset});case Nt:case Ct:return Ir;default:return e}}function ja(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ja(e,a,r[a])})}return e}const Ta={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function wa(e=Ta,t){const{payload:r}=t;switch(t.type){case vt:return Ke({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case rr:return Ke({},e,{isSourcePublic:!0});case Dt:return Ke({},e,{targetIds:r.targetIds});case It:return e.targetIds.indexOf(r.targetId)===-1?e:Ke({},e,{targetIds:Ss(e.targetIds,r.targetId)});case Ct:return Ke({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Nt:return Ke({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Ea(e=0,t){switch(t.type){case sr:case ar:return e+1;case ir:case It:return e-1;default:return e}}function Oa(e=0){return e+1}function Aa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Aa(e,a,r[a])})}return e}function Ra(e={},t){return{dirtyHandlerIds:Ca(e.dirtyHandlerIds,{type:t.type,payload:_a({},t.payload,{prevTargetIds:Is(e,"dragOperation.targetIds",[])})}),dragOffset:Sa(e.dragOffset,t),refCount:Ea(e.refCount,t),dragOperation:wa(e.dragOperation,t),stateId:Oa(e.stateId)}}function ka(e,t=void 0,r={},s=!1){const a=Pa(s),i=new ta(a,new ba(a)),o=new Ys(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function Pa(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Yr(Ra,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function La(e,t){if(e==null)return{};var r=Ma(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function Ma(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Sr=0;const pt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Fa=h.memo(function(t){var{children:r}=t,s=La(t,["children"]);const[a,i]=Ba(s);return h.useEffect(()=>{if(i){const o=rn();return++Sr,()=>{--Sr===0&&(o[pt]=null)}}},[]),n.jsx(Zr.Provider,{value:a,children:r})});function Ba(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=za(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function za(e,t=rn(),r,s){const a=t;return a[pt]||(a[pt]={dragDropManager:ka(e,t,r,s)}),a[pt]}function rn(){return typeof global<"u"?global:window}var Rt,jr;function $a(){return jr||(jr=1,Rt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,a,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(a=s;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=s;a--!==0;){var o=i[a];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Rt}var Ha=$a();const Va=x.getDefaultExportFromCjs(Ha),ze=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Ga(e,t,r){const[s,a]=h.useState(()=>t(e)),i=h.useCallback(()=>{const o=t(e);Va(s,o)||(a(o),r&&r())},[s,e,r]);return ze(i),[s,i]}function Ua(e,t,r){const[s,a]=Ga(e,t,r);return ze(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function nn(e,t,r){return Ua(t,e||(()=>({})),()=>r.reconnect())}function sn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function Ka(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function Wa(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let kt=!1,Pt=!1;class qa{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){K(!kt,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return kt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kt=!1}}isDragging(){if(!this.sourceId)return!1;K(!Pt,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Pt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pt=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Lt=!1;class Za{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;K(!Lt,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Lt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Lt=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function Ya(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Xa(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Wt(e,t,r,s){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<i.length;c++){const u=i[c];if(!l(u))return!1;const d=e[u],f=t[u];if(a=void 0,a===!1||a===void 0&&d!==f)return!1}return!0}function qt(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Qa(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Ja(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return Qa(s),ei(s,r?i=>e(i,r):e)}}function an(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Ja(s);t[r]=()=>a}}),t}function Tr(e,t){typeof e=="function"?e(t):e.current=t}function ei(e,t){const r=e.ref;return K(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:s=>{Tr(r,s),Tr(t,s)}}):h.cloneElement(e,{ref:t})}class ti{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Wt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Wt(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=an({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,qt(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,qt(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class ri{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Wt(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=an({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,qt(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Ye(){const{dragDropManager:e}=h.useContext(Zr);return K(e!=null,"Expected drag drop context"),e}function ni(e,t){const r=Ye(),s=h.useMemo(()=>new ti(r.getBackend()),[r]);return ze(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),ze(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function si(){const e=Ye();return h.useMemo(()=>new qa(e),[e])}class ai{beginDrag(){const t=this.spec,r=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(r):s={},s??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const s=this.spec,a=this.monitor,{isDragging:i}=s;return i?i(a):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,s=this.connector,{end:a}=t;a&&a(r.getItem(),r),s.reconnect()}constructor(t,r,s){this.spec=t,this.monitor=r,this.connector=s}}function ii(e,t,r){const s=h.useMemo(()=>new ai(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function oi(e){return h.useMemo(()=>{const t=e.type;return K(t!=null,"spec.type must be defined"),t},[e])}function li(e,t,r){const s=Ye(),a=ii(e,t,r),i=oi(e);ze(function(){if(i!=null){const[l,c]=Xa(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function ci(e,t){const r=sn(e,t);K(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const s=si(),a=ni(r.options,r.previewOptions);return li(r,s,a),[nn(r.collect,s,a),Ka(a),Wa(a)]}function di(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function ui(e){const t=Ye(),r=h.useMemo(()=>new ri(t.getBackend()),[t]);return ze(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function fi(){const e=Ye();return h.useMemo(()=>new Za(e),[e])}function pi(e){const{accept:t}=e;return h.useMemo(()=>(K(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class gi{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function hi(e,t){const r=h.useMemo(()=>new gi(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function mi(e,t,r){const s=Ye(),a=hi(e,t),i=pi(e);ze(function(){const[l,c]=Ya(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function or(e,t){const r=sn(e,t),s=fi(),a=ui(r.options);return mi(r,s,a),[nn(r.collect,s,a),di(a)]}const wr="column",xi="flex items-center",bi="mr-3 cursor-move text-secondary",yi=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:i="Drag item"})=>{const o=h.useRef(null),l=h.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:u},d,f]=ci(()=>({type:wr,item:{id:e,originalIndex:c},collect:p=>{const m=p.getItem();return{isDragging:p.isDragging()&&m?.id===e}},end:(p,m)=>{if(!p)return;!m.didDrop()&&typeof a=="function"&&p.originalIndex>-1&&a(p.id,p.originalIndex)}}),[e,c,a]),[,g]=or(()=>({accept:wr,hover:p=>{if(!(!p||p.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(p.id,m)}}}),[s,a,e]);return f(g(l)),d(o),n.jsxs("div",{ref:l,className:I.mergeClasses(xi,r),style:{opacity:u?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:bi,"aria-label":i,children:n.jsx(H.IconGripVertical,{...V.BASE_ICON_PROPS})}),t]})},St=({iconClassName:e,label:t,...r})=>t?n.jsx(x.DialDangerButton,{...r,label:t,appearance:w.ButtonAppearance.Ghost,iconBefore:n.jsx(H.IconTrashX,{...V.BASE_ICON_PROPS,className:e||""})}):n.jsx(L.DialDangerIconButton,{...r,appearance:w.ButtonAppearance.Ghost,icon:n.jsx(H.IconTrashX,{...V.BASE_ICON_PROPS,className:e||""})}),vi=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...u})=>{const d=I.mergeClasses("dial-textarea dial-input px-3 py-2",u.invalid&&"dial-input-error",u.disabled&&"dial-input-disable",i?"resize":"resize-none",e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-1",a),children:[o&&n.jsx(Re.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:d,onChange:f=>r?.(f.currentTarget.value),...u}),n.jsx(x.DialErrorText,{text:s}),!s&&n.jsx(x.DialCaptionText,{text:l})]})},Di="inline-flex items-center rounded bg-layer-3",Ci="flex flex-1 items-center justify-center gap-2 h-7 px-3 py-1 border border-primary dial-small-text whitespace-nowrap focus-visible:outline outline-offset-0 focus-visible:relative focus-visible:z-10",Ni="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ii="text-secondary hover:text-primary",Si="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",ji=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:i})=>{const o=h.useCallback(l=>{if(s)return;const c=e.filter(g=>!g.disabled);if(c.length===0)return;const u=c.findIndex(g=>g.value===t);let d=null;switch(l.key){case"ArrowRight":case"ArrowDown":d=(u+1)%c.length;break;case"ArrowLeft":case"ArrowUp":d=(u-1+c.length)%c.length;break;case"Home":d=0;break;case"End":d=c.length-1;break;default:return}l.preventDefault();const f=c[d];f&&f.value!==t&&r(f.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(Di,a),children:e.map((l,c)=>{const u=l.value===t,d=c===0,f=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":u,tabIndex:u?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Ci,!f&&"-mr-px",d&&"rounded-l",f&&"rounded-r",u?Ni:Ii,g&&Si),children:[l.icon,l.label]},l.value)})})},Mt=8,Ti=24,on=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:u=!1,readOnly:d=!1,containerClassName:f,tagClassName:g,onChange:p})=>{const m=h.useRef(null),v=h.useRef([]),b=h.useRef(null),[y,C]=h.useState(e),[N,S]=h.useState(""),[D,T]=h.useState(!1),[P,O]=h.useState(e.length),E=h.useCallback(k=>z=>{v.current[k]=z},[]),_=h.useCallback(()=>{if(!u)return;const k=m.current;if(!k)return;const z=k.offsetWidth;if(z===0)return;const Y=b.current?.offsetWidth??0,oe=z-(d?0:Ti)-Mt;let ee=0,W=0;for(let re=0;re<y.length;re++){const fe=v.current[re];if(!fe)continue;const ue=fe.offsetWidth+Mt;if(ee+ue>oe)break;ee+=ue,W++}if(W<y.length&&W>0)for(;ee+Y>oe&&W>0;){W--;const re=v.current[W]?.offsetWidth??0;ee-=re+Mt}O(W)},[u,d,y.length]),j=k=>{const z=k.trim().replace(/,$/,"");if(z&&!y.includes(z)){const Y=[z,...y];C(Y),p?.(Y)}},R=k=>{(k.key===","||k.key==="Enter")&&(k.preventDefault(),j(N),S(""))},$=()=>{N.trim()&&(j(N),S(""))},U=k=>{const z=y.filter((Y,J)=>J!==k);C(z),p?.(z)},te=()=>o?n.jsx(x.DialErrorText,{text:o}):i?n.jsx(x.DialCaptionText,{text:i}):null;h.useEffect(()=>{if(u)return;const k=new ResizeObserver(()=>{if(m.current){const z=m.current.scrollHeight>m.current.clientHeight+10;T(z)}});return m.current&&k.observe(m.current),()=>k.disconnect()},[y,u]),h.useEffect(()=>{if(!u){O(y.length);return}O(y.length);const k=new ResizeObserver(()=>{_()}),z=m.current;return z&&k.observe(z),_(),()=>k.disconnect()},[u,_,y]),h.useEffect(()=>{C(e)},[JSON.stringify(e)]);const B=n.jsxs("div",{ref:m,className:se("flex gap-2 items-center relative",u?"flex-nowrap overflow-hidden w-full min-w-0":se("flex-wrap",D?"flex-col-reverse":"flex-row"),f),children:[(u?y.slice(0,P):y).map((k,z)=>n.jsx(Be,{label:k,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>U(z):void 0},k+z)),u&&P<y.length&&n.jsx(w.DialTooltip,{tooltip:y.slice(P).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(Be,{label:`+${y.length-P}`})}),!d&&n.jsx("input",{id:s,type:"text",value:N,onChange:k=>S(k.target.value),onKeyDown:R,onBlur:$,className:se("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",u?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),u&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[y.map((k,z)=>n.jsx("div",{ref:E(z),className:"inline-flex shrink-0",children:n.jsx(Be,{label:k,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>U(z):void 0})},`measure-${k}-${z}`)),n.jsx("div",{ref:b,className:"inline-flex shrink-0",children:n.jsx(Be,{label:`+${y.length}`})})]})]});return d?B:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(Re.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:se("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:B}),te()]})},ln=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(on,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Ft=e=>gr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},gr.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),cn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:u,emptyValueText:d,placeholder:f,editable:g=!1,onValueChange:p,collapseTagOverflow:m=!1,iconBefore:v})=>{const b=Array.isArray(s)&&s.length>0,y=typeof s=="string"&&!!s.trim(),C=b||y?s:f?void 0:d,N=r?void 0:o,S=h.useCallback(O=>{p?.(O.target.value)},[p]),D=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:se("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(L.DialIcon,{icon:v}),n.jsx("input",{type:"text",className:se("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",a),value:typeof s=="string"?s:"",placeholder:f||d,onChange:S,disabled:r,id:l,"aria-label":"input-popup-field"})]}),!r&&n.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:o,"aria-label":"open-popup",children:n.jsx(L.DialIcon,{icon:n.jsx(Ft,{role:"img",width:V.BASE_ICON_SIZE,height:V.BASE_ICON_SIZE})})})]}),n.jsx(x.DialErrorText,{text:c})]}),T=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:se("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(L.DialIcon,{icon:v}),n.jsx(w.DialTooltip,{tooltip:C==null?void 0:String(C),children:C||!f?n.jsx("span",{className:a,children:C}):n.jsx("span",{className:"text-secondary",children:f})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(L.DialIcon,{icon:n.jsx(Ft,{role:"img",width:V.BASE_ICON_SIZE,height:V.BASE_ICON_SIZE})})})]})}),n.jsx(x.DialErrorText,{text:c})]}),P=()=>n.jsx("div",{className:"w-full",onClick:N,children:n.jsxs("div",{className:se("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",r&&"dial-input-disable"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(L.DialIcon,{icon:v}),n.jsx(ln,{placeholder:f,selectedItems:C,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(L.DialIcon,{icon:n.jsx(Ft,{role:"img",width:V.BASE_ICON_SIZE,height:V.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[b?P():g?D():T(),t&&qn.createPortal(e,document.body)]})},wi=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:u,onClose:d,header:f,portalId:g,onApply:p,onCancel:m,cancelButtonTitle:v="Cancel",applyButtonTitle:b="Apply",isValid:y,selectedRadioValue:C,onChangeRadioField:N,id:S,size:D=x.PopupSize.Md})=>{const[T,P]=h.useState(!1),O=h.useCallback(()=>{r||P(!0)},[r]),E=h.useCallback(()=>{P(!1),d?.()},[d]),_=h.useCallback(()=>{m?.(),E()},[m,E]),j=h.useCallback(()=>{p(),E()},[p,E]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Re.DialLabel,{label:e,htmlFor:t}),n.jsx(cn,{disabled:r,open:T,selectedValue:i??a.find(R=>R.id===s)?.name,valueClassName:o,inputClassName:se(l,"py-2","px-3"),emptyValueText:c,placeholder:u,onOpen:O,children:n.jsx(x.DialPopup,{open:T,onClose:_,header:f,portalId:g,size:D,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(x.DialNeutralButton,{label:v,onClick:_}),n.jsx(x.DialPrimaryButton,{label:b,onClick:j,disabled:!y})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(x.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:C,onChange:N,elementId:S,orientation:x.RadioGroupOrientation.Column})})})})]})},Ei="Create",Oi="Cancel",Ai="flex items-center justify-end gap-2 px-6 py-3",_i=({header:e,open:t=!1,submitLabel:r=Ei,cancelLabel:s=Oi,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:u,onCancel:d,children:f,dividers:g=!0,size:p=x.PopupSize.Md,footer:m})=>{const v=a?null:n.jsxs("div",{className:Ai,children:[n.jsx(x.DialNeutralButton,{label:s,onClick:()=>d?d():c?.()}),n.jsx(x.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>u()})]}),b=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(x.DialLoader,{size:50})}):f??null,[f,a]);return n.jsx(x.DialPopup,{open:t,header:e,className:o,dividers:g,onClose:()=>c?.(),footer:m??v,size:p,children:b()})},Ri=/^0+\.(\d+)?$/,ki=/^0+/,Zt=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>!d||d==="-"?d:String(d)?.match(Ri)?String(d)?.replace(ki,"0"):Number(d),c=d=>{if([".","-","+","e","E"].includes(d.key)){d.preventDefault();return}x.handleKeyDown(d,"number",r,s)},u=d=>{const f=d.clipboardData.getData("text"),g=f.replace(/\D/g,"");if(g!==f&&(d.preventDefault(),g)){const p=d.currentTarget,m=p.selectionStart??0,v=p.selectionEnd??0,b=p.value.slice(0,m)+g+p.value.slice(v);t?.(l(b))}};return n.jsx(x.DialInput,{type:"number",min:r,max:s,onChange:d=>t?.(l(d)),onKeyDown:e?c:a,onPaste:e?u:i,...o})},Pi=({onClick:e})=>n.jsx(H.IconEyeOff,{...V.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Li=({onClick:e})=>n.jsx(H.IconEye,{...V.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),dn=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(x.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(Pi,{onClick:()=>s(!1)}):n.jsx(Li,{onClick:()=>s(!0)})})},un=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(o=>o.value===s)?.label??s,i=e.find(o=>o.value===s)?.icon;return n.jsx(Be,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(L.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var ht=(e=>(e.Sm="sm",e.Md="md",e))(ht||{}),mt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(mt||{});const Mi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",Fi="w-full rounded flex flex-col",st="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small-text text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",Bi="bg-accent-primary-alpha",Yt="bg-accent-primary-alpha border-l border-accent-primary border-1",xt="opacity-75",zi=352,$i=4,Hi=n.jsx(H.IconChevronDown,{size:V.DIAL_ICON_SIZE.SM}),Vi=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=L.useSubMenuFloating($i,"listbox",!!e.disabled),u=e.children?.some(d=>t.includes(d.value));return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!u,"aria-disabled":!!e.disabled,disabled:e.disabled,className:se(st,u&&Yt,e.disabled&&xt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(L.DialIcon,{icon:e.icon}),n.jsx(L.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(H.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(L.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(d=>{const f=t.includes(d.value);return n.jsx("button",{type:"button",role:"option","aria-selected":f,"aria-disabled":!!d.disabled,disabled:d.disabled,className:se(st,f&&Yt,d.disabled&&xt),onClick:()=>!d.disabled&&r(d.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[d.icon&&n.jsx(L.DialIcon,{icon:d.icon}),n.jsx(L.DialEllipsisTooltip,{text:d.labelNode??d.label})]})},d.value)})})]})},ke=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=mt.Primary,size:o=ht.Md,prefix:l,customSelectedValue:c,placeholder:u="Select...",searchable:d=!1,searchSize:f=w.ElementSize.Standard,searchPlaceholder:g,selectAll:p=!1,invalid:m,selectAllLabel:v="Select all",emptyStateTitle:b="No options available",emptyStateDescription:y,emptyStateIcon:C,disabled:N=!1,className:S,listClassName:D,closable:T=!1,header:P,footer:O,onClose:E,onChange:_,inlineSearch:j=!1,dismissRef:R,onFooterClick:$,open:U,onOpenChange:te,onInlineQueryChange:B,customMultiSelectTagsRenderer:k})=>{const z=h.useId(),[Y,J]=h.useState(!1),oe=U!==void 0,ee=oe?!!U:Y,W=h.useCallback(A=>{oe||J(A),te?.(A)},[oe,te]),[re,fe]=h.useState(j&&c||""),ue=h.useRef(null),ae=h.useCallback(A=>{A!==re&&(fe(A||""),B?.(A||""))},[B,re]),de=s!==void 0,[pe,me]=h.useState(a),G=de?s:pe,Z=h.useMemo(()=>t?Array.isArray(G)?G:[]:typeof G=="string"?[G]:[],[G,t]),Se=h.useMemo(()=>{const A=re.trim().toLowerCase();return A?e.filter(X=>X.label.toLowerCase().includes(A)):e},[e,re]);h.useEffect(()=>{!ee&&!j&&ae("")},[j,ee,ae]);const et=h.useRef(c);h.useEffect(()=>{j&&c!==et.current&&(ee||(et.current=c,ae(c||"")))},[c,j,ee,ae]);const xe=h.useCallback(A=>{de||me(A),_?.(A)},[de,_]),je=h.useCallback(A=>{if(t){const X=new Set(Z);X.has(A)?X.delete(A):X.add(A),xe(Array.from(X));return}if(xe(A),j){const X=e.find(Ee=>Ee.value===A)??e.flatMap(Ee=>Ee.children??[]).find(Ee=>Ee.value===A);X&&ae(X.label)}W(!1)},[t,xe,j,W,Z,e,ae]),le=h.useCallback((A,X)=>{if(A.stopPropagation(),!t){xe("");return}const Ee=Z.filter(Et=>Et!==X);xe(Ee)},[t,Z,xe]),ge=h.useMemo(()=>Se.filter(A=>!A.disabled),[Se]),be=h.useMemo(()=>ge.filter(A=>Z.includes(A.value)).length,[ge,Z]),tt=h.useCallback(A=>{j&&!t&&!A&&je(re),W(A)},[je,j,t,re,W]),{allSelectedInFiltered:Me,someSelectedInFiltered:Ce}=h.useMemo(()=>{const A=ge.length>0&&be===ge.length;return{allSelectedInFiltered:A,someSelectedInFiltered:be>0&&!A}},[ge,be]),rt=h.useCallback(()=>{if(!(!t||ge.length===0))if(Me){const A=new Set(ge.map(X=>X.value));xe(Z.filter(X=>!A.has(X)))}else{const A=new Set(Z);ge.forEach(X=>A.add(X.value)),xe(Array.from(A))}},[Me,t,ge,Z,xe]),Fe=Z.length>0;h.useEffect(()=>{ee&&j&&!t&&!N&&requestAnimationFrame(()=>{const A=ue.current;if(!A)return;A.focus();const X=A.value?.length??0;A.setSelectionRange?.(X,X)})},[ee,j,t,N]);const Ve=!t&&Fe?Z[0]:void 0,ye=h.useMemo(()=>Ve?e.find(A=>A.value===Ve)??e.flatMap(A=>A.children??[]).find(A=>A.value===Ve):void 0,[e,Ve]),Ge=h.useCallback(()=>t?Fe?k?.(e,Z,le)||n.jsx(un,{options:e,selectedValues:Z,handleRemoveTag:le}):n.jsx("span",{className:"text-secondary truncate",children:u}):ye?n.jsxs(n.Fragment,{children:[ye.icon&&n.jsx(L.DialIcon,{icon:ye.icon}),n.jsx(L.DialEllipsisTooltip,{text:ye.labelNode??(l?`${l} ${ye.label}`:ye.label)}),ye?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:ye.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:u}),[Fe,t,c,l,s,u,ye,e,Z,le,k]);h.useImperativeHandle(R,()=>({dismiss:()=>{W(!1)}}));const we=h.useCallback(()=>{ae(Z.length===1?ye?.label??re:"")},[re,Z.length,ae,ye?.label]),he=h.useCallback(()=>{N||(W(!ee),j&&!t&&(we(),ue.current?.focus()))},[N,j,ee,t,we,W]);return n.jsx(L.DialDropdown,{open:ee,onOpenChange:tt,disabled:N,closable:T,onClose:E,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:zi,listClassName:D,renderOverlay:()=>n.jsxs("div",{id:`list-${r||z}`,role:"listbox","aria-multiselectable":t||void 0,className:Fi,children:[P&&n.jsx(n.Fragment,{children:typeof P=="function"?P():P}),(d||T)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&n.jsx(x.DialSearch,{size:f,placeholder:g,onChange:ae,value:re,id:`search-${r||z}`,containerClassName:I.mergeClasses(x.SIZE_CONFIG[f].containerClassName,"w-full")}),T&&n.jsx(x.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(H.IconX,{size:V.DIAL_ICON_SIZE.SM}),onClick:A=>{E?.(A),W(!1)}})]}),t&&p&&ge.length>0&&n.jsx("div",{className:se(st,"mt-2"),children:n.jsx(Gt,{id:`${r||z}-selectAll`,label:v,checked:Me,indeterminate:Ce,onChange:rt,ariaLabel:v})}),n.jsx("div",{className:se("overflow-y-auto max-h-[352px]",j&&Se.length===0?"":"py-1"),children:Se.length===0?!j&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(L.DialNoDataContent,{icon:C??n.jsx(H.IconClipboardX,{size:V.DIAL_ICON_SIZE.LG,stroke:.5}),title:b,description:y})}):Se.map(A=>{const X=Z.includes(A.value);return t?n.jsxs("div",{role:"option","aria-selected":X,"aria-disabled":!!A.disabled,className:se(st,X&&Bi,A.disabled&&xt,"w-full"),children:[n.jsx(Gt,{id:`${r||z}-${A.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[A.icon&&n.jsx(L.DialIcon,{icon:A.icon}),n.jsx("span",{className:"truncate",children:A.labelNode??A.label})]}),checked:X,disabled:A.disabled,onChange:()=>!A.disabled&&je(A.value),ariaLabel:A.label}),A.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:A.description})]},A.value):A.children?.length?n.jsx(Vi,{opt:A,selectedValues:Z,onSelect:je},A.value):n.jsx("button",{role:"option",type:"button","aria-selected":X,"aria-disabled":!!A.disabled,disabled:A.disabled,className:se(st,X&&Yt,A.disabled&&xt),onClick:()=>!A.disabled&&je(A.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[A.icon&&n.jsx(L.DialIcon,{icon:A.icon}),n.jsx(L.DialEllipsisTooltip,{text:A.labelNode??A.label}),A.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:A.description})]})},A.value)})}),O&&n.jsx("div",{onClick:A=>{$?.(A),$&&W(!1)},children:typeof O=="function"?O():O})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":ee,"aria-controls":`list-${r||z}`,className:I.mergeClasses(Mi,N&&"opacity-75 !cursor-not-allowed !border-primary",o===ht.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===mt.Secondary?"!bg-layer-4 !h-auto":"",S),onMouseDown:A=>{N||j&&!t&&(we(),A.preventDefault())},onClick:()=>{he()},onKeyDown:A=>{(A.key===" "||A.code==="Space")&&(A.preventDefault(),he())},children:[j&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||z}`,type:"text",placeholder:g??u,value:re||"",onChange:A=>ae(A.currentTarget.value.trimStart()),onFocus:()=>!N&&W(!0),onMouseDown:A=>{we(),A.stopPropagation()},onClick:A=>{A.stopPropagation()},onKeyDown:A=>{A.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:ue,disabled:N,"aria-disabled":N,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:Ge()}),!j&&n.jsx(L.DialIcon,{icon:Hi,className:se("text-primary",ee&&"rotate-180")})]})})},Gi=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:u,defaultEmptyText:d,...f})=>{const g=h.useCallback(()=>{if(!u||Array.isArray(u)&&u.length===0)return d??"None";if(Array.isArray(u))return n.jsx(un,{options:f.options,selectedValues:u});{const p=f.options?.find(m=>m.value===u);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:p?.label||u})}},[u,f.options,d]);return n.jsx(x.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:d,children:n.jsx(ke,{className:a,value:u,elementId:o,invalid:!!i,...f})})};function fn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Ui(e,t){return e.filter(r=>r!==t)}function Ki(e,t){const r=new Set,s=i=>r.add(i);e.forEach(s),t.forEach(s);const a=[];return r.forEach(i=>a.push(i)),a}class Wi{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Ki(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Ui(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class qi{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(r[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const jt="__NATIVE_FILE__",pn="__NATIVE_URL__",gn="__NATIVE_TEXT__",hn="__NATIVE_HTML__",Er=Object.freeze(Object.defineProperty({__proto__:null,FILE:jt,HTML:hn,TEXT:gn,URL:pn},Symbol.toStringTag,{value:"Module"}));function Bt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const Xt={[jt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[hn]:{exposeProperties:{html:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[pn]:{exposeProperties:{urls:(e,t)=>Bt(e,t,"").split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./use-file-manager-tabs-CkYH0CvF.cjs"),Re=require("./Switch-CtdhpYik.cjs"),n=require("react/jsx-runtime"),h=require("react"),H=require("@tabler/icons-react"),se=require("classnames"),L=require("./DateCellRenderer-B0o0BqbW.cjs"),V=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-Dipy1Ih1.cjs"),F=require("./DateCellRenderer-CKFfW-Hf.cjs"),w=require("./IconButton-BCbBgnzo.cjs"),qn=require("react-dom"),Ur=require("./editor-Ba3vCFHk.cjs"),ce=require("@floating-ui/react"),ne=require("./icon-DhjrDQ8I.cjs");function Zn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const gr=Zn(h),Be=({label:e,className:t,icon:r,selected:s,closable:a,onClick:i,onRemove:o})=>{const l=I.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",s?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return n.jsxs("div",{className:l,onClick:i,children:[n.jsx(L.DialIcon,{icon:r}),n.jsx(L.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(x.DialButton,{className:"p-0",iconAfter:n.jsx(H.IconX,{size:V.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},Jt=({label:e="Error",className:t})=>n.jsx(Be,{label:e,className:I.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var it=(e=>(e.Default="default",e.Compact="compact",e))(it||{});const Yn={[it.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[it.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},Xn=({title:e,value:t,description:r,variant:s=it.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:u,compareValues:d})=>{const f=Yn[s],g=c!==void 0?c:(l??0)>=0,p=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",f.container,o),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:f.title,children:e}),n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:p})]}):n.jsx("span",{className:f.title,children:e}),a?n.jsx(Jt,{className:"self-start"}):i?n.jsx(x.DialLoader,{fullWidth:!1,className:"self-start"}):d?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(L.DialEllipsisTooltip,{text:d[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:f.value,children:d[0].value})]}),n.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(L.DialEllipsisTooltip,{text:d[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:f.value,children:d[1].value})]})]}):n.jsx("span",{className:f.value,children:t}),!a&&!i&&f.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},er=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],Qn=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Jn=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},ut=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=er,className:l,titleClassName:c,valueClassName:u,inline:d,ariaLabel:f})=>{const g=e==null,p=!!(r||s||!g),m=Qn(g?0:e,t),v=Jn(m,o),b=i??(g?"—":e),y=f??(typeof a=="string"?a:void 0),C=r||s,N=r?n.jsx(Jt,{}):s?n.jsx(x.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",d?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),S=p?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":y,className:I.mergeClasses("w-full overflow-hidden rounded-sm",d?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!C&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:v}})}):null,D=n.jsx("span",{className:I.mergeClasses("dial-small-text text-primary",c),children:a});return d?n.jsxs("div",{className:I.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:D}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:S}),N]})]}):n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[D,N]}),S]})},Kr=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:u,contentClassName:d})=>{const f=s!==void 0,[g,p]=h.useState(a),m=o?!0:f?s:g,v=h.useId(),b=()=>{if(i)return;const y=!m;f||p(y),l?.(y)};return n.jsxs("div",{className:I.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":v,disabled:i||o,onClick:b,className:I.mergeClasses("flex w-full items-center gap-2 p-4 text-left",i?"cursor-not-allowed":"cursor-pointer",o&&"cursor-default",u),children:[!o&&n.jsx(L.DialIcon,{className:se("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(H.IconChevronRight,{size:V.DIAL_ICON_SIZE.SM})}),n.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&n.jsx("div",{id:v,role:"region",className:I.mergeClasses("px-4 pb-4",d),children:r})]})},es=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:u,isLoading:d,onBarClick:f,inline:g,barTitleClassName:p,barValueClassName:m,barClassName:v,barDescriptions:b,className:y})=>{const C=Object.entries(s),N=g?I.mergeClasses("text-secondary",p):p,S=i?"dial-tiny-text text-secondary":void 0,D=t?n.jsx(w.DialTooltip,{tooltip:t,children:e}):e,T=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],P="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary";return n.jsx(Kr,{title:D,description:r,defaultExpanded:c,nonCollapsible:u,className:y,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:d?n.jsx(x.DialLoader,{fullWidth:!1,className:"self-center"}):a?T.map(O=>{const E=O in s?s[O]:null,_=O in a?a[O]:null,R=typeof E=="number"&&typeof _=="number"?parseFloat((_-E).toFixed(3)):null,$=R!=null&&R!==0,U=$&&R>0,te=$?U?`+${R}`:String(R):null,B=b?.[O],k=n.jsx("span",{className:"dial-small-text text-secondary",children:O}),z=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[B?n.jsx(w.DialTooltip,{tooltip:B,children:k}):k,te!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",U?"bg-success text-success":"bg-error text-error"),children:te})]}),n.jsxs("div",{className:"flex flex-col gap-1.5 pl-2",children:[n.jsx(ut,{title:i?.[0],value:E,maxValue:o,colorMap:l,inline:g,titleClassName:S,className:v,ariaLabel:O}),n.jsx(ut,{title:i?.[1],value:_,maxValue:o,colorMap:l,inline:g,titleClassName:S,className:v,ariaLabel:`${O} compare`})]})]});return f?n.jsx("button",{type:"button",onClick:()=>f(O,E),className:I.mergeClasses("flex flex-col gap-1.5",P),children:z},O):n.jsx("div",{className:"flex flex-col gap-1.5",children:z},O)}):C.map(([O,E])=>{const _=n.jsx(ut,{title:O,value:E,maxValue:o,colorMap:l,inline:g,titleClassName:N,valueClassName:m,className:v}),j=f?n.jsx("button",{type:"button",onClick:()=>f(O,E),className:P,children:_}):_,R=b?.[O];return R?n.jsx(w.DialTooltip,{tooltip:R,triggerClassName:"flex flex-col",children:j},O):n.jsx(h.Fragment,{children:j},O)})})})},ts="#FF4E50",rs=(e,t)=>{let r=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=a)}),r},hr=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const u=rs(c,t);u>=0&&(r[u]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:ts,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,u)=>({from:c.from,to:c.to,color:c.color,count:r[u],ratio:i(r[u]),isZeroBucket:!1}));return[o,...l]},Wr=e=>e<=0?2:e%2===0?e:e+1,ns=e=>{const t=Wr(e);return[t,t/2,0]},Ot=e=>`${Math.round(e*100)/100}`,qr=(e,t)=>e===t?Ot(e):`${Ot(e)}-${Ot(t)}`,At=128,ss=(e,t)=>{const r=qr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},mr=(e,t,r,s,a)=>n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&n.jsx("strong",{children:e}),n.jsxs("span",{children:[t," out of ",r," ",s]}),n.jsx("span",{children:ss(a.from,a.to)})]}),as=({title:e,values:t,colorMap:r=er,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:u})=>{const d=hr(t,r),f=l?hr(l,r):void 0,g=t.length,p=l?.length??0,m=Math.max(g,p),v=Wr(m),b=ns(m),y=D=>D.map(T=>({...T,ratio:v>0?T.count/v:0})),C=y(d),N=f?y(f):void 0,S=(D,T,P,O)=>{if(D.count===0)return n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${D.ratio*100}%`}})});const E=O?{backgroundImage:`repeating-linear-gradient(135deg, ${D.color} 0px, ${D.color} 1px, transparent 1px, transparent 4px)`,borderColor:D.color}:{backgroundColor:D.color};return n.jsx(w.DialTooltip,{placement:"bottom",tooltip:T,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":P,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${D.ratio*100}%`,...E},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:D.count})})})};return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",o),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),i?n.jsx("div",{className:"flex items-center justify-center",style:{height:At},children:n.jsx(x.DialLoader,{fullWidth:!1})}):n.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[n.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:At},children:b.map((D,T)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${T/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:D},D))}),n.jsxs("div",{className:"relative min-w-0",children:[b.map((D,T)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${T/(b.length-1)*100}%`}},D)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:At},children:N?C.map((D,T)=>{const P=N[T],O=`${D.count} out of ${g} ${s}`,E=`${P.count} out of ${p} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[S(D,mr(c,D.count,g,s,D),O,!0),S(P,mr(u,P.count,p,s,P),E,!1)]},T)}):C.map((D,T)=>{const P=`${D.count} out of ${g} ${s}`;return D.count===0?n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${D.ratio*100}%`}})},T):n.jsx(w.DialTooltip,{placement:"bottom",tooltip:P,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":P,className:I.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${D.ratio*100}%`,backgroundColor:D.color},children:a&&D.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:D.count})})},T)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:C.map((D,T)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:qr(D.from,D.to)},T))})]})]})},is=({value:e,max:t=100,size:r=w.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const u=h.useId(),d=i??u,f=!!s?.label,g=f?s?.id??`${d}-label`:void 0,p=t>0?t:0,m=Number.isFinite(e)?e:0,v=Math.min(Math.max(m,0),p),b=p>0?v/p*100:0,y=n.jsx("div",{...c,id:d,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":p,"aria-labelledby":g,"aria-label":w.resolveAccessibleName(l,f?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===w.ElementSize.Small?"h-1":"h-2",o),children:n.jsx("div",{style:{width:`${b}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!f&&!a?y:n.jsxs("div",{className:"flex w-full flex-col gap-1",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(F.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),y]})},os=7,ls=2,cs=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var ft=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(ft||{});const ds=(e,t,r)=>e===t?"active":r<os||Math.abs(e-t)<=ls?"adjacent":"far",us=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=cs(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(w.DialIconButton,{icon:n.jsx(H.IconCaretLeftFilled,{size:V.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:w.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>r(e-1),"aria-label":"Previous page"}),n.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(i=>{const o=ds(i,e,t);return n.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":`Page ${i}`,"aria-current":i===e?"page":void 0,className:I.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",o===ft.Active&&"h-[8px] w-[32px]",o===ft.Adjacent&&"size-[8px]",o===ft.Far&&"size-[4px]")},i)})}),n.jsx(w.DialIconButton,{icon:n.jsx(H.IconCaretRightFilled,{size:V.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:w.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Gt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const u=h.useCallback(p=>{o?.(p.target.checked,t)},[o,t]),d=se("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${r||s?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",l),f=se("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx(H.IconMinus,{className:f,...V.BASE_ICON_PROPS}):r?n.jsx(H.IconCheck,{className:f,...V.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:d,htmlFor:t,"aria-description":c["aria-description"]||L.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(L.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:u,id:t,checked:r,"aria-checked":s?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:i,className:"invisible size-0"})]})};var De=(e=>(e.VALID="valid",e.ERROR="error",e))(De||{});const fs=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"border-accent-secondary text-primary";case De.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case De.VALID:return"border-primary text-primary";case De.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},ps=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-layer-4"}},gs=({step:e,index:t,currentStep:r,onChangeStep:s})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",i="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",o=()=>r===e.id&&e.status===De.ERROR?n.jsx(H.IconExclamationCircle,{stroke:2,size:V.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===De.VALID?n.jsx(H.IconCheck,{stroke:2,size:V.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:se(a,fs(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:se(i,ps(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},hs=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const i=e.findIndex(c=>c.id===t),o=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,o).every(c=>c.status===De.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(gs,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},_t=e=>(e.toString().split(".")[1]??"").length,ms=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:u,trackClassName:d,fillClassName:f,thumbClassName:g,labelsClassName:p,"aria-label":m,"aria-labelledby":v,...b})=>{const y=h.useRef(null),C=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),N=_t(s),S=l?l(e):e.toFixed(N),D=h.useCallback(E=>{const _=y.current;if(!_)return e;const j=_.getBoundingClientRect(),R=(E-j.left)/j.width,$=t+R*(r-t),U=_t(s),te=parseFloat((Math.round(($-t)/s)*s+t).toFixed(U));return Math.min(r,Math.max(t,te))},[t,r,s,e]),T=h.useCallback(E=>{a||(E.currentTarget.setPointerCapture(E.pointerId),c?.(D(E.clientX)))},[a,D,c]),P=h.useCallback(E=>{a||E.buttons===0||c?.(D(E.clientX))},[a,D,c]),O=h.useCallback(E=>{if(a)return;const _=_t(s),j=U=>parseFloat((Math.round((U-t)/s)*s+t).toFixed(_)),R=U=>Math.min(r,Math.max(t,U));let $=e;switch(E.key){case"ArrowRight":case"ArrowUp":$=R(j(e+s));break;case"ArrowLeft":case"ArrowDown":$=R(j(e-s));break;case"Home":$=t;break;case"End":$=r;break;default:return}E.preventDefault(),$!==e&&c?.($)},[a,e,s,t,r,c]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",u),...b,children:[i&&n.jsx(Re.DialLabel,{...i,htmlFor:b.id}),n.jsxs("div",{ref:y,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:T,onPointerMove:P,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",d)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",f),style:{width:`${C}%`}}),n.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":v,className:I.mergeClasses("dial-small-text absolute -translate-x-1/2 flex size-[38px] cursor-grab select-none items-center justify-center rounded-full bg-layer-3 text-primary shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",g),style:{left:`${C}%`},onKeyDown:O,children:S})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",p),children:o.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"flex-1 text-center",children:o[1]}),n.jsx("span",{children:o[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"ml-auto",children:o[1]})]})})]})},xs=({label:e,text:t,tooltip:r,children:s,postfix:a,className:i})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",s?"":"max-w-[200px]",i),children:[e&&n.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(w.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),Zr=h.createContext({dragDropManager:void 0});function Ne(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var xr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),br=function(){return Math.random().toString(36).substring(7).split("").join(".")},yr={INIT:"@@redux/INIT"+br(),REPLACE:"@@redux/REPLACE"+br()};function bs(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ys(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Cs(e))return"date";if(Ds(e))return"error";var r=vs(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function vs(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ds(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Cs(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ue(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=ys(e)),t}function Yr(e,t,r){var s;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ne(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(1):"Expected the enhancer to be a function. Instead, received: '"+Ue(r)+"'");return r(Yr)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(2):"Expected the root reducer to be a function. Instead, received: '"+Ue(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function u(){l===o&&(l=o.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(4):"Expected the listener to be a function. Instead, received: '"+Ue(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return u(),l.push(v),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,u();var C=l.indexOf(v);l.splice(C,1),o=null}}}function g(v){if(!bs(v))throw new Error(process.env.NODE_ENV==="production"?Ne(7):"Actions must be plain objects. Instead, the actual type was: '"+Ue(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ne(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,v)}finally{c=!1}for(var b=o=l,y=0;y<b.length;y++){var C=b[y];C()}return v}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(10):"Expected the nextReducer to be a function. Instead, received: '"+Ue(v));a=v,g({type:yr.REPLACE})}function m(){var v,b=f;return v={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?Ne(11):"Expected the observer to be an object. Instead, received: '"+Ue(C)+"'");function N(){C.next&&C.next(d())}N();var S=b(N);return{unsubscribe:S}}},v[xr]=function(){return this},v}return g({type:yr.INIT}),s={dispatch:g,subscribe:f,getState:d,replaceReducer:p},s[xr]=m,s}function K(e,t,...r){if(Ns()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;s=new Error(t.replace(/%s/g,function(){return r[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function Ns(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Is(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function Ss(e,t){return e.filter(r=>r!==t)}function Xr(e){return typeof e=="object"}function js(e,t){const r=new Map,s=i=>{r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((i,o)=>{i===1&&a.push(o)}),a}function Ts(e,t){return e.filter(r=>t.indexOf(r)>-1)}const tr="dnd-core/INIT_COORDS",vt="dnd-core/BEGIN_DRAG",rr="dnd-core/PUBLISH_DRAG_SOURCE",Dt="dnd-core/HOVER",Ct="dnd-core/DROP",Nt="dnd-core/END_DRAG";function vr(e,t){return{type:tr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const ws={type:tr,payload:{clientOffset:null,sourceClientOffset:null}};function Es(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(vr(i)),Os(r,l,c);const u=Rs(r,l);if(u==null){e.dispatch(ws);return}let d=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");As(o),d=o(u)}e.dispatch(vr(i,d));const g=c.getSource(u).beginDrag(l,u);if(g==null)return;_s(g),c.pinSource(u);const p=c.getSourceType(u);return{type:vt,payload:{itemType:p,item:g,sourceId:u,clientOffset:i||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function Os(e,t,r){K(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){K(r.getSource(s),"Expected sourceIds to be registered.")})}function As(e){K(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function _s(e){K(Xr(e),"Item must be an object.")}function Rs(e,t){let r=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){r=e[s];break}return r}function ks(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ps(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ks(e,a,r[a])})}return e}function Ls(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();Ms(s),zs(s).forEach((o,l)=>{const c=Fs(o,l,a,s),u={type:Ct,payload:{dropResult:Ps({},r,c)}};e.dispatch(u)})}}function Ms(e){K(e.isDragging(),"Cannot call drop while not dragging."),K(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Fs(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return Bs(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function Bs(e){K(typeof e>"u"||Xr(e),"Drop result must either be an object or undefined.")}function zs(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function $s(e){return function(){const r=e.getMonitor(),s=e.getRegistry();Hs(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Nt}}}function Hs(e){K(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ut(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Vs(e){return function(r,{clientOffset:s}={}){Gs(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return Ks(a,o,l),Us(a,i,o),Ws(a,i,o),{type:Dt,payload:{targetIds:a,clientOffset:s||null}}}}function Gs(e){K(Array.isArray(e),"Expected targetIds to be an array.")}function Us(e,t,r){K(t.isDragging(),"Cannot call hover while not dragging."),K(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];K(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);K(i,"Expected targetIds to be registered.")}}function Ks(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Ut(i,r)||e.splice(s,1)}}function Ws(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function qs(e){return function(){if(e.getMonitor().isDragging())return{type:rr}}}function Zs(e){return{beginDrag:Es(e),publishDragSource:qs(e),hover:Vs(e),drop:Ls(e),endDrag:$s(e)}}class Ys{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function s(i){return(...o)=>{const l=i.apply(t,o);typeof l<"u"&&r(l)}}const a=Zs(this);return Object.keys(a).reduce((i,o)=>{const l=a[o];return i[o]=s(l),i},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const s=this.store.getState().refCount>0;this.backend&&(s&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!s&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function Xs(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Qr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qs(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Qr(Xs(t,s),r)}function Js(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Qr(t,r)}const nt=[],nr=[];nt.__IS_NONE__=!0;nr.__IS_ALL__=!0;function ea(e,t){return e===nt?!1:e===nr||typeof t>"u"?!0:Ts(t,e).length>0}class ta{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;K(typeof t=="function","listener must be a function."),K(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const o=this.store.getState(),l=o.stateId;try{l===a||l===a+1&&!ea(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){K(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return K(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(K(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return Ut(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(K(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:s}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),i=this.getItemType();if(i&&!Ut(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const l=o.indexOf(t);return s?l===o.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Qs(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Js(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Dr=typeof global<"u"?global:self,Jr=Dr.MutationObserver||Dr.WebKitMutationObserver;function en(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function ra(e){let t=1;const r=new Jr(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const na=typeof Jr=="function"?ra:en;class sa{enqueueTask(t){const{queue:r,requestFlush:s}=this;r.length||(s(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let s=0,a=t.length-this.index;s<a;s++)t[s]=t[s+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=na(this.flush),this.requestErrorThrow=en(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class aa{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class ia{create(t){const r=this.freeTasks,s=r.length?r.pop():new aa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const tn=new sa,oa=new ia(tn.registerPendingError);function la(e){tn.enqueueTask(oa.create(e))}const sr="dnd-core/ADD_SOURCE",ar="dnd-core/ADD_TARGET",ir="dnd-core/REMOVE_SOURCE",It="dnd-core/REMOVE_TARGET";function ca(e){return{type:sr,payload:{sourceId:e}}}function da(e){return{type:ar,payload:{targetId:e}}}function ua(e){return{type:ir,payload:{sourceId:e}}}function fa(e){return{type:It,payload:{targetId:e}}}function pa(e){K(typeof e.canDrag=="function","Expected canDrag to be a function."),K(typeof e.beginDrag=="function","Expected beginDrag to be a function."),K(typeof e.endDrag=="function","Expected endDrag to be a function.")}function ga(e){K(typeof e.canDrop=="function","Expected canDrop to be a function."),K(typeof e.hover=="function","Expected hover to be a function."),K(typeof e.drop=="function","Expected beginDrag to be a function.")}function Kt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Kt(r,!1));return}K(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ie;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ie||(Ie={}));let ha=0;function ma(){return ha++}function xa(e){const t=ma().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Cr(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Nr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,i]}=r.next();if(i===t)return!0;s=!!a}while(!s);return!1}class ba{addSource(t,r){Kt(t),pa(r);const s=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(ca(s)),s}addTarget(t,r){Kt(t,!0),ga(r);const s=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(da(s)),s}containsHandler(t){return Nr(this.dragSources,t)||Nr(this.dropTargets,t)}getSource(t,r=!1){return K(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return K(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return K(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return K(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Cr(t)===Ie.SOURCE}isTargetId(t){return Cr(t)===Ie.TARGET}removeSource(t){K(this.getSource(t),"Expected an existing source."),this.store.dispatch(ua(t)),la(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){K(this.getTarget(t),"Expected an existing target."),this.store.dispatch(fa(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);K(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){K(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=xa(t);return this.types.set(a,r),t===Ie.SOURCE?this.dragSources.set(a,s):t===Ie.TARGET&&this.dropTargets.set(a,s),a}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const ya=(e,t)=>e===t;function va(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Da(e,t,r=ya){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!r(e[s],t[s]))return!1;return!0}function Ca(e=nt,t){switch(t.type){case Dt:break;case sr:case ar:case It:case ir:return nt;case vt:case rr:case Nt:case Ct:default:return nr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=js(r,s);if(!(a.length>0||!Da(r,s)))return nt;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function Na(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Na(e,a,r[a])})}return e}const Ir={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Sa(e=Ir,t){const{payload:r}=t;switch(t.type){case tr:case vt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Dt:return va(e.clientOffset,r.clientOffset)?e:Ia({},e,{clientOffset:r.clientOffset});case Nt:case Ct:return Ir;default:return e}}function ja(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ja(e,a,r[a])})}return e}const Ta={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function wa(e=Ta,t){const{payload:r}=t;switch(t.type){case vt:return Ke({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case rr:return Ke({},e,{isSourcePublic:!0});case Dt:return Ke({},e,{targetIds:r.targetIds});case It:return e.targetIds.indexOf(r.targetId)===-1?e:Ke({},e,{targetIds:Ss(e.targetIds,r.targetId)});case Ct:return Ke({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Nt:return Ke({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Ea(e=0,t){switch(t.type){case sr:case ar:return e+1;case ir:case It:return e-1;default:return e}}function Oa(e=0){return e+1}function Aa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Aa(e,a,r[a])})}return e}function Ra(e={},t){return{dirtyHandlerIds:Ca(e.dirtyHandlerIds,{type:t.type,payload:_a({},t.payload,{prevTargetIds:Is(e,"dragOperation.targetIds",[])})}),dragOffset:Sa(e.dragOffset,t),refCount:Ea(e.refCount,t),dragOperation:wa(e.dragOperation,t),stateId:Oa(e.stateId)}}function ka(e,t=void 0,r={},s=!1){const a=Pa(s),i=new ta(a,new ba(a)),o=new Ys(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function Pa(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Yr(Ra,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function La(e,t){if(e==null)return{};var r=Ma(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function Ma(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Sr=0;const pt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Fa=h.memo(function(t){var{children:r}=t,s=La(t,["children"]);const[a,i]=Ba(s);return h.useEffect(()=>{if(i){const o=rn();return++Sr,()=>{--Sr===0&&(o[pt]=null)}}},[]),n.jsx(Zr.Provider,{value:a,children:r})});function Ba(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=za(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function za(e,t=rn(),r,s){const a=t;return a[pt]||(a[pt]={dragDropManager:ka(e,t,r,s)}),a[pt]}function rn(){return typeof global<"u"?global:window}var Rt,jr;function $a(){return jr||(jr=1,Rt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,a,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(a=s;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=s;a--!==0;){var o=i[a];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Rt}var Ha=$a();const Va=x.getDefaultExportFromCjs(Ha),ze=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Ga(e,t,r){const[s,a]=h.useState(()=>t(e)),i=h.useCallback(()=>{const o=t(e);Va(s,o)||(a(o),r&&r())},[s,e,r]);return ze(i),[s,i]}function Ua(e,t,r){const[s,a]=Ga(e,t,r);return ze(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function nn(e,t,r){return Ua(t,e||(()=>({})),()=>r.reconnect())}function sn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function Ka(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function Wa(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let kt=!1,Pt=!1;class qa{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){K(!kt,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return kt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kt=!1}}isDragging(){if(!this.sourceId)return!1;K(!Pt,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Pt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pt=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Lt=!1;class Za{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;K(!Lt,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Lt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Lt=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function Ya(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Xa(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Wt(e,t,r,s){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<i.length;c++){const u=i[c];if(!l(u))return!1;const d=e[u],f=t[u];if(a=void 0,a===!1||a===void 0&&d!==f)return!1}return!0}function qt(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Qa(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Ja(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return Qa(s),ei(s,r?i=>e(i,r):e)}}function an(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Ja(s);t[r]=()=>a}}),t}function Tr(e,t){typeof e=="function"?e(t):e.current=t}function ei(e,t){const r=e.ref;return K(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:s=>{Tr(r,s),Tr(t,s)}}):h.cloneElement(e,{ref:t})}class ti{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Wt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Wt(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=an({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,qt(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,qt(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class ri{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Wt(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=an({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,qt(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Ye(){const{dragDropManager:e}=h.useContext(Zr);return K(e!=null,"Expected drag drop context"),e}function ni(e,t){const r=Ye(),s=h.useMemo(()=>new ti(r.getBackend()),[r]);return ze(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),ze(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function si(){const e=Ye();return h.useMemo(()=>new qa(e),[e])}class ai{beginDrag(){const t=this.spec,r=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(r):s={},s??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const s=this.spec,a=this.monitor,{isDragging:i}=s;return i?i(a):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,s=this.connector,{end:a}=t;a&&a(r.getItem(),r),s.reconnect()}constructor(t,r,s){this.spec=t,this.monitor=r,this.connector=s}}function ii(e,t,r){const s=h.useMemo(()=>new ai(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function oi(e){return h.useMemo(()=>{const t=e.type;return K(t!=null,"spec.type must be defined"),t},[e])}function li(e,t,r){const s=Ye(),a=ii(e,t,r),i=oi(e);ze(function(){if(i!=null){const[l,c]=Xa(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function ci(e,t){const r=sn(e,t);K(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const s=si(),a=ni(r.options,r.previewOptions);return li(r,s,a),[nn(r.collect,s,a),Ka(a),Wa(a)]}function di(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function ui(e){const t=Ye(),r=h.useMemo(()=>new ri(t.getBackend()),[t]);return ze(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function fi(){const e=Ye();return h.useMemo(()=>new Za(e),[e])}function pi(e){const{accept:t}=e;return h.useMemo(()=>(K(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class gi{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function hi(e,t){const r=h.useMemo(()=>new gi(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function mi(e,t,r){const s=Ye(),a=hi(e,t),i=pi(e);ze(function(){const[l,c]=Ya(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function or(e,t){const r=sn(e,t),s=fi(),a=ui(r.options);return mi(r,s,a),[nn(r.collect,s,a),di(a)]}const wr="column",xi="flex items-center",bi="mr-3 cursor-move text-secondary",yi=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:i="Drag item"})=>{const o=h.useRef(null),l=h.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:u},d,f]=ci(()=>({type:wr,item:{id:e,originalIndex:c},collect:p=>{const m=p.getItem();return{isDragging:p.isDragging()&&m?.id===e}},end:(p,m)=>{if(!p)return;!m.didDrop()&&typeof a=="function"&&p.originalIndex>-1&&a(p.id,p.originalIndex)}}),[e,c,a]),[,g]=or(()=>({accept:wr,hover:p=>{if(!(!p||p.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(p.id,m)}}}),[s,a,e]);return f(g(l)),d(o),n.jsxs("div",{ref:l,className:I.mergeClasses(xi,r),style:{opacity:u?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:bi,"aria-label":i,children:n.jsx(H.IconGripVertical,{...V.BASE_ICON_PROPS})}),t]})},St=({iconClassName:e,label:t,...r})=>t?n.jsx(x.DialDangerButton,{...r,label:t,appearance:w.ButtonAppearance.Ghost,iconBefore:n.jsx(H.IconTrashX,{...V.BASE_ICON_PROPS,className:e||""})}):n.jsx(L.DialDangerIconButton,{...r,appearance:w.ButtonAppearance.Ghost,icon:n.jsx(H.IconTrashX,{...V.BASE_ICON_PROPS,className:e||""})}),vi=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...u})=>{const d=I.mergeClasses("dial-textarea dial-input px-3 py-2",u.invalid&&"dial-input-error",u.disabled&&"dial-input-disable",i?"resize":"resize-none",e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-1",a),children:[o&&n.jsx(Re.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:d,onChange:f=>r?.(f.currentTarget.value),...u}),n.jsx(x.DialErrorText,{text:s}),!s&&n.jsx(x.DialCaptionText,{text:l})]})},Di="inline-flex items-center rounded bg-layer-3",Ci="flex flex-1 items-center justify-center gap-2 h-7 px-3 py-1 border border-primary dial-small-text whitespace-nowrap focus-visible:outline outline-offset-0 focus-visible:relative focus-visible:z-10",Ni="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ii="text-secondary hover:text-primary",Si="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",ji=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:i})=>{const o=h.useCallback(l=>{if(s)return;const c=e.filter(g=>!g.disabled);if(c.length===0)return;const u=c.findIndex(g=>g.value===t);let d=null;switch(l.key){case"ArrowRight":case"ArrowDown":d=(u+1)%c.length;break;case"ArrowLeft":case"ArrowUp":d=(u-1+c.length)%c.length;break;case"Home":d=0;break;case"End":d=c.length-1;break;default:return}l.preventDefault();const f=c[d];f&&f.value!==t&&r(f.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(Di,a),children:e.map((l,c)=>{const u=l.value===t,d=c===0,f=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":u,tabIndex:u?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Ci,!f&&"-mr-px",d&&"rounded-l",f&&"rounded-r",u?Ni:Ii,g&&Si),children:[l.icon,l.label]},l.value)})})},Mt=8,Ti=24,on=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:u=!1,readOnly:d=!1,containerClassName:f,tagClassName:g,onChange:p})=>{const m=h.useRef(null),v=h.useRef([]),b=h.useRef(null),[y,C]=h.useState(e),[N,S]=h.useState(""),[D,T]=h.useState(!1),[P,O]=h.useState(e.length),E=h.useCallback(k=>z=>{v.current[k]=z},[]),_=h.useCallback(()=>{if(!u)return;const k=m.current;if(!k)return;const z=k.offsetWidth;if(z===0)return;const Y=b.current?.offsetWidth??0,oe=z-(d?0:Ti)-Mt;let ee=0,W=0;for(let re=0;re<y.length;re++){const fe=v.current[re];if(!fe)continue;const ue=fe.offsetWidth+Mt;if(ee+ue>oe)break;ee+=ue,W++}if(W<y.length&&W>0)for(;ee+Y>oe&&W>0;){W--;const re=v.current[W]?.offsetWidth??0;ee-=re+Mt}O(W)},[u,d,y.length]),j=k=>{const z=k.trim().replace(/,$/,"");if(z&&!y.includes(z)){const Y=[z,...y];C(Y),p?.(Y)}},R=k=>{(k.key===","||k.key==="Enter")&&(k.preventDefault(),j(N),S(""))},$=()=>{N.trim()&&(j(N),S(""))},U=k=>{const z=y.filter((Y,J)=>J!==k);C(z),p?.(z)},te=()=>o?n.jsx(x.DialErrorText,{text:o}):i?n.jsx(x.DialCaptionText,{text:i}):null;h.useEffect(()=>{if(u)return;const k=new ResizeObserver(()=>{if(m.current){const z=m.current.scrollHeight>m.current.clientHeight+10;T(z)}});return m.current&&k.observe(m.current),()=>k.disconnect()},[y,u]),h.useEffect(()=>{if(!u){O(y.length);return}O(y.length);const k=new ResizeObserver(()=>{_()}),z=m.current;return z&&k.observe(z),_(),()=>k.disconnect()},[u,_,y]),h.useEffect(()=>{C(e)},[JSON.stringify(e)]);const B=n.jsxs("div",{ref:m,className:se("flex gap-2 items-center relative",u?"flex-nowrap overflow-hidden w-full min-w-0":se("flex-wrap",D?"flex-col-reverse":"flex-row"),f),children:[(u?y.slice(0,P):y).map((k,z)=>n.jsx(Be,{label:k,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>U(z):void 0},k+z)),u&&P<y.length&&n.jsx(w.DialTooltip,{tooltip:y.slice(P).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(Be,{label:`+${y.length-P}`})}),!d&&n.jsx("input",{id:s,type:"text",value:N,onChange:k=>S(k.target.value),onKeyDown:R,onBlur:$,className:se("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",u?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),u&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[y.map((k,z)=>n.jsx("div",{ref:E(z),className:"inline-flex shrink-0",children:n.jsx(Be,{label:k,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>U(z):void 0})},`measure-${k}-${z}`)),n.jsx("div",{ref:b,className:"inline-flex shrink-0",children:n.jsx(Be,{label:`+${y.length}`})})]})]});return d?B:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(Re.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:se("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:B}),te()]})},ln=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(on,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Ft=e=>gr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},gr.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),cn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:u,emptyValueText:d,placeholder:f,editable:g=!1,onValueChange:p,collapseTagOverflow:m=!1,iconBefore:v})=>{const b=Array.isArray(s)&&s.length>0,y=typeof s=="string"&&!!s.trim(),C=b||y?s:f?void 0:d,N=r?void 0:o,S=h.useCallback(O=>{p?.(O.target.value)},[p]),D=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:se("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(L.DialIcon,{icon:v}),n.jsx("input",{type:"text",className:se("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",a),value:typeof s=="string"?s:"",placeholder:f||d,onChange:S,disabled:r,id:l,"aria-label":"input-popup-field"})]}),!r&&n.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:o,"aria-label":"open-popup",children:n.jsx(L.DialIcon,{icon:n.jsx(Ft,{role:"img",width:V.BASE_ICON_SIZE,height:V.BASE_ICON_SIZE})})})]}),n.jsx(x.DialErrorText,{text:c})]}),T=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:se("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(L.DialIcon,{icon:v}),n.jsx(w.DialTooltip,{tooltip:C==null?void 0:String(C),children:C||!f?n.jsx("span",{className:a,children:C}):n.jsx("span",{className:"text-secondary",children:f})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(L.DialIcon,{icon:n.jsx(Ft,{role:"img",width:V.BASE_ICON_SIZE,height:V.BASE_ICON_SIZE})})})]})}),n.jsx(x.DialErrorText,{text:c})]}),P=()=>n.jsx("div",{className:"w-full",onClick:N,children:n.jsxs("div",{className:se("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",r&&"dial-input-disable"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(L.DialIcon,{icon:v}),n.jsx(ln,{placeholder:f,selectedItems:C,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(L.DialIcon,{icon:n.jsx(Ft,{role:"img",width:V.BASE_ICON_SIZE,height:V.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[b?P():g?D():T(),t&&qn.createPortal(e,document.body)]})},wi=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:u,onClose:d,header:f,portalId:g,onApply:p,onCancel:m,cancelButtonTitle:v="Cancel",applyButtonTitle:b="Apply",isValid:y,selectedRadioValue:C,onChangeRadioField:N,id:S,size:D=x.PopupSize.Md})=>{const[T,P]=h.useState(!1),O=h.useCallback(()=>{r||P(!0)},[r]),E=h.useCallback(()=>{P(!1),d?.()},[d]),_=h.useCallback(()=>{m?.(),E()},[m,E]),j=h.useCallback(()=>{p(),E()},[p,E]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Re.DialLabel,{label:e,htmlFor:t}),n.jsx(cn,{disabled:r,open:T,selectedValue:i??a.find(R=>R.id===s)?.name,valueClassName:o,inputClassName:se(l,"py-2","px-3"),emptyValueText:c,placeholder:u,onOpen:O,children:n.jsx(x.DialPopup,{open:T,onClose:_,header:f,portalId:g,size:D,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(x.DialNeutralButton,{label:v,onClick:_}),n.jsx(x.DialPrimaryButton,{label:b,onClick:j,disabled:!y})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(x.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:C,onChange:N,elementId:S,orientation:x.RadioGroupOrientation.Column})})})})]})},Ei="Create",Oi="Cancel",Ai="flex items-center justify-end gap-2 px-6 py-3",_i=({header:e,open:t=!1,submitLabel:r=Ei,cancelLabel:s=Oi,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:u,onCancel:d,children:f,dividers:g=!0,size:p=x.PopupSize.Md,footer:m})=>{const v=a?null:n.jsxs("div",{className:Ai,children:[n.jsx(x.DialNeutralButton,{label:s,onClick:()=>d?d():c?.()}),n.jsx(x.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>u()})]}),b=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(x.DialLoader,{size:50})}):f??null,[f,a]);return n.jsx(x.DialPopup,{open:t,header:e,className:o,dividers:g,onClose:()=>c?.(),footer:m??v,size:p,children:b()})},Ri=/^0+\.(\d+)?$/,ki=/^0+/,Zt=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>!d||d==="-"?d:String(d)?.match(Ri)?String(d)?.replace(ki,"0"):Number(d),c=d=>{if([".","-","+","e","E"].includes(d.key)){d.preventDefault();return}x.handleKeyDown(d,"number",r,s)},u=d=>{const f=d.clipboardData.getData("text"),g=f.replace(/\D/g,"");if(g!==f&&(d.preventDefault(),g)){const p=d.currentTarget,m=p.selectionStart??0,v=p.selectionEnd??0,b=p.value.slice(0,m)+g+p.value.slice(v);t?.(l(b))}};return n.jsx(x.DialInput,{type:"number",min:r,max:s,onChange:d=>t?.(l(d)),onKeyDown:e?c:a,onPaste:e?u:i,...o})},Pi=({onClick:e})=>n.jsx(H.IconEyeOff,{...V.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Li=({onClick:e})=>n.jsx(H.IconEye,{...V.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),dn=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(x.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(Pi,{onClick:()=>s(!1)}):n.jsx(Li,{onClick:()=>s(!0)})})},un=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(o=>o.value===s)?.label??s,i=e.find(o=>o.value===s)?.icon;return n.jsx(Be,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(L.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var ht=(e=>(e.Sm="sm",e.Md="md",e))(ht||{}),mt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(mt||{});const Mi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",Fi="w-full rounded flex flex-col",st="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small-text text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",Bi="bg-accent-primary-alpha",Yt="bg-accent-primary-alpha border-l border-accent-primary border-1",xt="opacity-75",zi=352,$i=4,Hi=n.jsx(H.IconChevronDown,{size:V.DIAL_ICON_SIZE.SM}),Vi=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=L.useSubMenuFloating($i,"listbox",!!e.disabled),u=e.children?.some(d=>t.includes(d.value));return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!u,"aria-disabled":!!e.disabled,disabled:e.disabled,className:se(st,u&&Yt,e.disabled&&xt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(L.DialIcon,{icon:e.icon}),n.jsx(L.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(H.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(L.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(d=>{const f=t.includes(d.value);return n.jsx("button",{type:"button",role:"option","aria-selected":f,"aria-disabled":!!d.disabled,disabled:d.disabled,className:se(st,f&&Yt,d.disabled&&xt),onClick:()=>!d.disabled&&r(d.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[d.icon&&n.jsx(L.DialIcon,{icon:d.icon}),n.jsx(L.DialEllipsisTooltip,{text:d.labelNode??d.label})]})},d.value)})})]})},ke=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=mt.Primary,size:o=ht.Md,prefix:l,customSelectedValue:c,placeholder:u="Select...",searchable:d=!1,searchSize:f=w.ElementSize.Standard,searchPlaceholder:g,selectAll:p=!1,invalid:m,selectAllLabel:v="Select all",emptyStateTitle:b="No options available",emptyStateDescription:y,emptyStateIcon:C,disabled:N=!1,className:S,listClassName:D,closable:T=!1,header:P,footer:O,onClose:E,onChange:_,inlineSearch:j=!1,dismissRef:R,onFooterClick:$,open:U,onOpenChange:te,onInlineQueryChange:B,customMultiSelectTagsRenderer:k})=>{const z=h.useId(),[Y,J]=h.useState(!1),oe=U!==void 0,ee=oe?!!U:Y,W=h.useCallback(A=>{oe||J(A),te?.(A)},[oe,te]),[re,fe]=h.useState(j&&c||""),ue=h.useRef(null),ae=h.useCallback(A=>{A!==re&&(fe(A||""),B?.(A||""))},[B,re]),de=s!==void 0,[pe,me]=h.useState(a),G=de?s:pe,Z=h.useMemo(()=>t?Array.isArray(G)?G:[]:typeof G=="string"?[G]:[],[G,t]),Se=h.useMemo(()=>{const A=re.trim().toLowerCase();return A?e.filter(X=>X.label.toLowerCase().includes(A)):e},[e,re]);h.useEffect(()=>{!ee&&!j&&ae("")},[j,ee,ae]);const et=h.useRef(c);h.useEffect(()=>{j&&c!==et.current&&(ee||(et.current=c,ae(c||"")))},[c,j,ee,ae]);const xe=h.useCallback(A=>{de||me(A),_?.(A)},[de,_]),je=h.useCallback(A=>{if(t){const X=new Set(Z);X.has(A)?X.delete(A):X.add(A),xe(Array.from(X));return}if(xe(A),j){const X=e.find(Ee=>Ee.value===A)??e.flatMap(Ee=>Ee.children??[]).find(Ee=>Ee.value===A);X&&ae(X.label)}W(!1)},[t,xe,j,W,Z,e,ae]),le=h.useCallback((A,X)=>{if(A.stopPropagation(),!t){xe("");return}const Ee=Z.filter(Et=>Et!==X);xe(Ee)},[t,Z,xe]),ge=h.useMemo(()=>Se.filter(A=>!A.disabled),[Se]),be=h.useMemo(()=>ge.filter(A=>Z.includes(A.value)).length,[ge,Z]),tt=h.useCallback(A=>{j&&!t&&!A&&je(re),W(A)},[je,j,t,re,W]),{allSelectedInFiltered:Me,someSelectedInFiltered:Ce}=h.useMemo(()=>{const A=ge.length>0&&be===ge.length;return{allSelectedInFiltered:A,someSelectedInFiltered:be>0&&!A}},[ge,be]),rt=h.useCallback(()=>{if(!(!t||ge.length===0))if(Me){const A=new Set(ge.map(X=>X.value));xe(Z.filter(X=>!A.has(X)))}else{const A=new Set(Z);ge.forEach(X=>A.add(X.value)),xe(Array.from(A))}},[Me,t,ge,Z,xe]),Fe=Z.length>0;h.useEffect(()=>{ee&&j&&!t&&!N&&requestAnimationFrame(()=>{const A=ue.current;if(!A)return;A.focus();const X=A.value?.length??0;A.setSelectionRange?.(X,X)})},[ee,j,t,N]);const Ve=!t&&Fe?Z[0]:void 0,ye=h.useMemo(()=>Ve?e.find(A=>A.value===Ve)??e.flatMap(A=>A.children??[]).find(A=>A.value===Ve):void 0,[e,Ve]),Ge=h.useCallback(()=>t?Fe?k?.(e,Z,le)||n.jsx(un,{options:e,selectedValues:Z,handleRemoveTag:le}):n.jsx("span",{className:"text-secondary truncate",children:u}):ye?n.jsxs(n.Fragment,{children:[ye.icon&&n.jsx(L.DialIcon,{icon:ye.icon}),n.jsx(L.DialEllipsisTooltip,{text:ye.labelNode??(l?`${l} ${ye.label}`:ye.label)}),ye?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:ye.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:u}),[Fe,t,c,l,s,u,ye,e,Z,le,k]);h.useImperativeHandle(R,()=>({dismiss:()=>{W(!1)}}));const we=h.useCallback(()=>{ae(Z.length===1?ye?.label??re:"")},[re,Z.length,ae,ye?.label]),he=h.useCallback(()=>{N||(W(!ee),j&&!t&&(we(),ue.current?.focus()))},[N,j,ee,t,we,W]);return n.jsx(L.DialDropdown,{open:ee,onOpenChange:tt,disabled:N,closable:T,onClose:E,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:zi,listClassName:D,renderOverlay:()=>n.jsxs("div",{id:`list-${r||z}`,role:"listbox","aria-multiselectable":t||void 0,className:Fi,children:[P&&n.jsx(n.Fragment,{children:typeof P=="function"?P():P}),(d||T)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&n.jsx(x.DialSearch,{size:f,placeholder:g,onChange:ae,value:re,id:`search-${r||z}`,containerClassName:I.mergeClasses(x.SIZE_CONFIG[f].containerClassName,"w-full")}),T&&n.jsx(x.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(H.IconX,{size:V.DIAL_ICON_SIZE.SM}),onClick:A=>{E?.(A),W(!1)}})]}),t&&p&&ge.length>0&&n.jsx("div",{className:se(st,"mt-2"),children:n.jsx(Gt,{id:`${r||z}-selectAll`,label:v,checked:Me,indeterminate:Ce,onChange:rt,ariaLabel:v})}),n.jsx("div",{className:se("overflow-y-auto max-h-[352px]",j&&Se.length===0?"":"py-1"),children:Se.length===0?!j&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(L.DialNoDataContent,{icon:C??n.jsx(H.IconClipboardX,{size:V.DIAL_ICON_SIZE.LG,stroke:.5}),title:b,description:y})}):Se.map(A=>{const X=Z.includes(A.value);return t?n.jsxs("div",{role:"option","aria-selected":X,"aria-disabled":!!A.disabled,className:se(st,X&&Bi,A.disabled&&xt,"w-full"),children:[n.jsx(Gt,{id:`${r||z}-${A.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[A.icon&&n.jsx(L.DialIcon,{icon:A.icon}),n.jsx("span",{className:"truncate",children:A.labelNode??A.label})]}),checked:X,disabled:A.disabled,onChange:()=>!A.disabled&&je(A.value),ariaLabel:A.label}),A.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:A.description})]},A.value):A.children?.length?n.jsx(Vi,{opt:A,selectedValues:Z,onSelect:je},A.value):n.jsx("button",{role:"option",type:"button","aria-selected":X,"aria-disabled":!!A.disabled,disabled:A.disabled,className:se(st,X&&Yt,A.disabled&&xt),onClick:()=>!A.disabled&&je(A.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[A.icon&&n.jsx(L.DialIcon,{icon:A.icon}),n.jsx(L.DialEllipsisTooltip,{text:A.labelNode??A.label}),A.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:A.description})]})},A.value)})}),O&&n.jsx("div",{onClick:A=>{$?.(A),$&&W(!1)},children:typeof O=="function"?O():O})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":ee,"aria-controls":`list-${r||z}`,className:I.mergeClasses(Mi,N&&"opacity-75 !cursor-not-allowed !border-primary",o===ht.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===mt.Secondary?"!bg-layer-4 !h-auto":"",S),onMouseDown:A=>{N||j&&!t&&(we(),A.preventDefault())},onClick:()=>{he()},onKeyDown:A=>{(A.key===" "||A.code==="Space")&&(A.preventDefault(),he())},children:[j&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||z}`,type:"text",placeholder:g??u,value:re||"",onChange:A=>ae(A.currentTarget.value.trimStart()),onFocus:()=>!N&&W(!0),onMouseDown:A=>{we(),A.stopPropagation()},onClick:A=>{A.stopPropagation()},onKeyDown:A=>{A.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:ue,disabled:N,"aria-disabled":N,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:Ge()}),!j&&n.jsx(L.DialIcon,{icon:Hi,className:se("text-primary",ee&&"rotate-180")})]})})},Gi=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:u,defaultEmptyText:d,...f})=>{const g=h.useCallback(()=>{if(!u||Array.isArray(u)&&u.length===0)return d??"None";if(Array.isArray(u))return n.jsx(un,{options:f.options,selectedValues:u});{const p=f.options?.find(m=>m.value===u);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:p?.label||u})}},[u,f.options,d]);return n.jsx(x.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:d,children:n.jsx(ke,{className:a,value:u,elementId:o,invalid:!!i,...f})})};function fn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Ui(e,t){return e.filter(r=>r!==t)}function Ki(e,t){const r=new Set,s=i=>r.add(i);e.forEach(s),t.forEach(s);const a=[];return r.forEach(i=>a.push(i)),a}class Wi{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Ki(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Ui(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class qi{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(r[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const jt="__NATIVE_FILE__",pn="__NATIVE_URL__",gn="__NATIVE_TEXT__",hn="__NATIVE_HTML__",Er=Object.freeze(Object.defineProperty({__proto__:null,FILE:jt,HTML:hn,TEXT:gn,URL:pn},Symbol.toStringTag,{value:"Module"}));function Bt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const Xt={[jt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[hn]:{exposeProperties:{html:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[pn]:{exposeProperties:{urls:(e,t)=>Bt(e,t,"").split(`
2
2
  `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[gn]:{exposeProperties:{text:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Zi(e,t){const r=Xt[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new qi(r);return s.loadDataTransfer(t),s}function zt(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Xt).filter(r=>{const s=Xt[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Yi=fn(()=>/firefox/i.test(navigator.userAgent)),mn=fn(()=>!!window.safari);class Or{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:i,c3s:o}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,u=o.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const p=r[d];if(p<t)c=d+1;else if(p>t)u=d-1;else return s[d]}l=Math.max(0,u);const f=t-r[l],g=f*f;return s[l]+a[l]*f+i[l]*g+o[l]*f*g}constructor(t,r){const{length:s}=t,a=[];for(let p=0;p<s;p++)a.push(p);a.sort((p,m)=>t[p]<t[m]?-1:1);const i=[],o=[];let l,c;for(let p=0;p<s-1;p++)l=t[p+1]-t[p],c=r[p+1]-r[p],i.push(l),o.push(c/l);const u=[o[0]];for(let p=0;p<i.length-1;p++){const m=o[p],v=o[p+1];if(m*v<=0)u.push(0);else{l=i[p];const b=i[p+1],y=l+b;u.push(3*y/((y+b)/m+(y+l)/v))}}u.push(o[o.length-1]);const d=[],f=[];let g;for(let p=0;p<u.length-1;p++){g=o[p];const m=u[p],v=1/i[p],b=m+u[p+1]-g-g;d.push((g-m-b)*v),f.push(b*v*v)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=d,this.c3s=f}}const Xi=1;function xn(e){const t=e.nodeType===Xi?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function ct(e){return{x:e.clientX,y:e.clientY}}function Qi(e){var t;return e.nodeName==="IMG"&&(Yi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Ji(e,t,r,s){let a=e?t.width:r,i=e?t.height:s;return mn()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function eo(e,t,r,s,a){const i=Qi(t),l=xn(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:d}=e,{anchorX:f,anchorY:g}=s,{dragPreviewWidth:p,dragPreviewHeight:m}=Ji(i,t,u,d),v=()=>{let T=new Or([0,.5,1],[c.y,c.y/d*m,c.y+m-d]).interpolate(g);return mn()&&i&&(T+=(window.devicePixelRatio-1)*m),T},b=()=>new Or([0,.5,1],[c.x,c.x/u*p,c.x+p-u]).interpolate(f),{offsetX:y,offsetY:C}=a,N=y===0||y,S=C===0||C;return{x:N?y:b(),y:S?C:v()}}class to{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function ro(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ro(e,a,r[a])})}return e}class no{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,s){return this.sourcePreviewNodeOptions.set(t,s),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,s){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,s);const a=o=>this.handleDragStart(o,t),i=o=>this.handleSelectStart(o);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",i),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const s=o=>this.handleDragEnter(o,t),a=o=>this.handleDragOver(o,t),i=o=>this.handleDrop(o,t);return r.addEventListener("dragenter",s),r.addEventListener("dragover",a),r.addEventListener("drop",i),()=>{r.removeEventListener("dragenter",s),r.removeEventListener("dragover",a),r.removeEventListener("drop",i)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Ar({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Ar({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Er).some(r=>Er[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Zi(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var s;return(s=this.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,s){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=a=>{const i=this.sourceNodes.get(a);return i&&xn(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const o=ct(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:l}=a,c=zt(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),g=this.sourcePreviewNodes.get(d)||f;if(g){const{anchorX:p,anchorY:m,offsetX:v,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),N=eo(f,g,o,{anchorX:p,anchorY:m},{offsetX:v,offsetY:b});l.setDragImage(g,N.x,N.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,c=zt(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:ct(a)}),i.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=ct(a),this.scheduleHover(i),(i||[]).some(l=>this.monitor.canDropOnTarget(l))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else zt(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:ct(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new to(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Wi(this.isNodeInDocument)}}const so=function(t,r,s){return new no(t,r,s)},ao=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:i,multiple:o,fileFormatError:l,fileCountError:c,fileSizeError:u,getIsFileFormatError:d,getIsFileSizeError:f})=>{const g=h.useRef(null),p=h.useRef(null),[m,v]=h.useState([]),[b,y]=h.useState(!1),[C,N]=h.useState(!1),S=h.useCallback(B=>{const k=B.target.files;if(k&&k.length>0){const z=Array.from(k),Y=d?.(z),J=f?.(z);Y?y(!0):J?N(!0):e(z)}},[d,f,e]),D=h.useCallback(B=>i&&B?.length>i,[i]),T=h.useMemo(()=>b||C||D(m),[b,C,D,m]),P=()=>{v([]),y(!1),N(!1)},O=h.useMemo(()=>b?n.jsx(x.DialErrorText,{text:l}):C?n.jsx(x.DialErrorText,{text:u}):D(m)?n.jsx(x.DialErrorText,{text:c}):null,[c,l,u,m,D,b,C]);h.useEffect(()=>{P()},[a]);const[{isOver:E,canDrop:_},j]=or(()=>({accept:[jt],drop(B){const k=B.files,z=d?.(k)??!1,Y=f?.(k)??!1,J=D?.(k)??!1;if(y(z),N(Y),z||Y||J){v(k);return}e(k),P()},collect:B=>({isOver:B.isOver(),canDrop:B.canDrop()})}),[e,d,f,D]),R=B=>{(B.key==="Enter"||B.key==="Space")&&(B.preventDefault(),p.current?.click())},$=B=>{B?.preventDefault();const k=Array.from(B.dataTransfer?.items??[]);y(!!d?.(k)),N(!!f?.(k)),v(k)},U=B=>{B.target===B.currentTarget&&P()},te=se("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!_&&!T&&"border-primary",_&&(E?"border-accent-primary":"border-hover"),T&&"border-error");return j(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:te,ref:g,onDragOver:$,onDragLeave:U,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:R,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&n.jsx("p",{className:"mb-1",children:t}),r&&n.jsx("p",{className:"mb-0.5",children:r}),s&&n.jsx(x.DialPrimaryButton,{appearance:w.ButtonAppearance.Ghost,label:s,onClick:()=>p.current?.click()})]}),n.jsx("input",{multiple:o,id:"file",type:"file",ref:p,hidden:!0,accept:a,onChange:S})]}),n.jsx(n.Fragment,{children:O})]})},io=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx(H.IconExclamationCircle,{...V.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(x.DialInput,{...r,iconBefore:a(),containerClassName:se("h-[40px] p-0",s&&"h-[60px]"),className:se("rounded-r-none border-r-0",s&&"text-error",t)})},oo=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:i,fileFormatError:o,fileSizeError:l,fileCountError:c})=>{const u=h.useRef(null),[d,f]=h.useState(!1),[g,p]=h.useState(!1),[m,v]=h.useState(0),b=h.useCallback(()=>{f(!1),p(!1),v(0)},[]),y=h.useCallback(E=>!!(i&&t.length+E.length>i),[i,t.length]),C=d||g,[{isOver:N,canDrop:S},D]=or(()=>({accept:[jt],drop(E){const _=E.files,j=[...t,..._],R=s?.(_)??!1,$=a?.(_)??!1,U=y?.(_)??!1;if(f(R),p($),R||$||U){v(_.length);return}r(j),b()},collect:E=>({isOver:E.isOver(),canDrop:E.canDrop()})}),[t,r,s,a,y,b]),T=E=>{E.preventDefault();const _=Array.from(E.dataTransfer?.items??[]);f(!!s?.(_)),p(!1),v(_.length)},P=E=>{E.target===E.currentTarget&&b()};D(u);const O=y(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:u,onDragOver:T,onDragLeave:P,className:se("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!C&&!O&&(S&&N?"border-accent-primary":"border-primary"),(C||O)&&"border-error"),children:e}),d&&n.jsx(x.DialErrorText,{text:o}),g&&n.jsx(x.DialErrorText,{text:l}),!d&&!g&&O&&n.jsx(x.DialErrorText,{text:c})]})},bn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:i,errorText:o,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:u,getIsFileFormatError:d,getIsFileSizeError:f,maxFilesCount:g}=e,p=h.useCallback((b,y)=>{b.stopPropagation(),a(t?.filter(C=>C.name!==y)||[])},[a,t]),m=h.useCallback(b=>n.jsx(St,{"aria-label":l,onClick:y=>p(y,b)}),[l,p]),v=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((b,y)=>n.jsx(io,{id:b.name,value:b.name,iconAfter:m(b.name),iconBefore:r||s?.(b.name),invalid:i?.(b),error:i?.(b)?o:""},b.name+y))}),[t,r,s,i,o,m]);return n.jsx(Fa,{backend:so,children:!t||t.length===0?n.jsx(ao,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx(oo,{existingFiles:t,onDrop:a,getIsFileFormatError:d,getIsFileSizeError:f,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),c?.(t)&&n.jsx(x.DialErrorText,{text:u})]})})},lo=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:i,maxMultiFilesSize:o,fileFormatError:l,fileCountError:c,fileSizeError:u,multiFilesSizeError:d,multiple:f=!0,acceptTypes:g,deleteAllButtonLabel:p,addButtonLabel:m,additionalActionButtons:v,...b})=>{const y=h.useRef(null),C=()=>y.current?.click(),N=()=>{e([])},S=h.useCallback(O=>O?.some(E=>!(g==="/"||g?.toLowerCase()?.includes(E?.type?.toLowerCase()))),[g]),D=h.useCallback(O=>{if(!i)return!1;const E=i*(1024*1024);return O?.some(_=>{const j=_.size;return!!j&&j>E})},[i]),T=h.useCallback(O=>{if(!o||!f)return!1;const E=o*1024*1024;return O.reduce((j,R)=>j+R.size,0)>E},[o,f]),P=h.useCallback(O=>{const E=O.target.files;if(E&&E.length>0){const _=Array.from(E),j=S(_),R=D(_);!j&&!R&&e([...s||[],..._])}},[S,D,e,s]);return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[n.jsx(Re.DialLabel,{label:`${t}: ${f?s?.length||0:""}`,htmlFor:r}),f&&!!s?.length&&n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(x.DialNeutralButton,{label:p,iconBefore:n.jsx(H.IconTrashX,{...V.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&n.jsx(x.DialPrimaryButton,{appearance:w.ButtonAppearance.Ghost,iconBefore:n.jsx(H.IconPlus,{...V.BASE_ICON_PROPS}),label:m,onClick:C}),v]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:f,ref:y,hidden:!0,accept:g,onChange:P}),n.jsx(bn,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:f,fileFormatError:l,fileCountError:c,fileSizeError:u,multiFilesSizeError:d,getIsFileFormatError:S,getIsFileSizeError:D,getIsMultiFilesSizeError:T,...b})]})},co=({icon:e,ariaLabel:t,size:r=w.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:i,iconClassName:o,caretIcon:l=n.jsx(H.IconChevronDown,{size:V.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:u="bottom-start",matchReferenceWidth:d=!1,open:f,onOpenChange:g,defaultOpen:p=!1,...m})=>{const v=r===w.ElementSize.Small,[b,y]=h.useState(p),C=f??b,N=v?"w-8 px-0":"w-10 px-0",S={[w.ElementSize.Small]:"size-5",[w.ElementSize.Standard]:"size-6",[w.ElementSize.Large]:"size-7"},D=T=>{y(T),g?.(T)};return n.jsx(L.DialDropdown,{...m,disabled:s,placement:u,matchReferenceWidth:d,className:a,open:C,onOpenChange:D,defaultOpen:p,children:n.jsxs("button",{type:"button","aria-label":t,disabled:s,className:I.mergeClasses("group flex items-center justify-center rounded border border-transparent bg-layer-4 text-primary","enabled:hover:bg-accent-primary-alpha enabled:active:bg-controls-accent-primary-alpha-active","focus-visible:border-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:text-controls-secondary-disable disabled:opacity-75",v?"h-8 px-2":"h-10 px-2",c?void 0:N,i),children:[n.jsx(L.DialIcon,{icon:e,className:I.mergeClasses("flex items-center justify-center text-inherit",S[r],c&&"-mr-2",o)}),c&&n.jsxs("div",{className:"relative z-10 inline-grid size-5 shrink-0 place-items-center",children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(L.DialIcon,{icon:l,className:I.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",C&&"rotate-180")})]})]})})},uo="application/octet-stream";function fo(e,t){if(!e||e.length===0)return[];const r=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!r)return[];const s=r.path||r.url||"",a=$t(s,!0),i=e.filter(c=>c!==r).map(c=>{const u=c.path||c.url||"",d=po(c.nodeType),f=d===x.DialFileNodeType.FOLDER,g=$t(u,f);let p;return c.parentPath===null||c.parentPath===void 0?p=a:c.parentPath===""?p="":p=$t(c.parentPath,!0),{...c,originalPath:u,path:g,parentPath:p,nodeType:d}}),o=new Map;i.forEach(c=>{const u={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:go(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===x.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===x.DialFileNodeType.ITEM&&(u.extension=ho(c.name),u.contentType=c.contentType||uo,u.contentLength=c.contentLength||0),o.set(c.path,u)});const l=[];return o.forEach(c=>{if(c.parentPath===a)l.push(c);else{const u=c.path.lastIndexOf(c.name||""),d=c.path.slice(0,u),f=o.get(d);f&&f.nodeType===x.DialFileNodeType.FOLDER?(f.items=f.items||[],f.items.push(c)):l.push(c)}}),l}function $t(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function po(e){return e.toUpperCase()==="FOLDER"?x.DialFileNodeType.FOLDER:x.DialFileNodeType.ITEM}function go(e){if(!e)return;const t=e.toUpperCase();return Object.values(x.DialFileResourceType).find(s=>s.toUpperCase()===t)}function ho(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function mo(e,t="Prompts",r="prompts/public/",s="root"){const a=fo(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:x.DialFileNodeType.FOLDER,folderId:s,items:a}]}var We=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(We||{}),ot=(e=>(e.Select="select",e.Radio="radio",e))(ot||{}),Tt=(e=>(e.Row="row",e.Column="column",e))(Tt||{}),Q=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(Q||{});const xo={noItemSchema:"No item schema defined.",noItemsYet:"No items yet. Add one below.",addItem:"Add Item",selectTypeToAdd:"Select type to add…",noConfigurableProperties:"No configurable properties.",noFieldsYet:"No fields yet. Add one below.",keyColumnHeader:"Key",valueColumnHeader:"Value",addField:"Add Field",keyInputPlaceholder:"Enter key",stringInputPlaceholder:"Enter a value",integerInputPlaceholder:"Enter a whole number",numberInputPlaceholder:"Enter a number",enumSelectPlaceholder:"Select an option",selectTypePlaceholder:"Select type",removeItemAriaLabel:"Remove item",removeFieldAriaLabel:"Remove field"},yn=h.createContext(null);function Te(){const e=h.useContext(yn);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function _r(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function q(e,t,r=0){if(r>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let i=t;for(const d of a)i=i?.[d];if(!i||typeof i!="object")return e;const{$ref:o,...l}=s,c=i;s={...c.$ref?q(c,t,r+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...i}=s;let o={};for(const l of a)o=_r(o,q(l,t,r+1));s=_r(o,i)}return s}function vn(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const s=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return s!==a?s-a:t.index-r.index}).map(({entry:t})=>t)}function wt(e){return e==null||e===""}function He(e){return e.type===Q.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function bt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Dn(e,t){return e.type===Q.Null?"null":e.$ref?q(e,t).title??e.$ref.split("/").pop()??"Option":e.title?e.title:e.type?Array.isArray(e.type)?e.type.join(" | "):e.type:e.discriminator?Object.keys(e.discriminator.mapping).join(" | "):e.const!=null?String(e.const):e.oneOf?"One of options":"Option"}function Ae(e,t,r=0){if(r>15)return;const s=q(e,t);if("default"in s)return s.default;if(s.discriminator&&s.oneOf){const a=Object.keys(s.discriminator.mapping)[0];if(a){const i=q({$ref:s.discriminator.mapping[a]},t);return{...Ae(i,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(He(s)){if(s.properties){const a={};let i=!1;for(const[o,l]of Object.entries(s.properties)){const c=Ae(l,t,r+1);c!==void 0&&(a[o]=c,i=!0)}return i?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function Oe(e,t,r,s="",a=0){if(a>15)return[];const i=[],o=q(t,r);if(o.anyOf){const u=o.anyOf.filter(d=>d.type!==Q.Null);return e!=null&&u.length===1?Oe(e,u[0],r,s,a+1):i}if(o.oneOf&&o.discriminator){const u=o.discriminator.propertyName,d=e?.[u];if(d&&o.discriminator.mapping[d]){const f={$ref:o.discriminator.mapping[d]},g=q(f,r);return Oe(e,g,r,s,a+1)}return i}if(o.type===Q.Array||!o.type&&Array.isArray(e)){if(Array.isArray(e)&&o.items)for(let u=0;u<e.length;u++){const d=Oe(e[u],o.items,r,`${s}[${u}]`,a+1);i.push(...d)}return i}if(!He(o))return i;const l=o.required??[],c=e;for(const u of l){const d=o.properties?.[u];if(d&&q(d,r).isHidden)continue;const f=s?`${s}.${u}`:u,g=c?.[u];if(wt(g)){const p=d?.title??bt(u);i.push({path:f,message:`${p} is required`})}}if(c&&o.properties)for(const[u,d]of Object.entries(o.properties)){if(q(d,r).isHidden)continue;const f=s?`${s}.${u}`:u,g=c[u];if(g!=null){const p=Oe(g,d,r,f,a+1);i.push(...p)}}if(c&&o.additionalProperties!=null&&o.additionalProperties!==!1&&typeof o.additionalProperties=="object"){const u=o.additionalProperties;for(const[d,f]of Object.entries(c)){const g=s?`${s}.${d}`:d,p=Oe(f,u,r,g,a+1);i.push(...p)}}return i}function lr(e,t,r){const s=q(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(He(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!q(c,r).isHidden),i=a.length,o=e;return`${a.filter(([c])=>{const u=o?.[c];return u!=null&&u!==""}).length}/${i} fields`}return""}function bo(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===Q.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>q(a,r).type===Q.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>q(a,r).type===Q.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const i=q(a,r);return i.type===Q.Number||i.type===Q.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>q(a,r).type===Q.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const i=q(t[a],r);if(i.discriminator&&i.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const i=q(t[a],r);if(He(i)||i.oneOf)return a}return 0}return 0}function yo(e,t,r){if(t&&typeof e=="object"&&e!==null){const s=e[t];if(s)return`Item ${r+1}: ${s}`}if(typeof e=="object"&&e!==null){const s=e,a=s.name??s.title??s.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function Cn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case Q.String:return"";case Q.Boolean:return!1;case Q.Array:return[];case Q.Integer:case Q.Number:return;default:return{}}}const lt=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:i,onRemove:o,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[u,d]=h.useState(l),f=a===0,g="rounded border border-secondary",p=I.mergeClasses("flex items-center gap-2 cursor-pointer select-none transition-colors",f?"px-4 py-3 bg-layer-3 hover:bg-layer-4":"px-3 py-2 bg-layer-4 hover:bg-layer-3",u?"rounded-t":"rounded"),m=I.mergeClasses("border-t border-secondary",f?"p-4":"p-3");return n.jsxs("div",{className:g,children:[n.jsxs("div",{className:p,onClick:()=>d(v=>!v),role:"button","aria-expanded":u,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:u?n.jsx(H.IconChevronDown,{size:16,stroke:2}):n.jsx(H.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:I.mergeClasses("flex-1 truncate",f?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(Re.DialInfoButton,{caption:t}),r&&n.jsx("span",{className:"dial-tiny-text text-secondary whitespace-nowrap ml-2",children:r}),s>0?n.jsxs("span",{className:"flex items-center gap-1 dial-tiny-text text-error whitespace-nowrap",children:[n.jsx(L.DialIcon,{icon:n.jsx(H.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(L.DialIcon,{icon:n.jsx(H.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),o&&n.jsx(St,{size:w.ElementSize.Small,onClick:v=>{v.stopPropagation(),o()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),u&&n.jsx("div",{className:m,children:i})]})},Nn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:i,label:o})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:u=new Set,skipUntouched:d=!1}=Te(),f=q(e,l),g=He(f),p=f.type===Q.Array;if(g||p){const b=lr(t,f,l),y=Oe(t,f,l,s.join(".")),C=s.join("."),N=C+".",S=!d||u.has(C)||[...u].some(D=>D.startsWith(N));return n.jsx(lt,{title:o??f.title??s[s.length-1]??"Section",description:f.description,level:a,summary:b,errorCount:S?y.length:0,defaultExpanded:c,children:n.jsx(_e,{schema:f,value:t,onChange:r,path:s,level:a+1,required:i})})}const v=(!d||u.has(s.join(".")))&&i&&wt(t)?`${o??"Field"} is required`:void 0;return n.jsx(x.DialFormItem,{label:o,required:i,description:f.description,error:v,children:n.jsx(_e,{schema:f,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:!0})})},gt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o}=Te(),l=q(e,i),c=vn(Object.entries(l.properties??{}).filter(([,f])=>!q(f,i).isHidden)),u=l.required??[],d=t??{};return c.length===0?n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noConfigurableProperties}):n.jsx("div",{className:"flex flex-col gap-4",children:c.map(([f,g])=>{const m=q(g,i).title??g.title??bt(f),v=u.includes(f);return n.jsx(Nn,{schema:g,value:d[f],onChange:b=>r({...d,[f]:b}),path:[...s,f],level:a,required:v,label:m},f)})})},vo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,defaultExpanded:c=!0}=Te(),u=Array.isArray(t)?t:[],d=e.items,[f,g]=h.useState(void 0);if(!d)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemSchema});const p=h.useMemo(()=>q(d,i),[d,i]),m=h.useMemo(()=>p.discriminator,[p]),v=h.useMemo(()=>m?.propertyName,[m]),b=h.useMemo(()=>m?Object.keys(m.mapping).map(S=>({value:S,label:S})):[],[m]),y=()=>{const S=f??b[0]?.value;let D;if(m&&S){const T=q({$ref:m.mapping[S]},i);D={...Ae(T,i)??{},[m.propertyName]:S}}else D=Ae(p,i)??Cn(p);r([...u,D])},C=S=>{r(u.filter((D,T)=>T!==S))},N=(S,D)=>{r(u.map((T,P)=>P===S?D:T))};return n.jsxs("div",{className:"flex flex-col gap-3",children:[u.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemsYet}),u.map((S,D)=>{const T=yo(S,v,D),P=lr(S,p,i),O=Oe(S,p,i,`${s.join(".")}[${D}]`);return n.jsx(lt,{title:T,level:a,summary:P,errorCount:O.length,onRemove:l?void 0:()=>C(D),defaultExpanded:c,removeItemAriaLabel:o.removeItemAriaLabel,children:n.jsx(_e,{schema:d,value:S,onChange:E=>N(D,E),path:[...s,String(D)],level:a+1})},D)}),!l&&n.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[b.length>0&&n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:b,value:f??b[0]?.value,placeholder:o.selectTypeToAdd,onChange:S=>{const D=typeof S=="string"?S:S[0];g(D)}})}),n.jsx(x.DialGhostButton,{label:o.addItem,iconBefore:n.jsx(H.IconPlus,{size:16,stroke:2}),onClick:y})]})]})},Do=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1}=Te(),c=h.useId(),u=e.discriminator;if(u){const b=u.propertyName,y=u.mapping,C=Object.keys(y).map(T=>({value:T,label:T})),N=typeof t=="object"&&t!==null?t[b]:void 0,S=N?q({$ref:y[N]},i):void 0,D=T=>{const P=q({$ref:y[T]},i),O=Ae(P,i)??{};r({...O,[b]:T})};if(e.discriminatorDisplay===ot.Radio){const T=e.discriminatorOrientation===Tt.Row,P=N?(()=>{const O=q({$ref:y[N]},i),{[b]:E,..._}=O.properties??{};return{...O,properties:_}})():void 0;return T?n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{role:"radiogroup",className:"flex flex-row flex-wrap gap-4",children:Object.keys(y).map(O=>{const E=q({$ref:y[O]},i);return n.jsx(L.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:E.title??O,checked:N===O,disabled:l,onChange:()=>D(O)},O)})}),P&&n.jsx(gt,{schema:P,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(y).map(O=>{const E=q({$ref:y[O]},i),_=N===O,{[b]:j,...R}=E.properties??{},$={...E,properties:R};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(L.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:E.title??O,checked:_,disabled:l,onChange:()=>D(O)}),_&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(gt,{schema:$,value:t,onChange:r,path:s,level:a})})]},O)})})}return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:C,value:N,placeholder:o.selectTypePlaceholder,disabled:l,onChange:T=>{const P=typeof T=="string"?T:T[0];P&&D(P)}})}),S&&n.jsx("div",{className:"pl-3",children:n.jsx(gt,{schema:S,value:t,onChange:r,path:s,level:a})})]})}const d=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let b=0;b<d.length;b++)if(q(d[b],i).required?.every(C=>C in t))return b}return 0})(),p=b=>{const y=q(d[b],i),C=Ae(y,i);r(C??null)},m=d[g];if(e.discriminatorDisplay===ot.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:d.map((b,y)=>{const C=q(b,i),N=Dn(b,i)??`Option ${y+1}`,S=g===y;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(L.DialRadioButton,{name:c,value:String(y),inputId:`${c}-${y}`,label:N,checked:S,disabled:l,onChange:()=>p(y)}),S&&C&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(_e,{schema:C,value:t,onChange:r,path:s,level:a})})]},y)})});const v=d.map((b,y)=>{const C=q(b,i);return{value:String(y),label:C.title??`Option ${y+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:v,value:String(g),disabled:l,onChange:b=>{const y=typeof b=="string"?b:b[0];p(Number(y))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(_e,{schema:m,value:t,onChange:r,path:s,level:a})})]})},Co=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,readonly:o=!1}=Te(),l=e.anyOf??[],c=l.map((m,v)=>({value:String(v),label:Dn(m,i)})),u=bo(t,l,i),d=l[u],g=q(d,i).type===Q.Null,p=m=>{const v=q(l[m],i);if(v.type===Q.Null){r(null);return}const b=Ae(v,i);if(b!==void 0){r(b);return}switch(v.type){case Q.Array:r([]);break;case Q.String:r("");break;case Q.Boolean:r(!1);break;case Q.Integer:case Q.Number:r(0);break;default:r({});break}};return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:c,value:String(u),disabled:o,onChange:m=>{const v=typeof m=="string"?m:m[0];p(Number(v))}})}),!g&&d&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(_e,{schema:d,value:t,onChange:r,path:s,level:a})})]})},In=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:i,readonly:o=!1,inputClassName:l,acceptableResourceTypes:c}=Te(),u=e.const!==void 0,d=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===Q.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(p=>{const m=c?.[p];return Array.isArray(m)?m.map(v=>{const b=String(v);return{value:b,label:b}}):[]});return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:p=>r(typeof p=="string"?p:p[0]),placeholder:i.enumSelectPlaceholder,className:l})}if(u)return n.jsx(x.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(d&&e.enumDisplay===ot.Radio){const g=e.enumOrientation===Tt.Row;return n.jsx("div",{role:"radiogroup",className:g?"flex flex-row flex-wrap gap-x-4 gap-y-2":"flex flex-col gap-2",children:e.enum.map(p=>{const m=String(p);return n.jsx(L.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:o,onChange:v=>r(v)},m)})})}if(d){const g=e.enum.map(p=>({value:String(p),label:String(p)}));return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:p=>r(typeof p=="string"?p:p[0]),placeholder:i.enumSelectPlaceholder})}switch(e.type){case Q.Boolean:return n.jsx(Re.DialSwitch,{switchId:a,isOn:!!t,disabled:o,onChange:g=>r(g)});case Q.Integer:return n.jsx(Zt,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.integerInputPlaceholder,containerClassName:l});case Q.Number:return n.jsx(Zt,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(dn,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l}):n.jsx(x.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l})}},Rr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Sn=e=>!!(e.oneOf||e.anyOf||e.type===Q.Array||He(e)),No=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,onKeyChange:a,onValueChange:i,onRemove:o,keyInputPlaceholder:l,removeFieldAriaLabel:c,path:u,level:d,readonly:f=!1,inputClassName:g})=>{const{rootSchema:p,texts:m,defaultExpanded:v=!0,touchedPaths:b=new Set,markTouched:y=()=>{},skipUntouched:C=!1}=Te(),[N,S]=h.useState(t),D=Sn(s),T=[...u,e,"key"].join("."),O=(!C||b.has(T))&&t==="",E=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:D?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(x.DialInput,{value:N,disabled:f,invalid:O,onChange:$=>S($??""),onBlur:()=>{y(T),N!==t&&a(N)},placeholder:l,containerClassName:g}),n.jsx(x.DialErrorText,{text:O?`${m.keyColumnHeader} is required`:void 0})]}),!D&&n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{schema:s,value:r,onChange:i})}),!f&&n.jsx(St,{size:w.ElementSize.Small,onClick:o,"aria-label":c,className:"shrink-0 p-1"})]});if(!D)return E;const _=[...u,t],j=lr(r,s,p),R=Oe(r,s,p,_.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[E,n.jsx(lt,{title:t,level:d,summary:j,errorCount:R.length+(O?1:0),defaultExpanded:v,children:n.jsx(_e,{schema:s,value:r,onChange:i,path:_,level:d+1})})]})},Io=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,inputClassName:c}=Te(),u=e.additionalProperties===!0||e.additionalProperties==null?{type:"string"}:typeof e.additionalProperties=="object"?q(e.additionalProperties,i):{type:"string"},d=Sn(u),[f,g]=h.useState(()=>Object.entries(t??{}).map(([N,S])=>Rr(N,S))),p=N=>Object.fromEntries(N.filter(S=>S.key!=="").map(S=>[S.key,S.value])),m=(N,S)=>{const D=f.map((T,P)=>P===N?{...T,key:S}:T);g(D),r(p(D))},v=(N,S)=>{const D=f.map((T,P)=>P===N?{...T,value:S}:T);g(D),r(p(D))},b=()=>d?Ae(u,i)??Cn(u):"",y=()=>{g(N=>[...N,Rr("",b())])},C=N=>{const S=f.filter((D,T)=>T!==N);g(S),r(p(S))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[f.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noFieldsYet}),f.length>0&&!d&&n.jsxs("div",{className:"flex gap-2 mb-1 pr-7",children:[n.jsx("span",{className:"w-2/5 dial-tiny-text text-secondary font-medium",children:o.keyColumnHeader}),n.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:o.valueColumnHeader})]}),f.map((N,S)=>n.jsx(No,{pairId:N.id,pairKey:N.key,pairValue:N.value,valueSchema:u,onKeyChange:D=>m(S,D),onValueChange:D=>v(S,D),onRemove:()=>C(S),keyInputPlaceholder:o.keyInputPlaceholder,removeFieldAriaLabel:o.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},N.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(x.DialGhostButton,{label:o.addField,iconBefore:n.jsx(H.IconPlus,{size:16,stroke:2}),onClick:y})})]})},jn=({value:e,onChange:t,theme:r=Ur.EditorThemes.dark,height:s=240})=>{const{readonly:a}=Te(),[i,o]=h.useState(null),[l,c]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-pdzI3xkJ.cjs")).then(d=>{o(()=>d.DialJsonEditor)})},[]);const u=d=>{const f=d??"";c(f);try{t(JSON.parse(f))}catch{}};return n.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:i&&n.jsx(i,{value:l,currentTheme:r,onChange:u,options:{readOnly:a}})})},_e=({schema:e,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:o=!1})=>{const{rootSchema:l,renderField:c,markTouched:u=()=>{},touchedPaths:d=new Set,skipUntouched:f=!1,jsonEditorTheme:g}=Te(),p=q(e,l),m=y=>{u(s.join(".")),r(y)},v=!f||d.has(s.join("."));let b;if(p.oneOf)b=n.jsx(Do,{schema:p,value:t,onChange:m,path:s,level:a});else if(p.anyOf&&p.type!==Q.Object)b=n.jsx(Co,{schema:p,value:t,onChange:m,path:s,level:a});else if(He(p)){const y=p.additionalProperties!=null&&p.additionalProperties!==!1,C=!p.properties||Object.keys(p.properties).length===0;y&&C?b=n.jsx(Io,{schema:p,value:t,onChange:m,path:s,level:a}):C&&p.additionalProperties!==!1?b=n.jsx(jn,{value:t,onChange:m,theme:g}):b=n.jsx(gt,{schema:p,value:t,onChange:m,path:s,level:a})}else if(p.type===Q.Array)b=n.jsx(vo,{schema:p,value:t,onChange:m,path:s,level:a});else{const y=v&&i&&wt(t),C=!o&&y?`${p.title??"Field"} is required`:void 0;b=n.jsxs(n.Fragment,{children:[n.jsx(In,{schema:p,value:t,onChange:m,invalid:y}),n.jsx(x.DialErrorText,{text:C})]})}return c?c(s,p,b):b},So=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:i=!0,inputClassName:o,variant:l=We.Sections,onChange:c,onPropertyChange:u,onDefaultValues:d,renderField:f,skipUntouched:g=!1,jsonEditorTheme:p,acceptableResourceTypes:m})=>{const v=h.useMemo(()=>({...xo,...r}),[r]),b=h.useMemo(()=>t||(Ae(e,e)??{}),[]),[y,C]=h.useState(b),[N,S]=h.useState(new Set),D=h.useCallback(j=>{S(R=>R.has(j)?R:new Set([...R,j]))},[]);h.useEffect(()=>{d?.(b)},[]);const T=(j,R)=>{const $={...y,[j]:R};C($),c?.($),u?.(j,R)},P=new Set(Object.keys(e.properties??{})),O=Object.keys(y).filter(j=>!P.has(j)),E=vn(Object.entries(e.properties??{}).filter(([,j])=>!q(j,e).isHidden)),_=e.required??[];return n.jsx(yn.Provider,{value:{rootSchema:e,texts:v,readonly:a,defaultExpanded:i,inputClassName:o,jsonEditorTheme:p,acceptableResourceTypes:m,renderField:f,touchedPaths:N,markTouched:D,skipUntouched:g},children:n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-4",s),children:[E.map(([j,R])=>{const $=q(R,e),U=$.title??R.title??bt(j),te=_.includes(j),B=y[j];if(l===We.Flat)return n.jsx(Nn,{schema:R,value:B,onChange:J=>T(j,J),path:[j],level:0,required:te,label:U},j);if(l===We.FlatSections)return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:U}),n.jsx(_e,{schema:R,value:B,onChange:J=>T(j,J),path:[j],level:0,required:te})]},j);const k=Oe(B,$,e,j),z=j+".",Y=!g||N.has(j)||[...N].some(J=>J.startsWith(z));return n.jsx(lt,{title:U,description:$.description,level:0,defaultExpanded:i,errorCount:Y?te&&wt(B)?Math.max(k.length,1):k.length:0,children:n.jsx(_e,{schema:R,value:B,onChange:J=>T(j,J),path:[j],level:1,required:te})},j)}),O.map(j=>{const R=bt(j),$=n.jsx(jn,{value:y[j],onChange:U=>T(j,U),theme:p});return l===We.Sections?n.jsx(lt,{title:R,level:0,defaultExpanded:i,children:$},j):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:R}),$]},j)})]})})},jo=e=>({info:n.jsx(H.IconInfoCircleFilled,{size:e.size}),error:n.jsx(H.IconAlertCircleFilled,{size:e.size}),warning:n.jsx(H.IconAlertTriangleFilled,{size:e.size}),success:n.jsx(H.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(x.Spinner,{size:e.size}),general:n.jsx(H.IconCheck,{size:e.size,stroke:e.stroke})}),To={[x.NotificationVariant.Info]:"bg-info text-info",[x.NotificationVariant.Success]:"bg-success text-success",[x.NotificationVariant.Warning]:"bg-warning text-warning",[x.NotificationVariant.Error]:"bg-error text-error",[x.NotificationVariant.Loading]:"bg-layer-raised text-info",[x.NotificationVariant.General]:"bg-layer-sunken text-primary"},wo={[x.NotificationVariant.Info]:"status",[x.NotificationVariant.Success]:"status",[x.NotificationVariant.Warning]:"alert",[x.NotificationVariant.Error]:"alert",[x.NotificationVariant.Loading]:"status",[x.NotificationVariant.General]:"status"},Eo="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",cr=({variant:e=x.NotificationVariant.Info,type:t=x.NotificationType.Toast,title:r,message:s,className:a,iconSize:i=24,iconStroke:o=2,closable:l=!1,onClose:c,children:u,textClassName:d,...f})=>{const g=h.useMemo(()=>jo({size:i,stroke:o})[e],[e,i,o]),p=d??(t===x.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:wo[e],...f,className:I.mergeClasses(Eo,To[e],t===x.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===x.NotificationType.SectionMessage&&e===x.NotificationVariant.Loading&&"border-secondary",a),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:n.jsx(L.DialIcon,{icon:g})}),r?n.jsxs("div",{className:I.mergeClasses("flex min-w-0 text-primary break-words",p),children:[n.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),n.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:s})]}):n.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:s})]}),u,l&&n.jsx("div",{className:"relative size-[40px]",children:n.jsx(F.CloseButton,{className:"absolute top-[-2px] right-0 size-auto hover:bg-transparent ",ariaLabel:"Close notification",onClose:m=>c?.(m)})})]})},kr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Oo=e=>e===1?"!truncate !whitespace-nowrap":`${kr[e]??kr[2]} !whitespace-normal`,Ao=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const i=Oo(a);if(!t.trim())return n.jsx(F.EllipsisTooltip,{className:I.mergeClasses(i,s),text:e});const o=e.toLowerCase().indexOf(t.toLowerCase()),l=o===-1?e:n.jsxs(n.Fragment,{children:[e.slice(0,o),n.jsx("mark",{className:I.mergeClasses("text-accent bg-control-accent-alpha-hover",r),children:e.slice(o,o+t.length)}),e.slice(o+t.length)]});return n.jsx(F.EllipsisTooltip,{className:I.mergeClasses(i,s),text:l})},_o=({className:e,children:t,...r})=>n.jsx("article",{...r,className:I.mergeClasses("relative flex flex-col gap-3 rounded-[20px] border-2 border-transparent p-5","bg-layer-raised shadow-md transition-[transform,box-shadow] duration-200 ease-out hover:-translate-y-[3px] hover:shadow-lg motion-reduce:transition-none motion-reduce:hover:translate-y-0",e),children:t}),Xe=(e,t)=>({type:s,...a})=>n.jsx(cr,{...a,variant:e,type:s||t}),Qe=(e,t)=>({variant:s,...a})=>n.jsx(cr,{...a,variant:s||t,type:e}),Ro=Xe(x.NotificationVariant.Error,x.NotificationType.Toast),ko=Xe(x.NotificationVariant.Info,x.NotificationType.Toast),Po=Xe(x.NotificationVariant.Success,x.NotificationType.Toast),Lo=Xe(x.NotificationVariant.Warning,x.NotificationType.Toast),Mo=Xe(x.NotificationVariant.Loading,x.NotificationType.Toast),Fo=Xe(x.NotificationVariant.General,x.NotificationType.Toast),Bo=Qe(x.NotificationType.SectionMessage,x.NotificationVariant.Error),zo=Qe(x.NotificationType.SectionMessage,x.NotificationVariant.Info),$o=Qe(x.NotificationType.SectionMessage,x.NotificationVariant.Success),Ho=Qe(x.NotificationType.SectionMessage,x.NotificationVariant.Warning),Vo=Qe(x.NotificationType.SectionMessage,x.NotificationVariant.Loading),Go=Qe(x.NotificationType.SectionMessage,x.NotificationVariant.General);var ve=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(ve||{});const Uo="en-GB",Ko={[ve.Date]:"Select date",[ve.DateTime]:"Select date and time",[ve.Time]:"--:--",[ve.Weekday]:"Select day"},Tn="flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus",wn="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",En="!border-error",Wo="z-[53] flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",qo="flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-none focus-visible:outline focus-visible:outline-focus",Zo="bg-control-accent text-control-permanent",Yo="text-accent dial-small-semi-text",Xo="text-control-disable-primary",On="text-secondary",Qo=n.jsx(H.IconCalendar,{size:V.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On}),Pr={prev:n.jsx(H.IconChevronLeft,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx(H.IconChevronRight,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Jo=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(i,o)=>{const l=new Date(a);return l.setDate(a.getDate()+o),l})},Lr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Mr=(e,t,r)=>{const s=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(s<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s>a)return!0}return!1},el=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Fr=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),tl=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),dt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Br=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},rl=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),nl=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const s=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),s.length===0)return r;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${r}:${a}`},An=5,_n=e=>e.charAt(0).toUpperCase()+e.slice(1),sl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return _n(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),al=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return{value:String(r+1),label:_n(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),zr=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:i,panel:o,labelledBy:l,panelLabel:c})=>{const u=L.useThemeScope(),[d,f]=h.useState(!1),{refs:g,floatingStyles:p,context:m}=ce.useFloating({open:d,onOpenChange:S=>f(t?!1:S),placement:"bottom-start",whileElementsMounted:ce.autoUpdate,middleware:[ce.offset(8),ce.flip({padding:8}),ce.shift({padding:8})]}),v=ce.useClick(m,{enabled:!t}),b=ce.useDismiss(m),y=ce.useRole(m,{role:"dialog"}),{getReferenceProps:C,getFloatingProps:N}=ce.useInteractions([v,b,y]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":d,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:I.mergeClasses(Tn,"focus-visible:outline focus-visible:outline-focus",r&&En,t&&wn,i),...C(),children:s}),d&&n.jsx(ce.FloatingPortal,{children:n.jsx(ce.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:p,"aria-label":c,className:I.mergeClasses(Wo,u,a),...N(),children:o(()=>f(!1))})})})]})},$r=({id:e,value:t,onChange:r,disabled:s,invalid:a,className:i,ariaLabel:o,placeholder:l="--:--"})=>{const[c,u]=h.useState(t);return h.useEffect(()=>{u(t)},[t]),n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":o,placeholder:l,disabled:s,value:c,onChange:d=>{const f=nl(d.target.value);u(f),rl(f)&&r(f)},className:I.mergeClasses(Tn,a&&En,s&&wn,i)})},il=({mode:e=ve.Date,value:t,onChange:r,labelProps:s,placeholder:a,disabled:i=!1,invalid:o=!1,id:l,className:c,minDate:u,maxDate:d,locale:f=Uo,fieldClassName:g})=>{const p=a??Ko[e],m=t instanceof Date?t:null,v=h.useId(),b=l??v,y=s?.id??`${b}-label`,C=!!s?.label,N=typeof s?.label=="string"?s.label:void 0,S=C?`${y} ${b}`:void 0,D=s?n.jsx(F.Label,{...s,id:y,htmlFor:b}):null,[T,P]=h.useState(()=>m??new Date),O=h.useMemo(()=>new Date,[]),E=h.useMemo(()=>sl(f),[f]),_=h.useMemo(()=>al(f),[f]),j=h.useMemo(()=>Jo(T.getFullYear(),T.getMonth()),[T]),R=B=>{P(k=>new Date(k.getFullYear(),k.getMonth()+B,1))},$=(B,k)=>{if(Mr(B,u,d))return;const z=e===ve.DateTime&&m?Br(B,dt(m)):B;r?.(z),e===ve.Date&&k()},U=B=>{r?.(Br(m??new Date,B))},te=()=>m?e===ve.DateTime?`${Fr(m,f)}, ${dt(m)}`:Fr(m,f):p;if(e===ve.Time){const B=typeof t=="string"?t:m?dt(m):"";return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",c),children:[D,n.jsx($r,{id:b,value:B,onChange:k=>r?.(k),disabled:i,invalid:o,placeholder:p,className:g})]})}if(e===ve.Weekday){const B=typeof t=="string"?t:void 0,k=_.find(z=>z.value===B);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",c),children:[D,n.jsx(zr,{id:b,disabled:i,invalid:o,labelledBy:S,panelLabel:N??p,fieldClassName:g,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!k&&"text-secondary"),children:k?.label??p}),n.jsx(H.IconChevronDown,{size:V.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On})]}),panel:z=>n.jsx("div",{role:"listbox","aria-label":N??p,className:"flex flex-col gap-0.5",children:_.map(Y=>n.jsx("button",{type:"button",role:"option","aria-selected":Y.value===B,className:I.mergeClasses("flex w-full items-center rounded-lg px-3 py-2 text-left dial-small-text text-primary hover:bg-control-accent-alpha-hover","focus-visible:outline focus-visible:outline-focus",Y.value===B&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(Y.value),z()},children:Y.label},Y.value))})})]})}return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",c),children:[D,n.jsx(zr,{id:b,disabled:i,invalid:o,labelledBy:S,panelLabel:N??p,fieldClassName:g,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!m&&"text-secondary"),children:te()}),Qo]}),panel:B=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(F.StaticIconButton,{"aria-label":"Previous month",icon:Pr.prev,size:w.ElementSize.Small,onClick:()=>R(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:el(T,f)}),n.jsx(F.StaticIconButton,{"aria-label":"Next month",icon:Pr.next,size:w.ElementSize.Small,onClick:()=>R(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[E.map(k=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:k},k)),j.map(k=>{const z=k.getMonth()!==T.getMonth(),Y=Lr(k,m),J=Lr(k,O),oe=Mr(k,u,d);return n.jsx("button",{type:"button",disabled:oe,"aria-label":tl(k,f),"aria-pressed":Y,"aria-current":J?"date":void 0,className:I.mergeClasses(qo,z&&Xo,J&&!Y&&Yo,Y&&Zo,oe&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>$(k,B),children:k.getDate()},k.toISOString())})]}),e===ve.DateTime&&n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[n.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),n.jsx($r,{ariaLabel:"Time",value:m?dt(m):"",onChange:U,className:"w-[120px] px-3 py-1.5"})]})]})})]})},ol=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const i=n.jsx(L.DialIcon,{icon:n.jsx(H.IconFolder,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),o=e.map((l,c)=>({label:c===e.length-1?n.jsx("span",{className:r,children:l}):l,disabled:!0,...c===0?{iconBefore:i}:{}}));return n.jsx(x.DialBreadcrumb,{className:s,ariaLabel:a,separator:n.jsx(L.DialIcon,{icon:n.jsx(H.IconChevronRight,{size:14,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:o,labelClassName:I.mergeClasses(t,"text-secondary","!cursor-default")})},Je=({label:e,variant:t,appearance:r=w.ButtonAppearance.Solid,size:s=w.ElementSize.Standard,className:a,textClassName:i,iconAfter:o,iconBefore:l,type:c="button",tooltipProps:u,href:d,target:f,rel:g,disabled:p,...m})=>{const v=I.mergeClasses("dial-kit-base-button",t&&F.getButtonClassNames(t,r),s===w.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===w.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===w.ElementSize.Small&&"dial-kit-base-button-small",r!==w.ButtonAppearance.Link&&(s===w.ElementSize.Small?"px-2":"px-4"),s!==w.ElementSize.Small&&r!==w.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),b=e?void 0:u?.tooltip,y=w.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],b),C=n.jsxs(n.Fragment,{children:[n.jsx(L.DialIcon,{icon:l}),e&&n.jsx("span",{className:i,children:e}),n.jsx(L.DialIcon,{icon:o})]}),N=m,S=d!==void 0?n.jsx("a",{...N,href:p?void 0:d,target:f,rel:g??(f==="_blank"?"noopener noreferrer":void 0),"aria-disabled":p||void 0,tabIndex:p?-1:N.tabIndex,onClick:p?void 0:N.onClick,className:v,"aria-label":y,children:C}):n.jsx("button",{...m,type:c,disabled:p,className:v,"aria-label":y,children:C});return u?n.jsx(F.Tooltip,{asChild:!0,...u,children:S}):S},dr=(e,t)=>({appearance:s,...a})=>n.jsx(Je,{...a,variant:e,appearance:s||t}),ur=(e,t)=>({variant:s,...a})=>n.jsx(Je,{...a,variant:s||t,appearance:e}),Rn=dr(w.ButtonVariant.Primary,w.ButtonAppearance.Solid),fr=dr(w.ButtonVariant.Neutral,w.ButtonAppearance.Solid),ll=dr(w.ButtonVariant.Danger,w.ButtonAppearance.Solid),cl=ur(w.ButtonAppearance.Link,w.ButtonVariant.Primary),dl=ur(w.ButtonAppearance.Ghost,w.ButtonVariant.Primary),ul=ur(w.ButtonAppearance.Outlined,w.ButtonVariant.Neutral),fl=({className:e,icon:t,tooltipProps:r,type:s="button",...a})=>{const i=I.mergeClasses("flex items-center justify-center rounded-full size-[40px]","dial-kit-enhanced-target","dial-kit-fab-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",e),o=n.jsx("button",{...a,type:s,className:i,"aria-label":w.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx(H.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(w.DialTooltip,{...r,children:o}):o},pl=e=>n.jsx(H.IconChevronDown,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",e&&"rotate-180")}),gl=({variant:e,appearance:t,items:r,...s})=>{const[a,i]=h.useState(!1),o=h.useMemo(()=>pl(a),[a]);return n.jsx("div",{children:n.jsx(F.Dropdown,{items:r,onOpenChange:l=>i(l),children:n.jsx(Je,{...s,iconAfter:o,variant:e||w.ButtonVariant.Primary,appearance:t||w.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":a})})})},kn=({label:e,size:t,isOpen:r=!1,"aria-label":s,...a})=>{const i=t===w.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return n.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":r,"aria-label":s?`${s} ${e}`:void 0,className:I.mergeClasses("dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus","flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary","hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",i,a.className),...a,children:[e,n.jsx(H.IconChevronDown,{size:V.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",r&&"rotate-180")})]})},hl=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:i,placement:o="bottom-end",matchReferenceWidth:l=!1,listClassName:c,ariaLabel:u})=>{const[d,f]=h.useState(!1),[g,p]=h.useState(r??e[0]?.key),m=t!==void 0,v=m?t:g,b=h.useMemo(()=>{const C=e.find(N=>N.key===v);return C?.label?String(C.label):""},[e,v]),y=h.useCallback(({key:C})=>{const N=e.find(S=>S.key===C);N&&(m||p(C),s?.(N))},[e,m,s]);return n.jsx(F.Dropdown,{items:e,placement:o,matchReferenceWidth:l,listClassName:c,disabled:i,onOpenChange:f,onItemClick:y,children:n.jsx(kn,{label:b,size:a,isOpen:d,disabled:i,"aria-label":u})})},Pe=({text:e,className:t,variant:r=x.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:I.mergeClasses("dial-tiny-text",r===x.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,Le=({...e})=>n.jsx(Pe,{...e,variant:x.CaptionType.Error}),ml="bg-control-neutral-active flex items-center justify-center enabled:text-secondary enabled:hover:text-control-accent-hover enabled:active:bg-control-accent-alpha-active enabled:hover:bg-control-accent-alpha-hover enabled:active:text-control-accent-active",xl={[w.ElementSize.Small]:"size-[24px]",[w.ElementSize.Standard]:"size-[40px]",[w.ElementSize.Large]:"size-[48px]"},bl=({icon:e,onClick:t,disabled:r,size:s=w.ElementSize.Standard,className:a})=>n.jsx("div",{className:I.mergeClasses("border-l border-tertiary",xl[s]),children:n.jsx(F.IconButton,{className:I.mergeClasses(ml,s===w.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),yl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Pn=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!yl.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if((r!==void 0||s!==void 0)&&e.currentTarget.selectionStart!==null){const i=e.currentTarget.value,o=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??o,c=i.slice(0,o)+e.key+i.slice(l),u=parseFloat(c);if(!isNaN(u)){if(r!==void 0&&u<+r){e.preventDefault();return}if(s!==void 0&&u>+s){e.preventDefault();return}}}}},Ln={[w.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[w.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[w.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},$e=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:i=w.ElementSize.Standard,...o})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",Ln[i].stackGap,a),children:[e&&n.jsx(F.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Mn,{id:s,size:i,...o}),n.jsx(Le,{text:t}),!t&&n.jsx(Pe,{text:r})]})]}),Mn=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:i,iconBefore:o,iconAfter:l,wrapperClassName:c,type:u,inputRef:d,value:f,tooltipText:g,min:p,onChange:m,max:v,inputButtonProps:b,wrapperRef:y,size:C=w.ElementSize.Standard,...N})=>{const S=Ln[C],D=h.useRef(null),T=ce.useMergeRefs([d,D]),P=u==="number"||p!==void 0||v!==void 0;h.useEffect(()=>{const j=D.current;if(!j||!P||t)return;const R=$=>{$.preventDefault()};return j.addEventListener("wheel",R,{passive:!1}),()=>{j.removeEventListener("wheel",R)}},[t,P,u]);const O=j=>{Pn(j,u,p,v)},E=j=>{const R=j.currentTarget.value;if(P&&R!==""){const $=parseFloat(R);if(isNaN($)&&R!=="-"&&R!=="."||!isNaN($)&&(p!==void 0&&$<+p||v!==void 0&&$>+v))return}m?.(R||void 0)},_=()=>n.jsxs("div",{ref:y,className:I.mergeClasses("dial-kit-input flex flex-row items-center justify-between",S.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&S.paddingStart,!b&&S.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(Mn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:C,id:`${r}_textBefore`})}),n.jsx(L.DialIcon,{icon:o}),i,n.jsx("input",{ref:T,type:u,autoComplete:u==="password"?"new-password":"off",value:f??"",className:I.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:E,onKeyDown:O,min:p,disabled:t,max:v,...N}),a&&n.jsxs("p",{className:I.mergeClasses("text-secondary",S.postfixText),children:[" ",a]}),n.jsx(L.DialIcon,{icon:l}),b&&n.jsx(bl,{size:C,...b,disabled:t})]});return t&&u!=="password"?n.jsx(F.Tooltip,{tooltip:g||f,children:_()}):_()};var Ze=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(Ze||{});const vl="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",Dl={[Ze.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Ze.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Cl="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Nl="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",qe=({label:e,icon:t,appearance:r=Ze.Outlined,selected:s=!1,disabled:a=!1,closable:i=!1,removeLabel:o,className:l,title:c,onClick:u,onRemove:d,onKeyDown:f,...g})=>{const p=r===Ze.Selectable,m=!!u&&!a,v=i&&!!d&&!a,b=p&&s,y=C=>{f?.(C),!(!m||C.defaultPrevented)&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":p&&m?s:void 0,onClick:a?void 0:u,onKeyDown:y,className:I.mergeClasses(vl,b?"dial-tiny-semi-text":"dial-tiny-text",Dl[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Cl,Nl],l),children:[t&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),n.jsx("span",{className:"truncate",title:c??e,children:e}),v&&n.jsx(F.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:w.ElementSize.Small,"aria-label":o??`Remove ${e}`,icon:n.jsx(H.IconX,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C=>{C.stopPropagation(),d?.(C)}})]})},Fn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx(n.Fragment,{children:t.map(s=>{const a=e.find(i=>i.value===s);return n.jsx(qe,{label:a?.label??s,closable:!!r,onRemove:i=>r?.(i,s),icon:a?.icon,className:"max-w-full"},s)})}),Il=I.mergeClasses("w-full flex flex-col"),at=I.mergeClasses(F.overlayItemClassName,"justify-between"),Sl=F.overlayItemSelectedClassName,jl="!max-w-[var(--reference-width)]",yt=F.overlayItemDisabledClassName,Tl=352,wl=F.overlayGap,El=F.overlaySubMenuClassName,Ol=n.jsx(H.IconChevronRight,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Al="text-secondary transition-transform",_l=8,Rl=n.jsx(H.IconSearch,{size:V.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),kl=n.jsx(H.IconX,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Bn=n.jsx(H.IconCheck,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,className:"shrink-0","aria-hidden":!0}),Pl=n.jsx(H.IconClipboardX,{size:V.DIAL_ICON_SIZE.LG,stroke:.5,"aria-hidden":"true"}),Ll=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=L.useSubMenuFloating(wl,"listbox",!!e.disabled),u=e.children?.some(d=>t.includes(d.value));return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!u,"aria-disabled":!!e.disabled,disabled:e.disabled,className:I.mergeClasses(at,e.disabled&&yt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(L.DialIcon,{icon:e.icon}),n.jsx(F.EllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx("span",{className:"shrink-0",children:Ol})]}),s&&n.jsx(L.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",surfaceClassName:El,children:e.children.map(d=>{const f=t.includes(d.value);return n.jsxs("button",{type:"button",role:"option","aria-selected":f,"aria-disabled":!!d.disabled,disabled:d.disabled,className:I.mergeClasses(at,d.disabled&&yt),onClick:()=>!d.disabled&&r(d.value),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[d.icon&&n.jsx(L.DialIcon,{icon:d.icon}),n.jsx(F.EllipsisTooltip,{text:d.labelNode??d.label})]}),f&&Bn]},d.value)})})]})},Ml=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:i=w.ElementSize.Standard,prefix:o,customSelectedValue:l,placeholder:c="Select...",labelProps:u,error:d,caption:f,ariaLabel:g,searchable:p=!1,searchSize:m=w.ElementSize.Standard,searchPlaceholder:v,selectAll:b=!1,invalid:y,selectAllLabel:C="Select all",emptyStateTitle:N="No options available",emptyStateDescription:S,emptyStateIcon:D,disabled:T=!1,className:P,fieldClassName:O,listClassName:E,closable:_=!1,header:j,footer:R,onClose:$,onChange:U,dismissRef:te,onFooterClick:B,open:k,onOpenChange:z,onSearchQueryChange:Y,customMultiSelectTagsRenderer:J})=>{const oe=h.useId(),ee=r||oe,W=`list-${ee}`,re=i===w.ElementSize.Small,[fe,ue]=h.useState(!1),ae=k!==void 0,de=ae?!!k:fe,pe=h.useCallback(M=>{ae||ue(M),z?.(M)},[ae,z]),[me,G]=h.useState(""),Z=h.useCallback(M=>{M!==me&&(G(M||""),Y?.(M||""))},[Y,me]),Se=s!==void 0,[et,xe]=h.useState(a),je=Se?s:et,le=h.useMemo(()=>t?Array.isArray(je)?je:[]:typeof je=="string"?[je]:[],[je,t]),ge=h.useMemo(()=>{const M=me.trim().toLowerCase();return M?e.filter(ie=>ie.label.toLowerCase().includes(M)):e},[e,me]);h.useEffect(()=>{de||Z("")},[de,Z]);const be=h.useCallback(M=>{Se||xe(M),U?.(M)},[Se,U]),tt=h.useCallback(M=>{if(t){const ie=new Set(le);ie.has(M)?ie.delete(M):ie.add(M),be(Array.from(ie));return}be(M),pe(!1)},[t,be,pe,le]),Me=h.useCallback((M,ie)=>{if(M.stopPropagation(),!t){be("");return}const Kn=le.filter(Wn=>Wn!==ie);be(Kn)},[t,le,be]),Ce=h.useMemo(()=>ge.filter(M=>!M.disabled),[ge]),rt=h.useMemo(()=>Ce.filter(M=>le.includes(M.value)).length,[Ce,le]),{allSelectedInFiltered:Fe,someSelectedInFiltered:Ve}=h.useMemo(()=>{const M=Ce.length>0&&rt===Ce.length;return{allSelectedInFiltered:M,someSelectedInFiltered:rt>0&&!M}},[Ce,rt]),ye=h.useCallback(()=>{if(!(!t||Ce.length===0))if(Fe){const M=new Set(Ce.map(ie=>ie.value));be(le.filter(ie=>!M.has(ie)))}else{const M=new Set(le);Ce.forEach(ie=>M.add(ie.value)),be(Array.from(M))}},[Fe,t,Ce,le,be]),Ge=le.length>0,we=!t&&Ge?le[0]:void 0,he=h.useMemo(()=>we?e.find(M=>M.value===we)??e.flatMap(M=>M.children??[]).find(M=>M.value===we):void 0,[e,we]),A=he?o?`${o} ${he.label}`:he.label:void 0,X=h.useMemo(()=>t?Ge?n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:J?.(e,le,Me)??n.jsx(Fn,{options:e,selectedValues:le,handleRemoveTag:Me})}):null:!he||!he.labelNode&&!he.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(F.EllipsisTooltip,{text:he.labelNode??A}),he.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:he.description})]}),[J,Me,Ge,t,e,A,le,he]),Ee=t||X?"":A||(l&&s?l:""),Et=typeof u?.label=="string"?u.label:void 0,Vn=X?[w.resolveAccessibleName(g,Et),t?le.map(M=>e.find(ie=>ie.value===M)?.label??M).join(", "):A].filter(Boolean).join(", ")||void 0:w.resolveAccessibleName(g);h.useImperativeHandle(te,()=>({dismiss:()=>{pe(!1)}}));const Gn=h.useCallback(M=>{T||(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),de||pe(!0))},[T,de,pe]),Un=()=>n.jsxs("div",{id:W,role:"listbox","aria-multiselectable":t||void 0,className:Il,children:[j&&n.jsx(n.Fragment,{children:typeof j=="function"?j():j}),(p||_)&&(e.length>_l||!!me)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[p&&n.jsx($e,{id:`search-${ee}`,size:m,placeholder:v,"aria-label":v||"Search options",onChange:M=>Z(M),value:me,iconBefore:Rl,containerClassName:"w-full"}),_&&n.jsx(F.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:w.ElementSize.Small,icon:kl,onClick:M=>{$?.(M),pe(!1)}})]}),t&&b&&Ce.length>0&&n.jsx("div",{className:I.mergeClasses(at,"mt-2"),children:n.jsx(F.Checkbox,{id:`${ee}-selectAll`,labelProps:{label:C},isSelected:Fe,isIndeterminate:Ve,onChange:ye})}),ge.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(L.DialNoDataContent,{icon:D??Pl,title:N,description:S})}):ge.map(M=>{const ie=le.includes(M.value);return t?n.jsxs("button",{id:`${ee}-${M.value}`,type:"button",role:"option","aria-selected":ie,"aria-disabled":!!M.disabled,disabled:M.disabled,className:I.mergeClasses(at,ie&&Sl,M.disabled&&yt),onClick:()=>tt(M.value),children:[n.jsx(F.CheckboxBox,{isSelected:ie,disabled:M.disabled}),M.icon&&n.jsx(L.DialIcon,{icon:M.icon}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:M.labelNode??M.label}),M.description&&n.jsx("span",{className:"shrink-0 text-secondary dial-small-text",children:M.description})]},M.value):M.children?.length?n.jsx(Ll,{opt:M,selectedValues:le,onSelect:tt},M.value):n.jsxs("button",{role:"option",type:"button","aria-selected":ie,"aria-disabled":!!M.disabled,disabled:M.disabled,className:I.mergeClasses(at,M.disabled&&yt),onClick:()=>!M.disabled&&tt(M.value),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[M.icon&&n.jsx(L.DialIcon,{icon:M.icon}),n.jsx(F.EllipsisTooltip,{text:M.labelNode??M.label}),M.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:M.description})]}),ie&&Bn]},M.value)}),R&&n.jsx("div",{onClick:M=>{B?.(M),B&&pe(!1)},children:typeof R=="function"?R():R})]});return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",P),children:[u&&n.jsx(F.Label,{...u,htmlFor:ee}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(F.Dropdown,{open:de,onOpenChange:pe,disabled:T,closable:_,onClose:$,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:p?null:Tl,listClassName:I.mergeClasses(jl,E),className:"w-full",renderOverlay:Un,children:n.jsx($e,{id:ee,size:i,disabled:T,invalid:y,value:Ee,placeholder:X?void 0:c,readOnly:!0,iconBefore:t?void 0:he?.icon,iconAfter:n.jsx(H.IconChevronDown,{size:re?V.DIAL_ICON_SIZE.SM:V.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses(Al,de&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":de,"aria-controls":W,"aria-autocomplete":"none","aria-label":Vn,containerClassName:"w-full",wrapperClassName:I.mergeClasses(!T&&"cursor-pointer",t&&Ge&&["!h-auto flex-wrap py-1.5",re?"min-h-[24px]":"min-h-[40px]"],O),className:I.mergeClasses("cursor-pointer",X&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Gn,children:X})}),n.jsx(Le,{text:d}),!d&&n.jsx(Pe,{text:f})]})]})};var zn=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(zn||{});const Hr={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Fl=e=>typeof e=="boolean"?Hr[e?"both":"none"]:Hr[e],Bl=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...u})=>{const d=I.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",u.invalid&&"dial-kit-input-error",u.disabled&&"dial-kit-input-disable",Fl(i),e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",a),children:[o&&n.jsx(F.Label,{...o,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:d,onChange:f=>r?.(f.currentTarget.value),...u}),n.jsx(Le,{text:s}),!s&&n.jsx(Pe,{text:l})]})]})},zl=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=w.ElementSize.Standard,...a})=>{const[i,o]=h.useState(!1),l=i&&!r;return n.jsx($e,{...a,size:s,disabled:r,type:l?"text":"password",iconAfter:n.jsx(F.GhostIconButton,{size:w.ElementSize.Small,disabled:r,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx(H.IconEyeOff,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(H.IconEye,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>o(c=>!c)})})},$l=/^0+\.(\d+)?$/,Hl=/^0+/,Vl=[".","-","+","e","E"],Vr=e=>!e||e==="-"?e:String(e).match($l)?String(e).replace(Hl,"0"):Number(e),Gl=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=u=>{if(e&&Vl.includes(u.key)){u.preventDefault();return}Pn(u,"number",r,s),a?.(u)},c=u=>{if(e){const d=u.clipboardData.getData("text"),f=d.replace(/\D/g,"");if(f!==d&&(u.preventDefault(),f)){const g=u.currentTarget,p=g.selectionStart??0,m=g.selectionEnd??0,v=g.value.slice(0,p)+f+g.value.slice(m);t?.(Vr(v))}}i?.(u)};return n.jsx($e,{...o,type:"number",min:r,max:s,onChange:u=>t?.(Vr(u)),onKeyDown:l,onPaste:c})},Ul="z-[52] flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Kl="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Wl="flex flex-row items-center justify-between px-6 py-4",ql="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",Zl="border-b border-tertiary",Yl="flex flex-row items-center gap-2 px-6 py-4",Xl="border-t border-tertiary",Ht="flex shrink-0 flex-row items-center gap-2",Ql={[x.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[x.PopupSize.Md]:"max-w-full md:max-w-[800px]",[x.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},pr=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:i,titleClassName:o,headerClassName:l,bodyClassName:c,children:u,footer:d,footerClassName:f,onClose:g,onBack:p,backAriaLabel:m="Back",headerActions:v,headerDivider:b=!1,mainButtons:y,additionalButtons:C,additionalButtonsOnLeft:N=!1,footerDivider:S=!1,size:D=x.PopupSize.Md,hideClose:T=!1,closeAriaLabel:P="Close dialog",closeOnOutsideClick:O=!0,preventKeyboardOnOpen:E=!1})=>{const _=L.useThemeScope(),j=h.useRef(null),R=h.useId(),{refs:$,context:U}=ce.useFloating({open:e,onOpenChange:W=>{W||g?.(null)}}),te=ce.useRole(U,{role:"dialog"}),B=ce.useDismiss(U,{outsidePress:O}),{getFloatingProps:k}=ce.useInteractions([te,B]);if(!e)return null;const z=typeof t=="string"?`popup-heading-${R}`:void 0,Y=W=>W?typeof W=="string"?n.jsx("h2",{id:z,className:I.mergeClasses(ql,o),children:n.jsx(F.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:n.jsx("span",{}),J=T?null:n.jsx(F.CloseButton,{ariaLabel:P,onClose:W=>g?.(W)}),oe=(W,re=[])=>re.map(({variant:fe=w.ButtonVariant.Neutral,...ue},ae)=>n.jsx(Je,{variant:fe,...ue},`${W}-${ae}`)),ee=()=>{if(d!==void 0)return d;if(!y?.length&&!C?.length)return null;const W=oe("additional",C);return n.jsxs("div",{className:I.mergeClasses(Yl,S&&Xl,f),children:[N&&W.length>0&&n.jsx("div",{className:Ht,children:W}),n.jsxs("div",{className:I.mergeClasses(Ht,"ml-auto"),children:[!N&&W,oe("main",y)]})]})};return n.jsx(ce.FloatingPortal,{id:s,children:n.jsx(ce.FloatingOverlay,{className:I.mergeClasses(Ul,_,i),children:n.jsx(ce.FloatingFocusManager,{context:U,initialFocus:E?j:$.floating,children:n.jsxs("div",{ref:$.setFloating,...k(),role:"dialog","aria-modal":"true","aria-labelledby":z,"aria-label":z?void 0:r,className:I.mergeClasses(Kl,Ql[D],a),children:[E&&n.jsx("div",{ref:j,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:I.mergeClasses(Wl,b&&Zl,l),children:[p&&n.jsx(F.GhostIconButton,{"aria-label":m,size:w.ElementSize.Small,className:"mr-2",onClick:p,icon:n.jsx(H.IconChevronLeft,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),Y(t),v?n.jsxs("div",{className:Ht,children:[v,J]}):J]}),n.jsx("div",{className:I.mergeClasses("grow overflow-auto",c),children:u}),ee()]})})})})},Jl="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",ec="text-secondary dial-small-paragraph-text px-6 pb-4",tc="px-6 py-4 h-[120px]",rc="Cancel",nc="Ok",Vt={[x.ConfirmationPopupVariant.Info]:{confirm:{variant:w.ButtonVariant.Primary,appearance:w.ButtonAppearance.Solid}},[x.ConfirmationPopupVariant.Danger]:{container:"border-t-4 border-error",confirm:{variant:w.ButtonVariant.Danger,appearance:w.ButtonAppearance.Solid}}},sc=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=nc,cancelLabel:i=rc,isLoading:o=!1,disableConfirmButton:l=!1,className:c,confirmClassName:u,onClose:d,onConfirm:f,onCancel:g,children:p,variant:m=x.ConfirmationPopupVariant.Info,size:v=x.PopupSize.Sm,footer:b,hideClose:y,...C})=>{const N=o?null:n.jsxs("div",{className:Jl,children:[n.jsx(fr,{label:i,onClick:()=>g?g():d?.()}),n.jsx(Je,{variant:Vt[m].confirm.variant,appearance:Vt[m].confirm.appearance,className:u,label:a,disabled:l,onClick:f})]}),S=h.useCallback(()=>o?n.jsx("div",{className:tc,children:n.jsx(x.Spinner,{size:40})}):p??(t?n.jsx("div",{className:I.mergeClasses(ec,r),children:t}):null),[p,t,o,r]);return n.jsx(pr,{...C,open:s,header:e,className:I.mergeClasses(Vt[m].container,c),onClose:()=>d?.(),footer:b??N,size:v,hideClose:y??(!o&&b===void 0),children:S()})},ac=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,ariaLabel:l,onToggle:c,className:u,headerClassName:d,contentClassName:f})=>{const g=s!==void 0,[p,m]=h.useState(a),v=o?!0:g?s:p,b=h.useId(),y=`accordion-header-${b}`,C=`accordion-content-${b}`,N=()=>{if(i)return;const D=!v;g||m(D),c?.(D)},S=n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"flex min-w-0 flex-col",children:[n.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?n.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!o&&n.jsx(H.IconChevronRight,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",v&&"rotate-90")})]});return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-3 py-3 overflow-hidden bg-transparent ",u),children:[o?n.jsx("div",{id:y,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",d),children:S}):n.jsx("button",{id:y,type:"button","aria-expanded":v,"aria-controls":v?C:void 0,"aria-label":w.resolveAccessibleName(l),disabled:i,onClick:N,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",i?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",d),children:S}),v&&n.jsx("div",{id:C,role:"region","aria-labelledby":y,className:I.mergeClasses("px-4 dial-small-text text-primary",f),children:r})]})},ic=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:i,className:o,...l})=>{const c=h.useId(),u=e??c,d=i?`${u}-caption`:void 0,f=h.useCallback(g=>{a?.(g.target.checked)},[a]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:I.mergeClasses("flex items-center gap-2",o),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:u,checked:r,"aria-checked":r,disabled:s,onChange:f,"aria-label":w.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":d,className:"peer sr-only"}),n.jsx("label",{htmlFor:u,className:I.mergeClasses("flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",r?"justify-end":"justify-start",s?"cursor-not-allowed bg-control-disable-primary":I.mergeClasses("cursor-pointer",r?"bg-control-accent hover:bg-control-accent-hover":"bg-control-neutral-default hover:bg-control-neutral-hover-strong")),children:n.jsx("span",{className:I.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&n.jsx(F.Label,{size:w.ElementSize.Standard,...t,htmlFor:u,className:I.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),i&&n.jsx("span",{id:d,className:"dial-tiny-text text-secondary ml-[44px]",children:i})]})},oc="flex flex-col gap-2",lc="flex",cc="mt-2 ml-[26px]",dc={[x.RadioGroupOrientation.Column]:"flex-col gap-y-3",[x.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},$n=({items:e,value:t,onChange:r,name:s,id:a,orientation:i=x.RadioGroupOrientation.Column,labelProps:o,disabled:l,error:c,caption:u,ariaLabel:d,className:f,optionsClassName:g,radioClassName:p,contentClassName:m})=>{const v=h.useId(),b=a??v,y=`${b}-label`,C=c?`${b}-error`:void 0,N=!c&&u?`${b}-caption`:void 0,S=w.resolveAccessibleName(o?.label);return n.jsxs("div",{className:I.mergeClasses(oc,f),children:[o&&n.jsx(F.Label,{...o,id:y}),n.jsx("div",{role:"radiogroup","aria-labelledby":S?y:void 0,"aria-label":S?void 0:w.resolveAccessibleName(d),"aria-describedby":[C,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:I.mergeClasses(lc,dc[i],g),children:e.map(D=>{const T=D.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(F.Radio,{id:`${b}-${D.value}`,name:s??b,value:D.value,labelProps:D.label==null?void 0:{label:D.label},"aria-label":D["aria-label"],caption:D.caption,isSelected:T,disabled:l||D.disabled,onChange:r,className:p}),T&&D.content?n.jsx("div",{className:I.mergeClasses(cc,m),children:D.content}):null]},D.value)})}),n.jsx(Le,{id:C,text:c}),!c&&n.jsx(Pe,{id:N,text:u})]})},uc="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",fc="min-w-0 flex-1 truncate text-primary",pc="min-w-0 flex-1 truncate text-secondary",gc="shrink-0 text-secondary",hc="px-6 pb-4",mc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",xc="Cancel",bc="Apply",yc=({items:e,value:t,customValue:r,header:s,onApply:a,id:i,labelProps:o,placeholder:l,selectedValue:c,onSelectionChange:u,onCancel:d,onClose:f,isValid:g=!0,applyButtonLabel:p=bc,cancelButtonLabel:m=xc,size:v=x.PopupSize.Md,portalId:b,disabled:y,invalid:C,error:N,caption:S,ariaLabel:D,className:T,fieldClassName:P})=>{const O=h.useId(),E=i??O,_=`${E}-label`,j=`${E}-value`,R=N?`${E}-error`:void 0,$=!N&&S?`${E}-caption`:void 0,[U,te]=h.useState(!1),B=c!==void 0,[k,z]=h.useState(t),Y=B?c:k,J=h.useCallback(()=>{y||(B||z(t),te(!0))},[y,B,t]),oe=h.useCallback(()=>{te(!1),f?.()},[f]),ee=h.useCallback(()=>{d?.(),oe()},[d,oe]),W=h.useCallback(()=>{a(Y),oe()},[a,Y,oe]),re=h.useCallback(G=>{B||z(G),u?.(G)},[B,u]),fe=w.resolveAccessibleName(o?.label),ue=fe?void 0:w.resolveAccessibleName(D),ae=fe?_:ue&&`${E}-name`,de=w.resolveAccessibleName(s),pe=e.find(G=>G.value===t)?.label,me=r??pe;return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",T),children:[o&&n.jsx(F.Label,{...o,id:_,htmlFor:E}),n.jsxs("div",{className:"flex flex-col gap-1",children:[ue&&n.jsx("span",{id:ae,className:"sr-only",children:ue}),n.jsxs("button",{type:"button",id:E,disabled:y,"aria-haspopup":"dialog","aria-expanded":U,"aria-labelledby":ae?`${ae} ${j}`:void 0,"aria-describedby":[R,$].filter(Boolean).join(" ")||void 0,onClick:J,className:I.mergeClasses(uc,C&&"dial-kit-input-error",y&&"dial-kit-input-disable",P),children:[n.jsx("span",{id:j,className:me==null?pc:fc,children:me??l}),n.jsx(H.IconMaximize,{size:V.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:gc})]}),n.jsx(Le,{id:R,text:N}),!N&&n.jsx(Pe,{id:$,text:S})]}),n.jsx(pr,{open:U,header:s,ariaLabel:de?void 0:fe,portalId:b,size:v,onClose:ee,footer:n.jsxs("div",{className:mc,children:[n.jsx(fr,{label:m,onClick:ee}),n.jsx(Rn,{label:p,disabled:!g,onClick:W})]}),children:n.jsx("div",{className:hc,children:n.jsx($n,{id:`${E}-options`,items:e,value:Y,onChange:re,orientation:x.RadioGroupOrientation.Column,ariaLabel:fe??de})})})]})},vc=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:i,size:o=w.ElementSize.Small,className:l,...c})=>{const u=h.useCallback(f=>{a?.(f),s?.(!r)},[a,s,r]),d=n.jsx(F.IconButton,{...c,size:o,variant:w.ButtonVariant.Primary,appearance:w.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":w.resolveAccessibleName(c["aria-label"],i?.tooltip),onClick:u,className:I.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l)});return i?n.jsx(F.Tooltip,{asChild:!0,...i,children:d}):d},Dc=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Cc="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Nc="flex h-8 min-w-8 flex-1 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-full px-4 dial-small-text transition-colors duration-200 outline-offset-0 focus-visible:outline focus-visible:outline-focus",Ic="bg-layer-raised text-accent shadow-xs",Sc="bg-transparent text-secondary",jc="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Tc="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",wc="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",Ec="cursor-not-allowed bg-transparent text-control-disable-primary",Oc=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:i,"aria-label":o})=>{const l=h.useRef({}),c=e.find(f=>f.value===t),u=c&&!c.disabled?c.value:e.find(f=>!f.disabled)?.value,d=h.useCallback(f=>{if(s||!Dc.includes(f.key))return;const g=e.filter(y=>!y.disabled);if(g.length===0)return;const p=Math.max(g.findIndex(y=>y.value===t),0),m=g.length-1;let v=p;switch(f.key){case"ArrowRight":case"ArrowDown":v=p===m?0:p+1;break;case"ArrowLeft":case"ArrowUp":v=p===0?m:p-1;break;case"Home":v=0;break;case"End":v=m;break}f.preventDefault();const b=g[v];l.current[b.value]?.focus(),b.value!==t&&r(b.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":o,"aria-disabled":s||void 0,onKeyDown:d,className:I.mergeClasses(Cc,a),children:e.map(f=>{const g=f.value===t,p=s||f.disabled;return n.jsxs("button",{ref:m=>{l.current[f.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":w.resolveAccessibleName(f["aria-label"],typeof f.label=="string"?f.label:void 0),tabIndex:f.value===u?0:-1,disabled:p,onClick:()=>r(f.value),className:I.mergeClasses(Nc,g?Ic:Sc,p?g?wc:Ec:g?jc:Tc,i),children:[f.icon,f.label]},f.value)})})},Ac=["ArrowRight","ArrowLeft","Home","End"],_c=({tabs:e,activeTabId:t,onTabChange:r,ariaLabel:s,className:a,tabClassName:i})=>{const o=h.useRef({}),l=e.find(d=>d.id===t),c=l&&!l.disabled?l.id:e.find(d=>!d.disabled)?.id,u=h.useCallback(d=>{if(!Ac.includes(d.key)||e.length===0)return;const f=e.filter(b=>!b.disabled);if(f.length===0)return;const g=Math.max(f.findIndex(b=>b.id===t),0),p=f.length-1;let m=g;switch(d.key){case"ArrowRight":m=g===p?0:g+1;break;case"ArrowLeft":m=g===0?p:g-1;break;case"Home":m=0;break;case"End":m=p;break}d.preventDefault();const v=f[m];o.current[v.id]?.focus(),v.id!==t&&r(v.id)},[e,t,r]);return n.jsx("div",{role:"tablist","aria-label":s,onKeyDown:u,className:I.mergeClasses("flex justify-start gap-1",a),children:e.map(d=>{const f=t===d.id,g=!!d.disabled;return n.jsxs("button",{ref:p=>{o.current[d.id]=p},type:"button",role:"tab","aria-selected":f,disabled:g,tabIndex:d.id===c?0:-1,onClick:()=>r(d.id),className:I.mergeClasses("dial-small-paragraph-semi-text dial-kit-enhanced-target","border-b-2 border-transparent flex items-center gap-2 px-3 py-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",g&&"cursor-not-allowed border-control-disable-primary text-control-disable-primary",!g&&(f?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),i),children:[n.jsx("span",{children:d.label}),d.count!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"bg-layer-sunken text-control-disable-primary",!g&&(f?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:d.count})]},d.id)})})},Qt=(e,t)=>{const r=(t??"").split(",").map(i=>i.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(i=>{if(i.startsWith("."))return s.endsWith(i);if(i.endsWith("/*")){const o=i.slice(0,-1);return a.length>o.length&&a.startsWith(o)}return a===i})},Rc=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:i,multiple:o=!1,disabled:l=!1,errorText:c,icon:u,id:d,ariaLabel:f,className:g})=>{const p=h.useId(),m=d??`file-dropzone-${p}`,v=c?`${m}-error`:void 0,[b,y]=h.useState(!1),C=h.useRef(0),N=h.useCallback(_=>{if(_.length===0)return;const j=o?_:_.slice(0,1),R=j.filter(U=>Qt(U,i)),$=j.filter(U=>!Qt(U,i));$.length>0&&a?.($),R.length>0&&s(R)},[i,o,s,a]),S=h.useCallback(_=>{N(Array.from(_.target.files??[])),_.target.value=""},[N]),D=h.useCallback(()=>{C.current=0,y(!1)},[]),T=h.useCallback(_=>{l||(_.preventDefault(),C.current+=1,y(!0))},[l]),P=h.useCallback(_=>{l||(_.preventDefault(),_.dataTransfer.dropEffect="copy")},[l]),O=h.useCallback(()=>{l||(C.current-=1,C.current<=0&&D())},[l,D]),E=h.useCallback(_=>{_.preventDefault(),!l&&(D(),N(Array.from(_.dataTransfer?.files??[])))},[l,D,N]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(F.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:i,multiple:o,disabled:l,onChange:S,"aria-label":w.resolveAccessibleName(typeof t!="string"?f:void 0),"aria-describedby":v,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:T,onDragOver:P,onDragLeave:O,onDrop:E,className:I.mergeClasses("flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center","transition-colors motion-reduce:transition-none","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",l?"cursor-not-allowed border-secondary bg-layer-sunken":"cursor-pointer bg-layer-base",!l&&b&&"border-accent bg-control-accent-alpha",!l&&!b&&"border-secondary hover:border-accent",c&&!b&&"border-error hover:border-error",g),children:[u??n.jsx(H.IconUpload,{size:V.DIAL_ICON_SIZE.LG,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),n.jsxs("span",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:I.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&n.jsx("span",{className:I.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),n.jsx(Le,{id:v,text:c})]})},kc=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:s})=>{if(e<=0)return t.length;let a=0,i=0;for(const o of t){const l=o+s;if(a+l>e)break;a+=l,i++}if(i===t.length)return i;for(;i>0&&a+r>e;)i--,a-=t[i]+s;return i},Pc=4,Lc=24,Gr=e=>parseFloat(e)||0,Mc=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Fc=()=>{},Bc=({id:e,value:t,defaultValue:r,size:s=w.ElementSize.Standard,labelProps:a,placeholder:i,caption:o,error:l,invalid:c,disabled:u=!1,readOnly:d=!1,collapseTagOverflow:f=!1,ariaLabel:g,tagListLabel:p="Tags",className:m,fieldClassName:v,tagClassName:b,onChange:y})=>{const C=h.useId(),N=e||C,S=s===w.ElementSize.Small,D=h.useRef(null),T=h.useRef([]),P=h.useRef(null),O=t!==void 0,[E,_]=h.useState(r??[]),j=O?t:E,R=j.length,[$,U]=h.useState(""),[te,B]=h.useState(R),k=!d&&!u,z=h.useCallback(G=>{O||_(G),y?.(G)},[O,y]),Y=h.useCallback(G=>Z=>{T.current[G]=Z},[]),J=h.useCallback(()=>{const G=D.current;if(!G||G.clientWidth===0){B(j.length);return}const{paddingLeft:Z,paddingRight:Se}=getComputedStyle(G);B(kc({availableWidth:G.clientWidth-Gr(Z)-Gr(Se)-(d?0:Lc),tagWidths:j.map((et,xe)=>T.current[xe]?.offsetWidth??0),overflowChipWidth:P.current?.offsetWidth??0,gap:Pc}))},[d,j]);h.useEffect(()=>{if(!f){B(R);return}const G=D.current;if(!G)return;const Z=new ResizeObserver(()=>J());return Z.observe(G),J(),()=>Z.disconnect()},[f,J,R]);const oe=I.mergeClasses(f?"shrink-0":"min-w-0",b),ee=G=>{const Z=Mc(G.trim()).trim();!Z||j.includes(Z)||z([...j,Z])},W=G=>{z(j.filter(Z=>Z!==G))},re=()=>{ee($),U("")},fe=G=>{if(k){if(G.key==="Enter"||G.key===","){G.preventDefault(),re();return}G.key==="Backspace"&&!$&&R>0&&(G.preventDefault(),z(j.slice(0,-1)))}},ue=()=>{k&&$.trim()&&re()},ae=f?j.slice(0,te):j,de=f?j.slice(te):[],pe=de.join(", "),me=R>0&&n.jsxs("span",{role:"list","aria-label":p,className:I.mergeClasses("relative flex min-w-0 items-center gap-1",f?"flex-nowrap":"flex-wrap"),children:[ae.map(G=>n.jsx(qe,{role:"listitem",label:G,className:oe,disabled:u,closable:k,onRemove:k?()=>W(G):void 0},G)),de.length>0&&n.jsx(qe,{role:"listitem",label:`+${de.length}`,"aria-label":pe,title:pe,className:I.mergeClasses("shrink-0",b),disabled:u}),f&&n.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[j.map((G,Z)=>n.jsx("span",{ref:Y(Z),className:"inline-flex",children:n.jsx(qe,{label:G,className:b,disabled:u,closable:k,onRemove:k?Fc:void 0})},G)),n.jsx("span",{ref:P,className:"inline-flex",children:n.jsx(qe,{label:`+${R}`,className:b})})]})]});return n.jsx($e,{id:N,size:s,labelProps:a,caption:o,error:l,invalid:c,disabled:u,readOnly:d,value:$,placeholder:R>0?void 0:i,"aria-label":g,wrapperRef:D,onChange:G=>U(G??""),onKeyDown:fe,onBlur:ue,containerClassName:I.mergeClasses("w-full",m),wrapperClassName:I.mergeClasses(R>0&&["!h-auto",S?"min-h-[24px] py-0.5":"min-h-[40px] py-1.5",f?"flex-nowrap overflow-hidden":"flex-wrap"],v),className:I.mergeClasses("w-auto flex-1",f?"min-w-[24px]":"min-w-[100px]",d&&"cursor-default"),children:me})},zc={[w.ElementSize.Small]:V.DIAL_ICON_SIZE.SM,[w.ElementSize.Standard]:V.DIAL_ICON_SIZE.MD,[w.ElementSize.Large]:V.DIAL_ICON_SIZE.MD},$c=({size:e=w.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:i,onChange:o,wrapperClassName:l,inputRef:c,...u})=>{const d=h.useRef(null),f=ce.useMergeRefs([c,d]),g=!!i&&!a,p=h.useCallback(()=>{o?.(void 0),d.current?.focus()},[o]);return n.jsx($e,{...u,size:e,value:i,disabled:a,onChange:o,placeholder:t,inputRef:f,wrapperClassName:I.mergeClasses(r&&"dial-kit-input-borderless",l),iconBefore:n.jsx(H.IconSearch,{size:zc[e],stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(F.GhostIconButton,{size:w.ElementSize.Small,"aria-label":s,icon:n.jsx(H.IconX,{size:V.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:p}):void 0})},Hc=16,Vc=e=>(e.toString().split(".")[1]??"").length,Gc=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:i,labelProps:o,labels:l,formatValue:c,showValue:u=!1,caption:d,error:f,onChange:g,containerClassName:p,trackClassName:m,fillClassName:v,className:b,...y})=>{const C=h.useId(),N=e??C,S=d&&!f?`${N}-caption`:void 0,D=f?`${N}-error`:void 0,T=s-r,P=T>0?Math.min(100,Math.max(0,(t-r)/T*100)):0,O=`calc(${P}% + ${(.5-P/100)*Hc}px)`,E=c?c(t):t.toFixed(Vc(a)),_=h.useCallback(j=>{g?.(Number(j.target.value))},[g]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",p),children:[(o||u)&&n.jsxs("div",{className:"flex items-center gap-2",children:[o&&n.jsx(F.Label,{...o,htmlFor:N}),u&&n.jsx("span",{"aria-hidden":"true",className:I.mergeClasses("dial-small-text ml-auto",i?"text-control-disable-primary":"text-primary"),children:E})]}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"relative flex h-6 items-center",children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",i?"bg-control-disable-primary":"bg-control-neutral-active",m)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",i?"bg-control-disable-secondary":"bg-control-accent",v),style:{width:O}}),n.jsx("input",{...y,type:"range",id:N,value:t,min:r,max:s,step:a,disabled:i,onChange:_,"aria-label":w.resolveAccessibleName(typeof o?.label!="string"?y["aria-label"]:void 0),"aria-valuetext":c?E:void 0,"aria-describedby":D??S,className:I.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",b)})]}),l&&n.jsx("div",{className:"dial-tiny-text flex text-secondary",children:l.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"flex-1 text-center",children:l[1]}),n.jsx("span",{children:l[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"ml-auto",children:l[1]})]})}),n.jsx(Le,{id:D,text:f}),!f&&n.jsx(Pe,{id:S,text:d})]})]})},Uc=48,Kc=({children:e,title:t,width:r=280,collapsedWidth:s=Uc,isOpened:a,defaultOpened:i=!0,onToggle:o,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:d="Expand sidebar",className:f,titleClassName:g,contentClassName:p,footerClassName:m})=>{const v=a!==void 0,[b,y]=h.useState(i),C=v?a:b,N=`collapsible-sidebar-content-${h.useId()}`,S=C?u:d,D=T=>{const P=!C;v||y(P),o?.(P,T)};return n.jsxs("aside",{"aria-label":c,style:{width:`${C?r:s}px`},className:I.mergeClasses("flex flex-col justify-between",f),children:[n.jsx("div",{id:N,hidden:!C,className:I.mergeClasses("min-h-0 flex-1 overflow-auto p-4",p),children:e}),n.jsx("div",{hidden:C,className:I.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),n.jsxs("div",{className:I.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",C?"justify-end px-2":"justify-center",m),children:[C&&l,n.jsx(F.IconButton,{variant:w.ButtonVariant.Primary,appearance:w.ButtonAppearance.Ghost,size:w.ElementSize.Standard,onClick:D,"aria-label":S,"aria-expanded":C,"aria-controls":N,tooltipProps:{tooltip:S},icon:C?n.jsx(H.IconChevronsLeft,{size:V.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(H.IconChevronsRight,{size:V.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},Wc=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:i,ariaLabel:o,onWidthChange:l,customHandler:c,handlerClassName:u})=>{const d=e===x.ResizableContainerSide.Left,f=d?H.IconChevronLeft:H.IconChevronRight,g=p=>{let m;switch(p.key){case"ArrowLeft":m=r+(d?i:-i);break;case"ArrowRight":m=r+(d?-i:i);break;case"Home":m=s;break;case"End":m=a;break;default:return}p.preventDefault(),l(m)};return n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":r,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:I.mergeClasses("relative h-full w-0.5 cursor-col-resize bg-control-accent text-accent","opacity-0 transition-opacity motion-reduce:transition-none","group-hover:opacity-100 focus-visible:opacity-100","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",t&&"opacity-100",u),children:c??n.jsx(f,{size:V.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",d?"right-full":"left-full")})})},qc=16,Hn=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:i,onResize:o,side:l=x.ResizableContainerSide.Right,keyboardStep:c=qc,ariaLabel:u="Resize panel",className:d,resizeHandlerClassName:f,resizeHandler:g})=>{const[p,m]=h.useState(!1),[v,b]=h.useState(a??t),y=s!==void 0,C=y?s:v,N=h.useRef(null),S=h.useCallback(()=>{m(!0)},[]),D=h.useCallback(()=>{m(!1);const O=N.current?.resizable?.getBoundingClientRect(),E=O?Math.round(O.width):t;y||b(E),i?.(E)},[i,y,t]),T=h.useCallback(O=>{const E=Math.min(r,Math.max(t,O));E!==C&&(y||(b(E),N.current?.updateSize({width:E,height:"100%"})),o?.(E),i?.(E))},[r,t,C,y,o,i]),P=h.useMemo(()=>{const O=l===x.ResizableContainerSide.Left,E=n.jsx(Wc,{side:l,isResizing:p,width:C,minWidth:t,maxWidth:r,step:c,ariaLabel:u,onWidthChange:T,customHandler:g,handlerClassName:f});return{size:y?{width:C,height:"100%"}:void 0,defaultSize:y?void 0:{width:C,height:"100%"},minWidth:t,maxWidth:r,enable:{left:O,right:!O},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:O?E:void 0,right:O?void 0:E},onResizeStart:S,onResize:(_,j,R)=>{o?.(Math.round(R.offsetWidth))},onResizeStop:D}},[l,y,C,t,r,c,u,T,g,f,p,S,D,o]);return n.jsx(x.Resizable,{ref:N,...P,children:n.jsx("div",{className:I.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",d),children:e})})},Zc=({enabled:e=!0,children:t,...r})=>e?n.jsx(Hn,{...r,children:t}):t,Yc=()=>Promise.resolve().then(()=>require("./JsonEditor-pdzI3xkJ.cjs")),Xc=()=>Promise.resolve().then(()=>require("./MarkdownEditor-Dea4eQpw.cjs")),Qc=()=>Promise.resolve().then(()=>require("./MarkdownEditor-CNEY8i7O.cjs"));exports.ConfirmationPopupVariant=x.ConfirmationPopupVariant;exports.DialBreadcrumb=x.DialBreadcrumb;exports.DialBreadcrumbItem=x.DialBreadcrumbItem;exports.DialButton=x.DialButton;exports.DialButtonDropdown=x.DialButtonDropdown;exports.DialCaptionText=x.DialCaptionText;exports.DialCollapsibleSidebar=x.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=x.DialConditionalResizableContainer;exports.DialConfirmationPopup=x.DialConfirmationPopup;exports.DialDangerButton=x.DialDangerButton;exports.DialDestinationFolderPopup=x.DialDestinationFolderPopup;exports.DialErrorText=x.DialErrorText;exports.DialFileIcon=x.DialFileIcon;exports.DialFileManager=x.DialFileManager;exports.DialFileManagerActions=x.DialFileManagerActions;exports.DialFileManagerTabs=x.DialFileManagerTabs;exports.DialFileName=x.DialFileName;exports.DialFileNodeType=x.DialFileNodeType;exports.DialFilePermission=x.DialFilePermission;exports.DialFileResourceType=x.DialFileResourceType;exports.DialFolderName=x.DialFolderName;exports.DialFoldersTree=x.DialFoldersTree;exports.DialFormItem=x.DialFormItem;exports.DialGhostButton=x.DialGhostButton;exports.DialInput=x.DialInput;exports.DialItemType=x.DialItemType;exports.DialLinkButton=x.DialLinkButton;exports.DialLoader=x.DialLoader;exports.DialNeutralButton=x.DialNeutralButton;exports.DialNotification=x.DialNotification;exports.DialPopup=x.DialPopup;exports.DialPrimaryButton=x.DialPrimaryButton;exports.DialRadioGroup=x.DialRadioGroup;exports.DialResizableContainer=x.DialResizableContainer;exports.DialSearch=x.DialSearch;exports.DialSharedEntityIndicator=x.DialSharedEntityIndicator;exports.DialTabs=x.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=x.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=x.FileManagerColumnKey;exports.FileManagerProvider=x.FileManagerProvider;exports.FlexibleActionsDirection=x.FlexibleActionsDirection;exports.FormItemOrientation=x.FormItemOrientation;exports.NAME_COLUMN=x.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=x.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=x.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=x.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=x.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=x.NotificationType;exports.NotificationVariant=x.NotificationVariant;exports.PopupSize=x.PopupSize;exports.RadioGroupOrientation=x.RadioGroupOrientation;exports.ResizableContainerSide=x.ResizableContainerSide;exports.SIZE_COLUMN=x.SIZE_COLUMN;exports.ScreenResolution=x.ScreenResolution;exports.Skeleton=x.Skeleton;exports.SkeletonAvatarShape=x.SkeletonAvatarShape;exports.SkeletonAvatarSize=x.SkeletonAvatarSize;exports.SkeletonVariant=x.SkeletonVariant;exports.Spinner=x.Spinner;exports.TabOrientation=x.TabOrientation;exports.TabView=x.TabView;exports.UPDATED_AT_COLUMN=x.UPDATED_AT_COLUMN;exports.editableContainerProps=x.editableContainerProps;exports.useDialFileManagerTabs=x.useDialFileManagerTabs;exports.useEditableItem=x.useEditableItem;exports.useFileManagerContext=x.useFileManagerContext;exports.DialLabel=Re.DialLabel;exports.DialSwitch=Re.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=L.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=L.DEFAULT_LOCALE;exports.DialCloseButton=L.DialCloseButton;exports.DialDangerIconButton=L.DialDangerIconButton;exports.DialDateCellRenderer=L.DialDateCellRenderer;exports.DialDropdown=L.DialDropdown;exports.DialEllipsisTooltip=L.DialEllipsisTooltip;exports.DialGhostIconButton=L.DialGhostIconButton;exports.DialGrid=L.DialGrid;exports.DialIcon=L.DialIcon;exports.DialNeutralIconButton=L.DialNeutralIconButton;exports.DialNoDataContent=L.DialNoDataContent;exports.DialPrimaryIconButton=L.DialPrimaryIconButton;exports.DialRadioButton=L.DialRadioButton;exports.DialSecondaryIconButton=L.DialSecondaryIconButton;exports.DialSuccessIconButton=L.DialSuccessIconButton;exports.DialTertiaryIconButton=L.DialTertiaryIconButton;exports.DropdownItemType=L.DropdownItemType;exports.DropdownTrigger=L.DropdownTrigger;exports.DropdownType=L.DropdownType;exports.GridSelectionMode=L.GridSelectionMode;exports.ThemeScope=L.ThemeScope;exports.baseColumnComparator=L.baseColumnComparator;exports.checkColDefsChanges=L.checkColDefsChanges;exports.convertGridDateToDate=L.convertToDate;exports.convertToDate=L.convertToDate;exports.useThemeScope=L.useThemeScope;exports.BASE_ICON_PROPS=V.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=V.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=V.DIAL_ICON_SIZE;exports.mergeClasses=I.mergeClasses;exports.Checkbox=F.Checkbox;exports.CheckboxBox=F.CheckboxBox;exports.CloseButton=F.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=F.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=F.DEFAULT_LOCALE;exports.DangerIconButton=F.DangerIconButton;exports.DateCellRenderer=F.DateCellRenderer;exports.Dropdown=F.Dropdown;exports.EllipsisTooltip=F.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=F.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=F.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=F.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=F.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=F.GRID_THEME_PARAMS;exports.GhostIconButton=F.GhostIconButton;exports.Grid=F.Grid;exports.IconButton=F.IconButton;exports.InfoButton=F.InfoButton;exports.Label=F.Label;exports.NeutralIconButton=F.NeutralIconButton;exports.NoDataContent=F.NoDataContent;exports.PrimaryIconButton=F.PrimaryIconButton;exports.Radio=F.Radio;exports.StaticIconButton=F.StaticIconButton;exports.Tooltip=F.Tooltip;exports.TooltipContainer=F.TooltipContainer;exports.TooltipContent=F.TooltipContent;exports.TooltipPlacement=F.TooltipPlacement;exports.TooltipTrigger=F.TooltipTrigger;exports.ButtonAppearance=w.ButtonAppearance;exports.ButtonVariant=w.ButtonVariant;exports.DialIconButton=w.DialIconButton;exports.DialTooltip=w.DialTooltip;exports.DialTooltipContainer=w.DialTooltipContainer;exports.DialTooltipContent=w.DialTooltipContent;exports.DialTooltipTrigger=w.DialTooltipTrigger;exports.ElementSize=w.ElementSize;exports.EditorThemes=Ur.EditorThemes;exports.DIAL_KIT_ICON_STROKE=ne.DIAL_KIT_ICON_STROKE;exports.Accordion=ac;exports.AnalyticsCardVariant=it;exports.Button=Je;exports.ButtonDropdown=gl;exports.Calendar=il;exports.CalendarMode=ve;exports.CaptionText=Pe;exports.CardShell=_o;exports.CollapsibleSidebar=Kc;exports.ConditionalResizableContainer=Zc;exports.ConfirmationPopup=sc;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=er;exports.DangerButton=ll;exports.DialAccordion=Kr;exports.DialAnalyticsBar=ut;exports.DialAnalyticsBarGroup=es;exports.DialAnalyticsCard=Xn;exports.DialAnalyticsErrorTag=Jt;exports.DialAnalyticsHistogram=as;exports.DialAutocompleteInputValue=ln;exports.DialCheckbox=Gt;exports.DialDraggableItem=yi;exports.DialDropdownIcon=co;exports.DialFormPopup=_i;exports.DialInputPopup=cn;exports.DialLabelledText=xs;exports.DialLoadFileArea=bn;exports.DialLoadFileAreaField=lo;exports.DialNumberInput=Zt;exports.DialPagination=us;exports.DialPasswordInput=dn;exports.DialRadioGroupPopupField=wi;exports.DialRemoveButton=St;exports.DialSchemaRenderer=So;exports.DialSegmentedControl=ji;exports.DialSelect=ke;exports.DialSelectField=Gi;exports.DialSlider=ms;exports.DialSteps=hs;exports.DialTag=Be;exports.DialTagInput=on;exports.DialTextarea=vi;exports.ErrorMessageNotification=Bo;exports.ErrorText=Le;exports.ErrorToastNotification=Ro;exports.FabButton=fl;exports.FileDropzone=Rc;exports.FolderPath=ol;exports.GeneralMessageNotification=Go;exports.GeneralToastNotification=Fo;exports.GhostButton=dl;exports.Highlight=Ao;exports.InfoMessageNotification=zo;exports.InfoToastNotification=ko;exports.InlineSelect=hl;exports.InlineSelectTrigger=kn;exports.Input=$e;exports.JsonSchemaType=Q;exports.LazyDialJsonEditor=Yc;exports.LazyDialMarkdownEditor=Xc;exports.LazyMarkdownEditor=Qc;exports.LinkButton=cl;exports.LoadingMessageNotification=Vo;exports.LoadingToastNotification=Mo;exports.MultiSelectTags=Fn;exports.NeutralButton=fr;exports.Notification=cr;exports.NumberInput=Gl;exports.OutlinedButton=ul;exports.PasswordInput=zl;exports.Popup=pr;exports.PrimaryButton=Rn;exports.ProgressBar=is;exports.RadioGroup=$n;exports.RadioGroupPopupField=yc;exports.ResizableContainer=Hn;exports.SchemaDisplayMode=ot;exports.SchemaOrientation=Tt;exports.SchemaRendererVariant=We;exports.Search=$c;exports.SegmentedControl=Oc;exports.Select=Ml;exports.SelectSize=ht;exports.SelectVariant=mt;exports.Slider=Gc;exports.StepStatus=De;exports.SuccessMessageNotification=$o;exports.SuccessToastNotification=Po;exports.Switch=ic;exports.Tabs=_c;exports.Tag=qe;exports.TagAppearance=Ze;exports.TagInput=Bc;exports.Textarea=Bl;exports.TextareaResize=zn;exports.ToggleIconButton=vc;exports.WarningMessageNotification=Ho;exports.WarningToastNotification=Lo;exports.matchesAccept=Qt;exports.wrapInRootFolder=mo;