@epam/ai-dial-ui-kit 0.15.0-dev.6 → 0.15.0-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -0
- package/dist/CHANGELOG.md +12 -0
- package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-Bu40QyHE.cjs} +26 -26
- package/dist/DateCellRenderer-C3e61i75.cjs +1 -0
- package/dist/components/Dropdown/Dropdown.js +70 -65
- package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
- package/dist/components/Dropdown/constants.js +14 -12
- package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
- package/dist/components/New/Accordion/Accordion.js +39 -37
- package/dist/components/New/ButtonDropdown/ButtonDropdown.js +7 -6
- package/dist/components/New/Calendar/Calendar.js +253 -222
- package/dist/components/New/CaptionText/CaptionText.js +18 -15
- package/dist/components/New/CardShell/CardShell.js +4 -2
- package/dist/components/New/Checkbox/Checkbox.js +67 -56
- package/dist/components/New/Checkbox/CheckboxBox.js +4 -2
- package/dist/components/New/CloseButton/CloseButton.js +18 -16
- package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
- package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +44 -39
- package/dist/components/New/Dropdown/Dropdown.js +101 -95
- package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +19 -17
- package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
- package/dist/components/New/FilterChips/FilterChips.js +43 -0
- package/dist/components/New/FilterChips/constants.js +5 -0
- package/dist/components/New/FolderPath/FolderPath.js +29 -28
- package/dist/components/New/Highlight/Highlight.js +23 -30
- package/dist/components/New/InfoButton/InfoButton.js +12 -10
- package/dist/components/New/InlineSelect/InlineSelect.js +43 -41
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +40 -38
- package/dist/components/New/Label/Label.js +13 -8
- package/dist/components/New/MenuItem/MenuItem.js +29 -27
- package/dist/components/New/MenuItem/constants.js +9 -8
- package/dist/components/New/NoDataContent/NoDataContent.js +20 -18
- package/dist/components/New/Notification/Notification.js +18 -16
- package/dist/components/New/NumberInput/NumberInput.js +42 -33
- package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
- package/dist/components/New/Popup/Popup.js +45 -43
- package/dist/components/New/Radio/Radio.js +75 -64
- package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
- package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
- package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
- package/dist/components/New/Search/Search.js +28 -26
- package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
- package/dist/components/New/Select/Select.js +120 -109
- package/dist/components/New/Switch/Switch.js +69 -58
- package/dist/components/New/Tabs/Tabs.js +28 -22
- package/dist/components/New/Tag/Tag.js +42 -40
- package/dist/components/New/TagInput/TagInput.js +44 -42
- package/dist/components/New/ToggleIconButton/ToggleIconButton.js +25 -23
- package/dist/components/New/Tooltip/TooltipContent.js +10 -8
- package/dist/components/ProgressBar/ProgressBar.js +45 -31
- package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
- package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
- package/dist/components/SchemaRenderer/types.js +19 -8
- package/dist/components/SchemaRenderer/utils.js +121 -96
- package/dist/components/Skeleton/Skeleton.js +25 -19
- package/dist/components/Spinner/Spinner.js +6 -4
- package/dist/components-manifest.json +85 -2
- package/dist/constants/public-class-names.js +157 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +214 -210
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
- package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
- package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
- package/dist/src/components/SchemaRenderer/utils.d.ts +5 -1
- package/dist/src/constants/public-class-names.d.ts +148 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/use-file-manager-tabs-9DWkp9IJ.cjs +3 -0
- package/package.json +1 -1
- package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
- package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
package/dist/dial-ui-kit.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./use-file-manager-tabs-DjdR_mYM.cjs"),Ae=require("./Switch-CUKClcEz.cjs"),n=require("react/jsx-runtime"),h=require("react"),$=require("@tabler/icons-react"),ae=require("classnames"),M=require("./DateCellRenderer-BVM-Q8yx.cjs"),H=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-Dipy1Ih1.cjs"),P=require("./DateCellRenderer-ssp7eaZY.cjs"),T=require("./IconButton-DWqoaBWf.cjs"),Wn=require("react-dom"),ot=require("./lazy-tfN4sKhq.cjs"),le=require("@floating-ui/react"),ie=require("./icon-DhjrDQ8I.cjs");function qn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const gr=qn(h),He=({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(M.DialIcon,{icon:r}),n.jsx(M.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(b.DialButton,{className:"p-0",iconAfter:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},Jt=({label:e="Error",className:t})=>n.jsx(He,{label:e,className:I.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var st=(e=>(e.Default="default",e.Compact="compact",e))(st||{});const Zn={[st.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[st.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},Yn=({title:e,value:t,description:r,variant:s=st.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:d,compareValues:u})=>{const p=Zn[s],g=c!==void 0?c:(l??0)>=0,f=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:f})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(Jt,{className:"self-start"}):i?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-start"}):u?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(M.DialEllipsisTooltip,{text:u[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:u[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(M.DialEllipsisTooltip,{text:u[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:u[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})]})},er=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],Xn=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Qn=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},ut=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=er,className:l,titleClassName:c,valueClassName:d,inline:u,ariaLabel:p})=>{const g=e==null,f=!!(r||s||!g),m=Xn(g?0:e,t),v=Qn(m,o),x=i??(g?"—":e),y=p??(typeof a=="string"?a:void 0),D=r||s,N=r?n.jsx(Jt,{}):s?n.jsx(b.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",u?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",d),children:x}),S=f?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":y,className:I.mergeClasses("w-full overflow-hidden rounded-sm",u?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!D&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:v}})}):null,C=n.jsx("span",{className:I.mergeClasses("dial-small-text text-primary",c),children:a});return u?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:C}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:S}),N]})]}):n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[C,N]}),S]})},Ur=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:d,contentClassName:u})=>{const p=s!==void 0,[g,f]=h.useState(a),m=o?!0:p?s:g,v=h.useId(),x=()=>{if(i)return;const y=!m;p||f(y),l?.(y)};return n.jsxs("div",{className:I.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":v,disabled:i||o,onClick: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(M.DialIcon,{className:ae("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx($.IconChevronRight,{size:H.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",u),children:r})]})},Jn=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:u,onBarClick:p,inline:g,barTitleClassName:f,barValueClassName:m,barClassName:v,barDescriptions:x,className:y})=>{const D=Object.entries(s),N=g?I.mergeClasses("text-secondary",f):f,S=i?"dial-tiny-text text-secondary":void 0,C=t?n.jsx(T.DialTooltip,{tooltip:t,children:e}):e,E=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],R="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",A="group flex flex-col gap-1.5",O=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(Ur,{title:C,description:r,defaultExpanded:c,nonCollapsible:d,className:y,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:u?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-center"}):a?E.map(_=>{const j=_ in s?s[_]:null,k=_ in a?a[_]:null,G=typeof j=="number"&&typeof k=="number"?parseFloat((k-j).toFixed(3)):null,te=G!=null&&G!==0,U=te&&G>0,B=te?U?`+${G}`:String(G):null,z=x?.[_],q=n.jsx("span",{className:"dial-small-text text-secondary",children:_}),V=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[z?n.jsx(T.DialTooltip,{tooltip:z,children:q}):q,B!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",U?"bg-success text-success":"bg-error text-error"),children:B})]}),n.jsxs("div",{className:O,children:[n.jsx(ut,{title:i?.[0],value:j,maxValue:o,colorMap:l,inline:g,titleClassName:S,ariaLabel:_}),n.jsx(ut,{title:i?.[1],value:k,maxValue:o,colorMap:l,inline:g,titleClassName:S,ariaLabel:`${_} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(_,j),className:I.mergeClasses(A,R),children:V},_):n.jsx("div",{className:A,children:V},_)}):D.map(([_,j])=>{const k=n.jsx(ut,{title:_,value:j,maxValue:o,colorMap:l,inline:g,titleClassName:N,valueClassName:m,className:v}),F=p?n.jsx("button",{type:"button",onClick:()=>p(_,j),className:R,children:k}):k,G=x?.[_];return G?n.jsx(T.DialTooltip,{tooltip:G,triggerClassName:"flex flex-col",children:F},_):n.jsx(h.Fragment,{children:F},_)})})})},es="#FF4E50",ts=(e,t)=>{let r=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=a)}),r},hr=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=ts(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:es,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]},Kr=e=>e<=0?2:e%2===0?e:e+1,rs=e=>{const t=Kr(e);return[t,t/2,0]},Ot=e=>`${Math.round(e*100)/100}`,Wr=(e,t)=>e===t?Ot(e):`${Ot(e)}-${Ot(t)}`,At=128,ns=(e,t)=>{const r=Wr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},mr=(e,t,r,s,a)=>n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&n.jsx("strong",{children:e}),n.jsxs("span",{children:[t," out of ",r," ",s]}),n.jsx("span",{children:ns(a.from,a.to)})]}),ss=({title:e,values:t,colorMap:r=er,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const u=hr(t,r),p=l?hr(l,r):void 0,g=t.length,f=l?.length??0,m=Math.max(g,f),v=Kr(m),x=rs(m),y=C=>C.map(E=>({...E,ratio:v>0?E.count/v:0})),D=y(u),N=p?y(p):void 0,S=(C,E,R,A)=>{if(C.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:`${C.ratio*100}%`}})});const O=A?{backgroundImage:`repeating-linear-gradient(135deg, ${C.color} 0px, ${C.color} 1px, transparent 1px, transparent 4px)`,borderColor:C.color}:{backgroundColor:C.color};return n.jsx(T.DialTooltip,{placement:"bottom",tooltip:E,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":R,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${C.ratio*100}%`,...O},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:C.count})})})};return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",o),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),i?n.jsx("div",{className:"flex items-center justify-center",style:{height:At},children:n.jsx(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:At},children:x.map((C,E)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${E/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:C},C))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((C,E)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${E/(x.length-1)*100}%`}},C)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:At},children:N?D.map((C,E)=>{const R=N[E],A=`${C.count} out of ${g} ${s}`,O=`${R.count} out of ${f} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[S(C,mr(c,C.count,g,s,C),A,!0),S(R,mr(d,R.count,f,s,R),O,!1)]},E)}):D.map((C,E)=>{const R=`${C.count} out of ${g} ${s}`;return C.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:`${C.ratio*100}%`}})},E):n.jsx(T.DialTooltip,{placement:"bottom",tooltip:R,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":R,className:I.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${C.ratio*100}%`,backgroundColor:C.color},children:a&&C.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:C.count})})},E)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:D.map((C,E)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Wr(C.from,C.to)},E))})]})]})},as=({value:e,max:t=100,size:r=T.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const d=h.useId(),u=i??d,p=!!s?.label,g=p?s?.id??`${u}-label`:void 0,f=t>0?t:0,m=Number.isFinite(e)?e:0,v=Math.min(Math.max(m,0),f),x=f>0?v/f*100:0,y=n.jsx("div",{...c,id:u,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":f,"aria-labelledby":g,"aria-label":T.resolveAccessibleName(l,p?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===T.ElementSize.Small?"h-1":"h-2",o),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?y:n.jsxs("div",{className:"flex w-full flex-col gap-1",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(P.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),y]})},is=7,os=2,ls=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var ft=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(ft||{});const cs=(e,t,r)=>e===t?"active":r<is||Math.abs(e-t)<=os?"adjacent":"far",ds=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=ls(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(T.DialIconButton,{icon:n.jsx($.IconCaretLeftFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.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=cs(i,e,t);return n.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":`Page ${i}`,"aria-current":i===e?"page":void 0,className:I.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",o===ft.Active&&"h-[8px] w-[32px]",o===ft.Adjacent&&"size-[8px]",o===ft.Far&&"size-[4px]")},i)})}),n.jsx(T.DialIconButton,{icon:n.jsx($.IconCaretRightFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Gt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const d=h.useCallback(f=>{o?.(f.target.checked,t)},[o,t]),u=ae("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=ae("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx($.IconMinus,{className:p,...H.BASE_ICON_PROPS}):r?n.jsx($.IconCheck,{className:p,...H.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:u,htmlFor:t,"aria-description":c["aria-description"]||M.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(M.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 ve=(e=>(e.VALID="valid",e.ERROR="error",e))(ve||{});const us=(e,t)=>{if(t===e.id)switch(e.status){case ve.VALID:return"border-accent-secondary text-primary";case ve.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case ve.VALID:return"border-primary text-primary";case ve.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},fs=(e,t)=>{if(t===e.id)switch(e.status){case ve.VALID:return"bg-accent-secondary";case ve.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case ve.VALID:return"bg-accent-secondary";case ve.ERROR:return"bg-red-400";default:return"bg-layer-4"}},ps=({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===ve.ERROR?n.jsx($.IconExclamationCircle,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===ve.VALID?n.jsx($.IconCheck,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:ae(a,us(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:ae(i,fs(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},gs=({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===ve.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(ps,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},_t=e=>(e.toString().split(".")[1]??"").length,hs=({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:u,fillClassName:p,thumbClassName:g,labelsClassName:f,"aria-label":m,"aria-labelledby":v,...x})=>{const y=h.useRef(null),D=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),N=_t(s),S=l?l(e):e.toFixed(N),C=h.useCallback(O=>{const _=y.current;if(!_)return e;const j=_.getBoundingClientRect(),k=(O-j.left)/j.width,F=t+k*(r-t),G=_t(s),te=parseFloat((Math.round((F-t)/s)*s+t).toFixed(G));return Math.min(r,Math.max(t,te))},[t,r,s,e]),E=h.useCallback(O=>{a||(O.currentTarget.setPointerCapture(O.pointerId),c?.(C(O.clientX)))},[a,C,c]),R=h.useCallback(O=>{a||O.buttons===0||c?.(C(O.clientX))},[a,C,c]),A=h.useCallback(O=>{if(a)return;const _=_t(s),j=G=>parseFloat((Math.round((G-t)/s)*s+t).toFixed(_)),k=G=>Math.min(r,Math.max(t,G));let F=e;switch(O.key){case"ArrowRight":case"ArrowUp":F=k(j(e+s));break;case"ArrowLeft":case"ArrowDown":F=k(j(e-s));break;case"Home":F=t;break;case"End":F=r;break;default:return}O.preventDefault(),F!==e&&c?.(F)},[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(Ae.DialLabel,{...i,htmlFor:x.id}),n.jsxs("div",{ref:y,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:E,onPointerMove:R,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",u)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${D}%`}}),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:`${D}%`},onKeyDown:A,children:S})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",f),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]})]})})]})},ms=({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(T.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),qr=h.createContext({dragDropManager:void 0});function De(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var xr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),br=function(){return Math.random().toString(36).substring(7).split("").join(".")},vr={INIT:"@@redux/INIT"+br(),REPLACE:"@@redux/REPLACE"+br()};function xs(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 bs(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(Ds(e))return"date";if(ys(e))return"error";var r=vs(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function vs(e){return typeof e.constructor=="function"?e.constructor.name:null}function ys(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ds(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ke(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=bs(e)),t}function Zr(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"?De(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"?De(1):"Expected the enhancer to be a function. Instead, received: '"+Ke(r)+"'");return r(Zr)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?De(2):"Expected the root reducer to be a function. Instead, received: '"+Ke(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function d(){l===o&&(l=o.slice())}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?De(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"?De(4):"Expected the listener to be a function. Instead, received: '"+Ke(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?De(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"?De(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 D=l.indexOf(v);l.splice(D,1),o=null}}}function g(v){if(!xs(v))throw new Error(process.env.NODE_ENV==="production"?De(7):"Actions must be plain objects. Instead, the actual type was: '"+Ke(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"?De(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"?De(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,v)}finally{c=!1}for(var x=o=l,y=0;y<x.length;y++){var D=x[y];D()}return v}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?De(10):"Expected the nextReducer to be a function. Instead, received: '"+Ke(v));a=v,g({type:vr.REPLACE})}function m(){var v,x=p;return v={subscribe:function(D){if(typeof D!="object"||D===null)throw new Error(process.env.NODE_ENV==="production"?De(11):"Expected the observer to be an object. Instead, received: '"+Ke(D)+"'");function N(){D.next&&D.next(u())}N();var S=x(N);return{unsubscribe:S}}},v[xr]=function(){return this},v}return g({type:vr.INIT}),s={dispatch:g,subscribe:p,getState:u,replaceReducer:f},s[xr]=m,s}function Z(e,t,...r){if(Cs()&&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 Cs(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Ns(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function Is(e,t){return e.filter(r=>r!==t)}function Yr(e){return typeof e=="object"}function Ss(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 js(e,t){return e.filter(r=>t.indexOf(r)>-1)}const tr="dnd-core/INIT_COORDS",vt="dnd-core/BEGIN_DRAG",rr="dnd-core/PUBLISH_DRAG_SOURCE",yt="dnd-core/HOVER",Dt="dnd-core/DROP",Ct="dnd-core/END_DRAG";function yr(e,t){return{type:tr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Ts={type:tr,payload:{clientOffset:null,sourceClientOffset:null}};function ws(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(yr(i)),Es(r,l,c);const d=_s(r,l);if(d==null){e.dispatch(Ts);return}let u=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");Os(o),u=o(d)}e.dispatch(yr(i,u));const g=c.getSource(d).beginDrag(l,d);if(g==null)return;As(g),c.pinSource(d);const f=c.getSourceType(d);return{type:vt,payload:{itemType:f,item:g,sourceId:d,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!a}}}}function Es(e,t,r){Z(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){Z(r.getSource(s),"Expected sourceIds to be registered.")})}function Os(e){Z(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function As(e){Z(Yr(e),"Item must be an object.")}function _s(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 Rs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ks(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){Rs(e,a,r[a])})}return e}function Ps(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();Ls(s),Bs(s).forEach((o,l)=>{const c=Ms(o,l,a,s),d={type:Dt,payload:{dropResult:ks({},r,c)}};e.dispatch(d)})}}function Ls(e){Z(e.isDragging(),"Cannot call drop while not dragging."),Z(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Ms(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return Fs(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function Fs(e){Z(typeof e>"u"||Yr(e),"Drop result must either be an object or undefined.")}function Bs(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function zs(e){return function(){const r=e.getMonitor(),s=e.getRegistry();$s(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Ct}}}function $s(e){Z(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ut(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Hs(e){return function(r,{clientOffset:s}={}){Vs(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return Us(a,o,l),Gs(a,i,o),Ks(a,i,o),{type:yt,payload:{targetIds:a,clientOffset:s||null}}}}function Vs(e){Z(Array.isArray(e),"Expected targetIds to be an array.")}function Gs(e,t,r){Z(t.isDragging(),"Cannot call hover while not dragging."),Z(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];Z(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);Z(i,"Expected targetIds to be registered.")}}function Us(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Ut(i,r)||e.splice(s,1)}}function Ks(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Ws(e){return function(){if(e.getMonitor().isDragging())return{type:rr}}}function qs(e){return{beginDrag:ws(e),publishDragSource:Ws(e),hover:Hs(e),drop:Ps(e),endDrag:zs(e)}}class Zs{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=qs(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 Ys(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Xr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xs(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Xr(Ys(t,s),r)}function Qs(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Xr(t,r)}const rt=[],nr=[];rt.__IS_NONE__=!0;nr.__IS_ALL__=!0;function Js(e,t){return e===rt?!1:e===nr||typeof t>"u"?!0:js(t,e).length>0}class ea{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;Z(typeof t=="function","listener must be a function."),Z(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&&!Js(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){Z(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 Z(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(Z(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return Ut(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Z(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:s}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),i=this.getItemType();if(i&&!Ut(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const l=o.indexOf(t);return s?l===o.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xs(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Qs(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Dr=typeof global<"u"?global:self,Qr=Dr.MutationObserver||Dr.WebKitMutationObserver;function Jr(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function ta(e){let t=1;const r=new Qr(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const ra=typeof Qr=="function"?ta:Jr;class na{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=ra(this.flush),this.requestErrorThrow=Jr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class sa{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 aa{create(t){const r=this.freeTasks,s=r.length?r.pop():new sa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const en=new na,ia=new aa(en.registerPendingError);function oa(e){en.enqueueTask(ia.create(e))}const sr="dnd-core/ADD_SOURCE",ar="dnd-core/ADD_TARGET",ir="dnd-core/REMOVE_SOURCE",Nt="dnd-core/REMOVE_TARGET";function la(e){return{type:sr,payload:{sourceId:e}}}function ca(e){return{type:ar,payload:{targetId:e}}}function da(e){return{type:ir,payload:{sourceId:e}}}function ua(e){return{type:Nt,payload:{targetId:e}}}function fa(e){Z(typeof e.canDrag=="function","Expected canDrag to be a function."),Z(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Z(typeof e.endDrag=="function","Expected endDrag to be a function.")}function pa(e){Z(typeof e.canDrop=="function","Expected canDrop to be a function."),Z(typeof e.hover=="function","Expected hover to be a function."),Z(typeof e.drop=="function","Expected beginDrag to be a function.")}function Kt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Kt(r,!1));return}Z(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 Ce;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ce||(Ce={}));let ga=0;function ha(){return ga++}function ma(e){const t=ha().toString();switch(e){case Ce.SOURCE:return`S${t}`;case Ce.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Cr(e){switch(e[0]){case"S":return Ce.SOURCE;case"T":return Ce.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Nr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,i]}=r.next();if(i===t)return!0;s=!!a}while(!s);return!1}class xa{addSource(t,r){Kt(t),fa(r);const s=this.addHandler(Ce.SOURCE,t,r);return this.store.dispatch(la(s)),s}addTarget(t,r){Kt(t,!0),pa(r);const s=this.addHandler(Ce.TARGET,t,r);return this.store.dispatch(ca(s)),s}containsHandler(t){return Nr(this.dragSources,t)||Nr(this.dropTargets,t)}getSource(t,r=!1){return Z(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Z(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Cr(t)===Ce.SOURCE}isTargetId(t){return Cr(t)===Ce.TARGET}removeSource(t){Z(this.getSource(t),"Expected an existing source."),this.store.dispatch(da(t)),oa(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Z(this.getTarget(t),"Expected an existing target."),this.store.dispatch(ua(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Z(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Z(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=ma(t);return this.types.set(a,r),t===Ce.SOURCE?this.dragSources.set(a,s):t===Ce.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 ba=(e,t)=>e===t;function va(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function ya(e,t,r=ba){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 Da(e=rt,t){switch(t.type){case yt:break;case sr:case ar:case Nt:case ir:return rt;case vt:case rr:case Ct:case Dt:default:return nr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=Ss(r,s);if(!(a.length>0||!ya(r,s)))return rt;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function Ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Na(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){Ca(e,a,r[a])})}return e}const Ir={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ia(e=Ir,t){const{payload:r}=t;switch(t.type){case tr:case vt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case yt:return va(e.clientOffset,r.clientOffset)?e:Na({},e,{clientOffset:r.clientOffset});case Ct:case Dt:return Ir;default:return e}}function Sa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function We(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){Sa(e,a,r[a])})}return e}const ja={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ta(e=ja,t){const{payload:r}=t;switch(t.type){case vt:return We({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case rr:return We({},e,{isSourcePublic:!0});case yt:return We({},e,{targetIds:r.targetIds});case Nt:return e.targetIds.indexOf(r.targetId)===-1?e:We({},e,{targetIds:Is(e.targetIds,r.targetId)});case Dt:return We({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Ct:return We({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function wa(e=0,t){switch(t.type){case sr:case ar:return e+1;case ir:case Nt:return e-1;default:return e}}function Ea(e=0){return e+1}function Oa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Aa(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){Oa(e,a,r[a])})}return e}function _a(e={},t){return{dirtyHandlerIds:Da(e.dirtyHandlerIds,{type:t.type,payload:Aa({},t.payload,{prevTargetIds:Ns(e,"dragOperation.targetIds",[])})}),dragOffset:Ia(e.dragOffset,t),refCount:wa(e.refCount,t),dragOperation:Ta(e.dragOperation,t),stateId:Ea(e.stateId)}}function Ra(e,t=void 0,r={},s=!1){const a=ka(s),i=new ea(a,new xa(a)),o=new Zs(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function ka(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Zr(_a,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Pa(e,t){if(e==null)return{};var r=La(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 La(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Sr=0;const pt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Ma=h.memo(function(t){var{children:r}=t,s=Pa(t,["children"]);const[a,i]=Fa(s);return h.useEffect(()=>{if(i){const o=tn();return++Sr,()=>{--Sr===0&&(o[pt]=null)}}},[]),n.jsx(qr.Provider,{value:a,children:r})});function Fa(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=Ba(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function Ba(e,t=tn(),r,s){const a=t;return a[pt]||(a[pt]={dragDropManager:Ra(e,t,r,s)}),a[pt]}function tn(){return typeof global<"u"?global:window}var Rt,jr;function za(){return jr||(jr=1,Rt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,a,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(a=s;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=s;a--!==0;){var o=i[a];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Rt}var $a=za();const Ha=b.getDefaultExportFromCjs($a),Ve=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Va(e,t,r){const[s,a]=h.useState(()=>t(e)),i=h.useCallback(()=>{const o=t(e);Ha(s,o)||(a(o),r&&r())},[s,e,r]);return Ve(i),[s,i]}function Ga(e,t,r){const[s,a]=Va(e,t,r);return Ve(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function rn(e,t,r){return Ga(t,e||(()=>({})),()=>r.reconnect())}function nn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function Ua(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function Ka(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let kt=!1,Pt=!1;class Wa{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Z(!kt,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return kt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kt=!1}}isDragging(){if(!this.sourceId)return!1;Z(!Pt,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Pt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pt=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Lt=!1;class qa{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Z(!Lt,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Lt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Lt=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function Za(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Ya(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Wt(e,t,r,s){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<i.length;c++){const d=i[c];if(!l(d))return!1;const u=e[d],p=t[d];if(a=void 0,a===!1||a===void 0&&u!==p)return!1}return!0}function qt(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xa(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 Qa(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return Xa(s),Ja(s,r?i=>e(i,r):e)}}function sn(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Qa(s);t[r]=()=>a}}),t}function Tr(e,t){typeof e=="function"?e(t):e.current=t}function Ja(e,t){const r=e.ref;return Z(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:s=>{Tr(r,s),Tr(t,s)}}):h.cloneElement(e,{ref:t})}class ei{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Wt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Wt(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=sn({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,qt(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,qt(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class ti{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Wt(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=sn({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,qt(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Xe(){const{dragDropManager:e}=h.useContext(qr);return Z(e!=null,"Expected drag drop context"),e}function ri(e,t){const r=Xe(),s=h.useMemo(()=>new ei(r.getBackend()),[r]);return Ve(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ve(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function ni(){const e=Xe();return h.useMemo(()=>new Wa(e),[e])}class si{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 ai(e,t,r){const s=h.useMemo(()=>new si(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function ii(e){return h.useMemo(()=>{const t=e.type;return Z(t!=null,"spec.type must be defined"),t},[e])}function oi(e,t,r){const s=Xe(),a=ai(e,t,r),i=ii(e);Ve(function(){if(i!=null){const[l,c]=Ya(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function li(e,t){const r=nn(e,t);Z(!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=ni(),a=ri(r.options,r.previewOptions);return oi(r,s,a),[rn(r.collect,s,a),Ua(a),Ka(a)]}function ci(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function di(e){const t=Xe(),r=h.useMemo(()=>new ti(t.getBackend()),[t]);return Ve(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ui(){const e=Xe();return h.useMemo(()=>new qa(e),[e])}function fi(e){const{accept:t}=e;return h.useMemo(()=>(Z(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class pi{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 gi(e,t){const r=h.useMemo(()=>new pi(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function hi(e,t,r){const s=Xe(),a=gi(e,t),i=fi(e);Ve(function(){const[l,c]=Za(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function or(e,t){const r=nn(e,t),s=ui(),a=di(r.options);return hi(r,s,a),[rn(r.collect,s,a),ci(a)]}const wr="column",mi="flex items-center",xi="mr-3 cursor-move text-secondary",bi=({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},u,p]=li(()=>({type:wr,item:{id:e,originalIndex:c},collect:f=>{const m=f.getItem();return{isDragging:f.isDragging()&&m?.id===e}},end:(f,m)=>{if(!f)return;!m.didDrop()&&typeof a=="function"&&f.originalIndex>-1&&a(f.id,f.originalIndex)}}),[e,c,a]),[,g]=or(()=>({accept:wr,hover:f=>{if(!(!f||f.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(f.id,m)}}}),[s,a,e]);return p(g(l)),u(o),n.jsxs("div",{ref:l,className:I.mergeClasses(mi,r),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:xi,"aria-label":i,children:n.jsx($.IconGripVertical,{...H.BASE_ICON_PROPS})}),t]})},It=({iconClassName:e,label:t,...r})=>t?n.jsx(b.DialDangerButton,{...r,label:t,appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}):n.jsx(M.DialDangerIconButton,{...r,appearance:T.ButtonAppearance.Ghost,icon:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}),vi=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const u=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(Ae.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:u,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(b.DialErrorText,{text:s}),!s&&n.jsx(b.DialCaptionText,{text:l})]})},yi="inline-flex items-center rounded bg-layer-3",Di="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",Ci="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ni="text-secondary hover:text-primary",Ii="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Si=({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 u=null;switch(l.key){case"ArrowRight":case"ArrowDown":u=(d+1)%c.length;break;case"ArrowLeft":case"ArrowUp":u=(d-1+c.length)%c.length;break;case"Home":u=0;break;case"End":u=c.length-1;break;default:return}l.preventDefault();const p=c[u];p&&p.value!==t&&r(p.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(yi,a),children:e.map((l,c)=>{const d=l.value===t,u=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(Di,!p&&"-mr-px",u&&"rounded-l",p&&"rounded-r",d?Ci:Ni,g&&Ii),children:[l.icon,l.label]},l.value)})})},Mt=8,ji=24,an=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:u=!1,containerClassName:p,tagClassName:g,onChange:f})=>{const m=h.useRef(null),v=h.useRef([]),x=h.useRef(null),[y,D]=h.useState(e),[N,S]=h.useState(""),[C,E]=h.useState(!1),[R,A]=h.useState(e.length),O=h.useCallback(B=>z=>{v.current[B]=z},[]),_=h.useCallback(()=>{if(!d)return;const B=m.current;if(!B)return;const z=B.offsetWidth;if(z===0)return;const q=x.current?.offsetWidth??0,se=z-(u?0:ji)-Mt;let X=0,W=0;for(let re=0;re<y.length;re++){const de=v.current[re];if(!de)continue;const ue=de.offsetWidth+Mt;if(X+ue>se)break;X+=ue,W++}if(W<y.length&&W>0)for(;X+q>se&&W>0;){W--;const re=v.current[W]?.offsetWidth??0;X-=re+Mt}A(W)},[d,u,y.length]),j=B=>{const z=B.trim().replace(/,$/,"");if(z&&!y.includes(z)){const q=[z,...y];D(q),f?.(q)}},k=B=>{(B.key===","||B.key==="Enter")&&(B.preventDefault(),j(N),S(""))},F=()=>{N.trim()&&(j(N),S(""))},G=B=>{const z=y.filter((q,V)=>V!==B);D(z),f?.(z)},te=()=>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 z=m.current.scrollHeight>m.current.clientHeight+10;E(z)}});return m.current&&B.observe(m.current),()=>B.disconnect()},[y,d]),h.useEffect(()=>{if(!d){A(y.length);return}A(y.length);const B=new ResizeObserver(()=>{_()}),z=m.current;return z&&B.observe(z),_(),()=>B.disconnect()},[d,_,y]),h.useEffect(()=>{D(e)},[JSON.stringify(e)]);const U=n.jsxs("div",{ref:m,className:ae("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":ae("flex-wrap",C?"flex-col-reverse":"flex-row"),p),children:[(d?y.slice(0,R):y).map((B,z)=>n.jsx(He,{label:B,className:g,closable:!c&&!u,onRemove:!c&&!u?()=>G(z):void 0},B+z)),d&&R<y.length&&n.jsx(T.DialTooltip,{tooltip:y.slice(R).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(He,{label:`+${y.length-R}`})}),!u&&n.jsx("input",{id:s,type:"text",value:N,onChange:B=>S(B.target.value),onKeyDown:k,onBlur:F,className:ae("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:[y.map((B,z)=>n.jsx("div",{ref:O(z),className:"inline-flex shrink-0",children:n.jsx(He,{label:B,className:g,closable:!c&&!u,onRemove:!c&&!u?()=>G(z):void 0})},`measure-${B}-${z}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(He,{label:`+${y.length}`})})]})]});return u?U:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(Ae.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:ae("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:U}),te()]})},on=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(an,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Ft=e=>gr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},gr.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),ln=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:d,emptyValueText:u,placeholder:p,editable:g=!1,onValueChange:f,collapseTagOverflow:m=!1,iconBefore:v})=>{const x=Array.isArray(s)&&s.length>0,y=typeof s=="string"&&!!s.trim(),D=x||y?s:p?void 0:u,N=r?void 0:o,S=h.useCallback(A=>{f?.(A.target.value)},[f]),C=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ae("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(M.DialIcon,{icon:v}),n.jsx("input",{type:"text",className:ae("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||u,onChange:S,disabled:r,id:l,"aria-label":"input-popup-field"})]}),!r&&n.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:o,"aria-label":"open-popup",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]}),n.jsx(b.DialErrorText,{text:c})]}),E=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:ae("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(M.DialIcon,{icon:v}),n.jsx(T.DialTooltip,{tooltip:D==null?void 0:String(D),children:D||!p?n.jsx("span",{className:a,children:D}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})}),n.jsx(b.DialErrorText,{text:c})]}),R=()=>n.jsx("div",{className:"w-full",onClick:N,children:n.jsxs("div",{className:ae("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(M.DialIcon,{icon:v}),n.jsx(on,{placeholder:p,selectedItems:D,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?R():g?C():E(),t&&Wn.createPortal(e,document.body)]})},Ti=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:d,onClose:u,header:p,portalId:g,onApply:f,onCancel:m,cancelButtonTitle:v="Cancel",applyButtonTitle:x="Apply",isValid:y,selectedRadioValue:D,onChangeRadioField:N,id:S,size:C=b.PopupSize.Md})=>{const[E,R]=h.useState(!1),A=h.useCallback(()=>{r||R(!0)},[r]),O=h.useCallback(()=>{R(!1),u?.()},[u]),_=h.useCallback(()=>{m?.(),O()},[m,O]),j=h.useCallback(()=>{f(),O()},[f,O]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Ae.DialLabel,{label:e,htmlFor:t}),n.jsx(ln,{disabled:r,open:E,selectedValue:i??a.find(k=>k.id===s)?.name,valueClassName:o,inputClassName:ae(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:A,children:n.jsx(b.DialPopup,{open:E,onClose:_,header:p,portalId:g,size:C,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:_}),n.jsx(b.DialPrimaryButton,{label:x,onClick:j,disabled:!y})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(b.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:D,onChange:N,elementId:S,orientation:b.RadioGroupOrientation.Column})})})})]})},wi="Create",Ei="Cancel",Oi="flex items-center justify-end gap-2 px-6 py-3",Ai=({header:e,open:t=!1,submitLabel:r=wi,cancelLabel:s=Ei,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:d,onCancel:u,children:p,dividers:g=!0,size:f=b.PopupSize.Md,footer:m})=>{const v=a?null:n.jsxs("div",{className:Oi,children:[n.jsx(b.DialNeutralButton,{label:s,onClick:()=>u?u():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:f,children:x()})},_i=/^0+\.(\d+)?$/,Ri=/^0+/,Zt=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=u=>!u||u==="-"?u:String(u)?.match(_i)?String(u)?.replace(Ri,"0"):Number(u),c=u=>{if([".","-","+","e","E"].includes(u.key)){u.preventDefault();return}b.handleKeyDown(u,"number",r,s)},d=u=>{const p=u.clipboardData.getData("text"),g=p.replace(/\D/g,"");if(g!==p&&(u.preventDefault(),g)){const f=u.currentTarget,m=f.selectionStart??0,v=f.selectionEnd??0,x=f.value.slice(0,m)+g+f.value.slice(v);t?.(l(x))}};return n.jsx(b.DialInput,{type:"number",min:r,max:s,onChange:u=>t?.(l(u)),onKeyDown:e?c:a,onPaste:e?d:i,...o})},ki=({onClick:e})=>n.jsx($.IconEyeOff,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Pi=({onClick:e})=>n.jsx($.IconEye,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),cn=({...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(ki,{onClick:()=>s(!1)}):n.jsx(Pi,{onClick:()=>s(!0)})})},dn=({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(He,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(M.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var ht=(e=>(e.Sm="sm",e.Md="md",e))(ht||{}),mt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(mt||{});const Li="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",Mi="w-full rounded flex flex-col",nt="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",Fi="bg-accent-primary-alpha",Yt="bg-accent-primary-alpha border-l border-accent-primary border-1",xt="opacity-75",Bi=352,zi=4,$i=n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),Hi=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=M.useSubMenuFloating(zi,"listbox",!!e.disabled),d=e.children?.some(u=>t.includes(u.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:ae(nt,d&&Yt,e.disabled&&xt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(M.DialIcon,{icon:e.icon}),n.jsx(M.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx($.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(M.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(u=>{const p=t.includes(u.value);return n.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!u.disabled,disabled:u.disabled,className:ae(nt,p&&Yt,u.disabled&&xt),onClick:()=>!u.disabled&&r(u.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u.icon&&n.jsx(M.DialIcon,{icon:u.icon}),n.jsx(M.DialEllipsisTooltip,{text:u.labelNode??u.label})]})},u.value)})})]})},ke=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=mt.Primary,size:o=ht.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:u=!1,searchSize:p=T.ElementSize.Standard,searchPlaceholder:g,selectAll:f=!1,invalid:m,selectAllLabel:v="Select all",emptyStateTitle:x="No options available",emptyStateDescription:y,emptyStateIcon:D,disabled:N=!1,className:S,listClassName:C,closable:E=!1,header:R,footer:A,onClose:O,onChange:_,inlineSearch:j=!1,dismissRef:k,onFooterClick:F,open:G,onOpenChange:te,onInlineQueryChange:U,customMultiSelectTagsRenderer:B})=>{const z=h.useId(),[q,V]=h.useState(!1),se=G!==void 0,X=se?!!G:q,W=h.useCallback(w=>{se||V(w),te?.(w)},[se,te]),[re,de]=h.useState(j&&c||""),ue=h.useRef(null),ce=h.useCallback(w=>{w!==re&&(de(w||""),U?.(w||""))},[U,re]),pe=s!==void 0,[ge,fe]=h.useState(a),K=pe?s:ge,Q=h.useMemo(()=>t?Array.isArray(K)?K:[]:typeof K=="string"?[K]:[],[K,t]),Ne=h.useMemo(()=>{const w=re.trim().toLowerCase();return w?e.filter(J=>J.label.toLowerCase().includes(w)):e},[e,re]);h.useEffect(()=>{!X&&!j&&ce("")},[j,X,ce]);const Me=h.useRef(c);h.useEffect(()=>{j&&c!==Me.current&&(X||(Me.current=c,ce(c||"")))},[c,j,X,ce]);const he=h.useCallback(w=>{pe||fe(w),_?.(w)},[pe,_]),Fe=h.useCallback(w=>{if(t){const J=new Set(Q);J.has(w)?J.delete(w):J.add(w),he(Array.from(J));return}if(he(w),j){const J=e.find(xe=>xe.value===w)??e.flatMap(xe=>xe.children??[]).find(xe=>xe.value===w);J&&ce(J.label)}W(!1)},[t,he,j,W,Q,e,ce]),je=h.useCallback((w,J)=>{if(w.stopPropagation(),!t){he("");return}const xe=Q.filter(Et=>Et!==J);he(xe)},[t,Q,he]),ne=h.useMemo(()=>Ne.filter(w=>!w.disabled),[Ne]),_e=h.useMemo(()=>ne.filter(w=>Q.includes(w.value)).length,[ne,Q]),Ie=h.useCallback(w=>{j&&!t&&!w&&Fe(re),W(w)},[Fe,j,t,re,W]),{allSelectedInFiltered:Be,someSelectedInFiltered:tt}=h.useMemo(()=>{const w=ne.length>0&&_e===ne.length;return{allSelectedInFiltered:w,someSelectedInFiltered:_e>0&&!w}},[ne,_e]),ye=h.useCallback(()=>{if(!(!t||ne.length===0))if(Be){const w=new Set(ne.map(J=>J.value));he(Q.filter(J=>!w.has(J)))}else{const w=new Set(Q);ne.forEach(J=>w.add(J.value)),he(Array.from(w))}},[Be,t,ne,Q,he]),ze=Q.length>0;h.useEffect(()=>{X&&j&&!t&&!N&&requestAnimationFrame(()=>{const w=ue.current;if(!w)return;w.focus();const J=w.value?.length??0;w.setSelectionRange?.(J,J)})},[X,j,t,N]);const Re=!t&&ze?Q[0]:void 0,me=h.useMemo(()=>Re?e.find(w=>w.value===Re)??e.flatMap(w=>w.children??[]).find(w=>w.value===Re):void 0,[e,Re]),wt=h.useCallback(()=>t?ze?B?.(e,Q,je)||n.jsx(dn,{options:e,selectedValues:Q,handleRemoveTag:je}):n.jsx("span",{className:"text-secondary truncate",children:d}):me?n.jsxs(n.Fragment,{children:[me.icon&&n.jsx(M.DialIcon,{icon:me.icon}),n.jsx(M.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}),[ze,t,c,l,s,d,me,e,Q,je,B]);h.useImperativeHandle(k,()=>({dismiss:()=>{W(!1)}}));const Te=h.useCallback(()=>{ce(Q.length===1?me?.label??re:"")},[re,Q.length,ce,me?.label]),$e=h.useCallback(()=>{N||(W(!X),j&&!t&&(Te(),ue.current?.focus()))},[N,j,X,t,Te,W]);return n.jsx(M.DialDropdown,{open:X,onOpenChange:Ie,disabled:N,closable:E,onClose:O,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:u?null:Bi,listClassName:C,renderOverlay:()=>n.jsxs("div",{id:`list-${r||z}`,role:"listbox","aria-multiselectable":t||void 0,className:Mi,children:[R&&n.jsx(n.Fragment,{children:typeof R=="function"?R():R}),(u||E)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&n.jsx(b.DialSearch,{size:p,placeholder:g,onChange:ce,value:re,id:`search-${r||z}`,containerClassName:I.mergeClasses(b.SIZE_CONFIG[p].containerClassName,"w-full")}),E&&n.jsx(b.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:w=>{O?.(w),W(!1)}})]}),t&&f&&ne.length>0&&n.jsx("div",{className:ae(nt,"mt-2"),children:n.jsx(Gt,{id:`${r||z}-selectAll`,label:v,checked:Be,indeterminate:tt,onChange:ye,ariaLabel:v})}),n.jsx("div",{className:ae("overflow-y-auto max-h-[352px]",j&&Ne.length===0?"":"py-1"),children:Ne.length===0?!j&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(M.DialNoDataContent,{icon:D??n.jsx($.IconClipboardX,{size:H.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:y})}):Ne.map(w=>{const J=Q.includes(w.value);return t?n.jsxs("div",{role:"option","aria-selected":J,"aria-disabled":!!w.disabled,className:ae(nt,J&&Fi,w.disabled&&xt,"w-full"),children:[n.jsx(Gt,{id:`${r||z}-${w.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[w.icon&&n.jsx(M.DialIcon,{icon:w.icon}),n.jsx("span",{className:"truncate",children:w.labelNode??w.label})]}),checked:J,disabled:w.disabled,onChange:()=>!w.disabled&&Fe(w.value),ariaLabel:w.label}),w.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:w.description})]},w.value):w.children?.length?n.jsx(Hi,{opt:w,selectedValues:Q,onSelect:Fe},w.value):n.jsx("button",{role:"option",type:"button","aria-selected":J,"aria-disabled":!!w.disabled,disabled:w.disabled,className:ae(nt,J&&Yt,w.disabled&&xt),onClick:()=>!w.disabled&&Fe(w.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[w.icon&&n.jsx(M.DialIcon,{icon:w.icon}),n.jsx(M.DialEllipsisTooltip,{text:w.labelNode??w.label}),w.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:w.description})]})},w.value)})}),A&&n.jsx("div",{onClick:w=>{F?.(w),F&&W(!1)},children:typeof A=="function"?A():A})]}),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||z}`,className:I.mergeClasses(Li,N&&"opacity-75 !cursor-not-allowed !border-primary",o===ht.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===mt.Secondary?"!bg-layer-4 !h-auto":"",S),onMouseDown:w=>{N||j&&!t&&(Te(),w.preventDefault())},onClick:()=>{$e()},onKeyDown:w=>{(w.key===" "||w.code==="Space")&&(w.preventDefault(),$e())},children:[j&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||z}`,type:"text",placeholder:g??d,value:re||"",onChange:w=>ce(w.currentTarget.value.trimStart()),onFocus:()=>!N&&W(!0),onMouseDown:w=>{Te(),w.stopPropagation()},onClick:w=>{w.stopPropagation()},onKeyDown:w=>{w.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:ue,disabled:N,"aria-disabled":N,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:wt()}),!j&&n.jsx(M.DialIcon,{icon:$i,className:ae("text-primary",X&&"rotate-180")})]})})},Vi=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:d,defaultEmptyText:u,...p})=>{const g=h.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return u??"None";if(Array.isArray(d))return n.jsx(dn,{options:p.options,selectedValues:d});{const f=p.options?.find(m=>m.value===d);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:f?.label||d})}},[d,p.options,u]);return n.jsx(b.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:u,children:n.jsx(ke,{className:a,value:d,elementId:o,invalid:!!i,...p})})};function un(e){let t=null;return()=>(t==null&&(t=e()),t)}function Gi(e,t){return e.filter(r=>r!==t)}function Ui(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 Ki{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Ui(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Gi(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wi{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 St="__NATIVE_FILE__",fn="__NATIVE_URL__",pn="__NATIVE_TEXT__",gn="__NATIVE_HTML__",Er=Object.freeze(Object.defineProperty({__proto__:null,FILE:St,HTML:gn,TEXT:pn,URL:fn},Symbol.toStringTag,{value:"Module"}));function Bt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const Xt={[St]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[gn]:{exposeProperties:{html:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[fn]:{exposeProperties:{urls:(e,t)=>Bt(e,t,"").split(`
|
|
2
|
-
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[pn]:{exposeProperties:{text:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function qi(e,t){const r=Xt[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new Wi(r);return s.loadDataTransfer(t),s}function zt(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Xt).filter(r=>{const s=Xt[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Zi=un(()=>/firefox/i.test(navigator.userAgent)),hn=un(()=>!!window.safari);class Or{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:i,c3s:o}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,d=o.length-1,u;for(;c<=d;){u=Math.floor(.5*(c+d));const f=r[u];if(f<t)c=u+1;else if(f>t)d=u-1;else return s[u]}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 f=0;f<s;f++)a.push(f);a.sort((f,m)=>t[f]<t[m]?-1:1);const i=[],o=[];let l,c;for(let f=0;f<s-1;f++)l=t[f+1]-t[f],c=r[f+1]-r[f],i.push(l),o.push(c/l);const d=[o[0]];for(let f=0;f<i.length-1;f++){const m=o[f],v=o[f+1];if(m*v<=0)d.push(0);else{l=i[f];const x=i[f+1],y=l+x;d.push(3*y/((y+x)/m+(y+l)/v))}}d.push(o[o.length-1]);const u=[],p=[];let g;for(let f=0;f<d.length-1;f++){g=o[f];const m=d[f],v=1/i[f],x=m+d[f+1]-g-g;u.push((g-m-x)*v),p.push(x*v*v)}this.xs=t,this.ys=r,this.c1s=d,this.c2s=u,this.c3s=p}}const Yi=1;function mn(e){const t=e.nodeType===Yi?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function ct(e){return{x:e.clientX,y:e.clientY}}function Xi(e){var t;return e.nodeName==="IMG"&&(Zi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Qi(e,t,r,s){let a=e?t.width:r,i=e?t.height:s;return hn()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function Ji(e,t,r,s,a){const i=Xi(t),l=mn(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:d,offsetHeight:u}=e,{anchorX:p,anchorY:g}=s,{dragPreviewWidth:f,dragPreviewHeight:m}=Qi(i,t,d,u),v=()=>{let E=new Or([0,.5,1],[c.y,c.y/u*m,c.y+m-u]).interpolate(g);return hn()&&i&&(E+=(window.devicePixelRatio-1)*m),E},x=()=>new Or([0,.5,1],[c.x,c.x/d*f,c.x+f-d]).interpolate(p),{offsetX:y,offsetY:D}=a,N=y===0||y,S=D===0||D;return{x:N?y:x(),y:S?D:v()}}class eo{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 to(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){to(e,a,r[a])})}return e}class ro{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,s){return this.sourcePreviewNodeOptions.set(t,s),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,s){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,s);const a=o=>this.handleDragStart(o,t),i=o=>this.handleSelectStart(o);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",i),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const s=o=>this.handleDragEnter(o,t),a=o=>this.handleDragOver(o,t),i=o=>this.handleDrop(o,t);return r.addEventListener("dragenter",s),r.addEventListener("dragover",a),r.addEventListener("drop",i),()=>{r.removeEventListener("dragenter",s),r.removeEventListener("dragover",a),r.removeEventListener("drop",i)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Ar({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Ar({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Er).some(r=>Er[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=qi(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&&mn(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const o=ct(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:l}=a,c=zt(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const u=this.monitor.getSourceId(),p=this.sourceNodes.get(u),g=this.sourcePreviewNodes.get(u)||p;if(g){const{anchorX:f,anchorY:m,offsetX:v,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),N=Ji(p,g,o,{anchorX:f,anchorY:m},{offsetX:v,offsetY:x});l.setDragImage(g,N.x,N.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=zt(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:ct(a)}),i.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=ct(a),this.scheduleHover(i),(i||[]).some(l=>this.monitor.canDropOnTarget(l))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else zt(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:ct(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new eo(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ki(this.isNodeInDocument)}}const no=function(t,r,s){return new ro(t,r,s)},so=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:i,multiple:o,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:u,getIsFileSizeError:p})=>{const g=h.useRef(null),f=h.useRef(null),[m,v]=h.useState([]),[x,y]=h.useState(!1),[D,N]=h.useState(!1),S=h.useCallback(U=>{const B=U.target.files;if(B&&B.length>0){const z=Array.from(B),q=u?.(z),V=p?.(z);q?y(!0):V?N(!0):e(z)}},[u,p,e]),C=h.useCallback(U=>i&&U?.length>i,[i]),E=h.useMemo(()=>x||D||C(m),[x,D,C,m]),R=()=>{v([]),y(!1),N(!1)},A=h.useMemo(()=>x?n.jsx(b.DialErrorText,{text:l}):D?n.jsx(b.DialErrorText,{text:d}):C(m)?n.jsx(b.DialErrorText,{text:c}):null,[c,l,d,m,C,x,D]);h.useEffect(()=>{R()},[a]);const[{isOver:O,canDrop:_},j]=or(()=>({accept:[St],drop(U){const B=U.files,z=u?.(B)??!1,q=p?.(B)??!1,V=C?.(B)??!1;if(y(z),N(q),z||q||V){v(B);return}e(B),R()},collect:U=>({isOver:U.isOver(),canDrop:U.canDrop()})}),[e,u,p,C]),k=U=>{(U.key==="Enter"||U.key==="Space")&&(U.preventDefault(),f.current?.click())},F=U=>{U?.preventDefault();const B=Array.from(U.dataTransfer?.items??[]);y(!!u?.(B)),N(!!p?.(B)),v(B)},G=U=>{U.target===U.currentTarget&&R()},te=ae("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!_&&!E&&"border-primary",_&&(O?"border-accent-primary":"border-hover"),E&&"border-error");return j(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:te,ref:g,onDragOver:F,onDragLeave:G,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:k,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:T.ButtonAppearance.Ghost,label:s,onClick:()=>f.current?.click()})]}),n.jsx("input",{multiple:o,id:"file",type:"file",ref:f,hidden:!0,accept:a,onChange:S})]}),n.jsx(n.Fragment,{children:A})]})},ao=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx($.IconExclamationCircle,{...H.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(b.DialInput,{...r,iconBefore:a(),containerClassName:ae("h-[40px] p-0",s&&"h-[60px]"),className:ae("rounded-r-none border-r-0",s&&"text-error",t)})},io=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:i,fileFormatError:o,fileSizeError:l,fileCountError:c})=>{const d=h.useRef(null),[u,p]=h.useState(!1),[g,f]=h.useState(!1),[m,v]=h.useState(0),x=h.useCallback(()=>{p(!1),f(!1),v(0)},[]),y=h.useCallback(O=>!!(i&&t.length+O.length>i),[i,t.length]),D=u||g,[{isOver:N,canDrop:S},C]=or(()=>({accept:[St],drop(O){const _=O.files,j=[...t,..._],k=s?.(_)??!1,F=a?.(_)??!1,G=y?.(_)??!1;if(p(k),f(F),k||F||G){v(_.length);return}r(j),x()},collect:O=>({isOver:O.isOver(),canDrop:O.canDrop()})}),[t,r,s,a,y,x]),E=O=>{O.preventDefault();const _=Array.from(O.dataTransfer?.items??[]);p(!!s?.(_)),f(!1),v(_.length)},R=O=>{O.target===O.currentTarget&&x()};C(d);const A=y(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:d,onDragOver:E,onDragLeave:R,className:ae("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!D&&!A&&(S&&N?"border-accent-primary":"border-primary"),(D||A)&&"border-error"),children:e}),u&&n.jsx(b.DialErrorText,{text:o}),g&&n.jsx(b.DialErrorText,{text:l}),!u&&!g&&A&&n.jsx(b.DialErrorText,{text:c})]})},xn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:i,errorText:o,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:u,getIsFileSizeError:p,maxFilesCount:g}=e,f=h.useCallback((x,y)=>{x.stopPropagation(),a(t?.filter(D=>D.name!==y)||[])},[a,t]),m=h.useCallback(x=>n.jsx(It,{"aria-label":l,onClick:y=>f(y,x)}),[l,f]),v=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,y)=>n.jsx(ao,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:r||s?.(x.name),invalid:i?.(x),error:i?.(x)?o:""},x.name+y))}),[t,r,s,i,o,m]);return n.jsx(Ma,{backend:no,children:!t||t.length===0?n.jsx(so,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx(io,{existingFiles:t,onDrop:a,getIsFileFormatError:u,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),c?.(t)&&n.jsx(b.DialErrorText,{text:d})]})})},oo=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:i,maxMultiFilesSize:o,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:u,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:f,addButtonLabel:m,additionalActionButtons:v,...x})=>{const y=h.useRef(null),D=()=>y.current?.click(),N=()=>{e([])},S=h.useCallback(A=>A?.some(O=>!(g==="/"||g?.toLowerCase()?.includes(O?.type?.toLowerCase()))),[g]),C=h.useCallback(A=>{if(!i)return!1;const O=i*(1024*1024);return A?.some(_=>{const j=_.size;return!!j&&j>O})},[i]),E=h.useCallback(A=>{if(!o||!p)return!1;const O=o*1024*1024;return A.reduce((j,k)=>j+k.size,0)>O},[o,p]),R=h.useCallback(A=>{const O=A.target.files;if(O&&O.length>0){const _=Array.from(O),j=S(_),k=C(_);!j&&!k&&e([...s||[],..._])}},[S,C,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(Ae.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:f,iconBefore:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&n.jsx(b.DialPrimaryButton,{appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx($.IconPlus,{...H.BASE_ICON_PROPS}),label:m,onClick:D}),v]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:p,ref:y,hidden:!0,accept:g,onChange:R}),n.jsx(xn,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:u,getIsFileFormatError:S,getIsFileSizeError:C,getIsMultiFilesSizeError:E,...x})]})},lo=({icon:e,ariaLabel:t,size:r=T.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:i,iconClassName:o,caretIcon:l=n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:u=!1,open:p,onOpenChange:g,defaultOpen:f=!1,...m})=>{const v=r===T.ElementSize.Small,[x,y]=h.useState(f),D=p??x,N=v?"w-8 px-0":"w-10 px-0",S={[T.ElementSize.Small]:"size-5",[T.ElementSize.Standard]:"size-6",[T.ElementSize.Large]:"size-7"},C=E=>{y(E),g?.(E)};return n.jsx(M.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:u,className:a,open:D,onOpenChange:C,defaultOpen:f,children:n.jsxs("button",{type:"button","aria-label":t,disabled:s,className:I.mergeClasses("group flex items-center justify-center rounded border border-transparent bg-layer-4 text-primary","enabled:hover:bg-accent-primary-alpha enabled:active:bg-controls-accent-primary-alpha-active","focus-visible:border-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:text-controls-secondary-disable disabled:opacity-75",v?"h-8 px-2":"h-10 px-2",c?void 0:N,i),children:[n.jsx(M.DialIcon,{icon:e,className:I.mergeClasses("flex items-center justify-center text-inherit",S[r],c&&"-mr-2",o)}),c&&n.jsxs("div",{className:"relative z-10 inline-grid size-5 shrink-0 place-items-center",children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(M.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",D&&"rotate-180")})]})]})})},co="application/octet-stream";function uo(e,t){if(!e||e.length===0)return[];const r=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!r)return[];const s=r.path||r.url||"",a=$t(s,!0),i=e.filter(c=>c!==r).map(c=>{const d=c.path||c.url||"",u=fo(c.nodeType),p=u===b.DialFileNodeType.FOLDER,g=$t(d,p);let f;return c.parentPath===null||c.parentPath===void 0?f=a:c.parentPath===""?f="":f=$t(c.parentPath,!0),{...c,originalPath:d,path:g,parentPath:f,nodeType:u}}),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:po(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=go(c.name),d.contentType=c.contentType||co,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||""),u=c.path.slice(0,d),p=o.get(u);p&&p.nodeType===b.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function $t(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function fo(e){return e.toUpperCase()==="FOLDER"?b.DialFileNodeType.FOLDER:b.DialFileNodeType.ITEM}function po(e){if(!e)return;const t=e.toUpperCase();return Object.values(b.DialFileResourceType).find(s=>s.toUpperCase()===t)}function go(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function ho(e,t="Prompts",r="prompts/public/",s="root"){const a=uo(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:b.DialFileNodeType.FOLDER,folderId:s,items:a}]}const bn=({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 qe=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(qe||{}),at=(e=>(e.Select="select",e.Radio="radio",e))(at||{}),jt=(e=>(e.Row="row",e.Column="column",e))(jt||{}),ee=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(ee||{});const mo={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"},vn=h.createContext(null);function Se(){const e=h.useContext(vn);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function _r(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function Y(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 u of a)i=i?.[u];if(!i||typeof i!="object")return e;const{$ref:o,...l}=s,c=i;s={...c.$ref?Y(c,t,r+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...i}=s;let o={};for(const l of a)o=_r(o,Y(l,t,r+1));s=_r(o,i)}return s}function yn(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 Tt(e){return e==null||e===""}function Ue(e){return e.type===ee.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function bt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Dn(e,t){return e.type===ee.Null?"null":e.$ref?Y(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 Ee(e,t,r=0){if(r>15)return;const s=Y(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=Y({$ref:s.discriminator.mapping[a]},t);return{...Ee(i,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(Ue(s)){if(s.properties){const a={};let i=!1;for(const[o,l]of Object.entries(s.properties)){const c=Ee(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 we(e,t,r,s="",a=0){if(a>15)return[];const i=[],o=Y(t,r);if(o.anyOf){const d=o.anyOf.filter(u=>u.type!==ee.Null);return e!=null&&d.length===1?we(e,d[0],r,s,a+1):i}if(o.oneOf&&o.discriminator){const d=o.discriminator.propertyName,u=e?.[d];if(u&&o.discriminator.mapping[u]){const p={$ref:o.discriminator.mapping[u]},g=Y(p,r);return we(e,g,r,s,a+1)}return i}if(o.type===ee.Array||!o.type&&Array.isArray(e)){if(Array.isArray(e)&&o.items)for(let d=0;d<e.length;d++){const u=we(e[d],o.items,r,`${s}[${d}]`,a+1);i.push(...u)}return i}if(!Ue(o))return i;const l=o.required??[],c=e;for(const d of l){const u=o.properties?.[d];if(u&&Y(u,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c?.[d];if(Tt(g)){const f=u?.title??bt(d);i.push({path:p,message:`${f} is required`})}}if(c&&o.properties)for(const[d,u]of Object.entries(o.properties)){if(Y(u,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c[d];if(g!=null){const f=we(g,u,r,p,a+1);i.push(...f)}}if(c&&o.additionalProperties!=null&&o.additionalProperties!==!1&&typeof o.additionalProperties=="object"){const d=o.additionalProperties;for(const[u,p]of Object.entries(c)){const g=s?`${s}.${u}`:u,f=we(p,d,r,g,a+1);i.push(...f)}}return i}function lr(e,t,r){const s=Y(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ue(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!Y(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 xo(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===ee.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>Y(a,r).type===ee.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>Y(a,r).type===ee.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const i=Y(a,r);return i.type===ee.Number||i.type===ee.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>Y(a,r).type===ee.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const i=Y(t[a],r);if(i.discriminator&&i.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const i=Y(t[a],r);if(Ue(i)||i.oneOf)return a}return 0}return 0}function bo(e,t,r){if(t&&typeof e=="object"&&e!==null){const s=e[t];if(s)return`Item ${r+1}: ${s}`}if(typeof e=="object"&&e!==null){const s=e,a=s.name??s.title??s.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function Cn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case ee.String:return"";case ee.Boolean:return!1;case ee.Array:return[];case ee.Integer:case ee.Number:return;default:return{}}}const it=({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,u]=h.useState(l),p=a===0,g="rounded border border-secondary",f=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:f,onClick:()=>u(v=>!v),role:"button","aria-expanded":d,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:d?n.jsx($.IconChevronDown,{size:16,stroke:2}):n.jsx($.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(Ae.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(M.DialIcon,{icon:n.jsx($.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(M.DialIcon,{icon:n.jsx($.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),o&&n.jsx(It,{size:T.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})]})},Nn=({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:u=!1}=Se(),p=Y(e,l),g=Ue(p),f=p.type===ee.Array;if(g||f){const x=lr(t,p,l),y=we(t,p,l,s.join(".")),D=s.join("."),N=D+".",S=!u||d.has(D)||[...d].some(C=>C.startsWith(N));return n.jsx(it,{title:o??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:S?y.length:0,defaultExpanded:c,children:n.jsx(Oe,{schema:p,value:t,onChange:r,path:s,level:a+1,required:i})})}const v=(!u||d.has(s.join(".")))&&i&&Tt(t)?`${o??"Field"} is required`:void 0;return n.jsx(b.DialFormItem,{label:o,required:i,description:p.description,error:v,children:n.jsx(Oe,{schema:p,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:!0})})},gt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o}=Se(),l=Y(e,i),c=yn(Object.entries(l.properties??{}).filter(([,p])=>!Y(p,i).isHidden)),d=l.required??[],u=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=Y(g,i).title??g.title??bt(p),v=d.includes(p);return n.jsx(Nn,{schema:g,value:u[p],onChange:x=>r({...u,[p]:x}),path:[...s,p],level:a,required:v,label:m},p)})})},vo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,defaultExpanded:c=!0}=Se(),d=Array.isArray(t)?t:[],u=e.items,[p,g]=h.useState(void 0);if(!u)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemSchema});const f=h.useMemo(()=>Y(u,i),[u,i]),m=h.useMemo(()=>f.discriminator,[f]),v=h.useMemo(()=>m?.propertyName,[m]),x=h.useMemo(()=>m?Object.keys(m.mapping).map(S=>({value:S,label:S})):[],[m]),y=()=>{const S=p??x[0]?.value;let C;if(m&&S){const E=Y({$ref:m.mapping[S]},i);C={...Ee(E,i)??{},[m.propertyName]:S}}else C=Ee(f,i)??Cn(f);r([...d,C])},D=S=>{r(d.filter((C,E)=>E!==S))},N=(S,C)=>{r(d.map((E,R)=>R===S?C:E))};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((S,C)=>{const E=bo(S,v,C),R=lr(S,f,i),A=we(S,f,i,`${s.join(".")}[${C}]`);return n.jsx(it,{title:E,level:a,summary:R,errorCount:A.length,onRemove:l?void 0:()=>D(C),defaultExpanded:c,removeItemAriaLabel:o.removeItemAriaLabel,children:n.jsx(Oe,{schema:u,value:S,onChange:O=>N(C,O),path:[...s,String(C)],level:a+1})},C)}),!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(ke,{options:x,value:p??x[0]?.value,placeholder:o.selectTypeToAdd,onChange:S=>{const C=typeof S=="string"?S:S[0];g(C)}})}),n.jsx(b.DialGhostButton,{label:o.addItem,iconBefore:n.jsx($.IconPlus,{size:16,stroke:2}),onClick:y})]})]})},yo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1}=Se(),c=h.useId(),d=e.discriminator;if(d){const x=d.propertyName,y=d.mapping,D=Object.keys(y).map(E=>({value:E,label:E})),N=typeof t=="object"&&t!==null?t[x]:void 0,S=N?Y({$ref:y[N]},i):void 0,C=E=>{const R=Y({$ref:y[E]},i),A=Ee(R,i)??{};r({...A,[x]:E})};if(e.discriminatorDisplay===at.Radio){const E=e.discriminatorOrientation===jt.Row,R=N?(()=>{const A=Y({$ref:y[N]},i),{[x]:O,..._}=A.properties??{};return{...A,properties:_}})():void 0;return E?n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{role:"radiogroup",className:"flex flex-row flex-wrap gap-4",children:Object.keys(y).map(A=>{const O=Y({$ref:y[A]},i);return n.jsx(M.DialRadioButton,{name:c,value:A,inputId:`${c}-${A}`,label:O.title??A,checked:N===A,disabled:l,onChange:()=>C(A)},A)})}),R&&n.jsx(gt,{schema:R,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(y).map(A=>{const O=Y({$ref:y[A]},i),_=N===A,{[x]:j,...k}=O.properties??{},F={...O,properties:k};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(M.DialRadioButton,{name:c,value:A,inputId:`${c}-${A}`,label:O.title??A,checked:_,disabled:l,onChange:()=>C(A)}),_&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(gt,{schema:F,value:t,onChange:r,path:s,level:a})})]},A)})})}return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:D,value:N,placeholder:o.selectTypePlaceholder,disabled:l,onChange:E=>{const R=typeof E=="string"?E:E[0];R&&C(R)}})}),S&&n.jsx("div",{className:"pl-3",children:n.jsx(gt,{schema:S,value:t,onChange:r,path:s,level:a})})]})}const u=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<u.length;x++)if(Y(u[x],i).required?.every(D=>D in t))return x}return 0})(),f=x=>{const y=Y(u[x],i),D=Ee(y,i);r(D??null)},m=u[g];if(e.discriminatorDisplay===at.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:u.map((x,y)=>{const D=Y(x,i),N=Dn(x,i)??`Option ${y+1}`,S=g===y;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(M.DialRadioButton,{name:c,value:String(y),inputId:`${c}-${y}`,label:N,checked:S,disabled:l,onChange:()=>f(y)}),S&&D&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Oe,{schema:D,value:t,onChange:r,path:s,level:a})})]},y)})});const v=u.map((x,y)=>{const D=Y(x,i);return{value:String(y),label:D.title??`Option ${y+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:v,value:String(g),disabled:l,onChange:x=>{const y=typeof x=="string"?x:x[0];f(Number(y))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Oe,{schema:m,value:t,onChange:r,path:s,level:a})})]})},Do=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,readonly:o=!1}=Se(),l=e.anyOf??[],c=l.map((m,v)=>({value:String(v),label:Dn(m,i)})),d=xo(t,l,i),u=l[d],g=Y(u,i).type===ee.Null,f=m=>{const v=Y(l[m],i);if(v.type===ee.Null){r(null);return}const x=Ee(v,i);if(x!==void 0){r(x);return}switch(v.type){case ee.Array:r([]);break;case ee.String:r("");break;case ee.Boolean:r(!1);break;case ee.Integer:case ee.Number:r(0);break;default:r({});break}};return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:c,value:String(d),disabled:o,onChange:m=>{const v=typeof m=="string"?m:m[0];f(Number(v))}})}),!g&&u&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Oe,{schema:u,value:t,onChange:r,path:s,level:a})})]})},In=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:i,readonly:o=!1,inputClassName:l,acceptableResourceTypes:c}=Se(),d=e.const!==void 0,u=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===ee.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(f=>{const m=c?.[f];return Array.isArray(m)?m.map(v=>{const x=String(v);return{value:x,label:x}}):[]});return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:f=>r(typeof f=="string"?f:f[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(u&&e.enumDisplay===at.Radio){const g=e.enumOrientation===jt.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(f=>{const m=String(f);return n.jsx(M.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(u){const g=e.enum.map(f=>({value:String(f),label:String(f)}));return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:f=>r(typeof f=="string"?f:f[0]),placeholder:i.enumSelectPlaceholder})}switch(e.type){case ee.Boolean:return n.jsx(Ae.DialSwitch,{switchId:a,isOn:!!t,disabled:o,onChange:g=>r(g)});case ee.Integer:return n.jsx(Zt,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.integerInputPlaceholder,containerClassName:l});case ee.Number:return n.jsx(Zt,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(cn,{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})}},Rr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Sn=e=>!!(e.oneOf||e.anyOf||e.type===ee.Array||Ue(e)),Co=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,onKeyChange:a,onValueChange:i,onRemove:o,keyInputPlaceholder:l,removeFieldAriaLabel:c,path:d,level:u,readonly:p=!1,inputClassName:g})=>{const{rootSchema:f,texts:m,defaultExpanded:v=!0,touchedPaths:x=new Set,markTouched:y=()=>{},skipUntouched:D=!1}=Se(),[N,S]=h.useState(t),C=Sn(s),E=[...d,e,"key"].join("."),A=(!D||x.has(E))&&t==="",O=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:C?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(b.DialInput,{value:N,disabled:p,invalid:A,onChange:F=>S(F??""),onBlur:()=>{y(E),N!==t&&a(N)},placeholder:l,containerClassName:g}),n.jsx(b.DialErrorText,{text:A?`${m.keyColumnHeader} is required`:void 0})]}),!C&&n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{schema:s,value:r,onChange:i})}),!p&&n.jsx(It,{size:T.ElementSize.Small,onClick:o,"aria-label":c,className:"shrink-0 p-1"})]});if(!C)return O;const _=[...d,t],j=lr(r,s,f),k=we(r,s,f,_.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[O,n.jsx(it,{title:t,level:u,summary:j,errorCount:k.length+(A?1:0),defaultExpanded:v,children:n.jsx(Oe,{schema:s,value:r,onChange:i,path:_,level:u+1})})]})},No=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,inputClassName:c}=Se(),d=e.additionalProperties===!0||e.additionalProperties==null?{type:"string"}:typeof e.additionalProperties=="object"?Y(e.additionalProperties,i):{type:"string"},u=Sn(d),[p,g]=h.useState(()=>Object.entries(t??{}).map(([N,S])=>Rr(N,S))),f=N=>Object.fromEntries(N.filter(S=>S.key!=="").map(S=>[S.key,S.value])),m=(N,S)=>{const C=p.map((E,R)=>R===N?{...E,key:S}:E);g(C),r(f(C))},v=(N,S)=>{const C=p.map((E,R)=>R===N?{...E,value:S}:E);g(C),r(f(C))},x=()=>u?Ee(d,i)??Cn(d):"",y=()=>{g(N=>[...N,Rr("",x())])},D=N=>{const S=p.filter((C,E)=>E!==N);g(S),r(f(S))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[p.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noFieldsYet}),p.length>0&&!u&&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})]}),p.map((N,S)=>n.jsx(Co,{pairId:N.id,pairKey:N.key,pairValue:N.value,valueSchema:d,onKeyChange:C=>m(S,C),onValueChange:C=>v(S,C),onRemove:()=>D(S),keyInputPlaceholder:o.keyInputPlaceholder,removeFieldAriaLabel:o.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},N.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(b.DialGhostButton,{label:o.addField,iconBefore:n.jsx($.IconPlus,{size:16,stroke:2}),onClick:y})})]})},jn=({value:e,onChange:t,theme:r=ot.EditorThemes.dark,height:s=240})=>{const{readonly:a}=Se(),[i,o]=h.useState(null),[l,c]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-qv1Z0dLX.cjs")).then(u=>{o(()=>u.DialJsonEditor)})},[]);const d=u=>{const p=u??"";c(p);try{t(JSON.parse(p))}catch{}};return n.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:i&&n.jsx(i,{value:l,currentTheme:r,onChange:d,options:{readOnly:a}})})},Oe=({schema:e,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:o=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:u=new Set,skipUntouched:p=!1,jsonEditorTheme:g}=Se(),f=Y(e,l),m=y=>{d(s.join(".")),r(y)},v=!p||u.has(s.join("."));let x;if(f.oneOf)x=n.jsx(yo,{schema:f,value:t,onChange:m,path:s,level:a});else if(f.anyOf&&f.type!==ee.Object)x=n.jsx(Do,{schema:f,value:t,onChange:m,path:s,level:a});else if(Ue(f)){const y=f.additionalProperties!=null&&f.additionalProperties!==!1,D=!f.properties||Object.keys(f.properties).length===0;y&&D?x=n.jsx(No,{schema:f,value:t,onChange:m,path:s,level:a}):D&&f.additionalProperties!==!1?x=n.jsx(jn,{value:t,onChange:m,theme:g}):x=n.jsx(gt,{schema:f,value:t,onChange:m,path:s,level:a})}else if(f.type===ee.Array)x=n.jsx(vo,{schema:f,value:t,onChange:m,path:s,level:a});else{const y=v&&i&&Tt(t),D=!o&&y?`${f.title??"Field"} is required`:void 0;x=n.jsxs(n.Fragment,{children:[n.jsx(In,{schema:f,value:t,onChange:m,invalid:y}),n.jsx(b.DialErrorText,{text:D})]})}return c?c(s,f,x):x},Io=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:i=!0,inputClassName:o,variant:l=qe.Sections,onChange:c,onPropertyChange:d,onDefaultValues:u,renderField:p,skipUntouched:g=!1,jsonEditorTheme:f,acceptableResourceTypes:m})=>{const v=h.useMemo(()=>({...mo,...r}),[r]),x=h.useMemo(()=>t||(Ee(e,e)??{}),[]),[y,D]=h.useState(x),[N,S]=h.useState(new Set),C=h.useCallback(j=>{S(k=>k.has(j)?k:new Set([...k,j]))},[]);h.useEffect(()=>{u?.(x)},[]);const E=(j,k)=>{const F={...y,[j]:k};D(F),c?.(F),d?.(j,k)},R=new Set(Object.keys(e.properties??{})),A=Object.keys(y).filter(j=>!R.has(j)),O=yn(Object.entries(e.properties??{}).filter(([,j])=>!Y(j,e).isHidden)),_=e.required??[];return n.jsx(vn.Provider,{value:{rootSchema:e,texts:v,readonly:a,defaultExpanded:i,inputClassName:o,jsonEditorTheme:f,acceptableResourceTypes:m,renderField:p,touchedPaths:N,markTouched:C,skipUntouched:g},children:n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-4",s),children:[O.map(([j,k])=>{const F=Y(k,e),G=F.title??k.title??bt(j),te=_.includes(j),U=y[j];if(l===qe.Flat)return n.jsx(Nn,{schema:k,value:U,onChange:V=>E(j,V),path:[j],level:0,required:te,label:G},j);if(l===qe.FlatSections)return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:G}),n.jsx(Oe,{schema:k,value:U,onChange:V=>E(j,V),path:[j],level:0,required:te})]},j);const B=we(U,F,e,j),z=j+".",q=!g||N.has(j)||[...N].some(V=>V.startsWith(z));return n.jsx(it,{title:G,description:F.description,level:0,defaultExpanded:i,errorCount:q?te&&Tt(U)?Math.max(B.length,1):B.length:0,children:n.jsx(Oe,{schema:k,value:U,onChange:V=>E(j,V),path:[j],level:1,required:te})},j)}),A.map(j=>{const k=bt(j),F=n.jsx(jn,{value:y[j],onChange:G=>E(j,G),theme:f});return l===qe.Sections?n.jsx(it,{title:k,level:0,defaultExpanded:i,children:F},j):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:k}),F]},j)})]})})},So=e=>({info:n.jsx($.IconInfoCircleFilled,{size:e.size}),error:n.jsx($.IconAlertCircleFilled,{size:e.size}),warning:n.jsx($.IconAlertTriangleFilled,{size:e.size}),success:n.jsx($.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(b.Spinner,{size:e.size}),general:n.jsx($.IconCheck,{size:e.size,stroke:e.stroke})}),jo={[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"},To={[b.NotificationVariant.Info]:"status",[b.NotificationVariant.Success]:"status",[b.NotificationVariant.Warning]:"alert",[b.NotificationVariant.Error]:"alert",[b.NotificationVariant.Loading]:"status",[b.NotificationVariant.General]:"status"},wo="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",cr=({variant:e=b.NotificationVariant.Info,type:t=b.NotificationType.Toast,title:r,message:s,className:a,iconSize:i=24,iconStroke:o=2,closable:l=!1,onClose:c,children:d,textClassName:u,...p})=>{const g=h.useMemo(()=>So({size:i,stroke:o})[e],[e,i,o]),f=u??(t===b.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:To[e],...p,className:I.mergeClasses(wo,jo[e],t===b.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===b.NotificationType.SectionMessage&&e===b.NotificationVariant.Loading&&"border-secondary",a),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:n.jsx(M.DialIcon,{icon:g})}),r?n.jsxs("div",{className:I.mergeClasses("flex min-w-0 text-primary break-words",f),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})]}),d,l&&n.jsx(P.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:m=>c?.(m)})]})},kr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Eo=e=>e===1?"!truncate !whitespace-nowrap":`${kr[e]??kr[2]} !whitespace-normal`,Oo=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const i=Eo(a);if(!t.trim())return n.jsx(P.EllipsisTooltip,{className:I.mergeClasses(i,s),text:e});const o=e.toLowerCase().indexOf(t.toLowerCase()),l=o===-1?e:n.jsxs(n.Fragment,{children:[e.slice(0,o),n.jsx("mark",{className:I.mergeClasses("text-accent bg-control-accent-alpha-hover",r),children:e.slice(o,o+t.length)}),e.slice(o+t.length)]});return n.jsx(P.EllipsisTooltip,{className:I.mergeClasses(i,s),text:l})},Ao=({className:e,children:t,...r})=>n.jsx("article",{...r,className:I.mergeClasses("relative flex flex-col gap-3 rounded-[20px] border-2 border-transparent p-5","bg-layer-raised shadow-md transition-[transform,box-shadow] duration-200 ease-out hover:-translate-y-[3px] hover:shadow-lg motion-reduce:transition-none motion-reduce:hover:translate-y-0",e),children:t}),Qe=(e,t)=>({type:s,...a})=>n.jsx(cr,{...a,variant:e,type:s||t}),Je=(e,t)=>({variant:s,...a})=>n.jsx(cr,{...a,variant:s||t,type:e}),_o=Qe(b.NotificationVariant.Error,b.NotificationType.Toast),Ro=Qe(b.NotificationVariant.Info,b.NotificationType.Toast),ko=Qe(b.NotificationVariant.Success,b.NotificationType.Toast),Po=Qe(b.NotificationVariant.Warning,b.NotificationType.Toast),Lo=Qe(b.NotificationVariant.Loading,b.NotificationType.Toast),Mo=Qe(b.NotificationVariant.General,b.NotificationType.Toast),Fo=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Error),Bo=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Info),zo=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Success),$o=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Warning),Ho=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Loading),Vo=Je(b.NotificationType.SectionMessage,b.NotificationVariant.General);var be=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(be||{});const Go="en-GB",Uo={[be.Date]:"Select date",[be.DateTime]:"Select date and time",[be.Time]:"--:--",[be.Weekday]:"Select day"},Tn="flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus",wn="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",En="!border-error",Ko="z-[53] flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Wo="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",qo="bg-control-accent text-control-permanent",Zo="text-accent dial-small-semi-text",Yo="text-control-disable-primary",On="text-secondary",Xo=n.jsx($.IconCalendar,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On}),Pr={prev:n.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Qo=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(i,o)=>{const l=new Date(a);return l.setDate(a.getDate()+o),l})},Lr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Mr=(e,t,r)=>{const s=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(s<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s>a)return!0}return!1},Jo=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Fr=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),el=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),dt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Br=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},tl=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),rl=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const s=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),s.length===0)return r;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${r}:${a}`},An=5,_n=e=>e.charAt(0).toUpperCase()+e.slice(1),nl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return _n(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),sl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return{value:String(r+1),label:_n(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),zr=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:i,panel:o,labelledBy:l,panelLabel:c})=>{const d=M.useThemeScope(),[u,p]=h.useState(!1),{refs:g,floatingStyles:f,context:m}=le.useFloating({open:u,onOpenChange:S=>p(t?!1:S),placement:"bottom-start",whileElementsMounted:le.autoUpdate,middleware:[le.offset(8),le.flip({padding:8}),le.shift({padding:8})]}),v=le.useClick(m,{enabled:!t}),x=le.useDismiss(m),y=le.useRole(m,{role:"dialog"}),{getReferenceProps:D,getFloatingProps:N}=le.useInteractions([v,x,y]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":u,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:I.mergeClasses(Tn,"focus-visible:outline focus-visible:outline-focus",r&&En,t&&wn,i),...D(),children:s}),u&&n.jsx(le.FloatingPortal,{children:n.jsx(le.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:f,"aria-label":c,className:I.mergeClasses(Ko,d,a),...N(),children:o(()=>p(!1))})})})]})},$r=({id:e,value:t,onChange:r,onBlur:s,disabled:a,invalid:i,className:o,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[u,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:u,onChange:f=>{const m=rl(f.target.value);p(m),tl(m)&&r(m)},onBlur:s,className:I.mergeClasses(Tn,i&&En,a&&wn,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},al=({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:u,maxDate:p,locale:g=Go,fieldClassName:f,showTimezone:m=!1})=>{const v=i??Uo[e],x=t instanceof Date?t:null,y=h.useId(),D=c??y,N=a?.id??`${D}-label`,S=!!a?.label,C=typeof a?.label=="string"?a.label:void 0,E=S?`${N} ${D}`:void 0,R=a?n.jsx(P.Label,{...a,id:N,htmlFor:D}):null,[A,O]=h.useState(()=>x??new Date),_=h.useMemo(()=>new Date,[]),j=h.useMemo(()=>m?bn({locale:g}):null,[m,g]),k=h.useMemo(()=>nl(g),[g]),F=h.useMemo(()=>sl(g),[g]),G=h.useMemo(()=>Qo(A.getFullYear(),A.getMonth()),[A]),te=q=>{O(V=>new Date(V.getFullYear(),V.getMonth()+q,1))},U=(q,V)=>{if(Mr(q,u,p))return;const se=e===be.DateTime&&x?Br(q,dt(x)):q;r?.(se),e===be.Date&&V()},B=q=>{r?.(Br(x??new Date,q))},z=()=>x?e===be.DateTime?`${Fr(x,g)}, ${dt(x)}`:Fr(x,g):v;if(e===be.Time){const q=typeof t=="string"?t:x?dt(x):"";return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d),children:[R,n.jsx($r,{id:D,value:q,onChange:V=>r?.(V),onBlur:s,disabled:o,invalid:l,placeholder:v,className:f,timezoneLabel:j})]})}if(e===be.Weekday){const q=typeof t=="string"?t:void 0,V=F.find(se=>se.value===q);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d),children:[R,n.jsx(zr,{id:D,disabled:o,invalid:l,labelledBy:E,panelLabel:C??v,fieldClassName:f,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!V&&"text-secondary"),children:V?.label??v}),n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On})]}),panel:se=>n.jsx("div",{role:"listbox","aria-label":C??v,className:"flex flex-col gap-0.5",children:F.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),children:[R,n.jsx(zr,{id:D,disabled:o,invalid:l,labelledBy:E,panelLabel:C??v,fieldClassName:f,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!x&&"text-secondary"),children:z()}),Xo]}),panel:q=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(P.StaticIconButton,{"aria-label":"Previous month",icon:Pr.prev,size:T.ElementSize.Small,onClick:()=>te(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Jo(A,g)}),n.jsx(P.StaticIconButton,{"aria-label":"Next month",icon:Pr.next,size:T.ElementSize.Small,onClick:()=>te(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[k.map(V=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:V},V)),G.map(V=>{const se=V.getMonth()!==A.getMonth(),X=Lr(V,x),W=Lr(V,_),re=Mr(V,u,p);return n.jsx("button",{type:"button",disabled:re,"aria-label":el(V,g),"aria-pressed":X,"aria-current":W?"date":void 0,className:I.mergeClasses(Wo,se&&Yo,W&&!X&&Zo,X&&qo,re&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>U(V,q),children:V.getDate()},V.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($r,{ariaLabel:"Time",value:x?dt(x):"",onChange:B,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},il=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const i=n.jsx(M.DialIcon,{icon:n.jsx($.IconFolder,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.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:s,ariaLabel:a,separator:n.jsx(M.DialIcon,{icon:n.jsx($.IconChevronRight,{size:14,stroke:ie.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")})},et=({label:e,variant:t,appearance:r=T.ButtonAppearance.Solid,size:s=T.ElementSize.Standard,className:a,textClassName:i,iconAfter:o,iconBefore:l,type:c="button",tooltipProps:d,href:u,target:p,rel:g,disabled:f,...m})=>{const v=I.mergeClasses("dial-kit-base-button",t&&P.getButtonClassNames(t,r),s===T.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===T.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===T.ElementSize.Small&&"dial-kit-base-button-small",r!==T.ButtonAppearance.Link&&(s===T.ElementSize.Small?"px-2":"px-4"),s!==T.ElementSize.Small&&r!==T.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,y=T.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),D=n.jsxs(n.Fragment,{children:[n.jsx(M.DialIcon,{icon:l}),e&&n.jsx("span",{className:i,children:e}),n.jsx(M.DialIcon,{icon:o})]}),N=m,S=u!==void 0?n.jsx("a",{...N,href:f?void 0:u,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":f||void 0,tabIndex:f?-1:N.tabIndex,onClick:f?void 0:N.onClick,className:v,"aria-label":y,children:D}):n.jsx("button",{...m,type:c,disabled:f,className:v,"aria-label":y,children:D});return d?n.jsx(P.Tooltip,{asChild:!0,...d,children:S}):S},dr=(e,t)=>({appearance:s,...a})=>n.jsx(et,{...a,variant:e,appearance:s||t}),ur=(e,t)=>({variant:s,...a})=>n.jsx(et,{...a,variant:s||t,appearance:e}),Rn=dr(T.ButtonVariant.Primary,T.ButtonAppearance.Solid),fr=dr(T.ButtonVariant.Neutral,T.ButtonAppearance.Solid),ol=dr(T.ButtonVariant.Danger,T.ButtonAppearance.Solid),ll=ur(T.ButtonAppearance.Link,T.ButtonVariant.Primary),cl=ur(T.ButtonAppearance.Ghost,T.ButtonVariant.Primary),dl=ur(T.ButtonAppearance.Outlined,T.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":T.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx($.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(T.DialTooltip,{...r,children:o}):o},fl=e=>n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",e&&"rotate-180")}),pl=({variant:e,appearance:t,items:r,...s})=>{const[a,i]=h.useState(!1),o=h.useMemo(()=>fl(a),[a]);return n.jsx("div",{children:n.jsx(P.Dropdown,{items:r,onOpenChange:l=>i(l),children:n.jsx(et,{...s,iconAfter:o,variant:e||T.ButtonVariant.Primary,appearance:t||T.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":a})})})},kn=({label:e,size:t,isOpen:r=!1,"aria-label":s,...a})=>{const i=t===T.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return n.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":r,"aria-label":s?`${s} ${e}`:void 0,className:I.mergeClasses("dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus","flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary","hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",i,a.className),...a,children:[e,n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",r&&"rotate-180")})]})},gl=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:i,placement:o="bottom-end",matchReferenceWidth:l=!1,listClassName:c,ariaLabel:d})=>{const[u,p]=h.useState(!1),[g,f]=h.useState(r??e[0]?.key),m=t!==void 0,v=m?t:g,x=h.useMemo(()=>{const D=e.find(N=>N.key===v);return D?.label?String(D.label):""},[e,v]),y=h.useCallback(({key:D})=>{const N=e.find(S=>S.key===D);N&&(m||f(D),s?.(N))},[e,m,s]);return n.jsx(P.Dropdown,{items:e,placement:o,matchReferenceWidth:l,listClassName:c,disabled:i,onOpenChange:p,onItemClick:y,children:n.jsx(kn,{label:x,size:a,isOpen:u,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),children:e}):null,Le=({...e})=>n.jsx(Pe,{...e,variant:b.CaptionType.Error}),hl="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",ml={[T.ElementSize.Small]:"size-[24px]",[T.ElementSize.Standard]:"size-[40px]",[T.ElementSize.Large]:"size-[48px]"},xl=({icon:e,onClick:t,disabled:r,size:s=T.ElementSize.Standard,className:a})=>n.jsx("div",{className:I.mergeClasses("border-l border-tertiary",ml[s]),children:n.jsx(P.IconButton,{className:I.mergeClasses(hl,s===T.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),bl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Pn=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!bl.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}}}}},Ln={[T.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[T.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[T.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},Ge=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:i=T.ElementSize.Standard,...o})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",Ln[i].stackGap,a),children:[e&&n.jsx(P.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Mn,{id:s,size:i,...o}),n.jsx(Le,{text:t}),!t&&n.jsx(Pe,{text:r})]})]}),Mn=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:i,iconBefore:o,iconAfter:l,wrapperClassName:c,type:d,inputRef:u,value:p,tooltipText:g,min:f,onChange:m,max:v,inputButtonProps:x,wrapperRef:y,size:D=T.ElementSize.Standard,...N})=>{const S=Ln[D],C=h.useRef(null),E=le.useMergeRefs([u,C]),R=d==="number"||f!==void 0||v!==void 0;h.useEffect(()=>{const j=C.current;if(!j||!R||t)return;const k=F=>{F.preventDefault()};return j.addEventListener("wheel",k,{passive:!1}),()=>{j.removeEventListener("wheel",k)}},[t,R,d]);const A=j=>{Pn(j,d,f,v)},O=j=>{const k=j.currentTarget.value;if(R&&k!==""){const F=parseFloat(k);if(isNaN(F)&&k!=="-"&&k!=="."||!isNaN(F)&&(f!==void 0&&F<+f||v!==void 0&&F>+v))return}m?.(k||void 0)},_=()=>n.jsxs("div",{ref:y,className:I.mergeClasses("dial-kit-input flex flex-row items-center justify-between",S.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&S.paddingStart,!x&&S.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(Mn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:D,id:`${r}_textBefore`})}),n.jsx(M.DialIcon,{icon:o}),i,n.jsx("input",{ref:E,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:O,onKeyDown:A,min:f,disabled:t,max:v,...N}),a&&n.jsxs("p",{className:I.mergeClasses("text-secondary",S.postfixText),children:[" ",a]}),n.jsx(M.DialIcon,{icon:l}),x&&n.jsx(xl,{size:D,...x,disabled:t})]});return t&&d!=="password"?n.jsx(P.Tooltip,{tooltip:g||p,children:_()}):_()};var Ye=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(Ye||{});const vl="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",yl={[Ye.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Ye.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Dl="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Cl="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ze=({label:e,icon:t,appearance:r=Ye.Outlined,selected:s=!1,disabled:a=!1,closable:i=!1,removeLabel:o,className:l,title:c,onClick:d,onRemove:u,onKeyDown:p,...g})=>{const f=r===Ye.Selectable,m=!!d&&!a,v=i&&!!u&&!a,x=f&&s,y=D=>{p?.(D),!(!m||D.defaultPrevented)&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),D.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":f&&m?s:void 0,onClick:a?void 0:d,onKeyDown:y,className:I.mergeClasses(vl,x?"dial-tiny-semi-text":"dial-tiny-text",yl[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Dl,Cl],l),children:[t&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),n.jsx("span",{className:"truncate",title:c??e,children:e}),v&&n.jsx(P.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:T.ElementSize.Small,"aria-label":o??`Remove ${e}`,icon:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:D=>{D.stopPropagation(),u?.(D)}})]})},Fn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx(n.Fragment,{children:t.map(s=>{const a=e.find(i=>i.value===s);return n.jsx(Ze,{label:a?.label??s,closable:!!r,onRemove:i=>r?.(i,s),icon:a?.icon,className:"max-w-full border border-tertiary"},s)})}),Nl=I.mergeClasses("w-full flex flex-col"),Il=P.overlayItemClassName,Sl="!max-w-[var(--reference-width)]",jl="max-h-[344px] overflow-y-auto",Tl=P.overlayGap,wl=P.overlaySubMenuClassName,El=n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Ol="text-secondary transition-transform",Al=8,_l=n.jsx($.IconSearch,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Rl=n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),kl=n.jsx(P.SvgNoData,{width:H.DIAL_ICON_SIZE.LG,height:H.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),Pl=({opt:e,selectedValues:t,mark:r=P.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:i,refs:o,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:u}=M.useSubMenuFloating(Tl,"listbox",!!e.disabled),p=e.children?.some(f=>t.includes(f.value)),g=n.jsx(P.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:El,...d()});return n.jsxs(le.FloatingNode,{id:i,children:[e.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(M.SubMenuPanel,{refs:o,floatingStyles:l,context:c,getFloatingProps:u,role:"listbox",surfaceClassName:wl,children:e.children.map(f=>{const m=n.jsx(P.MenuItem,{role:"option","aria-selected":t.includes(f.value),"aria-disabled":!!f.disabled,disabled:f.disabled,mark:r,selected:t.includes(f.value),ellipsisLabel:!0,icon:f.icon,label:f.labelNode??f.label,rightControl:f.rightControl,onClick:()=>!f.disabled&&s(f.value)});return n.jsx(h.Fragment,{children:f.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:f.interactiveTooltip.placement,content:f.interactiveTooltip.content,contentClassName:f.interactiveTooltip.contentClassName,children:m}):m},f.value)})})]})},Ll=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:i=T.ElementSize.Standard,prefix:o,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:u,caption:p,ariaLabel:g,searchable:f=!1,searchSize:m=T.ElementSize.Standard,searchPlaceholder:v,selectAll:x=!1,invalid:y,selectAllLabel:D="Select all",selectedOptionMark:N=P.MenuItemMark.Tint,emptyStateTitle:S="No options available",emptyStateDescription:C,emptyStateIcon:E,disabled:R=!1,className:A,fieldClassName:O,listClassName:_,closable:j=!1,header:k,footer:F,onClose:G,onChange:te,dismissRef:U,onFooterClick:B,open:z,onOpenChange:q,onSearchQueryChange:V,customMultiSelectTagsRenderer:se})=>{const X=h.useId(),W=r||X,re=`list-${W}`,de=i===T.ElementSize.Small,[ue,ce]=h.useState(!1),pe=z!==void 0,ge=pe?!!z:ue,fe=h.useCallback(L=>{pe||ce(L),q?.(L)},[pe,q]),[K,Q]=h.useState(""),Ne=h.useCallback(L=>{L!==K&&(Q(L||""),V?.(L||""))},[V,K]),Me=s!==void 0,[he,Fe]=h.useState(a),je=Me?s:he,ne=h.useMemo(()=>t?Array.isArray(je)?je:[]:typeof je=="string"?[je]:[],[je,t]),_e=h.useMemo(()=>{const L=K.trim().toLowerCase();return L?e.filter(oe=>oe.label.toLowerCase().includes(L)):e},[e,K]);h.useEffect(()=>{ge||Ne("")},[ge,Ne]);const Ie=h.useCallback(L=>{Me||Fe(L),te?.(L)},[Me,te]),Be=h.useCallback(L=>{if(t){const oe=new Set(ne);oe.has(L)?oe.delete(L):oe.add(L),Ie(Array.from(oe));return}Ie(L),fe(!1)},[t,Ie,fe,ne]),tt=h.useCallback((L,oe)=>{if(L.stopPropagation(),!t){Ie("");return}const lt=ne.filter(Kn=>Kn!==oe);Ie(lt)},[t,ne,Ie]),ye=h.useMemo(()=>_e.filter(L=>!L.disabled),[_e]),ze=h.useMemo(()=>ye.filter(L=>ne.includes(L.value)).length,[ye,ne]),{allSelectedInFiltered:Re,someSelectedInFiltered:me}=h.useMemo(()=>{const L=ye.length>0&&ze===ye.length;return{allSelectedInFiltered:L,someSelectedInFiltered:ze>0&&!L}},[ye,ze]),wt=h.useCallback(()=>{if(!(!t||ye.length===0))if(Re){const L=new Set(ye.map(oe=>oe.value));Ie(ne.filter(oe=>!L.has(oe)))}else{const L=new Set(ne);ye.forEach(oe=>L.add(oe.value)),Ie(Array.from(L))}},[Re,t,ye,ne,Ie]),Te=ne.length>0,$e=!t&&Te?ne[0]:void 0,w=h.useMemo(()=>$e?e.find(L=>L.value===$e)??e.flatMap(L=>L.children??[]).find(L=>L.value===$e):void 0,[e,$e]),J=w?o?`${o} ${w.label}`:w.label:void 0,xe=h.useMemo(()=>t?Te?n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:se?.(e,ne,tt)??n.jsx(Fn,{options:e,selectedValues:ne,handleRemoveTag:tt})}):null:!w||!w.labelNode&&!w.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(P.EllipsisTooltip,{text:w.labelNode??J}),w.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:w.description})]}),[se,tt,Te,t,e,J,ne,w]),Et=t||xe?"":J||(l&&s?l:""),Hn=typeof d?.label=="string"?d.label:void 0,Vn=xe?[T.resolveAccessibleName(g,Hn),t?ne.map(L=>e.find(oe=>oe.value===L)?.label??L).join(", "):J].filter(Boolean).join(", ")||void 0:T.resolveAccessibleName(g);h.useImperativeHandle(U,()=>({dismiss:()=>{fe(!1)}}));const Gn=h.useCallback(L=>{R||(L.key==="ArrowDown"||L.key==="ArrowUp")&&(L.preventDefault(),ge||fe(!0))},[R,ge,fe]),Un=()=>n.jsxs("div",{id:re,role:"listbox","aria-multiselectable":t||void 0,className:Nl,children:[k&&n.jsx(n.Fragment,{children:typeof k=="function"?k():k}),(f||j)&&(e.length>Al||!!K)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(Ge,{id:`search-${W}`,size:m,placeholder:v,"aria-label":v||"Search options",onChange:L=>Ne(L),value:K,iconBefore:_l,containerClassName:"w-full"}),j&&n.jsx(P.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:T.ElementSize.Small,icon:Rl,onClick:L=>{G?.(L),fe(!1)}})]}),t&&x&&ye.length>0&&n.jsx("div",{className:I.mergeClasses(Il,"mt-2"),children:n.jsx(P.Checkbox,{id:`${W}-selectAll`,labelProps:{label:D},isSelected:Re,isIndeterminate:me,onChange:wt})}),n.jsx("div",{role:"none",className:jl,children:_e.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(M.DialNoDataContent,{icon:E??kl,title:S,description:C})}):_e.map(L=>{const oe=ne.includes(L.value);if(L.children?.length)return n.jsx(Pl,{opt:L,selectedValues:ne,mark:t?P.MenuItemMark.Checkbox:N,onSelect:Be},L.value);const lt=t?n.jsx(P.MenuItem,{id:`${W}-${L.value}`,role:"option","aria-selected":oe,"aria-disabled":!!L.disabled,disabled:L.disabled,mark:P.MenuItemMark.Checkbox,selected:oe,icon:L.icon,label:L.labelNode??L.label,description:L.description,rightControl:L.rightControl,onClick:()=>Be(L.value)}):n.jsx(P.MenuItem,{role:"option","aria-selected":oe,"aria-disabled":!!L.disabled,disabled:L.disabled,mark:N,selected:oe,ellipsisLabel:!0,icon:L.icon,label:L.labelNode??L.label,description:L.description,rightControl:L.rightControl,onClick:()=>!L.disabled&&Be(L.value)});return n.jsx(h.Fragment,{children:L.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:L.interactiveTooltip.placement,content:L.interactiveTooltip.content,contentClassName:L.interactiveTooltip.contentClassName,children:lt}):lt},L.value)})}),F&&n.jsx("div",{onClick:L=>{B?.(L),B&&fe(!1)},children:typeof F=="function"?F():F})]});return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",A),children:[d&&n.jsx(P.Label,{...d,htmlFor:W}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(P.Dropdown,{open:ge,onOpenChange:fe,disabled:R,closable:j,onClose:G,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:I.mergeClasses(Sl,_),className:"w-full",renderOverlay:Un,children:n.jsx(Ge,{id:W,size:i,disabled:R,invalid:y,value:Et,placeholder:xe?void 0:c,readOnly:!0,iconBefore:t?void 0:w?.icon,iconAfter:n.jsx($.IconChevronDown,{size:de?H.DIAL_ICON_SIZE.SM:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses(Ol,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":re,"aria-autocomplete":"none","aria-label":Vn,containerClassName:"w-full",wrapperClassName:I.mergeClasses(!R&&"cursor-pointer",t&&Te&&["!h-auto flex-wrap py-1.5",de?"min-h-[24px]":"min-h-[40px]"],O),className:I.mergeClasses("cursor-pointer",xe&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Gn,children:xe})}),n.jsx(Le,{text:u}),!u&&n.jsx(Pe,{text:p})]})]})};var Bn=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(Bn||{});const Hr={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Ml=e=>typeof e=="boolean"?Hr[e?"both":"none"]:Hr[e],Fl=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const u=I.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d.invalid&&"dial-kit-input-error",d.disabled&&"dial-kit-input-disable",Ml(i),e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",a),children:[o&&n.jsx(P.Label,{...o,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:u,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(Le,{text:s}),!s&&n.jsx(Pe,{text:l})]})]})},Bl=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=T.ElementSize.Standard,...a})=>{const[i,o]=h.useState(!1),l=i&&!r;return h.useEffect(()=>{r&&o(!1)},[r]),n.jsx(Ge,{...a,size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx($.IconEyeOff,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx($.IconEye,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>o(c=>!c)})})},zl=/^0+\.(\d+)?$/,$l=/^0+/,Hl=[".","-","+","e","E"],Vr=e=>!e||e==="-"?e:String(e).match(zl)?String(e).replace($l,"0"):Number(e),Vl=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>{if(e&&Hl.includes(d.key)){d.preventDefault();return}Pn(d,"number",r,s),a?.(d)},c=d=>{if(e){const u=d.clipboardData.getData("text"),p=u.replace(/\D/g,"");if(p!==u&&(d.preventDefault(),p)){const g=d.currentTarget,f=g.selectionStart??0,m=g.selectionEnd??0,v=g.value.slice(0,f)+p+g.value.slice(m);t?.(Vr(v))}}i?.(d)};return n.jsx(Ge,{...o,type:"number",min:r,max:s,onChange:d=>t?.(Vr(d)),onKeyDown:l,onPaste:c})},Gl="z-[52] flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Ul="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Kl="flex flex-row items-center justify-between px-6 py-4",Wl="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",ql="border-b border-tertiary",Zl="flex flex-row items-center gap-2 px-6 py-4",Yl="border-t border-tertiary",Ht="flex shrink-0 flex-row items-center gap-2",Xl={[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]"},pr=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:i,titleClassName:o,headerClassName:l,bodyClassName:c,children:d,footer:u,footerClassName:p,onClose:g,onBack:f,backAriaLabel:m="Back",headerActions:v,headerDivider:x=!1,mainButtons:y,additionalButtons:D,additionalButtonsOnLeft:N=!1,footerDivider:S=!1,size:C=b.PopupSize.Md,hideClose:E=!1,closeAriaLabel:R="Close dialog",closeOnOutsideClick:A=!0,preventKeyboardOnOpen:O=!1})=>{const _=M.useThemeScope(),j=h.useRef(null),k=h.useId(),{refs:F,context:G}=le.useFloating({open:e,onOpenChange:W=>{W||g?.(null)}}),te=le.useRole(G,{role:"dialog"}),U=le.useDismiss(G,{outsidePress:A}),{getFloatingProps:B}=le.useInteractions([te,U]);if(!e)return null;const z=typeof t=="string"?`popup-heading-${k}`:void 0,q=W=>W?typeof W=="string"?n.jsx("h2",{id:z,className:I.mergeClasses(Wl,o),children:n.jsx(P.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:n.jsx("span",{}),V=E?null:n.jsx(P.CloseButton,{ariaLabel:R,onClose:W=>g?.(W)}),se=(W,re=[])=>re.map(({variant:de=T.ButtonVariant.Neutral,...ue},ce)=>n.jsx(et,{variant:de,...ue},`${W}-${ce}`)),X=()=>{if(u!==void 0)return u;if(!y?.length&&!D?.length)return null;const W=se("additional",D);return n.jsxs("div",{className:I.mergeClasses(Zl,S&&Yl,p),children:[N&&W.length>0&&n.jsx("div",{className:Ht,children:W}),n.jsxs("div",{className:I.mergeClasses(Ht,"ml-auto"),children:[!N&&W,se("main",y)]})]})};return n.jsx(le.FloatingPortal,{id:s,children:n.jsx(le.FloatingOverlay,{className:I.mergeClasses(Gl,_,i),children:n.jsx(le.FloatingFocusManager,{context:G,initialFocus:O?j:F.floating,children:n.jsxs("div",{ref:F.setFloating,...B(),role:"dialog","aria-modal":"true","aria-labelledby":z,"aria-label":z?void 0:r,className:I.mergeClasses(Ul,Xl[C],a),children:[O&&n.jsx("div",{ref:j,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:I.mergeClasses(Kl,x&&ql,l),children:[f&&n.jsx(P.GhostIconButton,{"aria-label":m,size:T.ElementSize.Small,className:"mr-2",onClick:f,icon:n.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),q(t),v?n.jsxs("div",{className:Ht,children:[v,V]}):V]}),n.jsx("div",{className:I.mergeClasses("grow overflow-auto",c),children:d}),X()]})})})})},Ql="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Jl="text-secondary dial-small-paragraph-text px-6 pb-4",ec="px-6 py-4 h-[120px]",tc="Cancel",rc="Ok",Vt={[b.ConfirmationPopupVariant.Info]:{confirm:{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Solid}},[b.ConfirmationPopupVariant.Danger]:{container:"border-t-4 border-error",confirm:{variant:T.ButtonVariant.Danger,appearance:T.ButtonAppearance.Solid}}},nc=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=rc,cancelLabel:i=tc,isLoading:o=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:u,onConfirm:p,onCancel:g,children:f,variant:m=b.ConfirmationPopupVariant.Info,size:v=b.PopupSize.Sm,footer:x,hideClose:y,...D})=>{const N=o?null:n.jsxs("div",{className:Ql,children:[n.jsx(fr,{label:i,onClick:()=>g?g():u?.()}),n.jsx(et,{variant:Vt[m].confirm.variant,appearance:Vt[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),S=h.useCallback(()=>o?n.jsx("div",{className:ec,children:n.jsx(b.Spinner,{size:40})}):f??(t?n.jsx("div",{className:I.mergeClasses(Jl,r),children:t}):null),[f,t,o,r]);return n.jsx(pr,{...D,open:s,header:e,className:I.mergeClasses(Vt[m].container,c),onClose:()=>u?.(),footer:x??N,size:v,hideClose:y??(!o&&x===void 0),children:S()})},sc=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,ariaLabel:l,onToggle:c,className:d,headerClassName:u,contentClassName:p})=>{const g=s!==void 0,[f,m]=h.useState(a),v=o?!0:g?s:f,x=h.useId(),y=`accordion-header-${x}`,D=`accordion-content-${x}`,N=()=>{if(i)return;const C=!v;g||m(C),c?.(C)},S=n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"flex min-w-0 flex-col",children:[n.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?n.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!o&&n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",v&&"rotate-90")})]});return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-3 py-3 overflow-hidden bg-transparent ",d),children:[o?n.jsx("div",{id:y,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",u),children:S}):n.jsx("button",{id:y,type:"button","aria-expanded":v,"aria-controls":v?D:void 0,"aria-label":T.resolveAccessibleName(l),disabled:i,onClick:N,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",i?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",u),children:S}),v&&n.jsx("div",{id:D,role:"region","aria-labelledby":y,className:I.mergeClasses("px-4 dial-small-text text-primary",p),children:r})]})},ac=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:i,className:o,...l})=>{const c=h.useId(),d=e??c,u=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),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:d,checked:r,"aria-checked":r,disabled:s,onChange:p,"aria-label":T.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":u,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(P.Label,{size:T.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:u,className:"dial-tiny-text text-secondary ml-[44px]",children:i})]})},ic="flex flex-col gap-2",oc="flex",lc="mt-2 ml-[26px]",cc={[b.RadioGroupOrientation.Column]:"flex-col gap-y-3",[b.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},zn=({items:e,value:t,onChange:r,name:s,id:a,orientation:i=b.RadioGroupOrientation.Column,labelProps:o,disabled:l,error:c,caption:d,ariaLabel:u,className:p,optionsClassName:g,radioClassName:f,contentClassName:m})=>{const v=h.useId(),x=a??v,y=`${x}-label`,D=c?`${x}-error`:void 0,N=!c&&d?`${x}-caption`:void 0,S=T.resolveAccessibleName(o?.label);return n.jsxs("div",{className:I.mergeClasses(ic,p),children:[o&&n.jsx(P.Label,{...o,id:y}),n.jsx("div",{role:"radiogroup","aria-labelledby":S?y:void 0,"aria-label":S?void 0:T.resolveAccessibleName(u),"aria-describedby":[D,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:I.mergeClasses(oc,cc[i],g),children:e.map(C=>{const E=C.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(P.Radio,{id:`${x}-${C.value}`,name:s??x,value:C.value,labelProps:C.label==null?void 0:{label:C.label},"aria-label":C["aria-label"],caption:C.caption,isSelected:E,disabled:l||C.disabled,onChange:r,className:f}),E&&C.content?n.jsx("div",{className:I.mergeClasses(lc,m),children:C.content}):null]},C.value)})}),n.jsx(Le,{id:D,text:c}),!c&&n.jsx(Pe,{id:N,text:d})]})},dc="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",uc="min-w-0 flex-1 truncate text-primary",fc="min-w-0 flex-1 truncate text-secondary",pc="shrink-0 text-secondary",gc="px-6 pb-4",hc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",mc="Cancel",xc="Apply",bc=({items:e,value:t,customValue:r,header:s,onApply:a,id:i,labelProps:o,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:u,onClose:p,isValid:g=!0,applyButtonLabel:f=xc,cancelButtonLabel:m=mc,size:v=b.PopupSize.Md,portalId:x,disabled:y,invalid:D,error:N,caption:S,ariaLabel:C,className:E,fieldClassName:R})=>{const A=h.useId(),O=i??A,_=`${O}-label`,j=`${O}-value`,k=N?`${O}-error`:void 0,F=!N&&S?`${O}-caption`:void 0,[G,te]=h.useState(!1),U=c!==void 0,[B,z]=h.useState(t),q=U?c:B,V=h.useCallback(()=>{y||(U||z(t),te(!0))},[y,U,t]),se=h.useCallback(()=>{te(!1),p?.()},[p]),X=h.useCallback(()=>{u?.(),se()},[u,se]),W=h.useCallback(()=>{a(q),se()},[a,q,se]),re=h.useCallback(K=>{U||z(K),d?.(K)},[U,d]),de=T.resolveAccessibleName(o?.label),ue=de?void 0:T.resolveAccessibleName(C),ce=de?_:ue&&`${O}-name`,pe=T.resolveAccessibleName(s),ge=e.find(K=>K.value===t)?.label,fe=r??ge;return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",E),children:[o&&n.jsx(P.Label,{...o,id:_,htmlFor:O}),n.jsxs("div",{className:"flex flex-col gap-1",children:[ue&&n.jsx("span",{id:ce,className:"sr-only",children:ue}),n.jsxs("button",{type:"button",id:O,disabled:y,"aria-haspopup":"dialog","aria-expanded":G,"aria-labelledby":ce?`${ce} ${j}`:void 0,"aria-describedby":[k,F].filter(Boolean).join(" ")||void 0,onClick:V,className:I.mergeClasses(dc,D&&"dial-kit-input-error",y&&"dial-kit-input-disable",R),children:[n.jsx("span",{id:j,className:fe==null?fc:uc,children:fe??l}),n.jsx($.IconMaximize,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:pc})]}),n.jsx(Le,{id:k,text:N}),!N&&n.jsx(Pe,{id:F,text:S})]}),n.jsx(pr,{open:G,header:s,ariaLabel:pe?void 0:de,portalId:x,size:v,onClose:X,footer:n.jsxs("div",{className:hc,children:[n.jsx(fr,{label:m,onClick:X}),n.jsx(Rn,{label:f,disabled:!g,onClick:W})]}),children:n.jsx("div",{className:gc,children:n.jsx(zn,{id:`${O}-options`,items:e,value:q,onChange:re,orientation:b.RadioGroupOrientation.Column,ariaLabel:de??pe})})})]})},vc=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:i,size:o=T.ElementSize.Small,className:l,...c})=>{const d=h.useCallback(p=>{a?.(p),s?.(!r)},[a,s,r]),u=n.jsx(P.IconButton,{...c,size:o,variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":T.resolveAccessibleName(c["aria-label"],i?.tooltip),onClick:d,className:I.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l)});return i?n.jsx(P.Tooltip,{asChild:!0,...i,children:u}):u},yc=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Dc="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Cc="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",Nc="bg-layer-raised text-accent shadow-xs",Ic="bg-transparent text-secondary",Sc="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",jc="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Tc="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",wc="cursor-not-allowed bg-transparent text-control-disable-primary",Ec=({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,u=h.useCallback(p=>{if(s||!yc.includes(p.key))return;const g=e.filter(y=>!y.disabled);if(g.length===0)return;const f=Math.max(g.findIndex(y=>y.value===t),0),m=g.length-1;let v=f;switch(p.key){case"ArrowRight":case"ArrowDown":v=f===m?0:f+1;break;case"ArrowLeft":case"ArrowUp":v=f===0?m:f-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:u,className:I.mergeClasses(Dc,a),children:e.map(p=>{const g=p.value===t,f=s||p.disabled;return n.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":T.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===d?0:-1,disabled:f,onClick:()=>r(p.value),className:I.mergeClasses(Cc,g?Nc:Ic,f?g?Tc:wc:g?Sc:jc,i),children:[p.icon,p.label]},p.value)})})},Oc=["ArrowRight","ArrowLeft","Home","End"],Ac=({tabs:e,activeTabId:t,onTabChange:r,ariaLabel:s,className:a,tabClassName:i})=>{const o=h.useRef({}),l=e.find(u=>u.id===t),c=l&&!l.disabled?l.id:e.find(u=>!u.disabled)?.id,d=h.useCallback(u=>{if(!Oc.includes(u.key)||e.length===0)return;const p=e.filter(x=>!x.disabled);if(p.length===0)return;const g=Math.max(p.findIndex(x=>x.id===t),0),f=p.length-1;let m=g;switch(u.key){case"ArrowRight":m=g===f?0:g+1;break;case"ArrowLeft":m=g===0?f:g-1;break;case"Home":m=0;break;case"End":m=f;break}u.preventDefault();const v=p[m];o.current[v.id]?.focus(),v.id!==t&&r(v.id)},[e,t,r]);return n.jsx("div",{role:"tablist","aria-label":s,onKeyDown:d,className:I.mergeClasses("flex justify-start gap-1",a),children:e.map(u=>{const p=t===u.id,g=!!u.disabled;return n.jsxs("button",{ref:f=>{o.current[u.id]=f},type:"button",role:"tab","aria-selected":p,disabled:g,tabIndex:u.id===c?0:-1,onClick:()=>r(u.id),className:I.mergeClasses("dial-small-paragraph-semi-text dial-kit-enhanced-target","border-b-2 border-transparent flex items-center gap-2 px-3 py-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",g&&"cursor-not-allowed border-control-disable-primary text-control-disable-primary",!g&&(p?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),i),children:[n.jsx("span",{children:u.label}),u.count!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"bg-layer-sunken text-control-disable-primary",!g&&(p?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:u.count})]},u.id)})})},Qt=(e,t)=>{const r=(t??"").split(",").map(i=>i.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(i=>{if(i.startsWith("."))return s.endsWith(i);if(i.endsWith("/*")){const o=i.slice(0,-1);return a.length>o.length&&a.startsWith(o)}return a===i})},_c=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:i,multiple:o=!1,disabled:l=!1,errorText:c,icon:d,id:u,ariaLabel:p,className:g})=>{const f=h.useId(),m=u??`file-dropzone-${f}`,v=c?`${m}-error`:void 0,[x,y]=h.useState(!1),D=h.useRef(0),N=h.useCallback(_=>{if(_.length===0)return;const j=o?_:_.slice(0,1),k=j.filter(G=>Qt(G,i)),F=j.filter(G=>!Qt(G,i));F.length>0&&a?.(F),k.length>0&&s(k)},[i,o,s,a]),S=h.useCallback(_=>{N(Array.from(_.target.files??[])),_.target.value=""},[N]),C=h.useCallback(()=>{D.current=0,y(!1)},[]),E=h.useCallback(_=>{l||(_.preventDefault(),D.current+=1,y(!0))},[l]),R=h.useCallback(_=>{l||(_.preventDefault(),_.dataTransfer.dropEffect="copy")},[l]),A=h.useCallback(()=>{l||(D.current-=1,D.current<=0&&C())},[l,C]),O=h.useCallback(_=>{_.preventDefault(),!l&&(C(),N(Array.from(_.dataTransfer?.files??[])))},[l,C,N]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(P.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:i,multiple:o,disabled:l,onChange:S,"aria-label":T.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:E,onDragOver:R,onDragLeave:A,onDrop:O,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),children:[d??n.jsx($.IconUpload,{size:H.DIAL_ICON_SIZE.LG,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),n.jsxs("span",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:I.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&n.jsx("span",{className:I.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),n.jsx(Le,{id:v,text:c})]})},Rc=({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},kc=4,Pc=24,Gr=e=>parseFloat(e)||0,Lc=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Mc=()=>{},Fc=({id:e,value:t,defaultValue:r,size:s=T.ElementSize.Standard,labelProps:a,placeholder:i,caption:o,error:l,invalid:c,disabled:d=!1,readOnly:u=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:f="Tags",className:m,fieldClassName:v,tagClassName:x,onChange:y})=>{const D=h.useId(),N=e||D,S=s===T.ElementSize.Small,C=h.useRef(null),E=h.useRef([]),R=h.useRef(null),A=t!==void 0,[O,_]=h.useState(r??[]),j=A?t:O,k=j.length,[F,G]=h.useState(""),[te,U]=h.useState(k),B=!u&&!d,z=h.useCallback(K=>{A||_(K),y?.(K)},[A,y]),q=h.useCallback(K=>Q=>{E.current[K]=Q},[]),V=h.useCallback(()=>{const K=C.current;if(!K||K.clientWidth===0){U(j.length);return}const{paddingLeft:Q,paddingRight:Ne}=getComputedStyle(K);U(Rc({availableWidth:K.clientWidth-Gr(Q)-Gr(Ne)-(u?0:Pc),tagWidths:j.map((Me,he)=>E.current[he]?.offsetWidth??0),overflowChipWidth:R.current?.offsetWidth??0,gap:kc}))},[u,j]);h.useEffect(()=>{if(!p){U(k);return}const K=C.current;if(!K)return;const Q=new ResizeObserver(()=>V());return Q.observe(K),V(),()=>Q.disconnect()},[p,V,k]);const se=I.mergeClasses(p?"shrink-0":"min-w-0",x),X=K=>{const Q=Lc(K.trim()).trim();!Q||j.includes(Q)||z([...j,Q])},W=K=>{z(j.filter(Q=>Q!==K))},re=()=>{X(F),G("")},de=K=>{if(B){if(K.key==="Enter"||K.key===","){K.preventDefault(),re();return}K.key==="Backspace"&&!F&&k>0&&(K.preventDefault(),z(j.slice(0,-1)))}},ue=()=>{B&&F.trim()&&re()},ce=p?j.slice(0,te):j,pe=p?j.slice(te):[],ge=pe.join(", "),fe=k>0&&n.jsxs("span",{role:"list","aria-label":f,className:I.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ce.map(K=>n.jsx(Ze,{role:"listitem",label:K,className:se,disabled:d,closable:B,onRemove:B?()=>W(K):void 0},K)),pe.length>0&&n.jsx(Ze,{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:[j.map((K,Q)=>n.jsx("span",{ref:q(Q),className:"inline-flex",children:n.jsx(Ze,{label:K,className:x,disabled:d,closable:B,onRemove:B?Mc:void 0})},K)),n.jsx("span",{ref:R,className:"inline-flex",children:n.jsx(Ze,{label:`+${k}`,className:x})})]})]});return n.jsx(Ge,{id:N,size:s,labelProps:a,caption:o,error:l,invalid:c,disabled:d,readOnly:u,value:F,placeholder:k>0?void 0:i,"aria-label":g,wrapperRef:C,onChange:K=>G(K??""),onKeyDown:de,onBlur:ue,containerClassName:I.mergeClasses("w-full",m),wrapperClassName:I.mergeClasses(k>0&&["!h-auto",S?"min-h-[24px] py-0.5":"min-h-[40px] py-1.5",p?"flex-nowrap overflow-hidden":"flex-wrap"],v),className:I.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",u&&"cursor-default"),children:fe})},Bc={[T.ElementSize.Small]:H.DIAL_ICON_SIZE.SM,[T.ElementSize.Standard]:H.DIAL_ICON_SIZE.MD,[T.ElementSize.Large]:H.DIAL_ICON_SIZE.MD},zc=({size:e=T.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:i,onChange:o,wrapperClassName:l,inputRef:c,...d})=>{const u=h.useRef(null),p=le.useMergeRefs([c,u]),g=!!i&&!a,f=h.useCallback(()=>{o?.(void 0),u.current?.focus()},[o]);return n.jsx(Ge,{...d,size:e,value:i,disabled:a,onChange:o,placeholder:t,inputRef:p,wrapperClassName:I.mergeClasses(r&&"dial-kit-input-borderless",l),iconBefore:n.jsx($.IconSearch,{size:Bc[e],stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":s,icon:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:f}):void 0})},$c=16,Hc=e=>(e.toString().split(".")[1]??"").length,Vc=({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:u,error:p,onChange:g,containerClassName:f,trackClassName:m,fillClassName:v,className:x,...y})=>{const D=h.useId(),N=e??D,S=u&&!p?`${N}-caption`:void 0,C=p?`${N}-error`:void 0,E=s-r,R=E>0?Math.min(100,Math.max(0,(t-r)/E*100)):0,A=`calc(${R}% + ${(.5-R/100)*$c}px)`,O=c?c(t):t.toFixed(Hc(a)),_=h.useCallback(j=>{g?.(Number(j.target.value))},[g]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",f),children:[(o||d)&&n.jsxs("div",{className:"flex items-center gap-2",children:[o&&n.jsx(P.Label,{...o,htmlFor:N}),d&&n.jsx("span",{"aria-hidden":"true",className:I.mergeClasses("dial-small-text ml-auto",i?"text-control-disable-primary":"text-primary"),children:O})]}),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:A}}),n.jsx("input",{...y,type:"range",id:N,value:t,min:r,max:s,step:a,disabled:i,onChange:_,"aria-label":T.resolveAccessibleName(typeof o?.label!="string"?y["aria-label"]:void 0),"aria-valuetext":c?O:void 0,"aria-describedby":C??S,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(Le,{id:C,text:p}),!p&&n.jsx(Pe,{id:S,text:u})]})]})},Gc=48,Uc=({children:e,title:t,width:r=280,collapsedWidth:s=Gc,isOpened:a,defaultOpened:i=!0,onToggle:o,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:u="Expand sidebar",className:p,titleClassName:g,contentClassName:f,footerClassName:m})=>{const v=a!==void 0,[x,y]=h.useState(i),D=v?a:x,N=`collapsible-sidebar-content-${h.useId()}`,S=D?d:u,C=E=>{const R=!D;v||y(R),o?.(R,E)};return n.jsxs("aside",{"aria-label":c,style:{width:`${D?r:s}px`},className:I.mergeClasses("flex flex-col justify-between",p),children:[n.jsx("div",{id:N,hidden:!D,className:I.mergeClasses("min-h-0 flex-1 overflow-auto p-4",f),children:e}),n.jsx("div",{hidden:D,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",D?"justify-end px-2":"justify-center",m),children:[D&&l,n.jsx(P.IconButton,{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,size:T.ElementSize.Standard,onClick:C,"aria-label":S,"aria-expanded":D,"aria-controls":N,tooltipProps:{tooltip:S},icon:D?n.jsx($.IconChevronsLeft,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx($.IconChevronsRight,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},Kc=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:i,ariaLabel:o,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const u=e===b.ResizableContainerSide.Left,p=u?$.IconChevronLeft:$.IconChevronRight,g=f=>{let m;switch(f.key){case"ArrowLeft":m=r+(u?i:-i);break;case"ArrowRight":m=r+(u?-i:i);break;case"Home":m=s;break;case"End":m=a;break;default:return}f.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:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",u?"right-full":"left-full")})})},Wc=16,$n=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:i,onResize:o,side:l=b.ResizableContainerSide.Right,keyboardStep:c=Wc,ariaLabel:d="Resize panel",className:u,resizeHandlerClassName:p,resizeHandler:g})=>{const[f,m]=h.useState(!1),[v,x]=h.useState(a??t),y=s!==void 0,D=y?s:v,N=h.useRef(null),S=h.useCallback(()=>{m(!0)},[]),C=h.useCallback(()=>{m(!1);const A=N.current?.resizable?.getBoundingClientRect(),O=A?Math.round(A.width):t;y||x(O),i?.(O)},[i,y,t]),E=h.useCallback(A=>{const O=Math.min(r,Math.max(t,A));O!==D&&(y||(x(O),N.current?.updateSize({width:O,height:"100%"})),o?.(O),i?.(O))},[r,t,D,y,o,i]),R=h.useMemo(()=>{const A=l===b.ResizableContainerSide.Left,O=n.jsx(Kc,{side:l,isResizing:f,width:D,minWidth:t,maxWidth:r,step:c,ariaLabel:d,onWidthChange:E,customHandler:g,handlerClassName:p});return{size:y?{width:D,height:"100%"}:void 0,defaultSize:y?void 0:{width:D,height:"100%"},minWidth:t,maxWidth:r,enable:{left:A,right:!A},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:A?O:void 0,right:A?void 0:O},onResizeStart:S,onResize:(_,j,k)=>{o?.(Math.round(k.offsetWidth))},onResizeStop:C}},[l,y,D,t,r,c,d,E,g,p,f,S,C,o]);return n.jsx(b.Resizable,{ref:N,...R,children:n.jsx("div",{className:I.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",u),children:e})})},qc=({enabled:e=!0,children:t,...r})=>e?n.jsx($n,{...r,children:t}):t;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=Ae.DialLabel;exports.DialSwitch=Ae.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=M.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=M.DEFAULT_LOCALE;exports.DialCloseButton=M.DialCloseButton;exports.DialDangerIconButton=M.DialDangerIconButton;exports.DialDateCellRenderer=M.DialDateCellRenderer;exports.DialDropdown=M.DialDropdown;exports.DialEllipsisTooltip=M.DialEllipsisTooltip;exports.DialGhostIconButton=M.DialGhostIconButton;exports.DialGrid=M.DialGrid;exports.DialIcon=M.DialIcon;exports.DialNeutralIconButton=M.DialNeutralIconButton;exports.DialNoDataContent=M.DialNoDataContent;exports.DialPrimaryIconButton=M.DialPrimaryIconButton;exports.DialRadioButton=M.DialRadioButton;exports.DialSecondaryIconButton=M.DialSecondaryIconButton;exports.DialSuccessIconButton=M.DialSuccessIconButton;exports.DialTertiaryIconButton=M.DialTertiaryIconButton;exports.DropdownItemType=M.DropdownItemType;exports.DropdownTrigger=M.DropdownTrigger;exports.DropdownType=M.DropdownType;exports.GridSelectionMode=M.GridSelectionMode;exports.ThemeScope=M.ThemeScope;exports.baseColumnComparator=M.baseColumnComparator;exports.checkColDefsChanges=M.checkColDefsChanges;exports.convertGridDateToDate=M.convertToDate;exports.convertToDate=M.convertToDate;exports.useThemeScope=M.useThemeScope;exports.BASE_ICON_PROPS=H.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=H.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=H.DIAL_ICON_SIZE;exports.mergeClasses=I.mergeClasses;exports.Checkbox=P.Checkbox;exports.CheckboxBox=P.CheckboxBox;exports.CloseButton=P.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=P.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=P.DEFAULT_LOCALE;exports.DangerIconButton=P.DangerIconButton;exports.DateCellRenderer=P.DateCellRenderer;exports.Dropdown=P.Dropdown;exports.EllipsisTooltip=P.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=P.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=P.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=P.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=P.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=P.GRID_THEME_PARAMS;exports.GhostIconButton=P.GhostIconButton;exports.Grid=P.Grid;exports.IconButton=P.IconButton;exports.InfoButton=P.InfoButton;exports.InteractiveTooltip=P.InteractiveTooltip;exports.Label=P.Label;exports.MenuItem=P.MenuItem;exports.MenuItemMark=P.MenuItemMark;exports.NeutralIconButton=P.NeutralIconButton;exports.NoDataContent=P.NoDataContent;exports.PrimaryIconButton=P.PrimaryIconButton;exports.Radio=P.Radio;exports.StaticIconButton=P.StaticIconButton;exports.Tooltip=P.Tooltip;exports.TooltipContainer=P.TooltipContainer;exports.TooltipContent=P.TooltipContent;exports.TooltipPlacement=P.TooltipPlacement;exports.TooltipTrigger=P.TooltipTrigger;exports.ButtonAppearance=T.ButtonAppearance;exports.ButtonVariant=T.ButtonVariant;exports.DialIconButton=T.DialIconButton;exports.DialTooltip=T.DialTooltip;exports.DialTooltipContainer=T.DialTooltipContainer;exports.DialTooltipContent=T.DialTooltipContent;exports.DialTooltipTrigger=T.DialTooltipTrigger;exports.ElementSize=T.ElementSize;exports.EditorThemes=ot.EditorThemes;exports.LazyDialJsonEditor=ot.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=ot.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=ot.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ie.DIAL_KIT_ICON_STROKE;exports.Accordion=sc;exports.AnalyticsCardVariant=st;exports.Button=et;exports.ButtonDropdown=pl;exports.Calendar=al;exports.CalendarMode=be;exports.CaptionText=Pe;exports.CardShell=Ao;exports.CollapsibleSidebar=Uc;exports.ConditionalResizableContainer=qc;exports.ConfirmationPopup=nc;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=er;exports.DangerButton=ol;exports.DialAccordion=Ur;exports.DialAnalyticsBar=ut;exports.DialAnalyticsBarGroup=Jn;exports.DialAnalyticsCard=Yn;exports.DialAnalyticsErrorTag=Jt;exports.DialAnalyticsHistogram=ss;exports.DialAutocompleteInputValue=on;exports.DialCheckbox=Gt;exports.DialDraggableItem=bi;exports.DialDropdownIcon=lo;exports.DialFormPopup=Ai;exports.DialInputPopup=ln;exports.DialLabelledText=ms;exports.DialLoadFileArea=xn;exports.DialLoadFileAreaField=oo;exports.DialNumberInput=Zt;exports.DialPagination=ds;exports.DialPasswordInput=cn;exports.DialRadioGroupPopupField=Ti;exports.DialRemoveButton=It;exports.DialSchemaRenderer=Io;exports.DialSegmentedControl=Si;exports.DialSelect=ke;exports.DialSelectField=Vi;exports.DialSlider=hs;exports.DialSteps=gs;exports.DialTag=He;exports.DialTagInput=an;exports.DialTextarea=vi;exports.ErrorMessageNotification=Fo;exports.ErrorText=Le;exports.ErrorToastNotification=_o;exports.FabButton=ul;exports.FileDropzone=_c;exports.FolderPath=il;exports.GeneralMessageNotification=Vo;exports.GeneralToastNotification=Mo;exports.GhostButton=cl;exports.Highlight=Oo;exports.InfoMessageNotification=Bo;exports.InfoToastNotification=Ro;exports.InlineSelect=gl;exports.InlineSelectTrigger=kn;exports.Input=Ge;exports.JsonSchemaType=ee;exports.LinkButton=ll;exports.LoadingMessageNotification=Ho;exports.LoadingToastNotification=Lo;exports.MultiSelectTags=Fn;exports.NeutralButton=fr;exports.Notification=cr;exports.NumberInput=Vl;exports.OutlinedButton=dl;exports.PasswordInput=Bl;exports.Popup=pr;exports.PrimaryButton=Rn;exports.ProgressBar=as;exports.RadioGroup=zn;exports.RadioGroupPopupField=bc;exports.ResizableContainer=$n;exports.SchemaDisplayMode=at;exports.SchemaOrientation=jt;exports.SchemaRendererVariant=qe;exports.Search=zc;exports.SegmentedControl=Ec;exports.Select=Ll;exports.SelectSize=ht;exports.SelectVariant=mt;exports.Slider=Vc;exports.StepStatus=ve;exports.SuccessMessageNotification=zo;exports.SuccessToastNotification=ko;exports.Switch=ac;exports.Tabs=Ac;exports.Tag=Ze;exports.TagAppearance=Ye;exports.TagInput=Fc;exports.Textarea=Fl;exports.TextareaResize=Bn;exports.ToggleIconButton=vc;exports.WarningMessageNotification=$o;exports.WarningToastNotification=Po;exports.getTimezoneLabel=bn;exports.matchesAccept=Qt;exports.wrapInRootFolder=ho;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./use-file-manager-tabs-9DWkp9IJ.cjs"),_e=require("./Switch-CUKClcEz.cjs"),n=require("react/jsx-runtime"),h=require("react"),H=require("@tabler/icons-react"),ie=require("classnames"),w=require("./DateCellRenderer-Bu40QyHE.cjs"),K=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-Dipy1Ih1.cjs"),P=require("./DateCellRenderer-C3e61i75.cjs"),T=require("./IconButton-DWqoaBWf.cjs"),Wn=require("react-dom"),ot=require("./lazy-tfN4sKhq.cjs"),de=require("@floating-ui/react"),oe=require("./icon-DhjrDQ8I.cjs");function qn(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 hr=qn(h),He=({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(w.DialIcon,{icon:r}),n.jsx(w.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(b.DialButton,{className:"p-0",iconAfter:n.jsx(H.IconX,{size:K.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},Qt=({label:e="Error",className:t})=>n.jsx(He,{label:e,className:I.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var st=(e=>(e.Default="default",e.Compact="compact",e))(st||{});const Zn={[st.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[st.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},Yn=({title:e,value:t,description:r,variant:s=st.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:u,compareValues:d})=>{const p=Zn[s],g=c!==void 0?c:(l??0)>=0,f=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",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:f})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(Qt,{className:"self-start"}):i?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-start"}):d?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(w.DialEllipsisTooltip,{text:d[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:d[0].value})]}),n.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(w.DialEllipsisTooltip,{text:d[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:d[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})]})},er=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],Xn=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Jn=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},ut=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=er,className:l,titleClassName:c,valueClassName:u,inline:d,ariaLabel:p})=>{const g=e==null,f=!!(r||s||!g),m=Xn(g?0:e,t),y=Jn(m,o),x=i??(g?"—":e),v=p??(typeof a=="string"?a:void 0),C=r||s,S=r?n.jsx(Qt,{}):s?n.jsx(b.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",d?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:x}),E=f?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":v,className:I.mergeClasses("w-full overflow-hidden rounded-sm",d?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!C&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:y}})}):null,D=n.jsx("span",{className:I.mergeClasses("dial-small-text text-primary",c),children:a});return d?n.jsxs("div",{className:I.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:D}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:E}),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]}),E]})},Ur=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:u,contentClassName:d})=>{const p=s!==void 0,[g,f]=h.useState(a),m=o?!0:p?s:g,y=h.useId(),x=()=>{if(i)return;const v=!m;p||f(v),l?.(v)};return n.jsxs("div",{className:I.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":y,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",u),children:[!o&&n.jsx(w.DialIcon,{className:ie("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(H.IconChevronRight,{size:K.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:y,role:"region",className:I.mergeClasses("px-4 pb-4",d),children:r})]})},Qn=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:u,isLoading:d,onBarClick:p,inline:g,barTitleClassName:f,barValueClassName:m,barClassName:y,barDescriptions:x,className:v})=>{const C=Object.entries(s),S=g?I.mergeClasses("text-secondary",f):f,E=i?"dial-tiny-text text-secondary":void 0,D=t?n.jsx(T.DialTooltip,{tooltip:t,children:e}):e,j=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",_=I.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",y);return n.jsx(Ur,{title:D,description:r,defaultExpanded:c,nonCollapsible:u,className:v,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:d?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-center"}):a?j.map(R=>{const N=R in s?s[R]:null,k=R in a?a[R]:null,U=typeof N=="number"&&typeof k=="number"?parseFloat((k-N).toFixed(3)):null,Q=U!=null&&U!==0,V=Q&&U>0,F=Q?V?`+${U}`:String(U):null,z=x?.[R],Z=n.jsx("span",{className:"dial-small-text text-secondary",children:R}),G=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[z?n.jsx(T.DialTooltip,{tooltip:z,children:Z}):Z,F!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",V?"bg-success text-success":"bg-error text-error"),children:F})]}),n.jsxs("div",{className:_,children:[n.jsx(ut,{title:i?.[0],value:N,maxValue:o,colorMap:l,inline:g,titleClassName:E,ariaLabel:R}),n.jsx(ut,{title:i?.[1],value:k,maxValue:o,colorMap:l,inline:g,titleClassName:E,ariaLabel:`${R} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(R,N),className:I.mergeClasses(O,L),children:G},R):n.jsx("div",{className:O,children:G},R)}):C.map(([R,N])=>{const k=n.jsx(ut,{title:R,value:N,maxValue:o,colorMap:l,inline:g,titleClassName:S,valueClassName:m,className:y}),B=p?n.jsx("button",{type:"button",onClick:()=>p(R,N),className:L,children:k}):k,U=x?.[R];return U?n.jsx(T.DialTooltip,{tooltip:U,triggerClassName:"flex flex-col",children:B},R):n.jsx(h.Fragment,{children:B},R)})})})},es="#FF4E50",ts=(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},mr=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const u=ts(c,t);u>=0&&(r[u]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:es,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,u)=>({from:c.from,to:c.to,color:c.color,count:r[u],ratio:i(r[u]),isZeroBucket:!1}));return[o,...l]},Wr=e=>e<=0?2:e%2===0?e:e+1,rs=e=>{const t=Wr(e);return[t,t/2,0]},Ot=e=>`${Math.round(e*100)/100}`,qr=(e,t)=>e===t?Ot(e):`${Ot(e)}-${Ot(t)}`,At=128,ns=(e,t)=>{const r=qr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},xr=(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:ns(a.from,a.to)})]}),ss=({title:e,values:t,colorMap:r=er,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:u})=>{const d=mr(t,r),p=l?mr(l,r):void 0,g=t.length,f=l?.length??0,m=Math.max(g,f),y=Wr(m),x=rs(m),v=D=>D.map(j=>({...j,ratio:y>0?j.count/y:0})),C=v(d),S=p?v(p):void 0,E=(D,j,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 _=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(T.DialTooltip,{placement:"bottom",tooltip:j,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}%`,..._},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:D.count})})})};return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",o),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),i?n.jsx("div",{className:"flex items-center justify-center",style:{height:At},children:n.jsx(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:At},children:x.map((D,j)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${j/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:D},D))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((D,j)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${j/(x.length-1)*100}%`}},D)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:At},children:S?C.map((D,j)=>{const L=S[j],O=`${D.count} out of ${g} ${s}`,_=`${L.count} out of ${f} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[E(D,xr(c,D.count,g,s,D),O,!0),E(L,xr(u,L.count,f,s,L),_,!1)]},j)}):C.map((D,j)=>{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}%`}})},j):n.jsx(T.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})})},j)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:C.map((D,j)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:qr(D.from,D.to)},j))})]})]})},as=({value:e,max:t=100,size:r=T.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const u=h.useId(),d=i??u,p=!!s?.label,g=p?s?.id??`${d}-label`:void 0,f=t>0?t:0,m=Number.isFinite(e)?e:0,y=Math.min(Math.max(m,0),f),x=f>0?y/f*100:0,v=n.jsx("div",{...c,id:d,role:"progressbar","aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":f,"aria-labelledby":g,"aria-label":T.resolveAccessibleName(l,p?void 0:"Progress"),className:I.mergeClasses(!p&&!a&&w.DIAL_KIT_CLASS.progressBar,"w-full overflow-hidden rounded-full bg-control-disable-primary",r===T.ElementSize.Small?"h-1":"h-2",o),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?v:n.jsxs("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.progressBar,"flex w-full flex-col gap-1"),children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(P.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),v]})},is=7,os=2,ls=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var ft=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(ft||{});const cs=(e,t,r)=>e===t?"active":r<is||Math.abs(e-t)<=os?"adjacent":"far",ds=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=ls(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(T.DialIconButton,{icon:n.jsx(H.IconCaretLeftFilled,{size:K.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.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=cs(i,e,t);return n.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":`Page ${i}`,"aria-current":i===e?"page":void 0,className:I.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",o===ft.Active&&"h-[8px] w-[32px]",o===ft.Adjacent&&"size-[8px]",o===ft.Far&&"size-[4px]")},i)})}),n.jsx(T.DialIconButton,{icon:n.jsx(H.IconCaretRightFilled,{size:K.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Gt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const u=h.useCallback(f=>{o?.(f.target.checked,t)},[o,t]),d=ie("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=ie("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx(H.IconMinus,{className:p,...K.BASE_ICON_PROPS}):r?n.jsx(H.IconCheck,{className:p,...K.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:d,htmlFor:t,"aria-description":c["aria-description"]||w.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(w.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:u,id:t,checked:r,"aria-checked":s?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:i,className:"invisible size-0"})]})};var ye=(e=>(e.VALID="valid",e.ERROR="error",e))(ye||{});const us=(e,t)=>{if(t===e.id)switch(e.status){case ye.VALID:return"border-accent-secondary text-primary";case ye.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case ye.VALID:return"border-primary text-primary";case ye.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},fs=(e,t)=>{if(t===e.id)switch(e.status){case ye.VALID:return"bg-accent-secondary";case ye.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case ye.VALID:return"bg-accent-secondary";case ye.ERROR:return"bg-red-400";default:return"bg-layer-4"}},ps=({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===ye.ERROR?n.jsx(H.IconExclamationCircle,{stroke:2,size:K.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===ye.VALID?n.jsx(H.IconCheck,{stroke:2,size:K.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:ie(a,us(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:ie(i,fs(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},gs=({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===ye.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(ps,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},_t=e=>(e.toString().split(".")[1]??"").length,hs=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:u,trackClassName:d,fillClassName:p,thumbClassName:g,labelsClassName:f,"aria-label":m,"aria-labelledby":y,...x})=>{const v=h.useRef(null),C=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),S=_t(s),E=l?l(e):e.toFixed(S),D=h.useCallback(_=>{const R=v.current;if(!R)return e;const N=R.getBoundingClientRect(),k=(_-N.left)/N.width,B=t+k*(r-t),U=_t(s),Q=parseFloat((Math.round((B-t)/s)*s+t).toFixed(U));return Math.min(r,Math.max(t,Q))},[t,r,s,e]),j=h.useCallback(_=>{a||(_.currentTarget.setPointerCapture(_.pointerId),c?.(D(_.clientX)))},[a,D,c]),L=h.useCallback(_=>{a||_.buttons===0||c?.(D(_.clientX))},[a,D,c]),O=h.useCallback(_=>{if(a)return;const R=_t(s),N=U=>parseFloat((Math.round((U-t)/s)*s+t).toFixed(R)),k=U=>Math.min(r,Math.max(t,U));let B=e;switch(_.key){case"ArrowRight":case"ArrowUp":B=k(N(e+s));break;case"ArrowLeft":case"ArrowDown":B=k(N(e-s));break;case"Home":B=t;break;case"End":B=r;break;default:return}_.preventDefault(),B!==e&&c?.(B)},[a,e,s,t,r,c]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",u),...x,children:[i&&n.jsx(_e.DialLabel,{...i,htmlFor:x.id}),n.jsxs("div",{ref:v,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:j,onPointerMove:L,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",d)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${C}%`}}),n.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":y,className:I.mergeClasses("dial-small-text absolute -translate-x-1/2 flex size-[38px] cursor-grab select-none items-center justify-center rounded-full bg-layer-3 text-primary shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",g),style:{left:`${C}%`},onKeyDown:O,children:E})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",f),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]})]})})]})},ms=({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(T.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),Zr=h.createContext({dragDropManager:void 0});function De(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 br=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),yr=function(){return Math.random().toString(36).substring(7).split("").join(".")},vr={INIT:"@@redux/INIT"+yr(),REPLACE:"@@redux/REPLACE"+yr()};function xs(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 bs(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(Ds(e))return"date";if(vs(e))return"error";var r=ys(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 ys(e){return typeof e.constructor=="function"?e.constructor.name:null}function vs(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ds(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function qe(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=bs(e)),t}function Yr(e,t,r){var s;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?De(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"?De(1):"Expected the enhancer to be a function. Instead, received: '"+qe(r)+"'");return r(Yr)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?De(2):"Expected the root reducer to be a function. Instead, received: '"+qe(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function u(){l===o&&(l=o.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?De(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(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?De(4):"Expected the listener to be a function. Instead, received: '"+qe(y)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?De(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 u(),l.push(y),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?De(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,u();var C=l.indexOf(y);l.splice(C,1),o=null}}}function g(y){if(!xs(y))throw new Error(process.env.NODE_ENV==="production"?De(7):"Actions must be plain objects. Instead, the actual type was: '"+qe(y)+"'. 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 y.type>"u")throw new Error(process.env.NODE_ENV==="production"?De(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"?De(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,y)}finally{c=!1}for(var x=o=l,v=0;v<x.length;v++){var C=x[v];C()}return y}function f(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?De(10):"Expected the nextReducer to be a function. Instead, received: '"+qe(y));a=y,g({type:vr.REPLACE})}function m(){var y,x=p;return y={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?De(11):"Expected the observer to be an object. Instead, received: '"+qe(C)+"'");function S(){C.next&&C.next(d())}S();var E=x(S);return{unsubscribe:E}}},y[br]=function(){return this},y}return g({type:vr.INIT}),s={dispatch:g,subscribe:p,getState:d,replaceReducer:f},s[br]=m,s}function Y(e,t,...r){if(Cs()&&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 Cs(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Is(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function Ss(e,t){return e.filter(r=>r!==t)}function Xr(e){return typeof e=="object"}function Ns(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 js(e,t){return e.filter(r=>t.indexOf(r)>-1)}const tr="dnd-core/INIT_COORDS",yt="dnd-core/BEGIN_DRAG",rr="dnd-core/PUBLISH_DRAG_SOURCE",vt="dnd-core/HOVER",Dt="dnd-core/DROP",Ct="dnd-core/END_DRAG";function Dr(e,t){return{type:tr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Ts={type:tr,payload:{clientOffset:null,sourceClientOffset:null}};function ws(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(Dr(i)),Es(r,l,c);const u=_s(r,l);if(u==null){e.dispatch(Ts);return}let d=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");Os(o),d=o(u)}e.dispatch(Dr(i,d));const g=c.getSource(u).beginDrag(l,u);if(g==null)return;As(g),c.pinSource(u);const f=c.getSourceType(u);return{type:yt,payload:{itemType:f,item:g,sourceId:u,clientOffset:i||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function Es(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 Os(e){Y(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function As(e){Y(Xr(e),"Item must be an object.")}function _s(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 Ls(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rs(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){Ls(e,a,r[a])})}return e}function ks(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();Ps(s),Bs(s).forEach((o,l)=>{const c=Ms(o,l,a,s),u={type:Dt,payload:{dropResult:Rs({},r,c)}};e.dispatch(u)})}}function Ps(e){Y(e.isDragging(),"Cannot call drop while not dragging."),Y(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Ms(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return Fs(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function Fs(e){Y(typeof e>"u"||Xr(e),"Drop result must either be an object or undefined.")}function Bs(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function zs(e){return function(){const r=e.getMonitor(),s=e.getRegistry();$s(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Ct}}}function $s(e){Y(e.isDragging(),"Cannot call endDrag while not dragging.")}function Vt(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Hs(e){return function(r,{clientOffset:s}={}){Ks(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return Vs(a,o,l),Gs(a,i,o),Us(a,i,o),{type:vt,payload:{targetIds:a,clientOffset:s||null}}}}function Ks(e){Y(Array.isArray(e),"Expected targetIds to be an array.")}function Gs(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 Vs(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Vt(i,r)||e.splice(s,1)}}function Us(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Ws(e){return function(){if(e.getMonitor().isDragging())return{type:rr}}}function qs(e){return{beginDrag:ws(e),publishDragSource:Ws(e),hover:Hs(e),drop:ks(e),endDrag:zs(e)}}class Zs{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=qs(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 Ys(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Jr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xs(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Jr(Ys(t,s),r)}function Js(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Jr(t,r)}const rt=[],nr=[];rt.__IS_NONE__=!0;nr.__IS_ALL__=!0;function Qs(e,t){return e===rt?!1:e===nr||typeof t>"u"?!0:js(t,e).length>0}class ea{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&&!Qs(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 Vt(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&&!Vt(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 Xs(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Js(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Cr=typeof global<"u"?global:self,Qr=Cr.MutationObserver||Cr.WebKitMutationObserver;function en(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function ta(e){let t=1;const r=new Qr(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const ra=typeof Qr=="function"?ta:en;class na{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=ra(this.flush),this.requestErrorThrow=en(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class sa{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 aa{create(t){const r=this.freeTasks,s=r.length?r.pop():new sa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const tn=new na,ia=new aa(tn.registerPendingError);function oa(e){tn.enqueueTask(ia.create(e))}const sr="dnd-core/ADD_SOURCE",ar="dnd-core/ADD_TARGET",ir="dnd-core/REMOVE_SOURCE",It="dnd-core/REMOVE_TARGET";function la(e){return{type:sr,payload:{sourceId:e}}}function ca(e){return{type:ar,payload:{targetId:e}}}function da(e){return{type:ir,payload:{sourceId:e}}}function ua(e){return{type:It,payload:{targetId:e}}}function fa(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 pa(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 Ut(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Ut(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 Ce;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ce||(Ce={}));let ga=0;function ha(){return ga++}function ma(e){const t=ha().toString();switch(e){case Ce.SOURCE:return`S${t}`;case Ce.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Ir(e){switch(e[0]){case"S":return Ce.SOURCE;case"T":return Ce.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Sr(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 xa{addSource(t,r){Ut(t),fa(r);const s=this.addHandler(Ce.SOURCE,t,r);return this.store.dispatch(la(s)),s}addTarget(t,r){Ut(t,!0),pa(r);const s=this.addHandler(Ce.TARGET,t,r);return this.store.dispatch(ca(s)),s}containsHandler(t){return Sr(this.dragSources,t)||Sr(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 Ir(t)===Ce.SOURCE}isTargetId(t){return Ir(t)===Ce.TARGET}removeSource(t){Y(this.getSource(t),"Expected an existing source."),this.store.dispatch(da(t)),oa(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Y(this.getTarget(t),"Expected an existing target."),this.store.dispatch(ua(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=ma(t);return this.types.set(a,r),t===Ce.SOURCE?this.dragSources.set(a,s):t===Ce.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 ba=(e,t)=>e===t;function ya(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function va(e,t,r=ba){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 Da(e=rt,t){switch(t.type){case vt:break;case sr:case ar:case It:case ir:return rt;case yt:case rr:case Ct:case Dt:default:return nr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=Ns(r,s);if(!(a.length>0||!va(r,s)))return rt;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function Ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ca(e,a,r[a])})}return e}const Nr={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Sa(e=Nr,t){const{payload:r}=t;switch(t.type){case tr:case yt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case vt:return ya(e.clientOffset,r.clientOffset)?e:Ia({},e,{clientOffset:r.clientOffset});case Ct:case Dt:return Nr;default:return e}}function Na(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ze(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Na(e,a,r[a])})}return e}const ja={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ta(e=ja,t){const{payload:r}=t;switch(t.type){case yt:return Ze({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case rr:return Ze({},e,{isSourcePublic:!0});case vt:return Ze({},e,{targetIds:r.targetIds});case It:return e.targetIds.indexOf(r.targetId)===-1?e:Ze({},e,{targetIds:Ss(e.targetIds,r.targetId)});case Dt:return Ze({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Ct:return Ze({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function wa(e=0,t){switch(t.type){case sr:case ar:return e+1;case ir:case It:return e-1;default:return e}}function Ea(e=0){return e+1}function Oa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Aa(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){Oa(e,a,r[a])})}return e}function _a(e={},t){return{dirtyHandlerIds:Da(e.dirtyHandlerIds,{type:t.type,payload:Aa({},t.payload,{prevTargetIds:Is(e,"dragOperation.targetIds",[])})}),dragOffset:Sa(e.dragOffset,t),refCount:wa(e.refCount,t),dragOperation:Ta(e.dragOperation,t),stateId:Ea(e.stateId)}}function La(e,t=void 0,r={},s=!1){const a=Ra(s),i=new ea(a,new xa(a)),o=new Zs(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function Ra(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Yr(_a,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function ka(e,t){if(e==null)return{};var r=Pa(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 Pa(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 jr=0;const pt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Ma=h.memo(function(t){var{children:r}=t,s=ka(t,["children"]);const[a,i]=Fa(s);return h.useEffect(()=>{if(i){const o=rn();return++jr,()=>{--jr===0&&(o[pt]=null)}}},[]),n.jsx(Zr.Provider,{value:a,children:r})});function Fa(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=Ba(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function Ba(e,t=rn(),r,s){const a=t;return a[pt]||(a[pt]={dragDropManager:La(e,t,r,s)}),a[pt]}function rn(){return typeof global<"u"?global:window}var Lt,Tr;function za(){return Tr||(Tr=1,Lt=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}),Lt}var $a=za();const Ha=b.getDefaultExportFromCjs($a),Ge=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Ka(e,t,r){const[s,a]=h.useState(()=>t(e)),i=h.useCallback(()=>{const o=t(e);Ha(s,o)||(a(o),r&&r())},[s,e,r]);return Ge(i),[s,i]}function Ga(e,t,r){const[s,a]=Ka(e,t,r);return Ge(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function nn(e,t,r){return Ga(t,e||(()=>({})),()=>r.reconnect())}function sn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function Va(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function Ua(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let Rt=!1,kt=!1;class Wa{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Y(!Rt,"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 Rt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Rt=!1}}isDragging(){if(!this.sourceId)return!1;Y(!kt,"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 kt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{kt=!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 Pt=!1;class qa{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(!Pt,"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 Pt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Pt=!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 Za(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Ya(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Wt(e,t,r,s){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<i.length;c++){const u=i[c];if(!l(u))return!1;const d=e[u],p=t[u];if(a=void 0,a===!1||a===void 0&&d!==p)return!1}return!0}function qt(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xa(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Ja(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return Xa(s),Qa(s,r?i=>e(i,r):e)}}function an(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Ja(s);t[r]=()=>a}}),t}function wr(e,t){typeof e=="function"?e(t):e.current=t}function Qa(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=>{wr(r,s),wr(t,s)}}):h.cloneElement(e,{ref:t})}class ei{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Wt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Wt(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=an({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,qt(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,qt(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class ti{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Wt(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=an({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,qt(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Xe(){const{dragDropManager:e}=h.useContext(Zr);return Y(e!=null,"Expected drag drop context"),e}function ri(e,t){const r=Xe(),s=h.useMemo(()=>new ei(r.getBackend()),[r]);return Ge(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ge(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function ni(){const e=Xe();return h.useMemo(()=>new Wa(e),[e])}class si{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 ai(e,t,r){const s=h.useMemo(()=>new si(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 oi(e,t,r){const s=Xe(),a=ai(e,t,r),i=ii(e);Ge(function(){if(i!=null){const[l,c]=Ya(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function li(e,t){const r=sn(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=ni(),a=ri(r.options,r.previewOptions);return oi(r,s,a),[nn(r.collect,s,a),Va(a),Ua(a)]}function ci(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function di(e){const t=Xe(),r=h.useMemo(()=>new ti(t.getBackend()),[t]);return Ge(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ui(){const e=Xe();return h.useMemo(()=>new qa(e),[e])}function fi(e){const{accept:t}=e;return h.useMemo(()=>(Y(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class pi{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 gi(e,t){const r=h.useMemo(()=>new pi(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function hi(e,t,r){const s=Xe(),a=gi(e,t),i=fi(e);Ge(function(){const[l,c]=Za(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function or(e,t){const r=sn(e,t),s=ui(),a=di(r.options);return hi(r,s,a),[nn(r.collect,s,a),ci(a)]}const Er="column",mi="flex items-center",xi="mr-3 cursor-move text-secondary",bi=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:i="Drag item"})=>{const o=h.useRef(null),l=h.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:u},d,p]=li(()=>({type:Er,item:{id:e,originalIndex:c},collect:f=>{const m=f.getItem();return{isDragging:f.isDragging()&&m?.id===e}},end:(f,m)=>{if(!f)return;!m.didDrop()&&typeof a=="function"&&f.originalIndex>-1&&a(f.id,f.originalIndex)}}),[e,c,a]),[,g]=or(()=>({accept:Er,hover:f=>{if(!(!f||f.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(f.id,m)}}}),[s,a,e]);return p(g(l)),d(o),n.jsxs("div",{ref:l,className:I.mergeClasses(mi,r),style:{opacity:u?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:xi,"aria-label":i,children:n.jsx(H.IconGripVertical,{...K.BASE_ICON_PROPS})}),t]})},St=({iconClassName:e,label:t,...r})=>t?n.jsx(b.DialDangerButton,{...r,label:t,appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx(H.IconTrashX,{...K.BASE_ICON_PROPS,className:e||""})}):n.jsx(w.DialDangerIconButton,{...r,appearance:T.ButtonAppearance.Ghost,icon:n.jsx(H.IconTrashX,{...K.BASE_ICON_PROPS,className:e||""})}),yi=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...u})=>{const d=I.mergeClasses("dial-textarea dial-input px-3 py-2",u.invalid&&"dial-input-error",u.disabled&&"dial-input-disable",i?"resize":"resize-none",e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-1",a),children:[o&&n.jsx(_e.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:d,onChange:p=>r?.(p.currentTarget.value),...u}),n.jsx(b.DialErrorText,{text:s}),!s&&n.jsx(b.DialCaptionText,{text:l})]})},vi="inline-flex items-center rounded bg-layer-3",Di="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",Ci="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ii="text-secondary hover:text-primary",Si="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Ni=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:i})=>{const o=h.useCallback(l=>{if(s)return;const c=e.filter(g=>!g.disabled);if(c.length===0)return;const u=c.findIndex(g=>g.value===t);let d=null;switch(l.key){case"ArrowRight":case"ArrowDown":d=(u+1)%c.length;break;case"ArrowLeft":case"ArrowUp":d=(u-1+c.length)%c.length;break;case"Home":d=0;break;case"End":d=c.length-1;break;default:return}l.preventDefault();const p=c[d];p&&p.value!==t&&r(p.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(vi,a),children:e.map((l,c)=>{const u=l.value===t,d=c===0,p=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":u,tabIndex:u?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Di,!p&&"-mr-px",d&&"rounded-l",p&&"rounded-r",u?Ci:Ii,g&&Si),children:[l.icon,l.label]},l.value)})})},Mt=8,ji=24,on=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:u=!1,readOnly:d=!1,containerClassName:p,tagClassName:g,onChange:f})=>{const m=h.useRef(null),y=h.useRef([]),x=h.useRef(null),[v,C]=h.useState(e),[S,E]=h.useState(""),[D,j]=h.useState(!1),[L,O]=h.useState(e.length),_=h.useCallback(F=>z=>{y.current[F]=z},[]),R=h.useCallback(()=>{if(!u)return;const F=m.current;if(!F)return;const z=F.offsetWidth;if(z===0)return;const Z=x.current?.offsetWidth??0,ne=z-(d?0:ji)-Mt;let X=0,W=0;for(let se=0;se<v.length;se++){const te=y.current[se];if(!te)continue;const le=te.offsetWidth+Mt;if(X+le>ne)break;X+=le,W++}if(W<v.length&&W>0)for(;X+Z>ne&&W>0;){W--;const se=y.current[W]?.offsetWidth??0;X-=se+Mt}O(W)},[u,d,v.length]),N=F=>{const z=F.trim().replace(/,$/,"");if(z&&!v.includes(z)){const Z=[z,...v];C(Z),f?.(Z)}},k=F=>{(F.key===","||F.key==="Enter")&&(F.preventDefault(),N(S),E(""))},B=()=>{S.trim()&&(N(S),E(""))},U=F=>{const z=v.filter((Z,G)=>G!==F);C(z),f?.(z)},Q=()=>o?n.jsx(b.DialErrorText,{text:o}):i?n.jsx(b.DialCaptionText,{text:i}):null;h.useEffect(()=>{if(u)return;const F=new ResizeObserver(()=>{if(m.current){const z=m.current.scrollHeight>m.current.clientHeight+10;j(z)}});return m.current&&F.observe(m.current),()=>F.disconnect()},[v,u]),h.useEffect(()=>{if(!u){O(v.length);return}O(v.length);const F=new ResizeObserver(()=>{R()}),z=m.current;return z&&F.observe(z),R(),()=>F.disconnect()},[u,R,v]),h.useEffect(()=>{C(e)},[JSON.stringify(e)]);const V=n.jsxs("div",{ref:m,className:ie("flex gap-2 items-center relative",u?"flex-nowrap overflow-hidden w-full min-w-0":ie("flex-wrap",D?"flex-col-reverse":"flex-row"),p),children:[(u?v.slice(0,L):v).map((F,z)=>n.jsx(He,{label:F,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>U(z):void 0},F+z)),u&&L<v.length&&n.jsx(T.DialTooltip,{tooltip:v.slice(L).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(He,{label:`+${v.length-L}`})}),!d&&n.jsx("input",{id:s,type:"text",value:S,onChange:F=>E(F.target.value),onKeyDown:k,onBlur:B,className:ie("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",u?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),u&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[v.map((F,z)=>n.jsx("div",{ref:_(z),className:"inline-flex shrink-0",children:n.jsx(He,{label:F,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>U(z):void 0})},`measure-${F}-${z}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(He,{label:`+${v.length}`})})]})]});return d?V:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(_e.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:ie("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:V}),Q()]})},ln=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(on,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Ft=e=>hr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},hr.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),cn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:u,emptyValueText:d,placeholder:p,editable:g=!1,onValueChange:f,collapseTagOverflow:m=!1,iconBefore:y})=>{const x=Array.isArray(s)&&s.length>0,v=typeof s=="string"&&!!s.trim(),C=x||v?s:p?void 0:d,S=r?void 0:o,E=h.useCallback(O=>{f?.(O.target.value)},[f]),D=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ie("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[y&&n.jsx(w.DialIcon,{icon:y}),n.jsx("input",{type:"text",className:ie("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||d,onChange:E,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(w.DialIcon,{icon:n.jsx(Ft,{role:"img",width:K.BASE_ICON_SIZE,height:K.BASE_ICON_SIZE})})})]}),n.jsx(b.DialErrorText,{text:c})]}),j=()=>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:ie("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[y&&n.jsx(w.DialIcon,{icon:y}),n.jsx(T.DialTooltip,{tooltip:C==null?void 0:String(C),children:C||!p?n.jsx("span",{className:a,children:C}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(w.DialIcon,{icon:n.jsx(Ft,{role:"img",width:K.BASE_ICON_SIZE,height:K.BASE_ICON_SIZE})})})]})}),n.jsx(b.DialErrorText,{text:c})]}),L=()=>n.jsx("div",{className:"w-full",onClick:S,children:n.jsxs("div",{className:ie("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:[y&&n.jsx(w.DialIcon,{icon:y}),n.jsx(ln,{placeholder:p,selectedItems:C,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(w.DialIcon,{icon:n.jsx(Ft,{role:"img",width:K.BASE_ICON_SIZE,height:K.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?L():g?D():j(),t&&Wn.createPortal(e,document.body)]})},Ti=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:u,onClose:d,header:p,portalId:g,onApply:f,onCancel:m,cancelButtonTitle:y="Cancel",applyButtonTitle:x="Apply",isValid:v,selectedRadioValue:C,onChangeRadioField:S,id:E,size:D=b.PopupSize.Md})=>{const[j,L]=h.useState(!1),O=h.useCallback(()=>{r||L(!0)},[r]),_=h.useCallback(()=>{L(!1),d?.()},[d]),R=h.useCallback(()=>{m?.(),_()},[m,_]),N=h.useCallback(()=>{f(),_()},[f,_]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(_e.DialLabel,{label:e,htmlFor:t}),n.jsx(cn,{disabled:r,open:j,selectedValue:i??a.find(k=>k.id===s)?.name,valueClassName:o,inputClassName:ie(l,"py-2","px-3"),emptyValueText:c,placeholder:u,onOpen:O,children:n.jsx(b.DialPopup,{open:j,onClose:R,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:y,onClick:R}),n.jsx(b.DialPrimaryButton,{label:x,onClick:N,disabled:!v})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(b.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:C,onChange:S,elementId:E,orientation:b.RadioGroupOrientation.Column})})})})]})},wi="Create",Ei="Cancel",Oi="flex items-center justify-end gap-2 px-6 py-3",Ai=({header:e,open:t=!1,submitLabel:r=wi,cancelLabel:s=Ei,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:u,onCancel:d,children:p,dividers:g=!0,size:f=b.PopupSize.Md,footer:m})=>{const y=a?null:n.jsxs("div",{className:Oi,children:[n.jsx(b.DialNeutralButton,{label:s,onClick:()=>d?d():c?.()}),n.jsx(b.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>u()})]}),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??y,size:f,children:x()})},_i=/^0+\.(\d+)?$/,Li=/^0+/,Zt=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>!d||d==="-"?d:String(d)?.match(_i)?String(d)?.replace(Li,"0"):Number(d),c=d=>{if([".","-","+","e","E"].includes(d.key)){d.preventDefault();return}b.handleKeyDown(d,"number",r,s)},u=d=>{const p=d.clipboardData.getData("text"),g=p.replace(/\D/g,"");if(g!==p&&(d.preventDefault(),g)){const f=d.currentTarget,m=f.selectionStart??0,y=f.selectionEnd??0,x=f.value.slice(0,m)+g+f.value.slice(y);t?.(l(x))}};return n.jsx(b.DialInput,{type:"number",min:r,max:s,onChange:d=>t?.(l(d)),onKeyDown:e?c:a,onPaste:e?u:i,...o})},Ri=({onClick:e})=>n.jsx(H.IconEyeOff,{...K.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),ki=({onClick:e})=>n.jsx(H.IconEye,{...K.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),dn=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(b.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(Ri,{onClick:()=>s(!1)}):n.jsx(ki,{onClick:()=>s(!0)})})},un=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(o=>o.value===s)?.label??s,i=e.find(o=>o.value===s)?.icon;return n.jsx(He,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(w.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var ht=(e=>(e.Sm="sm",e.Md="md",e))(ht||{}),mt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(mt||{});const Pi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",Mi="w-full rounded flex flex-col",nt="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",Fi="bg-accent-primary-alpha",Yt="bg-accent-primary-alpha border-l border-accent-primary border-1",xt="opacity-75",Bi=352,zi=4,$i=n.jsx(H.IconChevronDown,{size:K.DIAL_ICON_SIZE.SM}),Hi=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=w.useSubMenuFloating(zi,"listbox",!!e.disabled),u=e.children?.some(d=>t.includes(d.value));return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!u,"aria-disabled":!!e.disabled,disabled:e.disabled,className:ie(nt,u&&Yt,e.disabled&&xt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(w.DialIcon,{icon:e.icon}),n.jsx(w.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(H.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(w.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(d=>{const p=t.includes(d.value);return n.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!d.disabled,disabled:d.disabled,className:ie(nt,p&&Yt,d.disabled&&xt),onClick:()=>!d.disabled&&r(d.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[d.icon&&n.jsx(w.DialIcon,{icon:d.icon}),n.jsx(w.DialEllipsisTooltip,{text:d.labelNode??d.label})]})},d.value)})})]})},Ne=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=mt.Primary,size:o=ht.Md,prefix:l,customSelectedValue:c,placeholder:u="Select...",searchable:d=!1,searchSize:p=T.ElementSize.Standard,searchPlaceholder:g,selectAll:f=!1,invalid:m,selectAllLabel:y="Select all",emptyStateTitle:x="No options available",emptyStateDescription:v,emptyStateIcon:C,disabled:S=!1,className:E,listClassName:D,closable:j=!1,header:L,footer:O,onClose:_,onChange:R,inlineSearch:N=!1,dismissRef:k,onFooterClick:B,open:U,onOpenChange:Q,onInlineQueryChange:V,customMultiSelectTagsRenderer:F})=>{const z=h.useId(),[Z,G]=h.useState(!1),ne=U!==void 0,X=ne?!!U:Z,W=h.useCallback(A=>{ne||G(A),Q?.(A)},[ne,Q]),[se,te]=h.useState(N&&c||""),le=h.useRef(null),ue=h.useCallback(A=>{A!==se&&(te(A||""),V?.(A||""))},[V,se]),pe=s!==void 0,[ge,fe]=h.useState(a),q=pe?s:ge,ee=h.useMemo(()=>t?Array.isArray(q)?q:[]:typeof q=="string"?[q]:[],[q,t]),Ie=h.useMemo(()=>{const A=se.trim().toLowerCase();return A?e.filter(re=>re.label.toLowerCase().includes(A)):e},[e,se]);h.useEffect(()=>{!X&&!N&&ue("")},[N,X,ue]);const Me=h.useRef(c);h.useEffect(()=>{N&&c!==Me.current&&(X||(Me.current=c,ue(c||"")))},[c,N,X,ue]);const he=h.useCallback(A=>{pe||fe(A),R?.(A)},[pe,R]),Fe=h.useCallback(A=>{if(t){const re=new Set(ee);re.has(A)?re.delete(A):re.add(A),he(Array.from(re));return}if(he(A),N){const re=e.find(xe=>xe.value===A)??e.flatMap(xe=>xe.children??[]).find(xe=>xe.value===A);re&&ue(re.label)}W(!1)},[t,he,N,W,ee,e,ue]),Te=h.useCallback((A,re)=>{if(A.stopPropagation(),!t){he("");return}const xe=ee.filter(Et=>Et!==re);he(xe)},[t,ee,he]),ae=h.useMemo(()=>Ie.filter(A=>!A.disabled),[Ie]),Le=h.useMemo(()=>ae.filter(A=>ee.includes(A.value)).length,[ae,ee]),Se=h.useCallback(A=>{N&&!t&&!A&&Fe(se),W(A)},[Fe,N,t,se,W]),{allSelectedInFiltered:Be,someSelectedInFiltered:tt}=h.useMemo(()=>{const A=ae.length>0&&Le===ae.length;return{allSelectedInFiltered:A,someSelectedInFiltered:Le>0&&!A}},[ae,Le]),ve=h.useCallback(()=>{if(!(!t||ae.length===0))if(Be){const A=new Set(ae.map(re=>re.value));he(ee.filter(re=>!A.has(re)))}else{const A=new Set(ee);ae.forEach(re=>A.add(re.value)),he(Array.from(A))}},[Be,t,ae,ee,he]),ze=ee.length>0;h.useEffect(()=>{X&&N&&!t&&!S&&requestAnimationFrame(()=>{const A=le.current;if(!A)return;A.focus();const re=A.value?.length??0;A.setSelectionRange?.(re,re)})},[X,N,t,S]);const Re=!t&&ze?ee[0]:void 0,me=h.useMemo(()=>Re?e.find(A=>A.value===Re)??e.flatMap(A=>A.children??[]).find(A=>A.value===Re):void 0,[e,Re]),wt=h.useCallback(()=>t?ze?F?.(e,ee,Te)||n.jsx(un,{options:e,selectedValues:ee,handleRemoveTag:Te}):n.jsx("span",{className:"text-secondary truncate",children:u}):me?n.jsxs(n.Fragment,{children:[me.icon&&n.jsx(w.DialIcon,{icon:me.icon}),n.jsx(w.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:u}),[ze,t,c,l,s,u,me,e,ee,Te,F]);h.useImperativeHandle(k,()=>({dismiss:()=>{W(!1)}}));const we=h.useCallback(()=>{ue(ee.length===1?me?.label??se:"")},[se,ee.length,ue,me?.label]),$e=h.useCallback(()=>{S||(W(!X),N&&!t&&(we(),le.current?.focus()))},[S,N,X,t,we,W]);return n.jsx(w.DialDropdown,{open:X,onOpenChange:Se,disabled:S,closable:j,onClose:_,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:Bi,listClassName:D,renderOverlay:()=>n.jsxs("div",{id:`list-${r||z}`,role:"listbox","aria-multiselectable":t||void 0,className:Mi,children:[L&&n.jsx(n.Fragment,{children:typeof L=="function"?L():L}),(d||j)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&n.jsx(b.DialSearch,{size:p,placeholder:g,onChange:ue,value:se,id:`search-${r||z}`,containerClassName:I.mergeClasses(b.SIZE_CONFIG[p].containerClassName,"w-full")}),j&&n.jsx(b.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(H.IconX,{size:K.DIAL_ICON_SIZE.SM}),onClick:A=>{_?.(A),W(!1)}})]}),t&&f&&ae.length>0&&n.jsx("div",{className:ie(nt,"mt-2"),children:n.jsx(Gt,{id:`${r||z}-selectAll`,label:y,checked:Be,indeterminate:tt,onChange:ve,ariaLabel:y})}),n.jsx("div",{className:ie("overflow-y-auto max-h-[352px]",N&&Ie.length===0?"":"py-1"),children:Ie.length===0?!N&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(w.DialNoDataContent,{icon:C??n.jsx(H.IconClipboardX,{size:K.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:v})}):Ie.map(A=>{const re=ee.includes(A.value);return t?n.jsxs("div",{role:"option","aria-selected":re,"aria-disabled":!!A.disabled,className:ie(nt,re&&Fi,A.disabled&&xt,"w-full"),children:[n.jsx(Gt,{id:`${r||z}-${A.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[A.icon&&n.jsx(w.DialIcon,{icon:A.icon}),n.jsx("span",{className:"truncate",children:A.labelNode??A.label})]}),checked:re,disabled:A.disabled,onChange:()=>!A.disabled&&Fe(A.value),ariaLabel:A.label}),A.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:A.description})]},A.value):A.children?.length?n.jsx(Hi,{opt:A,selectedValues:ee,onSelect:Fe},A.value):n.jsx("button",{role:"option",type:"button","aria-selected":re,"aria-disabled":!!A.disabled,disabled:A.disabled,className:ie(nt,re&&Yt,A.disabled&&xt),onClick:()=>!A.disabled&&Fe(A.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[A.icon&&n.jsx(w.DialIcon,{icon:A.icon}),n.jsx(w.DialEllipsisTooltip,{text:A.labelNode??A.label}),A.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:A.description})]})},A.value)})}),O&&n.jsx("div",{onClick:A=>{B?.(A),B&&W(!1)},children:typeof O=="function"?O():O})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":X,"aria-controls":`list-${r||z}`,className:I.mergeClasses(Pi,S&&"opacity-75 !cursor-not-allowed !border-primary",o===ht.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===mt.Secondary?"!bg-layer-4 !h-auto":"",E),onMouseDown:A=>{S||N&&!t&&(we(),A.preventDefault())},onClick:()=>{$e()},onKeyDown:A=>{(A.key===" "||A.code==="Space")&&(A.preventDefault(),$e())},children:[N&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||z}`,type:"text",placeholder:g??u,value:se||"",onChange:A=>ue(A.currentTarget.value.trimStart()),onFocus:()=>!S&&W(!0),onMouseDown:A=>{we(),A.stopPropagation()},onClick:A=>{A.stopPropagation()},onKeyDown:A=>{A.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref: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:wt()}),!N&&n.jsx(w.DialIcon,{icon:$i,className:ie("text-primary",X&&"rotate-180")})]})})},Ki=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:u,defaultEmptyText:d,...p})=>{const g=h.useCallback(()=>{if(!u||Array.isArray(u)&&u.length===0)return d??"None";if(Array.isArray(u))return n.jsx(un,{options:p.options,selectedValues:u});{const f=p.options?.find(m=>m.value===u);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:f?.label||u})}},[u,p.options,d]);return n.jsx(b.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:d,children:n.jsx(Ne,{className:a,value:u,elementId:o,invalid:!!i,...p})})};function fn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Gi(e,t){return e.filter(r=>r!==t)}function Vi(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 Ui{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Vi(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Gi(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wi{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 Nt="__NATIVE_FILE__",pn="__NATIVE_URL__",gn="__NATIVE_TEXT__",hn="__NATIVE_HTML__",Or=Object.freeze(Object.defineProperty({__proto__:null,FILE:Nt,HTML:hn,TEXT:gn,URL:pn},Symbol.toStringTag,{value:"Module"}));function Bt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const Xt={[Nt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[hn]:{exposeProperties:{html:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[pn]:{exposeProperties:{urls:(e,t)=>Bt(e,t,"").split(`
|
|
2
|
+
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[gn]:{exposeProperties:{text:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function qi(e,t){const r=Xt[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new Wi(r);return s.loadDataTransfer(t),s}function zt(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Xt).filter(r=>{const s=Xt[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Zi=fn(()=>/firefox/i.test(navigator.userAgent)),mn=fn(()=>!!window.safari);class Ar{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:i,c3s:o}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,u=o.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const f=r[d];if(f<t)c=d+1;else if(f>t)u=d-1;else return s[d]}l=Math.max(0,u);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 f=0;f<s;f++)a.push(f);a.sort((f,m)=>t[f]<t[m]?-1:1);const i=[],o=[];let l,c;for(let f=0;f<s-1;f++)l=t[f+1]-t[f],c=r[f+1]-r[f],i.push(l),o.push(c/l);const u=[o[0]];for(let f=0;f<i.length-1;f++){const m=o[f],y=o[f+1];if(m*y<=0)u.push(0);else{l=i[f];const x=i[f+1],v=l+x;u.push(3*v/((v+x)/m+(v+l)/y))}}u.push(o[o.length-1]);const d=[],p=[];let g;for(let f=0;f<u.length-1;f++){g=o[f];const m=u[f],y=1/i[f],x=m+u[f+1]-g-g;d.push((g-m-x)*y),p.push(x*y*y)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=d,this.c3s=p}}const Yi=1;function xn(e){const t=e.nodeType===Yi?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function ct(e){return{x:e.clientX,y:e.clientY}}function Xi(e){var t;return e.nodeName==="IMG"&&(Zi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Ji(e,t,r,s){let a=e?t.width:r,i=e?t.height:s;return mn()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function Qi(e,t,r,s,a){const i=Xi(t),l=xn(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:d}=e,{anchorX:p,anchorY:g}=s,{dragPreviewWidth:f,dragPreviewHeight:m}=Ji(i,t,u,d),y=()=>{let j=new Ar([0,.5,1],[c.y,c.y/d*m,c.y+m-d]).interpolate(g);return mn()&&i&&(j+=(window.devicePixelRatio-1)*m),j},x=()=>new Ar([0,.5,1],[c.x,c.x/u*f,c.x+f-u]).interpolate(p),{offsetX:v,offsetY:C}=a,S=v===0||v,E=C===0||C;return{x:S?v:x(),y:E?C:y()}}class eo{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 to(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _r(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){to(e,a,r[a])})}return e}class ro{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 _r({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 _r({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Or).some(r=>Or[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=qi(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var s;return(s=this.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,s){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=a=>{const i=this.sourceNodes.get(a);return i&&xn(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const o=ct(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:l}=a,c=zt(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),p=this.sourceNodes.get(d),g=this.sourcePreviewNodes.get(d)||p;if(g){const{anchorX:f,anchorY:m,offsetX:y,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),S=Qi(p,g,o,{anchorX:f,anchorY:m},{offsetX:y,offsetY:x});l.setDragImage(g,S.x,S.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,c=zt(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:ct(a)}),i.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=ct(a),this.scheduleHover(i),(i||[]).some(l=>this.monitor.canDropOnTarget(l))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else zt(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:ct(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new eo(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ui(this.isNodeInDocument)}}const no=function(t,r,s){return new ro(t,r,s)},so=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:i,multiple:o,fileFormatError:l,fileCountError:c,fileSizeError:u,getIsFileFormatError:d,getIsFileSizeError:p})=>{const g=h.useRef(null),f=h.useRef(null),[m,y]=h.useState([]),[x,v]=h.useState(!1),[C,S]=h.useState(!1),E=h.useCallback(V=>{const F=V.target.files;if(F&&F.length>0){const z=Array.from(F),Z=d?.(z),G=p?.(z);Z?v(!0):G?S(!0):e(z)}},[d,p,e]),D=h.useCallback(V=>i&&V?.length>i,[i]),j=h.useMemo(()=>x||C||D(m),[x,C,D,m]),L=()=>{y([]),v(!1),S(!1)},O=h.useMemo(()=>x?n.jsx(b.DialErrorText,{text:l}):C?n.jsx(b.DialErrorText,{text:u}):D(m)?n.jsx(b.DialErrorText,{text:c}):null,[c,l,u,m,D,x,C]);h.useEffect(()=>{L()},[a]);const[{isOver:_,canDrop:R},N]=or(()=>({accept:[Nt],drop(V){const F=V.files,z=d?.(F)??!1,Z=p?.(F)??!1,G=D?.(F)??!1;if(v(z),S(Z),z||Z||G){y(F);return}e(F),L()},collect:V=>({isOver:V.isOver(),canDrop:V.canDrop()})}),[e,d,p,D]),k=V=>{(V.key==="Enter"||V.key==="Space")&&(V.preventDefault(),f.current?.click())},B=V=>{V?.preventDefault();const F=Array.from(V.dataTransfer?.items??[]);v(!!d?.(F)),S(!!p?.(F)),y(F)},U=V=>{V.target===V.currentTarget&&L()},Q=ie("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!R&&!j&&"border-primary",R&&(_?"border-accent-primary":"border-hover"),j&&"border-error");return N(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:Q,ref:g,onDragOver:B,onDragLeave:U,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:k,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:T.ButtonAppearance.Ghost,label:s,onClick:()=>f.current?.click()})]}),n.jsx("input",{multiple:o,id:"file",type:"file",ref:f,hidden:!0,accept:a,onChange:E})]}),n.jsx(n.Fragment,{children:O})]})},ao=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx(H.IconExclamationCircle,{...K.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(b.DialInput,{...r,iconBefore:a(),containerClassName:ie("h-[40px] p-0",s&&"h-[60px]"),className:ie("rounded-r-none border-r-0",s&&"text-error",t)})},io=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:i,fileFormatError:o,fileSizeError:l,fileCountError:c})=>{const u=h.useRef(null),[d,p]=h.useState(!1),[g,f]=h.useState(!1),[m,y]=h.useState(0),x=h.useCallback(()=>{p(!1),f(!1),y(0)},[]),v=h.useCallback(_=>!!(i&&t.length+_.length>i),[i,t.length]),C=d||g,[{isOver:S,canDrop:E},D]=or(()=>({accept:[Nt],drop(_){const R=_.files,N=[...t,...R],k=s?.(R)??!1,B=a?.(R)??!1,U=v?.(R)??!1;if(p(k),f(B),k||B||U){y(R.length);return}r(N),x()},collect:_=>({isOver:_.isOver(),canDrop:_.canDrop()})}),[t,r,s,a,v,x]),j=_=>{_.preventDefault();const R=Array.from(_.dataTransfer?.items??[]);p(!!s?.(R)),f(!1),y(R.length)},L=_=>{_.target===_.currentTarget&&x()};D(u);const O=v(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:u,onDragOver:j,onDragLeave:L,className:ie("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!C&&!O&&(E&&S?"border-accent-primary":"border-primary"),(C||O)&&"border-error"),children:e}),d&&n.jsx(b.DialErrorText,{text:o}),g&&n.jsx(b.DialErrorText,{text:l}),!d&&!g&&O&&n.jsx(b.DialErrorText,{text:c})]})},bn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:i,errorText:o,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:u,getIsFileFormatError:d,getIsFileSizeError:p,maxFilesCount:g}=e,f=h.useCallback((x,v)=>{x.stopPropagation(),a(t?.filter(C=>C.name!==v)||[])},[a,t]),m=h.useCallback(x=>n.jsx(St,{"aria-label":l,onClick:v=>f(v,x)}),[l,f]),y=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,v)=>n.jsx(ao,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:r||s?.(x.name),invalid:i?.(x),error:i?.(x)?o:""},x.name+v))}),[t,r,s,i,o,m]);return n.jsx(Ma,{backend:no,children:!t||t.length===0?n.jsx(so,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx(io,{existingFiles:t,onDrop:a,getIsFileFormatError:d,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:y}),c?.(t)&&n.jsx(b.DialErrorText,{text:u})]})})},oo=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:i,maxMultiFilesSize:o,fileFormatError:l,fileCountError:c,fileSizeError:u,multiFilesSizeError:d,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:f,addButtonLabel:m,additionalActionButtons:y,...x})=>{const v=h.useRef(null),C=()=>v.current?.click(),S=()=>{e([])},E=h.useCallback(O=>O?.some(_=>!(g==="/"||g?.toLowerCase()?.includes(_?.type?.toLowerCase()))),[g]),D=h.useCallback(O=>{if(!i)return!1;const _=i*(1024*1024);return O?.some(R=>{const N=R.size;return!!N&&N>_})},[i]),j=h.useCallback(O=>{if(!o||!p)return!1;const _=o*1024*1024;return O.reduce((N,k)=>N+k.size,0)>_},[o,p]),L=h.useCallback(O=>{const _=O.target.files;if(_&&_.length>0){const R=Array.from(_),N=E(R),k=D(R);!N&&!k&&e([...s||[],...R])}},[E,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(_e.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:f,iconBefore:n.jsx(H.IconTrashX,{...K.BASE_ICON_PROPS}),onClick:S}),(a?a>s?.length:!0)&&n.jsx(b.DialPrimaryButton,{appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx(H.IconPlus,{...K.BASE_ICON_PROPS}),label:m,onClick:C}),y]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:p,ref:v,hidden:!0,accept:g,onChange:L}),n.jsx(bn,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:u,multiFilesSizeError:d,getIsFileFormatError:E,getIsFileSizeError:D,getIsMultiFilesSizeError:j,...x})]})},lo=({icon:e,ariaLabel:t,size:r=T.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:i,iconClassName:o,caretIcon:l=n.jsx(H.IconChevronDown,{size:K.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:u="bottom-start",matchReferenceWidth:d=!1,open:p,onOpenChange:g,defaultOpen:f=!1,...m})=>{const y=r===T.ElementSize.Small,[x,v]=h.useState(f),C=p??x,S=y?"w-8 px-0":"w-10 px-0",E={[T.ElementSize.Small]:"size-5",[T.ElementSize.Standard]:"size-6",[T.ElementSize.Large]:"size-7"},D=j=>{v(j),g?.(j)};return n.jsx(w.DialDropdown,{...m,disabled:s,placement:u,matchReferenceWidth:d,className:a,open:C,onOpenChange:D,defaultOpen:f,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",y?"h-8 px-2":"h-10 px-2",c?void 0:S,i),children:[n.jsx(w.DialIcon,{icon:e,className:I.mergeClasses(w.DIAL_KIT_CLASS.dropdownIcon,"flex items-center justify-center text-inherit",E[r],c&&"-mr-2",o)}),c&&n.jsxs("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.dropdownIconCaret,"relative z-10 inline-grid size-5 shrink-0 place-items-center"),children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(w.DialIcon,{icon:l,className:I.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",C&&"rotate-180")})]})]})})},co="application/octet-stream";function uo(e,t){if(!e||e.length===0)return[];const r=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!r)return[];const s=r.path||r.url||"",a=$t(s,!0),i=e.filter(c=>c!==r).map(c=>{const u=c.path||c.url||"",d=fo(c.nodeType),p=d===b.DialFileNodeType.FOLDER,g=$t(u,p);let f;return c.parentPath===null||c.parentPath===void 0?f=a:c.parentPath===""?f="":f=$t(c.parentPath,!0),{...c,originalPath:u,path:g,parentPath:f,nodeType:d}}),o=new Map;i.forEach(c=>{const u={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:po(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&&(u.extension=go(c.name),u.contentType=c.contentType||co,u.contentLength=c.contentLength||0),o.set(c.path,u)});const l=[];return o.forEach(c=>{if(c.parentPath===a)l.push(c);else{const u=c.path.lastIndexOf(c.name||""),d=c.path.slice(0,u),p=o.get(d);p&&p.nodeType===b.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function $t(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function fo(e){return e.toUpperCase()==="FOLDER"?b.DialFileNodeType.FOLDER:b.DialFileNodeType.ITEM}function po(e){if(!e)return;const t=e.toUpperCase();return Object.values(b.DialFileResourceType).find(s=>s.toUpperCase()===t)}function go(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function ho(e,t="Prompts",r="prompts/public/",s="root"){const a=uo(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:b.DialFileNodeType.FOLDER,folderId:s,items:a}]}const yn=({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 Ye=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(Ye||{}),at=(e=>(e.Select="select",e.Radio="radio",e))(at||{}),jt=(e=>(e.Row="row",e.Column="column",e))(jt||{}),$=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))($||{});const mo={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"},vn=h.createContext(null);function je(){const e=h.useContext(vn);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function Lr(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 J(e,t,r=0){if(r>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let i=t;for(const d of a)i=i?.[d];if(!i||typeof i!="object")return e;const{$ref:o,...l}=s,c=i;s={...c.$ref?J(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=Lr(o,J(l,t,r+1));s=Lr(o,i)}return s}function Dn(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 Tt(e){return e==null||e===""}function We(e){return e.type===$.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function bt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Cn(e,t){return e.type===$.Null?"null":e.$ref?J(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 Oe(e,t,r=0){if(r>15)return;const s=J(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=J({$ref:s.discriminator.mapping[a]},t);return{...Oe(i,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(We(s)){if(s.properties){const a={};let i=!1;for(const[o,l]of Object.entries(s.properties)){const c=Oe(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 Ee(e,t,r,s="",a=0){if(a>15)return[];const i=[],o=J(t,r);if(o.anyOf){const u=o.anyOf.filter(d=>d.type!==$.Null);return e!=null&&u.length===1?Ee(e,u[0],r,s,a+1):i}if(o.oneOf&&o.discriminator){const u=o.discriminator.propertyName,d=e?.[u];if(d&&o.discriminator.mapping[d]){const p={$ref:o.discriminator.mapping[d]},g=J(p,r);return Ee(e,g,r,s,a+1)}return i}if(o.type===$.Array||!o.type&&Array.isArray(e)){if(Array.isArray(e)&&o.items)for(let u=0;u<e.length;u++){const d=Ee(e[u],o.items,r,`${s}[${u}]`,a+1);i.push(...d)}return i}if(!We(o))return i;const l=o.required??[],c=e;for(const u of l){const d=o.properties?.[u];if(d&&J(d,r).isHidden)continue;const p=s?`${s}.${u}`:u,g=c?.[u];if(Tt(g)){const f=d?.title??bt(u);i.push({path:p,message:`${f} is required`})}}if(c&&o.properties)for(const[u,d]of Object.entries(o.properties)){if(J(d,r).isHidden)continue;const p=s?`${s}.${u}`:u,g=c[u];if(g!=null){const f=Ee(g,d,r,p,a+1);i.push(...f)}}if(c&&o.additionalProperties!=null&&o.additionalProperties!==!1&&typeof o.additionalProperties=="object"){const u=o.additionalProperties;for(const[d,p]of Object.entries(c)){const g=s?`${s}.${d}`:d,f=Ee(p,u,r,g,a+1);i.push(...f)}}return i}function lr(e,t,r){const s=J(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(We(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!J(c,r).isHidden),i=a.length,o=e;return`${a.filter(([c])=>{const u=o?.[c];return u!=null&&u!==""}).length}/${i} fields`}return""}function xo(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===$.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>J(a,r).type===$.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>J(a,r).type===$.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const i=J(a,r);return i.type===$.Number||i.type===$.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>J(a,r).type===$.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const i=J(t[a],r);if(i.discriminator&&i.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const i=J(t[a],r);if(We(i)||i.oneOf)return a}return 0}return 0}function bo(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 In(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case $.String:return"";case $.Boolean:return!1;case $.Array:return[];case $.Integer:case $.Number:return;default:return{}}}const yo=[$.String,$.Number,$.Boolean,$.Null,$.Object,$.Array];function vo(e){return Array.isArray(e)?$.Array:typeof e=="object"&&e!==null?$.Object:typeof e=="boolean"?$.Boolean:typeof e=="number"?$.Number:e===null?$.Null:$.String}const Do={[$.String]:"",[$.Number]:0,[$.Boolean]:!1,[$.Null]:null,[$.Object]:{},[$.Array]:[]};function Co(e){return Do[e]}const it=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:i,onRemove:o,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[u,d]=h.useState(l),p=a===0,g="rounded border border-secondary",f=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",u?"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:f,onClick:()=>d(y=>!y),role:"button","aria-expanded":u,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:u?n.jsx(H.IconChevronDown,{size:16,stroke:2}):n.jsx(H.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:I.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(_e.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(w.DialIcon,{icon:n.jsx(H.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(w.DialIcon,{icon:n.jsx(H.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),o&&n.jsx(St,{size:T.ElementSize.Small,onClick:y=>{y.stopPropagation(),o()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),u&&n.jsx("div",{className:m,children:i})]})},Sn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:i,label:o})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:u=new Set,skipUntouched:d=!1}=je(),p=J(e,l),g=We(p),f=p.type===$.Array;if(g||f){const x=lr(t,p,l),v=Ee(t,p,l,s.join(".")),C=s.join("."),S=C+".",E=!d||u.has(C)||[...u].some(D=>D.startsWith(S));return n.jsx(it,{title:o??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:E?v.length:0,defaultExpanded:c,children:n.jsx(Ae,{schema:p,value:t,onChange:r,path:s,level:a+1,required:i})})}const y=(!d||u.has(s.join(".")))&&i&&Tt(t)?`${o??"Field"} is required`:void 0;return n.jsx(b.DialFormItem,{label:o,required:i,description:p.description,error:y,children:n.jsx(Ae,{schema:p,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:!0})})},gt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o}=je(),l=J(e,i),c=Dn(Object.entries(l.properties??{}).filter(([,p])=>!J(p,i).isHidden)),u=l.required??[],d=t??{};return c.length===0?n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noConfigurableProperties}):n.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,g])=>{const m=J(g,i).title??g.title??bt(p),y=u.includes(p);return n.jsx(Sn,{schema:g,value:d[p],onChange:x=>r({...d,[p]:x}),path:[...s,p],level:a,required:y,label:m},p)})})},Io=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,defaultExpanded:c=!0}=je(),u=Array.isArray(t)?t:[],d=e.items,[p,g]=h.useState(void 0);if(!d)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemSchema});const f=h.useMemo(()=>J(d,i),[d,i]),m=h.useMemo(()=>f.discriminator,[f]),y=h.useMemo(()=>m?.propertyName,[m]),x=h.useMemo(()=>m?Object.keys(m.mapping).map(E=>({value:E,label:E})):[],[m]),v=()=>{const E=p??x[0]?.value;let D;if(m&&E){const j=J({$ref:m.mapping[E]},i);D={...Oe(j,i)??{},[m.propertyName]:E}}else D=Oe(f,i)??In(f);r([...u,D])},C=E=>{r(u.filter((D,j)=>j!==E))},S=(E,D)=>{r(u.map((j,L)=>L===E?D:j))};return n.jsxs("div",{className:"flex flex-col gap-3",children:[u.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemsYet}),u.map((E,D)=>{const j=bo(E,y,D),L=lr(E,f,i),O=Ee(E,f,i,`${s.join(".")}[${D}]`);return n.jsx(it,{title:j,level:a,summary:L,errorCount:O.length,onRemove:l?void 0:()=>C(D),defaultExpanded:c,removeItemAriaLabel:o.removeItemAriaLabel,children:n.jsx(Ae,{schema:d,value:E,onChange:_=>S(D,_),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(Ne,{options:x,value:p??x[0]?.value,placeholder:o.selectTypeToAdd,onChange:E=>{const D=typeof E=="string"?E:E[0];g(D)}})}),n.jsx(b.DialGhostButton,{label:o.addItem,iconBefore:n.jsx(H.IconPlus,{size:16,stroke:2}),onClick:v})]})]})},So=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1}=je(),c=h.useId(),u=e.discriminator;if(u){const x=u.propertyName,v=u.mapping,C=Object.keys(v).map(j=>({value:j,label:j})),S=typeof t=="object"&&t!==null?t[x]:void 0,E=S?J({$ref:v[S]},i):void 0,D=j=>{const L=J({$ref:v[j]},i),O=Oe(L,i)??{};r({...O,[x]:j})};if(e.discriminatorDisplay===at.Radio){const j=e.discriminatorOrientation===jt.Row,L=S?(()=>{const O=J({$ref:v[S]},i),{[x]:_,...R}=O.properties??{};return{...O,properties:R}})():void 0;return j?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(v).map(O=>{const _=J({$ref:v[O]},i);return n.jsx(w.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:_.title??O,checked:S===O,disabled:l,onChange:()=>D(O)},O)})}),L&&n.jsx(gt,{schema:L,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(v).map(O=>{const _=J({$ref:v[O]},i),R=S===O,{[x]:N,...k}=_.properties??{},B={..._,properties:k};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(w.DialRadioButton,{name:c,value:O,inputId:`${c}-${O}`,label:_.title??O,checked:R,disabled:l,onChange:()=>D(O)}),R&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(gt,{schema:B,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(Ne,{options:C,value:S,placeholder:o.selectTypePlaceholder,disabled:l,onChange:j=>{const L=typeof j=="string"?j:j[0];L&&D(L)}})}),E&&n.jsx("div",{className:"pl-3",children:n.jsx(gt,{schema:E,value:t,onChange:r,path:s,level:a})})]})}const d=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<d.length;x++)if(J(d[x],i).required?.every(C=>C in t))return x}return 0})(),f=x=>{const v=J(d[x],i),C=Oe(v,i);r(C??null)},m=d[g];if(e.discriminatorDisplay===at.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:d.map((x,v)=>{const C=J(x,i),S=Cn(x,i)??`Option ${v+1}`,E=g===v;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(w.DialRadioButton,{name:c,value:String(v),inputId:`${c}-${v}`,label:S,checked:E,disabled:l,onChange:()=>f(v)}),E&&C&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Ae,{schema:C,value:t,onChange:r,path:s,level:a})})]},v)})});const y=d.map((x,v)=>{const C=J(x,i);return{value:String(v),label:C.title??`Option ${v+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(Ne,{options:y,value:String(g),disabled:l,onChange:x=>{const v=typeof x=="string"?x:x[0];f(Number(v))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Ae,{schema:m,value:t,onChange:r,path:s,level:a})})]})},No=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,readonly:o=!1}=je(),l=e.anyOf??[],c=l.map((m,y)=>({value:String(y),label:Cn(m,i)})),u=xo(t,l,i),d=l[u],g=J(d,i).type===$.Null,f=m=>{const y=J(l[m],i);if(y.type===$.Null){r(null);return}const x=Oe(y,i);if(x!==void 0){r(x);return}switch(y.type){case $.Array:r([]);break;case $.String:r("");break;case $.Boolean:r(!1);break;case $.Integer:case $.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(Ne,{options:c,value:String(u),disabled:o,onChange:m=>{const y=typeof m=="string"?m:m[0];f(Number(y))}})}),!g&&d&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Ae,{schema:d,value:t,onChange:r,path:s,level:a})})]})},Nn=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:i,readonly:o=!1,inputClassName:l,acceptableResourceTypes:c}=je(),u=e.const!==void 0,d=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===$.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(f=>{const m=c?.[f];return Array.isArray(m)?m.map(y=>{const x=String(y);return{value:x,label:x}}):[]});return n.jsx(Ne,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:f=>r(typeof f=="string"?f:f[0]),placeholder:i.enumSelectPlaceholder,className:l})}if(u)return n.jsx(b.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(d&&e.enumDisplay===at.Radio){const g=e.enumOrientation===jt.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(f=>{const m=String(f);return n.jsx(w.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:o,onChange:y=>r(y)},m)})})}if(d){const g=e.enum.map(f=>({value:String(f),label:String(f)}));return n.jsx(Ne,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:f=>r(typeof f=="string"?f:f[0]),placeholder:i.enumSelectPlaceholder})}switch(e.type){case $.Boolean:return n.jsx(_e.DialSwitch,{switchId:a,isOn:!!t,disabled:o,onChange:g=>r(g)});case $.Integer:return n.jsx(Zt,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.integerInputPlaceholder,containerClassName:l});case $.Number:return n.jsx(Zt,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(dn,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l}):n.jsx(b.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l})}},cr=({value:e,onChange:t,theme:r=ot.EditorThemes.dark,height:s=240})=>{const{readonly:a,texts:i}=je(),[o,l]=h.useState(null),[c,u]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-qv1Z0dLX.cjs")).then(g=>{l(()=>g.DialJsonEditor)})},[]);let d=!1;try{JSON.parse(c)}catch{d=!0}const p=g=>{const f=g??"";u(f);try{t(JSON.parse(f))}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:d?i.invalidJsonError:void 0})]})},Rr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),jn=e=>!!(e.oneOf||e.anyOf||e.type===$.Array||We(e)),jo={[$.String]:"entryTypeString",[$.Number]:"entryTypeNumber",[$.Boolean]:"entryTypeBoolean",[$.Null]:"entryTypeNull",[$.Object]:"entryTypeObject",[$.Array]:"entryTypeArray"},To=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,isUnschematizedValue:a,jsonEditorTheme:i,onKeyChange:o,onValueChange:l,onRemove:c,keyInputPlaceholder:u,removeFieldAriaLabel:d,path:p,level:g,readonly:f=!1,inputClassName:m})=>{const{rootSchema:y,texts:x,defaultExpanded:v=!0,touchedPaths:C=new Set,markTouched:S=()=>{},skipUntouched:E=!1}=je(),[D,j]=h.useState(t),L=jn(s),[O,_]=h.useState(()=>vo(r)),R=a&&(O===$.Object||O===$.Array),N=a&&O===$.Null,k=L||R,B=[...p,e,"key"].join("."),Q=(!E||C.has(B))&&t==="",V=h.useCallback(te=>{l(Co(te)),_(te)},[l]),F=h.useMemo(()=>yo.map(te=>({value:te,label:x[jo[te]]})),[x]),z=h.useMemo(()=>[{value:"true",label:x.booleanTrueOption},{value:"false",label:x.booleanFalseOption}],[x]),Z=`${e}-key-error`,G=a&&O===$.Boolean,ne=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:k?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(b.DialInput,{value:D,disabled:f,invalid:Q,"aria-describedby":Q?Z:void 0,onChange:te=>j(te??""),onBlur:()=>{S(B),D!==t&&o(D)},placeholder:u,containerClassName:m}),n.jsx(b.DialErrorText,{id:Z,text:Q?`${x.keyColumnHeader} is required`:void 0})]}),!L&&!R&&n.jsx("div",{className:"flex-1 min-w-0",children:N?n.jsx(b.DialInput,{value:"null",disabled:!0,onChange:void 0,className:"opacity-60"}):G?n.jsx(Ne,{options:z,value:r?"true":"false",disabled:f,onChange:te=>{const le=typeof te=="string"?te:te[0];le&&l(le==="true")}}):n.jsx(Nn,{schema:a?{type:O}:s,value:r,onChange:l})}),a&&n.jsx("div",{className:"w-28 shrink-0",children:n.jsx(T.DialTooltip,{tooltip:x.entryTypeChangeWarning,triggerClassName:"block",children:n.jsx(Ne,{options:F,value:O,disabled:f,onChange:te=>{const le=typeof te=="string"?te:te[0];le&&V(le)}})})}),!f&&n.jsx(St,{size:T.ElementSize.Small,onClick:c,"aria-label":d,className:"shrink-0 p-1"})]});if(!k)return ne;if(R)return n.jsxs("div",{className:"flex flex-col gap-2",children:[ne,n.jsx(cr,{value:r,onChange:l,theme:i},O)]});const X=[...p,t],W=lr(r,s,y),se=Ee(r,s,y,X.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[ne,n.jsx(it,{title:t,level:g,summary:W,errorCount:se.length+(Q?1:0),defaultExpanded:v,children:n.jsx(Ae,{schema:s,value:r,onChange:l,path:X,level:g+1})})]})},wo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,inputClassName:c,jsonEditorTheme:u}=je(),d=e.additionalProperties===!0||e.additionalProperties==null,p=d?{type:"string"}:typeof e.additionalProperties=="object"?J(e.additionalProperties,i):{type:"string"},g=jn(p),[f,m]=h.useState(()=>Object.entries(t??{}).map(([D,j])=>Rr(D,j))),y=D=>Object.fromEntries(D.filter(j=>j.key!=="").map(j=>[j.key,j.value])),x=(D,j)=>{const L=f.map((O,_)=>_===D?{...O,key:j}:O);m(L),r(y(L))},v=(D,j)=>{const L=f.map((O,_)=>_===D?{...O,value:j}:O);m(L),r(y(L))},C=()=>g?Oe(p,i)??In(p):"",S=()=>{m(D=>[...D,Rr("",C())])},E=D=>{const j=f.filter((L,O)=>O!==D);m(j),r(y(j))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[f.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noFieldsYet}),f.length>0&&!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}),d&&n.jsx("span",{className:"w-28 shrink-0 dial-tiny-text text-secondary font-medium",children:o.typeColumnHeader})]}),f.map((D,j)=>n.jsx(To,{pairId:D.id,pairKey:D.key,pairValue:D.value,valueSchema:p,isUnschematizedValue:d,jsonEditorTheme:u,onKeyChange:L=>x(j,L),onValueChange:L=>v(j,L),onRemove:()=>E(j),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(H.IconPlus,{size:16,stroke:2}),onClick:S})})]})},Ae=({schema:e,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:o=!1})=>{const{rootSchema:l,renderField:c,markTouched:u=()=>{},touchedPaths:d=new Set,skipUntouched:p=!1,jsonEditorTheme:g}=je(),f=J(e,l),m=v=>{u(s.join(".")),r(v)},y=!p||d.has(s.join("."));let x;if(f.oneOf)x=n.jsx(So,{schema:f,value:t,onChange:m,path:s,level:a});else if(f.anyOf&&f.type!==$.Object)x=n.jsx(No,{schema:f,value:t,onChange:m,path:s,level:a});else if(We(f)){const v=f.additionalProperties!=null&&f.additionalProperties!==!1,C=!f.properties||Object.keys(f.properties).length===0;v&&C?x=n.jsx(wo,{schema:f,value:t,onChange:m,path:s,level:a}):C&&f.additionalProperties!==!1?x=n.jsx(cr,{value:t,onChange:m,theme:g}):x=n.jsx(gt,{schema:f,value:t,onChange:m,path:s,level:a})}else if(f.type===$.Array)x=n.jsx(Io,{schema:f,value:t,onChange:m,path:s,level:a});else{const v=y&&i&&Tt(t),C=!o&&v?`${f.title??"Field"} is required`:void 0;x=n.jsxs(n.Fragment,{children:[n.jsx(Nn,{schema:f,value:t,onChange:m,invalid:v}),n.jsx(b.DialErrorText,{text:C})]})}return c?c(s,f,x):x},Eo=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:i=!0,inputClassName:o,variant:l=Ye.Sections,onChange:c,onPropertyChange:u,onDefaultValues:d,renderField:p,skipUntouched:g=!1,jsonEditorTheme:f,acceptableResourceTypes:m})=>{const y=h.useMemo(()=>({...mo,...r}),[r]),x=h.useMemo(()=>t||(Oe(e,e)??{}),[]),[v,C]=h.useState(x),[S,E]=h.useState(new Set),D=h.useCallback(N=>{E(k=>k.has(N)?k:new Set([...k,N]))},[]);h.useEffect(()=>{d?.(x)},[]);const j=(N,k)=>{const B={...v,[N]:k};C(B),c?.(B),u?.(N,k)},L=new Set(Object.keys(e.properties??{})),O=Object.keys(v).filter(N=>!L.has(N)),_=Dn(Object.entries(e.properties??{}).filter(([,N])=>!J(N,e).isHidden)),R=e.required??[];return n.jsx(vn.Provider,{value:{rootSchema:e,texts:y,readonly:a,defaultExpanded:i,inputClassName:o,jsonEditorTheme:f,acceptableResourceTypes:m,renderField:p,touchedPaths:S,markTouched:D,skipUntouched:g},children:n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-4",s),children:[_.map(([N,k])=>{const B=J(k,e),U=B.title??k.title??bt(N),Q=R.includes(N),V=v[N];if(l===Ye.Flat)return n.jsx(Sn,{schema:k,value:V,onChange:G=>j(N,G),path:[N],level:0,required:Q,label:U},N);if(l===Ye.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(Ae,{schema:k,value:V,onChange:G=>j(N,G),path:[N],level:0,required:Q})]},N);const F=Ee(V,B,e,N),z=N+".",Z=!g||S.has(N)||[...S].some(G=>G.startsWith(z));return n.jsx(it,{title:U,description:B.description,level:0,defaultExpanded:i,errorCount:Z?Q&&Tt(V)?Math.max(F.length,1):F.length:0,children:n.jsx(Ae,{schema:k,value:V,onChange:G=>j(N,G),path:[N],level:1,required:Q})},N)}),O.map(N=>{const k=bt(N),B=n.jsx(cr,{value:v[N],onChange:U=>j(N,U),theme:f});return l===Ye.Sections?n.jsx(it,{title:k,level:0,defaultExpanded:i,children:B},N):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:k}),B]},N)})]})})},Oo=e=>({info:n.jsx(H.IconInfoCircleFilled,{size:e.size}),error:n.jsx(H.IconAlertCircleFilled,{size:e.size}),warning:n.jsx(H.IconAlertTriangleFilled,{size:e.size}),success:n.jsx(H.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(b.Spinner,{size:e.size}),general:n.jsx(H.IconCheck,{size:e.size,stroke:e.stroke})}),Ao={[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"},_o={[b.NotificationVariant.Info]:"status",[b.NotificationVariant.Success]:"status",[b.NotificationVariant.Warning]:"alert",[b.NotificationVariant.Error]:"alert",[b.NotificationVariant.Loading]:"status",[b.NotificationVariant.General]:"status"},Lo="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",dr=({variant:e=b.NotificationVariant.Info,type:t=b.NotificationType.Toast,title:r,message:s,className:a,iconSize:i=24,iconStroke:o=2,closable:l=!1,onClose:c,children:u,textClassName:d,...p})=>{const g=h.useMemo(()=>Oo({size:i,stroke:o})[e],[e,i,o]),f=d??(t===b.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:_o[e],...p,className:I.mergeClasses(w.DIAL_KIT_CLASS.notification,Lo,Ao[e],t===b.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===b.NotificationType.SectionMessage&&e===b.NotificationVariant.Loading&&"border-secondary",a),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:n.jsx(w.DialIcon,{icon:g})}),r?n.jsxs("div",{className:I.mergeClasses("flex min-w-0 text-primary break-words",f),children:[n.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),n.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:s})]}):n.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:s})]}),u,l&&n.jsx(P.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:m=>c?.(m)})]})},kr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Ro=e=>e===1?"!truncate !whitespace-nowrap":`${kr[e]??kr[2]} !whitespace-normal`,ko=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const i=I.mergeClasses(w.DIAL_KIT_CLASS.highlight,Ro(a),s);if(!t.trim())return n.jsx(P.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(P.EllipsisTooltip,{className:i,text:l})},Po=({className:e,children:t,...r})=>n.jsx("article",{...r,className:I.mergeClasses(w.DIAL_KIT_CLASS.cardShell,"relative flex flex-col gap-3 rounded-[20px] border-2 border-transparent p-5","bg-layer-raised shadow-md transition-[transform,box-shadow] duration-200 ease-out hover:-translate-y-[3px] hover:shadow-lg motion-reduce:transition-none motion-reduce:hover:translate-y-0",e),children:t}),Je=(e,t)=>({type:s,...a})=>n.jsx(dr,{...a,variant:e,type:s||t}),Qe=(e,t)=>({variant:s,...a})=>n.jsx(dr,{...a,variant:s||t,type:e}),Mo=Je(b.NotificationVariant.Error,b.NotificationType.Toast),Fo=Je(b.NotificationVariant.Info,b.NotificationType.Toast),Bo=Je(b.NotificationVariant.Success,b.NotificationType.Toast),zo=Je(b.NotificationVariant.Warning,b.NotificationType.Toast),$o=Je(b.NotificationVariant.Loading,b.NotificationType.Toast),Ho=Je(b.NotificationVariant.General,b.NotificationType.Toast),Ko=Qe(b.NotificationType.SectionMessage,b.NotificationVariant.Error),Go=Qe(b.NotificationType.SectionMessage,b.NotificationVariant.Info),Vo=Qe(b.NotificationType.SectionMessage,b.NotificationVariant.Success),Uo=Qe(b.NotificationType.SectionMessage,b.NotificationVariant.Warning),Wo=Qe(b.NotificationType.SectionMessage,b.NotificationVariant.Loading),qo=Qe(b.NotificationType.SectionMessage,b.NotificationVariant.General);var be=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(be||{});const Zo="en-GB",Yo={[be.Date]:"Select date",[be.DateTime]:"Select date and time",[be.Time]:"--:--",[be.Weekday]:"Select day"},Tn="flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus",wn="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",En="!border-error",Xo="z-[53] flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Jo="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",Qo="bg-control-accent text-control-permanent",el="text-accent dial-small-semi-text",tl="text-control-disable-primary",On="text-secondary",rl=n.jsx(H.IconCalendar,{size:K.DIAL_ICON_SIZE.MD,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On}),Pr={prev:n.jsx(H.IconChevronLeft,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx(H.IconChevronRight,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},nl=(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})},Mr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Fr=(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},sl=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Br=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),al=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),dt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,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),ol=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const s=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),s.length===0)return r;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${r}:${a}`},An=5,_n=e=>e.charAt(0).toUpperCase()+e.slice(1),ll=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return _n(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),cl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return{value:String(r+1),label:_n(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),$r=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:i,panel:o,labelledBy:l,panelLabel:c})=>{const u=w.useThemeScope(),[d,p]=h.useState(!1),{refs:g,floatingStyles:f,context:m}=de.useFloating({open:d,onOpenChange:E=>p(t?!1:E),placement:"bottom-start",whileElementsMounted:de.autoUpdate,middleware:[de.offset(8),de.flip({padding:8}),de.shift({padding:8})]}),y=de.useClick(m,{enabled:!t}),x=de.useDismiss(m),v=de.useRole(m,{role:"dialog"}),{getReferenceProps:C,getFloatingProps:S}=de.useInteractions([y,x,v]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":d,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:I.mergeClasses(Tn,"focus-visible:outline focus-visible:outline-focus",r&&En,t&&wn,i),...C(),children:s}),d&&n.jsx(de.FloatingPortal,{children:n.jsx(de.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:f,"aria-label":c,className:I.mergeClasses(Xo,u,a),...S(),children:o(()=>p(!1))})})})]})},Hr=({id:e,value:t,onChange:r,onBlur:s,disabled:a,invalid:i,className:o,ariaLabel:l,placeholder:c="--:--",timezoneLabel:u})=>{const[d,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:d,onChange:f=>{const m=ol(f.target.value);p(m),il(m)&&r(m)},onBlur:s,className:I.mergeClasses(Tn,i&&En,a&&wn,o)});return u?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:u})]}):g},dl=({mode:e=be.Date,value:t,onChange:r,onBlur:s,labelProps:a,placeholder:i,disabled:o=!1,invalid:l=!1,id:c,className:u,minDate:d,maxDate:p,locale:g=Zo,fieldClassName:f,showTimezone:m=!1})=>{const y=i??Yo[e],x=t instanceof Date?t:null,v=h.useId(),C=c??v,S=a?.id??`${C}-label`,E=!!a?.label,D=typeof a?.label=="string"?a.label:void 0,j=E?`${S} ${C}`:void 0,L=a?n.jsx(P.Label,{...a,id:S,htmlFor:C}):null,[O,_]=h.useState(()=>x??new Date),R=h.useMemo(()=>new Date,[]),N=h.useMemo(()=>m?yn({locale:g}):null,[m,g]),k=h.useMemo(()=>ll(g),[g]),B=h.useMemo(()=>cl(g),[g]),U=h.useMemo(()=>nl(O.getFullYear(),O.getMonth()),[O]),Q=Z=>{_(G=>new Date(G.getFullYear(),G.getMonth()+Z,1))},V=(Z,G)=>{if(Fr(Z,d,p))return;const ne=e===be.DateTime&&x?zr(Z,dt(x)):Z;r?.(ne),e===be.Date&&G()},F=Z=>{r?.(zr(x??new Date,Z))},z=()=>x?e===be.DateTime?`${Br(x,g)}, ${dt(x)}`:Br(x,g):y;if(e===be.Time){const Z=typeof t=="string"?t:x?dt(x):"";return n.jsxs("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.calendar,"flex flex-col gap-y-3",u),children:[L,n.jsx(Hr,{id:C,value:Z,onChange:G=>r?.(G),onBlur:s,disabled:o,invalid:l,placeholder:y,className:f,timezoneLabel:N})]})}if(e===be.Weekday){const Z=typeof t=="string"?t:void 0,G=B.find(ne=>ne.value===Z);return n.jsxs("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.calendar,"flex flex-col gap-y-3",u),children:[L,n.jsx($r,{id:C,disabled:o,invalid:l,labelledBy:j,panelLabel:D??y,fieldClassName:f,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!G&&"text-secondary"),children:G?.label??y}),n.jsx(H.IconChevronDown,{size:K.DIAL_ICON_SIZE.MD,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On})]}),panel:ne=>n.jsx("div",{role:"listbox","aria-label":D??y,className:"flex flex-col gap-0.5",children:B.map(X=>n.jsx("button",{type:"button",role:"option","aria-selected":X.value===Z,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===Z&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(X.value),ne()},children:X.label},X.value))})})]})}return n.jsxs("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.calendar,"flex flex-col gap-y-3",u),children:[L,n.jsx($r,{id:C,disabled:o,invalid:l,labelledBy:j,panelLabel:D??y,fieldClassName:f,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!x&&"text-secondary"),children:z()}),rl]}),panel:Z=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(P.StaticIconButton,{"aria-label":"Previous month",icon:Pr.prev,size:T.ElementSize.Small,onClick:()=>Q(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:sl(O,g)}),n.jsx(P.StaticIconButton,{"aria-label":"Next month",icon:Pr.next,size:T.ElementSize.Small,onClick:()=>Q(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[k.map(G=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:G},G)),U.map(G=>{const ne=G.getMonth()!==O.getMonth(),X=Mr(G,x),W=Mr(G,R),se=Fr(G,d,p);return n.jsx("button",{type:"button",disabled:se,"aria-label":al(G,g),"aria-pressed":X,"aria-current":W?"date":void 0,className:I.mergeClasses(Jo,ne&&tl,W&&!X&&el,X&&Qo,se&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>V(G,Z),children:G.getDate()},G.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(Hr,{ariaLabel:"Time",value:x?dt(x):"",onChange:F,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},ul=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const i=n.jsx(w.DialIcon,{icon:n.jsx(H.IconFolder,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.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(w.DIAL_KIT_CLASS.folderPath,s),ariaLabel:a,separator:n.jsx(w.DialIcon,{icon:n.jsx(H.IconChevronRight,{size:14,stroke:oe.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")})},et=({label:e,variant:t,appearance:r=T.ButtonAppearance.Solid,size:s=T.ElementSize.Standard,className:a,textClassName:i,iconAfter:o,iconBefore:l,type:c="button",tooltipProps:u,href:d,target:p,rel:g,disabled:f,...m})=>{const y=I.mergeClasses("dial-kit-base-button",t&&P.getButtonClassNames(t,r),s===T.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===T.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===T.ElementSize.Small&&"dial-kit-base-button-small",r!==T.ButtonAppearance.Link&&(s===T.ElementSize.Small?"px-2":"px-4"),s!==T.ElementSize.Small&&r!==T.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:u?.tooltip,v=T.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),C=n.jsxs(n.Fragment,{children:[n.jsx(w.DialIcon,{icon:l}),e&&n.jsx("span",{className:i,children:e}),n.jsx(w.DialIcon,{icon:o})]}),S=m,E=d!==void 0?n.jsx("a",{...S,href:f?void 0:d,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":f||void 0,tabIndex:f?-1:S.tabIndex,onClick:f?void 0:S.onClick,className:y,"aria-label":v,children:C}):n.jsx("button",{...m,type:c,disabled:f,className:y,"aria-label":v,children:C});return u?n.jsx(P.Tooltip,{asChild:!0,...u,children:E}):E},ur=(e,t)=>({appearance:s,...a})=>n.jsx(et,{...a,variant:e,appearance:s||t}),fr=(e,t)=>({variant:s,...a})=>n.jsx(et,{...a,variant:s||t,appearance:e}),Ln=ur(T.ButtonVariant.Primary,T.ButtonAppearance.Solid),pr=ur(T.ButtonVariant.Neutral,T.ButtonAppearance.Solid),fl=ur(T.ButtonVariant.Danger,T.ButtonAppearance.Solid),pl=fr(T.ButtonAppearance.Link,T.ButtonVariant.Primary),gl=fr(T.ButtonAppearance.Ghost,T.ButtonVariant.Primary),hl=fr(T.ButtonAppearance.Outlined,T.ButtonVariant.Neutral),ml=({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":T.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx(H.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(T.DialTooltip,{...r,children:o}):o},xl=e=>n.jsx(H.IconChevronDown,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",e&&"rotate-180")}),bl=({variant:e,appearance:t,items:r,...s})=>{const[a,i]=h.useState(!1),o=h.useMemo(()=>xl(a),[a]);return n.jsx("div",{className:w.DIAL_KIT_CLASS.buttonDropdown,children:n.jsx(P.Dropdown,{items:r,onOpenChange:l=>i(l),children:n.jsx(et,{...s,iconAfter:o,variant:e||T.ButtonVariant.Primary,appearance:t||T.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":a})})})},Rn=({label:e,size:t,isOpen:r=!1,"aria-label":s,...a})=>{const i=t===T.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(w.DIAL_KIT_CLASS.inlineSelect,"dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus","flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary","hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",i,a.className),...a,children:[e,n.jsx(H.IconChevronDown,{size:K.DIAL_ICON_SIZE.MD,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",r&&"rotate-180")})]})},yl=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:i,placement:o="bottom-end",matchReferenceWidth:l=!1,listClassName:c,ariaLabel:u})=>{const[d,p]=h.useState(!1),[g,f]=h.useState(r??e[0]?.key),m=t!==void 0,y=m?t:g,x=h.useMemo(()=>{const C=e.find(S=>S.key===y);return C?.label?String(C.label):""},[e,y]),v=h.useCallback(({key:C})=>{const S=e.find(E=>E.key===C);S&&(m||f(C),s?.(S))},[e,m,s]);return n.jsx(P.Dropdown,{items:e,placement:o,matchReferenceWidth:l,listClassName:c,disabled:i,onOpenChange:p,onItemClick:v,children:n.jsx(Rn,{label:x,size:a,isOpen:d,disabled:i,"aria-label":u})})},ke=({text:e,className:t,variant:r=b.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:I.mergeClasses(w.DIAL_KIT_CLASS.captionText,r===b.CaptionType.Error&&w.DIAL_KIT_CLASS.errorText,"dial-tiny-text",r===b.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,Pe=({...e})=>n.jsx(ke,{...e,variant:b.CaptionType.Error}),vl="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",Dl={[T.ElementSize.Small]:"size-[24px]",[T.ElementSize.Standard]:"size-[40px]",[T.ElementSize.Large]:"size-[48px]"},Cl=({icon:e,onClick:t,disabled:r,size:s=T.ElementSize.Standard,className:a})=>n.jsx("div",{className:I.mergeClasses("border-l border-tertiary",Dl[s]),children:n.jsx(P.IconButton,{className:I.mergeClasses(vl,s===T.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),Il=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],kn=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!Il.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if((r!==void 0||s!==void 0)&&e.currentTarget.selectionStart!==null){const i=e.currentTarget.value,o=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??o,c=i.slice(0,o)+e.key+i.slice(l),u=parseFloat(c);if(!isNaN(u)){if(r!==void 0&&u<+r){e.preventDefault();return}if(s!==void 0&&u>+s){e.preventDefault();return}}}}},Pn={[T.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[T.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[T.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},Ve=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:i=T.ElementSize.Standard,...o})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",Pn[i].stackGap,a),children:[e&&n.jsx(P.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Mn,{id:s,size:i,...o}),n.jsx(Pe,{text:t}),!t&&n.jsx(ke,{text:r})]})]}),Mn=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:i,iconBefore:o,iconAfter:l,wrapperClassName:c,type:u,inputRef:d,value:p,tooltipText:g,min:f,onChange:m,max:y,inputButtonProps:x,wrapperRef:v,size:C=T.ElementSize.Standard,...S})=>{const E=Pn[C],D=h.useRef(null),j=de.useMergeRefs([d,D]),L=u==="number"||f!==void 0||y!==void 0;h.useEffect(()=>{const N=D.current;if(!N||!L||t)return;const k=B=>{B.preventDefault()};return N.addEventListener("wheel",k,{passive:!1}),()=>{N.removeEventListener("wheel",k)}},[t,L,u]);const O=N=>{kn(N,u,f,y)},_=N=>{const k=N.currentTarget.value;if(L&&k!==""){const B=parseFloat(k);if(isNaN(B)&&k!=="-"&&k!=="."||!isNaN(B)&&(f!==void 0&&B<+f||y!==void 0&&B>+y))return}m?.(k||void 0)},R=()=>n.jsxs("div",{ref:v,className:I.mergeClasses("dial-kit-input flex flex-row items-center justify-between",E.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&E.paddingStart,!x&&E.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(Mn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:C,id:`${r}_textBefore`})}),n.jsx(w.DialIcon,{icon:o}),i,n.jsx("input",{ref:j,type:u,autoComplete:u==="password"?"new-password":"off",value:p??"",className:I.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:_,onKeyDown:O,min:f,disabled:t,max:y,...S}),a&&n.jsxs("p",{className:I.mergeClasses("text-secondary",E.postfixText),children:[" ",a]}),n.jsx(w.DialIcon,{icon:l}),x&&n.jsx(Cl,{size:C,...x,disabled:t})]});return t&&u!=="password"?n.jsx(P.Tooltip,{tooltip:g||p,children:R()}):R()};var Ue=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(Ue||{});const Sl="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",Nl={[Ue.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Ue.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},jl="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Tl="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ke=({label:e,icon:t,appearance:r=Ue.Outlined,selected:s=!1,disabled:a=!1,closable:i=!1,removeLabel:o,className:l,title:c,onClick:u,onRemove:d,onKeyDown:p,...g})=>{const f=r===Ue.Selectable,m=!!u&&!a,y=i&&!!d&&!a,x=f&&s,v=C=>{p?.(C),!(!m||C.defaultPrevented)&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":f&&m?s:void 0,onClick:a?void 0:u,onKeyDown:v,className:I.mergeClasses(w.DIAL_KIT_CLASS.tag,Sl,x?"dial-tiny-semi-text":"dial-tiny-text",Nl[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[jl,Tl],l),children:[t&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),n.jsx("span",{className:"truncate",title:c??e,children:e}),y&&n.jsx(P.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:T.ElementSize.Small,"aria-label":o??`Remove ${e}`,icon:n.jsx(H.IconX,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C=>{C.stopPropagation(),d?.(C)}})]})},Fn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx(n.Fragment,{children:t.map(s=>{const a=e.find(i=>i.value===s);return n.jsx(Ke,{label:a?.label??s,closable:!!r,onRemove:i=>r?.(i,s),icon:a?.icon,className:"max-w-full border border-tertiary"},s)})}),wl=I.mergeClasses("w-full flex flex-col"),El=P.overlayItemClassName,Ol="!max-w-[var(--reference-width)]",Al="max-h-[344px] overflow-y-auto",_l=P.overlayGap,Ll=P.overlaySubMenuClassName,Rl=n.jsx(H.IconChevronRight,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),kl="text-secondary transition-transform",Pl=8,Ml=n.jsx(H.IconSearch,{size:K.DIAL_ICON_SIZE.MD,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Fl=n.jsx(H.IconX,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Bl=n.jsx(P.SvgNoData,{width:K.DIAL_ICON_SIZE.LG,height:K.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),zl=({opt:e,selectedValues:t,mark:r=P.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:i,refs:o,floatingStyles:l,context:c,getReferenceProps:u,getFloatingProps:d}=w.useSubMenuFloating(_l,"listbox",!!e.disabled),p=e.children?.some(f=>t.includes(f.value)),g=n.jsx(P.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:Rl,...u()});return n.jsxs(de.FloatingNode,{id:i,children:[e.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(w.SubMenuPanel,{refs:o,floatingStyles:l,context:c,getFloatingProps:d,role:"listbox",surfaceClassName:Ll,children:e.children.map(f=>{const m=n.jsx(P.MenuItem,{role:"option","aria-selected":t.includes(f.value),"aria-disabled":!!f.disabled,disabled:f.disabled,mark:r,selected:t.includes(f.value),ellipsisLabel:!0,icon:f.icon,label:f.labelNode??f.label,rightControl:f.rightControl,onClick:()=>!f.disabled&&s(f.value)});return n.jsx(h.Fragment,{children:f.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:f.interactiveTooltip.placement,content:f.interactiveTooltip.content,contentClassName:f.interactiveTooltip.contentClassName,children:m}):m},f.value)})})]})},$l=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:i=T.ElementSize.Standard,prefix:o,customSelectedValue:l,placeholder:c="Select...",labelProps:u,error:d,caption:p,ariaLabel:g,searchable:f=!1,searchSize:m=T.ElementSize.Standard,searchPlaceholder:y,selectAll:x=!1,invalid:v,selectAllLabel:C="Select all",selectedOptionMark:S=P.MenuItemMark.Tint,emptyStateTitle:E="No options available",emptyStateDescription:D,emptyStateIcon:j,disabled:L=!1,className:O,fieldClassName:_,listClassName:R,closable:N=!1,header:k,footer:B,onClose:U,onChange:Q,dismissRef:V,onFooterClick:F,open:z,onOpenChange:Z,onSearchQueryChange:G,customMultiSelectTagsRenderer:ne})=>{const X=h.useId(),W=r||X,se=`list-${W}`,te=i===T.ElementSize.Small,[le,ue]=h.useState(!1),pe=z!==void 0,ge=pe?!!z:le,fe=h.useCallback(M=>{pe||ue(M),Z?.(M)},[pe,Z]),[q,ee]=h.useState(""),Ie=h.useCallback(M=>{M!==q&&(ee(M||""),G?.(M||""))},[G,q]),Me=s!==void 0,[he,Fe]=h.useState(a),Te=Me?s:he,ae=h.useMemo(()=>t?Array.isArray(Te)?Te:[]:typeof Te=="string"?[Te]:[],[Te,t]),Le=h.useMemo(()=>{const M=q.trim().toLowerCase();return M?e.filter(ce=>ce.label.toLowerCase().includes(M)):e},[e,q]);h.useEffect(()=>{ge||Ie("")},[ge,Ie]);const Se=h.useCallback(M=>{Me||Fe(M),Q?.(M)},[Me,Q]),Be=h.useCallback(M=>{if(t){const ce=new Set(ae);ce.has(M)?ce.delete(M):ce.add(M),Se(Array.from(ce));return}Se(M),fe(!1)},[t,Se,fe,ae]),tt=h.useCallback((M,ce)=>{if(M.stopPropagation(),!t){Se("");return}const lt=ae.filter(Un=>Un!==ce);Se(lt)},[t,ae,Se]),ve=h.useMemo(()=>Le.filter(M=>!M.disabled),[Le]),ze=h.useMemo(()=>ve.filter(M=>ae.includes(M.value)).length,[ve,ae]),{allSelectedInFiltered:Re,someSelectedInFiltered:me}=h.useMemo(()=>{const M=ve.length>0&&ze===ve.length;return{allSelectedInFiltered:M,someSelectedInFiltered:ze>0&&!M}},[ve,ze]),wt=h.useCallback(()=>{if(!(!t||ve.length===0))if(Re){const M=new Set(ve.map(ce=>ce.value));Se(ae.filter(ce=>!M.has(ce)))}else{const M=new Set(ae);ve.forEach(ce=>M.add(ce.value)),Se(Array.from(M))}},[Re,t,ve,ae,Se]),we=ae.length>0,$e=!t&&we?ae[0]:void 0,A=h.useMemo(()=>$e?e.find(M=>M.value===$e)??e.flatMap(M=>M.children??[]).find(M=>M.value===$e):void 0,[e,$e]),re=A?o?`${o} ${A.label}`:A.label:void 0,xe=h.useMemo(()=>t?we?n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:ne?.(e,ae,tt)??n.jsx(Fn,{options:e,selectedValues:ae,handleRemoveTag:tt})}):null:!A||!A.labelNode&&!A.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(P.EllipsisTooltip,{text:A.labelNode??re}),A.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:A.description})]}),[ne,tt,we,t,e,re,ae,A]),Et=t||xe?"":re||(l&&s?l:""),Hn=typeof u?.label=="string"?u.label:void 0,Kn=xe?[T.resolveAccessibleName(g,Hn),t?ae.map(M=>e.find(ce=>ce.value===M)?.label??M).join(", "):re].filter(Boolean).join(", ")||void 0:T.resolveAccessibleName(g);h.useImperativeHandle(V,()=>({dismiss:()=>{fe(!1)}}));const Gn=h.useCallback(M=>{L||(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),ge||fe(!0))},[L,ge,fe]),Vn=()=>n.jsxs("div",{id:se,role:"listbox","aria-multiselectable":t||void 0,className:wl,children:[k&&n.jsx(n.Fragment,{children:typeof k=="function"?k():k}),(f||N)&&(e.length>Pl||!!q)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(Ve,{id:`search-${W}`,size:m,placeholder:y,"aria-label":y||"Search options",onChange:M=>Ie(M),value:q,iconBefore:Ml,containerClassName:"w-full"}),N&&n.jsx(P.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:T.ElementSize.Small,icon:Fl,onClick:M=>{U?.(M),fe(!1)}})]}),t&&x&&ve.length>0&&n.jsx("div",{className:I.mergeClasses(El,"mt-2"),children:n.jsx(P.Checkbox,{id:`${W}-selectAll`,labelProps:{label:C},isSelected:Re,isIndeterminate:me,onChange:wt})}),n.jsx("div",{role:"none",className:Al,children:Le.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(w.DialNoDataContent,{icon:j??Bl,title:E,description:D})}):Le.map(M=>{const ce=ae.includes(M.value);if(M.children?.length)return n.jsx(zl,{opt:M,selectedValues:ae,mark:t?P.MenuItemMark.Checkbox:S,onSelect:Be},M.value);const lt=t?n.jsx(P.MenuItem,{id:`${W}-${M.value}`,role:"option","aria-selected":ce,"aria-disabled":!!M.disabled,disabled:M.disabled,mark:P.MenuItemMark.Checkbox,selected:ce,icon:M.icon,label:M.labelNode??M.label,description:M.description,rightControl:M.rightControl,onClick:()=>Be(M.value)}):n.jsx(P.MenuItem,{role:"option","aria-selected":ce,"aria-disabled":!!M.disabled,disabled:M.disabled,mark:S,selected:ce,ellipsisLabel:!0,icon:M.icon,label:M.labelNode??M.label,description:M.description,rightControl:M.rightControl,onClick:()=>!M.disabled&&Be(M.value)});return n.jsx(h.Fragment,{children:M.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:M.interactiveTooltip.placement,content:M.interactiveTooltip.content,contentClassName:M.interactiveTooltip.contentClassName,children:lt}):lt},M.value)})}),B&&n.jsx("div",{onClick:M=>{F?.(M),F&&fe(!1)},children:typeof B=="function"?B():B})]});return n.jsxs("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.select,"flex w-full flex-col gap-2",O),children:[u&&n.jsx(P.Label,{...u,htmlFor:W}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(P.Dropdown,{open:ge,onOpenChange:fe,disabled:L,closable:N,onClose:U,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:I.mergeClasses(Ol,R),className:"w-full",renderOverlay:Vn,children:n.jsx(Ve,{id:W,size:i,disabled:L,invalid:v,value:Et,placeholder:xe?void 0:c,readOnly:!0,iconBefore:t?void 0:A?.icon,iconAfter:n.jsx(H.IconChevronDown,{size:te?K.DIAL_ICON_SIZE.SM:K.DIAL_ICON_SIZE.MD,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses(kl,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":se,"aria-autocomplete":"none","aria-label":Kn,containerClassName:"w-full",wrapperClassName:I.mergeClasses(!L&&"cursor-pointer",t&&we&&["!h-auto flex-wrap py-1.5",te?"min-h-[24px]":"min-h-[40px]"],_),className:I.mergeClasses("cursor-pointer",xe&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Gn,children:xe})}),n.jsx(Pe,{text:d}),!d&&n.jsx(ke,{text:p})]})]})};var Bn=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(Bn||{});const Kr={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Hl=e=>typeof e=="boolean"?Kr[e?"both":"none"]:Kr[e],Kl=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...u})=>{const d=I.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",u.invalid&&"dial-kit-input-error",u.disabled&&"dial-kit-input-disable",Hl(i),e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",a),children:[o&&n.jsx(P.Label,{...o,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:d,onChange:p=>r?.(p.currentTarget.value),...u}),n.jsx(Pe,{text:s}),!s&&n.jsx(ke,{text:l})]})]})},Gl=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=T.ElementSize.Standard,...a})=>{const[i,o]=h.useState(!1),l=i&&!r;return h.useEffect(()=>{r&&o(!1)},[r]),n.jsx(Ve,{...a,wrapperClassName:I.mergeClasses(w.DIAL_KIT_CLASS.passwordInput,a.wrapperClassName),size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx(H.IconEyeOff,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(H.IconEye,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>o(c=>!c)})})},Vl=/^0+\.(\d+)?$/,Ul=/^0+/,Wl=[".","-","+","e","E"],Gr=e=>!e||e==="-"?e:String(e).match(Vl)?String(e).replace(Ul,"0"):Number(e),ql=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=u=>{if(e&&Wl.includes(u.key)){u.preventDefault();return}kn(u,"number",r,s),a?.(u)},c=u=>{if(e){const d=u.clipboardData.getData("text"),p=d.replace(/\D/g,"");if(p!==d&&(u.preventDefault(),p)){const g=u.currentTarget,f=g.selectionStart??0,m=g.selectionEnd??0,y=g.value.slice(0,f)+p+g.value.slice(m);t?.(Gr(y))}}i?.(u)};return n.jsx(Ve,{...o,wrapperClassName:I.mergeClasses(w.DIAL_KIT_CLASS.numberInput,o.wrapperClassName),type:"number",min:r,max:s,onChange:u=>t?.(Gr(u)),onKeyDown:l,onPaste:c})},Zl="z-[52] flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Yl="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Xl="flex flex-row items-center justify-between px-6 py-4",Jl="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",Ql="border-b border-tertiary",ec="flex flex-row items-center gap-2 px-6 py-4",tc="border-t border-tertiary",Ht="flex shrink-0 flex-row items-center gap-2",rc={[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]"},gr=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:i,titleClassName:o,headerClassName:l,bodyClassName:c,children:u,footer:d,footerClassName:p,onClose:g,onBack:f,backAriaLabel:m="Back",headerActions:y,headerDivider:x=!1,mainButtons:v,additionalButtons:C,additionalButtonsOnLeft:S=!1,footerDivider:E=!1,size:D=b.PopupSize.Md,hideClose:j=!1,closeAriaLabel:L="Close dialog",closeOnOutsideClick:O=!0,preventKeyboardOnOpen:_=!1})=>{const R=w.useThemeScope(),N=h.useRef(null),k=h.useId(),{refs:B,context:U}=de.useFloating({open:e,onOpenChange:W=>{W||g?.(null)}}),Q=de.useRole(U,{role:"dialog"}),V=de.useDismiss(U,{outsidePress:O}),{getFloatingProps:F}=de.useInteractions([Q,V]);if(!e)return null;const z=typeof t=="string"?`popup-heading-${k}`:void 0,Z=W=>W?typeof W=="string"?n.jsx("h2",{id:z,className:I.mergeClasses(Jl,o),children:n.jsx(P.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:n.jsx("span",{}),G=j?null:n.jsx(P.CloseButton,{ariaLabel:L,onClose:W=>g?.(W)}),ne=(W,se=[])=>se.map(({variant:te=T.ButtonVariant.Neutral,...le},ue)=>n.jsx(et,{variant:te,...le},`${W}-${ue}`)),X=()=>{if(d!==void 0)return d;if(!v?.length&&!C?.length)return null;const W=ne("additional",C);return n.jsxs("div",{className:I.mergeClasses(ec,E&&tc,p),children:[S&&W.length>0&&n.jsx("div",{className:Ht,children:W}),n.jsxs("div",{className:I.mergeClasses(Ht,"ml-auto"),children:[!S&&W,ne("main",v)]})]})};return n.jsx(de.FloatingPortal,{id:s,children:n.jsx(de.FloatingOverlay,{className:I.mergeClasses(Zl,R,i),children:n.jsx(de.FloatingFocusManager,{context:U,initialFocus:_?N:B.floating,children:n.jsxs("div",{ref:B.setFloating,...F(),role:"dialog","aria-modal":"true","aria-labelledby":z,"aria-label":z?void 0:r,className:I.mergeClasses(w.DIAL_KIT_CLASS.popup,Yl,rc[D],a),children:[_&&n.jsx("div",{ref:N,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:I.mergeClasses(Xl,x&&Ql,l),children:[f&&n.jsx(P.GhostIconButton,{"aria-label":m,size:T.ElementSize.Small,className:"mr-2",onClick:f,icon:n.jsx(H.IconChevronLeft,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),Z(t),y?n.jsxs("div",{className:Ht,children:[y,G]}):G]}),n.jsx("div",{className:I.mergeClasses("grow overflow-auto",c),children:u}),X()]})})})})},nc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",sc="text-secondary dial-small-paragraph-text px-6 pb-4",ac="px-6 py-4 h-[120px]",ic="Cancel",oc="Ok",Kt={[b.ConfirmationPopupVariant.Info]:{confirm:{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Solid}},[b.ConfirmationPopupVariant.Danger]:{container:"border-t-4 border-error",confirm:{variant:T.ButtonVariant.Danger,appearance:T.ButtonAppearance.Solid}}},lc=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=oc,cancelLabel:i=ic,isLoading:o=!1,disableConfirmButton:l=!1,className:c,confirmClassName:u,onClose:d,onConfirm:p,onCancel:g,children:f,variant:m=b.ConfirmationPopupVariant.Info,size:y=b.PopupSize.Sm,footer:x,hideClose:v,...C})=>{const S=o?null:n.jsxs("div",{className:nc,children:[n.jsx(pr,{label:i,onClick:()=>g?g():d?.()}),n.jsx(et,{variant:Kt[m].confirm.variant,appearance:Kt[m].confirm.appearance,className:u,label:a,disabled:l,onClick:p})]}),E=h.useCallback(()=>o?n.jsx("div",{className:ac,children:n.jsx(b.Spinner,{size:40})}):f??(t?n.jsx("div",{className:I.mergeClasses(sc,r),children:t}):null),[f,t,o,r]);return n.jsx(gr,{...C,open:s,header:e,className:I.mergeClasses(w.DIAL_KIT_CLASS.confirmationPopup,Kt[m].container,c),onClose:()=>d?.(),footer:x??S,size:y,hideClose:v??(!o&&x===void 0),children:E()})},cc=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,ariaLabel:l,onToggle:c,className:u,headerClassName:d,contentClassName:p})=>{const g=s!==void 0,[f,m]=h.useState(a),y=o?!0:g?s:f,x=h.useId(),v=`accordion-header-${x}`,C=`accordion-content-${x}`,S=()=>{if(i)return;const D=!y;g||m(D),c?.(D)},E=n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"flex min-w-0 flex-col",children:[n.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?n.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!o&&n.jsx(H.IconChevronRight,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",y&&"rotate-90")})]});return n.jsxs("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.accordion,"flex flex-col gap-3 py-3 overflow-hidden bg-transparent ",u),children:[o?n.jsx("div",{id:v,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",d),children:E}):n.jsx("button",{id:v,type:"button","aria-expanded":y,"aria-controls":y?C:void 0,"aria-label":T.resolveAccessibleName(l),disabled:i,onClick:S,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",i?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",d),children:E}),y&&n.jsx("div",{id:C,role:"region","aria-labelledby":v,className:I.mergeClasses("px-4 dial-small-text text-primary",p),children:r})]})},dc=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:i,className:o,...l})=>{const c=h.useId(),u=e??c,d=i?`${u}-caption`:void 0,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(w.DIAL_KIT_CLASS.switch,"flex items-center gap-2",o),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:u,checked:r,"aria-checked":r,disabled:s,onChange:p,"aria-label":T.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":d,className:"peer sr-only"}),n.jsx("label",{htmlFor:u,className:I.mergeClasses("flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",r?"justify-end":"justify-start",s?"cursor-not-allowed bg-control-disable-primary":I.mergeClasses("cursor-pointer",r?"bg-control-accent hover:bg-control-accent-hover":"bg-control-neutral-default hover:bg-control-neutral-hover-strong")),children:n.jsx("span",{className:I.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&n.jsx(P.Label,{size:T.ElementSize.Standard,...t,htmlFor:u,className:I.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),i&&n.jsx("span",{id:d,className:"dial-tiny-text text-secondary ml-[44px]",children:i})]})},uc="flex flex-col gap-2",fc="flex",pc="mt-2 ml-[26px]",gc={[b.RadioGroupOrientation.Column]:"flex-col gap-y-3",[b.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},zn=({items:e,value:t,onChange:r,name:s,id:a,orientation:i=b.RadioGroupOrientation.Column,labelProps:o,disabled:l,error:c,caption:u,ariaLabel:d,className:p,optionsClassName:g,radioClassName:f,contentClassName:m})=>{const y=h.useId(),x=a??y,v=`${x}-label`,C=c?`${x}-error`:void 0,S=!c&&u?`${x}-caption`:void 0,E=T.resolveAccessibleName(o?.label);return n.jsxs("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.radioGroup,uc,p),children:[o&&n.jsx(P.Label,{...o,id:v}),n.jsx("div",{role:"radiogroup","aria-labelledby":E?v:void 0,"aria-label":E?void 0:T.resolveAccessibleName(d),"aria-describedby":[C,S].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:I.mergeClasses(fc,gc[i],g),children:e.map(D=>{const j=D.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(P.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:j,disabled:l||D.disabled,onChange:r,className:f}),j&&D.content?n.jsx("div",{className:I.mergeClasses(pc,m),children:D.content}):null]},D.value)})}),n.jsx(Pe,{id:C,text:c}),!c&&n.jsx(ke,{id:S,text:u})]})},hc="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",mc="min-w-0 flex-1 truncate text-primary",xc="min-w-0 flex-1 truncate text-secondary",bc="shrink-0 text-secondary",yc="px-6 pb-4",vc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Dc="Cancel",Cc="Apply",Ic=({items:e,value:t,customValue:r,header:s,onApply:a,id:i,labelProps:o,placeholder:l,selectedValue:c,onSelectionChange:u,onCancel:d,onClose:p,isValid:g=!0,applyButtonLabel:f=Cc,cancelButtonLabel:m=Dc,size:y=b.PopupSize.Md,portalId:x,disabled:v,invalid:C,error:S,caption:E,ariaLabel:D,className:j,fieldClassName:L})=>{const O=h.useId(),_=i??O,R=`${_}-label`,N=`${_}-value`,k=S?`${_}-error`:void 0,B=!S&&E?`${_}-caption`:void 0,[U,Q]=h.useState(!1),V=c!==void 0,[F,z]=h.useState(t),Z=V?c:F,G=h.useCallback(()=>{v||(V||z(t),Q(!0))},[v,V,t]),ne=h.useCallback(()=>{Q(!1),p?.()},[p]),X=h.useCallback(()=>{d?.(),ne()},[d,ne]),W=h.useCallback(()=>{a(Z),ne()},[a,Z,ne]),se=h.useCallback(q=>{V||z(q),u?.(q)},[V,u]),te=T.resolveAccessibleName(o?.label),le=te?void 0:T.resolveAccessibleName(D),ue=te?R:le&&`${_}-name`,pe=T.resolveAccessibleName(s),ge=e.find(q=>q.value===t)?.label,fe=r??ge;return n.jsxs("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.radioGroupPopupField,"flex w-full flex-col gap-2",j),children:[o&&n.jsx(P.Label,{...o,id:R,htmlFor:_}),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:_,disabled:v,"aria-haspopup":"dialog","aria-expanded":U,"aria-labelledby":ue?`${ue} ${N}`:void 0,"aria-describedby":[k,B].filter(Boolean).join(" ")||void 0,onClick:G,className:I.mergeClasses(hc,C&&"dial-kit-input-error",v&&"dial-kit-input-disable",L),children:[n.jsx("span",{id:N,className:fe==null?xc:mc,children:fe??l}),n.jsx(H.IconMaximize,{size:K.DIAL_ICON_SIZE.MD,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:bc})]}),n.jsx(Pe,{id:k,text:S}),!S&&n.jsx(ke,{id:B,text:E})]}),n.jsx(gr,{open:U,header:s,ariaLabel:pe?void 0:te,portalId:x,size:y,onClose:X,footer:n.jsxs("div",{className:vc,children:[n.jsx(pr,{label:m,onClick:X}),n.jsx(Ln,{label:f,disabled:!g,onClick:W})]}),children:n.jsx("div",{className:yc,children:n.jsx(zn,{id:`${_}-options`,items:e,value:Z,onChange:se,orientation:b.RadioGroupOrientation.Column,ariaLabel:te??pe})})})]})},Sc=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:i,size:o=T.ElementSize.Small,className:l,...c})=>{const u=h.useCallback(p=>{a?.(p),s?.(!r)},[a,s,r]),d=n.jsx(P.IconButton,{...c,size:o,variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":T.resolveAccessibleName(c["aria-label"],i?.tooltip),onClick:u,className:I.mergeClasses(w.DIAL_KIT_CLASS.toggleIconButton,"!rounded","[&_svg]:size-4",r&&"!text-accent",l)});return i?n.jsx(P.Tooltip,{asChild:!0,...i,children:d}):d},Nc=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],jc="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Tc="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",wc="bg-layer-raised text-accent shadow-xs",Ec="bg-transparent text-secondary",Oc="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ac="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",_c="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",Lc="cursor-not-allowed bg-transparent text-control-disable-primary",Rc=({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),u=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,d=h.useCallback(p=>{if(s||!Nc.includes(p.key))return;const g=e.filter(v=>!v.disabled);if(g.length===0)return;const f=Math.max(g.findIndex(v=>v.value===t),0),m=g.length-1;let y=f;switch(p.key){case"ArrowRight":case"ArrowDown":y=f===m?0:f+1;break;case"ArrowLeft":case"ArrowUp":y=f===0?m:f-1;break;case"Home":y=0;break;case"End":y=m;break}p.preventDefault();const x=g[y];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:d,className:I.mergeClasses(w.DIAL_KIT_CLASS.segmentedControl,jc,a),children:e.map(p=>{const g=p.value===t,f=s||p.disabled;return n.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":T.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===u?0:-1,disabled:f,onClick:()=>r(p.value),className:I.mergeClasses(w.DIAL_KIT_CLASS.segmentedControlItem,Tc,g?wc:Ec,f?g?_c:Lc:g?Oc:Ac,i),children:[p.icon,p.label]},p.value)})})},kc=["ArrowRight","ArrowLeft","Home","End"],Pc=({tabs:e,activeTabId:t,onTabChange:r,ariaLabel:s,className:a,tabClassName:i})=>{const o=h.useRef({}),l=e.find(d=>d.id===t),c=l&&!l.disabled?l.id:e.find(d=>!d.disabled)?.id,u=h.useCallback(d=>{if(!kc.includes(d.key)||e.length===0)return;const p=e.filter(x=>!x.disabled);if(p.length===0)return;const g=Math.max(p.findIndex(x=>x.id===t),0),f=p.length-1;let m=g;switch(d.key){case"ArrowRight":m=g===f?0:g+1;break;case"ArrowLeft":m=g===0?f:g-1;break;case"Home":m=0;break;case"End":m=f;break}d.preventDefault();const y=p[m];o.current[y.id]?.focus(),y.id!==t&&r(y.id)},[e,t,r]);return n.jsx("div",{role:"tablist","aria-label":s,onKeyDown:u,className:I.mergeClasses(w.DIAL_KIT_CLASS.tabs,"flex justify-start gap-1",a),children:e.map(d=>{const p=t===d.id,g=!!d.disabled;return n.jsxs("button",{ref:f=>{o.current[d.id]=f},type:"button",role:"tab","aria-selected":p,disabled:g,tabIndex:d.id===c?0:-1,onClick:()=>r(d.id),className:I.mergeClasses(w.DIAL_KIT_CLASS.tab,"dial-small-paragraph-semi-text dial-kit-enhanced-target","border-b-2 border-transparent flex items-center gap-2 px-3 py-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",g&&"cursor-not-allowed border-control-disable-primary text-control-disable-primary",!g&&(p?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),i),children:[n.jsx("span",{children:d.label}),d.count!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"bg-layer-sunken text-control-disable-primary",!g&&(p?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:d.count})]},d.id)})})},Mc="flex flex-nowrap items-center gap-1",Fc="min-w-max flex-1 justify-center",Bc=({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(w.DIAL_KIT_CLASS.filterChips,Mc,a),children:e.map(c=>n.jsx(Ke,{label:c.label,icon:c.icon,appearance:Ue.Selectable,selected:c.value===t,onClick:()=>r(c.value),className:I.mergeClasses(s&&Fc,i)},c.value))}),Jt=(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})},zc=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:i,multiple:o=!1,disabled:l=!1,errorText:c,icon:u,id:d,ariaLabel:p,className:g})=>{const f=h.useId(),m=d??`file-dropzone-${f}`,y=c?`${m}-error`:void 0,[x,v]=h.useState(!1),C=h.useRef(0),S=h.useCallback(R=>{if(R.length===0)return;const N=o?R:R.slice(0,1),k=N.filter(U=>Jt(U,i)),B=N.filter(U=>!Jt(U,i));B.length>0&&a?.(B),k.length>0&&s(k)},[i,o,s,a]),E=h.useCallback(R=>{S(Array.from(R.target.files??[])),R.target.value=""},[S]),D=h.useCallback(()=>{C.current=0,v(!1)},[]),j=h.useCallback(R=>{l||(R.preventDefault(),C.current+=1,v(!0))},[l]),L=h.useCallback(R=>{l||(R.preventDefault(),R.dataTransfer.dropEffect="copy")},[l]),O=h.useCallback(()=>{l||(C.current-=1,C.current<=0&&D())},[l,D]),_=h.useCallback(R=>{R.preventDefault(),!l&&(D(),S(Array.from(R.dataTransfer?.files??[])))},[l,D,S]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(P.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:i,multiple:o,disabled:l,onChange:E,"aria-label":T.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":y,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:j,onDragOver:L,onDragLeave:O,onDrop:_,className:I.mergeClasses(w.DIAL_KIT_CLASS.fileDropzone,"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),children:[u??n.jsx(H.IconUpload,{size:K.DIAL_ICON_SIZE.LG,stroke:oe.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(Pe,{id:y,text:c})]})},$c=({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},Hc=4,Kc=24,Vr=e=>parseFloat(e)||0,Gc=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Vc=()=>{},Uc=({id:e,value:t,defaultValue:r,size:s=T.ElementSize.Standard,labelProps:a,placeholder:i,caption:o,error:l,invalid:c,disabled:u=!1,readOnly:d=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:f="Tags",className:m,fieldClassName:y,tagClassName:x,onChange:v})=>{const C=h.useId(),S=e||C,E=s===T.ElementSize.Small,D=h.useRef(null),j=h.useRef([]),L=h.useRef(null),O=t!==void 0,[_,R]=h.useState(r??[]),N=O?t:_,k=N.length,[B,U]=h.useState(""),[Q,V]=h.useState(k),F=!d&&!u,z=h.useCallback(q=>{O||R(q),v?.(q)},[O,v]),Z=h.useCallback(q=>ee=>{j.current[q]=ee},[]),G=h.useCallback(()=>{const q=D.current;if(!q||q.clientWidth===0){V(N.length);return}const{paddingLeft:ee,paddingRight:Ie}=getComputedStyle(q);V($c({availableWidth:q.clientWidth-Vr(ee)-Vr(Ie)-(d?0:Kc),tagWidths:N.map((Me,he)=>j.current[he]?.offsetWidth??0),overflowChipWidth:L.current?.offsetWidth??0,gap:Hc}))},[d,N]);h.useEffect(()=>{if(!p){V(k);return}const q=D.current;if(!q)return;const ee=new ResizeObserver(()=>G());return ee.observe(q),G(),()=>ee.disconnect()},[p,G,k]);const ne=I.mergeClasses(p?"shrink-0":"min-w-0",x),X=q=>{const ee=Gc(q.trim()).trim();!ee||N.includes(ee)||z([...N,ee])},W=q=>{z(N.filter(ee=>ee!==q))},se=()=>{X(B),U("")},te=q=>{if(F){if(q.key==="Enter"||q.key===","){q.preventDefault(),se();return}q.key==="Backspace"&&!B&&k>0&&(q.preventDefault(),z(N.slice(0,-1)))}},le=()=>{F&&B.trim()&&se()},ue=p?N.slice(0,Q):N,pe=p?N.slice(Q):[],ge=pe.join(", "),fe=k>0&&n.jsxs("span",{role:"list","aria-label":f,className:I.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ue.map(q=>n.jsx(Ke,{role:"listitem",label:q,className:ne,disabled:u,closable:F,onRemove:F?()=>W(q):void 0},q)),pe.length>0&&n.jsx(Ke,{role:"listitem",label:`+${pe.length}`,"aria-label":ge,title:ge,className:I.mergeClasses("shrink-0",x),disabled:u}),p&&n.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[N.map((q,ee)=>n.jsx("span",{ref:Z(ee),className:"inline-flex",children:n.jsx(Ke,{label:q,className:x,disabled:u,closable:F,onRemove:F?Vc:void 0})},q)),n.jsx("span",{ref:L,className:"inline-flex",children:n.jsx(Ke,{label:`+${k}`,className:x})})]})]});return n.jsx(Ve,{id:S,size:s,labelProps:a,caption:o,error:l,invalid:c,disabled:u,readOnly:d,value:B,placeholder:k>0?void 0:i,"aria-label":g,wrapperRef:D,onChange:q=>U(q??""),onKeyDown:te,onBlur:le,containerClassName:I.mergeClasses("w-full",m),wrapperClassName:I.mergeClasses(w.DIAL_KIT_CLASS.tagInput,k>0&&["!h-auto",E?"min-h-[24px] py-0.5":"min-h-[40px] py-1.5",p?"flex-nowrap overflow-hidden":"flex-wrap"],y),className:I.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",d&&"cursor-default"),children:fe})},Wc={[T.ElementSize.Small]:K.DIAL_ICON_SIZE.SM,[T.ElementSize.Standard]:K.DIAL_ICON_SIZE.MD,[T.ElementSize.Large]:K.DIAL_ICON_SIZE.MD},qc=({size:e=T.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:i,onChange:o,wrapperClassName:l,inputRef:c,...u})=>{const d=h.useRef(null),p=de.useMergeRefs([c,d]),g=!!i&&!a,f=h.useCallback(()=>{o?.(void 0),d.current?.focus()},[o]);return n.jsx(Ve,{...u,size:e,value:i,disabled:a,onChange:o,placeholder:t,inputRef:p,wrapperClassName:I.mergeClasses(w.DIAL_KIT_CLASS.search,r&&"dial-kit-input-borderless",l),iconBefore:n.jsx(H.IconSearch,{size:Wc[e],stroke:oe.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":s,icon:n.jsx(H.IconX,{size:K.DIAL_ICON_SIZE.SM,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:f}):void 0})},Zc=16,Yc=e=>(e.toString().split(".")[1]??"").length,Xc=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:i,labelProps:o,labels:l,formatValue:c,showValue:u=!1,caption:d,error:p,onChange:g,containerClassName:f,trackClassName:m,fillClassName:y,className:x,...v})=>{const C=h.useId(),S=e??C,E=d&&!p?`${S}-caption`:void 0,D=p?`${S}-error`:void 0,j=s-r,L=j>0?Math.min(100,Math.max(0,(t-r)/j*100)):0,O=`calc(${L}% + ${(.5-L/100)*Zc}px)`,_=c?c(t):t.toFixed(Yc(a)),R=h.useCallback(N=>{g?.(Number(N.target.value))},[g]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",f),children:[(o||u)&&n.jsxs("div",{className:"flex items-center gap-2",children:[o&&n.jsx(P.Label,{...o,htmlFor:S}),u&&n.jsx("span",{"aria-hidden":"true",className:I.mergeClasses("dial-small-text ml-auto",i?"text-control-disable-primary":"text-primary"),children:_})]}),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",y),style:{width:O}}),n.jsx("input",{...v,type:"range",id:S,value:t,min:r,max:s,step:a,disabled:i,onChange:R,"aria-label":T.resolveAccessibleName(typeof o?.label!="string"?v["aria-label"]:void 0),"aria-valuetext":c?_:void 0,"aria-describedby":D??E,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(Pe,{id:D,text:p}),!p&&n.jsx(ke,{id:E,text:d})]})]})},Jc=48,Qc=({children:e,title:t,width:r=280,collapsedWidth:s=Jc,isOpened:a,defaultOpened:i=!0,onToggle:o,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:d="Expand sidebar",className:p,titleClassName:g,contentClassName:f,footerClassName:m})=>{const y=a!==void 0,[x,v]=h.useState(i),C=y?a:x,S=`collapsible-sidebar-content-${h.useId()}`,E=C?u:d,D=j=>{const L=!C;y||v(L),o?.(L,j)};return n.jsxs("aside",{"aria-label":c,style:{width:`${C?r:s}px`},className:I.mergeClasses(w.DIAL_KIT_CLASS.collapsibleSidebar,"flex flex-col justify-between",p),children:[n.jsx("div",{id:S,hidden:!C,className:I.mergeClasses("min-h-0 flex-1 overflow-auto p-4",f),children:e}),n.jsx("div",{hidden:C,className:I.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),n.jsxs("div",{className:I.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",C?"justify-end px-2":"justify-center",m),children:[C&&l,n.jsx(P.IconButton,{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,size:T.ElementSize.Standard,onClick:D,"aria-label":E,"aria-expanded":C,"aria-controls":S,tooltipProps:{tooltip:E},icon:C?n.jsx(H.IconChevronsLeft,{size:K.DIAL_ICON_SIZE.MD,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(H.IconChevronsRight,{size:K.DIAL_ICON_SIZE.MD,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},ed=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:i,ariaLabel:o,onWidthChange:l,customHandler:c,handlerClassName:u})=>{const d=e===b.ResizableContainerSide.Left,p=d?H.IconChevronLeft:H.IconChevronRight,g=f=>{let m;switch(f.key){case"ArrowLeft":m=r+(d?i:-i);break;case"ArrowRight":m=r+(d?-i:i);break;case"Home":m=s;break;case"End":m=a;break;default:return}f.preventDefault(),l(m)};return n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":r,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:I.mergeClasses("relative h-full w-0.5 cursor-col-resize bg-control-accent text-accent","opacity-0 transition-opacity motion-reduce:transition-none","group-hover:opacity-100 focus-visible:opacity-100","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",t&&"opacity-100",u),children:c??n.jsx(p,{size:K.DIAL_ICON_SIZE.MD,stroke:oe.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",d?"right-full":"left-full")})})},td=16,$n=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:i,onResize:o,side:l=b.ResizableContainerSide.Right,keyboardStep:c=td,ariaLabel:u="Resize panel",className:d,resizeHandlerClassName:p,resizeHandler:g})=>{const[f,m]=h.useState(!1),[y,x]=h.useState(a??t),v=s!==void 0,C=v?s:y,S=h.useRef(null),E=h.useCallback(()=>{m(!0)},[]),D=h.useCallback(()=>{m(!1);const O=S.current?.resizable?.getBoundingClientRect(),_=O?Math.round(O.width):t;v||x(_),i?.(_)},[i,v,t]),j=h.useCallback(O=>{const _=Math.min(r,Math.max(t,O));_!==C&&(v||(x(_),S.current?.updateSize({width:_,height:"100%"})),o?.(_),i?.(_))},[r,t,C,v,o,i]),L=h.useMemo(()=>{const O=l===b.ResizableContainerSide.Left,_=n.jsx(ed,{side:l,isResizing:f,width:C,minWidth:t,maxWidth:r,step:c,ariaLabel:u,onWidthChange:j,customHandler:g,handlerClassName:p});return{size:v?{width:C,height:"100%"}:void 0,defaultSize:v?void 0:{width:C,height:"100%"},minWidth:t,maxWidth:r,enable:{left:O,right:!O},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:O?_:void 0,right:O?void 0:_},onResizeStart:E,onResize:(R,N,k)=>{o?.(Math.round(k.offsetWidth))},onResizeStop:D}},[l,v,C,t,r,c,u,j,g,p,f,E,D,o]);return n.jsx(b.Resizable,{ref:S,...L,children:n.jsx("div",{className:I.mergeClasses(w.DIAL_KIT_CLASS.resizableContainer,"group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",d),children:e})})},rd=({enabled:e=!0,children:t,...r})=>e?n.jsx($n,{...r,children:t}):t;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=_e.DialLabel;exports.DialSwitch=_e.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=w.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=w.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=w.DIAL_KIT_CLASS;exports.DialCloseButton=w.DialCloseButton;exports.DialDangerIconButton=w.DialDangerIconButton;exports.DialDateCellRenderer=w.DialDateCellRenderer;exports.DialDropdown=w.DialDropdown;exports.DialEllipsisTooltip=w.DialEllipsisTooltip;exports.DialGhostIconButton=w.DialGhostIconButton;exports.DialGrid=w.DialGrid;exports.DialIcon=w.DialIcon;exports.DialNeutralIconButton=w.DialNeutralIconButton;exports.DialNoDataContent=w.DialNoDataContent;exports.DialPrimaryIconButton=w.DialPrimaryIconButton;exports.DialRadioButton=w.DialRadioButton;exports.DialSecondaryIconButton=w.DialSecondaryIconButton;exports.DialSuccessIconButton=w.DialSuccessIconButton;exports.DialTertiaryIconButton=w.DialTertiaryIconButton;exports.DropdownItemType=w.DropdownItemType;exports.DropdownTrigger=w.DropdownTrigger;exports.DropdownType=w.DropdownType;exports.GridSelectionMode=w.GridSelectionMode;exports.ThemeScope=w.ThemeScope;exports.baseColumnComparator=w.baseColumnComparator;exports.checkColDefsChanges=w.checkColDefsChanges;exports.convertGridDateToDate=w.convertToDate;exports.convertToDate=w.convertToDate;exports.useThemeScope=w.useThemeScope;exports.BASE_ICON_PROPS=K.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=K.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=K.DIAL_ICON_SIZE;exports.mergeClasses=I.mergeClasses;exports.Checkbox=P.Checkbox;exports.CheckboxBox=P.CheckboxBox;exports.CloseButton=P.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=P.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=P.DEFAULT_LOCALE;exports.DangerIconButton=P.DangerIconButton;exports.DateCellRenderer=P.DateCellRenderer;exports.Dropdown=P.Dropdown;exports.EllipsisTooltip=P.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=P.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=P.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=P.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=P.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=P.GRID_THEME_PARAMS;exports.GhostIconButton=P.GhostIconButton;exports.Grid=P.Grid;exports.IconButton=P.IconButton;exports.InfoButton=P.InfoButton;exports.InteractiveTooltip=P.InteractiveTooltip;exports.Label=P.Label;exports.MenuItem=P.MenuItem;exports.MenuItemMark=P.MenuItemMark;exports.NeutralIconButton=P.NeutralIconButton;exports.NoDataContent=P.NoDataContent;exports.PrimaryIconButton=P.PrimaryIconButton;exports.Radio=P.Radio;exports.StaticIconButton=P.StaticIconButton;exports.Tooltip=P.Tooltip;exports.TooltipContainer=P.TooltipContainer;exports.TooltipContent=P.TooltipContent;exports.TooltipPlacement=P.TooltipPlacement;exports.TooltipTrigger=P.TooltipTrigger;exports.ButtonAppearance=T.ButtonAppearance;exports.ButtonVariant=T.ButtonVariant;exports.DialIconButton=T.DialIconButton;exports.DialTooltip=T.DialTooltip;exports.DialTooltipContainer=T.DialTooltipContainer;exports.DialTooltipContent=T.DialTooltipContent;exports.DialTooltipTrigger=T.DialTooltipTrigger;exports.ElementSize=T.ElementSize;exports.EditorThemes=ot.EditorThemes;exports.LazyDialJsonEditor=ot.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=ot.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=ot.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=oe.DIAL_KIT_ICON_STROKE;exports.Accordion=cc;exports.AnalyticsCardVariant=st;exports.Button=et;exports.ButtonDropdown=bl;exports.Calendar=dl;exports.CalendarMode=be;exports.CaptionText=ke;exports.CardShell=Po;exports.CollapsibleSidebar=Qc;exports.ConditionalResizableContainer=rd;exports.ConfirmationPopup=lc;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=er;exports.DangerButton=fl;exports.DialAccordion=Ur;exports.DialAnalyticsBar=ut;exports.DialAnalyticsBarGroup=Qn;exports.DialAnalyticsCard=Yn;exports.DialAnalyticsErrorTag=Qt;exports.DialAnalyticsHistogram=ss;exports.DialAutocompleteInputValue=ln;exports.DialCheckbox=Gt;exports.DialDraggableItem=bi;exports.DialDropdownIcon=lo;exports.DialFormPopup=Ai;exports.DialInputPopup=cn;exports.DialLabelledText=ms;exports.DialLoadFileArea=bn;exports.DialLoadFileAreaField=oo;exports.DialNumberInput=Zt;exports.DialPagination=ds;exports.DialPasswordInput=dn;exports.DialRadioGroupPopupField=Ti;exports.DialRemoveButton=St;exports.DialSchemaRenderer=Eo;exports.DialSegmentedControl=Ni;exports.DialSelect=Ne;exports.DialSelectField=Ki;exports.DialSlider=hs;exports.DialSteps=gs;exports.DialTag=He;exports.DialTagInput=on;exports.DialTextarea=yi;exports.ErrorMessageNotification=Ko;exports.ErrorText=Pe;exports.ErrorToastNotification=Mo;exports.FabButton=ml;exports.FileDropzone=zc;exports.FilterChips=Bc;exports.FolderPath=ul;exports.GeneralMessageNotification=qo;exports.GeneralToastNotification=Ho;exports.GhostButton=gl;exports.Highlight=ko;exports.InfoMessageNotification=Go;exports.InfoToastNotification=Fo;exports.InlineSelect=yl;exports.InlineSelectTrigger=Rn;exports.Input=Ve;exports.JsonSchemaType=$;exports.LinkButton=pl;exports.LoadingMessageNotification=Wo;exports.LoadingToastNotification=$o;exports.MultiSelectTags=Fn;exports.NeutralButton=pr;exports.Notification=dr;exports.NumberInput=ql;exports.OutlinedButton=hl;exports.PasswordInput=Gl;exports.Popup=gr;exports.PrimaryButton=Ln;exports.ProgressBar=as;exports.RadioGroup=zn;exports.RadioGroupPopupField=Ic;exports.ResizableContainer=$n;exports.SchemaDisplayMode=at;exports.SchemaOrientation=jt;exports.SchemaRendererVariant=Ye;exports.Search=qc;exports.SegmentedControl=Rc;exports.Select=$l;exports.SelectSize=ht;exports.SelectVariant=mt;exports.Slider=Xc;exports.StepStatus=ye;exports.SuccessMessageNotification=Vo;exports.SuccessToastNotification=Bo;exports.Switch=dc;exports.Tabs=Pc;exports.Tag=Ke;exports.TagAppearance=Ue;exports.TagInput=Uc;exports.Textarea=Kl;exports.TextareaResize=Bn;exports.ToggleIconButton=Sc;exports.WarningMessageNotification=Uo;exports.WarningToastNotification=zo;exports.getTimezoneLabel=yn;exports.matchesAccept=Jt;exports.wrapInRootFolder=ho;
|