@epam/ai-dial-ui-kit 0.15.0-dev.22 → 0.15.0-dev.23

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 b=require("./use-file-manager-tabs-4s-dbnmu.cjs"),ke=require("./Switch-CfxMs3AZ.cjs"),n=require("react/jsx-runtime"),h=require("react"),F=require("@tabler/icons-react"),oe=require("classnames"),j=require("./DateCellRenderer-ZLb4GAUV.cjs"),z=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-BEJXjzkx.cjs"),R=require("./DateCellRenderer-CkFOYZGc.cjs"),E=require("./IconButton-CVttu-k-.cjs"),us=require("react-dom"),ut=require("./lazy-BEsZqouS.cjs"),de=require("@floating-ui/react"),ne=require("./icon-DhjrDQ8I.cjs");function fs(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 Dr=fs(h),Ke=({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(j.DialIcon,{icon:r}),n.jsx(j.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(b.DialButton,{className:"p-0",iconAfter:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},ar=({label:e="Error",className:t})=>n.jsx(Ke,{label:e,className:I.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var ot=(e=>(e.Default="default",e.Compact="compact",e))(ot||{});const ps={[ot.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[ot.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},gs=({title:e,value:t,description:r,variant:s=ot.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:d,compareValues:f})=>{const p=ps[s],g=c!==void 0?c:(l??0)>=0,u=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",p.container,o),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:p.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:u})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(ar,{className:"self-start"}):i?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-start"}):f?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(j.DialEllipsisTooltip,{text:f[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[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(j.DialEllipsisTooltip,{text:f[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[1].value})]})]}):n.jsx("span",{className:p.value,children:t}),!a&&!i&&p.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},ir=[{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"}],hs=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),ms=(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},mt=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=ir,className:l,titleClassName:c,valueClassName:d,inline:f,ariaLabel:p})=>{const g=e==null,u=!!(r||s||!g),m=hs(g?0:e,t),v=ms(m,o),x=i??(g?"—":e),C=p??(typeof a=="string"?a:void 0),y=r||s,S=r?n.jsx(ar,{}):s?n.jsx(b.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",f?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",d),children:x}),T=u?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":C,className:I.mergeClasses("w-full overflow-hidden rounded-sm",f?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!y&&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 f?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:T}),S]})]}):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,S]}),T]})},sn=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:d,contentClassName:f})=>{const p=s!==void 0,[g,u]=h.useState(a),m=o?!0:p?s:g,v=h.useId(),x=()=>{if(i)return;const C=!m;p||u(C),l?.(C)};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:x,className:I.mergeClasses("flex w-full items-center gap-2 p-4 text-left",i?"cursor-not-allowed":"cursor-pointer",o&&"cursor-default",d),children:[!o&&n.jsx(j.DialIcon,{className:oe("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(F.IconChevronRight,{size:z.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",f),children:r})]})},xs=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:f,onBarClick:p,inline:g,barTitleClassName:u,barValueClassName:m,barClassName:v,barDescriptions:x,className:C})=>{const y=Object.entries(s),S=g?I.mergeClasses("text-secondary",u):u,T=i?"dial-tiny-text text-secondary":void 0,D=t?n.jsx(E.DialTooltip,{tooltip:t,children:e}):e,N=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],L="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",O="group flex flex-col gap-1.5",A=I.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return n.jsx(sn,{title:D,description:r,defaultExpanded:c,nonCollapsible:d,className:C,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:f?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-center"}):a?N.map(k=>{const w=k in s?s[k]:null,M=k in a?a[k]:null,U=typeof w=="number"&&typeof M=="number"?parseFloat((M-w).toFixed(3)):null,J=U!=null&&U!==0,G=J&&U>0,B=J?G?`+${U}`:String(U):null,H=x?.[k],q=n.jsx("span",{className:"dial-small-text text-secondary",children:k}),K=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[H?n.jsx(E.DialTooltip,{tooltip:H,children:q}):q,B!=null&&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:B})]}),n.jsxs("div",{className:A,children:[n.jsx(mt,{title:i?.[0],value:w,maxValue:o,colorMap:l,inline:g,titleClassName:T,ariaLabel:k}),n.jsx(mt,{title:i?.[1],value:M,maxValue:o,colorMap:l,inline:g,titleClassName:T,ariaLabel:`${k} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(k,w),className:I.mergeClasses(O,L),children:K},k):n.jsx("div",{className:O,children:K},k)}):y.map(([k,w])=>{const M=n.jsx(mt,{title:k,value:w,maxValue:o,colorMap:l,inline:g,titleClassName:S,valueClassName:m,className:v}),$=p?n.jsx("button",{type:"button",onClick:()=>p(k,w),className:L,children:M}):M,U=x?.[k];return U?n.jsx(E.DialTooltip,{tooltip:U,triggerClassName:"flex flex-col",children:$},k):n.jsx(h.Fragment,{children:$},k)})})})},bs="#FF4E50",Cs=(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},Ir=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=Cs(c,t);d>=0&&(r[d]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:bs,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:r[d],ratio:i(r[d]),isZeroBucket:!1}));return[o,...l]},an=e=>e<=0?2:e%2===0?e:e+1,vs=e=>{const t=an(e);return[t,t/2,0]},Mt=e=>`${Math.round(e*100)/100}`,on=(e,t)=>e===t?Mt(e):`${Mt(e)}-${Mt(t)}`,Pt=128,ys=(e,t)=>{const r=on(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Sr=(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:ys(a.from,a.to)})]}),Ds=({title:e,values:t,colorMap:r=ir,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const f=Ir(t,r),p=l?Ir(l,r):void 0,g=t.length,u=l?.length??0,m=Math.max(g,u),v=an(m),x=vs(m),C=D=>D.map(N=>({...N,ratio:v>0?N.count/v:0})),y=C(f),S=p?C(p):void 0,T=(D,N,L,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 A=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(E.DialTooltip,{placement:"bottom",tooltip:N,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":L,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${D.ratio*100}%`,...A},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:Pt},children:n.jsx(b.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:Pt},children:x.map((D,N)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${N/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:D},D))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((D,N)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${N/(x.length-1)*100}%`}},D)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:Pt},children:S?y.map((D,N)=>{const L=S[N],O=`${D.count} out of ${g} ${s}`,A=`${L.count} out of ${u} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[T(D,Sr(c,D.count,g,s,D),O,!0),T(L,Sr(d,L.count,u,s,L),A,!1)]},N)}):y.map((D,N)=>{const L=`${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}%`}})},N):n.jsx(E.DialTooltip,{placement:"bottom",tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":L,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})})},N)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:y.map((D,N)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:on(D.from,D.to)},N))})]})]})},ln=({value:e,max:t=100,size:r=E.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const d=h.useId(),f=i??d,p=!!s?.label,g=p?s?.id??`${f}-label`:void 0,u=t>0?t:0,m=Number.isFinite(e)?e:0,v=Math.min(Math.max(m,0),u),x=u>0?v/u*100:0,C=n.jsx("div",{...c,id:f,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":u,"aria-labelledby":g,"aria-label":E.resolveAccessibleName(l,p?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===E.ElementSize.Small?"h-1":"h-2",o,!p&&!a&&j.DIAL_KIT_CLASS.progressBar),children:n.jsx("div",{style:{width:`${x}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?C:n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-1",j.DIAL_KIT_CLASS.progressBar),children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(R.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),C]})},Is=7,Ss=2,Ns=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var xt=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(xt||{});const js=(e,t,r)=>e===t?"active":r<Is||Math.abs(e-t)<=Ss?"adjacent":"far",Ts=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=Ns(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(E.DialIconButton,{icon:n.jsx(F.IconCaretLeftFilled,{size:z.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:E.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=js(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===xt.Active&&"h-[8px] w-[32px]",o===xt.Adjacent&&"size-[8px]",o===xt.Far&&"size-[4px]")},i)})}),n.jsx(E.DialIconButton,{icon:n.jsx(F.IconCaretRightFilled,{size:z.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:E.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Yt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const d=h.useCallback(u=>{o?.(u.target.checked,t)},[o,t]),f=oe("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),p=oe("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx(F.IconMinus,{className:p,...z.BASE_ICON_PROPS}):r?n.jsx(F.IconCheck,{className:p,...z.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:f,htmlFor:t,"aria-description":c["aria-description"]||j.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(j.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:d,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 Ce=(e=>(e.VALID="valid",e.ERROR="error",e))(Ce||{});const ws=(e,t)=>{if(t===e.id)switch(e.status){case Ce.VALID:return"border-accent-secondary text-primary";case Ce.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case Ce.VALID:return"border-primary text-primary";case Ce.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},Es=(e,t)=>{if(t===e.id)switch(e.status){case Ce.VALID:return"bg-accent-secondary";case Ce.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case Ce.VALID:return"bg-accent-secondary";case Ce.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Os=({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===Ce.ERROR?n.jsx(F.IconExclamationCircle,{stroke:2,size:z.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===Ce.VALID?n.jsx(F.IconCheck,{stroke:2,size:z.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:oe(a,ws(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:oe(i,Es(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},As=({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===Ce.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(Os,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},Ft=e=>(e.toString().split(".")[1]??"").length,_s=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:d,trackClassName:f,fillClassName:p,thumbClassName:g,labelsClassName:u,"aria-label":m,"aria-labelledby":v,...x})=>{const C=h.useRef(null),y=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),S=Ft(s),T=l?l(e):e.toFixed(S),D=h.useCallback(A=>{const k=C.current;if(!k)return e;const w=k.getBoundingClientRect(),M=(A-w.left)/w.width,$=t+M*(r-t),U=Ft(s),J=parseFloat((Math.round(($-t)/s)*s+t).toFixed(U));return Math.min(r,Math.max(t,J))},[t,r,s,e]),N=h.useCallback(A=>{a||(A.currentTarget.setPointerCapture(A.pointerId),c?.(D(A.clientX)))},[a,D,c]),L=h.useCallback(A=>{a||A.buttons===0||c?.(D(A.clientX))},[a,D,c]),O=h.useCallback(A=>{if(a)return;const k=Ft(s),w=U=>parseFloat((Math.round((U-t)/s)*s+t).toFixed(k)),M=U=>Math.min(r,Math.max(t,U));let $=e;switch(A.key){case"ArrowRight":case"ArrowUp":$=M(w(e+s));break;case"ArrowLeft":case"ArrowDown":$=M(w(e-s));break;case"Home":$=t;break;case"End":$=r;break;default:return}A.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",d),...x,children:[i&&n.jsx(ke.DialLabel,{...i,htmlFor:x.id}),n.jsxs("div",{ref:C,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:N,onPointerMove:L,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",f)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${y}%`}}),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:`${y}%`},onKeyDown:O,children:T})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",u),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]})]})})]})},Ls=({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(E.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),cn=h.createContext({dragDropManager:void 0});function ye(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 Nr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),jr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Tr={INIT:"@@redux/INIT"+jr(),REPLACE:"@@redux/REPLACE"+jr()};function ks(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 Rs(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(Fs(e))return"date";if(Ps(e))return"error";var r=Ms(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 Ms(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ps(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Fs(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Xe(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Rs(e)),t}function dn(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"?ye(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"?ye(1):"Expected the enhancer to be a function. Instead, received: '"+Xe(r)+"'");return r(dn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ye(2):"Expected the root reducer to be a function. Instead, received: '"+Xe(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function d(){l===o&&(l=o.slice())}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?ye(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 p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(4):"Expected the listener to be a function. Instead, received: '"+Xe(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?ye(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 x=!0;return d(),l.push(v),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?ye(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.");x=!1,d();var y=l.indexOf(v);l.splice(y,1),o=null}}}function g(v){if(!ks(v))throw new Error(process.env.NODE_ENV==="production"?ye(7):"Actions must be plain objects. Instead, the actual type was: '"+Xe(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"?ye(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"?ye(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,v)}finally{c=!1}for(var x=o=l,C=0;C<x.length;C++){var y=x[C];y()}return v}function u(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(10):"Expected the nextReducer to be a function. Instead, received: '"+Xe(v));a=v,g({type:Tr.REPLACE})}function m(){var v,x=p;return v={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?ye(11):"Expected the observer to be an object. Instead, received: '"+Xe(y)+"'");function S(){y.next&&y.next(f())}S();var T=x(S);return{unsubscribe:T}}},v[Nr]=function(){return this},v}return g({type:Tr.INIT}),s={dispatch:g,subscribe:p,getState:f,replaceReducer:u},s[Nr]=m,s}function Y(e,t,...r){if(Bs()&&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 Bs(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function zs(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function $s(e,t){return e.filter(r=>r!==t)}function un(e){return typeof e=="object"}function Hs(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 Vs(e,t){return e.filter(r=>t.indexOf(r)>-1)}const or="dnd-core/INIT_COORDS",Nt="dnd-core/BEGIN_DRAG",lr="dnd-core/PUBLISH_DRAG_SOURCE",jt="dnd-core/HOVER",Tt="dnd-core/DROP",wt="dnd-core/END_DRAG";function wr(e,t){return{type:or,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Ks={type:or,payload:{clientOffset:null,sourceClientOffset:null}};function Gs(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(wr(i)),Us(r,l,c);const d=qs(r,l);if(d==null){e.dispatch(Ks);return}let f=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");Zs(o),f=o(d)}e.dispatch(wr(i,f));const g=c.getSource(d).beginDrag(l,d);if(g==null)return;Ws(g),c.pinSource(d);const u=c.getSourceType(d);return{type:Nt,payload:{itemType:u,item:g,sourceId:d,clientOffset:i||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}function Us(e,t,r){Y(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){Y(r.getSource(s),"Expected sourceIds to be registered.")})}function Zs(e){Y(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ws(e){Y(un(e),"Item must be an object.")}function qs(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 Ys(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xs(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){Ys(e,a,r[a])})}return e}function Qs(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();Js(s),ra(s).forEach((o,l)=>{const c=ea(o,l,a,s),d={type:Tt,payload:{dropResult:Xs({},r,c)}};e.dispatch(d)})}}function Js(e){Y(e.isDragging(),"Cannot call drop while not dragging."),Y(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ea(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return ta(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function ta(e){Y(typeof e>"u"||un(e),"Drop result must either be an object or undefined.")}function ra(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function na(e){return function(){const r=e.getMonitor(),s=e.getRegistry();sa(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:wt}}}function sa(e){Y(e.isDragging(),"Cannot call endDrag while not dragging.")}function Xt(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function aa(e){return function(r,{clientOffset:s}={}){ia(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return la(a,o,l),oa(a,i,o),ca(a,i,o),{type:jt,payload:{targetIds:a,clientOffset:s||null}}}}function ia(e){Y(Array.isArray(e),"Expected targetIds to be an array.")}function oa(e,t,r){Y(t.isDragging(),"Cannot call hover while not dragging."),Y(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];Y(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);Y(i,"Expected targetIds to be registered.")}}function la(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Xt(i,r)||e.splice(s,1)}}function ca(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function da(e){return function(){if(e.getMonitor().isDragging())return{type:lr}}}function ua(e){return{beginDrag:Gs(e),publishDragSource:da(e),hover:aa(e),drop:Qs(e),endDrag:na(e)}}class fa{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=ua(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 pa(e,t){return{x:e.x+t.x,y:e.y+t.y}}function fn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ga(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:fn(pa(t,s),r)}function ha(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:fn(t,r)}const at=[],cr=[];at.__IS_NONE__=!0;cr.__IS_ALL__=!0;function ma(e,t){return e===at?!1:e===cr||typeof t>"u"?!0:Vs(t,e).length>0}class xa{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;Y(typeof t=="function","listener must be a function."),Y(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&&!ma(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){Y(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 Y(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(Y(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 Xt(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Y(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&&!Xt(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 ga(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return ha(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Er=typeof global<"u"?global:self,pn=Er.MutationObserver||Er.WebKitMutationObserver;function gn(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function ba(e){let t=1;const r=new pn(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const Ca=typeof pn=="function"?ba:gn;class va{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=Ca(this.flush),this.requestErrorThrow=gn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class ya{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 Da{create(t){const r=this.freeTasks,s=r.length?r.pop():new ya(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const hn=new va,Ia=new Da(hn.registerPendingError);function Sa(e){hn.enqueueTask(Ia.create(e))}const dr="dnd-core/ADD_SOURCE",ur="dnd-core/ADD_TARGET",fr="dnd-core/REMOVE_SOURCE",Et="dnd-core/REMOVE_TARGET";function Na(e){return{type:dr,payload:{sourceId:e}}}function ja(e){return{type:ur,payload:{targetId:e}}}function Ta(e){return{type:fr,payload:{sourceId:e}}}function wa(e){return{type:Et,payload:{targetId:e}}}function Ea(e){Y(typeof e.canDrag=="function","Expected canDrag to be a function."),Y(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Y(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Oa(e){Y(typeof e.canDrop=="function","Expected canDrop to be a function."),Y(typeof e.hover=="function","Expected hover to be a function."),Y(typeof e.drop=="function","Expected beginDrag to be a function.")}function Qt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Qt(r,!1));return}Y(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 Aa=0;function _a(){return Aa++}function La(e){const t=_a().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Or(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ar(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 ka{addSource(t,r){Qt(t),Ea(r);const s=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(Na(s)),s}addTarget(t,r){Qt(t,!0),Oa(r);const s=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(ja(s)),s}containsHandler(t){return Ar(this.dragSources,t)||Ar(this.dropTargets,t)}getSource(t,r=!1){return Y(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Y(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Y(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Y(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Or(t)===Ie.SOURCE}isTargetId(t){return Or(t)===Ie.TARGET}removeSource(t){Y(this.getSource(t),"Expected an existing source."),this.store.dispatch(Ta(t)),Sa(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Y(this.getTarget(t),"Expected an existing target."),this.store.dispatch(wa(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Y(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Y(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=La(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 Ra=(e,t)=>e===t;function Ma(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Pa(e,t,r=Ra){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 Fa(e=at,t){switch(t.type){case jt:break;case dr:case ur:case Et:case fr:return at;case Nt:case lr:case wt:case Tt:default:return cr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=Hs(r,s);if(!(a.length>0||!Pa(r,s)))return at;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function Ba(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function za(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){Ba(e,a,r[a])})}return e}const _r={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function $a(e=_r,t){const{payload:r}=t;switch(t.type){case or:case Nt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case jt:return Ma(e.clientOffset,r.clientOffset)?e:za({},e,{clientOffset:r.clientOffset});case wt:case Tt:return _r;default:return e}}function Ha(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qe(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){Ha(e,a,r[a])})}return e}const Va={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ka(e=Va,t){const{payload:r}=t;switch(t.type){case Nt:return Qe({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case lr:return Qe({},e,{isSourcePublic:!0});case jt:return Qe({},e,{targetIds:r.targetIds});case Et:return e.targetIds.indexOf(r.targetId)===-1?e:Qe({},e,{targetIds:$s(e.targetIds,r.targetId)});case Tt:return Qe({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case wt:return Qe({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Ga(e=0,t){switch(t.type){case dr:case ur:return e+1;case fr:case Et:return e-1;default:return e}}function Ua(e=0){return e+1}function Za(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wa(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){Za(e,a,r[a])})}return e}function qa(e={},t){return{dirtyHandlerIds:Fa(e.dirtyHandlerIds,{type:t.type,payload:Wa({},t.payload,{prevTargetIds:zs(e,"dragOperation.targetIds",[])})}),dragOffset:$a(e.dragOffset,t),refCount:Ga(e.refCount,t),dragOperation:Ka(e.dragOperation,t),stateId:Ua(e.stateId)}}function Ya(e,t=void 0,r={},s=!1){const a=Xa(s),i=new xa(a,new ka(a)),o=new fa(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function Xa(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return dn(qa,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Qa(e,t){if(e==null)return{};var r=Ja(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 Ja(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 Lr=0;const bt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ei=h.memo(function(t){var{children:r}=t,s=Qa(t,["children"]);const[a,i]=ti(s);return h.useEffect(()=>{if(i){const o=mn();return++Lr,()=>{--Lr===0&&(o[bt]=null)}}},[]),n.jsx(cn.Provider,{value:a,children:r})});function ti(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=ri(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function ri(e,t=mn(),r,s){const a=t;return a[bt]||(a[bt]={dragDropManager:Ya(e,t,r,s)}),a[bt]}function mn(){return typeof global<"u"?global:window}var Bt,kr;function ni(){return kr||(kr=1,Bt=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}),Bt}var si=ni();const ai=b.getDefaultExportFromCjs(si),Ue=typeof window<"u"?h.useLayoutEffect:h.useEffect;function ii(e,t,r){const[s,a]=h.useState(()=>t(e)),i=h.useCallback(()=>{const o=t(e);ai(s,o)||(a(o),r&&r())},[s,e,r]);return Ue(i),[s,i]}function oi(e,t,r){const[s,a]=ii(e,t,r);return Ue(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function xn(e,t,r){return oi(t,e||(()=>({})),()=>r.reconnect())}function bn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function li(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function ci(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let zt=!1,$t=!1;class di{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Y(!zt,"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 zt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{zt=!1}}isDragging(){if(!this.sourceId)return!1;Y(!$t,"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 $t=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{$t=!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 Ht=!1;class ui{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Y(!Ht,"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 Ht=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ht=!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 fi(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function pi(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Jt(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 d=i[c];if(!l(d))return!1;const f=e[d],p=t[d];if(a=void 0,a===!1||a===void 0&&f!==p)return!1}return!0}function er(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gi(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 hi(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return gi(s),mi(s,r?i=>e(i,r):e)}}function Cn(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=hi(s);t[r]=()=>a}}),t}function Rr(e,t){typeof e=="function"?e(t):e.current=t}function mi(e,t){const r=e.ref;return Y(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=>{Rr(r,s),Rr(t,s)}}):h.cloneElement(e,{ref:t})}class xi{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!Jt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Jt(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=Cn({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,er(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,er(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 bi{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!Jt(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=Cn({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,er(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 et(){const{dragDropManager:e}=h.useContext(cn);return Y(e!=null,"Expected drag drop context"),e}function Ci(e,t){const r=et(),s=h.useMemo(()=>new xi(r.getBackend()),[r]);return Ue(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ue(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function vi(){const e=et();return h.useMemo(()=>new di(e),[e])}class yi{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 Di(e,t,r){const s=h.useMemo(()=>new yi(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function Ii(e){return h.useMemo(()=>{const t=e.type;return Y(t!=null,"spec.type must be defined"),t},[e])}function Si(e,t,r){const s=et(),a=Di(e,t,r),i=Ii(e);Ue(function(){if(i!=null){const[l,c]=pi(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function Ni(e,t){const r=bn(e,t);Y(!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=vi(),a=Ci(r.options,r.previewOptions);return Si(r,s,a),[xn(r.collect,s,a),li(a),ci(a)]}function ji(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function Ti(e){const t=et(),r=h.useMemo(()=>new bi(t.getBackend()),[t]);return Ue(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function wi(){const e=et();return h.useMemo(()=>new ui(e),[e])}function Ei(e){const{accept:t}=e;return h.useMemo(()=>(Y(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Oi{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 Ai(e,t){const r=h.useMemo(()=>new Oi(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function _i(e,t,r){const s=et(),a=Ai(e,t),i=Ei(e);Ue(function(){const[l,c]=fi(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function pr(e,t){const r=bn(e,t),s=wi(),a=Ti(r.options);return _i(r,s,a),[xn(r.collect,s,a),ji(a)]}const Mr="column",Li="flex items-center",ki="mr-3 cursor-move text-secondary",Ri=({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:d},f,p]=Ni(()=>({type:Mr,item:{id:e,originalIndex:c},collect:u=>{const m=u.getItem();return{isDragging:u.isDragging()&&m?.id===e}},end:(u,m)=>{if(!u)return;!m.didDrop()&&typeof a=="function"&&u.originalIndex>-1&&a(u.id,u.originalIndex)}}),[e,c,a]),[,g]=pr(()=>({accept:Mr,hover:u=>{if(!(!u||u.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(u.id,m)}}}),[s,a,e]);return p(g(l)),f(o),n.jsxs("div",{ref:l,className:I.mergeClasses(Li,r),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:ki,"aria-label":i,children:n.jsx(F.IconGripVertical,{...z.BASE_ICON_PROPS})}),t]})},Ot=({iconClassName:e,label:t,...r})=>t?n.jsx(b.DialDangerButton,{...r,label:t,appearance:E.ButtonAppearance.Ghost,iconBefore:n.jsx(F.IconTrashX,{...z.BASE_ICON_PROPS,className:e||""})}):n.jsx(j.DialDangerIconButton,{...r,appearance:E.ButtonAppearance.Ghost,icon:n.jsx(F.IconTrashX,{...z.BASE_ICON_PROPS,className:e||""})}),Mi=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const f=I.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.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(ke.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(b.DialErrorText,{text:s}),!s&&n.jsx(b.DialCaptionText,{text:l})]})},Pi="inline-flex items-center rounded bg-layer-3",Fi="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",Bi="relative z-10 bg-controls-accent-primary-alpha-active text-primary",zi="text-secondary hover:text-primary",$i="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Hi=({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 d=c.findIndex(g=>g.value===t);let f=null;switch(l.key){case"ArrowRight":case"ArrowDown":f=(d+1)%c.length;break;case"ArrowLeft":case"ArrowUp":f=(d-1+c.length)%c.length;break;case"Home":f=0;break;case"End":f=c.length-1;break;default:return}l.preventDefault();const p=c[f];p&&p.value!==t&&r(p.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(Pi,a),children:e.map((l,c)=>{const d=l.value===t,f=c===0,p=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Fi,!p&&"-mr-px",f&&"rounded-l",p&&"rounded-r",d?Bi:zi,g&&$i),children:[l.icon,l.label]},l.value)})})},Vt=8,Vi=24,vn=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:f=!1,containerClassName:p,tagClassName:g,onChange:u})=>{const m=h.useRef(null),v=h.useRef([]),x=h.useRef(null),[C,y]=h.useState(e),[S,T]=h.useState(""),[D,N]=h.useState(!1),[L,O]=h.useState(e.length),A=h.useCallback(B=>H=>{v.current[B]=H},[]),k=h.useCallback(()=>{if(!d)return;const B=m.current;if(!B)return;const H=B.offsetWidth;if(H===0)return;const q=x.current?.offsetWidth??0,se=H-(f?0:Vi)-Vt;let X=0,Z=0;for(let ae=0;ae<C.length;ae++){const te=v.current[ae];if(!te)continue;const le=te.offsetWidth+Vt;if(X+le>se)break;X+=le,Z++}if(Z<C.length&&Z>0)for(;X+q>se&&Z>0;){Z--;const ae=v.current[Z]?.offsetWidth??0;X-=ae+Vt}O(Z)},[d,f,C.length]),w=B=>{const H=B.trim().replace(/,$/,"");if(H&&!C.includes(H)){const q=[H,...C];y(q),u?.(q)}},M=B=>{(B.key===","||B.key==="Enter")&&(B.preventDefault(),w(S),T(""))},$=()=>{S.trim()&&(w(S),T(""))},U=B=>{const H=C.filter((q,K)=>K!==B);y(H),u?.(H)},J=()=>o?n.jsx(b.DialErrorText,{text:o}):i?n.jsx(b.DialCaptionText,{text:i}):null;h.useEffect(()=>{if(d)return;const B=new ResizeObserver(()=>{if(m.current){const H=m.current.scrollHeight>m.current.clientHeight+10;N(H)}});return m.current&&B.observe(m.current),()=>B.disconnect()},[C,d]),h.useEffect(()=>{if(!d){O(C.length);return}O(C.length);const B=new ResizeObserver(()=>{k()}),H=m.current;return H&&B.observe(H),k(),()=>B.disconnect()},[d,k,C]),h.useEffect(()=>{y(e)},[JSON.stringify(e)]);const G=n.jsxs("div",{ref:m,className:oe("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":oe("flex-wrap",D?"flex-col-reverse":"flex-row"),p),children:[(d?C.slice(0,L):C).map((B,H)=>n.jsx(Ke,{label:B,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>U(H):void 0},B+H)),d&&L<C.length&&n.jsx(E.DialTooltip,{tooltip:C.slice(L).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(Ke,{label:`+${C.length-L}`})}),!f&&n.jsx("input",{id:s,type:"text",value:S,onChange:B=>T(B.target.value),onKeyDown:M,onBlur:$,className:oe("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",d?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),d&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[C.map((B,H)=>n.jsx("div",{ref:A(H),className:"inline-flex shrink-0",children:n.jsx(Ke,{label:B,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>U(H):void 0})},`measure-${B}-${H}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(Ke,{label:`+${C.length}`})})]})]});return f?G:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(ke.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:oe("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:G}),J()]})},yn=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(vn,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Kt=e=>Dr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Dr.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"})),Dn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:d,emptyValueText:f,placeholder:p,editable:g=!1,onValueChange:u,collapseTagOverflow:m=!1,iconBefore:v})=>{const x=Array.isArray(s)&&s.length>0,C=typeof s=="string"&&!!s.trim(),y=x||C?s:p?void 0:f,S=r?void 0:o,T=h.useCallback(O=>{u?.(O.target.value)},[u]),D=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:oe("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||d)&&"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(j.DialIcon,{icon:v}),n.jsx("input",{type:"text",className:oe("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:p||f,onChange:T,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(j.DialIcon,{icon:n.jsx(Kt,{role:"img",width:z.BASE_ICON_SIZE,height:z.BASE_ICON_SIZE})})})]}),n.jsx(b.DialErrorText,{text:c})]}),N=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:S,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:oe("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||d)&&"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(j.DialIcon,{icon:v}),n.jsx(E.DialTooltip,{tooltip:y==null?void 0:String(y),children:y||!p?n.jsx("span",{className:a,children:y}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(j.DialIcon,{icon:n.jsx(Kt,{role:"img",width:z.BASE_ICON_SIZE,height:z.BASE_ICON_SIZE})})})]})}),n.jsx(b.DialErrorText,{text:c})]}),L=()=>n.jsx("div",{className:"w-full",onClick:S,children:n.jsxs("div",{className:oe("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(j.DialIcon,{icon:v}),n.jsx(yn,{placeholder:p,selectedItems:y,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(j.DialIcon,{icon:n.jsx(Kt,{role:"img",width:z.BASE_ICON_SIZE,height:z.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?L():g?D():N(),t&&us.createPortal(e,document.body)]})},Ki=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:d,onClose:f,header:p,portalId:g,onApply:u,onCancel:m,cancelButtonTitle:v="Cancel",applyButtonTitle:x="Apply",isValid:C,selectedRadioValue:y,onChangeRadioField:S,id:T,size:D=b.PopupSize.Md})=>{const[N,L]=h.useState(!1),O=h.useCallback(()=>{r||L(!0)},[r]),A=h.useCallback(()=>{L(!1),f?.()},[f]),k=h.useCallback(()=>{m?.(),A()},[m,A]),w=h.useCallback(()=>{u(),A()},[u,A]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(ke.DialLabel,{label:e,htmlFor:t}),n.jsx(Dn,{disabled:r,open:N,selectedValue:i??a.find(M=>M.id===s)?.name,valueClassName:o,inputClassName:oe(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:O,children:n.jsx(b.DialPopup,{open:N,onClose:k,header:p,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(b.DialNeutralButton,{label:v,onClick:k}),n.jsx(b.DialPrimaryButton,{label:x,onClick:w,disabled:!C})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(b.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:y,onChange:S,elementId:T,orientation:b.RadioGroupOrientation.Column})})})})]})},Gi="Create",Ui="Cancel",Zi="flex items-center justify-end gap-2 px-6 py-3",Wi=({header:e,open:t=!1,submitLabel:r=Gi,cancelLabel:s=Ui,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:d,onCancel:f,children:p,dividers:g=!0,size:u=b.PopupSize.Md,footer:m})=>{const v=a?null:n.jsxs("div",{className:Zi,children:[n.jsx(b.DialNeutralButton,{label:s,onClick:()=>f?f():c?.()}),n.jsx(b.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>d()})]}),x=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(b.DialLoader,{size:50})}):p??null,[p,a]);return n.jsx(b.DialPopup,{open:t,header:e,className:o,dividers:g,onClose:()=>c?.(),footer:m??v,size:u,children:x()})},qi=/^0+\.(\d+)?$/,Yi=/^0+/,tr=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=f=>!f||f==="-"?f:String(f)?.match(qi)?String(f)?.replace(Yi,"0"):Number(f),c=f=>{if([".","-","+","e","E"].includes(f.key)){f.preventDefault();return}b.handleKeyDown(f,"number",r,s)},d=f=>{const p=f.clipboardData.getData("text"),g=p.replace(/\D/g,"");if(g!==p&&(f.preventDefault(),g)){const u=f.currentTarget,m=u.selectionStart??0,v=u.selectionEnd??0,x=u.value.slice(0,m)+g+u.value.slice(v);t?.(l(x))}};return n.jsx(b.DialInput,{type:"number",min:r,max:s,onChange:f=>t?.(l(f)),onKeyDown:e?c:a,onPaste:e?d:i,...o})},Xi=({onClick:e})=>n.jsx(F.IconEyeOff,{...z.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Qi=({onClick:e})=>n.jsx(F.IconEye,{...z.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),In=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(b.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(Xi,{onClick:()=>s(!1)}):n.jsx(Qi,{onClick:()=>s(!0)})})},Sn=({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(Ke,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(j.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var vt=(e=>(e.Sm="sm",e.Md="md",e))(vt||{}),yt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(yt||{});const Ji="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",eo="w-full rounded flex flex-col",it="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",to="bg-accent-primary-alpha",rr="bg-accent-primary-alpha border-l border-accent-primary border-1",Dt="opacity-75",ro=352,no=4,so=n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.SM}),ao=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=j.useSubMenuFloating(no,"listbox",!!e.disabled),d=e.children?.some(f=>t.includes(f.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":!!d,"aria-disabled":!!e.disabled,disabled:e.disabled,className:oe(it,d&&rr,e.disabled&&Dt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(j.DialIcon,{icon:e.icon}),n.jsx(j.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(F.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(j.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(f=>{const p=t.includes(f.value);return n.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!f.disabled,disabled:f.disabled,className:oe(it,p&&rr,f.disabled&&Dt),onClick:()=>!f.disabled&&r(f.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.icon&&n.jsx(j.DialIcon,{icon:f.icon}),n.jsx(j.DialEllipsisTooltip,{text:f.labelNode??f.label})]})},f.value)})})]})},Te=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=yt.Primary,size:o=vt.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:f=!1,searchSize:p=E.ElementSize.Standard,searchPlaceholder:g,selectAll:u=!1,invalid:m,selectAllLabel:v="Select all",emptyStateTitle:x="No options available",emptyStateDescription:C,emptyStateIcon:y,disabled:S=!1,className:T,listClassName:D,closable:N=!1,header:L,footer:O,onClose:A,onChange:k,inlineSearch:w=!1,dismissRef:M,onFooterClick:$,open:U,onOpenChange:J,onInlineQueryChange:G,customMultiSelectTagsRenderer:B})=>{const H=h.useId(),[q,K]=h.useState(!1),se=U!==void 0,X=se?!!U:q,Z=h.useCallback(_=>{se||K(_),J?.(_)},[se,J]),[ae,te]=h.useState(w&&c||""),le=h.useRef(null),ue=h.useCallback(_=>{_!==ae&&(te(_||""),G?.(_||""))},[G,ae]),pe=s!==void 0,[ge,fe]=h.useState(a),W=pe?s:ge,ee=h.useMemo(()=>t?Array.isArray(W)?W:[]:typeof W=="string"?[W]:[],[W,t]),Se=h.useMemo(()=>{const _=ae.trim().toLowerCase();return _?e.filter(re=>re.label.toLowerCase().includes(_)):e},[e,ae]);h.useEffect(()=>{!X&&!w&&ue("")},[w,X,ue]);const Be=h.useRef(c);h.useEffect(()=>{w&&c!==Be.current&&(X||(Be.current=c,ue(c||"")))},[c,w,X,ue]);const he=h.useCallback(_=>{pe||fe(_),k?.(_)},[pe,k]),ze=h.useCallback(_=>{if(t){const re=new Set(ee);re.has(_)?re.delete(_):re.add(_),he(Array.from(re));return}if(he(_),w){const re=e.find(xe=>xe.value===_)??e.flatMap(xe=>xe.children??[]).find(xe=>xe.value===_);re&&ue(re.label)}Z(!1)},[t,he,w,Z,ee,e,ue]),Ee=h.useCallback((_,re)=>{if(_.stopPropagation(),!t){he("");return}const xe=ee.filter(Rt=>Rt!==re);he(xe)},[t,ee,he]),ie=h.useMemo(()=>Se.filter(_=>!_.disabled),[Se]),Re=h.useMemo(()=>ie.filter(_=>ee.includes(_.value)).length,[ie,ee]),Ne=h.useCallback(_=>{w&&!t&&!_&&ze(ae),Z(_)},[ze,w,t,ae,Z]),{allSelectedInFiltered:$e,someSelectedInFiltered:st}=h.useMemo(()=>{const _=ie.length>0&&Re===ie.length;return{allSelectedInFiltered:_,someSelectedInFiltered:Re>0&&!_}},[ie,Re]),ve=h.useCallback(()=>{if(!(!t||ie.length===0))if($e){const _=new Set(ie.map(re=>re.value));he(ee.filter(re=>!_.has(re)))}else{const _=new Set(ee);ie.forEach(re=>_.add(re.value)),he(Array.from(_))}},[$e,t,ie,ee,he]),He=ee.length>0;h.useEffect(()=>{X&&w&&!t&&!S&&requestAnimationFrame(()=>{const _=le.current;if(!_)return;_.focus();const re=_.value?.length??0;_.setSelectionRange?.(re,re)})},[X,w,t,S]);const Me=!t&&He?ee[0]:void 0,me=h.useMemo(()=>Me?e.find(_=>_.value===Me)??e.flatMap(_=>_.children??[]).find(_=>_.value===Me):void 0,[e,Me]),kt=h.useCallback(()=>t?He?B?.(e,ee,Ee)||n.jsx(Sn,{options:e,selectedValues:ee,handleRemoveTag:Ee}):n.jsx("span",{className:"text-secondary truncate",children:d}):me?n.jsxs(n.Fragment,{children:[me.icon&&n.jsx(j.DialIcon,{icon:me.icon}),n.jsx(j.DialEllipsisTooltip,{text:me.labelNode??(l?`${l} ${me.label}`:me.label)}),me?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:me.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:d}),[He,t,c,l,s,d,me,e,ee,Ee,B]);h.useImperativeHandle(M,()=>({dismiss:()=>{Z(!1)}}));const Oe=h.useCallback(()=>{ue(ee.length===1?me?.label??ae:"")},[ae,ee.length,ue,me?.label]),Ve=h.useCallback(()=>{S||(Z(!X),w&&!t&&(Oe(),le.current?.focus()))},[S,w,X,t,Oe,Z]);return n.jsx(j.DialDropdown,{open:X,onOpenChange:Ne,disabled:S,closable:N,onClose:A,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:f?null:ro,listClassName:D,renderOverlay:()=>n.jsxs("div",{id:`list-${r||H}`,role:"listbox","aria-multiselectable":t||void 0,className:eo,children:[L&&n.jsx(n.Fragment,{children:typeof L=="function"?L():L}),(f||N)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(b.DialSearch,{size:p,placeholder:g,onChange:ue,value:ae,id:`search-${r||H}`,containerClassName:I.mergeClasses(b.SIZE_CONFIG[p].containerClassName,"w-full")}),N&&n.jsx(b.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM}),onClick:_=>{A?.(_),Z(!1)}})]}),t&&u&&ie.length>0&&n.jsx("div",{className:oe(it,"mt-2"),children:n.jsx(Yt,{id:`${r||H}-selectAll`,label:v,checked:$e,indeterminate:st,onChange:ve,ariaLabel:v})}),n.jsx("div",{className:oe("overflow-y-auto max-h-[352px]",w&&Se.length===0?"":"py-1"),children:Se.length===0?!w&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:y??n.jsx(F.IconClipboardX,{size:z.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:C})}):Se.map(_=>{const re=ee.includes(_.value);return t?n.jsxs("div",{role:"option","aria-selected":re,"aria-disabled":!!_.disabled,className:oe(it,re&&to,_.disabled&&Dt,"w-full"),children:[n.jsx(Yt,{id:`${r||H}-${_.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[_.icon&&n.jsx(j.DialIcon,{icon:_.icon}),n.jsx("span",{className:"truncate",children:_.labelNode??_.label})]}),checked:re,disabled:_.disabled,onChange:()=>!_.disabled&&ze(_.value),ariaLabel:_.label}),_.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:_.description})]},_.value):_.children?.length?n.jsx(ao,{opt:_,selectedValues:ee,onSelect:ze},_.value):n.jsx("button",{role:"option",type:"button","aria-selected":re,"aria-disabled":!!_.disabled,disabled:_.disabled,className:oe(it,re&&rr,_.disabled&&Dt),onClick:()=>!_.disabled&&ze(_.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[_.icon&&n.jsx(j.DialIcon,{icon:_.icon}),n.jsx(j.DialEllipsisTooltip,{text:_.labelNode??_.label}),_.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:_.description})]})},_.value)})}),O&&n.jsx("div",{onClick:_=>{$?.(_),$&&Z(!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":X,"aria-controls":`list-${r||H}`,className:I.mergeClasses(Ji,S&&"opacity-75 !cursor-not-allowed !border-primary",o===vt.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===yt.Secondary?"!bg-layer-4 !h-auto":"",T),onMouseDown:_=>{S||w&&!t&&(Oe(),_.preventDefault())},onClick:()=>{Ve()},onKeyDown:_=>{(_.key===" "||_.code==="Space")&&(_.preventDefault(),Ve())},children:[w&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||H}`,type:"text",placeholder:g??d,value:ae||"",onChange:_=>ue(_.currentTarget.value.trimStart()),onFocus:()=>!S&&Z(!0),onMouseDown:_=>{Oe(),_.stopPropagation()},onClick:_=>{_.stopPropagation()},onKeyDown:_=>{_.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:le,disabled:S,"aria-disabled":S,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:kt()}),!w&&n.jsx(j.DialIcon,{icon:so,className:oe("text-primary",X&&"rotate-180")})]})})},io=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:d,defaultEmptyText:f,...p})=>{const g=h.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return f??"None";if(Array.isArray(d))return n.jsx(Sn,{options:p.options,selectedValues:d});{const u=p.options?.find(m=>m.value===d);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:u?.label||d})}},[d,p.options,f]);return n.jsx(b.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:f,children:n.jsx(Te,{className:a,value:d,elementId:o,invalid:!!i,...p})})};function Nn(e){let t=null;return()=>(t==null&&(t=e()),t)}function oo(e,t){return e.filter(r=>r!==t)}function lo(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 co{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=lo(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=oo(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class uo{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 At="__NATIVE_FILE__",jn="__NATIVE_URL__",Tn="__NATIVE_TEXT__",wn="__NATIVE_HTML__",Pr=Object.freeze(Object.defineProperty({__proto__:null,FILE:At,HTML:wn,TEXT:Tn,URL:jn},Symbol.toStringTag,{value:"Module"}));function Gt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const nr={[At]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[wn]:{exposeProperties:{html:(e,t)=>Gt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[jn]:{exposeProperties:{urls:(e,t)=>Gt(e,t,"").split(`
2
- `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Tn]:{exposeProperties:{text:(e,t)=>Gt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function fo(e,t){const r=nr[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new uo(r);return s.loadDataTransfer(t),s}function Ut(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(nr).filter(r=>{const s=nr[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const po=Nn(()=>/firefox/i.test(navigator.userAgent)),En=Nn(()=>!!window.safari);class Fr{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,d=o.length-1,f;for(;c<=d;){f=Math.floor(.5*(c+d));const u=r[f];if(u<t)c=f+1;else if(u>t)d=f-1;else return s[f]}l=Math.max(0,d);const p=t-r[l],g=p*p;return s[l]+a[l]*p+i[l]*g+o[l]*p*g}constructor(t,r){const{length:s}=t,a=[];for(let u=0;u<s;u++)a.push(u);a.sort((u,m)=>t[u]<t[m]?-1:1);const i=[],o=[];let l,c;for(let u=0;u<s-1;u++)l=t[u+1]-t[u],c=r[u+1]-r[u],i.push(l),o.push(c/l);const d=[o[0]];for(let u=0;u<i.length-1;u++){const m=o[u],v=o[u+1];if(m*v<=0)d.push(0);else{l=i[u];const x=i[u+1],C=l+x;d.push(3*C/((C+x)/m+(C+l)/v))}}d.push(o[o.length-1]);const f=[],p=[];let g;for(let u=0;u<d.length-1;u++){g=o[u];const m=d[u],v=1/i[u],x=m+d[u+1]-g-g;f.push((g-m-x)*v),p.push(x*v*v)}this.xs=t,this.ys=r,this.c1s=d,this.c2s=f,this.c3s=p}}const go=1;function On(e){const t=e.nodeType===go?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function pt(e){return{x:e.clientX,y:e.clientY}}function ho(e){var t;return e.nodeName==="IMG"&&(po()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function mo(e,t,r,s){let a=e?t.width:r,i=e?t.height:s;return En()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function xo(e,t,r,s,a){const i=ho(t),l=On(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:d,offsetHeight:f}=e,{anchorX:p,anchorY:g}=s,{dragPreviewWidth:u,dragPreviewHeight:m}=mo(i,t,d,f),v=()=>{let N=new Fr([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(g);return En()&&i&&(N+=(window.devicePixelRatio-1)*m),N},x=()=>new Fr([0,.5,1],[c.x,c.x/d*u,c.x+u-d]).interpolate(p),{offsetX:C,offsetY:y}=a,S=C===0||C,T=y===0||y;return{x:S?C:x(),y:T?y:v()}}class bo{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 Co(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Br(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){Co(e,a,r[a])})}return e}class vo{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 Br({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 Br({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Pr).some(r=>Pr[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=fo(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&&On(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=pt(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=Ut(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const f=this.monitor.getSourceId(),p=this.sourceNodes.get(f),g=this.sourcePreviewNodes.get(f)||p;if(g){const{anchorX:u,anchorY:m,offsetX:v,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),S=xo(p,g,o,{anchorX:u,anchorY:m},{offsetX:v,offsetY:x});l.setDragImage(g,S.x,S.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?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=Ut(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:pt(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=pt(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 Ut(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:pt(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 bo(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new co(this.isNodeInDocument)}}const yo=function(t,r,s){return new vo(t,r,s)},Do=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:i,multiple:o,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p})=>{const g=h.useRef(null),u=h.useRef(null),[m,v]=h.useState([]),[x,C]=h.useState(!1),[y,S]=h.useState(!1),T=h.useCallback(G=>{const B=G.target.files;if(B&&B.length>0){const H=Array.from(B),q=f?.(H),K=p?.(H);q?C(!0):K?S(!0):e(H)}},[f,p,e]),D=h.useCallback(G=>i&&G?.length>i,[i]),N=h.useMemo(()=>x||y||D(m),[x,y,D,m]),L=()=>{v([]),C(!1),S(!1)},O=h.useMemo(()=>x?n.jsx(b.DialErrorText,{text:l}):y?n.jsx(b.DialErrorText,{text:d}):D(m)?n.jsx(b.DialErrorText,{text:c}):null,[c,l,d,m,D,x,y]);h.useEffect(()=>{L()},[a]);const[{isOver:A,canDrop:k},w]=pr(()=>({accept:[At],drop(G){const B=G.files,H=f?.(B)??!1,q=p?.(B)??!1,K=D?.(B)??!1;if(C(H),S(q),H||q||K){v(B);return}e(B),L()},collect:G=>({isOver:G.isOver(),canDrop:G.canDrop()})}),[e,f,p,D]),M=G=>{(G.key==="Enter"||G.key==="Space")&&(G.preventDefault(),u.current?.click())},$=G=>{G?.preventDefault();const B=Array.from(G.dataTransfer?.items??[]);C(!!f?.(B)),S(!!p?.(B)),v(B)},U=G=>{G.target===G.currentTarget&&L()},J=oe("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!k&&!N&&"border-primary",k&&(A?"border-accent-primary":"border-hover"),N&&"border-error");return w(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:J,ref:g,onDragOver:$,onDragLeave:U,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:M,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(b.DialPrimaryButton,{appearance:E.ButtonAppearance.Ghost,label:s,onClick:()=>u.current?.click()})]}),n.jsx("input",{multiple:o,id:"file",type:"file",ref:u,hidden:!0,accept:a,onChange:T})]}),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(F.IconExclamationCircle,{...z.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(b.DialInput,{...r,iconBefore:a(),containerClassName:oe("h-[40px] p-0",s&&"h-[60px]"),className:oe("rounded-r-none border-r-0",s&&"text-error",t)})},So=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:i,fileFormatError:o,fileSizeError:l,fileCountError:c})=>{const d=h.useRef(null),[f,p]=h.useState(!1),[g,u]=h.useState(!1),[m,v]=h.useState(0),x=h.useCallback(()=>{p(!1),u(!1),v(0)},[]),C=h.useCallback(A=>!!(i&&t.length+A.length>i),[i,t.length]),y=f||g,[{isOver:S,canDrop:T},D]=pr(()=>({accept:[At],drop(A){const k=A.files,w=[...t,...k],M=s?.(k)??!1,$=a?.(k)??!1,U=C?.(k)??!1;if(p(M),u($),M||$||U){v(k.length);return}r(w),x()},collect:A=>({isOver:A.isOver(),canDrop:A.canDrop()})}),[t,r,s,a,C,x]),N=A=>{A.preventDefault();const k=Array.from(A.dataTransfer?.items??[]);p(!!s?.(k)),u(!1),v(k.length)},L=A=>{A.target===A.currentTarget&&x()};D(d);const O=C(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:d,onDragOver:N,onDragLeave:L,className:oe("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!y&&!O&&(T&&S?"border-accent-primary":"border-primary"),(y||O)&&"border-error"),children:e}),f&&n.jsx(b.DialErrorText,{text:o}),g&&n.jsx(b.DialErrorText,{text:l}),!f&&!g&&O&&n.jsx(b.DialErrorText,{text:c})]})},An=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:i,errorText:o,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g}=e,u=h.useCallback((x,C)=>{x.stopPropagation(),a(t?.filter(y=>y.name!==C)||[])},[a,t]),m=h.useCallback(x=>n.jsx(Ot,{"aria-label":l,onClick:C=>u(C,x)}),[l,u]),v=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,C)=>n.jsx(Io,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:r||s?.(x.name),invalid:i?.(x),error:i?.(x)?o:""},x.name+C))}),[t,r,s,i,o,m]);return n.jsx(ei,{backend:yo,children:!t||t.length===0?n.jsx(Do,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx(So,{existingFiles:t,onDrop:a,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),c?.(t)&&n.jsx(b.DialErrorText,{text:d})]})})},No=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:i,maxMultiFilesSize:o,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:u,addButtonLabel:m,additionalActionButtons:v,...x})=>{const C=h.useRef(null),y=()=>C.current?.click(),S=()=>{e([])},T=h.useCallback(O=>O?.some(A=>!(g==="/"||g?.toLowerCase()?.includes(A?.type?.toLowerCase()))),[g]),D=h.useCallback(O=>{if(!i)return!1;const A=i*(1024*1024);return O?.some(k=>{const w=k.size;return!!w&&w>A})},[i]),N=h.useCallback(O=>{if(!o||!p)return!1;const A=o*1024*1024;return O.reduce((w,M)=>w+M.size,0)>A},[o,p]),L=h.useCallback(O=>{const A=O.target.files;if(A&&A.length>0){const k=Array.from(A),w=T(k),M=D(k);!w&&!M&&e([...s||[],...k])}},[T,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(ke.DialLabel,{label:`${t}: ${p?s?.length||0:""}`,htmlFor:r}),p&&!!s?.length&&n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(b.DialNeutralButton,{label:u,iconBefore:n.jsx(F.IconTrashX,{...z.BASE_ICON_PROPS}),onClick:S}),(a?a>s?.length:!0)&&n.jsx(b.DialPrimaryButton,{appearance:E.ButtonAppearance.Ghost,iconBefore:n.jsx(F.IconPlus,{...z.BASE_ICON_PROPS}),label:m,onClick:y}),v]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:p,ref:C,hidden:!0,accept:g,onChange:L}),n.jsx(An,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,getIsFileFormatError:T,getIsFileSizeError:D,getIsMultiFilesSizeError:N,...x})]})},jo=({icon:e,ariaLabel:t,size:r=E.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:i,iconClassName:o,caretIcon:l=n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:f=!1,open:p,onOpenChange:g,defaultOpen:u=!1,...m})=>{const v=r===E.ElementSize.Small,[x,C]=h.useState(u),y=p??x,S=v?"w-8 px-0":"w-10 px-0",T={[E.ElementSize.Small]:"size-5",[E.ElementSize.Standard]:"size-6",[E.ElementSize.Large]:"size-7"},D=N=>{C(N),g?.(N)};return n.jsx(j.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:f,className:a,open:y,onOpenChange:D,defaultOpen:u,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:S,i),children:[n.jsx(j.DialIcon,{icon:e,className:I.mergeClasses("flex items-center justify-center text-inherit",T[r],c&&"-mr-2",o,j.DIAL_KIT_CLASS.dropdownIcon)}),c&&n.jsxs("div",{className:I.mergeClasses("relative z-10 inline-grid size-5 shrink-0 place-items-center",j.DIAL_KIT_CLASS.dropdownIconCaret),children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(j.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",y&&"rotate-180")})]})]})})},To="application/octet-stream";function wo(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=Zt(s,!0),i=e.filter(c=>c!==r).map(c=>{const d=c.path||c.url||"",f=Eo(c.nodeType),p=f===b.DialFileNodeType.FOLDER,g=Zt(d,p);let u;return c.parentPath===null||c.parentPath===void 0?u=a:c.parentPath===""?u="":u=Zt(c.parentPath,!0),{...c,originalPath:d,path:g,parentPath:u,nodeType:f}}),o=new Map;i.forEach(c=>{const d={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:Oo(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===b.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===b.DialFileNodeType.ITEM&&(d.extension=Ao(c.name),d.contentType=c.contentType||To,d.contentLength=c.contentLength||0),o.set(c.path,d)});const l=[];return o.forEach(c=>{if(c.parentPath===a)l.push(c);else{const d=c.path.lastIndexOf(c.name||""),f=c.path.slice(0,d),p=o.get(f);p&&p.nodeType===b.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function Zt(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 Eo(e){return e.toUpperCase()==="FOLDER"?b.DialFileNodeType.FOLDER:b.DialFileNodeType.ITEM}function Oo(e){if(!e)return;const t=e.toUpperCase();return Object.values(b.DialFileResourceType).find(s=>s.toUpperCase()===t)}function Ao(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function _o(e,t="Prompts",r="prompts/public/",s="root"){const a=wo(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:b.DialFileNodeType.FOLDER,folderId:s,items:a}]}const _n=({locale:e,timeZone:t,date:r=new Date}={})=>{const s=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:s,timeZoneName:"longOffset"}).formatToParts(r).find(i=>i.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var Je=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(Je||{}),lt=(e=>(e.Select="select",e.Radio="radio",e))(lt||{}),_t=(e=>(e.Row="row",e.Column="column",e))(_t||{}),V=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(V||{});const Lo={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",typeColumnHeader:"Type",entryTypeString:"String",entryTypeNumber:"Number",entryTypeBoolean:"Boolean",entryTypeNull:"Null",entryTypeObject:"Object",entryTypeArray:"Array",entryTypeChangeWarning:"Changing type will reset the current value.",booleanTrueOption:"True",booleanFalseOption:"False",invalidJsonError:"Invalid JSON"},Ln=h.createContext(null);function we(){const e=h.useContext(Ln);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function zr(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 f of a)i=i?.[f];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=zr(o,Q(l,t,r+1));s=zr(o,i)}return s}function kn(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 Lt(e){return e==null||e===""}function Ye(e){return e.type===V.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function It(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Rn(e,t){return e.type===V.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 _e(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{..._e(i,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(Ye(s)){if(s.properties){const a={};let i=!1;for(const[o,l]of Object.entries(s.properties)){const c=_e(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 Ae(e,t,r,s="",a=0){if(a>15)return[];const i=[],o=Q(t,r);if(o.anyOf){const d=o.anyOf.filter(f=>f.type!==V.Null);return e!=null&&d.length===1?Ae(e,d[0],r,s,a+1):i}if(o.oneOf&&o.discriminator){const d=o.discriminator.propertyName,f=e?.[d];if(f&&o.discriminator.mapping[f]){const p={$ref:o.discriminator.mapping[f]},g=Q(p,r);return Ae(e,g,r,s,a+1)}return i}if(o.type===V.Array||!o.type&&Array.isArray(e)){if(Array.isArray(e)&&o.items)for(let d=0;d<e.length;d++){const f=Ae(e[d],o.items,r,`${s}[${d}]`,a+1);i.push(...f)}return i}if(!Ye(o))return i;const l=o.required??[],c=e;for(const d of l){const f=o.properties?.[d];if(f&&Q(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c?.[d];if(Lt(g)){const u=f?.title??It(d);i.push({path:p,message:`${u} is required`})}}if(c&&o.properties)for(const[d,f]of Object.entries(o.properties)){if(Q(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c[d];if(g!=null){const u=Ae(g,f,r,p,a+1);i.push(...u)}}if(c&&o.additionalProperties!=null&&o.additionalProperties!==!1&&typeof o.additionalProperties=="object"){const d=o.additionalProperties;for(const[f,p]of Object.entries(c)){const g=s?`${s}.${f}`:f,u=Ae(p,d,r,g,a+1);i.push(...u)}}return i}function gr(e,t,r){const s=Q(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ye(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 d=o?.[c];return d!=null&&d!==""}).length}/${i} fields`}return""}function ko(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===V.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>Q(a,r).type===V.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>Q(a,r).type===V.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const i=Q(a,r);return i.type===V.Number||i.type===V.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>Q(a,r).type===V.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(Ye(i)||i.oneOf)return a}return 0}return 0}function Ro(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 Mn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case V.String:return"";case V.Boolean:return!1;case V.Array:return[];case V.Integer:case V.Number:return;default:return{}}}const Mo=[V.String,V.Number,V.Boolean,V.Null,V.Object,V.Array];function Po(e){return Array.isArray(e)?V.Array:typeof e=="object"&&e!==null?V.Object:typeof e=="boolean"?V.Boolean:typeof e=="number"?V.Number:e===null?V.Null:V.String}const Fo={[V.String]:"",[V.Number]:0,[V.Boolean]:!1,[V.Null]:null,[V.Object]:{},[V.Array]:[]};function Bo(e){return Fo[e]}const ct=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:i,onRemove:o,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=h.useState(l),p=a===0,g="rounded border border-secondary",u=I.mergeClasses("flex items-center gap-2 cursor-pointer select-none transition-colors",p?"px-4 py-3 bg-layer-3 hover:bg-layer-4":"px-3 py-2 bg-layer-4 hover:bg-layer-3",d?"rounded-t":"rounded"),m=I.mergeClasses("border-t border-secondary",p?"p-4":"p-3");return n.jsxs("div",{className:g,children:[n.jsxs("div",{className:u,onClick:()=>f(v=>!v),role:"button","aria-expanded":d,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:d?n.jsx(F.IconChevronDown,{size:16,stroke:2}):n.jsx(F.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:I.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(ke.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(j.DialIcon,{icon:n.jsx(F.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(j.DialIcon,{icon:n.jsx(F.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),o&&n.jsx(Ot,{size:E.ElementSize.Small,onClick:v=>{v.stopPropagation(),o()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),d&&n.jsx("div",{className:m,children:i})]})},Pn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:i,label:o})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:d=new Set,skipUntouched:f=!1}=we(),p=Q(e,l),g=Ye(p),u=p.type===V.Array;if(g||u){const x=gr(t,p,l),C=Ae(t,p,l,s.join(".")),y=s.join("."),S=y+".",T=!f||d.has(y)||[...d].some(D=>D.startsWith(S));return n.jsx(ct,{title:o??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:T?C.length:0,defaultExpanded:c,children:n.jsx(Le,{schema:p,value:t,onChange:r,path:s,level:a+1,required:i})})}const v=(!f||d.has(s.join(".")))&&i&&Lt(t)?`${o??"Field"} is required`:void 0;return n.jsx(b.DialFormItem,{label:o,required:i,description:p.description,error:v,children:n.jsx(Le,{schema:p,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:!0})})},Ct=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o}=we(),l=Q(e,i),c=kn(Object.entries(l.properties??{}).filter(([,p])=>!Q(p,i).isHidden)),d=l.required??[],f=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(([p,g])=>{const m=Q(g,i).title??g.title??It(p),v=d.includes(p);return n.jsx(Pn,{schema:g,value:f[p],onChange:x=>r({...f,[p]:x}),path:[...s,p],level:a,required:v,label:m},p)})})},zo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,defaultExpanded:c=!0}=we(),d=Array.isArray(t)?t:[],f=e.items,[p,g]=h.useState(void 0);if(!f)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemSchema});const u=h.useMemo(()=>Q(f,i),[f,i]),m=h.useMemo(()=>u.discriminator,[u]),v=h.useMemo(()=>m?.propertyName,[m]),x=h.useMemo(()=>m?Object.keys(m.mapping).map(T=>({value:T,label:T})):[],[m]),C=()=>{const T=p??x[0]?.value;let D;if(m&&T){const N=Q({$ref:m.mapping[T]},i);D={..._e(N,i)??{},[m.propertyName]:T}}else D=_e(u,i)??Mn(u);r([...d,D])},y=T=>{r(d.filter((D,N)=>N!==T))},S=(T,D)=>{r(d.map((N,L)=>L===T?D:N))};return n.jsxs("div",{className:"flex flex-col gap-3",children:[d.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemsYet}),d.map((T,D)=>{const N=Ro(T,v,D),L=gr(T,u,i),O=Ae(T,u,i,`${s.join(".")}[${D}]`);return n.jsx(ct,{title:N,level:a,summary:L,errorCount:O.length,onRemove:l?void 0:()=>y(D),defaultExpanded:c,removeItemAriaLabel:o.removeItemAriaLabel,children:n.jsx(Le,{schema:f,value:T,onChange:A=>S(D,A),path:[...s,String(D)],level:a+1})},D)}),!l&&n.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[x.length>0&&n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(Te,{options:x,value:p??x[0]?.value,placeholder:o.selectTypeToAdd,onChange:T=>{const D=typeof T=="string"?T:T[0];g(D)}})}),n.jsx(b.DialGhostButton,{label:o.addItem,iconBefore:n.jsx(F.IconPlus,{size:16,stroke:2}),onClick:C})]})]})},$o=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1}=we(),c=h.useId(),d=e.discriminator;if(d){const x=d.propertyName,C=d.mapping,y=Object.keys(C).map(N=>({value:N,label:N})),S=typeof t=="object"&&t!==null?t[x]:void 0,T=S?Q({$ref:C[S]},i):void 0,D=N=>{const L=Q({$ref:C[N]},i),O=_e(L,i)??{};r({...O,[x]:N})};if(e.discriminatorDisplay===lt.Radio){const N=e.discriminatorOrientation===_t.Row,L=S?(()=>{const O=Q({$ref:C[S]},i),{[x]:A,...k}=O.properties??{};return{...O,properties:k}})():void 0;return N?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(C).map(O=>{const A=Q({$ref:C[O]},i);return n.jsx(j.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:A.title??O,checked:S===O,disabled:l,onChange:()=>D(O)},O)})}),L&&n.jsx(Ct,{schema:L,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(C).map(O=>{const A=Q({$ref:C[O]},i),k=S===O,{[x]:w,...M}=A.properties??{},$={...A,properties:M};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:A.title??O,checked:k,disabled:l,onChange:()=>D(O)}),k&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Ct,{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(Te,{options:y,value:S,placeholder:o.selectTypePlaceholder,disabled:l,onChange:N=>{const L=typeof N=="string"?N:N[0];L&&D(L)}})}),T&&n.jsx("div",{className:"pl-3",children:n.jsx(Ct,{schema:T,value:t,onChange:r,path:s,level:a})})]})}const f=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<f.length;x++)if(Q(f[x],i).required?.every(y=>y in t))return x}return 0})(),u=x=>{const C=Q(f[x],i),y=_e(C,i);r(y??null)},m=f[g];if(e.discriminatorDisplay===lt.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:f.map((x,C)=>{const y=Q(x,i),S=Rn(x,i)??`Option ${C+1}`,T=g===C;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:String(C),inputId:`${c}-${C}`,label:S,checked:T,disabled:l,onChange:()=>u(C)}),T&&y&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Le,{schema:y,value:t,onChange:r,path:s,level:a})})]},C)})});const v=f.map((x,C)=>{const y=Q(x,i);return{value:String(C),label:y.title??`Option ${C+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(Te,{options:v,value:String(g),disabled:l,onChange:x=>{const C=typeof x=="string"?x:x[0];u(Number(C))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Le,{schema:m,value:t,onChange:r,path:s,level:a})})]})},Ho=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,readonly:o=!1}=we(),l=e.anyOf??[],c=l.map((m,v)=>({value:String(v),label:Rn(m,i)})),d=ko(t,l,i),f=l[d],g=Q(f,i).type===V.Null,u=m=>{const v=Q(l[m],i);if(v.type===V.Null){r(null);return}const x=_e(v,i);if(x!==void 0){r(x);return}switch(v.type){case V.Array:r([]);break;case V.String:r("");break;case V.Boolean:r(!1);break;case V.Integer:case V.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(Te,{options:c,value:String(d),disabled:o,onChange:m=>{const v=typeof m=="string"?m:m[0];u(Number(v))}})}),!g&&f&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Le,{schema:f,value:t,onChange:r,path:s,level:a})})]})},Fn=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:i,readonly:o=!1,inputClassName:l,acceptableResourceTypes:c}=we(),d=e.const!==void 0,f=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===V.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(u=>{const m=c?.[u];return Array.isArray(m)?m.map(v=>{const x=String(v);return{value:x,label:x}}):[]});return n.jsx(Te,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:i.enumSelectPlaceholder,className:l})}if(d)return n.jsx(b.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(f&&e.enumDisplay===lt.Radio){const g=e.enumOrientation===_t.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(u=>{const m=String(u);return n.jsx(j.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(f){const g=e.enum.map(u=>({value:String(u),label:String(u)}));return n.jsx(Te,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:i.enumSelectPlaceholder})}switch(e.type){case V.Boolean:return n.jsx(ke.DialSwitch,{switchId:a,isOn:!!t,disabled:o,onChange:g=>r(g)});case V.Integer:return n.jsx(tr,{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 V.Number:return n.jsx(tr,{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(In,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l}):n.jsx(b.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l})}},hr=({value:e,onChange:t,theme:r=ut.EditorThemes.dark,height:s=240})=>{const{readonly:a,texts:i}=we(),[o,l]=h.useState(null),[c,d]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-BDe6elKO.cjs")).then(g=>{l(()=>g.DialJsonEditor)})},[]);let f=!1;try{JSON.parse(c)}catch{f=!0}const p=g=>{const u=g??"";d(u);try{t(JSON.parse(u))}catch{}};return n.jsxs("div",{children:[n.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:o&&n.jsx(o,{value:c,currentTheme:r,onChange:p,options:{readOnly:a}})}),n.jsx(b.DialErrorText,{text:f?i.invalidJsonError:void 0})]})},$r=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Bn=e=>!!(e.oneOf||e.anyOf||e.type===V.Array||Ye(e)),Vo={[V.String]:"entryTypeString",[V.Number]:"entryTypeNumber",[V.Boolean]:"entryTypeBoolean",[V.Null]:"entryTypeNull",[V.Object]:"entryTypeObject",[V.Array]:"entryTypeArray"},Ko=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,isUnschematizedValue:a,jsonEditorTheme:i,onKeyChange:o,onValueChange:l,onRemove:c,keyInputPlaceholder:d,removeFieldAriaLabel:f,path:p,level:g,readonly:u=!1,inputClassName:m})=>{const{rootSchema:v,texts:x,defaultExpanded:C=!0,touchedPaths:y=new Set,markTouched:S=()=>{},skipUntouched:T=!1}=we(),[D,N]=h.useState(t),L=Bn(s),[O,A]=h.useState(()=>Po(r)),k=a&&(O===V.Object||O===V.Array),w=a&&O===V.Null,M=L||k,$=[...p,e,"key"].join("."),J=(!T||y.has($))&&t==="",G=h.useCallback(te=>{l(Bo(te)),A(te)},[l]),B=h.useMemo(()=>Mo.map(te=>({value:te,label:x[Vo[te]]})),[x]),H=h.useMemo(()=>[{value:"true",label:x.booleanTrueOption},{value:"false",label:x.booleanFalseOption}],[x]),q=`${e}-key-error`,K=a&&O===V.Boolean,se=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:M?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(b.DialInput,{value:D,disabled:u,invalid:J,"aria-describedby":J?q:void 0,onChange:te=>N(te??""),onBlur:()=>{S($),D!==t&&o(D)},placeholder:d,containerClassName:m}),n.jsx(b.DialErrorText,{id:q,text:J?`${x.keyColumnHeader} is required`:void 0})]}),!L&&!k&&n.jsx("div",{className:"flex-1 min-w-0",children:w?n.jsx(b.DialInput,{value:"null",disabled:!0,onChange:void 0,className:"opacity-60"}):K?n.jsx(Te,{options:H,value:r?"true":"false",disabled:u,onChange:te=>{const le=typeof te=="string"?te:te[0];le&&l(le==="true")}}):n.jsx(Fn,{schema:a?{type:O}:s,value:r,onChange:l})}),a&&n.jsx("div",{className:"w-28 shrink-0",children:n.jsx(E.DialTooltip,{tooltip:x.entryTypeChangeWarning,triggerClassName:"block",children:n.jsx(Te,{options:B,value:O,disabled:u,onChange:te=>{const le=typeof te=="string"?te:te[0];le&&G(le)}})})}),!u&&n.jsx(Ot,{size:E.ElementSize.Small,onClick:c,"aria-label":f,className:"shrink-0 p-1"})]});if(!M)return se;if(k)return n.jsxs("div",{className:"flex flex-col gap-2",children:[se,n.jsx(hr,{value:r,onChange:l,theme:i},O)]});const X=[...p,t],Z=gr(r,s,v),ae=Ae(r,s,v,X.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[se,n.jsx(ct,{title:t,level:g,summary:Z,errorCount:ae.length+(J?1:0),defaultExpanded:C,children:n.jsx(Le,{schema:s,value:r,onChange:l,path:X,level:g+1})})]})},Go=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,inputClassName:c,jsonEditorTheme:d}=we(),f=e.additionalProperties===!0||e.additionalProperties==null,p=f?{type:"string"}:typeof e.additionalProperties=="object"?Q(e.additionalProperties,i):{type:"string"},g=Bn(p),[u,m]=h.useState(()=>Object.entries(t??{}).map(([D,N])=>$r(D,N))),v=D=>Object.fromEntries(D.filter(N=>N.key!=="").map(N=>[N.key,N.value])),x=(D,N)=>{const L=u.map((O,A)=>A===D?{...O,key:N}:O);m(L),r(v(L))},C=(D,N)=>{const L=u.map((O,A)=>A===D?{...O,value:N}:O);m(L),r(v(L))},y=()=>g?_e(p,i)??Mn(p):"",S=()=>{m(D=>[...D,$r("",y())])},T=D=>{const N=u.filter((L,O)=>O!==D);m(N),r(v(N))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[u.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noFieldsYet}),u.length>0&&!g&&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&&n.jsx("span",{className:"w-28 shrink-0 dial-tiny-text text-secondary font-medium",children:o.typeColumnHeader})]}),u.map((D,N)=>n.jsx(Ko,{pairId:D.id,pairKey:D.key,pairValue:D.value,valueSchema:p,isUnschematizedValue:f,jsonEditorTheme:d,onKeyChange:L=>x(N,L),onValueChange:L=>C(N,L),onRemove:()=>T(N),keyInputPlaceholder:o.keyInputPlaceholder,removeFieldAriaLabel:o.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},D.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(b.DialGhostButton,{label:o.addField,iconBefore:n.jsx(F.IconPlus,{size:16,stroke:2}),onClick:S})})]})},Le=({schema:e,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:o=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:f=new Set,skipUntouched:p=!1,jsonEditorTheme:g}=we(),u=Q(e,l),m=C=>{d(s.join(".")),r(C)},v=!p||f.has(s.join("."));let x;if(u.oneOf)x=n.jsx($o,{schema:u,value:t,onChange:m,path:s,level:a});else if(u.anyOf&&u.type!==V.Object)x=n.jsx(Ho,{schema:u,value:t,onChange:m,path:s,level:a});else if(Ye(u)){const C=u.additionalProperties!=null&&u.additionalProperties!==!1,y=!u.properties||Object.keys(u.properties).length===0;C&&y?x=n.jsx(Go,{schema:u,value:t,onChange:m,path:s,level:a}):y&&u.additionalProperties!==!1?x=n.jsx(hr,{value:t,onChange:m,theme:g}):x=n.jsx(Ct,{schema:u,value:t,onChange:m,path:s,level:a})}else if(u.type===V.Array)x=n.jsx(zo,{schema:u,value:t,onChange:m,path:s,level:a});else{const C=v&&i&&Lt(t),y=!o&&C?`${u.title??"Field"} is required`:void 0;x=n.jsxs(n.Fragment,{children:[n.jsx(Fn,{schema:u,value:t,onChange:m,invalid:C}),n.jsx(b.DialErrorText,{text:y})]})}return c?c(s,u,x):x},Uo=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:i=!0,inputClassName:o,variant:l=Je.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:g=!1,jsonEditorTheme:u,acceptableResourceTypes:m})=>{const v=h.useMemo(()=>({...Lo,...r}),[r]),x=h.useMemo(()=>t||(_e(e,e)??{}),[]),[C,y]=h.useState(x),[S,T]=h.useState(new Set),D=h.useCallback(w=>{T(M=>M.has(w)?M:new Set([...M,w]))},[]);h.useEffect(()=>{f?.(x)},[]);const N=(w,M)=>{const $={...C,[w]:M};y($),c?.($),d?.(w,M)},L=new Set(Object.keys(e.properties??{})),O=Object.keys(C).filter(w=>!L.has(w)),A=kn(Object.entries(e.properties??{}).filter(([,w])=>!Q(w,e).isHidden)),k=e.required??[];return n.jsx(Ln.Provider,{value:{rootSchema:e,texts:v,readonly:a,defaultExpanded:i,inputClassName:o,jsonEditorTheme:u,acceptableResourceTypes:m,renderField:p,touchedPaths:S,markTouched:D,skipUntouched:g},children:n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-4",s),children:[A.map(([w,M])=>{const $=Q(M,e),U=$.title??M.title??It(w),J=k.includes(w),G=C[w];if(l===Je.Flat)return n.jsx(Pn,{schema:M,value:G,onChange:K=>N(w,K),path:[w],level:0,required:J,label:U},w);if(l===Je.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(Le,{schema:M,value:G,onChange:K=>N(w,K),path:[w],level:0,required:J})]},w);const B=Ae(G,$,e,w),H=w+".",q=!g||S.has(w)||[...S].some(K=>K.startsWith(H));return n.jsx(ct,{title:U,description:$.description,level:0,defaultExpanded:i,errorCount:q?J&&Lt(G)?Math.max(B.length,1):B.length:0,children:n.jsx(Le,{schema:M,value:G,onChange:K=>N(w,K),path:[w],level:1,required:J})},w)}),O.map(w=>{const M=It(w),$=n.jsx(hr,{value:C[w],onChange:U=>N(w,U),theme:u});return l===Je.Sections?n.jsx(ct,{title:M,level:0,defaultExpanded:i,children:$},w):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:M}),$]},w)})]})})},Zo=e=>({info:n.jsx(F.IconInfoCircleFilled,{size:e.size}),error:n.jsx(F.IconAlertCircleFilled,{size:e.size}),warning:n.jsx(F.IconAlertTriangleFilled,{size:e.size}),success:n.jsx(F.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(b.Spinner,{size:e.size}),general:n.jsx(F.IconCheck,{size:e.size,stroke:e.stroke})}),Wo={[b.NotificationVariant.Info]:"bg-info text-info",[b.NotificationVariant.Success]:"bg-success text-success",[b.NotificationVariant.Warning]:"bg-warning text-warning",[b.NotificationVariant.Error]:"bg-error text-error",[b.NotificationVariant.Loading]:"bg-layer-raised text-info",[b.NotificationVariant.General]:"bg-layer-sunken text-primary"},qo={[b.NotificationVariant.Info]:"status",[b.NotificationVariant.Success]:"status",[b.NotificationVariant.Warning]:"alert",[b.NotificationVariant.Error]:"alert",[b.NotificationVariant.Loading]:"status",[b.NotificationVariant.General]:"status"},Yo="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",mr=({variant:e=b.NotificationVariant.Info,type:t=b.NotificationType.Toast,title:r,message:s,action:a,className:i,iconSize:o=24,iconStroke:l=2,closable:c=!1,onClose:d,children:f,textClassName:p,...g})=>{const u=h.useMemo(()=>Zo({size:o,stroke:l})[e],[e,o,l]),m=p??(t===b.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:qo[e],...g,className:I.mergeClasses(Yo,Wo[e],t===b.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===b.NotificationType.SectionMessage&&e===b.NotificationVariant.Loading&&"border-secondary",i,j.DIAL_KIT_CLASS.notification),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(j.DialIcon,{icon:u})}),r?n.jsxs("div",{className:I.mergeClasses("flex min-w-0 text-primary break-words",m),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})]}),a!=null&&n.jsx("div",{className:"flex shrink-0 items-center",children:a}),f,c&&n.jsx(R.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:v=>d?.(v)})]})},Hr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Xo=e=>e===1?"!truncate !whitespace-nowrap":`${Hr[e]??Hr[2]} !whitespace-normal`,Qo=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const i=I.mergeClasses(Xo(a),s,j.DIAL_KIT_CLASS.highlight);if(!t.trim())return n.jsx(R.EllipsisTooltip,{className:i,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(R.EllipsisTooltip,{className:i,text:l})},Jo=({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,j.DIAL_KIT_CLASS.cardShell),children:t}),tt=(e,t)=>({type:s,...a})=>n.jsx(mr,{...a,variant:e,type:s||t}),rt=(e,t)=>({variant:s,...a})=>n.jsx(mr,{...a,variant:s||t,type:e}),el=tt(b.NotificationVariant.Error,b.NotificationType.Toast),tl=tt(b.NotificationVariant.Info,b.NotificationType.Toast),rl=tt(b.NotificationVariant.Success,b.NotificationType.Toast),nl=tt(b.NotificationVariant.Warning,b.NotificationType.Toast),sl=tt(b.NotificationVariant.Loading,b.NotificationType.Toast),al=tt(b.NotificationVariant.General,b.NotificationType.Toast),il=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Error),ol=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Info),ll=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Success),cl=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Warning),dl=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Loading),ul=rt(b.NotificationType.SectionMessage,b.NotificationVariant.General);var be=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(be||{});const fl="en-GB",pl={[be.Date]:"Select date",[be.DateTime]:"Select date and time",[be.Time]:"--:--",[be.Weekday]:"Select day"},zn="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",$n="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",Hn="!border-error",gl="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",hl="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",ml="bg-control-accent text-control-permanent",xl="text-accent dial-small-semi-text",bl="text-control-disable-primary",Vn="text-secondary",Cl=n.jsx(F.IconCalendar,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Vn}),Vr={prev:n.jsx(F.IconChevronLeft,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx(F.IconChevronRight,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},vl=(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})},Kr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Gr=(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},yl=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Ur=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),Dl=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),gt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Zr=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},Il=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Sl=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}`},Kn=5,Gn=e=>e.charAt(0).toUpperCase()+e.slice(1),Nl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,Kn+r));return Gn(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),jl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,Kn+r));return{value:String(r+1),label:Gn(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),Wr=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:i,panel:o,labelledBy:l,panelLabel:c})=>{const d=j.useThemeScope(),[f,p]=h.useState(!1),{refs:g,floatingStyles:u,context:m}=de.useFloating({open:f,onOpenChange:T=>p(t?!1:T),placement:"bottom-start",whileElementsMounted:de.autoUpdate,middleware:[de.offset(8),de.flip({padding:8}),de.shift({padding:8})]}),v=de.useClick(m,{enabled:!t}),x=de.useDismiss(m),C=de.useRole(m,{role:"dialog"}),{getReferenceProps:y,getFloatingProps:S}=de.useInteractions([v,x,C]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":f,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:I.mergeClasses(zn,"focus-visible:outline focus-visible:outline-focus",r&&Hn,t&&$n,i),...y(),children:s}),f&&n.jsx(de.FloatingPortal,{children:n.jsx(de.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:u,"aria-label":c,className:I.mergeClasses(gl,d,a),...S(),children:o(()=>p(!1))})})})]})},qr=({id:e,value:t,onChange:r,onBlur:s,disabled:a,invalid:i,className:o,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[f,p]=h.useState(t);h.useEffect(()=>{p(t)},[t]);const g=n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:c,disabled:a,value:f,onChange:u=>{const m=Sl(u.target.value);p(m),Il(m)&&r(m)},onBlur:s,className:I.mergeClasses(zn,i&&Hn,a&&$n,o)});return d?n.jsxs("div",{className:"relative w-full",children:[g,n.jsx("span",{className:"dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",children:d})]}):g},Tl=({mode:e=be.Date,value:t,onChange:r,onBlur:s,labelProps:a,placeholder:i,disabled:o=!1,invalid:l=!1,id:c,className:d,minDate:f,maxDate:p,locale:g=fl,fieldClassName:u,showTimezone:m=!1})=>{const v=i??pl[e],x=t instanceof Date?t:null,C=h.useId(),y=c??C,S=a?.id??`${y}-label`,T=!!a?.label,D=typeof a?.label=="string"?a.label:void 0,N=T?`${S} ${y}`:void 0,L=a?n.jsx(R.Label,{...a,id:S,htmlFor:y}):null,[O,A]=h.useState(()=>x??new Date),k=h.useMemo(()=>new Date,[]),w=h.useMemo(()=>m?_n({locale:g}):null,[m,g]),M=h.useMemo(()=>Nl(g),[g]),$=h.useMemo(()=>jl(g),[g]),U=h.useMemo(()=>vl(O.getFullYear(),O.getMonth()),[O]),J=q=>{A(K=>new Date(K.getFullYear(),K.getMonth()+q,1))},G=(q,K)=>{if(Gr(q,f,p))return;const se=e===be.DateTime&&x?Zr(q,gt(x)):q;r?.(se),e===be.Date&&K()},B=q=>{r?.(Zr(x??new Date,q))},H=()=>x?e===be.DateTime?`${Ur(x,g)}, ${gt(x)}`:Ur(x,g):v;if(e===be.Time){const q=typeof t=="string"?t:x?gt(x):"";return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[L,n.jsx(qr,{id:y,value:q,onChange:K=>r?.(K),onBlur:s,disabled:o,invalid:l,placeholder:v,className:u,timezoneLabel:w})]})}if(e===be.Weekday){const q=typeof t=="string"?t:void 0,K=$.find(se=>se.value===q);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[L,n.jsx(Wr,{id:y,disabled:o,invalid:l,labelledBy:N,panelLabel:D??v,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!K&&"text-secondary"),children:K?.label??v}),n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Vn})]}),panel:se=>n.jsx("div",{role:"listbox","aria-label":D??v,className:"flex flex-col gap-0.5",children:$.map(X=>n.jsx("button",{type:"button",role:"option","aria-selected":X.value===q,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",X.value===q&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(X.value),se()},children:X.label},X.value))})})]})}return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[L,n.jsx(Wr,{id:y,disabled:o,invalid:l,labelledBy:N,panelLabel:D??v,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!x&&"text-secondary"),children:H()}),Cl]}),panel:q=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(R.StaticIconButton,{"aria-label":"Previous month",icon:Vr.prev,size:E.ElementSize.Small,onClick:()=>J(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:yl(O,g)}),n.jsx(R.StaticIconButton,{"aria-label":"Next month",icon:Vr.next,size:E.ElementSize.Small,onClick:()=>J(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[M.map(K=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:K},K)),U.map(K=>{const se=K.getMonth()!==O.getMonth(),X=Kr(K,x),Z=Kr(K,k),ae=Gr(K,f,p);return n.jsx("button",{type:"button",disabled:ae,"aria-label":Dl(K,g),"aria-pressed":X,"aria-current":Z?"date":void 0,className:I.mergeClasses(hl,se&&bl,Z&&!X&&xl,X&&ml,ae&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>G(K,q),children:K.getDate()},K.toISOString())})]}),e===be.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(qr,{ariaLabel:"Time",value:x?gt(x):"",onChange:B,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},wl=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const i=n.jsx(j.DialIcon,{icon:n.jsx(F.IconFolder,{size:z.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(b.DialBreadcrumb,{className:I.mergeClasses(s,j.DIAL_KIT_CLASS.folderPath),ariaLabel:a,separator:n.jsx(j.DialIcon,{icon:n.jsx(F.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")})};var Ze=(e=>(e.Small="small",e.Heading="heading",e))(Ze||{});const El="w-full overflow-hidden",Ol="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",Yr="flex min-w-0 items-center gap-2",Xr={[Ze.Small]:"dial-small-text",[Ze.Heading]:"dial-h2-text"},Al={[Ze.Small]:"dial-small-semi-text",[Ze.Heading]:"dial-h2-text"},_l={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},Ll="flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors",kl="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Rl="cursor-default text-primary",Ml="cursor-default text-secondary",Qr="inline-flex flex-none items-center leading-none text-secondary",Pl="dial-kit-minimum-target flex shrink-0 items-center rounded-sm text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Fl=3,Bl=4,zl=n.jsx(F.IconChevronRight,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),$l=({items:e,maxVisibleItems:t=Bl,size:r=Ze.Small,separator:s=zl,ariaLabel:a="Breadcrumb",overflowAriaLabel:i="Show hidden path segments",className:o,itemClassName:l})=>{const c=Math.max(t,Fl),d=h.useMemo(()=>e.length>c?e.slice(1,-(c-2)):[],[e,c]),f=h.useMemo(()=>d.map((m,v)=>({key:String(v),label:m.label,icon:m.icon})),[d]),p=h.useCallback(({key:m,domEvent:v})=>{const x=d[Number(m)];x&&(x.onClick?.(v),!x.onClick&&x.href&&!v.defaultPrevented&&(window.location.href=x.href))},[d]);if(e.length===0)return null;const g=e.slice(d.length+1),u=(m,{index:v,isFirst:x,isCurrent:C})=>{const y=!C&&(!!m.href||!!m.onClick),S=I.mergeClasses(Ll,y?kl:C?I.mergeClasses(Rl,Al[r]):Ml,l,j.DIAL_KIT_CLASS.breadcrumbsItem),T=n.jsxs(n.Fragment,{children:[m.icon,n.jsx(R.EllipsisTooltip,{text:m.label})]});return n.jsxs("li",{className:I.mergeClasses(Yr,Xr[r],_l[C?"last":x?"first":"middle"]),children:[y?m.href?n.jsx("a",{href:m.href,onClick:m.onClick,className:S,children:T}):n.jsx("button",{type:"button",onClick:m.onClick,className:S,children:T}):n.jsx("span",{className:S,"aria-current":C?"page":void 0,children:T}),!C&&n.jsx("span",{className:Qr,"aria-hidden":"true",children:s})]},`segment-${v}`)};return n.jsx("nav",{"aria-label":a,className:I.mergeClasses(El,o,j.DIAL_KIT_CLASS.breadcrumbs),children:n.jsxs("ol",{className:Ol,children:[u(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),d.length>0&&n.jsxs("li",{className:I.mergeClasses(Yr,Xr[r],"shrink-0"),children:[n.jsx(R.Dropdown,{items:f,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:n.jsx("button",{type:"button","aria-label":i,className:Pl,children:n.jsx(F.IconDots,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),n.jsx("span",{className:Qr,"aria-hidden":"true",children:s})]}),g.map((m,v)=>u(m,{index:e.length-g.length+v,isFirst:!1,isCurrent:v===g.length-1}))]})})},nt=({label:e,variant:t,appearance:r=E.ButtonAppearance.Solid,size:s=E.ElementSize.Standard,className:a,textClassName:i,iconAfter:o,iconBefore:l,type:c="button",tooltipProps:d,href:f,target:p,rel:g,disabled:u,...m})=>{const v=I.mergeClasses("dial-kit-base-button",t&&R.getButtonClassNames(t,r),s===E.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===E.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===E.ElementSize.Small&&"dial-kit-base-button-small",r!==E.ButtonAppearance.Link&&(s===E.ElementSize.Small?"px-2":"px-4"),s!==E.ElementSize.Small&&r!==E.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,C=E.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),y=n.jsxs(n.Fragment,{children:[n.jsx(j.DialIcon,{icon:l}),e&&n.jsx("span",{className:i,children:e}),n.jsx(j.DialIcon,{icon:o})]}),S=m,T=f!==void 0?n.jsx("a",{...S,href:u?void 0:f,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":u||void 0,tabIndex:u?-1:S.tabIndex,onClick:u?void 0:S.onClick,className:v,"aria-label":C,children:y}):n.jsx("button",{...m,type:c,disabled:u,className:v,"aria-label":C,children:y});return d?n.jsx(R.Tooltip,{asChild:!0,...d,children:T}):T},xr=(e,t)=>({appearance:s,...a})=>n.jsx(nt,{...a,variant:e,appearance:s||t}),br=(e,t)=>({variant:s,...a})=>n.jsx(nt,{...a,variant:s||t,appearance:e}),Un=xr(E.ButtonVariant.Primary,E.ButtonAppearance.Solid),Cr=xr(E.ButtonVariant.Neutral,E.ButtonAppearance.Solid),Hl=xr(E.ButtonVariant.Danger,E.ButtonAppearance.Solid),Vl=br(E.ButtonAppearance.Link,E.ButtonVariant.Primary),Kl=br(E.ButtonAppearance.Ghost,E.ButtonVariant.Primary),Gl=br(E.ButtonAppearance.Outlined,E.ButtonVariant.Neutral),Ul=({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":E.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx(F.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(E.DialTooltip,{...r,children:o}):o},Zl=e=>n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",e&&"rotate-180")}),Wl=({variant:e,appearance:t,items:r,...s})=>{const[a,i]=h.useState(!1),o=h.useMemo(()=>Zl(a),[a]);return n.jsx("div",{className:j.DIAL_KIT_CLASS.buttonDropdown,children:n.jsx(R.Dropdown,{items:r,onOpenChange:l=>i(l),children:n.jsx(nt,{...s,iconAfter:o,variant:e||E.ButtonVariant.Primary,appearance:t||E.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":a})})})},Zn=({label:e,size:t,isOpen:r=!1,"aria-label":s,...a})=>{const i=t===E.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,j.DIAL_KIT_CLASS.inlineSelect),...a,children:[e,n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",r&&"rotate-180")})]})},ql=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:i,placement:o="bottom-end",matchReferenceWidth:l=!1,listClassName:c,ariaLabel:d})=>{const[f,p]=h.useState(!1),[g,u]=h.useState(r??e[0]?.key),m=t!==void 0,v=m?t:g,x=h.useMemo(()=>{const y=e.find(S=>S.key===v);return y?.label?String(y.label):""},[e,v]),C=h.useCallback(({key:y})=>{const S=e.find(T=>T.key===y);S&&(m||u(y),s?.(S))},[e,m,s]);return n.jsx(R.Dropdown,{items:e,placement:o,matchReferenceWidth:l,listClassName:c,disabled:i,onOpenChange:p,onItemClick:C,children:n.jsx(Zn,{label:x,size:a,isOpen:f,disabled:i,"aria-label":d})})},Pe=({text:e,className:t,variant:r=b.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:I.mergeClasses("dial-tiny-text",r===b.CaptionType.Error?"text-error":"text-secondary",t,j.DIAL_KIT_CLASS.captionText,r===b.CaptionType.Error&&j.DIAL_KIT_CLASS.errorText),children:e}):null,Fe=({...e})=>n.jsx(Pe,{...e,variant:b.CaptionType.Error}),Yl="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={[E.ElementSize.Small]:"size-[24px]",[E.ElementSize.Standard]:"size-[40px]",[E.ElementSize.Large]:"size-[48px]"},Ql=({icon:e,onClick:t,disabled:r,size:s=E.ElementSize.Standard,className:a})=>n.jsx("div",{className:I.mergeClasses("border-l border-tertiary",Xl[s]),children:n.jsx(R.IconButton,{className:I.mergeClasses(Yl,s===E.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),Jl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Wn=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!Jl.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),d=parseFloat(c);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(s!==void 0&&d>+s){e.preventDefault();return}}}}},qn={[E.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[E.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[E.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},We=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:i=E.ElementSize.Standard,...o})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",qn[i].stackGap,a),children:[e&&n.jsx(R.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Yn,{id:s,size:i,...o}),n.jsx(Fe,{text:t}),!t&&n.jsx(Pe,{text:r})]})]}),Yn=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:i,iconBefore:o,iconAfter:l,wrapperClassName:c,type:d,inputRef:f,value:p,tooltipText:g,min:u,onChange:m,max:v,inputButtonProps:x,wrapperRef:C,size:y=E.ElementSize.Standard,...S})=>{const T=qn[y],D=h.useRef(null),N=de.useMergeRefs([f,D]),L=d==="number"||u!==void 0||v!==void 0;h.useEffect(()=>{const w=D.current;if(!w||!L||t)return;const M=$=>{$.preventDefault()};return w.addEventListener("wheel",M,{passive:!1}),()=>{w.removeEventListener("wheel",M)}},[t,L,d]);const O=w=>{Wn(w,d,u,v)},A=w=>{const M=w.currentTarget.value;if(L&&M!==""){const $=parseFloat(M);if(isNaN($)&&M!=="-"&&M!=="."||!isNaN($)&&(u!==void 0&&$<+u||v!==void 0&&$>+v))return}m?.(M||void 0)},k=()=>n.jsxs("div",{ref:C,className:I.mergeClasses("dial-kit-input flex flex-row items-center justify-between",T.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&T.paddingStart,!x&&T.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(Yn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:y,id:`${r}_textBefore`})}),n.jsx(j.DialIcon,{icon:o}),i,n.jsx("input",{ref:N,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:I.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:A,onKeyDown:O,min:u,disabled:t,max:v,...S}),a&&n.jsxs("p",{className:I.mergeClasses("text-secondary",T.postfixText),children:[" ",a]}),n.jsx(j.DialIcon,{icon:l}),x&&n.jsx(Ql,{size:y,...x,disabled:t})]});return t&&d!=="password"?n.jsx(R.Tooltip,{tooltip:g||p,children:k()}):k()};var qe=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(qe||{});const ec="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",tc={[qe.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[qe.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},rc="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",nc="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ge=({label:e,icon:t,appearance:r=qe.Outlined,selected:s=!1,disabled:a=!1,closable:i=!1,removeLabel:o,className:l,title:c,onClick:d,onRemove:f,onKeyDown:p,...g})=>{const u=r===qe.Selectable,m=!!d&&!a,v=i&&!!f&&!a,x=u&&s,C=y=>{p?.(y),!(!m||y.defaultPrevented)&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":u&&m?s:void 0,onClick:a?void 0:d,onKeyDown:C,className:I.mergeClasses(ec,x?"dial-tiny-semi-text":"dial-tiny-text",tc[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[rc,nc],l,j.DIAL_KIT_CLASS.tag),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(R.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:E.ElementSize.Small,"aria-label":o??`Remove ${e}`,icon:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:y=>{y.stopPropagation(),f?.(y)}})]})},Xn=({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(Ge,{label:a?.label??s,closable:!!r,onRemove:i=>r?.(i,s),icon:a?.icon,className:"max-w-full border border-tertiary"},s)})}),sc=I.mergeClasses("w-full flex flex-col"),ac=R.overlayItemClassName,ic="!max-w-[var(--reference-width)]",oc=I.mergeClasses("max-h-[344px] overflow-y-auto py-1",R.overlayListClassName),lc=R.overlayGap,cc=R.overlaySubMenuListClassName,dc=n.jsx(F.IconChevronRight,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),uc="text-secondary transition-transform",fc=8,pc=n.jsx(F.IconSearch,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),gc=n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),hc=n.jsx(R.SvgNoData,{width:z.DIAL_ICON_SIZE.LG,height:z.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),mc=({opt:e,selectedValues:t,mark:r=R.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:i,refs:o,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:f}=j.useSubMenuFloating(lc,"listbox",!!e.disabled),p=e.children?.some(u=>t.includes(u.value)),g=n.jsx(R.MenuItem,{ref:o.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!p,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:dc,...d()});return n.jsxs(de.FloatingNode,{id:i,children:[e.interactiveTooltip?n.jsx(R.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(j.SubMenuPanel,{refs:o,floatingStyles:l,context:c,getFloatingProps:f,role:"listbox",surfaceClassName:cc,children:e.children.map(u=>{const m=n.jsx(R.MenuItem,{role:"option","aria-selected":t.includes(u.value),"aria-disabled":!!u.disabled,disabled:u.disabled,mark:r,selected:t.includes(u.value),ellipsisLabel:!0,icon:u.icon,label:u.labelNode??u.label,rightControl:u.rightControl,onClick:()=>!u.disabled&&s(u.value)});return n.jsx(h.Fragment,{children:u.interactiveTooltip?n.jsx(R.InteractiveTooltip,{asChild:!0,placement:u.interactiveTooltip.placement,content:u.interactiveTooltip.content,contentClassName:u.interactiveTooltip.contentClassName,children:m}):m},u.value)})})]})},xc=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:i=E.ElementSize.Standard,prefix:o,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:f,caption:p,ariaLabel:g,searchable:u=!1,searchSize:m=E.ElementSize.Standard,searchPlaceholder:v,selectAll:x=!1,invalid:C,selectAllLabel:y="Select all",selectedOptionMark:S=R.MenuItemMark.Tint,emptyStateTitle:T="No options available",emptyStateDescription:D,emptyStateIcon:N,disabled:L=!1,className:O,fieldClassName:A,listClassName:k,closable:w=!1,header:M,footer:$,onClose:U,onChange:J,dismissRef:G,onFooterClick:B,open:H,onOpenChange:q,onSearchQueryChange:K,customMultiSelectTagsRenderer:se})=>{const X=h.useId(),Z=r||X,ae=`list-${Z}`,te=i===E.ElementSize.Small,[le,ue]=h.useState(!1),pe=H!==void 0,ge=pe?!!H:le,fe=h.useCallback(P=>{pe||ue(P),q?.(P)},[pe,q]),[W,ee]=h.useState(""),Se=h.useCallback(P=>{P!==W&&(ee(P||""),K?.(P||""))},[K,W]),Be=s!==void 0,[he,ze]=h.useState(a),Ee=Be?s:he,ie=h.useMemo(()=>t?Array.isArray(Ee)?Ee:[]:typeof Ee=="string"?[Ee]:[],[Ee,t]),Re=h.useMemo(()=>{const P=W.trim().toLowerCase();return P?e.filter(ce=>ce.label.toLowerCase().includes(P)):e},[e,W]);h.useEffect(()=>{ge||Se("")},[ge,Se]);const Ne=h.useCallback(P=>{Be||ze(P),J?.(P)},[Be,J]),$e=h.useCallback(P=>{if(t){const ce=new Set(ie);ce.has(P)?ce.delete(P):ce.add(P),Ne(Array.from(ce));return}Ne(P),fe(!1)},[t,Ne,fe,ie]),st=h.useCallback((P,ce)=>{if(P.stopPropagation(),!t){Ne("");return}const ft=ie.filter(ds=>ds!==ce);Ne(ft)},[t,ie,Ne]),ve=h.useMemo(()=>Re.filter(P=>!P.disabled),[Re]),He=h.useMemo(()=>ve.filter(P=>ie.includes(P.value)).length,[ve,ie]),{allSelectedInFiltered:Me,someSelectedInFiltered:me}=h.useMemo(()=>{const P=ve.length>0&&He===ve.length;return{allSelectedInFiltered:P,someSelectedInFiltered:He>0&&!P}},[ve,He]),kt=h.useCallback(()=>{if(!(!t||ve.length===0))if(Me){const P=new Set(ve.map(ce=>ce.value));Ne(ie.filter(ce=>!P.has(ce)))}else{const P=new Set(ie);ve.forEach(ce=>P.add(ce.value)),Ne(Array.from(P))}},[Me,t,ve,ie,Ne]),Oe=ie.length>0,Ve=!t&&Oe?ie[0]:void 0,_=h.useMemo(()=>Ve?e.find(P=>P.value===Ve)??e.flatMap(P=>P.children??[]).find(P=>P.value===Ve):void 0,[e,Ve]),re=_?o?`${o} ${_.label}`:_.label:void 0,xe=h.useMemo(()=>t?Oe?n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:se?.(e,ie,st)??n.jsx(Xn,{options:e,selectedValues:ie,handleRemoveTag:st})}):null:!_||!_.labelNode&&!_.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(R.EllipsisTooltip,{text:_.labelNode??re}),_.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:_.description})]}),[se,st,Oe,t,e,re,ie,_]),Rt=t||xe?"":re||(l&&s?l:""),is=typeof d?.label=="string"?d.label:void 0,os=xe?[E.resolveAccessibleName(g,is),t?ie.map(P=>e.find(ce=>ce.value===P)?.label??P).join(", "):re].filter(Boolean).join(", ")||void 0:E.resolveAccessibleName(g);h.useImperativeHandle(G,()=>({dismiss:()=>{fe(!1)}}));const ls=h.useCallback(P=>{L||(P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),ge||fe(!0))},[L,ge,fe]),cs=()=>n.jsxs("div",{id:ae,role:"listbox","aria-multiselectable":t||void 0,className:sc,children:[M&&n.jsx(n.Fragment,{children:typeof M=="function"?M():M}),(u||w)&&(e.length>fc||!!W)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&n.jsx(We,{id:`search-${Z}`,size:m,placeholder:v,"aria-label":v||"Search options",onChange:P=>Se(P),value:W,iconBefore:pc,containerClassName:"w-full"}),w&&n.jsx(R.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:E.ElementSize.Small,icon:gc,onClick:P=>{U?.(P),fe(!1)}})]}),t&&x&&ve.length>0&&n.jsx("div",{className:I.mergeClasses(ac,"mt-2"),children:n.jsx(R.Checkbox,{id:`${Z}-selectAll`,labelProps:{label:y},isSelected:Me,isIndeterminate:me,onChange:kt})}),n.jsx("div",{role:"none",className:oc,children:Re.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:N??hc,title:T,description:D})}):Re.map(P=>{const ce=ie.includes(P.value);if(P.children?.length)return n.jsx(mc,{opt:P,selectedValues:ie,mark:t?R.MenuItemMark.Checkbox:S,onSelect:$e},P.value);const ft=t?n.jsx(R.MenuItem,{id:`${Z}-${P.value}`,role:"option","aria-selected":ce,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:R.MenuItemMark.Checkbox,selected:ce,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>$e(P.value)}):n.jsx(R.MenuItem,{role:"option","aria-selected":ce,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:S,selected:ce,ellipsisLabel:!0,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>!P.disabled&&$e(P.value)});return n.jsx(h.Fragment,{children:P.interactiveTooltip?n.jsx(R.InteractiveTooltip,{asChild:!0,placement:P.interactiveTooltip.placement,content:P.interactiveTooltip.content,contentClassName:P.interactiveTooltip.contentClassName,children:ft}):ft},P.value)})}),$&&n.jsx("div",{onClick:P=>{B?.(P),B&&fe(!1)},children:typeof $=="function"?$():$})]});return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",O,j.DIAL_KIT_CLASS.select),children:[d&&n.jsx(R.Label,{...d,htmlFor:Z}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(R.Dropdown,{open:ge,onOpenChange:fe,disabled:L,closable:w,onClose:U,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:I.mergeClasses(ic,k),className:"w-full",renderOverlay:cs,children:n.jsx(We,{id:Z,size:i,disabled:L,invalid:C,value:Rt,placeholder:xe?void 0:c,readOnly:!0,iconBefore:t?void 0:_?.icon,iconAfter:n.jsx(F.IconChevronDown,{size:te?z.DIAL_ICON_SIZE.SM:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses(uc,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":ae,"aria-autocomplete":"none","aria-label":os,containerClassName:"w-full",wrapperClassName:I.mergeClasses(!L&&"cursor-pointer",t&&Oe&&["!h-auto flex-wrap py-1.5",te?"min-h-[24px]":"min-h-[40px]"],A),className:I.mergeClasses("cursor-pointer",xe&&"w-0 min-w-0 flex-none p-0"),onKeyDown:ls,children:xe})}),n.jsx(Fe,{text:f}),!f&&n.jsx(Pe,{text:p})]})]})};var Qn=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(Qn||{});const Jr={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},bc=e=>typeof e=="boolean"?Jr[e?"both":"none"]:Jr[e],Cc=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const f=I.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d.invalid&&"dial-kit-input-error",d.disabled&&"dial-kit-input-disable",bc(i),e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",a),children:[o&&n.jsx(R.Label,{...o,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(Fe,{text:s}),!s&&n.jsx(Pe,{text:l})]})]})},vc=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=E.ElementSize.Standard,...a})=>{const[i,o]=h.useState(!1),l=i&&!r;return h.useEffect(()=>{r&&o(!1)},[r]),n.jsx(We,{...a,wrapperClassName:I.mergeClasses(a.wrapperClassName,j.DIAL_KIT_CLASS.passwordInput),size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(R.GhostIconButton,{size:E.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx(F.IconEyeOff,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(F.IconEye,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>o(c=>!c)})})},yc=/^0+\.(\d+)?$/,Dc=/^0+/,Ic=[".","-","+","e","E"],en=e=>!e||e==="-"?e:String(e).match(yc)?String(e).replace(Dc,"0"):Number(e),Sc=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>{if(e&&Ic.includes(d.key)){d.preventDefault();return}Wn(d,"number",r,s),a?.(d)},c=d=>{if(e){const f=d.clipboardData.getData("text"),p=f.replace(/\D/g,"");if(p!==f&&(d.preventDefault(),p)){const g=d.currentTarget,u=g.selectionStart??0,m=g.selectionEnd??0,v=g.value.slice(0,u)+p+g.value.slice(m);t?.(en(v))}}i?.(d)};return n.jsx(We,{...o,wrapperClassName:I.mergeClasses(o.wrapperClassName,j.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:s,onChange:d=>t?.(en(d)),onKeyDown:l,onPaste:c})},Nc="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",jc="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Tc="flex flex-row items-center justify-between px-6 py-4",wc="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",Ec="border-b border-tertiary",Oc="flex flex-row items-center gap-2 px-6 py-4",Ac="border-t border-tertiary",Wt="flex shrink-0 flex-row items-center gap-2",_c={[b.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[b.PopupSize.Md]:"max-w-full md:max-w-[800px]",[b.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},vr=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:i,titleClassName:o,headerClassName:l,bodyClassName:c,children:d,footer:f,footerClassName:p,onClose:g,onBack:u,backAriaLabel:m="Back",headerActions:v,headerDivider:x=!1,mainButtons:C,additionalButtons:y,additionalButtonsOnLeft:S=!1,footerDivider:T=!1,size:D=b.PopupSize.Md,hideClose:N=!1,closeAriaLabel:L="Close dialog",closeOnOutsideClick:O=!0,preventKeyboardOnOpen:A=!1})=>{const k=j.useThemeScope(),w=h.useRef(null),M=h.useId(),{refs:$,context:U}=de.useFloating({open:e,onOpenChange:Z=>{Z||g?.(null)}}),J=de.useRole(U,{role:"dialog"}),G=de.useDismiss(U,{outsidePress:O}),{getFloatingProps:B}=de.useInteractions([J,G]);if(!e)return null;const H=typeof t=="string"?`popup-heading-${M}`:void 0,q=Z=>Z?typeof Z=="string"?n.jsx("h2",{id:H,className:I.mergeClasses(wc,o),children:n.jsx(R.Tooltip,{tooltip:Z,triggerClassName:"truncate",children:Z})}):Z:n.jsx("span",{}),K=N?null:n.jsx(R.CloseButton,{ariaLabel:L,onClose:Z=>g?.(Z)}),se=(Z,ae=[])=>ae.map(({variant:te=E.ButtonVariant.Neutral,...le},ue)=>n.jsx(nt,{variant:te,...le},`${Z}-${ue}`)),X=()=>{if(f!==void 0)return f;if(!C?.length&&!y?.length)return null;const Z=se("additional",y);return n.jsxs("div",{className:I.mergeClasses(Oc,T&&Ac,p),children:[S&&Z.length>0&&n.jsx("div",{className:Wt,children:Z}),n.jsxs("div",{className:I.mergeClasses(Wt,"ml-auto"),children:[!S&&Z,se("main",C)]})]})};return n.jsx(de.FloatingPortal,{id:s,children:n.jsx(de.FloatingOverlay,{className:I.mergeClasses(Nc,k,i),children:n.jsx(de.FloatingFocusManager,{context:U,initialFocus:A?w:$.floating,children:n.jsxs("div",{ref:$.setFloating,...B(),role:"dialog","aria-modal":"true","aria-labelledby":H,"aria-label":H?void 0:r,className:I.mergeClasses(jc,_c[D],a,j.DIAL_KIT_CLASS.popup),children:[A&&n.jsx("div",{ref:w,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:I.mergeClasses(Tc,x&&Ec,l),children:[u&&n.jsx(R.GhostIconButton,{"aria-label":m,size:E.ElementSize.Small,className:"mr-2",onClick:u,icon:n.jsx(F.IconChevronLeft,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),q(t),v?n.jsxs("div",{className:Wt,children:[v,K]}):K]}),n.jsx("div",{className:I.mergeClasses("grow overflow-auto",c),children:d}),X()]})})})})},Lc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",kc="text-secondary dial-small-paragraph-text px-6 pb-4",Rc="px-6 py-4 h-[120px]",Mc="Cancel",Pc="Ok",qt={[b.ConfirmationPopupVariant.Info]:{confirm:{variant:E.ButtonVariant.Primary,appearance:E.ButtonAppearance.Solid}},[b.ConfirmationPopupVariant.Danger]:{container:"border-t-4 border-error",confirm:{variant:E.ButtonVariant.Danger,appearance:E.ButtonAppearance.Solid}}},Jn=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=Pc,cancelLabel:i=Mc,isLoading:o=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:f,onConfirm:p,onCancel:g,children:u,variant:m=b.ConfirmationPopupVariant.Info,size:v=b.PopupSize.Sm,footer:x,hideClose:C,...y})=>{const S=o?null:n.jsxs("div",{className:Lc,children:[n.jsx(Cr,{label:i,onClick:()=>g?g():f?.()}),n.jsx(nt,{variant:qt[m].confirm.variant,appearance:qt[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),T=h.useCallback(()=>o?n.jsx("div",{className:Rc,children:n.jsx(b.Spinner,{size:40})}):u??(t?n.jsx("div",{className:I.mergeClasses(kc,r),children:t}):null),[u,t,o,r]);return n.jsx(vr,{...y,open:s,header:e,className:I.mergeClasses(qt[m].container,c,j.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>f?.(),footer:x??S,size:v,hideClose:C??(!o&&x===void 0),children:T()})};var St=(e=>(e.Start="start",e.End="end",e))(St||{});const Fc=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,ariaLabel:l,onToggle:c,caretPosition:d=St.End,className:f,headerClassName:p,contentClassName:g})=>{const u=s!==void 0,[m,v]=h.useState(a),x=o?!0:u?s:m,C=h.useId(),y=`accordion-header-${C}`,S=`accordion-content-${C}`,T=()=>{if(i)return;const A=!x;u||v(A),c?.(A)},D=d===St.Start,N=o?null:n.jsx(F.IconChevronRight,{size:z.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",x?"rotate-90":"rtl:rotate-180")}),L=n.jsxs(n.Fragment,{children:[D&&N,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]}),!D&&N]}),O=D?"justify-start gap-2":"justify-between";return n.jsxs("div",{className:I.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",f,j.DIAL_KIT_CLASS.accordion),children:[o?n.jsx("div",{id:y,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",O,p),children:L}):n.jsx("button",{id:y,type:"button","aria-expanded":x,"aria-controls":S,"aria-label":E.resolveAccessibleName(l),disabled:i,onClick:T,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",O,i?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:L}),n.jsx("div",{inert:!x,className:I.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",x?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:n.jsx("div",{className:"min-h-0 overflow-hidden",children:n.jsx("div",{className:"pt-3",children:n.jsx("div",{id:S,role:"region","aria-labelledby":y,className:I.mergeClasses("px-4 dial-small-text text-primary",g),children:r})})})})]})},Bc=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:i,className:o,...l})=>{const c=h.useId(),d=e??c,f=i?`${d}-caption`:void 0,p=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,j.DIAL_KIT_CLASS.switch),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:d,checked:r,"aria-checked":r,disabled:s,onChange:p,"aria-label":E.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":f,className:"peer sr-only"}),n.jsx("label",{htmlFor:d,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(R.Label,{size:E.ElementSize.Standard,...t,htmlFor:d,className:I.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),i&&n.jsx("span",{id:f,className:"dial-tiny-text text-secondary ml-[44px]",children:i})]})},zc="flex flex-col gap-2",$c="flex",Hc="mt-2 ml-[26px]",Vc={[b.RadioGroupOrientation.Column]:"flex-col gap-y-3",[b.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},es=({items:e,value:t,onChange:r,name:s,id:a,orientation:i=b.RadioGroupOrientation.Column,labelProps:o,disabled:l,error:c,caption:d,ariaLabel:f,className:p,optionsClassName:g,radioClassName:u,contentClassName:m})=>{const v=h.useId(),x=a??v,C=`${x}-label`,y=c?`${x}-error`:void 0,S=!c&&d?`${x}-caption`:void 0,T=E.resolveAccessibleName(o?.label);return n.jsxs("div",{className:I.mergeClasses(zc,p,j.DIAL_KIT_CLASS.radioGroup),children:[o&&n.jsx(R.Label,{...o,id:C}),n.jsx("div",{role:"radiogroup","aria-labelledby":T?C:void 0,"aria-label":T?void 0:E.resolveAccessibleName(f),"aria-describedby":[y,S].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:I.mergeClasses($c,Vc[i],g),children:e.map(D=>{const N=D.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(R.Radio,{id:`${x}-${D.value}`,name:s??x,value:D.value,labelProps:D.label==null?void 0:{label:D.label},"aria-label":D["aria-label"],caption:D.caption,isSelected:N,disabled:l||D.disabled,onChange:r,className:u}),N&&D.content?n.jsx("div",{className:I.mergeClasses(Hc,m),children:D.content}):null]},D.value)})}),n.jsx(Fe,{id:y,text:c}),!c&&n.jsx(Pe,{id:S,text:d})]})},Kc="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",Gc="min-w-0 flex-1 truncate text-primary",Uc="min-w-0 flex-1 truncate text-secondary",Zc="shrink-0 text-secondary",Wc="px-6 pb-4",qc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Yc="Cancel",Xc="Apply",Qc=({items:e,value:t,customValue:r,header:s,onApply:a,id:i,labelProps:o,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:f,onClose:p,isValid:g=!0,applyButtonLabel:u=Xc,cancelButtonLabel:m=Yc,size:v=b.PopupSize.Md,portalId:x,disabled:C,invalid:y,error:S,caption:T,ariaLabel:D,className:N,fieldClassName:L})=>{const O=h.useId(),A=i??O,k=`${A}-label`,w=`${A}-value`,M=S?`${A}-error`:void 0,$=!S&&T?`${A}-caption`:void 0,[U,J]=h.useState(!1),G=c!==void 0,[B,H]=h.useState(t),q=G?c:B,K=h.useCallback(()=>{C||(G||H(t),J(!0))},[C,G,t]),se=h.useCallback(()=>{J(!1),p?.()},[p]),X=h.useCallback(()=>{f?.(),se()},[f,se]),Z=h.useCallback(()=>{a(q),se()},[a,q,se]),ae=h.useCallback(W=>{G||H(W),d?.(W)},[G,d]),te=E.resolveAccessibleName(o?.label),le=te?void 0:E.resolveAccessibleName(D),ue=te?k:le&&`${A}-name`,pe=E.resolveAccessibleName(s),ge=e.find(W=>W.value===t)?.label,fe=r??ge;return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",N,j.DIAL_KIT_CLASS.radioGroupPopupField),children:[o&&n.jsx(R.Label,{...o,id:k,htmlFor:A}),n.jsxs("div",{className:"flex flex-col gap-1",children:[le&&n.jsx("span",{id:ue,className:"sr-only",children:le}),n.jsxs("button",{type:"button",id:A,disabled:C,"aria-haspopup":"dialog","aria-expanded":U,"aria-labelledby":ue?`${ue} ${w}`:void 0,"aria-describedby":[M,$].filter(Boolean).join(" ")||void 0,onClick:K,className:I.mergeClasses(Kc,y&&"dial-kit-input-error",C&&"dial-kit-input-disable",L),children:[n.jsx("span",{id:w,className:fe==null?Uc:Gc,children:fe??l}),n.jsx(F.IconMaximize,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Zc})]}),n.jsx(Fe,{id:M,text:S}),!S&&n.jsx(Pe,{id:$,text:T})]}),n.jsx(vr,{open:U,header:s,ariaLabel:pe?void 0:te,portalId:x,size:v,onClose:X,footer:n.jsxs("div",{className:qc,children:[n.jsx(Cr,{label:m,onClick:X}),n.jsx(Un,{label:u,disabled:!g,onClick:Z})]}),children:n.jsx("div",{className:Wc,children:n.jsx(es,{id:`${A}-options`,items:e,value:q,onChange:ae,orientation:b.RadioGroupOrientation.Column,ariaLabel:te??pe})})})]})},Jc=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:i,size:o=E.ElementSize.Small,className:l,...c})=>{const d=h.useCallback(p=>{a?.(p),s?.(!r)},[a,s,r]),f=n.jsx(R.IconButton,{...c,size:o,variant:E.ButtonVariant.Primary,appearance:E.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":E.resolveAccessibleName(c["aria-label"],i?.tooltip),onClick:d,className:I.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,j.DIAL_KIT_CLASS.toggleIconButton)});return i?n.jsx(R.Tooltip,{asChild:!0,...i,children:f}):f},ed=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],td="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",rd="flex h-8 min-w-8 grow shrink-0 basis-auto 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",nd="bg-layer-raised text-accent shadow-xs",sd="bg-transparent text-secondary",ad="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",id="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",od="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",ld="cursor-not-allowed bg-transparent text-control-disable-primary",cd=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:i,"aria-label":o})=>{const l=h.useRef({}),c=e.find(p=>p.value===t),d=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,f=h.useCallback(p=>{if(s||!ed.includes(p.key))return;const g=e.filter(C=>!C.disabled);if(g.length===0)return;const u=Math.max(g.findIndex(C=>C.value===t),0),m=g.length-1;let v=u;switch(p.key){case"ArrowRight":case"ArrowDown":v=u===m?0:u+1;break;case"ArrowLeft":case"ArrowUp":v=u===0?m:u-1;break;case"Home":v=0;break;case"End":v=m;break}p.preventDefault();const x=g[v];l.current[x.value]?.focus(),x.value!==t&&r(x.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":o,"aria-disabled":s||void 0,onKeyDown:f,className:I.mergeClasses(td,a,j.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const g=p.value===t,u=s||p.disabled;return n.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":E.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===d?0:-1,disabled:u,onClick:()=>r(p.value),className:I.mergeClasses(rd,g?nd:sd,u?g?od:ld:g?ad:id,i,j.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},dd={[b.TabOrientation.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[b.TabOrientation.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},ud=({tabs:e,activeTabId:t,onTabChange:r,orientation:s=b.TabOrientation.Horizontal,sectionLabel:a,ariaLabel:i,className:o,tabListClassName:l,tabClassName:c,sectionLabelClassName:d})=>{const f=h.useRef({}),p=h.useId(),g=s===b.TabOrientation.Vertical,u=e.find(C=>C.id===t),m=u&&!u.disabled?u.id:e.find(C=>!C.disabled)?.id,v=h.useCallback(C=>{const{next:y,previous:S}=dd[s];if(![y,S,"Home","End"].includes(C.key)||e.length===0)return;const T=e.filter(A=>!A.disabled);if(T.length===0)return;const D=Math.max(T.findIndex(A=>A.id===t),0),N=T.length-1;let L=D;C.key===y?L=D===N?0:D+1:C.key===S?L=D===0?N:D-1:C.key==="Home"?L=0:L=N,C.preventDefault();const O=T[L];f.current[O.id]?.focus(),O.id!==t&&r(O.id)},[e,t,r,s]),x=n.jsx("div",{role:"tablist","aria-orientation":g?"vertical":void 0,"aria-label":i,"aria-labelledby":!i&&a?p:void 0,onKeyDown:v,className:I.mergeClasses(g?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&o,l,j.DIAL_KIT_CLASS.tabList,!a&&j.DIAL_KIT_CLASS.tabs),children:e.map(C=>{const y=t===C.id,S=!!C.disabled;return n.jsxs("button",{ref:T=>{f.current[C.id]=T},type:"button",role:"tab","aria-selected":y,disabled:S,tabIndex:C.id===m?0:-1,onClick:()=>r(C.id),className:I.mergeClasses("dial-kit-enhanced-target flex items-center gap-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-focus",g?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",y?"dial-small-semi-text":"dial-small-text text-secondary"]:["dial-small-paragraph-semi-text border-b-2 border-transparent px-3 py-2","focus-visible:outline-offset-2"],S&&(g?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!S&&(g?y?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":y?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),c,j.DIAL_KIT_CLASS.tab,y&&j.DIAL_KIT_CLASS.tabSelected),children:[C.icon&&n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:C.icon}),n.jsx("span",{className:I.mergeClasses(g&&!y&&!S&&"text-primary"),children:C.label}),C.count!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"ms-auto",S&&"bg-layer-sunken text-control-disable-primary",!S&&(y?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:C.count})]},C.id)})});return a?n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-3",o,j.DIAL_KIT_CLASS.tabs),children:[n.jsx("div",{className:I.mergeClasses("flex h-16 shrink-0 items-center",g?"px-4":"px-3"),children:n.jsx("span",{id:p,className:I.mergeClasses("dial-h1-text text-primary",d,j.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),x]}):x},fd="flex flex-nowrap items-center gap-1",pd="min-w-max flex-1 justify-center",gd=({items:e,value:t,onChange:r,stretch:s=!1,className:a,chipClassName:i,"aria-label":o,"aria-labelledby":l})=>n.jsx("div",{role:"group","aria-label":o,"aria-labelledby":l,className:I.mergeClasses(fd,a,j.DIAL_KIT_CLASS.filterChips),children:e.map(c=>n.jsx(Ge,{label:c.label,icon:c.icon,appearance:qe.Selectable,selected:c.value===t,onClick:()=>r(c.value),className:I.mergeClasses(s&&pd,i)},c.value))}),sr=(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})},hd=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:i,multiple:o=!1,disabled:l=!1,errorText:c,icon:d,id:f,ariaLabel:p,className:g})=>{const u=h.useId(),m=f??`file-dropzone-${u}`,v=c?`${m}-error`:void 0,[x,C]=h.useState(!1),y=h.useRef(0),S=h.useCallback(k=>{if(k.length===0)return;const w=o?k:k.slice(0,1),M=w.filter(U=>sr(U,i)),$=w.filter(U=>!sr(U,i));$.length>0&&a?.($),M.length>0&&s(M)},[i,o,s,a]),T=h.useCallback(k=>{S(Array.from(k.target.files??[])),k.target.value=""},[S]),D=h.useCallback(()=>{y.current=0,C(!1)},[]),N=h.useCallback(k=>{l||(k.preventDefault(),y.current+=1,C(!0))},[l]),L=h.useCallback(k=>{l||(k.preventDefault(),k.dataTransfer.dropEffect="copy")},[l]),O=h.useCallback(()=>{l||(y.current-=1,y.current<=0&&D())},[l,D]),A=h.useCallback(k=>{k.preventDefault(),!l&&(D(),S(Array.from(k.dataTransfer?.files??[])))},[l,D,S]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(R.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:i,multiple:o,disabled:l,onChange:T,"aria-label":E.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":v,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:N,onDragOver:L,onDragLeave:O,onDrop:A,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&&x&&"border-accent bg-control-accent-alpha",!l&&!x&&"border-secondary hover:border-accent",c&&!x&&"border-error hover:border-error",g,j.DIAL_KIT_CLASS.fileDropzone),children:[d??n.jsx(F.IconUpload,{size:z.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(Fe,{id:v,text:c})]})},ts=({label:e="Shared",tooltip:t,size:r=12,className:s})=>n.jsx(R.Tooltip,{tooltip:t||"Shared",asChild:!0,children:n.jsx("span",{role:"img","aria-label":e,className:I.mergeClasses("flex shrink-0 rounded-sm bg-layer-raised text-accent",s,j.DIAL_KIT_CLASS.sharedEntityIndicator),children:n.jsx(F.IconArrowUpRight,{size:r,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var De=(e=>(e.Images="images",e.Video="video",e.Audio="audio",e.Code="code",e.Text="text",e.Pdf="pdf",e.Spreadsheet="spreadsheet",e.Presentation="presentation",e.Archive="archive",e.Dial="dial",e.Other="other",e))(De||{});const md={images:["apng","avif","bmp","gif","heic","heif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],video:["avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"],audio:["aac","aiff","flac","m4a","mid","midi","mp3","oga","ogg","opus","wav","wma"],code:["bash","c","cjs","cpp","cs","css","go","h","hpp","htm","html","ini","ipynb","java","js","json","jsx","kt","less","lua","mjs","php","ps1","py","r","rb","rs","sass","scala","scss","sh","sql","svelte","swift","toml","ts","tsx","vue","xml","yaml","yml","zsh"],text:["doc","docx","log","markdown","md","odt","rtf","text","txt"],pdf:["pdf"],spreadsheet:["csv","numbers","ods","tsv","xls","xlsm","xlsx"],presentation:["key","odp","pps","ppsx","ppt","pptx"],archive:["7z","bz2","gz","rar","tar","tgz","xz","zip"],dial:["dial"]},xd=new Map(Object.entries(md).flatMap(([e,t])=>t.map(r=>[r,e]))),bd=e=>xd.get(e)??"other",tn="var(--text-control-permanent, #FCFCFC)",ht={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},Cd="#1B212D",vd={[De.Images]:{path:"M11.0002 8.66667H11.0036M7.00024 11.3333L8.66691 9.66667C8.97624 9.369 9.35758 9.369 9.66691 9.66667L11.3336 11.3333M10.6669 10.6667L11.0002 10.3333C11.3096 10.0357 11.6909 10.0357 12.0002 10.3333L13.0002 11.3333M7.00024 8C7.00024 7.73478 7.1056 7.48043 7.29314 7.29289C7.48067 7.10536 7.73503 7 8.00024 7H12.0002C12.2655 7 12.5198 7.10536 12.7074 7.29289C12.8949 7.48043 13.0002 7.73478 13.0002 8V12C13.0002 12.2652 12.8949 12.5196 12.7074 12.7071C12.5198 12.8946 12.2655 13 12.0002 13H8.00024C7.73503 13 7.48067 12.8946 7.29314 12.7071C7.1056 12.5196 7.00024 12.2652 7.00024 12V8Z",sheet:ht},[De.Code]:{path:"M8.33358 8.66665L7.00024 9.99998L8.33358 11.3333M11.6669 8.66665L13.0002 9.99998L11.6669 11.3333M10.6669 7.33331L9.33358 12.6666",sheet:{x1:"16.6667",y1:"0",x2:"2.08333",y2:"20.4167",from:"var(--bg-control-inverted, #57647A)",to:Cd}},[De.Text]:{path:"M7.3335 8H12.6668M7.3335 10H12.6668M7.3335 12H11.3335",sheet:{x1:"25.8333",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-violet-1, #DDE3F9)",to:"var(--bg-gradient-1, #1D4ED8)"}},[De.Spreadsheet]:{path:"M7.33325 10.1667H12.6666M9.99992 7.5V12.8333M7.33325 8.16667C7.33325 7.98986 7.40349 7.82029 7.52851 7.69526C7.65354 7.57024 7.82311 7.5 7.99992 7.5H11.9999C12.1767 7.5 12.3463 7.57024 12.4713 7.69526C12.5963 7.82029 12.6666 7.98986 12.6666 8.16667V12.1667C12.6666 12.3435 12.5963 12.513 12.4713 12.6381C12.3463 12.7631 12.1767 12.8333 11.9999 12.8333H7.99992C7.82311 12.8333 7.65354 12.7631 7.52851 12.6381C7.40349 12.513 7.33325 12.3435 7.33325 12.1667V8.16667Z",sheet:{x1:"20.4167",y1:"-3.75",x2:"2.91667",y2:"20.4167",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-1, #059669)"}},[De.Pdf]:{fillPath:"M12.5373 10.3151C12.0382 10.3151 11.4137 10.4021 11.2094 10.4328C10.3637 9.54967 10.1231 9.04771 10.069 8.91388C10.1423 8.72544 10.3975 8.0096 10.4338 7.09022C10.4517 6.62991 10.3544 6.28596 10.1447 6.06792C9.93533 5.85024 9.68191 5.83331 9.60924 5.83331C9.35443 5.83331 8.92697 5.96216 8.92697 6.82503C8.92697 7.5737 9.27603 8.36813 9.37252 8.57339C8.86416 10.0536 8.31837 11.0669 8.20248 11.2753C6.15974 12.0444 6 12.788 6 12.9988C6 13.3775 6.26973 13.6036 6.72152 13.6036C7.8192 13.6036 8.8209 11.7607 8.98653 11.4407C9.76614 11.1301 10.8096 10.9377 11.0749 10.8918C11.8357 11.6166 12.7157 11.81 13.0811 11.81C13.3561 11.81 14 11.81 14 11.148C14 10.5332 13.2121 10.3151 12.5373 10.3151ZM12.4844 10.7497C13.0773 10.7497 13.234 10.9458 13.234 11.0494C13.234 11.1145 13.2093 11.3268 12.8915 11.3268C12.6065 11.3268 12.1145 11.1621 11.6303 10.8047C11.8322 10.7782 12.131 10.7497 12.4844 10.7497ZM9.57812 6.25458C9.63218 6.25458 9.66777 6.27195 9.69711 6.31264C9.86764 6.54926 9.73014 7.32242 9.56279 7.92745C9.40124 7.40867 9.28 6.61264 9.45058 6.33259C9.48392 6.27793 9.52204 6.25458 9.57812 6.25458ZM9.29017 10.8856C9.50483 10.452 9.74542 9.81997 9.87646 9.46253C10.1387 9.90147 10.4914 10.309 10.6954 10.53C10.0603 10.6639 9.57969 10.7976 9.29017 10.8856ZM6.4264 13.0566C6.41226 13.0399 6.41017 13.0045 6.42083 12.9621C6.44317 12.8731 6.61396 12.4322 7.84924 11.8796C7.67236 12.1582 7.39585 12.5563 7.09208 12.8537C6.87825 13.0538 6.71174 13.1553 6.59719 13.1553C6.55621 13.1553 6.49974 13.1442 6.4264 13.0566Z",sheet:{x1:"26.25",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-red, #FCE7F3)",to:"var(--bg-control-error-active, #CC4545)"}},[De.Audio]:{path:"M9 11.5C9 11.7652 8.89464 12.0195 8.70711 12.2071C8.51957 12.3946 8.26522 12.5 8 12.5C7.73478 12.5 7.48043 12.3946 7.29289 12.2071C7.10536 12.0195 7 11.7652 7 11.5C7 11.2347 7.10536 10.9804 7.29289 10.7929C7.48043 10.6053 7.73478 10.5 8 10.5C8.26522 10.5 8.51957 10.6053 8.70711 10.7929C8.89464 10.9804 9 11.2347 9 11.5ZM9 11.5V7.16663H12.3333V11.5M12.3333 11.5C12.3333 11.7652 12.228 12.0195 12.0404 12.2071C11.8529 12.3946 11.5985 12.5 11.3333 12.5C11.0681 12.5 10.8138 12.3946 10.6262 12.2071C10.4387 12.0195 10.3333 11.7652 10.3333 11.5C10.3333 11.2347 10.4387 10.9804 10.6262 10.7929C10.8138 10.6053 11.0681 10.5 11.3333 10.5C11.5985 10.5 11.8529 10.6053 12.0404 10.7929C12.228 10.9804 12.3333 11.2347 12.3333 11.5ZM9 8.49996H12.3333",sheet:ht},[De.Video]:{path:"M9.99996 13.1667C11.8409 13.1667 13.3333 11.6743 13.3333 9.83333C13.3333 7.99238 11.8409 6.5 9.99996 6.5C8.15901 6.5 6.66663 7.99238 6.66663 9.83333C6.66663 11.6743 8.15901 13.1667 9.99996 13.1667ZM9.33337 8.5L11.3334 9.83333L9.33337 11.1667V8.5Z",sheet:ht},[De.Presentation]:{path:"M7 7.33331H13M7.33333 7.33331V10.6666C7.33333 10.8435 7.40357 11.013 7.5286 11.1381C7.65362 11.2631 7.82319 11.3333 8 11.3333H12C12.1768 11.3333 12.3464 11.2631 12.4714 11.1381C12.5964 11.013 12.6667 10.8435 12.6667 10.6666V7.33331M10 11.3333V12.6666M9 12.6666H11M8.66667 9.99998L9.66667 8.99998L10.3333 9.66665L11.3333 8.66665",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-brown, #FDE8D8)",to:"var(--text-visual-brown-2, #B45309)"}},[De.Archive]:{path:"M10.0001 6.66669H9.58341M10.8334 7.451H10.4167M10.0001 8.23531H9.58341M10.8334 9.01963H10.4167M10.0001 9.80394H9.58341M10.8334 10.5883H10.4167M10.0001 11.3726C10.2211 11.3726 10.4331 11.4552 10.5893 11.6023C10.7456 11.7494 10.8334 11.9489 10.8334 12.1569V12.9412C10.8334 13.0452 10.7895 13.1449 10.7114 13.2185C10.6332 13.292 10.5273 13.3334 10.4167 13.3334H9.58341C9.47291 13.3334 9.36693 13.292 9.28879 13.2185C9.21065 13.1449 9.16675 13.0452 9.16675 12.9412V12.1569C9.16675 11.9489 9.25455 11.7494 9.41083 11.6023C9.56711 11.4552 9.77907 11.3726 10.0001 11.3726Z",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-3, #065F46)"}},[De.Dial]:{path:"M8.26392 7.44049C8.80816 7.44049 9.28449 7.50578 9.69653 7.63092L9.69849 7.6319C10.1079 7.75343 10.4556 7.938 10.7463 8.1817L10.7483 8.18365C11.0312 8.41601 11.2537 8.72491 11.4104 9.12115V9.12213C11.5666 9.51456 11.6496 9.98403 11.6497 10.5381C11.6497 11.5957 11.3539 12.3492 10.8108 12.8565C10.2602 13.3708 9.47204 13.6504 8.39868 13.6505H6.71313V7.44049H8.26392Z",fillPath:"M12.7167 12.1008L12.9558 12.3564L12.9558 12.3564L12.7167 12.1008ZM11.4504 6.20825L11.3486 6.54311L11.3507 6.54375L11.4504 6.20825ZM12.637 6.833L12.4119 7.10109L12.4147 7.10334L12.637 6.833ZM13.4108 7.9263L13.0853 8.05488L13.0856 8.05566L13.4108 7.9263ZM11.1666 12.8853L11.0909 12.5436V12.5436L11.1666 12.8853ZM10.4391 12.6553C10.2487 12.689 10.1217 12.8706 10.1553 13.0609C10.189 13.2513 10.3706 13.3783 10.5609 13.3447L10.5 13L10.4391 12.6553ZM13.6781 9.49291H13.3281C13.3281 10.5655 13.0283 11.33 12.4776 11.8451L12.7167 12.1008L12.9558 12.3564C13.687 11.6724 14.0281 10.6984 14.0281 9.49291H13.6781ZM7.9751 6.12805H8.3251C8.3251 6.24476 8.23053 6.35 8.1009 6.35V6V5.65C7.83231 5.65 7.6251 5.86989 7.6251 6.12805H7.9751ZM8.1009 6V6.35H9.89799V6V5.65H8.1009V6ZM9.89799 6V6.35C10.449 6.35 10.9312 6.41618 11.3486 6.54311L11.4504 6.20825L11.5522 5.87339C11.0566 5.72265 10.5039 5.65 9.89799 5.65V6ZM11.4504 6.20825L11.3507 6.54375C11.7654 6.66701 12.1173 6.85376 12.4119 7.10107L12.637 6.833L12.862 6.56492C12.4875 6.2506 12.0484 6.02084 11.5501 5.87275L11.4504 6.20825ZM12.637 6.833L12.4147 7.10334C12.7016 7.33926 12.9264 7.65273 13.0853 8.05488L13.4108 7.9263L13.7363 7.79772C13.5387 7.29746 13.2477 6.88206 12.8593 6.56265L12.637 6.833ZM13.4108 7.9263L13.0856 8.05566C13.2441 8.45409 13.3281 8.93071 13.3281 9.49291H13.6781H14.0281C14.0281 8.86239 13.934 8.29465 13.736 7.79694L13.4108 7.9263ZM7.9751 7.21882H8.3251V6.12805H7.9751H7.6251V7.21882H7.9751ZM12.7167 12.1008L12.4776 11.8451C12.117 12.1824 11.6591 12.4177 11.0909 12.5436L11.1666 12.8853L11.2423 13.227C11.9168 13.0776 12.4923 12.7898 12.9558 12.3564L12.7167 12.1008ZM11.1666 12.8853L11.0909 12.5436C11.091 12.5435 11.0826 12.5452 11.0606 12.5493C11.041 12.5528 11.0155 12.5573 10.9857 12.5625C10.926 12.5729 10.8511 12.5857 10.7756 12.5984C10.6269 12.6236 10.472 12.6495 10.4391 12.6553L10.5 13L10.5609 13.3447C10.6064 13.3366 11.1725 13.2425 11.2423 13.227L11.1666 12.8853Z",sheet:"var(--bg-gradient-2, #885DF2)"},[De.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:ht}},yd=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${h.useId().replace(/[^\w-]/g,"")}`,{path:s,fillPath:a,sheet:i}=vd[t],o=typeof i=="string";return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M17.4999 3.97859V16C17.4999 18.2091 15.709 20 13.4999 20H6.5C4.29086 20 2.5 18.2091 2.5 16V4C2.5 1.79086 4.29086 0 6.5 0H13.1683H13.5213C15.7186 0 17.4999 1.78128 17.4999 3.97859Z",fill:o?i:`url(#${r})`}),s&&n.jsx("path",{d:s,stroke:tn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&n.jsx("path",{d:a,fill:tn}),!o&&n.jsx("defs",{children:n.jsxs("linearGradient",{id:r,x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:i.from}),n.jsx("stop",{offset:"1",stopColor:i.to})]})})]})},Dd=({size:e})=>{const t=`dial-kit-folder-gradient-${h.useId().replace(/[^\w-]/g,"")}`;return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M6.38992 3.75H4.66663C3.00977 3.75 1.66663 5.09315 1.66663 6.75V7.91667H7.16339L10.8333 5.79247L7.85075 4.1297C7.40412 3.8807 6.90127 3.75 6.38992 3.75Z",fill:"var(--stroke-gradient-1, #5976E9)"}),n.jsx("path",{d:"M14.3333 5.41669C16.5424 5.41669 18.3333 7.20755 18.3333 9.41669V12.25C18.3333 14.4592 16.5424 16.25 14.3333 16.25H5.66663C3.45749 16.25 1.66663 14.4592 1.66663 12.25V7.6708C1.66663 7.11851 2.11434 6.6708 2.66663 6.6708H6.89447C7.43998 6.6708 7.97973 6.55922 8.48053 6.34291L9.86582 5.74458C10.3666 5.52827 10.9064 5.41669 11.4519 5.41669H14.3333Z",fill:`url(#${t})`}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),n.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},Id=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),Sd=(e,t)=>e===b.DialItemType.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",Nd=(e,t,r)=>e===b.DialItemType.Folder?n.jsx(Dd,{size:r}):n.jsx(yd,{size:r,kind:bd(t)}),yr=({type:e,name:t,fileExtension:r,shared:s=!1,loading:a=!1,size:i=z.DIAL_ICON_SIZE.MD,className:o,decorative:l=!1,label:c,loadingLabel:d="Loading",sharedIndicatorClassName:f,sharedIndicatorTooltip:p})=>{if(e!==b.DialItemType.File&&e!==b.DialItemType.Folder)return null;const g=e===b.DialItemType.File?Id(t,r):"",u=Sd(e,g),m=c??(s?`${u}, shared`:u),v=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":m};return n.jsxs("span",{className:I.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",o,j.DIAL_KIT_CLASS.fileIcon),...v,children:[a?n.jsx(b.Spinner,{size:i,ariaLabel:d}):Nd(e,g,i),s&&n.jsx(ts,{tooltip:p,className:I.mergeClasses("absolute -bottom-0.5 -left-0.5",f)})]})},rs=({name:e,type:t=b.DialItemType.File,fileExtension:r,shared:s=!1,loading:a=!1,loadingLabel:i,iconSize:o,details:l,isInvalidName:c=!1,className:d,nameClassName:f,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,sharedLabel:u="Shared",hideTooltip:m=!1,tooltipContent:v})=>n.jsxs("div",{className:I.mergeClasses("flex w-full min-w-0 items-center gap-2",d,j.DIAL_KIT_CLASS.fileName),children:[n.jsx(yr,{name:e,type:t,fileExtension:r,shared:s,loading:a,loadingLabel:i,size:o,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,decorative:!a}),n.jsxs("div",{className:I.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[n.jsx(R.EllipsisTooltip,{className:I.mergeClasses("dial-small-paragraph-text",c?"text-secondary":"text-primary",f),text:e,hideTooltip:m,customTooltipContent:v}),s&&n.jsx("span",{className:"sr-only",children:u}),l]})]}),jd=({className:e,...t})=>n.jsx(rs,{...t,type:b.DialItemType.Folder,className:I.mergeClasses(e,j.DIAL_KIT_CLASS.folderName)}),Td=({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},wd=4,Ed=24,rn=e=>parseFloat(e)||0,Od=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Ad=()=>{},_d=({id:e,value:t,defaultValue:r,size:s=E.ElementSize.Standard,labelProps:a,placeholder:i,caption:o,error:l,invalid:c,disabled:d=!1,readOnly:f=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:u="Tags",className:m,fieldClassName:v,tagClassName:x,onChange:C})=>{const y=h.useId(),S=e||y,T=s===E.ElementSize.Small,D=h.useRef(null),N=h.useRef([]),L=h.useRef(null),O=t!==void 0,[A,k]=h.useState(r??[]),w=O?t:A,M=w.length,[$,U]=h.useState(""),[J,G]=h.useState(M),B=!f&&!d,H=h.useCallback(W=>{O||k(W),C?.(W)},[O,C]),q=h.useCallback(W=>ee=>{N.current[W]=ee},[]),K=h.useCallback(()=>{const W=D.current;if(!W||W.clientWidth===0){G(w.length);return}const{paddingLeft:ee,paddingRight:Se}=getComputedStyle(W);G(Td({availableWidth:W.clientWidth-rn(ee)-rn(Se)-(f?0:Ed),tagWidths:w.map((Be,he)=>N.current[he]?.offsetWidth??0),overflowChipWidth:L.current?.offsetWidth??0,gap:wd}))},[f,w]);h.useEffect(()=>{if(!p){G(M);return}const W=D.current;if(!W)return;const ee=new ResizeObserver(()=>K());return ee.observe(W),K(),()=>ee.disconnect()},[p,K,M]);const se=I.mergeClasses(p?"shrink-0":"min-w-0",x),X=W=>{const ee=Od(W.trim()).trim();!ee||w.includes(ee)||H([...w,ee])},Z=W=>{H(w.filter(ee=>ee!==W))},ae=()=>{X($),U("")},te=W=>{if(B){if(W.key==="Enter"||W.key===","){W.preventDefault(),ae();return}W.key==="Backspace"&&!$&&M>0&&(W.preventDefault(),H(w.slice(0,-1)))}},le=()=>{B&&$.trim()&&ae()},ue=p?w.slice(0,J):w,pe=p?w.slice(J):[],ge=pe.join(", "),fe=M>0&&n.jsxs("span",{role:"list","aria-label":u,className:I.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ue.map(W=>n.jsx(Ge,{role:"listitem",label:W,className:se,disabled:d,closable:B,onRemove:B?()=>Z(W):void 0},W)),pe.length>0&&n.jsx(Ge,{role:"listitem",label:`+${pe.length}`,"aria-label":ge,title:ge,className:I.mergeClasses("shrink-0",x),disabled:d}),p&&n.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[w.map((W,ee)=>n.jsx("span",{ref:q(ee),className:"inline-flex",children:n.jsx(Ge,{label:W,className:x,disabled:d,closable:B,onRemove:B?Ad:void 0})},W)),n.jsx("span",{ref:L,className:"inline-flex",children:n.jsx(Ge,{label:`+${M}`,className:x})})]})]});return n.jsx(We,{id:S,size:s,labelProps:a,caption:o,error:l,invalid:c,disabled:d,readOnly:f,value:$,placeholder:M>0?void 0:i,"aria-label":g,wrapperRef:D,onChange:W=>U(W??""),onKeyDown:te,onBlur:le,containerClassName:I.mergeClasses("w-full",m),wrapperClassName:I.mergeClasses(M>0&&["!h-auto",T?"min-h-[24px] py-0.5":"min-h-[40px] py-1.5",p?"flex-nowrap overflow-hidden":"flex-wrap"],v,j.DIAL_KIT_CLASS.tagInput),className:I.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",f&&"cursor-default"),children:fe})},Ld={[E.ElementSize.Small]:z.DIAL_ICON_SIZE.SM,[E.ElementSize.Standard]:z.DIAL_ICON_SIZE.MD,[E.ElementSize.Large]:z.DIAL_ICON_SIZE.MD},kd=({size:e=E.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:i,onChange:o,wrapperClassName:l,inputRef:c,...d})=>{const f=h.useRef(null),p=de.useMergeRefs([c,f]),g=!!i&&!a,u=h.useCallback(()=>{o?.(void 0),f.current?.focus()},[o]);return n.jsx(We,{...d,size:e,value:i,disabled:a,onChange:o,placeholder:t,inputRef:p,wrapperClassName:I.mergeClasses(r&&"dial-kit-input-borderless",l,j.DIAL_KIT_CLASS.search),iconBefore:n.jsx(F.IconSearch,{size:Ld[e],stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(R.GhostIconButton,{size:E.ElementSize.Small,"aria-label":s,icon:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:u}):void 0})},Rd=16,Md=e=>(e.toString().split(".")[1]??"").length,Pd=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:i,labelProps:o,labels:l,formatValue:c,showValue:d=!1,caption:f,error:p,onChange:g,containerClassName:u,trackClassName:m,fillClassName:v,className:x,...C})=>{const y=h.useId(),S=e??y,T=f&&!p?`${S}-caption`:void 0,D=p?`${S}-error`:void 0,N=s-r,L=N>0?Math.min(100,Math.max(0,(t-r)/N*100)):0,O=`calc(${L}% + ${(.5-L/100)*Rd}px)`,A=c?c(t):t.toFixed(Md(a)),k=h.useCallback(w=>{g?.(Number(w.target.value))},[g]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",u),children:[(o||d)&&n.jsxs("div",{className:"flex items-center gap-2",children:[o&&n.jsx(R.Label,{...o,htmlFor:S}),d&&n.jsx("span",{"aria-hidden":"true",className:I.mergeClasses("dial-small-text ml-auto",i?"text-control-disable-primary":"text-primary"),children:A})]}),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",{...C,type:"range",id:S,value:t,min:r,max:s,step:a,disabled:i,onChange:k,"aria-label":E.resolveAccessibleName(typeof o?.label!="string"?C["aria-label"]:void 0),"aria-valuetext":c?A:void 0,"aria-describedby":D??T,className:I.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",x)})]}),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(Fe,{id:D,text:p}),!p&&n.jsx(Pe,{id:T,text:f})]})]})},Fd=48,Bd=({children:e,title:t,width:r=280,collapsedWidth:s=Fd,isOpened:a,defaultOpened:i=!0,onToggle:o,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:f="Expand sidebar",className:p,titleClassName:g,contentClassName:u,footerClassName:m})=>{const v=a!==void 0,[x,C]=h.useState(i),y=v?a:x,S=`collapsible-sidebar-content-${h.useId()}`,T=y?d:f,D=N=>{const L=!y;v||C(L),o?.(L,N)};return n.jsxs("aside",{"aria-label":c,style:{width:`${y?r:s}px`},className:I.mergeClasses("flex flex-col justify-between",p,j.DIAL_KIT_CLASS.collapsibleSidebar),children:[n.jsx("div",{id:S,hidden:!y,className:I.mergeClasses("min-h-0 flex-1 overflow-auto p-4",u),children:e}),n.jsx("div",{hidden:y,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",y?"justify-end px-2":"justify-center",m),children:[y&&l,n.jsx(R.IconButton,{variant:E.ButtonVariant.Primary,appearance:E.ButtonAppearance.Ghost,size:E.ElementSize.Standard,onClick:D,"aria-label":T,"aria-expanded":y,"aria-controls":S,tooltipProps:{tooltip:T},icon:y?n.jsx(F.IconChevronsLeft,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(F.IconChevronsRight,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},zd=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:i,ariaLabel:o,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const f=e===b.ResizableContainerSide.Left,p=f?F.IconChevronLeft:F.IconChevronRight,g=u=>{let m;switch(u.key){case"ArrowLeft":m=r+(f?i:-i);break;case"ArrowRight":m=r+(f?-i:i);break;case"Home":m=s;break;case"End":m=a;break;default:return}u.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",d),children:c??n.jsx(p,{size:z.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",f?"right-full":"left-full")})})},$d=16,ns=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:i,onResize:o,side:l=b.ResizableContainerSide.Right,keyboardStep:c=$d,ariaLabel:d="Resize panel",className:f,resizeHandlerClassName:p,resizeHandler:g})=>{const[u,m]=h.useState(!1),[v,x]=h.useState(a??t),C=s!==void 0,y=C?s:v,S=h.useRef(null),T=h.useCallback(()=>{m(!0)},[]),D=h.useCallback(()=>{m(!1);const O=S.current?.resizable?.getBoundingClientRect(),A=O?Math.round(O.width):t;C||x(A),i?.(A)},[i,C,t]),N=h.useCallback(O=>{const A=Math.min(r,Math.max(t,O));A!==y&&(C||(x(A),S.current?.updateSize({width:A,height:"100%"})),o?.(A),i?.(A))},[r,t,y,C,o,i]),L=h.useMemo(()=>{const O=l===b.ResizableContainerSide.Left,A=n.jsx(zd,{side:l,isResizing:u,width:y,minWidth:t,maxWidth:r,step:c,ariaLabel:d,onWidthChange:N,customHandler:g,handlerClassName:p});return{size:C?{width:y,height:"100%"}:void 0,defaultSize:C?void 0:{width:y,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?A:void 0,right:O?void 0:A},onResizeStart:T,onResize:(k,w,M)=>{o?.(Math.round(M.offsetWidth))},onResizeStop:D}},[l,C,y,t,r,c,d,N,g,p,u,T,D,o]);return n.jsx(b.Resizable,{ref:S,...L,children:n.jsx("div",{className:I.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",f,j.DIAL_KIT_CLASS.resizableContainer),children:e})})},Hd=({enabled:e=!0,children:t,...r})=>e?n.jsx(ns,{...r,children:t}):t;var je=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(je||{});const ss=8e3,dt="flex size-7 shrink-0 items-center justify-center",as={cancelItemAriaLabel:e=>`Cancel "${e}"`,itemProgressAriaLabel:e=>`"${e}" in progress`,successLabel:"Completed",canceledLabel:"Canceled",failedMessage:"Failed",warningMessage:"Completed with warnings",queueProgressAriaLabel:"Progress",queueProgressValueText:(e,t)=>`${e} of ${t}`,collapseAriaLabel:"Collapse",expandAriaLabel:"Expand",closeAriaLabel:"Close",closeConfirmHeader:"Close?",closeConfirmDescriptionInProgress:"Some items are still in progress.",closeConfirmDescriptionFailed:"Some items have failed.",closeConfirmDescriptionMixed:"Some items are still in progress, and some have failed.",closeConfirmLabel:"Close",closeCancelLabel:"Cancel"},Vd=({title:e,failedCount:t,isCollapsed:r,itemsId:s,labels:a,onToggleCollapse:i,onClose:o})=>{const l=r?F.IconChevronUp:F.IconChevronDown;return n.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"dial-small-paragraph-semi-text truncate text-primary",children:e}),t>0&&n.jsx("span",{className:"dial-small-paragraph-semi-text inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-control-error px-1 text-control-permanent",children:t})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[n.jsx(R.GhostIconButton,{"aria-label":r?a.expandAriaLabel:a.collapseAriaLabel,"aria-expanded":!r,"aria-controls":s,size:E.ElementSize.Small,icon:n.jsx(l,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:i,className:dt}),n.jsx(R.GhostIconButton,{"aria-label":a.closeAriaLabel,size:E.ElementSize.Small,icon:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:dt})]})]})},nn=({message:e,isError:t})=>{const r=t?F.IconAlertCircleFilled:F.IconAlertTriangleFilled;return n.jsx(R.Tooltip,{tooltip:e,asChild:!0,children:n.jsx("span",{className:dt,role:"img","aria-label":e,tabIndex:0,children:n.jsx(r,{size:z.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},Kd=({item:e,labels:t,onCancel:r})=>{const s=e.status===je.Canceled;return n.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[n.jsx(yr,{type:b.DialItemType.File,name:e.name,size:z.DIAL_ICON_SIZE.MD,className:I.mergeClasses(s&&"opacity-50"),decorative:!0}),n.jsx(R.EllipsisTooltip,{text:e.name,className:I.mergeClasses("dial-small-text",s?"text-secondary":"text-primary")}),e.status===je.InProgress&&n.jsxs("div",{className:I.mergeClasses(dt,"grid"),children:[n.jsx(b.Spinner,{size:z.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:I.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0")}),r&&n.jsx(R.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:E.ElementSize.Small,icon:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===je.Success&&n.jsx("span",{className:dt,role:"img","aria-label":t.successLabel,children:n.jsx(F.IconCheck,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===je.Warning&&n.jsx(nn,{message:e.message||t.warningMessage,isError:!1}),e.status===je.Failed&&n.jsx(nn,{message:e.message||t.failedMessage,isError:!0}),s&&n.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},Gd=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===je.InProgress?0:100)),0)/e.length),Ud=(e,t,r)=>e&&t?r.closeConfirmDescriptionMixed:t?r.closeConfirmDescriptionFailed:r.closeConfirmDescriptionInProgress,Zd=({title:e,items:t,onClose:r,onCancelItem:s,labels:a,autoCloseDelay:i=ss,className:o,bodyClassName:l})=>{const[c,d]=h.useState(!1),[f,p]=h.useState(!1),g=h.useId(),u={...as,...a},m=t.filter(N=>N.status===je.InProgress).length,v=m>0,x=t.filter(N=>N.status===je.Failed).length,C=x>0,y=t.length>0&&t.every(N=>N.status===je.Success),S=h.useCallback(()=>{v||C?p(!0):r()},[v,C,r]),T=h.useCallback(()=>{p(!1),r()},[r]),D=h.useCallback(()=>{d(N=>!N)},[]);return h.useEffect(()=>{if(!y||i<=0)return;const N=setTimeout(r,i);return()=>clearTimeout(N)},[y,i,r]),t.length===0?null:n.jsxs("div",{role:"status","aria-live":"polite",className:I.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",o,j.DIAL_KIT_CLASS.transferQueue),children:[n.jsx(Vd,{title:e,failedCount:x,isCollapsed:c,itemsId:g,labels:u,onToggleCollapse:D,onClose:S}),c&&v&&n.jsx(ln,{value:Gd(t),size:E.ElementSize.Small,"aria-label":u.queueProgressAriaLabel,"aria-valuetext":u.queueProgressValueText(t.length-m,t.length)}),!c&&n.jsx("div",{id:g,className:I.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(N=>n.jsx(Kd,{item:N,labels:u,onCancel:s},N.id))}),n.jsx(Jn,{open:f,header:u.closeConfirmHeader,description:Ud(v,C,u),confirmLabel:u.closeConfirmLabel,cancelLabel:u.closeCancelLabel,variant:b.ConfirmationPopupVariant.Danger,onConfirm:T,onClose:()=>p(!1)})]})};exports.ConfirmationPopupVariant=b.ConfirmationPopupVariant;exports.DialBreadcrumb=b.DialBreadcrumb;exports.DialBreadcrumbItem=b.DialBreadcrumbItem;exports.DialButton=b.DialButton;exports.DialButtonDropdown=b.DialButtonDropdown;exports.DialCaptionText=b.DialCaptionText;exports.DialCollapsibleSidebar=b.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=b.DialConditionalResizableContainer;exports.DialConfirmationPopup=b.DialConfirmationPopup;exports.DialDangerButton=b.DialDangerButton;exports.DialDestinationFolderPopup=b.DialDestinationFolderPopup;exports.DialErrorText=b.DialErrorText;exports.DialFileIcon=b.DialFileIcon;exports.DialFileManager=b.DialFileManager;exports.DialFileManagerActions=b.DialFileManagerActions;exports.DialFileManagerTabs=b.DialFileManagerTabs;exports.DialFileName=b.DialFileName;exports.DialFileNodeType=b.DialFileNodeType;exports.DialFilePermission=b.DialFilePermission;exports.DialFileResourceType=b.DialFileResourceType;exports.DialFolderName=b.DialFolderName;exports.DialFoldersTree=b.DialFoldersTree;exports.DialFormItem=b.DialFormItem;exports.DialGhostButton=b.DialGhostButton;exports.DialInput=b.DialInput;exports.DialItemType=b.DialItemType;exports.DialLinkButton=b.DialLinkButton;exports.DialLoader=b.DialLoader;exports.DialNeutralButton=b.DialNeutralButton;exports.DialNotification=b.DialNotification;exports.DialPopup=b.DialPopup;exports.DialPrimaryButton=b.DialPrimaryButton;exports.DialRadioGroup=b.DialRadioGroup;exports.DialResizableContainer=b.DialResizableContainer;exports.DialSearch=b.DialSearch;exports.DialSharedEntityIndicator=b.DialSharedEntityIndicator;exports.DialTabs=b.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=b.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=b.FileManagerColumnKey;exports.FileManagerProvider=b.FileManagerProvider;exports.FlexibleActionsDirection=b.FlexibleActionsDirection;exports.FormItemOrientation=b.FormItemOrientation;exports.NAME_COLUMN=b.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=b.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=b.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=b.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=b.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=b.NotificationType;exports.NotificationVariant=b.NotificationVariant;exports.PopupSize=b.PopupSize;exports.RadioGroupOrientation=b.RadioGroupOrientation;exports.ResizableContainerSide=b.ResizableContainerSide;exports.SIZE_COLUMN=b.SIZE_COLUMN;exports.ScreenResolution=b.ScreenResolution;exports.Skeleton=b.Skeleton;exports.SkeletonAvatarShape=b.SkeletonAvatarShape;exports.SkeletonAvatarSize=b.SkeletonAvatarSize;exports.SkeletonVariant=b.SkeletonVariant;exports.Spinner=b.Spinner;exports.TabOrientation=b.TabOrientation;exports.TabView=b.TabView;exports.UPDATED_AT_COLUMN=b.UPDATED_AT_COLUMN;exports.editableContainerProps=b.editableContainerProps;exports.useDialFileManagerTabs=b.useDialFileManagerTabs;exports.useEditableItem=b.useEditableItem;exports.useFileManagerContext=b.useFileManagerContext;exports.DialLabel=ke.DialLabel;exports.DialSwitch=ke.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=j.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=j.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=j.DIAL_KIT_CLASS;exports.DialCloseButton=j.DialCloseButton;exports.DialDangerIconButton=j.DialDangerIconButton;exports.DialDateCellRenderer=j.DialDateCellRenderer;exports.DialDropdown=j.DialDropdown;exports.DialEllipsisTooltip=j.DialEllipsisTooltip;exports.DialGhostIconButton=j.DialGhostIconButton;exports.DialGrid=j.DialGrid;exports.DialIcon=j.DialIcon;exports.DialNeutralIconButton=j.DialNeutralIconButton;exports.DialNoDataContent=j.DialNoDataContent;exports.DialPrimaryIconButton=j.DialPrimaryIconButton;exports.DialRadioButton=j.DialRadioButton;exports.DialSecondaryIconButton=j.DialSecondaryIconButton;exports.DialSuccessIconButton=j.DialSuccessIconButton;exports.DialTertiaryIconButton=j.DialTertiaryIconButton;exports.DropdownItemType=j.DropdownItemType;exports.DropdownTrigger=j.DropdownTrigger;exports.DropdownType=j.DropdownType;exports.GridSelectionMode=j.GridSelectionMode;exports.ThemeScope=j.ThemeScope;exports.baseColumnComparator=j.baseColumnComparator;exports.checkColDefsChanges=j.checkColDefsChanges;exports.convertGridDateToDate=j.convertToDate;exports.convertToDate=j.convertToDate;exports.useThemeScope=j.useThemeScope;exports.BASE_ICON_PROPS=z.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=z.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=z.DIAL_ICON_SIZE;exports.mergeClasses=I.mergeClasses;exports.Checkbox=R.Checkbox;exports.CheckboxBox=R.CheckboxBox;exports.CloseButton=R.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=R.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=R.DEFAULT_LOCALE;exports.DangerIconButton=R.DangerIconButton;exports.DateCellRenderer=R.DateCellRenderer;exports.Dropdown=R.Dropdown;exports.EllipsisTooltip=R.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=R.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=R.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=R.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=R.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=R.GRID_THEME_PARAMS;exports.GhostIconButton=R.GhostIconButton;exports.Grid=R.Grid;exports.IconButton=R.IconButton;exports.InfoButton=R.InfoButton;exports.InteractiveTooltip=R.InteractiveTooltip;exports.Label=R.Label;exports.MenuItem=R.MenuItem;exports.MenuItemMark=R.MenuItemMark;exports.NeutralIconButton=R.NeutralIconButton;exports.NoDataContent=R.NoDataContent;exports.PrimaryIconButton=R.PrimaryIconButton;exports.Radio=R.Radio;exports.StaticIconButton=R.StaticIconButton;exports.Tooltip=R.Tooltip;exports.TooltipContainer=R.TooltipContainer;exports.TooltipContent=R.TooltipContent;exports.TooltipPlacement=R.TooltipPlacement;exports.TooltipTrigger=R.TooltipTrigger;exports.ButtonAppearance=E.ButtonAppearance;exports.ButtonVariant=E.ButtonVariant;exports.DialIconButton=E.DialIconButton;exports.DialTooltip=E.DialTooltip;exports.DialTooltipContainer=E.DialTooltipContainer;exports.DialTooltipContent=E.DialTooltipContent;exports.DialTooltipTrigger=E.DialTooltipTrigger;exports.ElementSize=E.ElementSize;exports.EditorThemes=ut.EditorThemes;exports.LazyDialJsonEditor=ut.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=ut.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=ut.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ne.DIAL_KIT_ICON_STROKE;exports.Accordion=Fc;exports.AccordionCaretPosition=St;exports.AnalyticsCardVariant=ot;exports.Breadcrumbs=$l;exports.BreadcrumbsSize=Ze;exports.Button=nt;exports.ButtonDropdown=Wl;exports.Calendar=Tl;exports.CalendarMode=be;exports.CaptionText=Pe;exports.CardShell=Jo;exports.CollapsibleSidebar=Bd;exports.ConditionalResizableContainer=Hd;exports.ConfirmationPopup=Jn;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=ir;exports.DEFAULT_TRANSFER_QUEUE_LABELS=as;exports.DangerButton=Hl;exports.DialAccordion=sn;exports.DialAnalyticsBar=mt;exports.DialAnalyticsBarGroup=xs;exports.DialAnalyticsCard=gs;exports.DialAnalyticsErrorTag=ar;exports.DialAnalyticsHistogram=Ds;exports.DialAutocompleteInputValue=yn;exports.DialCheckbox=Yt;exports.DialDraggableItem=Ri;exports.DialDropdownIcon=jo;exports.DialFormPopup=Wi;exports.DialInputPopup=Dn;exports.DialLabelledText=Ls;exports.DialLoadFileArea=An;exports.DialLoadFileAreaField=No;exports.DialNumberInput=tr;exports.DialPagination=Ts;exports.DialPasswordInput=In;exports.DialRadioGroupPopupField=Ki;exports.DialRemoveButton=Ot;exports.DialSchemaRenderer=Uo;exports.DialSegmentedControl=Hi;exports.DialSelect=Te;exports.DialSelectField=io;exports.DialSlider=_s;exports.DialSteps=As;exports.DialTag=Ke;exports.DialTagInput=vn;exports.DialTextarea=Mi;exports.ErrorMessageNotification=il;exports.ErrorText=Fe;exports.ErrorToastNotification=el;exports.FabButton=Ul;exports.FileDropzone=hd;exports.FileIcon=yr;exports.FileName=rs;exports.FilterChips=gd;exports.FolderName=jd;exports.FolderPath=wl;exports.GeneralMessageNotification=ul;exports.GeneralToastNotification=al;exports.GhostButton=Kl;exports.Highlight=Qo;exports.InfoMessageNotification=ol;exports.InfoToastNotification=tl;exports.InlineSelect=ql;exports.InlineSelectTrigger=Zn;exports.Input=We;exports.JsonSchemaType=V;exports.LinkButton=Vl;exports.LoadingMessageNotification=dl;exports.LoadingToastNotification=sl;exports.MultiSelectTags=Xn;exports.NeutralButton=Cr;exports.Notification=mr;exports.NumberInput=Sc;exports.OutlinedButton=Gl;exports.PasswordInput=vc;exports.Popup=vr;exports.PrimaryButton=Un;exports.ProgressBar=ln;exports.RadioGroup=es;exports.RadioGroupPopupField=Qc;exports.ResizableContainer=ns;exports.SchemaDisplayMode=lt;exports.SchemaOrientation=_t;exports.SchemaRendererVariant=Je;exports.Search=kd;exports.SegmentedControl=cd;exports.Select=xc;exports.SelectSize=vt;exports.SelectVariant=yt;exports.SharedEntityIndicator=ts;exports.Slider=Pd;exports.StepStatus=Ce;exports.SuccessMessageNotification=ll;exports.SuccessToastNotification=rl;exports.Switch=Bc;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=ss;exports.Tabs=ud;exports.Tag=Ge;exports.TagAppearance=qe;exports.TagInput=_d;exports.Textarea=Cc;exports.TextareaResize=Qn;exports.ToggleIconButton=Jc;exports.TransferQueue=Zd;exports.TransferQueueItemStatus=je;exports.WarningMessageNotification=cl;exports.WarningToastNotification=nl;exports.getTimezoneLabel=_n;exports.matchesAccept=sr;exports.wrapInRootFolder=_o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./use-file-manager-tabs-4s-dbnmu.cjs"),ke=require("./Switch-CfxMs3AZ.cjs"),n=require("react/jsx-runtime"),h=require("react"),F=require("@tabler/icons-react"),oe=require("classnames"),j=require("./DateCellRenderer-ZLb4GAUV.cjs"),z=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-BEJXjzkx.cjs"),R=require("./DateCellRenderer-CkFOYZGc.cjs"),E=require("./IconButton-CVttu-k-.cjs"),us=require("react-dom"),ut=require("./lazy-Cy9WobJf.cjs"),de=require("@floating-ui/react"),ne=require("./icon-DhjrDQ8I.cjs");function fs(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 Dr=fs(h),Ke=({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(j.DialIcon,{icon:r}),n.jsx(j.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(b.DialButton,{className:"p-0",iconAfter:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},ar=({label:e="Error",className:t})=>n.jsx(Ke,{label:e,className:I.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var ot=(e=>(e.Default="default",e.Compact="compact",e))(ot||{});const ps={[ot.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[ot.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},gs=({title:e,value:t,description:r,variant:s=ot.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:d,compareValues:f})=>{const p=ps[s],g=c!==void 0?c:(l??0)>=0,u=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",p.container,o),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:p.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:u})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(ar,{className:"self-start"}):i?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-start"}):f?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(j.DialEllipsisTooltip,{text:f[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[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(j.DialEllipsisTooltip,{text:f[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[1].value})]})]}):n.jsx("span",{className:p.value,children:t}),!a&&!i&&p.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},ir=[{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"}],hs=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),ms=(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},mt=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=ir,className:l,titleClassName:c,valueClassName:d,inline:f,ariaLabel:p})=>{const g=e==null,u=!!(r||s||!g),m=hs(g?0:e,t),v=ms(m,o),x=i??(g?"—":e),C=p??(typeof a=="string"?a:void 0),y=r||s,S=r?n.jsx(ar,{}):s?n.jsx(b.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",f?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",d),children:x}),T=u?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":C,className:I.mergeClasses("w-full overflow-hidden rounded-sm",f?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!y&&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 f?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:T}),S]})]}):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,S]}),T]})},sn=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:d,contentClassName:f})=>{const p=s!==void 0,[g,u]=h.useState(a),m=o?!0:p?s:g,v=h.useId(),x=()=>{if(i)return;const C=!m;p||u(C),l?.(C)};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:x,className:I.mergeClasses("flex w-full items-center gap-2 p-4 text-left",i?"cursor-not-allowed":"cursor-pointer",o&&"cursor-default",d),children:[!o&&n.jsx(j.DialIcon,{className:oe("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(F.IconChevronRight,{size:z.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",f),children:r})]})},xs=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:f,onBarClick:p,inline:g,barTitleClassName:u,barValueClassName:m,barClassName:v,barDescriptions:x,className:C})=>{const y=Object.entries(s),S=g?I.mergeClasses("text-secondary",u):u,T=i?"dial-tiny-text text-secondary":void 0,D=t?n.jsx(E.DialTooltip,{tooltip:t,children:e}):e,N=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],L="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",O="group flex flex-col gap-1.5",A=I.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return n.jsx(sn,{title:D,description:r,defaultExpanded:c,nonCollapsible:d,className:C,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:f?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-center"}):a?N.map(k=>{const w=k in s?s[k]:null,M=k in a?a[k]:null,U=typeof w=="number"&&typeof M=="number"?parseFloat((M-w).toFixed(3)):null,J=U!=null&&U!==0,G=J&&U>0,B=J?G?`+${U}`:String(U):null,H=x?.[k],q=n.jsx("span",{className:"dial-small-text text-secondary",children:k}),K=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[H?n.jsx(E.DialTooltip,{tooltip:H,children:q}):q,B!=null&&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:B})]}),n.jsxs("div",{className:A,children:[n.jsx(mt,{title:i?.[0],value:w,maxValue:o,colorMap:l,inline:g,titleClassName:T,ariaLabel:k}),n.jsx(mt,{title:i?.[1],value:M,maxValue:o,colorMap:l,inline:g,titleClassName:T,ariaLabel:`${k} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(k,w),className:I.mergeClasses(O,L),children:K},k):n.jsx("div",{className:O,children:K},k)}):y.map(([k,w])=>{const M=n.jsx(mt,{title:k,value:w,maxValue:o,colorMap:l,inline:g,titleClassName:S,valueClassName:m,className:v}),$=p?n.jsx("button",{type:"button",onClick:()=>p(k,w),className:L,children:M}):M,U=x?.[k];return U?n.jsx(E.DialTooltip,{tooltip:U,triggerClassName:"flex flex-col",children:$},k):n.jsx(h.Fragment,{children:$},k)})})})},bs="#FF4E50",Cs=(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},Ir=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=Cs(c,t);d>=0&&(r[d]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:bs,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:r[d],ratio:i(r[d]),isZeroBucket:!1}));return[o,...l]},an=e=>e<=0?2:e%2===0?e:e+1,vs=e=>{const t=an(e);return[t,t/2,0]},Mt=e=>`${Math.round(e*100)/100}`,on=(e,t)=>e===t?Mt(e):`${Mt(e)}-${Mt(t)}`,Pt=128,ys=(e,t)=>{const r=on(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Sr=(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:ys(a.from,a.to)})]}),Ds=({title:e,values:t,colorMap:r=ir,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const f=Ir(t,r),p=l?Ir(l,r):void 0,g=t.length,u=l?.length??0,m=Math.max(g,u),v=an(m),x=vs(m),C=D=>D.map(N=>({...N,ratio:v>0?N.count/v:0})),y=C(f),S=p?C(p):void 0,T=(D,N,L,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 A=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(E.DialTooltip,{placement:"bottom",tooltip:N,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":L,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${D.ratio*100}%`,...A},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:Pt},children:n.jsx(b.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:Pt},children:x.map((D,N)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${N/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:D},D))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((D,N)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${N/(x.length-1)*100}%`}},D)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:Pt},children:S?y.map((D,N)=>{const L=S[N],O=`${D.count} out of ${g} ${s}`,A=`${L.count} out of ${u} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[T(D,Sr(c,D.count,g,s,D),O,!0),T(L,Sr(d,L.count,u,s,L),A,!1)]},N)}):y.map((D,N)=>{const L=`${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}%`}})},N):n.jsx(E.DialTooltip,{placement:"bottom",tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":L,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})})},N)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:y.map((D,N)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:on(D.from,D.to)},N))})]})]})},ln=({value:e,max:t=100,size:r=E.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const d=h.useId(),f=i??d,p=!!s?.label,g=p?s?.id??`${f}-label`:void 0,u=t>0?t:0,m=Number.isFinite(e)?e:0,v=Math.min(Math.max(m,0),u),x=u>0?v/u*100:0,C=n.jsx("div",{...c,id:f,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":u,"aria-labelledby":g,"aria-label":E.resolveAccessibleName(l,p?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===E.ElementSize.Small?"h-1":"h-2",o,!p&&!a&&j.DIAL_KIT_CLASS.progressBar),children:n.jsx("div",{style:{width:`${x}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?C:n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-1",j.DIAL_KIT_CLASS.progressBar),children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(R.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),C]})},Is=7,Ss=2,Ns=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var xt=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(xt||{});const js=(e,t,r)=>e===t?"active":r<Is||Math.abs(e-t)<=Ss?"adjacent":"far",Ts=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=Ns(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(E.DialIconButton,{icon:n.jsx(F.IconCaretLeftFilled,{size:z.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:E.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=js(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===xt.Active&&"h-[8px] w-[32px]",o===xt.Adjacent&&"size-[8px]",o===xt.Far&&"size-[4px]")},i)})}),n.jsx(E.DialIconButton,{icon:n.jsx(F.IconCaretRightFilled,{size:z.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:E.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Yt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const d=h.useCallback(u=>{o?.(u.target.checked,t)},[o,t]),f=oe("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),p=oe("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx(F.IconMinus,{className:p,...z.BASE_ICON_PROPS}):r?n.jsx(F.IconCheck,{className:p,...z.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:f,htmlFor:t,"aria-description":c["aria-description"]||j.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(j.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:d,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 Ce=(e=>(e.VALID="valid",e.ERROR="error",e))(Ce||{});const ws=(e,t)=>{if(t===e.id)switch(e.status){case Ce.VALID:return"border-accent-secondary text-primary";case Ce.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case Ce.VALID:return"border-primary text-primary";case Ce.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},Es=(e,t)=>{if(t===e.id)switch(e.status){case Ce.VALID:return"bg-accent-secondary";case Ce.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case Ce.VALID:return"bg-accent-secondary";case Ce.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Os=({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===Ce.ERROR?n.jsx(F.IconExclamationCircle,{stroke:2,size:z.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===Ce.VALID?n.jsx(F.IconCheck,{stroke:2,size:z.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:oe(a,ws(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:oe(i,Es(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},As=({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===Ce.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(Os,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},Ft=e=>(e.toString().split(".")[1]??"").length,_s=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:d,trackClassName:f,fillClassName:p,thumbClassName:g,labelsClassName:u,"aria-label":m,"aria-labelledby":v,...x})=>{const C=h.useRef(null),y=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),S=Ft(s),T=l?l(e):e.toFixed(S),D=h.useCallback(A=>{const k=C.current;if(!k)return e;const w=k.getBoundingClientRect(),M=(A-w.left)/w.width,$=t+M*(r-t),U=Ft(s),J=parseFloat((Math.round(($-t)/s)*s+t).toFixed(U));return Math.min(r,Math.max(t,J))},[t,r,s,e]),N=h.useCallback(A=>{a||(A.currentTarget.setPointerCapture(A.pointerId),c?.(D(A.clientX)))},[a,D,c]),L=h.useCallback(A=>{a||A.buttons===0||c?.(D(A.clientX))},[a,D,c]),O=h.useCallback(A=>{if(a)return;const k=Ft(s),w=U=>parseFloat((Math.round((U-t)/s)*s+t).toFixed(k)),M=U=>Math.min(r,Math.max(t,U));let $=e;switch(A.key){case"ArrowRight":case"ArrowUp":$=M(w(e+s));break;case"ArrowLeft":case"ArrowDown":$=M(w(e-s));break;case"Home":$=t;break;case"End":$=r;break;default:return}A.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",d),...x,children:[i&&n.jsx(ke.DialLabel,{...i,htmlFor:x.id}),n.jsxs("div",{ref:C,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:N,onPointerMove:L,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",f)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${y}%`}}),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:`${y}%`},onKeyDown:O,children:T})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",u),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]})]})})]})},Ls=({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(E.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),cn=h.createContext({dragDropManager:void 0});function ye(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 Nr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),jr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Tr={INIT:"@@redux/INIT"+jr(),REPLACE:"@@redux/REPLACE"+jr()};function ks(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 Rs(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(Fs(e))return"date";if(Ps(e))return"error";var r=Ms(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 Ms(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ps(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Fs(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Xe(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Rs(e)),t}function dn(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"?ye(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"?ye(1):"Expected the enhancer to be a function. Instead, received: '"+Xe(r)+"'");return r(dn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ye(2):"Expected the root reducer to be a function. Instead, received: '"+Xe(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function d(){l===o&&(l=o.slice())}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?ye(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 p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(4):"Expected the listener to be a function. Instead, received: '"+Xe(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?ye(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 x=!0;return d(),l.push(v),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?ye(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.");x=!1,d();var y=l.indexOf(v);l.splice(y,1),o=null}}}function g(v){if(!ks(v))throw new Error(process.env.NODE_ENV==="production"?ye(7):"Actions must be plain objects. Instead, the actual type was: '"+Xe(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"?ye(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"?ye(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,v)}finally{c=!1}for(var x=o=l,C=0;C<x.length;C++){var y=x[C];y()}return v}function u(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(10):"Expected the nextReducer to be a function. Instead, received: '"+Xe(v));a=v,g({type:Tr.REPLACE})}function m(){var v,x=p;return v={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?ye(11):"Expected the observer to be an object. Instead, received: '"+Xe(y)+"'");function S(){y.next&&y.next(f())}S();var T=x(S);return{unsubscribe:T}}},v[Nr]=function(){return this},v}return g({type:Tr.INIT}),s={dispatch:g,subscribe:p,getState:f,replaceReducer:u},s[Nr]=m,s}function Y(e,t,...r){if(Bs()&&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 Bs(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function zs(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function $s(e,t){return e.filter(r=>r!==t)}function un(e){return typeof e=="object"}function Hs(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 Vs(e,t){return e.filter(r=>t.indexOf(r)>-1)}const or="dnd-core/INIT_COORDS",Nt="dnd-core/BEGIN_DRAG",lr="dnd-core/PUBLISH_DRAG_SOURCE",jt="dnd-core/HOVER",Tt="dnd-core/DROP",wt="dnd-core/END_DRAG";function wr(e,t){return{type:or,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Ks={type:or,payload:{clientOffset:null,sourceClientOffset:null}};function Gs(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(wr(i)),Us(r,l,c);const d=qs(r,l);if(d==null){e.dispatch(Ks);return}let f=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");Zs(o),f=o(d)}e.dispatch(wr(i,f));const g=c.getSource(d).beginDrag(l,d);if(g==null)return;Ws(g),c.pinSource(d);const u=c.getSourceType(d);return{type:Nt,payload:{itemType:u,item:g,sourceId:d,clientOffset:i||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}function Us(e,t,r){Y(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){Y(r.getSource(s),"Expected sourceIds to be registered.")})}function Zs(e){Y(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ws(e){Y(un(e),"Item must be an object.")}function qs(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 Ys(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xs(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){Ys(e,a,r[a])})}return e}function Qs(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();Js(s),ra(s).forEach((o,l)=>{const c=ea(o,l,a,s),d={type:Tt,payload:{dropResult:Xs({},r,c)}};e.dispatch(d)})}}function Js(e){Y(e.isDragging(),"Cannot call drop while not dragging."),Y(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ea(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return ta(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function ta(e){Y(typeof e>"u"||un(e),"Drop result must either be an object or undefined.")}function ra(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function na(e){return function(){const r=e.getMonitor(),s=e.getRegistry();sa(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:wt}}}function sa(e){Y(e.isDragging(),"Cannot call endDrag while not dragging.")}function Xt(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function aa(e){return function(r,{clientOffset:s}={}){ia(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return la(a,o,l),oa(a,i,o),ca(a,i,o),{type:jt,payload:{targetIds:a,clientOffset:s||null}}}}function ia(e){Y(Array.isArray(e),"Expected targetIds to be an array.")}function oa(e,t,r){Y(t.isDragging(),"Cannot call hover while not dragging."),Y(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];Y(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);Y(i,"Expected targetIds to be registered.")}}function la(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Xt(i,r)||e.splice(s,1)}}function ca(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function da(e){return function(){if(e.getMonitor().isDragging())return{type:lr}}}function ua(e){return{beginDrag:Gs(e),publishDragSource:da(e),hover:aa(e),drop:Qs(e),endDrag:na(e)}}class fa{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=ua(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 pa(e,t){return{x:e.x+t.x,y:e.y+t.y}}function fn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ga(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:fn(pa(t,s),r)}function ha(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:fn(t,r)}const at=[],cr=[];at.__IS_NONE__=!0;cr.__IS_ALL__=!0;function ma(e,t){return e===at?!1:e===cr||typeof t>"u"?!0:Vs(t,e).length>0}class xa{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;Y(typeof t=="function","listener must be a function."),Y(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&&!ma(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){Y(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 Y(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(Y(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 Xt(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Y(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&&!Xt(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 ga(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return ha(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Er=typeof global<"u"?global:self,pn=Er.MutationObserver||Er.WebKitMutationObserver;function gn(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function ba(e){let t=1;const r=new pn(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const Ca=typeof pn=="function"?ba:gn;class va{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=Ca(this.flush),this.requestErrorThrow=gn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class ya{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 Da{create(t){const r=this.freeTasks,s=r.length?r.pop():new ya(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const hn=new va,Ia=new Da(hn.registerPendingError);function Sa(e){hn.enqueueTask(Ia.create(e))}const dr="dnd-core/ADD_SOURCE",ur="dnd-core/ADD_TARGET",fr="dnd-core/REMOVE_SOURCE",Et="dnd-core/REMOVE_TARGET";function Na(e){return{type:dr,payload:{sourceId:e}}}function ja(e){return{type:ur,payload:{targetId:e}}}function Ta(e){return{type:fr,payload:{sourceId:e}}}function wa(e){return{type:Et,payload:{targetId:e}}}function Ea(e){Y(typeof e.canDrag=="function","Expected canDrag to be a function."),Y(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Y(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Oa(e){Y(typeof e.canDrop=="function","Expected canDrop to be a function."),Y(typeof e.hover=="function","Expected hover to be a function."),Y(typeof e.drop=="function","Expected beginDrag to be a function.")}function Qt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Qt(r,!1));return}Y(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 Aa=0;function _a(){return Aa++}function La(e){const t=_a().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Or(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ar(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 ka{addSource(t,r){Qt(t),Ea(r);const s=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(Na(s)),s}addTarget(t,r){Qt(t,!0),Oa(r);const s=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(ja(s)),s}containsHandler(t){return Ar(this.dragSources,t)||Ar(this.dropTargets,t)}getSource(t,r=!1){return Y(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Y(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Y(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Y(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Or(t)===Ie.SOURCE}isTargetId(t){return Or(t)===Ie.TARGET}removeSource(t){Y(this.getSource(t),"Expected an existing source."),this.store.dispatch(Ta(t)),Sa(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Y(this.getTarget(t),"Expected an existing target."),this.store.dispatch(wa(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Y(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Y(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=La(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 Ra=(e,t)=>e===t;function Ma(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Pa(e,t,r=Ra){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 Fa(e=at,t){switch(t.type){case jt:break;case dr:case ur:case Et:case fr:return at;case Nt:case lr:case wt:case Tt:default:return cr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=Hs(r,s);if(!(a.length>0||!Pa(r,s)))return at;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function Ba(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function za(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){Ba(e,a,r[a])})}return e}const _r={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function $a(e=_r,t){const{payload:r}=t;switch(t.type){case or:case Nt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case jt:return Ma(e.clientOffset,r.clientOffset)?e:za({},e,{clientOffset:r.clientOffset});case wt:case Tt:return _r;default:return e}}function Ha(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qe(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){Ha(e,a,r[a])})}return e}const Va={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ka(e=Va,t){const{payload:r}=t;switch(t.type){case Nt:return Qe({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case lr:return Qe({},e,{isSourcePublic:!0});case jt:return Qe({},e,{targetIds:r.targetIds});case Et:return e.targetIds.indexOf(r.targetId)===-1?e:Qe({},e,{targetIds:$s(e.targetIds,r.targetId)});case Tt:return Qe({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case wt:return Qe({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Ga(e=0,t){switch(t.type){case dr:case ur:return e+1;case fr:case Et:return e-1;default:return e}}function Ua(e=0){return e+1}function Za(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wa(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){Za(e,a,r[a])})}return e}function qa(e={},t){return{dirtyHandlerIds:Fa(e.dirtyHandlerIds,{type:t.type,payload:Wa({},t.payload,{prevTargetIds:zs(e,"dragOperation.targetIds",[])})}),dragOffset:$a(e.dragOffset,t),refCount:Ga(e.refCount,t),dragOperation:Ka(e.dragOperation,t),stateId:Ua(e.stateId)}}function Ya(e,t=void 0,r={},s=!1){const a=Xa(s),i=new xa(a,new ka(a)),o=new fa(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function Xa(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return dn(qa,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Qa(e,t){if(e==null)return{};var r=Ja(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 Ja(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 Lr=0;const bt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ei=h.memo(function(t){var{children:r}=t,s=Qa(t,["children"]);const[a,i]=ti(s);return h.useEffect(()=>{if(i){const o=mn();return++Lr,()=>{--Lr===0&&(o[bt]=null)}}},[]),n.jsx(cn.Provider,{value:a,children:r})});function ti(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=ri(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function ri(e,t=mn(),r,s){const a=t;return a[bt]||(a[bt]={dragDropManager:Ya(e,t,r,s)}),a[bt]}function mn(){return typeof global<"u"?global:window}var Bt,kr;function ni(){return kr||(kr=1,Bt=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}),Bt}var si=ni();const ai=b.getDefaultExportFromCjs(si),Ue=typeof window<"u"?h.useLayoutEffect:h.useEffect;function ii(e,t,r){const[s,a]=h.useState(()=>t(e)),i=h.useCallback(()=>{const o=t(e);ai(s,o)||(a(o),r&&r())},[s,e,r]);return Ue(i),[s,i]}function oi(e,t,r){const[s,a]=ii(e,t,r);return Ue(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function xn(e,t,r){return oi(t,e||(()=>({})),()=>r.reconnect())}function bn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function li(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function ci(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let zt=!1,$t=!1;class di{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Y(!zt,"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 zt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{zt=!1}}isDragging(){if(!this.sourceId)return!1;Y(!$t,"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 $t=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{$t=!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 Ht=!1;class ui{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Y(!Ht,"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 Ht=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ht=!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 fi(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function pi(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Jt(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 d=i[c];if(!l(d))return!1;const f=e[d],p=t[d];if(a=void 0,a===!1||a===void 0&&f!==p)return!1}return!0}function er(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gi(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 hi(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return gi(s),mi(s,r?i=>e(i,r):e)}}function Cn(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=hi(s);t[r]=()=>a}}),t}function Rr(e,t){typeof e=="function"?e(t):e.current=t}function mi(e,t){const r=e.ref;return Y(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=>{Rr(r,s),Rr(t,s)}}):h.cloneElement(e,{ref:t})}class xi{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!Jt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Jt(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=Cn({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,er(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,er(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 bi{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!Jt(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=Cn({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,er(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 et(){const{dragDropManager:e}=h.useContext(cn);return Y(e!=null,"Expected drag drop context"),e}function Ci(e,t){const r=et(),s=h.useMemo(()=>new xi(r.getBackend()),[r]);return Ue(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ue(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function vi(){const e=et();return h.useMemo(()=>new di(e),[e])}class yi{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 Di(e,t,r){const s=h.useMemo(()=>new yi(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function Ii(e){return h.useMemo(()=>{const t=e.type;return Y(t!=null,"spec.type must be defined"),t},[e])}function Si(e,t,r){const s=et(),a=Di(e,t,r),i=Ii(e);Ue(function(){if(i!=null){const[l,c]=pi(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function Ni(e,t){const r=bn(e,t);Y(!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=vi(),a=Ci(r.options,r.previewOptions);return Si(r,s,a),[xn(r.collect,s,a),li(a),ci(a)]}function ji(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function Ti(e){const t=et(),r=h.useMemo(()=>new bi(t.getBackend()),[t]);return Ue(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function wi(){const e=et();return h.useMemo(()=>new ui(e),[e])}function Ei(e){const{accept:t}=e;return h.useMemo(()=>(Y(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Oi{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 Ai(e,t){const r=h.useMemo(()=>new Oi(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function _i(e,t,r){const s=et(),a=Ai(e,t),i=Ei(e);Ue(function(){const[l,c]=fi(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function pr(e,t){const r=bn(e,t),s=wi(),a=Ti(r.options);return _i(r,s,a),[xn(r.collect,s,a),ji(a)]}const Mr="column",Li="flex items-center",ki="mr-3 cursor-move text-secondary",Ri=({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:d},f,p]=Ni(()=>({type:Mr,item:{id:e,originalIndex:c},collect:u=>{const m=u.getItem();return{isDragging:u.isDragging()&&m?.id===e}},end:(u,m)=>{if(!u)return;!m.didDrop()&&typeof a=="function"&&u.originalIndex>-1&&a(u.id,u.originalIndex)}}),[e,c,a]),[,g]=pr(()=>({accept:Mr,hover:u=>{if(!(!u||u.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(u.id,m)}}}),[s,a,e]);return p(g(l)),f(o),n.jsxs("div",{ref:l,className:I.mergeClasses(Li,r),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:ki,"aria-label":i,children:n.jsx(F.IconGripVertical,{...z.BASE_ICON_PROPS})}),t]})},Ot=({iconClassName:e,label:t,...r})=>t?n.jsx(b.DialDangerButton,{...r,label:t,appearance:E.ButtonAppearance.Ghost,iconBefore:n.jsx(F.IconTrashX,{...z.BASE_ICON_PROPS,className:e||""})}):n.jsx(j.DialDangerIconButton,{...r,appearance:E.ButtonAppearance.Ghost,icon:n.jsx(F.IconTrashX,{...z.BASE_ICON_PROPS,className:e||""})}),Mi=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const f=I.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.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(ke.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(b.DialErrorText,{text:s}),!s&&n.jsx(b.DialCaptionText,{text:l})]})},Pi="inline-flex items-center rounded bg-layer-3",Fi="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",Bi="relative z-10 bg-controls-accent-primary-alpha-active text-primary",zi="text-secondary hover:text-primary",$i="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Hi=({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 d=c.findIndex(g=>g.value===t);let f=null;switch(l.key){case"ArrowRight":case"ArrowDown":f=(d+1)%c.length;break;case"ArrowLeft":case"ArrowUp":f=(d-1+c.length)%c.length;break;case"Home":f=0;break;case"End":f=c.length-1;break;default:return}l.preventDefault();const p=c[f];p&&p.value!==t&&r(p.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(Pi,a),children:e.map((l,c)=>{const d=l.value===t,f=c===0,p=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Fi,!p&&"-mr-px",f&&"rounded-l",p&&"rounded-r",d?Bi:zi,g&&$i),children:[l.icon,l.label]},l.value)})})},Vt=8,Vi=24,vn=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:f=!1,containerClassName:p,tagClassName:g,onChange:u})=>{const m=h.useRef(null),v=h.useRef([]),x=h.useRef(null),[C,y]=h.useState(e),[S,T]=h.useState(""),[D,N]=h.useState(!1),[L,O]=h.useState(e.length),A=h.useCallback(B=>H=>{v.current[B]=H},[]),k=h.useCallback(()=>{if(!d)return;const B=m.current;if(!B)return;const H=B.offsetWidth;if(H===0)return;const q=x.current?.offsetWidth??0,se=H-(f?0:Vi)-Vt;let X=0,Z=0;for(let ae=0;ae<C.length;ae++){const te=v.current[ae];if(!te)continue;const le=te.offsetWidth+Vt;if(X+le>se)break;X+=le,Z++}if(Z<C.length&&Z>0)for(;X+q>se&&Z>0;){Z--;const ae=v.current[Z]?.offsetWidth??0;X-=ae+Vt}O(Z)},[d,f,C.length]),w=B=>{const H=B.trim().replace(/,$/,"");if(H&&!C.includes(H)){const q=[H,...C];y(q),u?.(q)}},M=B=>{(B.key===","||B.key==="Enter")&&(B.preventDefault(),w(S),T(""))},$=()=>{S.trim()&&(w(S),T(""))},U=B=>{const H=C.filter((q,K)=>K!==B);y(H),u?.(H)},J=()=>o?n.jsx(b.DialErrorText,{text:o}):i?n.jsx(b.DialCaptionText,{text:i}):null;h.useEffect(()=>{if(d)return;const B=new ResizeObserver(()=>{if(m.current){const H=m.current.scrollHeight>m.current.clientHeight+10;N(H)}});return m.current&&B.observe(m.current),()=>B.disconnect()},[C,d]),h.useEffect(()=>{if(!d){O(C.length);return}O(C.length);const B=new ResizeObserver(()=>{k()}),H=m.current;return H&&B.observe(H),k(),()=>B.disconnect()},[d,k,C]),h.useEffect(()=>{y(e)},[JSON.stringify(e)]);const G=n.jsxs("div",{ref:m,className:oe("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":oe("flex-wrap",D?"flex-col-reverse":"flex-row"),p),children:[(d?C.slice(0,L):C).map((B,H)=>n.jsx(Ke,{label:B,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>U(H):void 0},B+H)),d&&L<C.length&&n.jsx(E.DialTooltip,{tooltip:C.slice(L).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(Ke,{label:`+${C.length-L}`})}),!f&&n.jsx("input",{id:s,type:"text",value:S,onChange:B=>T(B.target.value),onKeyDown:M,onBlur:$,className:oe("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",d?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),d&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[C.map((B,H)=>n.jsx("div",{ref:A(H),className:"inline-flex shrink-0",children:n.jsx(Ke,{label:B,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>U(H):void 0})},`measure-${B}-${H}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(Ke,{label:`+${C.length}`})})]})]});return f?G:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(ke.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:oe("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:G}),J()]})},yn=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(vn,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Kt=e=>Dr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Dr.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"})),Dn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:d,emptyValueText:f,placeholder:p,editable:g=!1,onValueChange:u,collapseTagOverflow:m=!1,iconBefore:v})=>{const x=Array.isArray(s)&&s.length>0,C=typeof s=="string"&&!!s.trim(),y=x||C?s:p?void 0:f,S=r?void 0:o,T=h.useCallback(O=>{u?.(O.target.value)},[u]),D=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:oe("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||d)&&"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(j.DialIcon,{icon:v}),n.jsx("input",{type:"text",className:oe("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:p||f,onChange:T,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(j.DialIcon,{icon:n.jsx(Kt,{role:"img",width:z.BASE_ICON_SIZE,height:z.BASE_ICON_SIZE})})})]}),n.jsx(b.DialErrorText,{text:c})]}),N=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:S,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:oe("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||d)&&"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(j.DialIcon,{icon:v}),n.jsx(E.DialTooltip,{tooltip:y==null?void 0:String(y),children:y||!p?n.jsx("span",{className:a,children:y}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(j.DialIcon,{icon:n.jsx(Kt,{role:"img",width:z.BASE_ICON_SIZE,height:z.BASE_ICON_SIZE})})})]})}),n.jsx(b.DialErrorText,{text:c})]}),L=()=>n.jsx("div",{className:"w-full",onClick:S,children:n.jsxs("div",{className:oe("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(j.DialIcon,{icon:v}),n.jsx(yn,{placeholder:p,selectedItems:y,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(j.DialIcon,{icon:n.jsx(Kt,{role:"img",width:z.BASE_ICON_SIZE,height:z.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?L():g?D():N(),t&&us.createPortal(e,document.body)]})},Ki=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:d,onClose:f,header:p,portalId:g,onApply:u,onCancel:m,cancelButtonTitle:v="Cancel",applyButtonTitle:x="Apply",isValid:C,selectedRadioValue:y,onChangeRadioField:S,id:T,size:D=b.PopupSize.Md})=>{const[N,L]=h.useState(!1),O=h.useCallback(()=>{r||L(!0)},[r]),A=h.useCallback(()=>{L(!1),f?.()},[f]),k=h.useCallback(()=>{m?.(),A()},[m,A]),w=h.useCallback(()=>{u(),A()},[u,A]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(ke.DialLabel,{label:e,htmlFor:t}),n.jsx(Dn,{disabled:r,open:N,selectedValue:i??a.find(M=>M.id===s)?.name,valueClassName:o,inputClassName:oe(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:O,children:n.jsx(b.DialPopup,{open:N,onClose:k,header:p,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(b.DialNeutralButton,{label:v,onClick:k}),n.jsx(b.DialPrimaryButton,{label:x,onClick:w,disabled:!C})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(b.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:y,onChange:S,elementId:T,orientation:b.RadioGroupOrientation.Column})})})})]})},Gi="Create",Ui="Cancel",Zi="flex items-center justify-end gap-2 px-6 py-3",Wi=({header:e,open:t=!1,submitLabel:r=Gi,cancelLabel:s=Ui,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:d,onCancel:f,children:p,dividers:g=!0,size:u=b.PopupSize.Md,footer:m})=>{const v=a?null:n.jsxs("div",{className:Zi,children:[n.jsx(b.DialNeutralButton,{label:s,onClick:()=>f?f():c?.()}),n.jsx(b.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>d()})]}),x=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(b.DialLoader,{size:50})}):p??null,[p,a]);return n.jsx(b.DialPopup,{open:t,header:e,className:o,dividers:g,onClose:()=>c?.(),footer:m??v,size:u,children:x()})},qi=/^0+\.(\d+)?$/,Yi=/^0+/,tr=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=f=>!f||f==="-"?f:String(f)?.match(qi)?String(f)?.replace(Yi,"0"):Number(f),c=f=>{if([".","-","+","e","E"].includes(f.key)){f.preventDefault();return}b.handleKeyDown(f,"number",r,s)},d=f=>{const p=f.clipboardData.getData("text"),g=p.replace(/\D/g,"");if(g!==p&&(f.preventDefault(),g)){const u=f.currentTarget,m=u.selectionStart??0,v=u.selectionEnd??0,x=u.value.slice(0,m)+g+u.value.slice(v);t?.(l(x))}};return n.jsx(b.DialInput,{type:"number",min:r,max:s,onChange:f=>t?.(l(f)),onKeyDown:e?c:a,onPaste:e?d:i,...o})},Xi=({onClick:e})=>n.jsx(F.IconEyeOff,{...z.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Qi=({onClick:e})=>n.jsx(F.IconEye,{...z.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),In=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(b.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(Xi,{onClick:()=>s(!1)}):n.jsx(Qi,{onClick:()=>s(!0)})})},Sn=({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(Ke,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(j.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var vt=(e=>(e.Sm="sm",e.Md="md",e))(vt||{}),yt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(yt||{});const Ji="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",eo="w-full rounded flex flex-col",it="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",to="bg-accent-primary-alpha",rr="bg-accent-primary-alpha border-l border-accent-primary border-1",Dt="opacity-75",ro=352,no=4,so=n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.SM}),ao=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=j.useSubMenuFloating(no,"listbox",!!e.disabled),d=e.children?.some(f=>t.includes(f.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":!!d,"aria-disabled":!!e.disabled,disabled:e.disabled,className:oe(it,d&&rr,e.disabled&&Dt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(j.DialIcon,{icon:e.icon}),n.jsx(j.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(F.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(j.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(f=>{const p=t.includes(f.value);return n.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!f.disabled,disabled:f.disabled,className:oe(it,p&&rr,f.disabled&&Dt),onClick:()=>!f.disabled&&r(f.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.icon&&n.jsx(j.DialIcon,{icon:f.icon}),n.jsx(j.DialEllipsisTooltip,{text:f.labelNode??f.label})]})},f.value)})})]})},Te=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=yt.Primary,size:o=vt.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:f=!1,searchSize:p=E.ElementSize.Standard,searchPlaceholder:g,selectAll:u=!1,invalid:m,selectAllLabel:v="Select all",emptyStateTitle:x="No options available",emptyStateDescription:C,emptyStateIcon:y,disabled:S=!1,className:T,listClassName:D,closable:N=!1,header:L,footer:O,onClose:A,onChange:k,inlineSearch:w=!1,dismissRef:M,onFooterClick:$,open:U,onOpenChange:J,onInlineQueryChange:G,customMultiSelectTagsRenderer:B})=>{const H=h.useId(),[q,K]=h.useState(!1),se=U!==void 0,X=se?!!U:q,Z=h.useCallback(_=>{se||K(_),J?.(_)},[se,J]),[ae,te]=h.useState(w&&c||""),le=h.useRef(null),ue=h.useCallback(_=>{_!==ae&&(te(_||""),G?.(_||""))},[G,ae]),pe=s!==void 0,[ge,fe]=h.useState(a),W=pe?s:ge,ee=h.useMemo(()=>t?Array.isArray(W)?W:[]:typeof W=="string"?[W]:[],[W,t]),Se=h.useMemo(()=>{const _=ae.trim().toLowerCase();return _?e.filter(re=>re.label.toLowerCase().includes(_)):e},[e,ae]);h.useEffect(()=>{!X&&!w&&ue("")},[w,X,ue]);const Be=h.useRef(c);h.useEffect(()=>{w&&c!==Be.current&&(X||(Be.current=c,ue(c||"")))},[c,w,X,ue]);const he=h.useCallback(_=>{pe||fe(_),k?.(_)},[pe,k]),ze=h.useCallback(_=>{if(t){const re=new Set(ee);re.has(_)?re.delete(_):re.add(_),he(Array.from(re));return}if(he(_),w){const re=e.find(xe=>xe.value===_)??e.flatMap(xe=>xe.children??[]).find(xe=>xe.value===_);re&&ue(re.label)}Z(!1)},[t,he,w,Z,ee,e,ue]),Ee=h.useCallback((_,re)=>{if(_.stopPropagation(),!t){he("");return}const xe=ee.filter(Rt=>Rt!==re);he(xe)},[t,ee,he]),ie=h.useMemo(()=>Se.filter(_=>!_.disabled),[Se]),Re=h.useMemo(()=>ie.filter(_=>ee.includes(_.value)).length,[ie,ee]),Ne=h.useCallback(_=>{w&&!t&&!_&&ze(ae),Z(_)},[ze,w,t,ae,Z]),{allSelectedInFiltered:$e,someSelectedInFiltered:st}=h.useMemo(()=>{const _=ie.length>0&&Re===ie.length;return{allSelectedInFiltered:_,someSelectedInFiltered:Re>0&&!_}},[ie,Re]),ve=h.useCallback(()=>{if(!(!t||ie.length===0))if($e){const _=new Set(ie.map(re=>re.value));he(ee.filter(re=>!_.has(re)))}else{const _=new Set(ee);ie.forEach(re=>_.add(re.value)),he(Array.from(_))}},[$e,t,ie,ee,he]),He=ee.length>0;h.useEffect(()=>{X&&w&&!t&&!S&&requestAnimationFrame(()=>{const _=le.current;if(!_)return;_.focus();const re=_.value?.length??0;_.setSelectionRange?.(re,re)})},[X,w,t,S]);const Me=!t&&He?ee[0]:void 0,me=h.useMemo(()=>Me?e.find(_=>_.value===Me)??e.flatMap(_=>_.children??[]).find(_=>_.value===Me):void 0,[e,Me]),kt=h.useCallback(()=>t?He?B?.(e,ee,Ee)||n.jsx(Sn,{options:e,selectedValues:ee,handleRemoveTag:Ee}):n.jsx("span",{className:"text-secondary truncate",children:d}):me?n.jsxs(n.Fragment,{children:[me.icon&&n.jsx(j.DialIcon,{icon:me.icon}),n.jsx(j.DialEllipsisTooltip,{text:me.labelNode??(l?`${l} ${me.label}`:me.label)}),me?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:me.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:d}),[He,t,c,l,s,d,me,e,ee,Ee,B]);h.useImperativeHandle(M,()=>({dismiss:()=>{Z(!1)}}));const Oe=h.useCallback(()=>{ue(ee.length===1?me?.label??ae:"")},[ae,ee.length,ue,me?.label]),Ve=h.useCallback(()=>{S||(Z(!X),w&&!t&&(Oe(),le.current?.focus()))},[S,w,X,t,Oe,Z]);return n.jsx(j.DialDropdown,{open:X,onOpenChange:Ne,disabled:S,closable:N,onClose:A,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:f?null:ro,listClassName:D,renderOverlay:()=>n.jsxs("div",{id:`list-${r||H}`,role:"listbox","aria-multiselectable":t||void 0,className:eo,children:[L&&n.jsx(n.Fragment,{children:typeof L=="function"?L():L}),(f||N)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(b.DialSearch,{size:p,placeholder:g,onChange:ue,value:ae,id:`search-${r||H}`,containerClassName:I.mergeClasses(b.SIZE_CONFIG[p].containerClassName,"w-full")}),N&&n.jsx(b.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM}),onClick:_=>{A?.(_),Z(!1)}})]}),t&&u&&ie.length>0&&n.jsx("div",{className:oe(it,"mt-2"),children:n.jsx(Yt,{id:`${r||H}-selectAll`,label:v,checked:$e,indeterminate:st,onChange:ve,ariaLabel:v})}),n.jsx("div",{className:oe("overflow-y-auto max-h-[352px]",w&&Se.length===0?"":"py-1"),children:Se.length===0?!w&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:y??n.jsx(F.IconClipboardX,{size:z.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:C})}):Se.map(_=>{const re=ee.includes(_.value);return t?n.jsxs("div",{role:"option","aria-selected":re,"aria-disabled":!!_.disabled,className:oe(it,re&&to,_.disabled&&Dt,"w-full"),children:[n.jsx(Yt,{id:`${r||H}-${_.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[_.icon&&n.jsx(j.DialIcon,{icon:_.icon}),n.jsx("span",{className:"truncate",children:_.labelNode??_.label})]}),checked:re,disabled:_.disabled,onChange:()=>!_.disabled&&ze(_.value),ariaLabel:_.label}),_.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:_.description})]},_.value):_.children?.length?n.jsx(ao,{opt:_,selectedValues:ee,onSelect:ze},_.value):n.jsx("button",{role:"option",type:"button","aria-selected":re,"aria-disabled":!!_.disabled,disabled:_.disabled,className:oe(it,re&&rr,_.disabled&&Dt),onClick:()=>!_.disabled&&ze(_.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[_.icon&&n.jsx(j.DialIcon,{icon:_.icon}),n.jsx(j.DialEllipsisTooltip,{text:_.labelNode??_.label}),_.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:_.description})]})},_.value)})}),O&&n.jsx("div",{onClick:_=>{$?.(_),$&&Z(!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":X,"aria-controls":`list-${r||H}`,className:I.mergeClasses(Ji,S&&"opacity-75 !cursor-not-allowed !border-primary",o===vt.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===yt.Secondary?"!bg-layer-4 !h-auto":"",T),onMouseDown:_=>{S||w&&!t&&(Oe(),_.preventDefault())},onClick:()=>{Ve()},onKeyDown:_=>{(_.key===" "||_.code==="Space")&&(_.preventDefault(),Ve())},children:[w&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||H}`,type:"text",placeholder:g??d,value:ae||"",onChange:_=>ue(_.currentTarget.value.trimStart()),onFocus:()=>!S&&Z(!0),onMouseDown:_=>{Oe(),_.stopPropagation()},onClick:_=>{_.stopPropagation()},onKeyDown:_=>{_.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:le,disabled:S,"aria-disabled":S,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:kt()}),!w&&n.jsx(j.DialIcon,{icon:so,className:oe("text-primary",X&&"rotate-180")})]})})},io=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:d,defaultEmptyText:f,...p})=>{const g=h.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return f??"None";if(Array.isArray(d))return n.jsx(Sn,{options:p.options,selectedValues:d});{const u=p.options?.find(m=>m.value===d);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:u?.label||d})}},[d,p.options,f]);return n.jsx(b.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:f,children:n.jsx(Te,{className:a,value:d,elementId:o,invalid:!!i,...p})})};function Nn(e){let t=null;return()=>(t==null&&(t=e()),t)}function oo(e,t){return e.filter(r=>r!==t)}function lo(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 co{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=lo(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=oo(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class uo{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 At="__NATIVE_FILE__",jn="__NATIVE_URL__",Tn="__NATIVE_TEXT__",wn="__NATIVE_HTML__",Pr=Object.freeze(Object.defineProperty({__proto__:null,FILE:At,HTML:wn,TEXT:Tn,URL:jn},Symbol.toStringTag,{value:"Module"}));function Gt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const nr={[At]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[wn]:{exposeProperties:{html:(e,t)=>Gt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[jn]:{exposeProperties:{urls:(e,t)=>Gt(e,t,"").split(`
2
+ `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Tn]:{exposeProperties:{text:(e,t)=>Gt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function fo(e,t){const r=nr[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new uo(r);return s.loadDataTransfer(t),s}function Ut(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(nr).filter(r=>{const s=nr[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const po=Nn(()=>/firefox/i.test(navigator.userAgent)),En=Nn(()=>!!window.safari);class Fr{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,d=o.length-1,f;for(;c<=d;){f=Math.floor(.5*(c+d));const u=r[f];if(u<t)c=f+1;else if(u>t)d=f-1;else return s[f]}l=Math.max(0,d);const p=t-r[l],g=p*p;return s[l]+a[l]*p+i[l]*g+o[l]*p*g}constructor(t,r){const{length:s}=t,a=[];for(let u=0;u<s;u++)a.push(u);a.sort((u,m)=>t[u]<t[m]?-1:1);const i=[],o=[];let l,c;for(let u=0;u<s-1;u++)l=t[u+1]-t[u],c=r[u+1]-r[u],i.push(l),o.push(c/l);const d=[o[0]];for(let u=0;u<i.length-1;u++){const m=o[u],v=o[u+1];if(m*v<=0)d.push(0);else{l=i[u];const x=i[u+1],C=l+x;d.push(3*C/((C+x)/m+(C+l)/v))}}d.push(o[o.length-1]);const f=[],p=[];let g;for(let u=0;u<d.length-1;u++){g=o[u];const m=d[u],v=1/i[u],x=m+d[u+1]-g-g;f.push((g-m-x)*v),p.push(x*v*v)}this.xs=t,this.ys=r,this.c1s=d,this.c2s=f,this.c3s=p}}const go=1;function On(e){const t=e.nodeType===go?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function pt(e){return{x:e.clientX,y:e.clientY}}function ho(e){var t;return e.nodeName==="IMG"&&(po()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function mo(e,t,r,s){let a=e?t.width:r,i=e?t.height:s;return En()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function xo(e,t,r,s,a){const i=ho(t),l=On(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:d,offsetHeight:f}=e,{anchorX:p,anchorY:g}=s,{dragPreviewWidth:u,dragPreviewHeight:m}=mo(i,t,d,f),v=()=>{let N=new Fr([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(g);return En()&&i&&(N+=(window.devicePixelRatio-1)*m),N},x=()=>new Fr([0,.5,1],[c.x,c.x/d*u,c.x+u-d]).interpolate(p),{offsetX:C,offsetY:y}=a,S=C===0||C,T=y===0||y;return{x:S?C:x(),y:T?y:v()}}class bo{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 Co(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Br(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){Co(e,a,r[a])})}return e}class vo{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 Br({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 Br({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Pr).some(r=>Pr[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=fo(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&&On(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=pt(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=Ut(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const f=this.monitor.getSourceId(),p=this.sourceNodes.get(f),g=this.sourcePreviewNodes.get(f)||p;if(g){const{anchorX:u,anchorY:m,offsetX:v,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),S=xo(p,g,o,{anchorX:u,anchorY:m},{offsetX:v,offsetY:x});l.setDragImage(g,S.x,S.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?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=Ut(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:pt(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=pt(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 Ut(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:pt(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 bo(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new co(this.isNodeInDocument)}}const yo=function(t,r,s){return new vo(t,r,s)},Do=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:i,multiple:o,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p})=>{const g=h.useRef(null),u=h.useRef(null),[m,v]=h.useState([]),[x,C]=h.useState(!1),[y,S]=h.useState(!1),T=h.useCallback(G=>{const B=G.target.files;if(B&&B.length>0){const H=Array.from(B),q=f?.(H),K=p?.(H);q?C(!0):K?S(!0):e(H)}},[f,p,e]),D=h.useCallback(G=>i&&G?.length>i,[i]),N=h.useMemo(()=>x||y||D(m),[x,y,D,m]),L=()=>{v([]),C(!1),S(!1)},O=h.useMemo(()=>x?n.jsx(b.DialErrorText,{text:l}):y?n.jsx(b.DialErrorText,{text:d}):D(m)?n.jsx(b.DialErrorText,{text:c}):null,[c,l,d,m,D,x,y]);h.useEffect(()=>{L()},[a]);const[{isOver:A,canDrop:k},w]=pr(()=>({accept:[At],drop(G){const B=G.files,H=f?.(B)??!1,q=p?.(B)??!1,K=D?.(B)??!1;if(C(H),S(q),H||q||K){v(B);return}e(B),L()},collect:G=>({isOver:G.isOver(),canDrop:G.canDrop()})}),[e,f,p,D]),M=G=>{(G.key==="Enter"||G.key==="Space")&&(G.preventDefault(),u.current?.click())},$=G=>{G?.preventDefault();const B=Array.from(G.dataTransfer?.items??[]);C(!!f?.(B)),S(!!p?.(B)),v(B)},U=G=>{G.target===G.currentTarget&&L()},J=oe("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!k&&!N&&"border-primary",k&&(A?"border-accent-primary":"border-hover"),N&&"border-error");return w(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:J,ref:g,onDragOver:$,onDragLeave:U,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:M,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(b.DialPrimaryButton,{appearance:E.ButtonAppearance.Ghost,label:s,onClick:()=>u.current?.click()})]}),n.jsx("input",{multiple:o,id:"file",type:"file",ref:u,hidden:!0,accept:a,onChange:T})]}),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(F.IconExclamationCircle,{...z.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(b.DialInput,{...r,iconBefore:a(),containerClassName:oe("h-[40px] p-0",s&&"h-[60px]"),className:oe("rounded-r-none border-r-0",s&&"text-error",t)})},So=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:i,fileFormatError:o,fileSizeError:l,fileCountError:c})=>{const d=h.useRef(null),[f,p]=h.useState(!1),[g,u]=h.useState(!1),[m,v]=h.useState(0),x=h.useCallback(()=>{p(!1),u(!1),v(0)},[]),C=h.useCallback(A=>!!(i&&t.length+A.length>i),[i,t.length]),y=f||g,[{isOver:S,canDrop:T},D]=pr(()=>({accept:[At],drop(A){const k=A.files,w=[...t,...k],M=s?.(k)??!1,$=a?.(k)??!1,U=C?.(k)??!1;if(p(M),u($),M||$||U){v(k.length);return}r(w),x()},collect:A=>({isOver:A.isOver(),canDrop:A.canDrop()})}),[t,r,s,a,C,x]),N=A=>{A.preventDefault();const k=Array.from(A.dataTransfer?.items??[]);p(!!s?.(k)),u(!1),v(k.length)},L=A=>{A.target===A.currentTarget&&x()};D(d);const O=C(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:d,onDragOver:N,onDragLeave:L,className:oe("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!y&&!O&&(T&&S?"border-accent-primary":"border-primary"),(y||O)&&"border-error"),children:e}),f&&n.jsx(b.DialErrorText,{text:o}),g&&n.jsx(b.DialErrorText,{text:l}),!f&&!g&&O&&n.jsx(b.DialErrorText,{text:c})]})},An=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:i,errorText:o,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g}=e,u=h.useCallback((x,C)=>{x.stopPropagation(),a(t?.filter(y=>y.name!==C)||[])},[a,t]),m=h.useCallback(x=>n.jsx(Ot,{"aria-label":l,onClick:C=>u(C,x)}),[l,u]),v=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,C)=>n.jsx(Io,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:r||s?.(x.name),invalid:i?.(x),error:i?.(x)?o:""},x.name+C))}),[t,r,s,i,o,m]);return n.jsx(ei,{backend:yo,children:!t||t.length===0?n.jsx(Do,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx(So,{existingFiles:t,onDrop:a,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),c?.(t)&&n.jsx(b.DialErrorText,{text:d})]})})},No=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:i,maxMultiFilesSize:o,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:u,addButtonLabel:m,additionalActionButtons:v,...x})=>{const C=h.useRef(null),y=()=>C.current?.click(),S=()=>{e([])},T=h.useCallback(O=>O?.some(A=>!(g==="/"||g?.toLowerCase()?.includes(A?.type?.toLowerCase()))),[g]),D=h.useCallback(O=>{if(!i)return!1;const A=i*(1024*1024);return O?.some(k=>{const w=k.size;return!!w&&w>A})},[i]),N=h.useCallback(O=>{if(!o||!p)return!1;const A=o*1024*1024;return O.reduce((w,M)=>w+M.size,0)>A},[o,p]),L=h.useCallback(O=>{const A=O.target.files;if(A&&A.length>0){const k=Array.from(A),w=T(k),M=D(k);!w&&!M&&e([...s||[],...k])}},[T,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(ke.DialLabel,{label:`${t}: ${p?s?.length||0:""}`,htmlFor:r}),p&&!!s?.length&&n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(b.DialNeutralButton,{label:u,iconBefore:n.jsx(F.IconTrashX,{...z.BASE_ICON_PROPS}),onClick:S}),(a?a>s?.length:!0)&&n.jsx(b.DialPrimaryButton,{appearance:E.ButtonAppearance.Ghost,iconBefore:n.jsx(F.IconPlus,{...z.BASE_ICON_PROPS}),label:m,onClick:y}),v]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:p,ref:C,hidden:!0,accept:g,onChange:L}),n.jsx(An,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,getIsFileFormatError:T,getIsFileSizeError:D,getIsMultiFilesSizeError:N,...x})]})},jo=({icon:e,ariaLabel:t,size:r=E.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:i,iconClassName:o,caretIcon:l=n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:f=!1,open:p,onOpenChange:g,defaultOpen:u=!1,...m})=>{const v=r===E.ElementSize.Small,[x,C]=h.useState(u),y=p??x,S=v?"w-8 px-0":"w-10 px-0",T={[E.ElementSize.Small]:"size-5",[E.ElementSize.Standard]:"size-6",[E.ElementSize.Large]:"size-7"},D=N=>{C(N),g?.(N)};return n.jsx(j.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:f,className:a,open:y,onOpenChange:D,defaultOpen:u,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:S,i),children:[n.jsx(j.DialIcon,{icon:e,className:I.mergeClasses("flex items-center justify-center text-inherit",T[r],c&&"-mr-2",o,j.DIAL_KIT_CLASS.dropdownIcon)}),c&&n.jsxs("div",{className:I.mergeClasses("relative z-10 inline-grid size-5 shrink-0 place-items-center",j.DIAL_KIT_CLASS.dropdownIconCaret),children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(j.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",y&&"rotate-180")})]})]})})},To="application/octet-stream";function wo(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=Zt(s,!0),i=e.filter(c=>c!==r).map(c=>{const d=c.path||c.url||"",f=Eo(c.nodeType),p=f===b.DialFileNodeType.FOLDER,g=Zt(d,p);let u;return c.parentPath===null||c.parentPath===void 0?u=a:c.parentPath===""?u="":u=Zt(c.parentPath,!0),{...c,originalPath:d,path:g,parentPath:u,nodeType:f}}),o=new Map;i.forEach(c=>{const d={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:Oo(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===b.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===b.DialFileNodeType.ITEM&&(d.extension=Ao(c.name),d.contentType=c.contentType||To,d.contentLength=c.contentLength||0),o.set(c.path,d)});const l=[];return o.forEach(c=>{if(c.parentPath===a)l.push(c);else{const d=c.path.lastIndexOf(c.name||""),f=c.path.slice(0,d),p=o.get(f);p&&p.nodeType===b.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function Zt(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 Eo(e){return e.toUpperCase()==="FOLDER"?b.DialFileNodeType.FOLDER:b.DialFileNodeType.ITEM}function Oo(e){if(!e)return;const t=e.toUpperCase();return Object.values(b.DialFileResourceType).find(s=>s.toUpperCase()===t)}function Ao(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function _o(e,t="Prompts",r="prompts/public/",s="root"){const a=wo(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:b.DialFileNodeType.FOLDER,folderId:s,items:a}]}const _n=({locale:e,timeZone:t,date:r=new Date}={})=>{const s=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:s,timeZoneName:"longOffset"}).formatToParts(r).find(i=>i.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var Je=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(Je||{}),lt=(e=>(e.Select="select",e.Radio="radio",e))(lt||{}),_t=(e=>(e.Row="row",e.Column="column",e))(_t||{}),V=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(V||{});const Lo={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",typeColumnHeader:"Type",entryTypeString:"String",entryTypeNumber:"Number",entryTypeBoolean:"Boolean",entryTypeNull:"Null",entryTypeObject:"Object",entryTypeArray:"Array",entryTypeChangeWarning:"Changing type will reset the current value.",booleanTrueOption:"True",booleanFalseOption:"False",invalidJsonError:"Invalid JSON"},Ln=h.createContext(null);function we(){const e=h.useContext(Ln);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function zr(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 f of a)i=i?.[f];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=zr(o,Q(l,t,r+1));s=zr(o,i)}return s}function kn(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 Lt(e){return e==null||e===""}function Ye(e){return e.type===V.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function It(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Rn(e,t){return e.type===V.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 _e(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{..._e(i,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(Ye(s)){if(s.properties){const a={};let i=!1;for(const[o,l]of Object.entries(s.properties)){const c=_e(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 Ae(e,t,r,s="",a=0){if(a>15)return[];const i=[],o=Q(t,r);if(o.anyOf){const d=o.anyOf.filter(f=>f.type!==V.Null);return e!=null&&d.length===1?Ae(e,d[0],r,s,a+1):i}if(o.oneOf&&o.discriminator){const d=o.discriminator.propertyName,f=e?.[d];if(f&&o.discriminator.mapping[f]){const p={$ref:o.discriminator.mapping[f]},g=Q(p,r);return Ae(e,g,r,s,a+1)}return i}if(o.type===V.Array||!o.type&&Array.isArray(e)){if(Array.isArray(e)&&o.items)for(let d=0;d<e.length;d++){const f=Ae(e[d],o.items,r,`${s}[${d}]`,a+1);i.push(...f)}return i}if(!Ye(o))return i;const l=o.required??[],c=e;for(const d of l){const f=o.properties?.[d];if(f&&Q(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c?.[d];if(Lt(g)){const u=f?.title??It(d);i.push({path:p,message:`${u} is required`})}}if(c&&o.properties)for(const[d,f]of Object.entries(o.properties)){if(Q(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c[d];if(g!=null){const u=Ae(g,f,r,p,a+1);i.push(...u)}}if(c&&o.additionalProperties!=null&&o.additionalProperties!==!1&&typeof o.additionalProperties=="object"){const d=o.additionalProperties;for(const[f,p]of Object.entries(c)){const g=s?`${s}.${f}`:f,u=Ae(p,d,r,g,a+1);i.push(...u)}}return i}function gr(e,t,r){const s=Q(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ye(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 d=o?.[c];return d!=null&&d!==""}).length}/${i} fields`}return""}function ko(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===V.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>Q(a,r).type===V.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>Q(a,r).type===V.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const i=Q(a,r);return i.type===V.Number||i.type===V.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>Q(a,r).type===V.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(Ye(i)||i.oneOf)return a}return 0}return 0}function Ro(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 Mn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case V.String:return"";case V.Boolean:return!1;case V.Array:return[];case V.Integer:case V.Number:return;default:return{}}}const Mo=[V.String,V.Number,V.Boolean,V.Null,V.Object,V.Array];function Po(e){return Array.isArray(e)?V.Array:typeof e=="object"&&e!==null?V.Object:typeof e=="boolean"?V.Boolean:typeof e=="number"?V.Number:e===null?V.Null:V.String}const Fo={[V.String]:"",[V.Number]:0,[V.Boolean]:!1,[V.Null]:null,[V.Object]:{},[V.Array]:[]};function Bo(e){return Fo[e]}const ct=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:i,onRemove:o,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=h.useState(l),p=a===0,g="rounded border border-secondary",u=I.mergeClasses("flex items-center gap-2 cursor-pointer select-none transition-colors",p?"px-4 py-3 bg-layer-3 hover:bg-layer-4":"px-3 py-2 bg-layer-4 hover:bg-layer-3",d?"rounded-t":"rounded"),m=I.mergeClasses("border-t border-secondary",p?"p-4":"p-3");return n.jsxs("div",{className:g,children:[n.jsxs("div",{className:u,onClick:()=>f(v=>!v),role:"button","aria-expanded":d,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:d?n.jsx(F.IconChevronDown,{size:16,stroke:2}):n.jsx(F.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:I.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(ke.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(j.DialIcon,{icon:n.jsx(F.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(j.DialIcon,{icon:n.jsx(F.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),o&&n.jsx(Ot,{size:E.ElementSize.Small,onClick:v=>{v.stopPropagation(),o()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),d&&n.jsx("div",{className:m,children:i})]})},Pn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:i,label:o})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:d=new Set,skipUntouched:f=!1}=we(),p=Q(e,l),g=Ye(p),u=p.type===V.Array;if(g||u){const x=gr(t,p,l),C=Ae(t,p,l,s.join(".")),y=s.join("."),S=y+".",T=!f||d.has(y)||[...d].some(D=>D.startsWith(S));return n.jsx(ct,{title:o??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:T?C.length:0,defaultExpanded:c,children:n.jsx(Le,{schema:p,value:t,onChange:r,path:s,level:a+1,required:i})})}const v=(!f||d.has(s.join(".")))&&i&&Lt(t)?`${o??"Field"} is required`:void 0;return n.jsx(b.DialFormItem,{label:o,required:i,description:p.description,error:v,children:n.jsx(Le,{schema:p,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:!0})})},Ct=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o}=we(),l=Q(e,i),c=kn(Object.entries(l.properties??{}).filter(([,p])=>!Q(p,i).isHidden)),d=l.required??[],f=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(([p,g])=>{const m=Q(g,i).title??g.title??It(p),v=d.includes(p);return n.jsx(Pn,{schema:g,value:f[p],onChange:x=>r({...f,[p]:x}),path:[...s,p],level:a,required:v,label:m},p)})})},zo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,defaultExpanded:c=!0}=we(),d=Array.isArray(t)?t:[],f=e.items,[p,g]=h.useState(void 0);if(!f)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemSchema});const u=h.useMemo(()=>Q(f,i),[f,i]),m=h.useMemo(()=>u.discriminator,[u]),v=h.useMemo(()=>m?.propertyName,[m]),x=h.useMemo(()=>m?Object.keys(m.mapping).map(T=>({value:T,label:T})):[],[m]),C=()=>{const T=p??x[0]?.value;let D;if(m&&T){const N=Q({$ref:m.mapping[T]},i);D={..._e(N,i)??{},[m.propertyName]:T}}else D=_e(u,i)??Mn(u);r([...d,D])},y=T=>{r(d.filter((D,N)=>N!==T))},S=(T,D)=>{r(d.map((N,L)=>L===T?D:N))};return n.jsxs("div",{className:"flex flex-col gap-3",children:[d.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemsYet}),d.map((T,D)=>{const N=Ro(T,v,D),L=gr(T,u,i),O=Ae(T,u,i,`${s.join(".")}[${D}]`);return n.jsx(ct,{title:N,level:a,summary:L,errorCount:O.length,onRemove:l?void 0:()=>y(D),defaultExpanded:c,removeItemAriaLabel:o.removeItemAriaLabel,children:n.jsx(Le,{schema:f,value:T,onChange:A=>S(D,A),path:[...s,String(D)],level:a+1})},D)}),!l&&n.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[x.length>0&&n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(Te,{options:x,value:p??x[0]?.value,placeholder:o.selectTypeToAdd,onChange:T=>{const D=typeof T=="string"?T:T[0];g(D)}})}),n.jsx(b.DialGhostButton,{label:o.addItem,iconBefore:n.jsx(F.IconPlus,{size:16,stroke:2}),onClick:C})]})]})},$o=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1}=we(),c=h.useId(),d=e.discriminator;if(d){const x=d.propertyName,C=d.mapping,y=Object.keys(C).map(N=>({value:N,label:N})),S=typeof t=="object"&&t!==null?t[x]:void 0,T=S?Q({$ref:C[S]},i):void 0,D=N=>{const L=Q({$ref:C[N]},i),O=_e(L,i)??{};r({...O,[x]:N})};if(e.discriminatorDisplay===lt.Radio){const N=e.discriminatorOrientation===_t.Row,L=S?(()=>{const O=Q({$ref:C[S]},i),{[x]:A,...k}=O.properties??{};return{...O,properties:k}})():void 0;return N?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(C).map(O=>{const A=Q({$ref:C[O]},i);return n.jsx(j.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:A.title??O,checked:S===O,disabled:l,onChange:()=>D(O)},O)})}),L&&n.jsx(Ct,{schema:L,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(C).map(O=>{const A=Q({$ref:C[O]},i),k=S===O,{[x]:w,...M}=A.properties??{},$={...A,properties:M};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:A.title??O,checked:k,disabled:l,onChange:()=>D(O)}),k&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Ct,{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(Te,{options:y,value:S,placeholder:o.selectTypePlaceholder,disabled:l,onChange:N=>{const L=typeof N=="string"?N:N[0];L&&D(L)}})}),T&&n.jsx("div",{className:"pl-3",children:n.jsx(Ct,{schema:T,value:t,onChange:r,path:s,level:a})})]})}const f=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<f.length;x++)if(Q(f[x],i).required?.every(y=>y in t))return x}return 0})(),u=x=>{const C=Q(f[x],i),y=_e(C,i);r(y??null)},m=f[g];if(e.discriminatorDisplay===lt.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:f.map((x,C)=>{const y=Q(x,i),S=Rn(x,i)??`Option ${C+1}`,T=g===C;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:String(C),inputId:`${c}-${C}`,label:S,checked:T,disabled:l,onChange:()=>u(C)}),T&&y&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Le,{schema:y,value:t,onChange:r,path:s,level:a})})]},C)})});const v=f.map((x,C)=>{const y=Q(x,i);return{value:String(C),label:y.title??`Option ${C+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(Te,{options:v,value:String(g),disabled:l,onChange:x=>{const C=typeof x=="string"?x:x[0];u(Number(C))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Le,{schema:m,value:t,onChange:r,path:s,level:a})})]})},Ho=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,readonly:o=!1}=we(),l=e.anyOf??[],c=l.map((m,v)=>({value:String(v),label:Rn(m,i)})),d=ko(t,l,i),f=l[d],g=Q(f,i).type===V.Null,u=m=>{const v=Q(l[m],i);if(v.type===V.Null){r(null);return}const x=_e(v,i);if(x!==void 0){r(x);return}switch(v.type){case V.Array:r([]);break;case V.String:r("");break;case V.Boolean:r(!1);break;case V.Integer:case V.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(Te,{options:c,value:String(d),disabled:o,onChange:m=>{const v=typeof m=="string"?m:m[0];u(Number(v))}})}),!g&&f&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Le,{schema:f,value:t,onChange:r,path:s,level:a})})]})},Fn=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:i,readonly:o=!1,inputClassName:l,acceptableResourceTypes:c}=we(),d=e.const!==void 0,f=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===V.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(u=>{const m=c?.[u];return Array.isArray(m)?m.map(v=>{const x=String(v);return{value:x,label:x}}):[]});return n.jsx(Te,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:i.enumSelectPlaceholder,className:l})}if(d)return n.jsx(b.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(f&&e.enumDisplay===lt.Radio){const g=e.enumOrientation===_t.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(u=>{const m=String(u);return n.jsx(j.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(f){const g=e.enum.map(u=>({value:String(u),label:String(u)}));return n.jsx(Te,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:i.enumSelectPlaceholder})}switch(e.type){case V.Boolean:return n.jsx(ke.DialSwitch,{switchId:a,isOn:!!t,disabled:o,onChange:g=>r(g)});case V.Integer:return n.jsx(tr,{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 V.Number:return n.jsx(tr,{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(In,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l}):n.jsx(b.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l})}},hr=({value:e,onChange:t,theme:r=ut.EditorThemes.dark,height:s=240})=>{const{readonly:a,texts:i}=we(),[o,l]=h.useState(null),[c,d]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-CpSpVa0v.cjs")).then(g=>{l(()=>g.DialJsonEditor)})},[]);let f=!1;try{JSON.parse(c)}catch{f=!0}const p=g=>{const u=g??"";d(u);try{t(JSON.parse(u))}catch{}};return n.jsxs("div",{children:[n.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:o&&n.jsx(o,{value:c,currentTheme:r,onChange:p,options:{readOnly:a}})}),n.jsx(b.DialErrorText,{text:f?i.invalidJsonError:void 0})]})},$r=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Bn=e=>!!(e.oneOf||e.anyOf||e.type===V.Array||Ye(e)),Vo={[V.String]:"entryTypeString",[V.Number]:"entryTypeNumber",[V.Boolean]:"entryTypeBoolean",[V.Null]:"entryTypeNull",[V.Object]:"entryTypeObject",[V.Array]:"entryTypeArray"},Ko=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,isUnschematizedValue:a,jsonEditorTheme:i,onKeyChange:o,onValueChange:l,onRemove:c,keyInputPlaceholder:d,removeFieldAriaLabel:f,path:p,level:g,readonly:u=!1,inputClassName:m})=>{const{rootSchema:v,texts:x,defaultExpanded:C=!0,touchedPaths:y=new Set,markTouched:S=()=>{},skipUntouched:T=!1}=we(),[D,N]=h.useState(t),L=Bn(s),[O,A]=h.useState(()=>Po(r)),k=a&&(O===V.Object||O===V.Array),w=a&&O===V.Null,M=L||k,$=[...p,e,"key"].join("."),J=(!T||y.has($))&&t==="",G=h.useCallback(te=>{l(Bo(te)),A(te)},[l]),B=h.useMemo(()=>Mo.map(te=>({value:te,label:x[Vo[te]]})),[x]),H=h.useMemo(()=>[{value:"true",label:x.booleanTrueOption},{value:"false",label:x.booleanFalseOption}],[x]),q=`${e}-key-error`,K=a&&O===V.Boolean,se=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:M?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(b.DialInput,{value:D,disabled:u,invalid:J,"aria-describedby":J?q:void 0,onChange:te=>N(te??""),onBlur:()=>{S($),D!==t&&o(D)},placeholder:d,containerClassName:m}),n.jsx(b.DialErrorText,{id:q,text:J?`${x.keyColumnHeader} is required`:void 0})]}),!L&&!k&&n.jsx("div",{className:"flex-1 min-w-0",children:w?n.jsx(b.DialInput,{value:"null",disabled:!0,onChange:void 0,className:"opacity-60"}):K?n.jsx(Te,{options:H,value:r?"true":"false",disabled:u,onChange:te=>{const le=typeof te=="string"?te:te[0];le&&l(le==="true")}}):n.jsx(Fn,{schema:a?{type:O}:s,value:r,onChange:l})}),a&&n.jsx("div",{className:"w-28 shrink-0",children:n.jsx(E.DialTooltip,{tooltip:x.entryTypeChangeWarning,triggerClassName:"block",children:n.jsx(Te,{options:B,value:O,disabled:u,onChange:te=>{const le=typeof te=="string"?te:te[0];le&&G(le)}})})}),!u&&n.jsx(Ot,{size:E.ElementSize.Small,onClick:c,"aria-label":f,className:"shrink-0 p-1"})]});if(!M)return se;if(k)return n.jsxs("div",{className:"flex flex-col gap-2",children:[se,n.jsx(hr,{value:r,onChange:l,theme:i},O)]});const X=[...p,t],Z=gr(r,s,v),ae=Ae(r,s,v,X.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[se,n.jsx(ct,{title:t,level:g,summary:Z,errorCount:ae.length+(J?1:0),defaultExpanded:C,children:n.jsx(Le,{schema:s,value:r,onChange:l,path:X,level:g+1})})]})},Go=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,inputClassName:c,jsonEditorTheme:d}=we(),f=e.additionalProperties===!0||e.additionalProperties==null,p=f?{type:"string"}:typeof e.additionalProperties=="object"?Q(e.additionalProperties,i):{type:"string"},g=Bn(p),[u,m]=h.useState(()=>Object.entries(t??{}).map(([D,N])=>$r(D,N))),v=D=>Object.fromEntries(D.filter(N=>N.key!=="").map(N=>[N.key,N.value])),x=(D,N)=>{const L=u.map((O,A)=>A===D?{...O,key:N}:O);m(L),r(v(L))},C=(D,N)=>{const L=u.map((O,A)=>A===D?{...O,value:N}:O);m(L),r(v(L))},y=()=>g?_e(p,i)??Mn(p):"",S=()=>{m(D=>[...D,$r("",y())])},T=D=>{const N=u.filter((L,O)=>O!==D);m(N),r(v(N))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[u.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noFieldsYet}),u.length>0&&!g&&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&&n.jsx("span",{className:"w-28 shrink-0 dial-tiny-text text-secondary font-medium",children:o.typeColumnHeader})]}),u.map((D,N)=>n.jsx(Ko,{pairId:D.id,pairKey:D.key,pairValue:D.value,valueSchema:p,isUnschematizedValue:f,jsonEditorTheme:d,onKeyChange:L=>x(N,L),onValueChange:L=>C(N,L),onRemove:()=>T(N),keyInputPlaceholder:o.keyInputPlaceholder,removeFieldAriaLabel:o.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},D.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(b.DialGhostButton,{label:o.addField,iconBefore:n.jsx(F.IconPlus,{size:16,stroke:2}),onClick:S})})]})},Le=({schema:e,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:o=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:f=new Set,skipUntouched:p=!1,jsonEditorTheme:g}=we(),u=Q(e,l),m=C=>{d(s.join(".")),r(C)},v=!p||f.has(s.join("."));let x;if(u.oneOf)x=n.jsx($o,{schema:u,value:t,onChange:m,path:s,level:a});else if(u.anyOf&&u.type!==V.Object)x=n.jsx(Ho,{schema:u,value:t,onChange:m,path:s,level:a});else if(Ye(u)){const C=u.additionalProperties!=null&&u.additionalProperties!==!1,y=!u.properties||Object.keys(u.properties).length===0;C&&y?x=n.jsx(Go,{schema:u,value:t,onChange:m,path:s,level:a}):y&&u.additionalProperties!==!1?x=n.jsx(hr,{value:t,onChange:m,theme:g}):x=n.jsx(Ct,{schema:u,value:t,onChange:m,path:s,level:a})}else if(u.type===V.Array)x=n.jsx(zo,{schema:u,value:t,onChange:m,path:s,level:a});else{const C=v&&i&&Lt(t),y=!o&&C?`${u.title??"Field"} is required`:void 0;x=n.jsxs(n.Fragment,{children:[n.jsx(Fn,{schema:u,value:t,onChange:m,invalid:C}),n.jsx(b.DialErrorText,{text:y})]})}return c?c(s,u,x):x},Uo=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:i=!0,inputClassName:o,variant:l=Je.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:g=!1,jsonEditorTheme:u,acceptableResourceTypes:m})=>{const v=h.useMemo(()=>({...Lo,...r}),[r]),x=h.useMemo(()=>t||(_e(e,e)??{}),[]),[C,y]=h.useState(x),[S,T]=h.useState(new Set),D=h.useCallback(w=>{T(M=>M.has(w)?M:new Set([...M,w]))},[]);h.useEffect(()=>{f?.(x)},[]);const N=(w,M)=>{const $={...C,[w]:M};y($),c?.($),d?.(w,M)},L=new Set(Object.keys(e.properties??{})),O=Object.keys(C).filter(w=>!L.has(w)),A=kn(Object.entries(e.properties??{}).filter(([,w])=>!Q(w,e).isHidden)),k=e.required??[];return n.jsx(Ln.Provider,{value:{rootSchema:e,texts:v,readonly:a,defaultExpanded:i,inputClassName:o,jsonEditorTheme:u,acceptableResourceTypes:m,renderField:p,touchedPaths:S,markTouched:D,skipUntouched:g},children:n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-4",s),children:[A.map(([w,M])=>{const $=Q(M,e),U=$.title??M.title??It(w),J=k.includes(w),G=C[w];if(l===Je.Flat)return n.jsx(Pn,{schema:M,value:G,onChange:K=>N(w,K),path:[w],level:0,required:J,label:U},w);if(l===Je.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(Le,{schema:M,value:G,onChange:K=>N(w,K),path:[w],level:0,required:J})]},w);const B=Ae(G,$,e,w),H=w+".",q=!g||S.has(w)||[...S].some(K=>K.startsWith(H));return n.jsx(ct,{title:U,description:$.description,level:0,defaultExpanded:i,errorCount:q?J&&Lt(G)?Math.max(B.length,1):B.length:0,children:n.jsx(Le,{schema:M,value:G,onChange:K=>N(w,K),path:[w],level:1,required:J})},w)}),O.map(w=>{const M=It(w),$=n.jsx(hr,{value:C[w],onChange:U=>N(w,U),theme:u});return l===Je.Sections?n.jsx(ct,{title:M,level:0,defaultExpanded:i,children:$},w):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:M}),$]},w)})]})})},Zo=e=>({info:n.jsx(F.IconInfoCircleFilled,{size:e.size}),error:n.jsx(F.IconAlertCircleFilled,{size:e.size}),warning:n.jsx(F.IconAlertTriangleFilled,{size:e.size}),success:n.jsx(F.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(b.Spinner,{size:e.size}),general:n.jsx(F.IconCheck,{size:e.size,stroke:e.stroke})}),Wo={[b.NotificationVariant.Info]:"bg-info text-info",[b.NotificationVariant.Success]:"bg-success text-success",[b.NotificationVariant.Warning]:"bg-warning text-warning",[b.NotificationVariant.Error]:"bg-error text-error",[b.NotificationVariant.Loading]:"bg-layer-raised text-info",[b.NotificationVariant.General]:"bg-layer-sunken text-primary"},qo={[b.NotificationVariant.Info]:"status",[b.NotificationVariant.Success]:"status",[b.NotificationVariant.Warning]:"alert",[b.NotificationVariant.Error]:"alert",[b.NotificationVariant.Loading]:"status",[b.NotificationVariant.General]:"status"},Yo="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",mr=({variant:e=b.NotificationVariant.Info,type:t=b.NotificationType.Toast,title:r,message:s,action:a,className:i,iconSize:o=24,iconStroke:l=2,closable:c=!1,onClose:d,children:f,textClassName:p,...g})=>{const u=h.useMemo(()=>Zo({size:o,stroke:l})[e],[e,o,l]),m=p??(t===b.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:qo[e],...g,className:I.mergeClasses(Yo,Wo[e],t===b.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===b.NotificationType.SectionMessage&&e===b.NotificationVariant.Loading&&"border-secondary",i,j.DIAL_KIT_CLASS.notification),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(j.DialIcon,{icon:u})}),r?n.jsxs("div",{className:I.mergeClasses("flex min-w-0 text-primary break-words",m),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})]}),a!=null&&n.jsx("div",{className:"flex shrink-0 items-center",children:a}),f,c&&n.jsx(R.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:v=>d?.(v)})]})},Hr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Xo=e=>e===1?"!truncate !whitespace-nowrap":`${Hr[e]??Hr[2]} !whitespace-normal`,Qo=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const i=I.mergeClasses(Xo(a),s,j.DIAL_KIT_CLASS.highlight);if(!t.trim())return n.jsx(R.EllipsisTooltip,{className:i,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(R.EllipsisTooltip,{className:i,text:l})},Jo=({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,j.DIAL_KIT_CLASS.cardShell),children:t}),tt=(e,t)=>({type:s,...a})=>n.jsx(mr,{...a,variant:e,type:s||t}),rt=(e,t)=>({variant:s,...a})=>n.jsx(mr,{...a,variant:s||t,type:e}),el=tt(b.NotificationVariant.Error,b.NotificationType.Toast),tl=tt(b.NotificationVariant.Info,b.NotificationType.Toast),rl=tt(b.NotificationVariant.Success,b.NotificationType.Toast),nl=tt(b.NotificationVariant.Warning,b.NotificationType.Toast),sl=tt(b.NotificationVariant.Loading,b.NotificationType.Toast),al=tt(b.NotificationVariant.General,b.NotificationType.Toast),il=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Error),ol=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Info),ll=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Success),cl=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Warning),dl=rt(b.NotificationType.SectionMessage,b.NotificationVariant.Loading),ul=rt(b.NotificationType.SectionMessage,b.NotificationVariant.General);var be=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(be||{});const fl="en-GB",pl={[be.Date]:"Select date",[be.DateTime]:"Select date and time",[be.Time]:"--:--",[be.Weekday]:"Select day"},zn="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",$n="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",Hn="!border-error",gl="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",hl="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",ml="bg-control-accent text-control-permanent",xl="text-accent dial-small-semi-text",bl="text-control-disable-primary",Vn="text-secondary",Cl=n.jsx(F.IconCalendar,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Vn}),Vr={prev:n.jsx(F.IconChevronLeft,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx(F.IconChevronRight,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},vl=(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})},Kr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Gr=(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},yl=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Ur=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),Dl=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),gt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Zr=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},Il=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Sl=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}`},Kn=5,Gn=e=>e.charAt(0).toUpperCase()+e.slice(1),Nl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,Kn+r));return Gn(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),jl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,Kn+r));return{value:String(r+1),label:Gn(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),Wr=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:i,panel:o,labelledBy:l,panelLabel:c})=>{const d=j.useThemeScope(),[f,p]=h.useState(!1),{refs:g,floatingStyles:u,context:m}=de.useFloating({open:f,onOpenChange:T=>p(t?!1:T),placement:"bottom-start",whileElementsMounted:de.autoUpdate,middleware:[de.offset(8),de.flip({padding:8}),de.shift({padding:8})]}),v=de.useClick(m,{enabled:!t}),x=de.useDismiss(m),C=de.useRole(m,{role:"dialog"}),{getReferenceProps:y,getFloatingProps:S}=de.useInteractions([v,x,C]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":f,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:I.mergeClasses(zn,"focus-visible:outline focus-visible:outline-focus",r&&Hn,t&&$n,i),...y(),children:s}),f&&n.jsx(de.FloatingPortal,{children:n.jsx(de.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:u,"aria-label":c,className:I.mergeClasses(gl,d,a),...S(),children:o(()=>p(!1))})})})]})},qr=({id:e,value:t,onChange:r,onBlur:s,disabled:a,invalid:i,className:o,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[f,p]=h.useState(t);h.useEffect(()=>{p(t)},[t]);const g=n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:c,disabled:a,value:f,onChange:u=>{const m=Sl(u.target.value);p(m),Il(m)&&r(m)},onBlur:s,className:I.mergeClasses(zn,i&&Hn,a&&$n,o)});return d?n.jsxs("div",{className:"relative w-full",children:[g,n.jsx("span",{className:"dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",children:d})]}):g},Tl=({mode:e=be.Date,value:t,onChange:r,onBlur:s,labelProps:a,placeholder:i,disabled:o=!1,invalid:l=!1,id:c,className:d,minDate:f,maxDate:p,locale:g=fl,fieldClassName:u,showTimezone:m=!1})=>{const v=i??pl[e],x=t instanceof Date?t:null,C=h.useId(),y=c??C,S=a?.id??`${y}-label`,T=!!a?.label,D=typeof a?.label=="string"?a.label:void 0,N=T?`${S} ${y}`:void 0,L=a?n.jsx(R.Label,{...a,id:S,htmlFor:y}):null,[O,A]=h.useState(()=>x??new Date),k=h.useMemo(()=>new Date,[]),w=h.useMemo(()=>m?_n({locale:g}):null,[m,g]),M=h.useMemo(()=>Nl(g),[g]),$=h.useMemo(()=>jl(g),[g]),U=h.useMemo(()=>vl(O.getFullYear(),O.getMonth()),[O]),J=q=>{A(K=>new Date(K.getFullYear(),K.getMonth()+q,1))},G=(q,K)=>{if(Gr(q,f,p))return;const se=e===be.DateTime&&x?Zr(q,gt(x)):q;r?.(se),e===be.Date&&K()},B=q=>{r?.(Zr(x??new Date,q))},H=()=>x?e===be.DateTime?`${Ur(x,g)}, ${gt(x)}`:Ur(x,g):v;if(e===be.Time){const q=typeof t=="string"?t:x?gt(x):"";return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[L,n.jsx(qr,{id:y,value:q,onChange:K=>r?.(K),onBlur:s,disabled:o,invalid:l,placeholder:v,className:u,timezoneLabel:w})]})}if(e===be.Weekday){const q=typeof t=="string"?t:void 0,K=$.find(se=>se.value===q);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[L,n.jsx(Wr,{id:y,disabled:o,invalid:l,labelledBy:N,panelLabel:D??v,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!K&&"text-secondary"),children:K?.label??v}),n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Vn})]}),panel:se=>n.jsx("div",{role:"listbox","aria-label":D??v,className:"flex flex-col gap-0.5",children:$.map(X=>n.jsx("button",{type:"button",role:"option","aria-selected":X.value===q,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",X.value===q&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(X.value),se()},children:X.label},X.value))})})]})}return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[L,n.jsx(Wr,{id:y,disabled:o,invalid:l,labelledBy:N,panelLabel:D??v,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!x&&"text-secondary"),children:H()}),Cl]}),panel:q=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(R.StaticIconButton,{"aria-label":"Previous month",icon:Vr.prev,size:E.ElementSize.Small,onClick:()=>J(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:yl(O,g)}),n.jsx(R.StaticIconButton,{"aria-label":"Next month",icon:Vr.next,size:E.ElementSize.Small,onClick:()=>J(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[M.map(K=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:K},K)),U.map(K=>{const se=K.getMonth()!==O.getMonth(),X=Kr(K,x),Z=Kr(K,k),ae=Gr(K,f,p);return n.jsx("button",{type:"button",disabled:ae,"aria-label":Dl(K,g),"aria-pressed":X,"aria-current":Z?"date":void 0,className:I.mergeClasses(hl,se&&bl,Z&&!X&&xl,X&&ml,ae&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>G(K,q),children:K.getDate()},K.toISOString())})]}),e===be.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(qr,{ariaLabel:"Time",value:x?gt(x):"",onChange:B,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},wl=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const i=n.jsx(j.DialIcon,{icon:n.jsx(F.IconFolder,{size:z.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(b.DialBreadcrumb,{className:I.mergeClasses(s,j.DIAL_KIT_CLASS.folderPath),ariaLabel:a,separator:n.jsx(j.DialIcon,{icon:n.jsx(F.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")})};var Ze=(e=>(e.Small="small",e.Heading="heading",e))(Ze||{});const El="w-full overflow-hidden",Ol="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",Yr="flex min-w-0 items-center gap-2",Xr={[Ze.Small]:"dial-small-text",[Ze.Heading]:"dial-h2-text"},Al={[Ze.Small]:"dial-small-semi-text",[Ze.Heading]:"dial-h2-text"},_l={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},Ll="flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors",kl="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Rl="cursor-default text-primary",Ml="cursor-default text-secondary",Qr="inline-flex flex-none items-center leading-none text-secondary",Pl="dial-kit-minimum-target flex shrink-0 items-center rounded-sm text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Fl=3,Bl=4,zl=n.jsx(F.IconChevronRight,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),$l=({items:e,maxVisibleItems:t=Bl,size:r=Ze.Small,separator:s=zl,ariaLabel:a="Breadcrumb",overflowAriaLabel:i="Show hidden path segments",className:o,itemClassName:l})=>{const c=Math.max(t,Fl),d=h.useMemo(()=>e.length>c?e.slice(1,-(c-2)):[],[e,c]),f=h.useMemo(()=>d.map((m,v)=>({key:String(v),label:m.label,icon:m.icon})),[d]),p=h.useCallback(({key:m,domEvent:v})=>{const x=d[Number(m)];x&&(x.onClick?.(v),!x.onClick&&x.href&&!v.defaultPrevented&&(window.location.href=x.href))},[d]);if(e.length===0)return null;const g=e.slice(d.length+1),u=(m,{index:v,isFirst:x,isCurrent:C})=>{const y=!C&&(!!m.href||!!m.onClick),S=I.mergeClasses(Ll,y?kl:C?I.mergeClasses(Rl,Al[r]):Ml,l,j.DIAL_KIT_CLASS.breadcrumbsItem),T=n.jsxs(n.Fragment,{children:[m.icon,n.jsx(R.EllipsisTooltip,{text:m.label})]});return n.jsxs("li",{className:I.mergeClasses(Yr,Xr[r],_l[C?"last":x?"first":"middle"]),children:[y?m.href?n.jsx("a",{href:m.href,onClick:m.onClick,className:S,children:T}):n.jsx("button",{type:"button",onClick:m.onClick,className:S,children:T}):n.jsx("span",{className:S,"aria-current":C?"page":void 0,children:T}),!C&&n.jsx("span",{className:Qr,"aria-hidden":"true",children:s})]},`segment-${v}`)};return n.jsx("nav",{"aria-label":a,className:I.mergeClasses(El,o,j.DIAL_KIT_CLASS.breadcrumbs),children:n.jsxs("ol",{className:Ol,children:[u(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),d.length>0&&n.jsxs("li",{className:I.mergeClasses(Yr,Xr[r],"shrink-0"),children:[n.jsx(R.Dropdown,{items:f,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:n.jsx("button",{type:"button","aria-label":i,className:Pl,children:n.jsx(F.IconDots,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),n.jsx("span",{className:Qr,"aria-hidden":"true",children:s})]}),g.map((m,v)=>u(m,{index:e.length-g.length+v,isFirst:!1,isCurrent:v===g.length-1}))]})})},nt=({label:e,variant:t,appearance:r=E.ButtonAppearance.Solid,size:s=E.ElementSize.Standard,className:a,textClassName:i,iconAfter:o,iconBefore:l,type:c="button",tooltipProps:d,href:f,target:p,rel:g,disabled:u,...m})=>{const v=I.mergeClasses("dial-kit-base-button",t&&R.getButtonClassNames(t,r),s===E.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===E.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===E.ElementSize.Small&&"dial-kit-base-button-small",r!==E.ButtonAppearance.Link&&(s===E.ElementSize.Small?"px-2":"px-4"),s!==E.ElementSize.Small&&r!==E.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,C=E.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),y=n.jsxs(n.Fragment,{children:[n.jsx(j.DialIcon,{icon:l}),e&&n.jsx("span",{className:i,children:e}),n.jsx(j.DialIcon,{icon:o})]}),S=m,T=f!==void 0?n.jsx("a",{...S,href:u?void 0:f,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":u||void 0,tabIndex:u?-1:S.tabIndex,onClick:u?void 0:S.onClick,className:v,"aria-label":C,children:y}):n.jsx("button",{...m,type:c,disabled:u,className:v,"aria-label":C,children:y});return d?n.jsx(R.Tooltip,{asChild:!0,...d,children:T}):T},xr=(e,t)=>({appearance:s,...a})=>n.jsx(nt,{...a,variant:e,appearance:s||t}),br=(e,t)=>({variant:s,...a})=>n.jsx(nt,{...a,variant:s||t,appearance:e}),Un=xr(E.ButtonVariant.Primary,E.ButtonAppearance.Solid),Cr=xr(E.ButtonVariant.Neutral,E.ButtonAppearance.Solid),Hl=xr(E.ButtonVariant.Danger,E.ButtonAppearance.Solid),Vl=br(E.ButtonAppearance.Link,E.ButtonVariant.Primary),Kl=br(E.ButtonAppearance.Ghost,E.ButtonVariant.Primary),Gl=br(E.ButtonAppearance.Outlined,E.ButtonVariant.Neutral),Ul=({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":E.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx(F.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(E.DialTooltip,{...r,children:o}):o},Zl=e=>n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",e&&"rotate-180")}),Wl=({variant:e,appearance:t,items:r,dropdownProps:s,...a})=>{const[i,o]=h.useState(!1),l=h.useMemo(()=>Zl(i),[i]);return n.jsx("div",{className:j.DIAL_KIT_CLASS.buttonDropdown,children:n.jsx(R.Dropdown,{...s,items:r,onOpenChange:c=>o(c),children:n.jsx(nt,{...a,iconAfter:l,variant:e||E.ButtonVariant.Primary,appearance:t||E.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":i})})})},Zn=({label:e,size:t,isOpen:r=!1,"aria-label":s,...a})=>{const i=t===E.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,j.DIAL_KIT_CLASS.inlineSelect),...a,children:[e,n.jsx(F.IconChevronDown,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",r&&"rotate-180")})]})},ql=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:i,placement:o="bottom-end",matchReferenceWidth:l=!1,listClassName:c,ariaLabel:d})=>{const[f,p]=h.useState(!1),[g,u]=h.useState(r??e[0]?.key),m=t!==void 0,v=m?t:g,x=h.useMemo(()=>{const y=e.find(S=>S.key===v);return y?.label?String(y.label):""},[e,v]),C=h.useCallback(({key:y})=>{const S=e.find(T=>T.key===y);S&&(m||u(y),s?.(S))},[e,m,s]);return n.jsx(R.Dropdown,{items:e,placement:o,matchReferenceWidth:l,listClassName:c,disabled:i,onOpenChange:p,onItemClick:C,children:n.jsx(Zn,{label:x,size:a,isOpen:f,disabled:i,"aria-label":d})})},Pe=({text:e,className:t,variant:r=b.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:I.mergeClasses("dial-tiny-text",r===b.CaptionType.Error?"text-error":"text-secondary",t,j.DIAL_KIT_CLASS.captionText,r===b.CaptionType.Error&&j.DIAL_KIT_CLASS.errorText),children:e}):null,Fe=({...e})=>n.jsx(Pe,{...e,variant:b.CaptionType.Error}),Yl="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={[E.ElementSize.Small]:"size-[24px]",[E.ElementSize.Standard]:"size-[40px]",[E.ElementSize.Large]:"size-[48px]"},Ql=({icon:e,onClick:t,disabled:r,size:s=E.ElementSize.Standard,className:a})=>n.jsx("div",{className:I.mergeClasses("border-l border-tertiary",Xl[s]),children:n.jsx(R.IconButton,{className:I.mergeClasses(Yl,s===E.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),Jl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Wn=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!Jl.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),d=parseFloat(c);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(s!==void 0&&d>+s){e.preventDefault();return}}}}},qn={[E.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[E.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[E.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},We=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:i=E.ElementSize.Standard,...o})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",qn[i].stackGap,a),children:[e&&n.jsx(R.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Yn,{id:s,size:i,...o}),n.jsx(Fe,{text:t}),!t&&n.jsx(Pe,{text:r})]})]}),Yn=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:i,iconBefore:o,iconAfter:l,wrapperClassName:c,type:d,inputRef:f,value:p,tooltipText:g,min:u,onChange:m,max:v,inputButtonProps:x,wrapperRef:C,size:y=E.ElementSize.Standard,...S})=>{const T=qn[y],D=h.useRef(null),N=de.useMergeRefs([f,D]),L=d==="number"||u!==void 0||v!==void 0;h.useEffect(()=>{const w=D.current;if(!w||!L||t)return;const M=$=>{$.preventDefault()};return w.addEventListener("wheel",M,{passive:!1}),()=>{w.removeEventListener("wheel",M)}},[t,L,d]);const O=w=>{Wn(w,d,u,v)},A=w=>{const M=w.currentTarget.value;if(L&&M!==""){const $=parseFloat(M);if(isNaN($)&&M!=="-"&&M!=="."||!isNaN($)&&(u!==void 0&&$<+u||v!==void 0&&$>+v))return}m?.(M||void 0)},k=()=>n.jsxs("div",{ref:C,className:I.mergeClasses("dial-kit-input flex flex-row items-center justify-between",T.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&T.paddingStart,!x&&T.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(Yn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:y,id:`${r}_textBefore`})}),n.jsx(j.DialIcon,{icon:o}),i,n.jsx("input",{ref:N,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:I.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:A,onKeyDown:O,min:u,disabled:t,max:v,...S}),a&&n.jsxs("p",{className:I.mergeClasses("text-secondary",T.postfixText),children:[" ",a]}),n.jsx(j.DialIcon,{icon:l}),x&&n.jsx(Ql,{size:y,...x,disabled:t})]});return t&&d!=="password"?n.jsx(R.Tooltip,{tooltip:g||p,children:k()}):k()};var qe=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(qe||{});const ec="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",tc={[qe.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[qe.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},rc="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",nc="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ge=({label:e,icon:t,appearance:r=qe.Outlined,selected:s=!1,disabled:a=!1,closable:i=!1,removeLabel:o,className:l,title:c,onClick:d,onRemove:f,onKeyDown:p,...g})=>{const u=r===qe.Selectable,m=!!d&&!a,v=i&&!!f&&!a,x=u&&s,C=y=>{p?.(y),!(!m||y.defaultPrevented)&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":u&&m?s:void 0,onClick:a?void 0:d,onKeyDown:C,className:I.mergeClasses(ec,x?"dial-tiny-semi-text":"dial-tiny-text",tc[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[rc,nc],l,j.DIAL_KIT_CLASS.tag),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(R.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:E.ElementSize.Small,"aria-label":o??`Remove ${e}`,icon:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:y=>{y.stopPropagation(),f?.(y)}})]})},Xn=({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(Ge,{label:a?.label??s,closable:!!r,onRemove:i=>r?.(i,s),icon:a?.icon,className:"max-w-full border border-tertiary"},s)})}),sc=I.mergeClasses("w-full flex flex-col"),ac=R.overlayItemClassName,ic="!max-w-[var(--reference-width)]",oc=I.mergeClasses("max-h-[344px] overflow-y-auto py-1",R.overlayListClassName),lc=R.overlayGap,cc=R.overlaySubMenuListClassName,dc=n.jsx(F.IconChevronRight,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),uc="text-secondary transition-transform",fc=8,pc=n.jsx(F.IconSearch,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),gc=n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),hc=n.jsx(R.SvgNoData,{width:z.DIAL_ICON_SIZE.LG,height:z.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),mc=({opt:e,selectedValues:t,mark:r=R.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:i,refs:o,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:f}=j.useSubMenuFloating(lc,"listbox",!!e.disabled),p=e.children?.some(u=>t.includes(u.value)),g=n.jsx(R.MenuItem,{ref:o.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!p,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:dc,...d()});return n.jsxs(de.FloatingNode,{id:i,children:[e.interactiveTooltip?n.jsx(R.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(j.SubMenuPanel,{refs:o,floatingStyles:l,context:c,getFloatingProps:f,role:"listbox",surfaceClassName:cc,children:e.children.map(u=>{const m=n.jsx(R.MenuItem,{role:"option","aria-selected":t.includes(u.value),"aria-disabled":!!u.disabled,disabled:u.disabled,mark:r,selected:t.includes(u.value),ellipsisLabel:!0,icon:u.icon,label:u.labelNode??u.label,rightControl:u.rightControl,onClick:()=>!u.disabled&&s(u.value)});return n.jsx(h.Fragment,{children:u.interactiveTooltip?n.jsx(R.InteractiveTooltip,{asChild:!0,placement:u.interactiveTooltip.placement,content:u.interactiveTooltip.content,contentClassName:u.interactiveTooltip.contentClassName,children:m}):m},u.value)})})]})},xc=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:i=E.ElementSize.Standard,prefix:o,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:f,caption:p,ariaLabel:g,searchable:u=!1,searchSize:m=E.ElementSize.Standard,searchPlaceholder:v,selectAll:x=!1,invalid:C,selectAllLabel:y="Select all",selectedOptionMark:S=R.MenuItemMark.Tint,emptyStateTitle:T="No options available",emptyStateDescription:D,emptyStateIcon:N,disabled:L=!1,className:O,fieldClassName:A,listClassName:k,closable:w=!1,header:M,footer:$,onClose:U,onChange:J,dismissRef:G,onFooterClick:B,open:H,onOpenChange:q,onSearchQueryChange:K,customMultiSelectTagsRenderer:se})=>{const X=h.useId(),Z=r||X,ae=`list-${Z}`,te=i===E.ElementSize.Small,[le,ue]=h.useState(!1),pe=H!==void 0,ge=pe?!!H:le,fe=h.useCallback(P=>{pe||ue(P),q?.(P)},[pe,q]),[W,ee]=h.useState(""),Se=h.useCallback(P=>{P!==W&&(ee(P||""),K?.(P||""))},[K,W]),Be=s!==void 0,[he,ze]=h.useState(a),Ee=Be?s:he,ie=h.useMemo(()=>t?Array.isArray(Ee)?Ee:[]:typeof Ee=="string"?[Ee]:[],[Ee,t]),Re=h.useMemo(()=>{const P=W.trim().toLowerCase();return P?e.filter(ce=>ce.label.toLowerCase().includes(P)):e},[e,W]);h.useEffect(()=>{ge||Se("")},[ge,Se]);const Ne=h.useCallback(P=>{Be||ze(P),J?.(P)},[Be,J]),$e=h.useCallback(P=>{if(t){const ce=new Set(ie);ce.has(P)?ce.delete(P):ce.add(P),Ne(Array.from(ce));return}Ne(P),fe(!1)},[t,Ne,fe,ie]),st=h.useCallback((P,ce)=>{if(P.stopPropagation(),!t){Ne("");return}const ft=ie.filter(ds=>ds!==ce);Ne(ft)},[t,ie,Ne]),ve=h.useMemo(()=>Re.filter(P=>!P.disabled),[Re]),He=h.useMemo(()=>ve.filter(P=>ie.includes(P.value)).length,[ve,ie]),{allSelectedInFiltered:Me,someSelectedInFiltered:me}=h.useMemo(()=>{const P=ve.length>0&&He===ve.length;return{allSelectedInFiltered:P,someSelectedInFiltered:He>0&&!P}},[ve,He]),kt=h.useCallback(()=>{if(!(!t||ve.length===0))if(Me){const P=new Set(ve.map(ce=>ce.value));Ne(ie.filter(ce=>!P.has(ce)))}else{const P=new Set(ie);ve.forEach(ce=>P.add(ce.value)),Ne(Array.from(P))}},[Me,t,ve,ie,Ne]),Oe=ie.length>0,Ve=!t&&Oe?ie[0]:void 0,_=h.useMemo(()=>Ve?e.find(P=>P.value===Ve)??e.flatMap(P=>P.children??[]).find(P=>P.value===Ve):void 0,[e,Ve]),re=_?o?`${o} ${_.label}`:_.label:void 0,xe=h.useMemo(()=>t?Oe?n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:se?.(e,ie,st)??n.jsx(Xn,{options:e,selectedValues:ie,handleRemoveTag:st})}):null:!_||!_.labelNode&&!_.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(R.EllipsisTooltip,{text:_.labelNode??re}),_.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:_.description})]}),[se,st,Oe,t,e,re,ie,_]),Rt=t||xe?"":re||(l&&s?l:""),is=typeof d?.label=="string"?d.label:void 0,os=xe?[E.resolveAccessibleName(g,is),t?ie.map(P=>e.find(ce=>ce.value===P)?.label??P).join(", "):re].filter(Boolean).join(", ")||void 0:E.resolveAccessibleName(g);h.useImperativeHandle(G,()=>({dismiss:()=>{fe(!1)}}));const ls=h.useCallback(P=>{L||(P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),ge||fe(!0))},[L,ge,fe]),cs=()=>n.jsxs("div",{id:ae,role:"listbox","aria-multiselectable":t||void 0,className:sc,children:[M&&n.jsx(n.Fragment,{children:typeof M=="function"?M():M}),(u||w)&&(e.length>fc||!!W)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&n.jsx(We,{id:`search-${Z}`,size:m,placeholder:v,"aria-label":v||"Search options",onChange:P=>Se(P),value:W,iconBefore:pc,containerClassName:"w-full"}),w&&n.jsx(R.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:E.ElementSize.Small,icon:gc,onClick:P=>{U?.(P),fe(!1)}})]}),t&&x&&ve.length>0&&n.jsx("div",{className:I.mergeClasses(ac,"mt-2"),children:n.jsx(R.Checkbox,{id:`${Z}-selectAll`,labelProps:{label:y},isSelected:Me,isIndeterminate:me,onChange:kt})}),n.jsx("div",{role:"none",className:oc,children:Re.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:N??hc,title:T,description:D})}):Re.map(P=>{const ce=ie.includes(P.value);if(P.children?.length)return n.jsx(mc,{opt:P,selectedValues:ie,mark:t?R.MenuItemMark.Checkbox:S,onSelect:$e},P.value);const ft=t?n.jsx(R.MenuItem,{id:`${Z}-${P.value}`,role:"option","aria-selected":ce,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:R.MenuItemMark.Checkbox,selected:ce,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>$e(P.value)}):n.jsx(R.MenuItem,{role:"option","aria-selected":ce,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:S,selected:ce,ellipsisLabel:!0,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>!P.disabled&&$e(P.value)});return n.jsx(h.Fragment,{children:P.interactiveTooltip?n.jsx(R.InteractiveTooltip,{asChild:!0,placement:P.interactiveTooltip.placement,content:P.interactiveTooltip.content,contentClassName:P.interactiveTooltip.contentClassName,children:ft}):ft},P.value)})}),$&&n.jsx("div",{onClick:P=>{B?.(P),B&&fe(!1)},children:typeof $=="function"?$():$})]});return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",O,j.DIAL_KIT_CLASS.select),children:[d&&n.jsx(R.Label,{...d,htmlFor:Z}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(R.Dropdown,{open:ge,onOpenChange:fe,disabled:L,closable:w,onClose:U,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:I.mergeClasses(ic,k),className:"w-full",renderOverlay:cs,children:n.jsx(We,{id:Z,size:i,disabled:L,invalid:C,value:Rt,placeholder:xe?void 0:c,readOnly:!0,iconBefore:t?void 0:_?.icon,iconAfter:n.jsx(F.IconChevronDown,{size:te?z.DIAL_ICON_SIZE.SM:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses(uc,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":ae,"aria-autocomplete":"none","aria-label":os,containerClassName:"w-full",wrapperClassName:I.mergeClasses(!L&&"cursor-pointer",t&&Oe&&["!h-auto flex-wrap py-1.5",te?"min-h-[24px]":"min-h-[40px]"],A),className:I.mergeClasses("cursor-pointer",xe&&"w-0 min-w-0 flex-none p-0"),onKeyDown:ls,children:xe})}),n.jsx(Fe,{text:f}),!f&&n.jsx(Pe,{text:p})]})]})};var Qn=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(Qn||{});const Jr={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},bc=e=>typeof e=="boolean"?Jr[e?"both":"none"]:Jr[e],Cc=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const f=I.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d.invalid&&"dial-kit-input-error",d.disabled&&"dial-kit-input-disable",bc(i),e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",a),children:[o&&n.jsx(R.Label,{...o,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(Fe,{text:s}),!s&&n.jsx(Pe,{text:l})]})]})},vc=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=E.ElementSize.Standard,...a})=>{const[i,o]=h.useState(!1),l=i&&!r;return h.useEffect(()=>{r&&o(!1)},[r]),n.jsx(We,{...a,wrapperClassName:I.mergeClasses(a.wrapperClassName,j.DIAL_KIT_CLASS.passwordInput),size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(R.GhostIconButton,{size:E.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx(F.IconEyeOff,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(F.IconEye,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>o(c=>!c)})})},yc=/^0+\.(\d+)?$/,Dc=/^0+/,Ic=[".","-","+","e","E"],en=e=>!e||e==="-"?e:String(e).match(yc)?String(e).replace(Dc,"0"):Number(e),Sc=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>{if(e&&Ic.includes(d.key)){d.preventDefault();return}Wn(d,"number",r,s),a?.(d)},c=d=>{if(e){const f=d.clipboardData.getData("text"),p=f.replace(/\D/g,"");if(p!==f&&(d.preventDefault(),p)){const g=d.currentTarget,u=g.selectionStart??0,m=g.selectionEnd??0,v=g.value.slice(0,u)+p+g.value.slice(m);t?.(en(v))}}i?.(d)};return n.jsx(We,{...o,wrapperClassName:I.mergeClasses(o.wrapperClassName,j.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:s,onChange:d=>t?.(en(d)),onKeyDown:l,onPaste:c})},Nc="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",jc="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Tc="flex flex-row items-center justify-between px-6 py-4",wc="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",Ec="border-b border-tertiary",Oc="flex flex-row items-center gap-2 px-6 py-4",Ac="border-t border-tertiary",Wt="flex shrink-0 flex-row items-center gap-2",_c={[b.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[b.PopupSize.Md]:"max-w-full md:max-w-[800px]",[b.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},vr=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:i,titleClassName:o,headerClassName:l,bodyClassName:c,children:d,footer:f,footerClassName:p,onClose:g,onBack:u,backAriaLabel:m="Back",headerActions:v,headerDivider:x=!1,mainButtons:C,additionalButtons:y,additionalButtonsOnLeft:S=!1,footerDivider:T=!1,size:D=b.PopupSize.Md,hideClose:N=!1,closeAriaLabel:L="Close dialog",closeOnOutsideClick:O=!0,preventKeyboardOnOpen:A=!1})=>{const k=j.useThemeScope(),w=h.useRef(null),M=h.useId(),{refs:$,context:U}=de.useFloating({open:e,onOpenChange:Z=>{Z||g?.(null)}}),J=de.useRole(U,{role:"dialog"}),G=de.useDismiss(U,{outsidePress:O}),{getFloatingProps:B}=de.useInteractions([J,G]);if(!e)return null;const H=typeof t=="string"?`popup-heading-${M}`:void 0,q=Z=>Z?typeof Z=="string"?n.jsx("h2",{id:H,className:I.mergeClasses(wc,o),children:n.jsx(R.Tooltip,{tooltip:Z,triggerClassName:"truncate",children:Z})}):Z:n.jsx("span",{}),K=N?null:n.jsx(R.CloseButton,{ariaLabel:L,onClose:Z=>g?.(Z)}),se=(Z,ae=[])=>ae.map(({variant:te=E.ButtonVariant.Neutral,...le},ue)=>n.jsx(nt,{variant:te,...le},`${Z}-${ue}`)),X=()=>{if(f!==void 0)return f;if(!C?.length&&!y?.length)return null;const Z=se("additional",y);return n.jsxs("div",{className:I.mergeClasses(Oc,T&&Ac,p),children:[S&&Z.length>0&&n.jsx("div",{className:Wt,children:Z}),n.jsxs("div",{className:I.mergeClasses(Wt,"ml-auto"),children:[!S&&Z,se("main",C)]})]})};return n.jsx(de.FloatingPortal,{id:s,children:n.jsx(de.FloatingOverlay,{className:I.mergeClasses(Nc,k,i),children:n.jsx(de.FloatingFocusManager,{context:U,initialFocus:A?w:$.floating,children:n.jsxs("div",{ref:$.setFloating,...B(),role:"dialog","aria-modal":"true","aria-labelledby":H,"aria-label":H?void 0:r,className:I.mergeClasses(jc,_c[D],a,j.DIAL_KIT_CLASS.popup),children:[A&&n.jsx("div",{ref:w,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:I.mergeClasses(Tc,x&&Ec,l),children:[u&&n.jsx(R.GhostIconButton,{"aria-label":m,size:E.ElementSize.Small,className:"mr-2",onClick:u,icon:n.jsx(F.IconChevronLeft,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),q(t),v?n.jsxs("div",{className:Wt,children:[v,K]}):K]}),n.jsx("div",{className:I.mergeClasses("grow overflow-auto",c),children:d}),X()]})})})})},Lc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",kc="text-secondary dial-small-paragraph-text px-6 pb-4",Rc="px-6 py-4 h-[120px]",Mc="Cancel",Pc="Ok",qt={[b.ConfirmationPopupVariant.Info]:{confirm:{variant:E.ButtonVariant.Primary,appearance:E.ButtonAppearance.Solid}},[b.ConfirmationPopupVariant.Danger]:{container:"border-t-4 border-error",confirm:{variant:E.ButtonVariant.Danger,appearance:E.ButtonAppearance.Solid}}},Jn=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=Pc,cancelLabel:i=Mc,isLoading:o=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:f,onConfirm:p,onCancel:g,children:u,variant:m=b.ConfirmationPopupVariant.Info,size:v=b.PopupSize.Sm,footer:x,hideClose:C,...y})=>{const S=o?null:n.jsxs("div",{className:Lc,children:[n.jsx(Cr,{label:i,onClick:()=>g?g():f?.()}),n.jsx(nt,{variant:qt[m].confirm.variant,appearance:qt[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),T=h.useCallback(()=>o?n.jsx("div",{className:Rc,children:n.jsx(b.Spinner,{size:40})}):u??(t?n.jsx("div",{className:I.mergeClasses(kc,r),children:t}):null),[u,t,o,r]);return n.jsx(vr,{...y,open:s,header:e,className:I.mergeClasses(qt[m].container,c,j.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>f?.(),footer:x??S,size:v,hideClose:C??(!o&&x===void 0),children:T()})};var St=(e=>(e.Start="start",e.End="end",e))(St||{});const Fc=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,ariaLabel:l,onToggle:c,caretPosition:d=St.End,className:f,headerClassName:p,contentClassName:g})=>{const u=s!==void 0,[m,v]=h.useState(a),x=o?!0:u?s:m,C=h.useId(),y=`accordion-header-${C}`,S=`accordion-content-${C}`,T=()=>{if(i)return;const A=!x;u||v(A),c?.(A)},D=d===St.Start,N=o?null:n.jsx(F.IconChevronRight,{size:z.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",x?"rotate-90":"rtl:rotate-180")}),L=n.jsxs(n.Fragment,{children:[D&&N,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]}),!D&&N]}),O=D?"justify-start gap-2":"justify-between";return n.jsxs("div",{className:I.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",f,j.DIAL_KIT_CLASS.accordion),children:[o?n.jsx("div",{id:y,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",O,p),children:L}):n.jsx("button",{id:y,type:"button","aria-expanded":x,"aria-controls":S,"aria-label":E.resolveAccessibleName(l),disabled:i,onClick:T,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",O,i?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:L}),n.jsx("div",{inert:!x,className:I.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",x?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:n.jsx("div",{className:"min-h-0 overflow-hidden",children:n.jsx("div",{className:"pt-3",children:n.jsx("div",{id:S,role:"region","aria-labelledby":y,className:I.mergeClasses("px-4 dial-small-text text-primary",g),children:r})})})})]})},Bc=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:i,className:o,...l})=>{const c=h.useId(),d=e??c,f=i?`${d}-caption`:void 0,p=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,j.DIAL_KIT_CLASS.switch),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:d,checked:r,"aria-checked":r,disabled:s,onChange:p,"aria-label":E.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":f,className:"peer sr-only"}),n.jsx("label",{htmlFor:d,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(R.Label,{size:E.ElementSize.Standard,...t,htmlFor:d,className:I.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),i&&n.jsx("span",{id:f,className:"dial-tiny-text text-secondary ml-[44px]",children:i})]})},zc="flex flex-col gap-2",$c="flex",Hc="mt-2 ml-[26px]",Vc={[b.RadioGroupOrientation.Column]:"flex-col gap-y-3",[b.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},es=({items:e,value:t,onChange:r,name:s,id:a,orientation:i=b.RadioGroupOrientation.Column,labelProps:o,disabled:l,error:c,caption:d,ariaLabel:f,className:p,optionsClassName:g,radioClassName:u,contentClassName:m})=>{const v=h.useId(),x=a??v,C=`${x}-label`,y=c?`${x}-error`:void 0,S=!c&&d?`${x}-caption`:void 0,T=E.resolveAccessibleName(o?.label);return n.jsxs("div",{className:I.mergeClasses(zc,p,j.DIAL_KIT_CLASS.radioGroup),children:[o&&n.jsx(R.Label,{...o,id:C}),n.jsx("div",{role:"radiogroup","aria-labelledby":T?C:void 0,"aria-label":T?void 0:E.resolveAccessibleName(f),"aria-describedby":[y,S].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:I.mergeClasses($c,Vc[i],g),children:e.map(D=>{const N=D.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(R.Radio,{id:`${x}-${D.value}`,name:s??x,value:D.value,labelProps:D.label==null?void 0:{label:D.label},"aria-label":D["aria-label"],caption:D.caption,isSelected:N,disabled:l||D.disabled,onChange:r,className:u}),N&&D.content?n.jsx("div",{className:I.mergeClasses(Hc,m),children:D.content}):null]},D.value)})}),n.jsx(Fe,{id:y,text:c}),!c&&n.jsx(Pe,{id:S,text:d})]})},Kc="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",Gc="min-w-0 flex-1 truncate text-primary",Uc="min-w-0 flex-1 truncate text-secondary",Zc="shrink-0 text-secondary",Wc="px-6 pb-4",qc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Yc="Cancel",Xc="Apply",Qc=({items:e,value:t,customValue:r,header:s,onApply:a,id:i,labelProps:o,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:f,onClose:p,isValid:g=!0,applyButtonLabel:u=Xc,cancelButtonLabel:m=Yc,size:v=b.PopupSize.Md,portalId:x,disabled:C,invalid:y,error:S,caption:T,ariaLabel:D,className:N,fieldClassName:L})=>{const O=h.useId(),A=i??O,k=`${A}-label`,w=`${A}-value`,M=S?`${A}-error`:void 0,$=!S&&T?`${A}-caption`:void 0,[U,J]=h.useState(!1),G=c!==void 0,[B,H]=h.useState(t),q=G?c:B,K=h.useCallback(()=>{C||(G||H(t),J(!0))},[C,G,t]),se=h.useCallback(()=>{J(!1),p?.()},[p]),X=h.useCallback(()=>{f?.(),se()},[f,se]),Z=h.useCallback(()=>{a(q),se()},[a,q,se]),ae=h.useCallback(W=>{G||H(W),d?.(W)},[G,d]),te=E.resolveAccessibleName(o?.label),le=te?void 0:E.resolveAccessibleName(D),ue=te?k:le&&`${A}-name`,pe=E.resolveAccessibleName(s),ge=e.find(W=>W.value===t)?.label,fe=r??ge;return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",N,j.DIAL_KIT_CLASS.radioGroupPopupField),children:[o&&n.jsx(R.Label,{...o,id:k,htmlFor:A}),n.jsxs("div",{className:"flex flex-col gap-1",children:[le&&n.jsx("span",{id:ue,className:"sr-only",children:le}),n.jsxs("button",{type:"button",id:A,disabled:C,"aria-haspopup":"dialog","aria-expanded":U,"aria-labelledby":ue?`${ue} ${w}`:void 0,"aria-describedby":[M,$].filter(Boolean).join(" ")||void 0,onClick:K,className:I.mergeClasses(Kc,y&&"dial-kit-input-error",C&&"dial-kit-input-disable",L),children:[n.jsx("span",{id:w,className:fe==null?Uc:Gc,children:fe??l}),n.jsx(F.IconMaximize,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Zc})]}),n.jsx(Fe,{id:M,text:S}),!S&&n.jsx(Pe,{id:$,text:T})]}),n.jsx(vr,{open:U,header:s,ariaLabel:pe?void 0:te,portalId:x,size:v,onClose:X,footer:n.jsxs("div",{className:qc,children:[n.jsx(Cr,{label:m,onClick:X}),n.jsx(Un,{label:u,disabled:!g,onClick:Z})]}),children:n.jsx("div",{className:Wc,children:n.jsx(es,{id:`${A}-options`,items:e,value:q,onChange:ae,orientation:b.RadioGroupOrientation.Column,ariaLabel:te??pe})})})]})},Jc=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:i,size:o=E.ElementSize.Small,className:l,...c})=>{const d=h.useCallback(p=>{a?.(p),s?.(!r)},[a,s,r]),f=n.jsx(R.IconButton,{...c,size:o,variant:E.ButtonVariant.Primary,appearance:E.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":E.resolveAccessibleName(c["aria-label"],i?.tooltip),onClick:d,className:I.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,j.DIAL_KIT_CLASS.toggleIconButton)});return i?n.jsx(R.Tooltip,{asChild:!0,...i,children:f}):f},ed=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],td="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",rd="flex h-8 min-w-8 grow shrink-0 basis-auto 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",nd="bg-layer-raised text-accent shadow-xs",sd="bg-transparent text-secondary",ad="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",id="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",od="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",ld="cursor-not-allowed bg-transparent text-control-disable-primary",cd=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:i,"aria-label":o})=>{const l=h.useRef({}),c=e.find(p=>p.value===t),d=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,f=h.useCallback(p=>{if(s||!ed.includes(p.key))return;const g=e.filter(C=>!C.disabled);if(g.length===0)return;const u=Math.max(g.findIndex(C=>C.value===t),0),m=g.length-1;let v=u;switch(p.key){case"ArrowRight":case"ArrowDown":v=u===m?0:u+1;break;case"ArrowLeft":case"ArrowUp":v=u===0?m:u-1;break;case"Home":v=0;break;case"End":v=m;break}p.preventDefault();const x=g[v];l.current[x.value]?.focus(),x.value!==t&&r(x.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":o,"aria-disabled":s||void 0,onKeyDown:f,className:I.mergeClasses(td,a,j.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const g=p.value===t,u=s||p.disabled;return n.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":E.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===d?0:-1,disabled:u,onClick:()=>r(p.value),className:I.mergeClasses(rd,g?nd:sd,u?g?od:ld:g?ad:id,i,j.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},dd={[b.TabOrientation.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[b.TabOrientation.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},ud=({tabs:e,activeTabId:t,onTabChange:r,orientation:s=b.TabOrientation.Horizontal,sectionLabel:a,ariaLabel:i,className:o,tabListClassName:l,tabClassName:c,sectionLabelClassName:d})=>{const f=h.useRef({}),p=h.useId(),g=s===b.TabOrientation.Vertical,u=e.find(C=>C.id===t),m=u&&!u.disabled?u.id:e.find(C=>!C.disabled)?.id,v=h.useCallback(C=>{const{next:y,previous:S}=dd[s];if(![y,S,"Home","End"].includes(C.key)||e.length===0)return;const T=e.filter(A=>!A.disabled);if(T.length===0)return;const D=Math.max(T.findIndex(A=>A.id===t),0),N=T.length-1;let L=D;C.key===y?L=D===N?0:D+1:C.key===S?L=D===0?N:D-1:C.key==="Home"?L=0:L=N,C.preventDefault();const O=T[L];f.current[O.id]?.focus(),O.id!==t&&r(O.id)},[e,t,r,s]),x=n.jsx("div",{role:"tablist","aria-orientation":g?"vertical":void 0,"aria-label":i,"aria-labelledby":!i&&a?p:void 0,onKeyDown:v,className:I.mergeClasses(g?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&o,l,j.DIAL_KIT_CLASS.tabList,!a&&j.DIAL_KIT_CLASS.tabs),children:e.map(C=>{const y=t===C.id,S=!!C.disabled;return n.jsxs("button",{ref:T=>{f.current[C.id]=T},type:"button",role:"tab","aria-selected":y,disabled:S,tabIndex:C.id===m?0:-1,onClick:()=>r(C.id),className:I.mergeClasses("dial-kit-enhanced-target flex items-center gap-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-focus",g?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",y?"dial-small-semi-text":"dial-small-text text-secondary"]:["dial-small-paragraph-semi-text border-b-2 border-transparent px-3 py-2","focus-visible:outline-offset-2"],S&&(g?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!S&&(g?y?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":y?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),c,j.DIAL_KIT_CLASS.tab,y&&j.DIAL_KIT_CLASS.tabSelected),children:[C.icon&&n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:C.icon}),n.jsx("span",{className:I.mergeClasses(g&&!y&&!S&&"text-primary"),children:C.label}),C.count!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"ms-auto",S&&"bg-layer-sunken text-control-disable-primary",!S&&(y?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:C.count})]},C.id)})});return a?n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-3",o,j.DIAL_KIT_CLASS.tabs),children:[n.jsx("div",{className:I.mergeClasses("flex h-16 shrink-0 items-center",g?"px-4":"px-3"),children:n.jsx("span",{id:p,className:I.mergeClasses("dial-h1-text text-primary",d,j.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),x]}):x},fd="flex flex-nowrap items-center gap-1",pd="min-w-max flex-1 justify-center",gd=({items:e,value:t,onChange:r,stretch:s=!1,className:a,chipClassName:i,"aria-label":o,"aria-labelledby":l})=>n.jsx("div",{role:"group","aria-label":o,"aria-labelledby":l,className:I.mergeClasses(fd,a,j.DIAL_KIT_CLASS.filterChips),children:e.map(c=>n.jsx(Ge,{label:c.label,icon:c.icon,appearance:qe.Selectable,selected:c.value===t,onClick:()=>r(c.value),className:I.mergeClasses(s&&pd,i)},c.value))}),sr=(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})},hd=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:i,multiple:o=!1,disabled:l=!1,errorText:c,icon:d,id:f,ariaLabel:p,className:g})=>{const u=h.useId(),m=f??`file-dropzone-${u}`,v=c?`${m}-error`:void 0,[x,C]=h.useState(!1),y=h.useRef(0),S=h.useCallback(k=>{if(k.length===0)return;const w=o?k:k.slice(0,1),M=w.filter(U=>sr(U,i)),$=w.filter(U=>!sr(U,i));$.length>0&&a?.($),M.length>0&&s(M)},[i,o,s,a]),T=h.useCallback(k=>{S(Array.from(k.target.files??[])),k.target.value=""},[S]),D=h.useCallback(()=>{y.current=0,C(!1)},[]),N=h.useCallback(k=>{l||(k.preventDefault(),y.current+=1,C(!0))},[l]),L=h.useCallback(k=>{l||(k.preventDefault(),k.dataTransfer.dropEffect="copy")},[l]),O=h.useCallback(()=>{l||(y.current-=1,y.current<=0&&D())},[l,D]),A=h.useCallback(k=>{k.preventDefault(),!l&&(D(),S(Array.from(k.dataTransfer?.files??[])))},[l,D,S]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(R.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:i,multiple:o,disabled:l,onChange:T,"aria-label":E.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":v,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:N,onDragOver:L,onDragLeave:O,onDrop:A,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&&x&&"border-accent bg-control-accent-alpha",!l&&!x&&"border-secondary hover:border-accent",c&&!x&&"border-error hover:border-error",g,j.DIAL_KIT_CLASS.fileDropzone),children:[d??n.jsx(F.IconUpload,{size:z.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(Fe,{id:v,text:c})]})},ts=({label:e="Shared",tooltip:t,size:r=12,className:s})=>n.jsx(R.Tooltip,{tooltip:t||"Shared",asChild:!0,children:n.jsx("span",{role:"img","aria-label":e,className:I.mergeClasses("flex shrink-0 rounded-sm bg-layer-raised text-accent",s,j.DIAL_KIT_CLASS.sharedEntityIndicator),children:n.jsx(F.IconArrowUpRight,{size:r,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var De=(e=>(e.Images="images",e.Video="video",e.Audio="audio",e.Code="code",e.Text="text",e.Pdf="pdf",e.Spreadsheet="spreadsheet",e.Presentation="presentation",e.Archive="archive",e.Dial="dial",e.Other="other",e))(De||{});const md={images:["apng","avif","bmp","gif","heic","heif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],video:["avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"],audio:["aac","aiff","flac","m4a","mid","midi","mp3","oga","ogg","opus","wav","wma"],code:["bash","c","cjs","cpp","cs","css","go","h","hpp","htm","html","ini","ipynb","java","js","json","jsx","kt","less","lua","mjs","php","ps1","py","r","rb","rs","sass","scala","scss","sh","sql","svelte","swift","toml","ts","tsx","vue","xml","yaml","yml","zsh"],text:["doc","docx","log","markdown","md","odt","rtf","text","txt"],pdf:["pdf"],spreadsheet:["csv","numbers","ods","tsv","xls","xlsm","xlsx"],presentation:["key","odp","pps","ppsx","ppt","pptx"],archive:["7z","bz2","gz","rar","tar","tgz","xz","zip"],dial:["dial"]},xd=new Map(Object.entries(md).flatMap(([e,t])=>t.map(r=>[r,e]))),bd=e=>xd.get(e)??"other",tn="var(--text-control-permanent, #FCFCFC)",ht={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},Cd="#1B212D",vd={[De.Images]:{path:"M11.0002 8.66667H11.0036M7.00024 11.3333L8.66691 9.66667C8.97624 9.369 9.35758 9.369 9.66691 9.66667L11.3336 11.3333M10.6669 10.6667L11.0002 10.3333C11.3096 10.0357 11.6909 10.0357 12.0002 10.3333L13.0002 11.3333M7.00024 8C7.00024 7.73478 7.1056 7.48043 7.29314 7.29289C7.48067 7.10536 7.73503 7 8.00024 7H12.0002C12.2655 7 12.5198 7.10536 12.7074 7.29289C12.8949 7.48043 13.0002 7.73478 13.0002 8V12C13.0002 12.2652 12.8949 12.5196 12.7074 12.7071C12.5198 12.8946 12.2655 13 12.0002 13H8.00024C7.73503 13 7.48067 12.8946 7.29314 12.7071C7.1056 12.5196 7.00024 12.2652 7.00024 12V8Z",sheet:ht},[De.Code]:{path:"M8.33358 8.66665L7.00024 9.99998L8.33358 11.3333M11.6669 8.66665L13.0002 9.99998L11.6669 11.3333M10.6669 7.33331L9.33358 12.6666",sheet:{x1:"16.6667",y1:"0",x2:"2.08333",y2:"20.4167",from:"var(--bg-control-inverted, #57647A)",to:Cd}},[De.Text]:{path:"M7.3335 8H12.6668M7.3335 10H12.6668M7.3335 12H11.3335",sheet:{x1:"25.8333",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-violet-1, #DDE3F9)",to:"var(--bg-gradient-1, #1D4ED8)"}},[De.Spreadsheet]:{path:"M7.33325 10.1667H12.6666M9.99992 7.5V12.8333M7.33325 8.16667C7.33325 7.98986 7.40349 7.82029 7.52851 7.69526C7.65354 7.57024 7.82311 7.5 7.99992 7.5H11.9999C12.1767 7.5 12.3463 7.57024 12.4713 7.69526C12.5963 7.82029 12.6666 7.98986 12.6666 8.16667V12.1667C12.6666 12.3435 12.5963 12.513 12.4713 12.6381C12.3463 12.7631 12.1767 12.8333 11.9999 12.8333H7.99992C7.82311 12.8333 7.65354 12.7631 7.52851 12.6381C7.40349 12.513 7.33325 12.3435 7.33325 12.1667V8.16667Z",sheet:{x1:"20.4167",y1:"-3.75",x2:"2.91667",y2:"20.4167",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-1, #059669)"}},[De.Pdf]:{fillPath:"M12.5373 10.3151C12.0382 10.3151 11.4137 10.4021 11.2094 10.4328C10.3637 9.54967 10.1231 9.04771 10.069 8.91388C10.1423 8.72544 10.3975 8.0096 10.4338 7.09022C10.4517 6.62991 10.3544 6.28596 10.1447 6.06792C9.93533 5.85024 9.68191 5.83331 9.60924 5.83331C9.35443 5.83331 8.92697 5.96216 8.92697 6.82503C8.92697 7.5737 9.27603 8.36813 9.37252 8.57339C8.86416 10.0536 8.31837 11.0669 8.20248 11.2753C6.15974 12.0444 6 12.788 6 12.9988C6 13.3775 6.26973 13.6036 6.72152 13.6036C7.8192 13.6036 8.8209 11.7607 8.98653 11.4407C9.76614 11.1301 10.8096 10.9377 11.0749 10.8918C11.8357 11.6166 12.7157 11.81 13.0811 11.81C13.3561 11.81 14 11.81 14 11.148C14 10.5332 13.2121 10.3151 12.5373 10.3151ZM12.4844 10.7497C13.0773 10.7497 13.234 10.9458 13.234 11.0494C13.234 11.1145 13.2093 11.3268 12.8915 11.3268C12.6065 11.3268 12.1145 11.1621 11.6303 10.8047C11.8322 10.7782 12.131 10.7497 12.4844 10.7497ZM9.57812 6.25458C9.63218 6.25458 9.66777 6.27195 9.69711 6.31264C9.86764 6.54926 9.73014 7.32242 9.56279 7.92745C9.40124 7.40867 9.28 6.61264 9.45058 6.33259C9.48392 6.27793 9.52204 6.25458 9.57812 6.25458ZM9.29017 10.8856C9.50483 10.452 9.74542 9.81997 9.87646 9.46253C10.1387 9.90147 10.4914 10.309 10.6954 10.53C10.0603 10.6639 9.57969 10.7976 9.29017 10.8856ZM6.4264 13.0566C6.41226 13.0399 6.41017 13.0045 6.42083 12.9621C6.44317 12.8731 6.61396 12.4322 7.84924 11.8796C7.67236 12.1582 7.39585 12.5563 7.09208 12.8537C6.87825 13.0538 6.71174 13.1553 6.59719 13.1553C6.55621 13.1553 6.49974 13.1442 6.4264 13.0566Z",sheet:{x1:"26.25",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-red, #FCE7F3)",to:"var(--bg-control-error-active, #CC4545)"}},[De.Audio]:{path:"M9 11.5C9 11.7652 8.89464 12.0195 8.70711 12.2071C8.51957 12.3946 8.26522 12.5 8 12.5C7.73478 12.5 7.48043 12.3946 7.29289 12.2071C7.10536 12.0195 7 11.7652 7 11.5C7 11.2347 7.10536 10.9804 7.29289 10.7929C7.48043 10.6053 7.73478 10.5 8 10.5C8.26522 10.5 8.51957 10.6053 8.70711 10.7929C8.89464 10.9804 9 11.2347 9 11.5ZM9 11.5V7.16663H12.3333V11.5M12.3333 11.5C12.3333 11.7652 12.228 12.0195 12.0404 12.2071C11.8529 12.3946 11.5985 12.5 11.3333 12.5C11.0681 12.5 10.8138 12.3946 10.6262 12.2071C10.4387 12.0195 10.3333 11.7652 10.3333 11.5C10.3333 11.2347 10.4387 10.9804 10.6262 10.7929C10.8138 10.6053 11.0681 10.5 11.3333 10.5C11.5985 10.5 11.8529 10.6053 12.0404 10.7929C12.228 10.9804 12.3333 11.2347 12.3333 11.5ZM9 8.49996H12.3333",sheet:ht},[De.Video]:{path:"M9.99996 13.1667C11.8409 13.1667 13.3333 11.6743 13.3333 9.83333C13.3333 7.99238 11.8409 6.5 9.99996 6.5C8.15901 6.5 6.66663 7.99238 6.66663 9.83333C6.66663 11.6743 8.15901 13.1667 9.99996 13.1667ZM9.33337 8.5L11.3334 9.83333L9.33337 11.1667V8.5Z",sheet:ht},[De.Presentation]:{path:"M7 7.33331H13M7.33333 7.33331V10.6666C7.33333 10.8435 7.40357 11.013 7.5286 11.1381C7.65362 11.2631 7.82319 11.3333 8 11.3333H12C12.1768 11.3333 12.3464 11.2631 12.4714 11.1381C12.5964 11.013 12.6667 10.8435 12.6667 10.6666V7.33331M10 11.3333V12.6666M9 12.6666H11M8.66667 9.99998L9.66667 8.99998L10.3333 9.66665L11.3333 8.66665",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-brown, #FDE8D8)",to:"var(--text-visual-brown-2, #B45309)"}},[De.Archive]:{path:"M10.0001 6.66669H9.58341M10.8334 7.451H10.4167M10.0001 8.23531H9.58341M10.8334 9.01963H10.4167M10.0001 9.80394H9.58341M10.8334 10.5883H10.4167M10.0001 11.3726C10.2211 11.3726 10.4331 11.4552 10.5893 11.6023C10.7456 11.7494 10.8334 11.9489 10.8334 12.1569V12.9412C10.8334 13.0452 10.7895 13.1449 10.7114 13.2185C10.6332 13.292 10.5273 13.3334 10.4167 13.3334H9.58341C9.47291 13.3334 9.36693 13.292 9.28879 13.2185C9.21065 13.1449 9.16675 13.0452 9.16675 12.9412V12.1569C9.16675 11.9489 9.25455 11.7494 9.41083 11.6023C9.56711 11.4552 9.77907 11.3726 10.0001 11.3726Z",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-3, #065F46)"}},[De.Dial]:{path:"M8.26392 7.44049C8.80816 7.44049 9.28449 7.50578 9.69653 7.63092L9.69849 7.6319C10.1079 7.75343 10.4556 7.938 10.7463 8.1817L10.7483 8.18365C11.0312 8.41601 11.2537 8.72491 11.4104 9.12115V9.12213C11.5666 9.51456 11.6496 9.98403 11.6497 10.5381C11.6497 11.5957 11.3539 12.3492 10.8108 12.8565C10.2602 13.3708 9.47204 13.6504 8.39868 13.6505H6.71313V7.44049H8.26392Z",fillPath:"M12.7167 12.1008L12.9558 12.3564L12.9558 12.3564L12.7167 12.1008ZM11.4504 6.20825L11.3486 6.54311L11.3507 6.54375L11.4504 6.20825ZM12.637 6.833L12.4119 7.10109L12.4147 7.10334L12.637 6.833ZM13.4108 7.9263L13.0853 8.05488L13.0856 8.05566L13.4108 7.9263ZM11.1666 12.8853L11.0909 12.5436V12.5436L11.1666 12.8853ZM10.4391 12.6553C10.2487 12.689 10.1217 12.8706 10.1553 13.0609C10.189 13.2513 10.3706 13.3783 10.5609 13.3447L10.5 13L10.4391 12.6553ZM13.6781 9.49291H13.3281C13.3281 10.5655 13.0283 11.33 12.4776 11.8451L12.7167 12.1008L12.9558 12.3564C13.687 11.6724 14.0281 10.6984 14.0281 9.49291H13.6781ZM7.9751 6.12805H8.3251C8.3251 6.24476 8.23053 6.35 8.1009 6.35V6V5.65C7.83231 5.65 7.6251 5.86989 7.6251 6.12805H7.9751ZM8.1009 6V6.35H9.89799V6V5.65H8.1009V6ZM9.89799 6V6.35C10.449 6.35 10.9312 6.41618 11.3486 6.54311L11.4504 6.20825L11.5522 5.87339C11.0566 5.72265 10.5039 5.65 9.89799 5.65V6ZM11.4504 6.20825L11.3507 6.54375C11.7654 6.66701 12.1173 6.85376 12.4119 7.10107L12.637 6.833L12.862 6.56492C12.4875 6.2506 12.0484 6.02084 11.5501 5.87275L11.4504 6.20825ZM12.637 6.833L12.4147 7.10334C12.7016 7.33926 12.9264 7.65273 13.0853 8.05488L13.4108 7.9263L13.7363 7.79772C13.5387 7.29746 13.2477 6.88206 12.8593 6.56265L12.637 6.833ZM13.4108 7.9263L13.0856 8.05566C13.2441 8.45409 13.3281 8.93071 13.3281 9.49291H13.6781H14.0281C14.0281 8.86239 13.934 8.29465 13.736 7.79694L13.4108 7.9263ZM7.9751 7.21882H8.3251V6.12805H7.9751H7.6251V7.21882H7.9751ZM12.7167 12.1008L12.4776 11.8451C12.117 12.1824 11.6591 12.4177 11.0909 12.5436L11.1666 12.8853L11.2423 13.227C11.9168 13.0776 12.4923 12.7898 12.9558 12.3564L12.7167 12.1008ZM11.1666 12.8853L11.0909 12.5436C11.091 12.5435 11.0826 12.5452 11.0606 12.5493C11.041 12.5528 11.0155 12.5573 10.9857 12.5625C10.926 12.5729 10.8511 12.5857 10.7756 12.5984C10.6269 12.6236 10.472 12.6495 10.4391 12.6553L10.5 13L10.5609 13.3447C10.6064 13.3366 11.1725 13.2425 11.2423 13.227L11.1666 12.8853Z",sheet:"var(--bg-gradient-2, #885DF2)"},[De.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:ht}},yd=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${h.useId().replace(/[^\w-]/g,"")}`,{path:s,fillPath:a,sheet:i}=vd[t],o=typeof i=="string";return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M17.4999 3.97859V16C17.4999 18.2091 15.709 20 13.4999 20H6.5C4.29086 20 2.5 18.2091 2.5 16V4C2.5 1.79086 4.29086 0 6.5 0H13.1683H13.5213C15.7186 0 17.4999 1.78128 17.4999 3.97859Z",fill:o?i:`url(#${r})`}),s&&n.jsx("path",{d:s,stroke:tn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&n.jsx("path",{d:a,fill:tn}),!o&&n.jsx("defs",{children:n.jsxs("linearGradient",{id:r,x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:i.from}),n.jsx("stop",{offset:"1",stopColor:i.to})]})})]})},Dd=({size:e})=>{const t=`dial-kit-folder-gradient-${h.useId().replace(/[^\w-]/g,"")}`;return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M6.38992 3.75H4.66663C3.00977 3.75 1.66663 5.09315 1.66663 6.75V7.91667H7.16339L10.8333 5.79247L7.85075 4.1297C7.40412 3.8807 6.90127 3.75 6.38992 3.75Z",fill:"var(--stroke-gradient-1, #5976E9)"}),n.jsx("path",{d:"M14.3333 5.41669C16.5424 5.41669 18.3333 7.20755 18.3333 9.41669V12.25C18.3333 14.4592 16.5424 16.25 14.3333 16.25H5.66663C3.45749 16.25 1.66663 14.4592 1.66663 12.25V7.6708C1.66663 7.11851 2.11434 6.6708 2.66663 6.6708H6.89447C7.43998 6.6708 7.97973 6.55922 8.48053 6.34291L9.86582 5.74458C10.3666 5.52827 10.9064 5.41669 11.4519 5.41669H14.3333Z",fill:`url(#${t})`}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),n.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},Id=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),Sd=(e,t)=>e===b.DialItemType.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",Nd=(e,t,r)=>e===b.DialItemType.Folder?n.jsx(Dd,{size:r}):n.jsx(yd,{size:r,kind:bd(t)}),yr=({type:e,name:t,fileExtension:r,shared:s=!1,loading:a=!1,size:i=z.DIAL_ICON_SIZE.MD,className:o,decorative:l=!1,label:c,loadingLabel:d="Loading",sharedIndicatorClassName:f,sharedIndicatorTooltip:p})=>{if(e!==b.DialItemType.File&&e!==b.DialItemType.Folder)return null;const g=e===b.DialItemType.File?Id(t,r):"",u=Sd(e,g),m=c??(s?`${u}, shared`:u),v=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":m};return n.jsxs("span",{className:I.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",o,j.DIAL_KIT_CLASS.fileIcon),...v,children:[a?n.jsx(b.Spinner,{size:i,ariaLabel:d}):Nd(e,g,i),s&&n.jsx(ts,{tooltip:p,className:I.mergeClasses("absolute -bottom-0.5 -left-0.5",f)})]})},rs=({name:e,type:t=b.DialItemType.File,fileExtension:r,shared:s=!1,loading:a=!1,loadingLabel:i,iconSize:o,details:l,isInvalidName:c=!1,className:d,nameClassName:f,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,sharedLabel:u="Shared",hideTooltip:m=!1,tooltipContent:v})=>n.jsxs("div",{className:I.mergeClasses("flex w-full min-w-0 items-center gap-2",d,j.DIAL_KIT_CLASS.fileName),children:[n.jsx(yr,{name:e,type:t,fileExtension:r,shared:s,loading:a,loadingLabel:i,size:o,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,decorative:!a}),n.jsxs("div",{className:I.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[n.jsx(R.EllipsisTooltip,{className:I.mergeClasses("dial-small-paragraph-text",c?"text-secondary":"text-primary",f),text:e,hideTooltip:m,customTooltipContent:v}),s&&n.jsx("span",{className:"sr-only",children:u}),l]})]}),jd=({className:e,...t})=>n.jsx(rs,{...t,type:b.DialItemType.Folder,className:I.mergeClasses(e,j.DIAL_KIT_CLASS.folderName)}),Td=({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},wd=4,Ed=24,rn=e=>parseFloat(e)||0,Od=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Ad=()=>{},_d=({id:e,value:t,defaultValue:r,size:s=E.ElementSize.Standard,labelProps:a,placeholder:i,caption:o,error:l,invalid:c,disabled:d=!1,readOnly:f=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:u="Tags",className:m,fieldClassName:v,tagClassName:x,onChange:C})=>{const y=h.useId(),S=e||y,T=s===E.ElementSize.Small,D=h.useRef(null),N=h.useRef([]),L=h.useRef(null),O=t!==void 0,[A,k]=h.useState(r??[]),w=O?t:A,M=w.length,[$,U]=h.useState(""),[J,G]=h.useState(M),B=!f&&!d,H=h.useCallback(W=>{O||k(W),C?.(W)},[O,C]),q=h.useCallback(W=>ee=>{N.current[W]=ee},[]),K=h.useCallback(()=>{const W=D.current;if(!W||W.clientWidth===0){G(w.length);return}const{paddingLeft:ee,paddingRight:Se}=getComputedStyle(W);G(Td({availableWidth:W.clientWidth-rn(ee)-rn(Se)-(f?0:Ed),tagWidths:w.map((Be,he)=>N.current[he]?.offsetWidth??0),overflowChipWidth:L.current?.offsetWidth??0,gap:wd}))},[f,w]);h.useEffect(()=>{if(!p){G(M);return}const W=D.current;if(!W)return;const ee=new ResizeObserver(()=>K());return ee.observe(W),K(),()=>ee.disconnect()},[p,K,M]);const se=I.mergeClasses(p?"shrink-0":"min-w-0",x),X=W=>{const ee=Od(W.trim()).trim();!ee||w.includes(ee)||H([...w,ee])},Z=W=>{H(w.filter(ee=>ee!==W))},ae=()=>{X($),U("")},te=W=>{if(B){if(W.key==="Enter"||W.key===","){W.preventDefault(),ae();return}W.key==="Backspace"&&!$&&M>0&&(W.preventDefault(),H(w.slice(0,-1)))}},le=()=>{B&&$.trim()&&ae()},ue=p?w.slice(0,J):w,pe=p?w.slice(J):[],ge=pe.join(", "),fe=M>0&&n.jsxs("span",{role:"list","aria-label":u,className:I.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ue.map(W=>n.jsx(Ge,{role:"listitem",label:W,className:se,disabled:d,closable:B,onRemove:B?()=>Z(W):void 0},W)),pe.length>0&&n.jsx(Ge,{role:"listitem",label:`+${pe.length}`,"aria-label":ge,title:ge,className:I.mergeClasses("shrink-0",x),disabled:d}),p&&n.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[w.map((W,ee)=>n.jsx("span",{ref:q(ee),className:"inline-flex",children:n.jsx(Ge,{label:W,className:x,disabled:d,closable:B,onRemove:B?Ad:void 0})},W)),n.jsx("span",{ref:L,className:"inline-flex",children:n.jsx(Ge,{label:`+${M}`,className:x})})]})]});return n.jsx(We,{id:S,size:s,labelProps:a,caption:o,error:l,invalid:c,disabled:d,readOnly:f,value:$,placeholder:M>0?void 0:i,"aria-label":g,wrapperRef:D,onChange:W=>U(W??""),onKeyDown:te,onBlur:le,containerClassName:I.mergeClasses("w-full",m),wrapperClassName:I.mergeClasses(M>0&&["!h-auto",T?"min-h-[24px] py-0.5":"min-h-[40px] py-1.5",p?"flex-nowrap overflow-hidden":"flex-wrap"],v,j.DIAL_KIT_CLASS.tagInput),className:I.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",f&&"cursor-default"),children:fe})},Ld={[E.ElementSize.Small]:z.DIAL_ICON_SIZE.SM,[E.ElementSize.Standard]:z.DIAL_ICON_SIZE.MD,[E.ElementSize.Large]:z.DIAL_ICON_SIZE.MD},kd=({size:e=E.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:i,onChange:o,wrapperClassName:l,inputRef:c,...d})=>{const f=h.useRef(null),p=de.useMergeRefs([c,f]),g=!!i&&!a,u=h.useCallback(()=>{o?.(void 0),f.current?.focus()},[o]);return n.jsx(We,{...d,size:e,value:i,disabled:a,onChange:o,placeholder:t,inputRef:p,wrapperClassName:I.mergeClasses(r&&"dial-kit-input-borderless",l,j.DIAL_KIT_CLASS.search),iconBefore:n.jsx(F.IconSearch,{size:Ld[e],stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(R.GhostIconButton,{size:E.ElementSize.Small,"aria-label":s,icon:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:u}):void 0})},Rd=16,Md=e=>(e.toString().split(".")[1]??"").length,Pd=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:i,labelProps:o,labels:l,formatValue:c,showValue:d=!1,caption:f,error:p,onChange:g,containerClassName:u,trackClassName:m,fillClassName:v,className:x,...C})=>{const y=h.useId(),S=e??y,T=f&&!p?`${S}-caption`:void 0,D=p?`${S}-error`:void 0,N=s-r,L=N>0?Math.min(100,Math.max(0,(t-r)/N*100)):0,O=`calc(${L}% + ${(.5-L/100)*Rd}px)`,A=c?c(t):t.toFixed(Md(a)),k=h.useCallback(w=>{g?.(Number(w.target.value))},[g]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",u),children:[(o||d)&&n.jsxs("div",{className:"flex items-center gap-2",children:[o&&n.jsx(R.Label,{...o,htmlFor:S}),d&&n.jsx("span",{"aria-hidden":"true",className:I.mergeClasses("dial-small-text ml-auto",i?"text-control-disable-primary":"text-primary"),children:A})]}),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",{...C,type:"range",id:S,value:t,min:r,max:s,step:a,disabled:i,onChange:k,"aria-label":E.resolveAccessibleName(typeof o?.label!="string"?C["aria-label"]:void 0),"aria-valuetext":c?A:void 0,"aria-describedby":D??T,className:I.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",x)})]}),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(Fe,{id:D,text:p}),!p&&n.jsx(Pe,{id:T,text:f})]})]})},Fd=48,Bd=({children:e,title:t,width:r=280,collapsedWidth:s=Fd,isOpened:a,defaultOpened:i=!0,onToggle:o,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:f="Expand sidebar",className:p,titleClassName:g,contentClassName:u,footerClassName:m})=>{const v=a!==void 0,[x,C]=h.useState(i),y=v?a:x,S=`collapsible-sidebar-content-${h.useId()}`,T=y?d:f,D=N=>{const L=!y;v||C(L),o?.(L,N)};return n.jsxs("aside",{"aria-label":c,style:{width:`${y?r:s}px`},className:I.mergeClasses("flex flex-col justify-between",p,j.DIAL_KIT_CLASS.collapsibleSidebar),children:[n.jsx("div",{id:S,hidden:!y,className:I.mergeClasses("min-h-0 flex-1 overflow-auto p-4",u),children:e}),n.jsx("div",{hidden:y,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",y?"justify-end px-2":"justify-center",m),children:[y&&l,n.jsx(R.IconButton,{variant:E.ButtonVariant.Primary,appearance:E.ButtonAppearance.Ghost,size:E.ElementSize.Standard,onClick:D,"aria-label":T,"aria-expanded":y,"aria-controls":S,tooltipProps:{tooltip:T},icon:y?n.jsx(F.IconChevronsLeft,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(F.IconChevronsRight,{size:z.DIAL_ICON_SIZE.MD,stroke:ne.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},zd=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:i,ariaLabel:o,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const f=e===b.ResizableContainerSide.Left,p=f?F.IconChevronLeft:F.IconChevronRight,g=u=>{let m;switch(u.key){case"ArrowLeft":m=r+(f?i:-i);break;case"ArrowRight":m=r+(f?-i:i);break;case"Home":m=s;break;case"End":m=a;break;default:return}u.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",d),children:c??n.jsx(p,{size:z.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",f?"right-full":"left-full")})})},$d=16,ns=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:i,onResize:o,side:l=b.ResizableContainerSide.Right,keyboardStep:c=$d,ariaLabel:d="Resize panel",className:f,resizeHandlerClassName:p,resizeHandler:g})=>{const[u,m]=h.useState(!1),[v,x]=h.useState(a??t),C=s!==void 0,y=C?s:v,S=h.useRef(null),T=h.useCallback(()=>{m(!0)},[]),D=h.useCallback(()=>{m(!1);const O=S.current?.resizable?.getBoundingClientRect(),A=O?Math.round(O.width):t;C||x(A),i?.(A)},[i,C,t]),N=h.useCallback(O=>{const A=Math.min(r,Math.max(t,O));A!==y&&(C||(x(A),S.current?.updateSize({width:A,height:"100%"})),o?.(A),i?.(A))},[r,t,y,C,o,i]),L=h.useMemo(()=>{const O=l===b.ResizableContainerSide.Left,A=n.jsx(zd,{side:l,isResizing:u,width:y,minWidth:t,maxWidth:r,step:c,ariaLabel:d,onWidthChange:N,customHandler:g,handlerClassName:p});return{size:C?{width:y,height:"100%"}:void 0,defaultSize:C?void 0:{width:y,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?A:void 0,right:O?void 0:A},onResizeStart:T,onResize:(k,w,M)=>{o?.(Math.round(M.offsetWidth))},onResizeStop:D}},[l,C,y,t,r,c,d,N,g,p,u,T,D,o]);return n.jsx(b.Resizable,{ref:S,...L,children:n.jsx("div",{className:I.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",f,j.DIAL_KIT_CLASS.resizableContainer),children:e})})},Hd=({enabled:e=!0,children:t,...r})=>e?n.jsx(ns,{...r,children:t}):t;var je=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(je||{});const ss=8e3,dt="flex size-7 shrink-0 items-center justify-center",as={cancelItemAriaLabel:e=>`Cancel "${e}"`,itemProgressAriaLabel:e=>`"${e}" in progress`,successLabel:"Completed",canceledLabel:"Canceled",failedMessage:"Failed",warningMessage:"Completed with warnings",queueProgressAriaLabel:"Progress",queueProgressValueText:(e,t)=>`${e} of ${t}`,collapseAriaLabel:"Collapse",expandAriaLabel:"Expand",closeAriaLabel:"Close",closeConfirmHeader:"Close?",closeConfirmDescriptionInProgress:"Some items are still in progress.",closeConfirmDescriptionFailed:"Some items have failed.",closeConfirmDescriptionMixed:"Some items are still in progress, and some have failed.",closeConfirmLabel:"Close",closeCancelLabel:"Cancel"},Vd=({title:e,failedCount:t,isCollapsed:r,itemsId:s,labels:a,onToggleCollapse:i,onClose:o})=>{const l=r?F.IconChevronUp:F.IconChevronDown;return n.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"dial-small-paragraph-semi-text truncate text-primary",children:e}),t>0&&n.jsx("span",{className:"dial-small-paragraph-semi-text inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-control-error px-1 text-control-permanent",children:t})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[n.jsx(R.GhostIconButton,{"aria-label":r?a.expandAriaLabel:a.collapseAriaLabel,"aria-expanded":!r,"aria-controls":s,size:E.ElementSize.Small,icon:n.jsx(l,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:i,className:dt}),n.jsx(R.GhostIconButton,{"aria-label":a.closeAriaLabel,size:E.ElementSize.Small,icon:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:dt})]})]})},nn=({message:e,isError:t})=>{const r=t?F.IconAlertCircleFilled:F.IconAlertTriangleFilled;return n.jsx(R.Tooltip,{tooltip:e,asChild:!0,children:n.jsx("span",{className:dt,role:"img","aria-label":e,tabIndex:0,children:n.jsx(r,{size:z.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},Kd=({item:e,labels:t,onCancel:r})=>{const s=e.status===je.Canceled;return n.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[n.jsx(yr,{type:b.DialItemType.File,name:e.name,size:z.DIAL_ICON_SIZE.MD,className:I.mergeClasses(s&&"opacity-50"),decorative:!0}),n.jsx(R.EllipsisTooltip,{text:e.name,className:I.mergeClasses("dial-small-text",s?"text-secondary":"text-primary")}),e.status===je.InProgress&&n.jsxs("div",{className:I.mergeClasses(dt,"grid"),children:[n.jsx(b.Spinner,{size:z.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:I.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0")}),r&&n.jsx(R.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:E.ElementSize.Small,icon:n.jsx(F.IconX,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===je.Success&&n.jsx("span",{className:dt,role:"img","aria-label":t.successLabel,children:n.jsx(F.IconCheck,{size:z.DIAL_ICON_SIZE.SM,stroke:ne.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===je.Warning&&n.jsx(nn,{message:e.message||t.warningMessage,isError:!1}),e.status===je.Failed&&n.jsx(nn,{message:e.message||t.failedMessage,isError:!0}),s&&n.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},Gd=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===je.InProgress?0:100)),0)/e.length),Ud=(e,t,r)=>e&&t?r.closeConfirmDescriptionMixed:t?r.closeConfirmDescriptionFailed:r.closeConfirmDescriptionInProgress,Zd=({title:e,items:t,onClose:r,onCancelItem:s,labels:a,autoCloseDelay:i=ss,className:o,bodyClassName:l})=>{const[c,d]=h.useState(!1),[f,p]=h.useState(!1),g=h.useId(),u={...as,...a},m=t.filter(N=>N.status===je.InProgress).length,v=m>0,x=t.filter(N=>N.status===je.Failed).length,C=x>0,y=t.length>0&&t.every(N=>N.status===je.Success),S=h.useCallback(()=>{v||C?p(!0):r()},[v,C,r]),T=h.useCallback(()=>{p(!1),r()},[r]),D=h.useCallback(()=>{d(N=>!N)},[]);return h.useEffect(()=>{if(!y||i<=0)return;const N=setTimeout(r,i);return()=>clearTimeout(N)},[y,i,r]),t.length===0?null:n.jsxs("div",{role:"status","aria-live":"polite",className:I.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",o,j.DIAL_KIT_CLASS.transferQueue),children:[n.jsx(Vd,{title:e,failedCount:x,isCollapsed:c,itemsId:g,labels:u,onToggleCollapse:D,onClose:S}),c&&v&&n.jsx(ln,{value:Gd(t),size:E.ElementSize.Small,"aria-label":u.queueProgressAriaLabel,"aria-valuetext":u.queueProgressValueText(t.length-m,t.length)}),!c&&n.jsx("div",{id:g,className:I.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(N=>n.jsx(Kd,{item:N,labels:u,onCancel:s},N.id))}),n.jsx(Jn,{open:f,header:u.closeConfirmHeader,description:Ud(v,C,u),confirmLabel:u.closeConfirmLabel,cancelLabel:u.closeCancelLabel,variant:b.ConfirmationPopupVariant.Danger,onConfirm:T,onClose:()=>p(!1)})]})};exports.ConfirmationPopupVariant=b.ConfirmationPopupVariant;exports.DialBreadcrumb=b.DialBreadcrumb;exports.DialBreadcrumbItem=b.DialBreadcrumbItem;exports.DialButton=b.DialButton;exports.DialButtonDropdown=b.DialButtonDropdown;exports.DialCaptionText=b.DialCaptionText;exports.DialCollapsibleSidebar=b.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=b.DialConditionalResizableContainer;exports.DialConfirmationPopup=b.DialConfirmationPopup;exports.DialDangerButton=b.DialDangerButton;exports.DialDestinationFolderPopup=b.DialDestinationFolderPopup;exports.DialErrorText=b.DialErrorText;exports.DialFileIcon=b.DialFileIcon;exports.DialFileManager=b.DialFileManager;exports.DialFileManagerActions=b.DialFileManagerActions;exports.DialFileManagerTabs=b.DialFileManagerTabs;exports.DialFileName=b.DialFileName;exports.DialFileNodeType=b.DialFileNodeType;exports.DialFilePermission=b.DialFilePermission;exports.DialFileResourceType=b.DialFileResourceType;exports.DialFolderName=b.DialFolderName;exports.DialFoldersTree=b.DialFoldersTree;exports.DialFormItem=b.DialFormItem;exports.DialGhostButton=b.DialGhostButton;exports.DialInput=b.DialInput;exports.DialItemType=b.DialItemType;exports.DialLinkButton=b.DialLinkButton;exports.DialLoader=b.DialLoader;exports.DialNeutralButton=b.DialNeutralButton;exports.DialNotification=b.DialNotification;exports.DialPopup=b.DialPopup;exports.DialPrimaryButton=b.DialPrimaryButton;exports.DialRadioGroup=b.DialRadioGroup;exports.DialResizableContainer=b.DialResizableContainer;exports.DialSearch=b.DialSearch;exports.DialSharedEntityIndicator=b.DialSharedEntityIndicator;exports.DialTabs=b.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=b.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=b.FileManagerColumnKey;exports.FileManagerProvider=b.FileManagerProvider;exports.FlexibleActionsDirection=b.FlexibleActionsDirection;exports.FormItemOrientation=b.FormItemOrientation;exports.NAME_COLUMN=b.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=b.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=b.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=b.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=b.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=b.NotificationType;exports.NotificationVariant=b.NotificationVariant;exports.PopupSize=b.PopupSize;exports.RadioGroupOrientation=b.RadioGroupOrientation;exports.ResizableContainerSide=b.ResizableContainerSide;exports.SIZE_COLUMN=b.SIZE_COLUMN;exports.ScreenResolution=b.ScreenResolution;exports.Skeleton=b.Skeleton;exports.SkeletonAvatarShape=b.SkeletonAvatarShape;exports.SkeletonAvatarSize=b.SkeletonAvatarSize;exports.SkeletonVariant=b.SkeletonVariant;exports.Spinner=b.Spinner;exports.TabOrientation=b.TabOrientation;exports.TabView=b.TabView;exports.UPDATED_AT_COLUMN=b.UPDATED_AT_COLUMN;exports.editableContainerProps=b.editableContainerProps;exports.useDialFileManagerTabs=b.useDialFileManagerTabs;exports.useEditableItem=b.useEditableItem;exports.useFileManagerContext=b.useFileManagerContext;exports.DialLabel=ke.DialLabel;exports.DialSwitch=ke.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=j.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=j.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=j.DIAL_KIT_CLASS;exports.DialCloseButton=j.DialCloseButton;exports.DialDangerIconButton=j.DialDangerIconButton;exports.DialDateCellRenderer=j.DialDateCellRenderer;exports.DialDropdown=j.DialDropdown;exports.DialEllipsisTooltip=j.DialEllipsisTooltip;exports.DialGhostIconButton=j.DialGhostIconButton;exports.DialGrid=j.DialGrid;exports.DialIcon=j.DialIcon;exports.DialNeutralIconButton=j.DialNeutralIconButton;exports.DialNoDataContent=j.DialNoDataContent;exports.DialPrimaryIconButton=j.DialPrimaryIconButton;exports.DialRadioButton=j.DialRadioButton;exports.DialSecondaryIconButton=j.DialSecondaryIconButton;exports.DialSuccessIconButton=j.DialSuccessIconButton;exports.DialTertiaryIconButton=j.DialTertiaryIconButton;exports.DropdownItemType=j.DropdownItemType;exports.DropdownTrigger=j.DropdownTrigger;exports.DropdownType=j.DropdownType;exports.GridSelectionMode=j.GridSelectionMode;exports.ThemeScope=j.ThemeScope;exports.baseColumnComparator=j.baseColumnComparator;exports.checkColDefsChanges=j.checkColDefsChanges;exports.convertGridDateToDate=j.convertToDate;exports.convertToDate=j.convertToDate;exports.useThemeScope=j.useThemeScope;exports.BASE_ICON_PROPS=z.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=z.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=z.DIAL_ICON_SIZE;exports.mergeClasses=I.mergeClasses;exports.Checkbox=R.Checkbox;exports.CheckboxBox=R.CheckboxBox;exports.CloseButton=R.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=R.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=R.DEFAULT_LOCALE;exports.DangerIconButton=R.DangerIconButton;exports.DateCellRenderer=R.DateCellRenderer;exports.Dropdown=R.Dropdown;exports.EllipsisTooltip=R.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=R.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=R.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=R.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=R.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=R.GRID_THEME_PARAMS;exports.GhostIconButton=R.GhostIconButton;exports.Grid=R.Grid;exports.IconButton=R.IconButton;exports.InfoButton=R.InfoButton;exports.InteractiveTooltip=R.InteractiveTooltip;exports.Label=R.Label;exports.MenuItem=R.MenuItem;exports.MenuItemMark=R.MenuItemMark;exports.NeutralIconButton=R.NeutralIconButton;exports.NoDataContent=R.NoDataContent;exports.PrimaryIconButton=R.PrimaryIconButton;exports.Radio=R.Radio;exports.StaticIconButton=R.StaticIconButton;exports.Tooltip=R.Tooltip;exports.TooltipContainer=R.TooltipContainer;exports.TooltipContent=R.TooltipContent;exports.TooltipPlacement=R.TooltipPlacement;exports.TooltipTrigger=R.TooltipTrigger;exports.ButtonAppearance=E.ButtonAppearance;exports.ButtonVariant=E.ButtonVariant;exports.DialIconButton=E.DialIconButton;exports.DialTooltip=E.DialTooltip;exports.DialTooltipContainer=E.DialTooltipContainer;exports.DialTooltipContent=E.DialTooltipContent;exports.DialTooltipTrigger=E.DialTooltipTrigger;exports.ElementSize=E.ElementSize;exports.EditorThemes=ut.EditorThemes;exports.LazyDialJsonEditor=ut.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=ut.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=ut.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ne.DIAL_KIT_ICON_STROKE;exports.Accordion=Fc;exports.AccordionCaretPosition=St;exports.AnalyticsCardVariant=ot;exports.Breadcrumbs=$l;exports.BreadcrumbsSize=Ze;exports.Button=nt;exports.ButtonDropdown=Wl;exports.Calendar=Tl;exports.CalendarMode=be;exports.CaptionText=Pe;exports.CardShell=Jo;exports.CollapsibleSidebar=Bd;exports.ConditionalResizableContainer=Hd;exports.ConfirmationPopup=Jn;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=ir;exports.DEFAULT_TRANSFER_QUEUE_LABELS=as;exports.DangerButton=Hl;exports.DialAccordion=sn;exports.DialAnalyticsBar=mt;exports.DialAnalyticsBarGroup=xs;exports.DialAnalyticsCard=gs;exports.DialAnalyticsErrorTag=ar;exports.DialAnalyticsHistogram=Ds;exports.DialAutocompleteInputValue=yn;exports.DialCheckbox=Yt;exports.DialDraggableItem=Ri;exports.DialDropdownIcon=jo;exports.DialFormPopup=Wi;exports.DialInputPopup=Dn;exports.DialLabelledText=Ls;exports.DialLoadFileArea=An;exports.DialLoadFileAreaField=No;exports.DialNumberInput=tr;exports.DialPagination=Ts;exports.DialPasswordInput=In;exports.DialRadioGroupPopupField=Ki;exports.DialRemoveButton=Ot;exports.DialSchemaRenderer=Uo;exports.DialSegmentedControl=Hi;exports.DialSelect=Te;exports.DialSelectField=io;exports.DialSlider=_s;exports.DialSteps=As;exports.DialTag=Ke;exports.DialTagInput=vn;exports.DialTextarea=Mi;exports.ErrorMessageNotification=il;exports.ErrorText=Fe;exports.ErrorToastNotification=el;exports.FabButton=Ul;exports.FileDropzone=hd;exports.FileIcon=yr;exports.FileName=rs;exports.FilterChips=gd;exports.FolderName=jd;exports.FolderPath=wl;exports.GeneralMessageNotification=ul;exports.GeneralToastNotification=al;exports.GhostButton=Kl;exports.Highlight=Qo;exports.InfoMessageNotification=ol;exports.InfoToastNotification=tl;exports.InlineSelect=ql;exports.InlineSelectTrigger=Zn;exports.Input=We;exports.JsonSchemaType=V;exports.LinkButton=Vl;exports.LoadingMessageNotification=dl;exports.LoadingToastNotification=sl;exports.MultiSelectTags=Xn;exports.NeutralButton=Cr;exports.Notification=mr;exports.NumberInput=Sc;exports.OutlinedButton=Gl;exports.PasswordInput=vc;exports.Popup=vr;exports.PrimaryButton=Un;exports.ProgressBar=ln;exports.RadioGroup=es;exports.RadioGroupPopupField=Qc;exports.ResizableContainer=ns;exports.SchemaDisplayMode=lt;exports.SchemaOrientation=_t;exports.SchemaRendererVariant=Je;exports.Search=kd;exports.SegmentedControl=cd;exports.Select=xc;exports.SelectSize=vt;exports.SelectVariant=yt;exports.SharedEntityIndicator=ts;exports.Slider=Pd;exports.StepStatus=Ce;exports.SuccessMessageNotification=ll;exports.SuccessToastNotification=rl;exports.Switch=Bc;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=ss;exports.Tabs=ud;exports.Tag=Ge;exports.TagAppearance=qe;exports.TagInput=_d;exports.Textarea=Cc;exports.TextareaResize=Qn;exports.ToggleIconButton=Jc;exports.TransferQueue=Zd;exports.TransferQueueItemStatus=je;exports.WarningMessageNotification=cl;exports.WarningToastNotification=nl;exports.getTimezoneLabel=_n;exports.matchesAccept=sr;exports.wrapInRootFolder=_o;