@epam/ai-dial-ui-kit 0.16.0-dev.57 → 0.16.0-dev.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +8 -0
- package/dist/MarkdownEditor-5Jq0NTTP.cjs +1 -0
- package/dist/components/New/Calendar/Calendar.js +163 -154
- package/dist/components/New/MarkdownEditor/MarkdownEditor.js +40 -28
- package/dist/components/New/Notification/Notification.js +25 -24
- package/dist/components/New/StateScreen/StateScreen.js +23 -21
- package/dist/components/New/Steps/Steps.js +37 -35
- package/dist/components-manifest.json +39 -3
- package/dist/dial-ui-kit.cjs +3 -3
- package/dist/editors.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/src/components/New/Calendar/Calendar.d.ts +7 -0
- package/dist/src/components/New/MarkdownEditor/MarkdownEditor.d.ts +6 -0
- package/dist/src/components/New/Notification/Notification.d.ts +3 -0
- package/dist/src/components/New/StateScreen/StateScreen.d.ts +8 -0
- package/dist/src/components/New/Steps/Steps.d.ts +1 -1
- package/dist/src/models/step.d.ts +2 -0
- package/package.json +1 -1
- package/dist/MarkdownEditor-B-x8Ntfe.cjs +0 -1
package/dist/dial-ui-kit.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("./icon-4D9xu6E_.cjs"),c=require("./DateCellRenderer-CB2R7gM2.cjs"),F=require("@tabler/icons-react"),B=require("@floating-ui/react"),m=require("react"),te=require("classnames"),hn=require("./editors.cjs"),Wa=require("react-dom");function Ga(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Me=Ga(m),Br=({text:e,className:t,variant:r=c.CaptionType.Description,...n})=>e?s.jsx("span",{...n,role:"alert",className:f.mergeClasses("dial-tiny-text",r===c.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,Fe=({...e})=>s.jsx(Br,{...e,variant:c.CaptionType.Error}),gs={[c.ButtonVariant.Primary]:{[c.ButtonAppearance.Solid]:"dial-primary-solid-button",[c.ButtonAppearance.Ghost]:"dial-primary-ghost-button",[c.ButtonAppearance.Link]:"dial-primary-link-button"},[c.ButtonVariant.Neutral]:{[c.ButtonAppearance.Outlined]:"dial-neutral-outlined-button"},[c.ButtonVariant.Danger]:{[c.ButtonAppearance.Solid]:"dial-danger-solid-button",[c.ButtonAppearance.Ghost]:"dial-danger-ghost-button",[c.ButtonAppearance.Outlined]:"dial-danger-outlined-button"},[c.ButtonVariant.Success]:{[c.ButtonAppearance.Ghost]:"dial-success-ghost-button"},[c.ButtonVariant.Secondary]:{[c.ButtonAppearance.Ghost]:"dial-secondary-ghost-button"},[c.ButtonVariant.Tertiary]:{[c.ButtonAppearance.Ghost]:"dial-tertiary-ghost-button"},[c.ButtonVariant.Static]:{},[c.ButtonVariant.Starter]:{}},mn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=gs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),gs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},Ua=7,Za=2,gn=m.createContext(null),xn=()=>{const e=m.useContext(gn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},qa=({initialOpen:e=!1,placement:t="bottom",isTriggerClickable:r=!1,open:n,onOpenChange:a}={})=>{const[o,i]=m.useState(e),l=m.useRef(null),d=n??o,u=a??i,h=B.useFloating({placement:t,open:d,onOpenChange:u,whileElementsMounted:B.autoUpdate,middleware:[B.offset(Ua+Za),B.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),B.shift({padding:5}),B.arrow({element:l})]}),p=B.useHover(h.context,{move:!1,enabled:n==null,mouseOnly:r,delay:{open:500,close:0}}),g=B.useFocus(h.context,{enabled:n==null}),x=B.useDismiss(h.context),y=B.useRole(h.context,{role:"tooltip"}),v=B.useInteractions([p,g,x,y]);return m.useEffect(()=>{if(!d)return;const b=h.refs.reference.current;if(!(b instanceof Element))return;const C=new IntersectionObserver(([I])=>{I.isIntersecting||u(!1)},{root:null,threshold:0});return C.observe(b),()=>C.disconnect()},[d,h.refs.reference,u]),m.useMemo(()=>({open:d,setOpen:u,arrowRef:l,...v,...h}),[d,u,v,h])},zr=({children:e,...t})=>{const r=qa(t);return s.jsx(gn.Provider,{value:r,children:e})},Fr=({style:e,...t})=>{const r=xn(),n=c.useHasHover(),a=m.useRef(null),o=B.useMergeRefs([r.refs.setFloating,a]);return!r.open||!n?null:s.jsx(B.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...r.floatingStyles,...e},...r.getFloatingProps(t),className:te("z-tooltip whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny-text shadow max-w-[300px]",r.getFloatingProps(t).className),children:[t.children,s.jsx(B.FloatingArrow,{ref:r.arrowRef,context:r.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},Hr=({children:e,asChild:t=!1,...r})=>{const n=xn(),a=t&&m.isValidElement(e),o=a?e.props?.ref:null,i=B.useMergeRefs([n.refs.setReference,...o?[o]:[]]);return a?m.cloneElement(e,n.getReferenceProps({...e.props,...r,ref:i})):s.jsx("span",{ref:i,...n.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-start",children:e})},qe=({hideTooltip:e,tooltip:t,children:r,triggerClassName:n,contentClassName:a,...o})=>s.jsxs(zr,{...o,children:[s.jsx(Hr,{className:te(n,"truncate"),children:r}),s.jsx(Fr,{className:te("text-primary",a,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]}),Tt=({variant:e,appearance:t=c.ButtonAppearance.Solid,size:r=c.ElementSize.Standard,className:n,icon:a,tooltipProps:o,type:i="button",...l})=>{const d=f.mergeClasses(e&&mn(e,t),r===c.ElementSize.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px] dial-kit-enhanced-target","dial-icon-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",n),u=s.jsx("button",{...l,type:i,className:d,"aria-label":c.resolveAccessibleName(l["aria-label"],o?.tooltip),children:a});return o?s.jsx(qe,{...o,children:u}):u},Ya="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active",Xa=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Tt,{"aria-label":e,className:Ya,icon:s.jsx(F.IconInfoCircle,{size:f.DIAL_ICON_SIZE.SM}),onClick:t});return e?s.jsx(qe,{tooltip:e,triggerClassName:"flex justify-center items-center",children:r}):r},$r=({label:e,required:t,className:r,caption:n,...a})=>e?s.jsxs("label",{...a,className:f.mergeClasses("dial-tiny-text text-secondary flex items-center gap-1",r),children:[typeof e=="string"?s.jsx("span",{className:"min-h-4",children:e}):e,t&&s.jsx("span",{className:"text-accent-primary",children:"*"}),s.jsx(Xa,{caption:n})]}):null,Qa=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:d,headerClassName:u,contentClassName:h})=>{const p=n!==void 0,[g,x]=m.useState(a),y=i?!0:p?n:g,v=m.useId(),b=()=>{if(o)return;const C=!y;p||x(C),l?.(C)};return s.jsxs("div",{className:f.mergeClasses("rounded border border-secondary",d),children:[s.jsxs("button",{type:"button","aria-expanded":y,"aria-controls":v,disabled:o||i,onClick:b,className:f.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",u),children:[!i&&s.jsx(c.DialIcon,{className:te("text-secondary transition-transform",y&&"rotate-90"),icon:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM})}),s.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),y&&s.jsx("div",{id:v,role:"region",className:f.mergeClasses("px-4 pb-4",h),children:r})]})},Ja="flex items-center justify-center text-secondary",eo="shrink-0 grow-0 basis-auto animate-spin-steps",to=e=>Me.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Me.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),ro=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:te({[Ja]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(to,{width:e,height:e,className:te(eo,r),role:"img","aria-label":a})})}),Ve=({size:e=40,className:t,fullWidth:r=!1,ariaLabel:n="Loading"})=>s.jsx("div",{role:"status",className:f.mergeClasses("flex items-center justify-center",{"size-full":r},t,c.DIAL_KIT_CLASS.spinner),children:s.jsx("div",{role:"img","aria-label":n,style:{width:e,height:e},className:"rounded-full border-2 border-secondary border-t-accent animate-spin-steps shrink-0"})});var Ct=(e=>(e.Progressbar="progressbar",e.Meter="meter",e))(Ct||{});const so={[Ct.Progressbar]:"Progress",[Ct.Meter]:"Meter"},bn=({value:e,max:t=100,size:r=c.ElementSize.Standard,labelProps:n,valueLabel:a,role:o=Ct.Progressbar,id:i,className:l,"aria-label":d,...u})=>{const h=m.useId(),p=i??h,g=!!n?.label,x=g?n?.id??`${p}-label`:void 0,y=t>0?t:0,v=Number.isFinite(e)?e:0,b=Math.min(Math.max(v,0),y),C=y>0?b/y*100:0,I=s.jsx("div",{...u,id:p,role:o,"aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":y,"aria-labelledby":x,"aria-label":c.resolveAccessibleName(d,g?void 0:so[o]),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",l,!g&&!a&&c.DIAL_KIT_CLASS.progressBar),children:s.jsx("div",{style:{width:`${C}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!g&&!a?I:s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-1",c.DIAL_KIT_CLASS.progressBar),children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[n&&s.jsx(c.Label,{...n,id:x}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),I]})},no=({icon:e,title:t,description:r,containerClassName:n,titleClassName:a,descriptionClassName:o})=>s.jsxs("div",{className:f.mergeClasses("h-full w-full flex flex-col items-center justify-center text-secondary",n),"aria-label":"no-data-container",children:[e||s.jsx(F.IconClipboardX,{width:60,height:60,stroke:.5}),s.jsx("span",{className:f.mergeClasses("dial-small-text mt-2 text-primary",a),"aria-label":"no-results-title",children:t}),r&&s.jsx("span",{className:f.mergeClasses("mt-1 text-primary",o),"aria-label":"no-results-description",children:r})]}),ao=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col",n?"":"max-w-[200px]",o),children:[e&&s.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),n||s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(qe,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),Et=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,hideTitleOnMobile:d,type:u="button",tooltipProps:h,...p})=>{const g=te(d?"hidden sm:inline":"inline",o),x=f.mergeClasses(t&&mn(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-semi-text",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"h-[24px] px-2":"h-[40px] px-3"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target","disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",a),y=s.jsxs("button",{...p,type:u,className:x,"aria-label":typeof e=="string"&&e||p["aria-label"],children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:g,children:e}),s.jsx(c.DialIcon,{icon:i})]});return h?s.jsx(qe,{...h,children:y}):y},oo="text-primary",er=({text:e,className:t,contentClassName:r,hideTooltip:n,id:a,customTooltipContent:o,...i})=>{const l=m.useRef(null),[d,u]=m.useState(!1),[h,p]=m.useState(""),g=m.useCallback(()=>{const b=l.current;b&&(p(b.textContent??""),u(b.scrollWidth>b.clientWidth))},[]),x=m.useCallback(()=>c.scheduleMeasure(g),[g]);m.useEffect(()=>{const b=l.current;if(b)return c.observeElementSize(b,g)},[g]),m.useEffect(()=>{x()},[e,x]);const y=m.useMemo(()=>typeof e=="string"?e:h,[h,e]),v=m.useMemo(()=>n?"":o||(d?y:""),[o,y,n,d]);return s.jsxs(zr,{...i,children:[s.jsx(Hr,{asChild:!0,onMouseEnter:x,onFocusCapture:x,children:s.jsx("span",{id:a,className:f.mergeClasses("block truncate flex-1 min-w-0 max-w-full text-start",t),"aria-label":d?y:void 0,onMouseEnter:x,onFocus:x,ref:l,children:e})}),s.jsx(Fr,{className:f.mergeClasses(oo,r,!v&&"hidden"),children:v})]})},io=({label:e,className:t,icon:r,selected:n,closable:a,onClick:o,onRemove:i})=>{const l=f.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",n?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return s.jsxs("div",{className:l,onClick:o,children:[s.jsx(c.DialIcon,{icon:r}),s.jsx(er,{text:e}),a&&i&&s.jsx(Et,{className:"p-0",iconAfter:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM}),onClick:d=>i(d)})]},e)};var Ee=(e=>(e.Default="default",e.Text="text",e.Circular="circular",e.Rectangular="rectangular",e))(Ee||{}),bt=(e=>(e.Small="small",e.Default="default",e.Large="large",e))(bt||{}),Wt=(e=>(e.Circle="circle",e.Square="square",e))(Wt||{});const lo=e=>{if(typeof e=="number")return e;switch(e){case bt.Small:return 32;case bt.Large:return 64;case bt.Default:default:return 40}},$t=({active:e=!0,paragraph:t=!0,avatar:r=!1,showTitle:n=!0,loading:a=!0,children:o,variant:i=Ee.Default,width:l,height:d,overlay:u,color:h,className:p,...g})=>{if(!a&&o)return s.jsx(s.Fragment,{children:o});const x=f.mergeClasses("bg-layer-raised",e&&"animate-pulse",p);if(i!==Ee.Default){const D=f.mergeClasses(x,i===Ee.Circular&&"rounded-full",i===Ee.Rectangular&&"rounded",i===Ee.Text&&"rounded",!!u&&"relative"),E={};return l&&(E.width=typeof l=="number"?`${l}px`:l),d&&(E.height=typeof d=="number"?`${d}px`:d),h&&(E.backgroundColor=h),s.jsx("div",{className:D,style:E,...g,children:u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})})}const y=!!r,v=!!n,b=!!t,C=typeof r=="object"?r:{},I=typeof n=="object"?n:{},S=typeof t=="object"?t:{},w=lo(C.size),N=C.shape??Wt.Circle,L=I.width??"38%",A=S.rows??3,T=S.width,j=D=>T?Array.isArray(T)?T[D]??"100%":T:D===A-1?"61%":"100%";return s.jsxs("div",{...g,className:f.mergeClasses("flex gap-4",!!u&&"relative",p,c.DIAL_KIT_CLASS.skeleton),children:[y&&s.jsx("div",{className:f.mergeClasses(x,N===Wt.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:w,height:w,...h&&{backgroundColor:h}}}),s.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[v&&s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:L,...h&&{backgroundColor:h}}}),b&&s.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:A}).map((D,E)=>s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:j(E),...h&&{backgroundColor:h}}},E))})]}),u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})]})},co=te("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),uo=te("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),Tr=te("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-hidden","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary",c.DIAL_KIT_CLASS.menuItem),Er="opacity-75 !cursor-not-allowed",vn="text-error",fo="my-1 border-t border-hover border-secondary",st=4,po=s.jsx(F.IconChevronRight,{size:14}),ct=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),ho=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),mo=ct(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),go=ct(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),yn=ct(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),xo=ct(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),bo=ct(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),vo=ct(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),Cn=ho(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),In=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(Cn,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),yo=({item:e,onRootClose:t})=>{const{isOpen:r,refs:n,floatingStyles:a,context:o,getReferenceProps:i,getFloatingProps:l}=c.useSubMenuFloating(st,"menu",!!e.disabled),d=m.useCallback(u=>h=>{u.disabled||(u.onClick?.({key:u.key,domEvent:h}),t())},[t]);return s.jsxs(s.Fragment,{children:[s.jsxs("button",{ref:n.setReference,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":r,"aria-disabled":!!e.disabled,disabled:e.disabled,className:te(Tr,e.disabled&&Er,e.className),...i(),children:[e.icon&&s.jsx("span",{className:te(e.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:e.icon})}),s.jsx("span",{className:te("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),s.jsx("span",{className:te("ml-auto shrink-0",e.disabled&&"text-secondary"),children:po})]}),r&&s.jsx(c.SubMenuPanel,{refs:n,floatingStyles:a,context:o,getFloatingProps:l,role:"menu",className:"w-max",children:s.jsx("div",{role:"none",className:te("py-1",c.DIAL_KIT_CLASS.dropdownList),children:e.children.map(u=>s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!u.disabled,disabled:u.disabled,className:te(Tr,u.disabled&&Er,u.danger&&vn,u.className),onClick:d(u),children:[u.icon&&s.jsx("span",{className:te(u.danger&&"text-error",u.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:u.icon})}),s.jsx("span",{className:te("flex-1 truncate text-start",u.danger&&"text-error",u.disabled&&"text-secondary"),children:u.label})]},u.key))})})]})},Co=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,Gt=({children:e,items:t,onItemClick:r,menuHeader:n,menuFooter:a,renderOverlay:o,trigger:i=[c.DropdownTrigger.Click],placement:l,disabled:d=!1,open:u,defaultOpen:h=!1,onOpenChange:p,closable:g=!1,onClose:x,className:y,overlayContentClassName:v,separatorClassName:b,listClassName:C,outsidePressIgnoreRef:I,outsideClosable:S=!0,allowedPlacements:w,anchorToMouse:N=!1,matchReferenceWidth:L=!0,maxDropdownHeight:A})=>{const[T,j]=m.useState(h),D=u!==void 0,E=D?!!u:T,k=m.useRef(null),P=m.useCallback(_=>{D||j(_),p?.(_)},[D,p]),O=m.useId(),R=l===void 0,{refs:M,floatingStyles:H,context:W}=B.useFloating({placement:l,open:E,onOpenChange:P,whileElementsMounted:B.autoUpdate,middleware:[B.offset({mainAxis:st,crossAxis:0}),R?B.autoPlacement({alignment:"start",crossAxis:!0,padding:st,allowedPlacements:w}):B.flip({padding:st}),B.shift({padding:st}),B.size({padding:st,apply({availableWidth:_,availableHeight:U,elements:de}){const ne=de.floating,ge=Co(de.reference);ne.style.setProperty("--fui-available-height",`${Math.floor(U)}px`),ne.style.setProperty("--reference-width",L?`${Math.round(ge)}px`:"0px"),L?ne.style.minWidth=`${Math.round(ge)}px`:ne.style.removeProperty("min-width"),ne.style.maxWidth=`${Math.floor(_)}px`;const Qe=Math.floor(U);ne.style.maxHeight=`${A?Math.min(Qe,A):Qe}px`}})]}),K=B.useClick(W,{enabled:i.includes(c.DropdownTrigger.Click)&&!d}),V=B.useHover(W,{enabled:i.includes(c.DropdownTrigger.Hover)&&!d,move:!1,restMs:40,delay:{open:80,close:80}}),G=B.useDismiss(W,{bubbles:!0,referencePress:!1,outsidePress:_=>{if(!S)return!1;const U=_.target;return!(I?.current&&U instanceof Node&&I.current.contains(U))}}),ee=B.useRole(W,{role:"menu"}),{getReferenceProps:re,getFloatingProps:q}=B.useInteractions([K,V,G,ee]),Y=m.useCallback((_,U)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:_,y:U,top:U,left:_,right:_,bottom:U})})},[M]),se=m.useCallback(_=>{!i.includes(c.DropdownTrigger.ContextMenu)||d||(_.preventDefault(),N&&(Y(_.clientX,_.clientY),k.current=document.elementFromPoint(_.clientX,_.clientY)),P(!0))},[N,d,P,Y,i]),le=m.useCallback(_=>{!N||d||(i.includes(c.DropdownTrigger.ContextMenu)&&E&&P(!1),Y(_.clientX,_.clientY),k.current=document.elementFromPoint(_.clientX,_.clientY))},[N,d,Y,E,i,P]);m.useEffect(()=>{d&&E&&P(!1)},[d,E,P]);const oe=m.useCallback(_=>U=>{_.disabled||(_.onClick?.({key:_.key,domEvent:U}),r?.({key:_.key,domEvent:U}),P(!1))},[r,P]),me=m.useMemo(()=>o?o():t?s.jsxs(s.Fragment,{children:[n&&s.jsx(s.Fragment,{children:typeof n=="function"?n():n}),s.jsx("div",{role:"none",className:f.mergeClasses("py-1",v,c.DIAL_KIT_CLASS.dropdownList),"aria-label":"dropdown",children:t.map(_=>_.type===c.DropdownItemType.Divider?s.jsx("div",{role:"separator",className:f.mergeClasses(fo,b)},_.key):_.type===c.DropdownItemType.PlainText?s.jsx("div",{className:f.mergeClasses("px-3 py-2 text-secondary dial-caption-text",_.className),children:_.label},_.key):_.children?.length?s.jsx(yo,{item:_,onRootClose:()=>P(!1)},_.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!_.disabled,className:te(Tr,_.disabled&&Er,_.danger&&vn,_.className),disabled:_.disabled,onClick:oe(_),children:[_.icon&&s.jsx("span",{className:te(_.danger&&"text-error",_.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:_.icon})}),s.jsx("span",{className:te("flex-1 truncate text-start",_.danger&&"text-error",_.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:_.label})]},_.key))}),a&&s.jsx(s.Fragment,{children:typeof a=="function"?a():a})]}):null,[oe,t,a,n,o,P,v,b]),ve=re({onContextMenu:se,onMouseDown:le});return m.useEffect(()=>{if(!E)return;const _=M.reference.current;let U=null;if(_ instanceof Element?U=_:k.current instanceof Element&&(U=k.current),!U)return;const de=new IntersectionObserver(([ne])=>{ne.isIntersecting||P(!1)},{root:null,threshold:0});return de.observe(U),()=>de.disconnect()},[E,M.reference,P]),s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M.setReference,className:te(co,d&&"!cursor-not-allowed opacity-75",y),"aria-haspopup":"menu","aria-expanded":E,"aria-controls":O,...ve,children:e}),E&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:W,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsxs("div",{id:O,ref:M.setFloating,style:H,className:te(uo,!L&&"w-max",C),...q(),children:[g&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(In,{ariaLabel:"Close dropdown",onClose:_=>{x?.(_),P(!1)}})}),me]})})})]})};var Ge=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Ge||{}),ot=(e=>(e.Error="error",e.Warning="warning",e))(ot||{}),Ue=(e=>(e.Default="default",e.Inline="inline",e))(Ue||{}),Ut=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Ut||{});const gt=({tab:e,active:t,invalid:r,className:n,horizontal:a,view:o=Ue.Default,onClick:i})=>{const l=o===Ue.Inline,d=f.mergeClasses("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small-text hover:text-accent-primary",{"border-b-2 px-4":a,"border-l-2 px-3":!a},{"bg-layer-4":a,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&a&&!e.disabled,"border-l-accent-primary":t&&!a&&!e.disabled}),u=f.mergeClasses("flex flex-row gap-1 h-6 items-center py-1 px-2 rounded cursor-pointer hover:bg-accent-primary-alpha",t?"dial-small-semi-text":"dial-small-text",{"text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-secondary":!t&&!e.disabled}),h=f.mergeClasses(l?u:d,n);return s.jsxs("button",{role:"tab","aria-selected":t,className:h,onClick:()=>i(e.id),disabled:e.disabled,children:[l&&t&&!e.disabled&&s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM}),s.jsx(er,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(r||e.invalid)&&s.jsx("div",{className:"text-error pl-1",children:s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS})}),e.warning&&s.jsx("div",{className:"text-warning pl-1",children:s.jsx(F.IconAlertTriangle,{...f.BASE_ICON_PROPS})})]})},Io=()=>{const[e,t]=m.useState(()=>typeof window>"u"?c.ScreenType.Desktop:c.getScreenType());return m.useEffect(()=>{t(c.getScreenType());const r=()=>t(c.getScreenType());return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e},So=12,No=({tabs:e,activeTab:t,onClick:r,className:n,orientation:a=Ge.Horizontal,view:o=Ue.Default,screenThreshold:i=Ut.Tablet,smallScreenContainerClassName:l,smallScreenDropdownItemClassName:d,desktopDropdownClassName:u,desktopTabClassName:h,inlineContainerClassName:p,inlineTabClassName:g})=>{const[x,y]=m.useState(!1),[v,b]=m.useState(!1),[C,I]=m.useState(!1),S=Io(),w=S===c.ScreenType.Mobile||i===Ut.Tablet&&S===c.ScreenType.Tablet,N=a===Ge.Horizontal,L=m.useRef(null),A=m.useRef(null),T=m.useRef(null),j=e.find(O=>O.id===t),D=m.useMemo(()=>f.mergeClasses("flex gap-2",N?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[N]),E=m.useCallback(()=>{const O=A.current;O&&I(O.scrollWidth>O.clientWidth)},[]),k=m.useCallback(()=>{const O=T.current,R=A.current;if(!O||!R)return;const M=O.getBoundingClientRect(),H=R.getBoundingClientRect();if(M.width===0||H.width===0)return;const W=So;let K=R.scrollLeft;if(M.left<H.left+W)K-=H.left+W-M.left;else if(M.right>H.right-W)K+=M.right-(H.right-W);else return;const V=Math.max(0,R.scrollWidth-R.clientWidth);K=Math.max(0,Math.min(K,V)),K!==R.scrollLeft&&R.scrollTo({left:K,behavior:"smooth"})},[]),P=m.useCallback(O=>{r(O),O===t&&k()},[r,t,k]);return m.useEffect(()=>{E();const O=new ResizeObserver(()=>E()),R=A.current;return R&&O.observe(R),()=>O.disconnect()},[e,E]),m.useEffect(()=>{k()},[t,k]),o===Ue.Inline?s.jsx("div",{role:"tablist",className:f.mergeClasses("flex flex-row items-center gap-0.5 bg-layer-4 rounded w-fit p-0.5",p),children:e.map(O=>s.jsx(gt,{tab:O,active:t===O.id,view:Ue.Inline,onClick:P,className:g},O.id))}):w?s.jsx("div",{role:"tablist",className:f.mergeClasses("h-11 flex items-center bg-layer-3 px-4",l),children:s.jsx(Gt,{trigger:[c.DropdownTrigger.Click],open:x,onOpenChange:y,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(O=>s.jsx(gt,{tab:O,active:O.id===t,onClick:R=>{P(R),y(!1)},className:f.mergeClasses("w-full rounded-none h-11 items-center px-6",d)},O.id)),children:s.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[s.jsx(gt,{tab:j,active:!0,onClick:P,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM}),className:f.mergeClasses("text-primary transition-transform",x&&"rotate-180")})]})})}):s.jsxs("div",{ref:L,className:f.mergeClasses("flex items-center",n),children:[s.jsx("div",{ref:A,role:"tablist",className:D,children:e.map(O=>s.jsx("div",{ref:t===O.id?T:void 0,className:"w-full",children:s.jsx(gt,{tab:O,active:t===O.id,onClick:P,horizontal:N,className:f.mergeClasses("w-full",h)})},O.id))}),C&&s.jsx("div",{className:"flex items-center ml-2",children:s.jsx(Gt,{trigger:[c.DropdownTrigger.Click],open:v,onOpenChange:b,placement:"bottom-end",renderOverlay:()=>e.map(O=>s.jsx(gt,{tab:O,active:O.id===t,onClick:R=>{P(R),b(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},O.id)),children:s.jsx(Et,{iconBefore:s.jsx(F.IconDotsVertical,{size:f.BASE_ICON_SIZE}),className:f.mergeClasses("w-8 h-8 flex items-center justify-center rounded border",v?"bg-layer-4 border-transparent":"border-primary",u)})})})]})},Sn="w-full overflow-hidden",Nn="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Zt="flex items-center gap-2 dial-small-text",mr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},Lr="flex flex-1 items-center gap-1 min-w-0 transition-colors",wo="text-secondary hover:text-accent-primary",wn="text-primary cursor-default",Kr="flex-none inline-flex items-center leading-none text-secondary",jo="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",jn=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,"aria-hidden":"true"}),xt=({label:e,href:t,onClick:r,disabled:n,isLast:a,isFirst:o,separator:i=jn,className:l,iconBefore:d,labelClassName:u,onBeforeNavigate:h,...p})=>{const g=async I=>{if(h&&!a&&!await h()){I.preventDefault();return}r&&r(I)},x=a?mr.last:o?mr.first:mr.middle,y=f.mergeClasses(Zt,x,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(Lr,wo):f.mergeClasses(Lr,wn,n?"pointer-events-none opacity-75":""),C=typeof e=="string"?s.jsx(er,{className:f.mergeClasses("cursor-pointer",u),text:e,id:"breadcrumb-item-content"}):s.jsx("span",{className:f.mergeClasses("flex-1 min-w-0 truncate cursor-pointer max-w-[300px]",u),"aria-label":"breadcrumb-item-content",children:e});return s.jsxs("li",{...p,className:y,"aria-label":p["aria-label"]||"breadcrumb-item",children:[v?s.jsxs("a",{href:t,onClick:g,className:b,children:[d,C]}):s.jsxs("span",{className:b,"aria-current":a?"page":void 0,"aria-disabled":n?"true":void 0,children:[d,C]}),!a&&s.jsx("span",{className:Kr,"aria-label":"separator",children:i})]})},Do=({pathItems:e,separator:t=jn,ariaLabel:r="Breadcrumb",className:n,children:a,labelClassName:o,onBeforeNavigate:i})=>{const l=m.useMemo(()=>e?.length?e:m.Children.toArray(a).filter(m.isValidElement).map(h=>{const p=h.props,{labelClassName:g,isLast:x,separator:y,...v}=p;return v}),[e,a]),d=m.useCallback(async h=>{const p=parseInt(h.key,10),g=l[p];if(i&&!await i()){h.domEvent.preventDefault();return}g.onClick?g.onClick(h.domEvent):g.href&&(window.location.href=g.href)},[l,i]),u=m.useMemo(()=>{if(l.length===0)return null;if(l.length<=3)return l.map((v,b)=>m.createElement(xt,{...v,key:`item-${b}`,isFirst:b===0&&l.length>1,isLast:b===l.length-1,separator:t,labelClassName:o,onBeforeNavigate:i}));const h=l.at(0),p=l.slice(1,-2),g=l.at(-2),x=l.at(-1);if(!h||!g||!x)return null;const y=p.map((v,b)=>({key:String(b+1),label:typeof v.label=="string"?v.label:`Item ${b+1}`,disabled:v.disabled}));return s.jsxs(s.Fragment,{children:[m.createElement(xt,{...h,key:"item-0",isFirst:!0,separator:t,labelClassName:o,onBeforeNavigate:i}),s.jsxs("li",{className:f.mergeClasses(Zt,"shrink-0"),children:[s.jsx(Gt,{items:y,onItemClick:d,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:jo,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Kr,children:t})]}),m.createElement(xt,{...g,key:`item-${l.length-2}`,separator:t,labelClassName:o,onBeforeNavigate:i}),m.createElement(xt,{...x,key:`item-${l.length-1}`,isLast:!0,separator:t,labelClassName:o,onBeforeNavigate:i})]})},[l,t,o,d,i]);return s.jsx("nav",{"aria-label":r,className:f.mergeClasses(Sn,n),children:s.jsx("ol",{className:Nn,children:u})})},Vr=(e,t)=>({appearance:n,...a})=>s.jsx(Et,{...a,variant:e,appearance:n||t}),Dn=(e,t)=>({variant:n,...a})=>s.jsx(Et,{...a,variant:n||t,appearance:e}),Wr=Vr(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),Tn=Vr(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),En=Vr(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),To=Dn(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Eo=Dn(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Ln=({iconClassName:e,label:t,...r})=>t?s.jsx(En,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(yn,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),Lo="bg-layer-4 flex items-center justify-center enabled:text-secondary enabled:hover:text-accent-primary enabled:active:bg-controls-accent-primary-alpha-active enabled:hover:bg-accent-primary-alpha enabled:active:text-accent-primary",Ao=({icon:e,onClick:t,disabled:r,size:n=c.ElementSize.Standard,className:a})=>s.jsx("div",{className:te("border-l border-tertiary",n===c.ElementSize.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:s.jsx(Tt,{className:te(Lo,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),Oo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],_o=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!Oo.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||n!==void 0){const o=e.currentTarget.value,i=e.currentTarget.selectionStart||0,l=o.slice(0,i)+e.key+o.slice(i),d=parseFloat(l);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(n!==void 0&&d>+n){e.preventDefault();return}}}}},An=({labelProps:e,error:t,caption:r,id:n,containerClassName:a,...o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",a),children:[e&&s.jsx($r,{...e,htmlFor:n}),s.jsx(On,{id:n,...o}),s.jsx(Fe,{text:t}),!t&&s.jsx(Br,{text:r})]}),On=({invalid:e,disabled:t,prefix:r,className:n,postfix:a,iconBefore:o,iconAfter:i,wrapperClassName:l,type:d,inputRef:u,value:h,tooltipText:p,min:g,onChange:x,max:y,inputButtonProps:v,...b})=>{const C=m.useRef(null),I=B.useMergeRefs([u,C]),S=d==="number"||g!==void 0||y!==void 0;m.useEffect(()=>{const A=C.current;if(!A||!S||t)return;const T=j=>{j.preventDefault()};return A.addEventListener("wheel",T,{passive:!1}),()=>{A.removeEventListener("wheel",T)}},[t,S,d]);const w=A=>{_o(A,d,g,y)},N=A=>{const T=A.currentTarget.value;if(S&&T!==""){const j=parseFloat(T);if(isNaN(j)&&T!=="-"&&T!=="."||!isNaN(j)&&(g!==void 0&&j<+g||y!==void 0&&j>+y))return}x?.(T||void 0)},L=()=>s.jsxs("div",{className:f.mergeClasses("dial-input flex flex-row items-center gap-x-2 justify-between py-2",e&&"dial-input-error",t&&"dial-input-disable",!r&&"pl-3",!v&&"pr-3",l),"aria-label":"input-container",children:[r&&s.jsx("div",{className:"border-r border-tertiary",children:s.jsx(On,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,id:`${r}_textBefore`})}),s.jsx(c.DialIcon,{icon:o}),s.jsx("input",{ref:I,type:d,autoComplete:d==="password"?"new-password":"off",value:h??"",className:f.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",n),onChange:N,onKeyDown:w,min:g,disabled:t,max:y,...b}),a&&s.jsxs("p",{className:"text-secondary dial-small-text",children:[" ",a]}),s.jsx(c.DialIcon,{icon:i}),v&&s.jsx(Ao,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(qe,{tooltip:p||h,children:L()}):L()},_n=m.createContext({dragDropManager:void 0});function ye(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var xs=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),bs=function(){return Math.random().toString(36).substring(7).split("").join(".")},vs={INIT:"@@redux/INIT"+bs(),REPLACE:"@@redux/REPLACE"+bs()};function ko(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 Ro(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(Bo(e))return"date";if(Po(e))return"error";var r=Mo(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 Mo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Po(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Bo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Je(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Ro(e)),t}function kn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ye(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?ye(1):"Expected the enhancer to be a function. Instead, received: '"+Je(r)+"'");return r(kn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ye(2):"Expected the root reducer to be a function. Instead, received: '"+Je(e)+"'");var a=e,o=t,i=[],l=i,d=!1;function u(){l===i&&(l=i.slice())}function h(){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(4):"Expected the listener to be a function. Instead, received: '"+Je(v)+"'");if(d)throw new Error(process.env.NODE_ENV==="production"?ye(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return u(),l.push(v),function(){if(b){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,u();var I=l.indexOf(v);l.splice(I,1),i=null}}}function g(v){if(!ko(v))throw new Error(process.env.NODE_ENV==="production"?ye(7):"Actions must be plain objects. Instead, the actual type was: '"+Je(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?ye(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(d)throw new Error(process.env.NODE_ENV==="production"?ye(9):"Reducers may not dispatch actions.");try{d=!0,o=a(o,v)}finally{d=!1}for(var b=i=l,C=0;C<b.length;C++){var I=b[C];I()}return v}function x(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(10):"Expected the nextReducer to be a function. Instead, received: '"+Je(v));a=v,g({type:vs.REPLACE})}function y(){var v,b=p;return v={subscribe:function(I){if(typeof I!="object"||I===null)throw new Error(process.env.NODE_ENV==="production"?ye(11):"Expected the observer to be an object. Instead, received: '"+Je(I)+"'");function S(){I.next&&I.next(h())}S();var w=b(S);return{unsubscribe:w}}},v[xs]=function(){return this},v}return g({type:vs.INIT}),n={dispatch:g,subscribe:p,getState:h,replaceReducer:x},n[xs]=y,n}function Z(e,t,...r){if(zo()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;n=new Error(t.replace(/%s/g,function(){return r[a++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function zo(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Fo(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function Ho(e,t){return e.filter(r=>r!==t)}function Rn(e){return typeof e=="object"}function $o(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const a=[];return r.forEach((o,i)=>{o===1&&a.push(i)}),a}function Ko(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Gr="dnd-core/INIT_COORDS",tr="dnd-core/BEGIN_DRAG",Ur="dnd-core/PUBLISH_DRAG_SOURCE",rr="dnd-core/HOVER",sr="dnd-core/DROP",nr="dnd-core/END_DRAG";function ys(e,t){return{type:Gr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Vo={type:Gr,payload:{clientOffset:null,sourceClientOffset:null}};function Wo(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(ys(o)),Go(r,l,d);const u=qo(r,l);if(u==null){e.dispatch(Vo);return}let h=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");Uo(i),h=i(u)}e.dispatch(ys(o,h));const g=d.getSource(u).beginDrag(l,u);if(g==null)return;Zo(g),d.pinSource(u);const x=d.getSourceType(u);return{type:tr,payload:{itemType:x,item:g,sourceId:u,clientOffset:o||null,sourceClientOffset:h||null,isSourcePublic:!!a}}}}function Go(e,t,r){Z(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Z(r.getSource(n),"Expected sourceIds to be registered.")})}function Uo(e){Z(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Zo(e){Z(Rn(e),"Item must be an object.")}function qo(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Yo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Yo(e,a,r[a])})}return e}function Qo(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();Jo(n),ri(n).forEach((i,l)=>{const d=ei(i,l,a,n),u={type:sr,payload:{dropResult:Xo({},r,d)}};e.dispatch(u)})}}function Jo(e){Z(e.isDragging(),"Cannot call drop while not dragging."),Z(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ei(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return ti(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function ti(e){Z(typeof e>"u"||Rn(e),"Drop result must either be an object or undefined.")}function ri(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function si(e){return function(){const r=e.getMonitor(),n=e.getRegistry();ni(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:nr}}}function ni(e){Z(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ar(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function ai(e){return function(r,{clientOffset:n}={}){oi(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return li(a,i,l),ii(a,o,i),ci(a,o,i),{type:rr,payload:{targetIds:a,clientOffset:n||null}}}}function oi(e){Z(Array.isArray(e),"Expected targetIds to be an array.")}function ii(e,t,r){Z(t.isDragging(),"Cannot call hover while not dragging."),Z(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const a=e[n];Z(e.lastIndexOf(a)===n,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);Z(o,"Expected targetIds to be registered.")}}function li(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);Ar(o,r)||e.splice(n,1)}}function ci(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function di(e){return function(){if(e.getMonitor().isDragging())return{type:Ur}}}function ui(e){return{beginDrag:Wo(e),publishDragSource:di(e),hover:ai(e),drop:Qo(e),endDrag:si(e)}}class fi{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 n(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&r(l)}}const a=ui(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=n(l),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function pi(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Mn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hi(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Mn(pi(t,n),r)}function mi(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Mn(t,r)}const vt=[],Zr=[];vt.__IS_NONE__=!0;Zr.__IS_ALL__=!0;function gi(e,t){return e===vt?!1:e===Zr||typeof t>"u"?!0:Ko(t,e).length>0}class xi{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Z(typeof t=="function","listener must be a function."),Z(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const o=()=>{const i=this.store.getState(),l=i.stateId;try{l===a||l===a+1&&!gi(i.dirtyHandlerIds,n)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Z(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(n)}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 n=this.registry.getTargetType(t),a=this.getItemType();return Ar(n,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 n=this.registry.getSourceType(t),a=this.getItemType();return n!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),o=this.getItemType();if(o&&!Ar(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return n?l===i.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 hi(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return mi(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Cs=typeof global<"u"?global:self,Pn=Cs.MutationObserver||Cs.WebKitMutationObserver;function Bn(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function bi(e){let t=1;const r=new Pn(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const vi=typeof Pn=="function"?bi:Bn;class yi{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),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 n=0,a=t.length-this.index;n<a;n++)t[n]=t[n+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=vi(this.flush),this.requestErrorThrow=Bn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Ci{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 Ii{create(t){const r=this.freeTasks,n=r.length?r.pop():new Ci(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const zn=new yi,Si=new Ii(zn.registerPendingError);function Ni(e){zn.enqueueTask(Si.create(e))}const qr="dnd-core/ADD_SOURCE",Yr="dnd-core/ADD_TARGET",Xr="dnd-core/REMOVE_SOURCE",ar="dnd-core/REMOVE_TARGET";function wi(e){return{type:qr,payload:{sourceId:e}}}function ji(e){return{type:Yr,payload:{targetId:e}}}function Di(e){return{type:Xr,payload:{sourceId:e}}}function Ti(e){return{type:ar,payload:{targetId:e}}}function Ei(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 Li(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 Or(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Or(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 Ie;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ie||(Ie={}));let Ai=0;function Oi(){return Ai++}function _i(e){const t=Oi().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Is(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ss(e,t){const r=e.entries();let n=!1;do{const{done:a,value:[,o]}=r.next();if(o===t)return!0;n=!!a}while(!n);return!1}class ki{addSource(t,r){Or(t),Ei(r);const n=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(wi(n)),n}addTarget(t,r){Or(t,!0),Li(r);const n=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(ji(n)),n}containsHandler(t){return Ss(this.dragSources,t)||Ss(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 Is(t)===Ie.SOURCE}isTargetId(t){return Is(t)===Ie.TARGET}removeSource(t){Z(this.getSource(t),"Expected an existing source."),this.store.dispatch(Di(t)),Ni(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Z(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Ti(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,n){const a=_i(t);return this.types.set(a,r),t===Ie.SOURCE?this.dragSources.set(a,n):t===Ie.TARGET&&this.dropTargets.set(a,n),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 Ri=(e,t)=>e===t;function Mi(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Pi(e,t,r=Ri){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Bi(e=vt,t){switch(t.type){case rr:break;case qr:case Yr:case ar:case Xr:return vt;case tr:case Ur:case nr:case sr:default:return Zr}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=$o(r,n);if(!(a.length>0||!Pi(r,n)))return vt;const i=n[n.length-1],l=r[r.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function zi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){zi(e,a,r[a])})}return e}const Ns={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Hi(e=Ns,t){const{payload:r}=t;switch(t.type){case Gr:case tr:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case rr:return Mi(e.clientOffset,r.clientOffset)?e:Fi({},e,{clientOffset:r.clientOffset});case nr:case sr:return Ns;default:return e}}function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function et(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){$i(e,a,r[a])})}return e}const Ki={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Vi(e=Ki,t){const{payload:r}=t;switch(t.type){case tr:return et({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Ur:return et({},e,{isSourcePublic:!0});case rr:return et({},e,{targetIds:r.targetIds});case ar:return e.targetIds.indexOf(r.targetId)===-1?e:et({},e,{targetIds:Ho(e.targetIds,r.targetId)});case sr:return et({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case nr:return et({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Wi(e=0,t){switch(t.type){case qr:case Yr:return e+1;case Xr:case ar:return e-1;default:return e}}function Gi(e=0){return e+1}function Ui(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Ui(e,a,r[a])})}return e}function qi(e={},t){return{dirtyHandlerIds:Bi(e.dirtyHandlerIds,{type:t.type,payload:Zi({},t.payload,{prevTargetIds:Fo(e,"dragOperation.targetIds",[])})}),dragOffset:Hi(e.dragOffset,t),refCount:Wi(e.refCount,t),dragOperation:Vi(e.dragOperation,t),stateId:Gi(e.stateId)}}function Yi(e,t=void 0,r={},n=!1){const a=Xi(n),o=new xi(a,new ki(a)),i=new fi(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function Xi(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return kn(qi,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Qi(e,t){if(e==null)return{};var r=Ji(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ji(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let ws=0;const Kt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var el=m.memo(function(t){var{children:r}=t,n=Qi(t,["children"]);const[a,o]=tl(n);return m.useEffect(()=>{if(o){const i=Fn();return++ws,()=>{--ws===0&&(i[Kt]=null)}}},[]),s.jsx(_n.Provider,{value:a,children:r})});function tl(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=rl(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function rl(e,t=Fn(),r,n){const a=t;return a[Kt]||(a[Kt]={dragDropManager:Yi(e,t,r,n)}),a[Kt]}function Fn(){return typeof global<"u"?global:window}function sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gr,js;function nl(){return js||(js=1,gr=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 n,a,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(a=n;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(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=n;a--!==0;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),gr}var al=nl();const ol=sl(al),or=typeof window<"u"?m.useLayoutEffect:m.useEffect;function il(e,t,r){const[n,a]=m.useState(()=>t(e)),o=m.useCallback(()=>{const i=t(e);ol(n,i)||(a(i),r&&r())},[n,e,r]);return or(o),[n,o]}function ll(e,t,r){const[n,a]=il(e,t,r);return or(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function cl(e,t,r){return ll(t,e||(()=>({})),()=>r.reconnect())}function dl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),m.useMemo(()=>typeof e=="function"?e():e,r)}let xr=!1;class ul{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(!xr,"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 xr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{xr=!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 fl(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function pl(e,t,r,n){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 o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let d=0;d<o.length;d++){const u=o[d];if(!l(u))return!1;const h=e[u],p=t[u];if(a=void 0,a===!1||a===void 0&&h!==p)return!1}return!0}function hl(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ml(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 gl(e){return(t=null,r=null)=>{if(!m.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return ml(n),bl(n,r?o=>e(o,r):e)}}function xl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=gl(n);t[r]=()=>a}}),t}function Ds(e,t){typeof e=="function"?e(t):e.current=t}function bl(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?m.cloneElement(e,{ref:n=>{Ds(r,n),Ds(t,n)}}):m.cloneElement(e,{ref:t})}class vl{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!pl(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=xl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,hl(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 Qr(){const{dragDropManager:e}=m.useContext(_n);return Z(e!=null,"Expected drag drop context"),e}function yl(e){return m.useMemo(()=>e.hooks.dropTarget(),[e])}function Cl(e){const t=Qr(),r=m.useMemo(()=>new vl(t.getBackend()),[t]);return or(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function Il(){const e=Qr();return m.useMemo(()=>new ul(e),[e])}function Sl(e){const{accept:t}=e;return m.useMemo(()=>(Z(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Nl{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 wl(e,t){const r=m.useMemo(()=>new Nl(e,t),[t]);return m.useEffect(()=>{r.spec=e},[e]),r}function jl(e,t,r){const n=Qr(),a=wl(e,t),o=Sl(e);or(function(){const[l,d]=fl(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function Hn(e,t){const r=dl(e,t),n=Il(),a=Cl(r.options);return jl(r,n,a),[cl(r.collect,n,a),yl(a)]}function $n(e){let t=null;return()=>(t==null&&(t=e()),t)}function Dl(e,t){return e.filter(r=>r!==t)}function Tl(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const a=[];return r.forEach(o=>a.push(o)),a}class El{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Tl(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Dl(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Ll{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(n=>{const a=this.config.exposeProperties[n];a!=null&&(r[n]={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 ir="__NATIVE_FILE__",Kn="__NATIVE_URL__",Vn="__NATIVE_TEXT__",Wn="__NATIVE_HTML__",Ts=Object.freeze(Object.defineProperty({__proto__:null,FILE:ir,HTML:Wn,TEXT:Vn,URL:Kn},Symbol.toStringTag,{value:"Module"}));function br(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const _r={[ir]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Wn]:{exposeProperties:{html:(e,t)=>br(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Kn]:{exposeProperties:{urls:(e,t)=>br(e,t,"").split(`
|
|
2
|
-
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Vn]:{exposeProperties:{text:(e,t)=>br(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Al(e,t){const r=_r[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new Ll(r);return n.loadDataTransfer(t),n}function vr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(_r).filter(r=>{const n=_r[r];return n?.matchesTypes?n.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Ol=$n(()=>/firefox/i.test(navigator.userAgent)),Gn=$n(()=>!!window.safari);class Es{interpolate(t){const{xs:r,ys:n,c1s:a,c2s:o,c3s:i}=this;let l=r.length-1;if(t===r[l])return n[l];let d=0,u=i.length-1,h;for(;d<=u;){h=Math.floor(.5*(d+u));const x=r[h];if(x<t)d=h+1;else if(x>t)u=h-1;else return n[h]}l=Math.max(0,u);const p=t-r[l],g=p*p;return n[l]+a[l]*p+o[l]*g+i[l]*p*g}constructor(t,r){const{length:n}=t,a=[];for(let x=0;x<n;x++)a.push(x);a.sort((x,y)=>t[x]<t[y]?-1:1);const o=[],i=[];let l,d;for(let x=0;x<n-1;x++)l=t[x+1]-t[x],d=r[x+1]-r[x],o.push(l),i.push(d/l);const u=[i[0]];for(let x=0;x<o.length-1;x++){const y=i[x],v=i[x+1];if(y*v<=0)u.push(0);else{l=o[x];const b=o[x+1],C=l+b;u.push(3*C/((C+b)/y+(C+l)/v))}}u.push(i[i.length-1]);const h=[],p=[];let g;for(let x=0;x<u.length-1;x++){g=i[x];const y=u[x],v=1/o[x],b=y+u[x+1]-g-g;h.push((g-y-b)*v),p.push(b*v*v)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=h,this.c3s=p}}const _l=1;function Un(e){const t=e.nodeType===_l?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function Rt(e){return{x:e.clientX,y:e.clientY}}function kl(e){var t;return e.nodeName==="IMG"&&(Ol()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Rl(e,t,r,n){let a=e?t.width:r,o=e?t.height:n;return Gn()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function Ml(e,t,r,n,a){const o=kl(t),l=Un(o?e:t),d={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:h}=e,{anchorX:p,anchorY:g}=n,{dragPreviewWidth:x,dragPreviewHeight:y}=Rl(o,t,u,h),v=()=>{let L=new Es([0,.5,1],[d.y,d.y/h*y,d.y+y-h]).interpolate(g);return Gn()&&o&&(L+=(window.devicePixelRatio-1)*y),L},b=()=>new Es([0,.5,1],[d.x,d.x/u*x,d.x+x-u]).interpolate(p),{offsetX:C,offsetY:I}=a,S=C===0||C,w=I===0||I;return{x:S?C:b(),y:w?I:v()}}class Pl{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 Bl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ls(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Bl(e,a,r[a])})}return e}class zl{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,n){return this.sourcePreviewNodeOptions.set(t,n),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const a=i=>this.handleDragStart(i,t),o=i=>this.handleSelectStart(i);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",a),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",a),r.removeEventListener("drop",o)}}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 Ls({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 Ls({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Ts).some(r=>Ts[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Al(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 n;return(n=this.rootElement)===null||n===void 0?void 0:n.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,n){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 o=this.sourceNodes.get(a);return o&&Un(o)||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:o}=this;this.dragStartSourceIds=null;const i=Rt(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,d=vr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const h=this.monitor.getSourceId(),p=this.sourceNodes.get(h),g=this.sourcePreviewNodes.get(h)||p;if(g){const{anchorX:x,anchorY:y,offsetX:v,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),S=Ml(p,g,i,{anchorX:x,anchorY:y},{offsetX:v,offsetY:b});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(d)this.beginDragNativeItem(d);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 o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,d=vr(l);d&&this.beginDragNativeItem(d,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,o.length>0&&this.actions.hover(o,{clientOffset:Rt(a)}),o.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=Rt(a),this.scheduleHover(o),(o||[]).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 o;a.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}else vr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:Rt(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const o=a.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(a.preventDefault(),o.dragDrop()))},this.options=new Pl(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new El(this.isNodeInDocument)}}const Fl=function(t,r,n){return new zl(t,r,n)},Hl=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:n,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:d,fileSizeError:u,getIsFileFormatError:h,getIsFileSizeError:p})=>{const g=m.useRef(null),x=m.useRef(null),[y,v]=m.useState([]),[b,C]=m.useState(!1),[I,S]=m.useState(!1),w=m.useCallback(M=>{const H=M.target.files;if(H&&H.length>0){const W=Array.from(H),K=h?.(W),V=p?.(W);K?C(!0):V?S(!0):e(W)}},[h,p,e]),N=m.useCallback(M=>o&&M?.length>o,[o]),L=m.useMemo(()=>b||I||N(y),[b,I,N,y]),A=()=>{v([]),C(!1),S(!1)},T=m.useMemo(()=>b?s.jsx(Fe,{text:l}):I?s.jsx(Fe,{text:u}):N(y)?s.jsx(Fe,{text:d}):null,[d,l,u,y,N,b,I]);m.useEffect(()=>{A()},[a]);const[{isOver:j,canDrop:D},E]=Hn(()=>({accept:[ir],drop(M){const H=M.files,W=h?.(H)??!1,K=p?.(H)??!1,V=N?.(H)??!1;if(C(W),S(K),W||K||V){v(H);return}e(H),A()},collect:M=>({isOver:M.isOver(),canDrop:M.canDrop()})}),[e,h,p,N]),k=M=>{(M.key==="Enter"||M.key==="Space")&&(M.preventDefault(),x.current?.click())},P=M=>{M?.preventDefault();const H=Array.from(M.dataTransfer?.items??[]);C(!!h?.(H)),S(!!p?.(H)),v(H)},O=M=>{M.target===M.currentTarget&&A()},R=te("border border-dashed rounded size-full cursor-pointer relative hover:border-hover",!D&&!L&&"border-primary",D&&(j?"border-accent-primary":"border-hover"),L&&"border-error");return E(g),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:R,ref:g,onDragOver:P,onDragLeave:O,children:[s.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&&s.jsx("p",{className:"mb-1",children:t}),r&&s.jsx("p",{className:"mb-0.5",children:r}),n&&s.jsx(Wr,{appearance:c.ButtonAppearance.Ghost,label:n,onClick:()=>x.current?.click()})]}),s.jsx("input",{multiple:i,id:"file",type:"file",ref:x,hidden:!0,accept:a,onChange:w})]}),s.jsx(s.Fragment,{children:T})]})},$l=({iconBefore:e,className:t,...r})=>{const n=r.invalid,a=()=>s.jsx("div",{className:"mr-2",children:n?s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS,className:"text-error"}):e});return s.jsx(An,{...r,iconBefore:a(),containerClassName:te("h-[40px] p-0",n&&"h-[60px]"),className:te("rounded-r-none border-r-0",n&&"text-error",t)})},Kl=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:n,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:d})=>{const u=m.useRef(null),[h,p]=m.useState(!1),[g,x]=m.useState(!1),[y,v]=m.useState(0),b=m.useCallback(()=>{p(!1),x(!1),v(0)},[]),C=m.useCallback(j=>!!(o&&t.length+j.length>o),[o,t.length]),I=h||g,[{isOver:S,canDrop:w},N]=Hn(()=>({accept:[ir],drop(j){const D=j.files,E=[...t,...D],k=n?.(D)??!1,P=a?.(D)??!1,O=C?.(D)??!1;if(p(k),x(P),k||P||O){v(D.length);return}r(E),b()},collect:j=>({isOver:j.isOver(),canDrop:j.canDrop()})}),[t,r,n,a,C,b]),L=j=>{j.preventDefault();const D=Array.from(j.dataTransfer?.items??[]);p(!!n?.(D)),x(!1),v(D.length)},A=j=>{j.target===j.currentTarget&&b()};N(u);const T=C(Array.from({length:y}));return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{ref:u,onDragOver:L,onDragLeave:A,className:te("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!I&&!T&&(w&&S?"border-accent-primary":"border-primary"),(I||T)&&"border-error"),children:e}),h&&s.jsx(Fe,{text:i}),g&&s.jsx(Fe,{text:l}),!h&&!g&&T&&s.jsx(Fe,{text:d})]})},Zn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:n,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:d,multiFilesSizeError:u,getIsFileFormatError:h,getIsFileSizeError:p,maxFilesCount:g}=e,x=m.useCallback((b,C)=>{b.stopPropagation(),a(t?.filter(I=>I.name!==C)||[])},[a,t]),y=m.useCallback(b=>s.jsx(Ln,{"aria-label":l,onClick:C=>x(C,b)}),[l,x]),v=m.useMemo(()=>s.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((b,C)=>s.jsx($l,{id:b.name,value:b.name,iconAfter:y(b.name),iconBefore:r||n?.(b.name),invalid:o?.(b),error:o?.(b)?i:""},b.name+C))}),[t,r,n,o,i,y]);return s.jsx(el,{backend:Fl,children:!t||t.length===0?s.jsx(Hl,{...e,onChange:a}):s.jsxs(s.Fragment,{children:[s.jsx(Kl,{existingFiles:t,onDrop:a,getIsFileFormatError:h,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),d?.(t)&&s.jsx(Fe,{text:u})]})})},Vl=({onChange:e,fieldTitle:t,elementId:r,files:n,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:h,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:x,addButtonLabel:y,additionalActionButtons:v,...b})=>{const C=m.useRef(null),I=()=>C.current?.click(),S=()=>{e([])},w=m.useCallback(T=>T?.some(j=>!(g==="/"||g?.toLowerCase()?.includes(j?.type?.toLowerCase()))),[g]),N=m.useCallback(T=>{if(!o)return!1;const j=o*(1024*1024);return T?.some(D=>{const E=D.size;return!!E&&E>j})},[o]),L=m.useCallback(T=>{if(!i||!p)return!1;const j=i*1024*1024;return T.reduce((E,k)=>E+k.size,0)>j},[i,p]),A=m.useCallback(T=>{const j=T.target.files;if(j&&j.length>0){const D=Array.from(j),E=w(D),k=N(D);!E&&!k&&e([...n||[],...D])}},[w,N,e,n]);return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[s.jsx($r,{label:`${t}: ${p?n?.length||0:""}`,htmlFor:r}),p&&!!n?.length&&s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(Tn,{label:x,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS}),onClick:S}),(a?a>n?.length:!0)&&s.jsx(Wr,{appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconPlus,{...f.BASE_ICON_PROPS}),label:y,onClick:I}),v]})]}),n&&n.length>0&&s.jsx("input",{id:"file",type:"file",multiple:p,ref:C,hidden:!0,accept:g,onChange:A}),s.jsx(Zn,{files:n,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:h,getIsFileFormatError:w,getIsFileSizeError:N,getIsMultiFilesSizeError:L,...b})]})};var Oe=(e=>(e.Row="Row",e.Column="Column",e))(Oe||{}),We=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(We||{}),it=(e=>(e.Info="info",e.Danger="danger",e))(it||{}),qn=(e=>(e.Normal="normal",e.Reverse="reverse",e))(qn||{}),Ae=(e=>(e.File="file",e.Folder="folder",e))(Ae||{}),It=(e=>(e.Left="left",e.Right="right",e))(It||{}),X=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e.Loading="loading",e.General="general",e))(X||{}),fe=(e=>(e.Toast="toast",e.SectionMessage="section-message",e))(fe||{}),qt=(e=>(e.Variant="variant",e.Neutral="neutral",e))(qt||{});const Jr="data-editable-container",Wl={[Jr]:""};function Gl({value:e,isEditing:t,isCreating:r,isLoading:n=!1,restoreOnCancel:a=!0,onValidate:o,onSave:i,onCancel:l,onCreateFolderSave:d,onCreateFolderCancel:u}){const[h,p]=m.useState(e),[g,x]=m.useState(!1),[y,v]=m.useState(""),b=m.useRef(null),C=m.useRef(!1),I=m.useRef(!1),S=m.useCallback((j=!1,D="")=>{x(j),v(D)},[]),w=m.useCallback(j=>{if(!o)return S(),!0;const D=o(j);return D?D.startsWith(`${X.Warning}__`)?(S(!1,D),!0):(S(!0,D),!1):(S(),!0)},[o,S]),N=m.useCallback(j=>{const D=j??"";p(D),w(D)},[w]),L=m.useCallback(j=>{r&&!C.current&&!n?d?.(j):!r&&t&&i?.(j),C.current=!1},[i,d,r,t,n]),A=m.useCallback(()=>{a&&p(e),r?u?.():l?.(),C.current=!0,S()},[e,l,a,S,u,r]),T=m.useCallback(()=>{if(!I.current){if(I.current=!0,w(h)){L(h);return}!r&&w(e)?(p(e),S(),L(e)):A()}},[w,h,e,L,A,S,r]);return m.useEffect(()=>{!t&&!r||(C.current=!1,I.current=!1,p(e),S(),requestAnimationFrame(()=>{b.current?.focus(),b.current?.select()}))},[t,r,e,S]),m.useEffect(()=>{const j=b.current;if(!t&&!r||!j)return;const D=E=>{E.key==="Enter"?(E.preventDefault(),b.current?.blur()):E.key==="Escape"&&(E.preventDefault(),A())};return j.addEventListener("keydown",D),()=>j.removeEventListener("keydown",D)},[t,r,A]),m.useEffect(()=>{if(!t&&!r||n)return;const j=b.current;if(!j)return;const D=P=>P?(j.closest(`[${Jr}]`)??j).contains(P):!1,E=P=>{D(P.target)||T()},k=P=>{D(P.relatedTarget)||T()};return document.addEventListener("pointerdown",E,!0),j.addEventListener("blur",k),()=>{document.removeEventListener("pointerdown",E,!0),j.removeEventListener("blur",k)}},[t,r,n,T]),{inputRef:b,value:h,onChange:N,invalid:g,invalidMessage:y}}var be=(e=>(e.VALID="valid",e.ERROR="error",e))(be||{}),ze=(e=>(e.ITEM="item",e.FOLDER="folder",e))(ze||{}),es=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(es||{}),Yn=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(Yn||{});const Ul="application/octet-stream";function Zl(e,t){if(!e||e.length===0)return[];const r=e.find(d=>d.parentPath===""&&d.nodeType==="FOLDER");if(!r)return[];const n=r.path||r.url||"",a=yr(n,!0),o=e.filter(d=>d!==r).map(d=>{const u=d.path||d.url||"",h=ql(d.nodeType),p=h===ze.FOLDER,g=yr(u,p);let x;return d.parentPath===null||d.parentPath===void 0?x=a:d.parentPath===""?x="":x=yr(d.parentPath,!0),{...d,originalPath:u,path:g,parentPath:x,nodeType:h}}),i=new Map;o.forEach(d=>{const u={...d,id:d.originalPath,name:d.name,path:d.path,parentPath:d.parentPath,nodeType:d.nodeType,resourceType:Yl(d.resourceType),folderId:t,updatedAt:d.updatedAt?new Date(d.updatedAt).toISOString():new Date().toISOString(),items:d.nodeType===ze.FOLDER?[]:void 0};d.nodeType===ze.ITEM&&(u.extension=Xl(d.name),u.contentType=d.contentType||Ul,u.contentLength=d.contentLength||0),i.set(d.path,u)});const l=[];return i.forEach(d=>{if(d.parentPath===a)l.push(d);else{const u=d.path.lastIndexOf(d.name||""),h=d.path.slice(0,u),p=i.get(h);p&&p.nodeType===ze.FOLDER?(p.items=p.items||[],p.items.push(d)):l.push(d)}}),l}function yr(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 ql(e){return e.toUpperCase()==="FOLDER"?ze.FOLDER:ze.ITEM}function Yl(e){if(!e)return;const t=e.toUpperCase();return Object.values(es).find(n=>n.toUpperCase()===t)}function Xl(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function Ql(e,t="Prompts",r="prompts/public/",n="root"){const a=Zl(e,n);return[{id:n,name:t,path:r,parentPath:"",nodeType:ze.FOLDER,folderId:n,items:a}]}const Xn=({locale:e,timeZone:t,date:r=new Date}={})=>{const n=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:n,timeZoneName:"longOffset"}).formatToParts(r).find(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${n}`:n}catch{return n}},Qn=':;,=/{}%&\\"',ts=`(\r
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("./icon-4D9xu6E_.cjs"),c=require("./DateCellRenderer-CB2R7gM2.cjs"),F=require("@tabler/icons-react"),B=require("@floating-ui/react"),m=require("react"),re=require("classnames"),hn=require("./editors.cjs"),Wa=require("react-dom");function Ga(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Me=Ga(m),Br=({text:e,className:t,variant:r=c.CaptionType.Description,...n})=>e?s.jsx("span",{...n,role:"alert",className:f.mergeClasses("dial-tiny-text",r===c.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,Fe=({...e})=>s.jsx(Br,{...e,variant:c.CaptionType.Error}),gs={[c.ButtonVariant.Primary]:{[c.ButtonAppearance.Solid]:"dial-primary-solid-button",[c.ButtonAppearance.Ghost]:"dial-primary-ghost-button",[c.ButtonAppearance.Link]:"dial-primary-link-button"},[c.ButtonVariant.Neutral]:{[c.ButtonAppearance.Outlined]:"dial-neutral-outlined-button"},[c.ButtonVariant.Danger]:{[c.ButtonAppearance.Solid]:"dial-danger-solid-button",[c.ButtonAppearance.Ghost]:"dial-danger-ghost-button",[c.ButtonAppearance.Outlined]:"dial-danger-outlined-button"},[c.ButtonVariant.Success]:{[c.ButtonAppearance.Ghost]:"dial-success-ghost-button"},[c.ButtonVariant.Secondary]:{[c.ButtonAppearance.Ghost]:"dial-secondary-ghost-button"},[c.ButtonVariant.Tertiary]:{[c.ButtonAppearance.Ghost]:"dial-tertiary-ghost-button"},[c.ButtonVariant.Static]:{},[c.ButtonVariant.Starter]:{}},mn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=gs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),gs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},Ua=7,Za=2,gn=m.createContext(null),xn=()=>{const e=m.useContext(gn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},qa=({initialOpen:e=!1,placement:t="bottom",isTriggerClickable:r=!1,open:n,onOpenChange:a}={})=>{const[o,i]=m.useState(e),l=m.useRef(null),d=n??o,u=a??i,p=B.useFloating({placement:t,open:d,onOpenChange:u,whileElementsMounted:B.autoUpdate,middleware:[B.offset(Ua+Za),B.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),B.shift({padding:5}),B.arrow({element:l})]}),h=B.useHover(p.context,{move:!1,enabled:n==null,mouseOnly:r,delay:{open:500,close:0}}),x=B.useFocus(p.context,{enabled:n==null}),g=B.useDismiss(p.context),y=B.useRole(p.context,{role:"tooltip"}),v=B.useInteractions([h,x,g,y]);return m.useEffect(()=>{if(!d)return;const b=p.refs.reference.current;if(!(b instanceof Element))return;const I=new IntersectionObserver(([C])=>{C.isIntersecting||u(!1)},{root:null,threshold:0});return I.observe(b),()=>I.disconnect()},[d,p.refs.reference,u]),m.useMemo(()=>({open:d,setOpen:u,arrowRef:l,...v,...p}),[d,u,v,p])},zr=({children:e,...t})=>{const r=qa(t);return s.jsx(gn.Provider,{value:r,children:e})},Fr=({style:e,...t})=>{const r=xn(),n=c.useHasHover(),a=m.useRef(null),o=B.useMergeRefs([r.refs.setFloating,a]);return!r.open||!n?null:s.jsx(B.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...r.floatingStyles,...e},...r.getFloatingProps(t),className:re("z-tooltip whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny-text shadow max-w-[300px]",r.getFloatingProps(t).className),children:[t.children,s.jsx(B.FloatingArrow,{ref:r.arrowRef,context:r.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},Hr=({children:e,asChild:t=!1,...r})=>{const n=xn(),a=t&&m.isValidElement(e),o=a?e.props?.ref:null,i=B.useMergeRefs([n.refs.setReference,...o?[o]:[]]);return a?m.cloneElement(e,n.getReferenceProps({...e.props,...r,ref:i})):s.jsx("span",{ref:i,...n.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-start",children:e})},qe=({hideTooltip:e,tooltip:t,children:r,triggerClassName:n,contentClassName:a,...o})=>s.jsxs(zr,{...o,children:[s.jsx(Hr,{className:re(n,"truncate"),children:r}),s.jsx(Fr,{className:re("text-primary",a,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]}),Tt=({variant:e,appearance:t=c.ButtonAppearance.Solid,size:r=c.ElementSize.Standard,className:n,icon:a,tooltipProps:o,type:i="button",...l})=>{const d=f.mergeClasses(e&&mn(e,t),r===c.ElementSize.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px] dial-kit-enhanced-target","dial-icon-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",n),u=s.jsx("button",{...l,type:i,className:d,"aria-label":c.resolveAccessibleName(l["aria-label"],o?.tooltip),children:a});return o?s.jsx(qe,{...o,children:u}):u},Ya="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active",Xa=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Tt,{"aria-label":e,className:Ya,icon:s.jsx(F.IconInfoCircle,{size:f.DIAL_ICON_SIZE.SM}),onClick:t});return e?s.jsx(qe,{tooltip:e,triggerClassName:"flex justify-center items-center",children:r}):r},$r=({label:e,required:t,className:r,caption:n,...a})=>e?s.jsxs("label",{...a,className:f.mergeClasses("dial-tiny-text text-secondary flex items-center gap-1",r),children:[typeof e=="string"?s.jsx("span",{className:"min-h-4",children:e}):e,t&&s.jsx("span",{className:"text-accent-primary",children:"*"}),s.jsx(Xa,{caption:n})]}):null,Qa=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:d,headerClassName:u,contentClassName:p})=>{const h=n!==void 0,[x,g]=m.useState(a),y=i?!0:h?n:x,v=m.useId(),b=()=>{if(o)return;const I=!y;h||g(I),l?.(I)};return s.jsxs("div",{className:f.mergeClasses("rounded border border-secondary",d),children:[s.jsxs("button",{type:"button","aria-expanded":y,"aria-controls":v,disabled:o||i,onClick:b,className:f.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",u),children:[!i&&s.jsx(c.DialIcon,{className:re("text-secondary transition-transform",y&&"rotate-90"),icon:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM})}),s.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),y&&s.jsx("div",{id:v,role:"region",className:f.mergeClasses("px-4 pb-4",p),children:r})]})},Ja="flex items-center justify-center text-secondary",eo="shrink-0 grow-0 basis-auto animate-spin-steps",to=e=>Me.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Me.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Me.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),ro=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:re({[Ja]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(to,{width:e,height:e,className:re(eo,r),role:"img","aria-label":a})})}),Ve=({size:e=40,className:t,fullWidth:r=!1,ariaLabel:n="Loading"})=>s.jsx("div",{role:"status",className:f.mergeClasses("flex items-center justify-center",{"size-full":r},t,c.DIAL_KIT_CLASS.spinner),children:s.jsx("div",{role:"img","aria-label":n,style:{width:e,height:e},className:"rounded-full border-2 border-secondary border-t-accent animate-spin-steps shrink-0"})});var Ct=(e=>(e.Progressbar="progressbar",e.Meter="meter",e))(Ct||{});const so={[Ct.Progressbar]:"Progress",[Ct.Meter]:"Meter"},bn=({value:e,max:t=100,size:r=c.ElementSize.Standard,labelProps:n,valueLabel:a,role:o=Ct.Progressbar,id:i,className:l,"aria-label":d,...u})=>{const p=m.useId(),h=i??p,x=!!n?.label,g=x?n?.id??`${h}-label`:void 0,y=t>0?t:0,v=Number.isFinite(e)?e:0,b=Math.min(Math.max(v,0),y),I=y>0?b/y*100:0,C=s.jsx("div",{...u,id:h,role:o,"aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":y,"aria-labelledby":g,"aria-label":c.resolveAccessibleName(d,x?void 0:so[o]),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",l,!x&&!a&&c.DIAL_KIT_CLASS.progressBar),children:s.jsx("div",{style:{width:`${I}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!x&&!a?C:s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-1",c.DIAL_KIT_CLASS.progressBar),children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[n&&s.jsx(c.Label,{...n,id:g}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),C]})},no=({icon:e,title:t,description:r,containerClassName:n,titleClassName:a,descriptionClassName:o})=>s.jsxs("div",{className:f.mergeClasses("h-full w-full flex flex-col items-center justify-center text-secondary",n),"aria-label":"no-data-container",children:[e||s.jsx(F.IconClipboardX,{width:60,height:60,stroke:.5}),s.jsx("span",{className:f.mergeClasses("dial-small-text mt-2 text-primary",a),"aria-label":"no-results-title",children:t}),r&&s.jsx("span",{className:f.mergeClasses("mt-1 text-primary",o),"aria-label":"no-results-description",children:r})]}),ao=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col",n?"":"max-w-[200px]",o),children:[e&&s.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),n||s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(qe,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),Et=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,hideTitleOnMobile:d,type:u="button",tooltipProps:p,...h})=>{const x=re(d?"hidden sm:inline":"inline",o),g=f.mergeClasses(t&&mn(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-semi-text",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"h-[24px] px-2":"h-[40px] px-3"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target","disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",a),y=s.jsxs("button",{...h,type:u,className:g,"aria-label":typeof e=="string"&&e||h["aria-label"],children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:x,children:e}),s.jsx(c.DialIcon,{icon:i})]});return p?s.jsx(qe,{...p,children:y}):y},oo="text-primary",er=({text:e,className:t,contentClassName:r,hideTooltip:n,id:a,customTooltipContent:o,...i})=>{const l=m.useRef(null),[d,u]=m.useState(!1),[p,h]=m.useState(""),x=m.useCallback(()=>{const b=l.current;b&&(h(b.textContent??""),u(b.scrollWidth>b.clientWidth))},[]),g=m.useCallback(()=>c.scheduleMeasure(x),[x]);m.useEffect(()=>{const b=l.current;if(b)return c.observeElementSize(b,x)},[x]),m.useEffect(()=>{g()},[e,g]);const y=m.useMemo(()=>typeof e=="string"?e:p,[p,e]),v=m.useMemo(()=>n?"":o||(d?y:""),[o,y,n,d]);return s.jsxs(zr,{...i,children:[s.jsx(Hr,{asChild:!0,onMouseEnter:g,onFocusCapture:g,children:s.jsx("span",{id:a,className:f.mergeClasses("block truncate flex-1 min-w-0 max-w-full text-start",t),"aria-label":d?y:void 0,onMouseEnter:g,onFocus:g,ref:l,children:e})}),s.jsx(Fr,{className:f.mergeClasses(oo,r,!v&&"hidden"),children:v})]})},io=({label:e,className:t,icon:r,selected:n,closable:a,onClick:o,onRemove:i})=>{const l=f.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",n?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return s.jsxs("div",{className:l,onClick:o,children:[s.jsx(c.DialIcon,{icon:r}),s.jsx(er,{text:e}),a&&i&&s.jsx(Et,{className:"p-0",iconAfter:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM}),onClick:d=>i(d)})]},e)};var Ee=(e=>(e.Default="default",e.Text="text",e.Circular="circular",e.Rectangular="rectangular",e))(Ee||{}),bt=(e=>(e.Small="small",e.Default="default",e.Large="large",e))(bt||{}),Wt=(e=>(e.Circle="circle",e.Square="square",e))(Wt||{});const lo=e=>{if(typeof e=="number")return e;switch(e){case bt.Small:return 32;case bt.Large:return 64;case bt.Default:default:return 40}},$t=({active:e=!0,paragraph:t=!0,avatar:r=!1,showTitle:n=!0,loading:a=!0,children:o,variant:i=Ee.Default,width:l,height:d,overlay:u,color:p,className:h,...x})=>{if(!a&&o)return s.jsx(s.Fragment,{children:o});const g=f.mergeClasses("bg-layer-raised",e&&"animate-pulse",h);if(i!==Ee.Default){const j=f.mergeClasses(g,i===Ee.Circular&&"rounded-full",i===Ee.Rectangular&&"rounded",i===Ee.Text&&"rounded",!!u&&"relative"),T={};return l&&(T.width=typeof l=="number"?`${l}px`:l),d&&(T.height=typeof d=="number"?`${d}px`:d),p&&(T.backgroundColor=p),s.jsx("div",{className:j,style:T,...x,children:u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})})}const y=!!r,v=!!n,b=!!t,I=typeof r=="object"?r:{},C=typeof n=="object"?n:{},N=typeof t=="object"?t:{},w=lo(I.size),S=I.shape??Wt.Circle,L=C.width??"38%",A=N.rows??3,E=N.width,D=j=>E?Array.isArray(E)?E[j]??"100%":E:j===A-1?"61%":"100%";return s.jsxs("div",{...x,className:f.mergeClasses("flex gap-4",!!u&&"relative",h,c.DIAL_KIT_CLASS.skeleton),children:[y&&s.jsx("div",{className:f.mergeClasses(g,S===Wt.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:w,height:w,...p&&{backgroundColor:p}}}),s.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[v&&s.jsx("div",{className:f.mergeClasses(g,"h-4 rounded"),style:{width:L,...p&&{backgroundColor:p}}}),b&&s.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:A}).map((j,T)=>s.jsx("div",{className:f.mergeClasses(g,"h-4 rounded"),style:{width:D(T),...p&&{backgroundColor:p}}},T))})]}),u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})]})},co=re("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),uo=re("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),Tr=re("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-hidden","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary",c.DIAL_KIT_CLASS.menuItem),Er="opacity-75 !cursor-not-allowed",vn="text-error",fo="my-1 border-t border-hover border-secondary",st=4,po=s.jsx(F.IconChevronRight,{size:14}),ct=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),ho=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),mo=ct(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),go=ct(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),yn=ct(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),xo=ct(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),bo=ct(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),vo=ct(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),Cn=ho(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),In=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(Cn,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),yo=({item:e,onRootClose:t})=>{const{isOpen:r,refs:n,floatingStyles:a,context:o,getReferenceProps:i,getFloatingProps:l}=c.useSubMenuFloating(st,"menu",!!e.disabled),d=m.useCallback(u=>p=>{u.disabled||(u.onClick?.({key:u.key,domEvent:p}),t())},[t]);return s.jsxs(s.Fragment,{children:[s.jsxs("button",{ref:n.setReference,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":r,"aria-disabled":!!e.disabled,disabled:e.disabled,className:re(Tr,e.disabled&&Er,e.className),...i(),children:[e.icon&&s.jsx("span",{className:re(e.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:e.icon})}),s.jsx("span",{className:re("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),s.jsx("span",{className:re("ml-auto shrink-0",e.disabled&&"text-secondary"),children:po})]}),r&&s.jsx(c.SubMenuPanel,{refs:n,floatingStyles:a,context:o,getFloatingProps:l,role:"menu",className:"w-max",children:s.jsx("div",{role:"none",className:re("py-1",c.DIAL_KIT_CLASS.dropdownList),children:e.children.map(u=>s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!u.disabled,disabled:u.disabled,className:re(Tr,u.disabled&&Er,u.danger&&vn,u.className),onClick:d(u),children:[u.icon&&s.jsx("span",{className:re(u.danger&&"text-error",u.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:u.icon})}),s.jsx("span",{className:re("flex-1 truncate text-start",u.danger&&"text-error",u.disabled&&"text-secondary"),children:u.label})]},u.key))})})]})},Co=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,Gt=({children:e,items:t,onItemClick:r,menuHeader:n,menuFooter:a,renderOverlay:o,trigger:i=[c.DropdownTrigger.Click],placement:l,disabled:d=!1,open:u,defaultOpen:p=!1,onOpenChange:h,closable:x=!1,onClose:g,className:y,overlayContentClassName:v,separatorClassName:b,listClassName:I,outsidePressIgnoreRef:C,outsideClosable:N=!0,allowedPlacements:w,anchorToMouse:S=!1,matchReferenceWidth:L=!0,maxDropdownHeight:A})=>{const[E,D]=m.useState(p),j=u!==void 0,T=j?!!u:E,k=m.useRef(null),P=m.useCallback(O=>{j||D(O),h?.(O)},[j,h]),_=m.useId(),R=l===void 0,{refs:M,floatingStyles:H,context:V}=B.useFloating({placement:l,open:T,onOpenChange:P,whileElementsMounted:B.autoUpdate,middleware:[B.offset({mainAxis:st,crossAxis:0}),R?B.autoPlacement({alignment:"start",crossAxis:!0,padding:st,allowedPlacements:w}):B.flip({padding:st}),B.shift({padding:st}),B.size({padding:st,apply({availableWidth:O,availableHeight:U,elements:de}){const ne=de.floating,ge=Co(de.reference);ne.style.setProperty("--fui-available-height",`${Math.floor(U)}px`),ne.style.setProperty("--reference-width",L?`${Math.round(ge)}px`:"0px"),L?ne.style.minWidth=`${Math.round(ge)}px`:ne.style.removeProperty("min-width"),ne.style.maxWidth=`${Math.floor(O)}px`;const Qe=Math.floor(U);ne.style.maxHeight=`${A?Math.min(Qe,A):Qe}px`}})]}),K=B.useClick(V,{enabled:i.includes(c.DropdownTrigger.Click)&&!d}),Z=B.useHover(V,{enabled:i.includes(c.DropdownTrigger.Hover)&&!d,move:!1,restMs:40,delay:{open:80,close:80}}),Y=B.useDismiss(V,{bubbles:!0,referencePress:!1,outsidePress:O=>{if(!N)return!1;const U=O.target;return!(C?.current&&U instanceof Node&&C.current.contains(U))}}),W=B.useRole(V,{role:"menu"}),{getReferenceProps:se,getFloatingProps:G}=B.useInteractions([K,Z,Y,W]),X=m.useCallback((O,U)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:O,y:U,top:U,left:O,right:O,bottom:U})})},[M]),te=m.useCallback(O=>{!i.includes(c.DropdownTrigger.ContextMenu)||d||(O.preventDefault(),S&&(X(O.clientX,O.clientY),k.current=document.elementFromPoint(O.clientX,O.clientY)),P(!0))},[S,d,P,X,i]),le=m.useCallback(O=>{!S||d||(i.includes(c.DropdownTrigger.ContextMenu)&&T&&P(!1),X(O.clientX,O.clientY),k.current=document.elementFromPoint(O.clientX,O.clientY))},[S,d,X,T,i,P]);m.useEffect(()=>{d&&T&&P(!1)},[d,T,P]);const oe=m.useCallback(O=>U=>{O.disabled||(O.onClick?.({key:O.key,domEvent:U}),r?.({key:O.key,domEvent:U}),P(!1))},[r,P]),me=m.useMemo(()=>o?o():t?s.jsxs(s.Fragment,{children:[n&&s.jsx(s.Fragment,{children:typeof n=="function"?n():n}),s.jsx("div",{role:"none",className:f.mergeClasses("py-1",v,c.DIAL_KIT_CLASS.dropdownList),"aria-label":"dropdown",children:t.map(O=>O.type===c.DropdownItemType.Divider?s.jsx("div",{role:"separator",className:f.mergeClasses(fo,b)},O.key):O.type===c.DropdownItemType.PlainText?s.jsx("div",{className:f.mergeClasses("px-3 py-2 text-secondary dial-caption-text",O.className),children:O.label},O.key):O.children?.length?s.jsx(yo,{item:O,onRootClose:()=>P(!1)},O.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!O.disabled,className:re(Tr,O.disabled&&Er,O.danger&&vn,O.className),disabled:O.disabled,onClick:oe(O),children:[O.icon&&s.jsx("span",{className:re(O.danger&&"text-error",O.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:O.icon})}),s.jsx("span",{className:re("flex-1 truncate text-start",O.danger&&"text-error",O.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:O.label})]},O.key))}),a&&s.jsx(s.Fragment,{children:typeof a=="function"?a():a})]}):null,[oe,t,a,n,o,P,v,b]),ve=se({onContextMenu:te,onMouseDown:le});return m.useEffect(()=>{if(!T)return;const O=M.reference.current;let U=null;if(O instanceof Element?U=O:k.current instanceof Element&&(U=k.current),!U)return;const de=new IntersectionObserver(([ne])=>{ne.isIntersecting||P(!1)},{root:null,threshold:0});return de.observe(U),()=>de.disconnect()},[T,M.reference,P]),s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M.setReference,className:re(co,d&&"!cursor-not-allowed opacity-75",y),"aria-haspopup":"menu","aria-expanded":T,"aria-controls":_,...ve,children:e}),T&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:V,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsxs("div",{id:_,ref:M.setFloating,style:H,className:re(uo,!L&&"w-max",I),...G(),children:[x&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(In,{ariaLabel:"Close dropdown",onClose:O=>{g?.(O),P(!1)}})}),me]})})})]})};var Ge=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Ge||{}),ot=(e=>(e.Error="error",e.Warning="warning",e))(ot||{}),Ue=(e=>(e.Default="default",e.Inline="inline",e))(Ue||{}),Ut=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Ut||{});const gt=({tab:e,active:t,invalid:r,className:n,horizontal:a,view:o=Ue.Default,onClick:i})=>{const l=o===Ue.Inline,d=f.mergeClasses("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small-text hover:text-accent-primary",{"border-b-2 px-4":a,"border-l-2 px-3":!a},{"bg-layer-4":a,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&a&&!e.disabled,"border-l-accent-primary":t&&!a&&!e.disabled}),u=f.mergeClasses("flex flex-row gap-1 h-6 items-center py-1 px-2 rounded cursor-pointer hover:bg-accent-primary-alpha",t?"dial-small-semi-text":"dial-small-text",{"text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-secondary":!t&&!e.disabled}),p=f.mergeClasses(l?u:d,n);return s.jsxs("button",{role:"tab","aria-selected":t,className:p,onClick:()=>i(e.id),disabled:e.disabled,children:[l&&t&&!e.disabled&&s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM}),s.jsx(er,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(r||e.invalid)&&s.jsx("div",{className:"text-error pl-1",children:s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS})}),e.warning&&s.jsx("div",{className:"text-warning pl-1",children:s.jsx(F.IconAlertTriangle,{...f.BASE_ICON_PROPS})})]})},Io=()=>{const[e,t]=m.useState(()=>typeof window>"u"?c.ScreenType.Desktop:c.getScreenType());return m.useEffect(()=>{t(c.getScreenType());const r=()=>t(c.getScreenType());return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e},So=12,No=({tabs:e,activeTab:t,onClick:r,className:n,orientation:a=Ge.Horizontal,view:o=Ue.Default,screenThreshold:i=Ut.Tablet,smallScreenContainerClassName:l,smallScreenDropdownItemClassName:d,desktopDropdownClassName:u,desktopTabClassName:p,inlineContainerClassName:h,inlineTabClassName:x})=>{const[g,y]=m.useState(!1),[v,b]=m.useState(!1),[I,C]=m.useState(!1),N=Io(),w=N===c.ScreenType.Mobile||i===Ut.Tablet&&N===c.ScreenType.Tablet,S=a===Ge.Horizontal,L=m.useRef(null),A=m.useRef(null),E=m.useRef(null),D=e.find(_=>_.id===t),j=m.useMemo(()=>f.mergeClasses("flex gap-2",S?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[S]),T=m.useCallback(()=>{const _=A.current;_&&C(_.scrollWidth>_.clientWidth)},[]),k=m.useCallback(()=>{const _=E.current,R=A.current;if(!_||!R)return;const M=_.getBoundingClientRect(),H=R.getBoundingClientRect();if(M.width===0||H.width===0)return;const V=So;let K=R.scrollLeft;if(M.left<H.left+V)K-=H.left+V-M.left;else if(M.right>H.right-V)K+=M.right-(H.right-V);else return;const Z=Math.max(0,R.scrollWidth-R.clientWidth);K=Math.max(0,Math.min(K,Z)),K!==R.scrollLeft&&R.scrollTo({left:K,behavior:"smooth"})},[]),P=m.useCallback(_=>{r(_),_===t&&k()},[r,t,k]);return m.useEffect(()=>{T();const _=new ResizeObserver(()=>T()),R=A.current;return R&&_.observe(R),()=>_.disconnect()},[e,T]),m.useEffect(()=>{k()},[t,k]),o===Ue.Inline?s.jsx("div",{role:"tablist",className:f.mergeClasses("flex flex-row items-center gap-0.5 bg-layer-4 rounded w-fit p-0.5",h),children:e.map(_=>s.jsx(gt,{tab:_,active:t===_.id,view:Ue.Inline,onClick:P,className:x},_.id))}):w?s.jsx("div",{role:"tablist",className:f.mergeClasses("h-11 flex items-center bg-layer-3 px-4",l),children:s.jsx(Gt,{trigger:[c.DropdownTrigger.Click],open:g,onOpenChange:y,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(_=>s.jsx(gt,{tab:_,active:_.id===t,onClick:R=>{P(R),y(!1)},className:f.mergeClasses("w-full rounded-none h-11 items-center px-6",d)},_.id)),children:s.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[s.jsx(gt,{tab:D,active:!0,onClick:P,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM}),className:f.mergeClasses("text-primary transition-transform",g&&"rotate-180")})]})})}):s.jsxs("div",{ref:L,className:f.mergeClasses("flex items-center",n),children:[s.jsx("div",{ref:A,role:"tablist",className:j,children:e.map(_=>s.jsx("div",{ref:t===_.id?E:void 0,className:"w-full",children:s.jsx(gt,{tab:_,active:t===_.id,onClick:P,horizontal:S,className:f.mergeClasses("w-full",p)})},_.id))}),I&&s.jsx("div",{className:"flex items-center ml-2",children:s.jsx(Gt,{trigger:[c.DropdownTrigger.Click],open:v,onOpenChange:b,placement:"bottom-end",renderOverlay:()=>e.map(_=>s.jsx(gt,{tab:_,active:_.id===t,onClick:R=>{P(R),b(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},_.id)),children:s.jsx(Et,{iconBefore:s.jsx(F.IconDotsVertical,{size:f.BASE_ICON_SIZE}),className:f.mergeClasses("w-8 h-8 flex items-center justify-center rounded border",v?"bg-layer-4 border-transparent":"border-primary",u)})})})]})},Sn="w-full overflow-hidden",Nn="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Zt="flex items-center gap-2 dial-small-text",mr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},Lr="flex flex-1 items-center gap-1 min-w-0 transition-colors",wo="text-secondary hover:text-accent-primary",wn="text-primary cursor-default",Kr="flex-none inline-flex items-center leading-none text-secondary",jo="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",jn=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,"aria-hidden":"true"}),xt=({label:e,href:t,onClick:r,disabled:n,isLast:a,isFirst:o,separator:i=jn,className:l,iconBefore:d,labelClassName:u,onBeforeNavigate:p,...h})=>{const x=async C=>{if(p&&!a&&!await p()){C.preventDefault();return}r&&r(C)},g=a?mr.last:o?mr.first:mr.middle,y=f.mergeClasses(Zt,g,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(Lr,wo):f.mergeClasses(Lr,wn,n?"pointer-events-none opacity-75":""),I=typeof e=="string"?s.jsx(er,{className:f.mergeClasses("cursor-pointer",u),text:e,id:"breadcrumb-item-content"}):s.jsx("span",{className:f.mergeClasses("flex-1 min-w-0 truncate cursor-pointer max-w-[300px]",u),"aria-label":"breadcrumb-item-content",children:e});return s.jsxs("li",{...h,className:y,"aria-label":h["aria-label"]||"breadcrumb-item",children:[v?s.jsxs("a",{href:t,onClick:x,className:b,children:[d,I]}):s.jsxs("span",{className:b,"aria-current":a?"page":void 0,"aria-disabled":n?"true":void 0,children:[d,I]}),!a&&s.jsx("span",{className:Kr,"aria-label":"separator",children:i})]})},Do=({pathItems:e,separator:t=jn,ariaLabel:r="Breadcrumb",className:n,children:a,labelClassName:o,onBeforeNavigate:i})=>{const l=m.useMemo(()=>e?.length?e:m.Children.toArray(a).filter(m.isValidElement).map(p=>{const h=p.props,{labelClassName:x,isLast:g,separator:y,...v}=h;return v}),[e,a]),d=m.useCallback(async p=>{const h=parseInt(p.key,10),x=l[h];if(i&&!await i()){p.domEvent.preventDefault();return}x.onClick?x.onClick(p.domEvent):x.href&&(window.location.href=x.href)},[l,i]),u=m.useMemo(()=>{if(l.length===0)return null;if(l.length<=3)return l.map((v,b)=>m.createElement(xt,{...v,key:`item-${b}`,isFirst:b===0&&l.length>1,isLast:b===l.length-1,separator:t,labelClassName:o,onBeforeNavigate:i}));const p=l.at(0),h=l.slice(1,-2),x=l.at(-2),g=l.at(-1);if(!p||!x||!g)return null;const y=h.map((v,b)=>({key:String(b+1),label:typeof v.label=="string"?v.label:`Item ${b+1}`,disabled:v.disabled}));return s.jsxs(s.Fragment,{children:[m.createElement(xt,{...p,key:"item-0",isFirst:!0,separator:t,labelClassName:o,onBeforeNavigate:i}),s.jsxs("li",{className:f.mergeClasses(Zt,"shrink-0"),children:[s.jsx(Gt,{items:y,onItemClick:d,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:jo,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Kr,children:t})]}),m.createElement(xt,{...x,key:`item-${l.length-2}`,separator:t,labelClassName:o,onBeforeNavigate:i}),m.createElement(xt,{...g,key:`item-${l.length-1}`,isLast:!0,separator:t,labelClassName:o,onBeforeNavigate:i})]})},[l,t,o,d,i]);return s.jsx("nav",{"aria-label":r,className:f.mergeClasses(Sn,n),children:s.jsx("ol",{className:Nn,children:u})})},Vr=(e,t)=>({appearance:n,...a})=>s.jsx(Et,{...a,variant:e,appearance:n||t}),Dn=(e,t)=>({variant:n,...a})=>s.jsx(Et,{...a,variant:n||t,appearance:e}),Wr=Vr(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),Tn=Vr(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),En=Vr(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),To=Dn(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Eo=Dn(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Ln=({iconClassName:e,label:t,...r})=>t?s.jsx(En,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(yn,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),Lo="bg-layer-4 flex items-center justify-center enabled:text-secondary enabled:hover:text-accent-primary enabled:active:bg-controls-accent-primary-alpha-active enabled:hover:bg-accent-primary-alpha enabled:active:text-accent-primary",Ao=({icon:e,onClick:t,disabled:r,size:n=c.ElementSize.Standard,className:a})=>s.jsx("div",{className:re("border-l border-tertiary",n===c.ElementSize.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:s.jsx(Tt,{className:re(Lo,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),Oo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],_o=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!Oo.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||n!==void 0){const o=e.currentTarget.value,i=e.currentTarget.selectionStart||0,l=o.slice(0,i)+e.key+o.slice(i),d=parseFloat(l);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(n!==void 0&&d>+n){e.preventDefault();return}}}}},An=({labelProps:e,error:t,caption:r,id:n,containerClassName:a,...o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",a),children:[e&&s.jsx($r,{...e,htmlFor:n}),s.jsx(On,{id:n,...o}),s.jsx(Fe,{text:t}),!t&&s.jsx(Br,{text:r})]}),On=({invalid:e,disabled:t,prefix:r,className:n,postfix:a,iconBefore:o,iconAfter:i,wrapperClassName:l,type:d,inputRef:u,value:p,tooltipText:h,min:x,onChange:g,max:y,inputButtonProps:v,...b})=>{const I=m.useRef(null),C=B.useMergeRefs([u,I]),N=d==="number"||x!==void 0||y!==void 0;m.useEffect(()=>{const A=I.current;if(!A||!N||t)return;const E=D=>{D.preventDefault()};return A.addEventListener("wheel",E,{passive:!1}),()=>{A.removeEventListener("wheel",E)}},[t,N,d]);const w=A=>{_o(A,d,x,y)},S=A=>{const E=A.currentTarget.value;if(N&&E!==""){const D=parseFloat(E);if(isNaN(D)&&E!=="-"&&E!=="."||!isNaN(D)&&(x!==void 0&&D<+x||y!==void 0&&D>+y))return}g?.(E||void 0)},L=()=>s.jsxs("div",{className:f.mergeClasses("dial-input flex flex-row items-center gap-x-2 justify-between py-2",e&&"dial-input-error",t&&"dial-input-disable",!r&&"pl-3",!v&&"pr-3",l),"aria-label":"input-container",children:[r&&s.jsx("div",{className:"border-r border-tertiary",children:s.jsx(On,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,id:`${r}_textBefore`})}),s.jsx(c.DialIcon,{icon:o}),s.jsx("input",{ref:C,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:f.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",n),onChange:S,onKeyDown:w,min:x,disabled:t,max:y,...b}),a&&s.jsxs("p",{className:"text-secondary dial-small-text",children:[" ",a]}),s.jsx(c.DialIcon,{icon:i}),v&&s.jsx(Ao,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(qe,{tooltip:h||p,children:L()}):L()},_n=m.createContext({dragDropManager:void 0});function ye(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var xs=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),bs=function(){return Math.random().toString(36).substring(7).split("").join(".")},vs={INIT:"@@redux/INIT"+bs(),REPLACE:"@@redux/REPLACE"+bs()};function ko(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 Ro(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(Bo(e))return"date";if(Po(e))return"error";var r=Mo(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 Mo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Po(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Bo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Je(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Ro(e)),t}function kn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ye(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?ye(1):"Expected the enhancer to be a function. Instead, received: '"+Je(r)+"'");return r(kn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ye(2):"Expected the root reducer to be a function. Instead, received: '"+Je(e)+"'");var a=e,o=t,i=[],l=i,d=!1;function u(){l===i&&(l=i.slice())}function p(){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function h(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(4):"Expected the listener to be a function. Instead, received: '"+Je(v)+"'");if(d)throw new Error(process.env.NODE_ENV==="production"?ye(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return u(),l.push(v),function(){if(b){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,u();var C=l.indexOf(v);l.splice(C,1),i=null}}}function x(v){if(!ko(v))throw new Error(process.env.NODE_ENV==="production"?ye(7):"Actions must be plain objects. Instead, the actual type was: '"+Je(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?ye(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(d)throw new Error(process.env.NODE_ENV==="production"?ye(9):"Reducers may not dispatch actions.");try{d=!0,o=a(o,v)}finally{d=!1}for(var b=i=l,I=0;I<b.length;I++){var C=b[I];C()}return v}function g(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(10):"Expected the nextReducer to be a function. Instead, received: '"+Je(v));a=v,x({type:vs.REPLACE})}function y(){var v,b=h;return v={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?ye(11):"Expected the observer to be an object. Instead, received: '"+Je(C)+"'");function N(){C.next&&C.next(p())}N();var w=b(N);return{unsubscribe:w}}},v[xs]=function(){return this},v}return x({type:vs.INIT}),n={dispatch:x,subscribe:h,getState:p,replaceReducer:g},n[xs]=y,n}function q(e,t,...r){if(zo()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;n=new Error(t.replace(/%s/g,function(){return r[a++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function zo(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Fo(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function Ho(e,t){return e.filter(r=>r!==t)}function Rn(e){return typeof e=="object"}function $o(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const a=[];return r.forEach((o,i)=>{o===1&&a.push(i)}),a}function Ko(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Gr="dnd-core/INIT_COORDS",tr="dnd-core/BEGIN_DRAG",Ur="dnd-core/PUBLISH_DRAG_SOURCE",rr="dnd-core/HOVER",sr="dnd-core/DROP",nr="dnd-core/END_DRAG";function ys(e,t){return{type:Gr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Vo={type:Gr,payload:{clientOffset:null,sourceClientOffset:null}};function Wo(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(ys(o)),Go(r,l,d);const u=qo(r,l);if(u==null){e.dispatch(Vo);return}let p=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");Uo(i),p=i(u)}e.dispatch(ys(o,p));const x=d.getSource(u).beginDrag(l,u);if(x==null)return;Zo(x),d.pinSource(u);const g=d.getSourceType(u);return{type:tr,payload:{itemType:g,item:x,sourceId:u,clientOffset:o||null,sourceClientOffset:p||null,isSourcePublic:!!a}}}}function Go(e,t,r){q(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){q(r.getSource(n),"Expected sourceIds to be registered.")})}function Uo(e){q(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Zo(e){q(Rn(e),"Item must be an object.")}function qo(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Yo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Yo(e,a,r[a])})}return e}function Qo(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();Jo(n),ri(n).forEach((i,l)=>{const d=ei(i,l,a,n),u={type:sr,payload:{dropResult:Xo({},r,d)}};e.dispatch(u)})}}function Jo(e){q(e.isDragging(),"Cannot call drop while not dragging."),q(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ei(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return ti(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function ti(e){q(typeof e>"u"||Rn(e),"Drop result must either be an object or undefined.")}function ri(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function si(e){return function(){const r=e.getMonitor(),n=e.getRegistry();ni(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:nr}}}function ni(e){q(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ar(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function ai(e){return function(r,{clientOffset:n}={}){oi(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return li(a,i,l),ii(a,o,i),ci(a,o,i),{type:rr,payload:{targetIds:a,clientOffset:n||null}}}}function oi(e){q(Array.isArray(e),"Expected targetIds to be an array.")}function ii(e,t,r){q(t.isDragging(),"Cannot call hover while not dragging."),q(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const a=e[n];q(e.lastIndexOf(a)===n,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);q(o,"Expected targetIds to be registered.")}}function li(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);Ar(o,r)||e.splice(n,1)}}function ci(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function di(e){return function(){if(e.getMonitor().isDragging())return{type:Ur}}}function ui(e){return{beginDrag:Wo(e),publishDragSource:di(e),hover:ai(e),drop:Qo(e),endDrag:si(e)}}class fi{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 n(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&r(l)}}const a=ui(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=n(l),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function pi(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Mn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hi(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Mn(pi(t,n),r)}function mi(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Mn(t,r)}const vt=[],Zr=[];vt.__IS_NONE__=!0;Zr.__IS_ALL__=!0;function gi(e,t){return e===vt?!1:e===Zr||typeof t>"u"?!0:Ko(t,e).length>0}class xi{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;q(typeof t=="function","listener must be a function."),q(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const o=()=>{const i=this.store.getState(),l=i.stateId;try{l===a||l===a+1&&!gi(i.dirtyHandlerIds,n)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){q(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return q(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(q(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),a=this.getItemType();return Ar(n,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(q(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),a=this.getItemType();return n!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),o=this.getItemType();if(o&&!Ar(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return n?l===i.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 hi(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return mi(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Cs=typeof global<"u"?global:self,Pn=Cs.MutationObserver||Cs.WebKitMutationObserver;function Bn(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function bi(e){let t=1;const r=new Pn(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const vi=typeof Pn=="function"?bi:Bn;class yi{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),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 n=0,a=t.length-this.index;n<a;n++)t[n]=t[n+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=vi(this.flush),this.requestErrorThrow=Bn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Ci{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 Ii{create(t){const r=this.freeTasks,n=r.length?r.pop():new Ci(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const zn=new yi,Si=new Ii(zn.registerPendingError);function Ni(e){zn.enqueueTask(Si.create(e))}const qr="dnd-core/ADD_SOURCE",Yr="dnd-core/ADD_TARGET",Xr="dnd-core/REMOVE_SOURCE",ar="dnd-core/REMOVE_TARGET";function wi(e){return{type:qr,payload:{sourceId:e}}}function ji(e){return{type:Yr,payload:{targetId:e}}}function Di(e){return{type:Xr,payload:{sourceId:e}}}function Ti(e){return{type:ar,payload:{targetId:e}}}function Ei(e){q(typeof e.canDrag=="function","Expected canDrag to be a function."),q(typeof e.beginDrag=="function","Expected beginDrag to be a function."),q(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Li(e){q(typeof e.canDrop=="function","Expected canDrop to be a function."),q(typeof e.hover=="function","Expected hover to be a function."),q(typeof e.drop=="function","Expected beginDrag to be a function.")}function Or(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Or(r,!1));return}q(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ie;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ie||(Ie={}));let Ai=0;function Oi(){return Ai++}function _i(e){const t=Oi().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Is(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ss(e,t){const r=e.entries();let n=!1;do{const{done:a,value:[,o]}=r.next();if(o===t)return!0;n=!!a}while(!n);return!1}class ki{addSource(t,r){Or(t),Ei(r);const n=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(wi(n)),n}addTarget(t,r){Or(t,!0),Li(r);const n=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(ji(n)),n}containsHandler(t){return Ss(this.dragSources,t)||Ss(this.dropTargets,t)}getSource(t,r=!1){return q(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return q(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Is(t)===Ie.SOURCE}isTargetId(t){return Is(t)===Ie.TARGET}removeSource(t){q(this.getSource(t),"Expected an existing source."),this.store.dispatch(Di(t)),Ni(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){q(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Ti(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);q(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){q(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const a=_i(t);return this.types.set(a,r),t===Ie.SOURCE?this.dragSources.set(a,n):t===Ie.TARGET&&this.dropTargets.set(a,n),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 Ri=(e,t)=>e===t;function Mi(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Pi(e,t,r=Ri){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Bi(e=vt,t){switch(t.type){case rr:break;case qr:case Yr:case ar:case Xr:return vt;case tr:case Ur:case nr:case sr:default:return Zr}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=$o(r,n);if(!(a.length>0||!Pi(r,n)))return vt;const i=n[n.length-1],l=r[r.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function zi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){zi(e,a,r[a])})}return e}const Ns={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Hi(e=Ns,t){const{payload:r}=t;switch(t.type){case Gr:case tr:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case rr:return Mi(e.clientOffset,r.clientOffset)?e:Fi({},e,{clientOffset:r.clientOffset});case nr:case sr:return Ns;default:return e}}function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function et(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){$i(e,a,r[a])})}return e}const Ki={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Vi(e=Ki,t){const{payload:r}=t;switch(t.type){case tr:return et({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Ur:return et({},e,{isSourcePublic:!0});case rr:return et({},e,{targetIds:r.targetIds});case ar:return e.targetIds.indexOf(r.targetId)===-1?e:et({},e,{targetIds:Ho(e.targetIds,r.targetId)});case sr:return et({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case nr:return et({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Wi(e=0,t){switch(t.type){case qr:case Yr:return e+1;case Xr:case ar:return e-1;default:return e}}function Gi(e=0){return e+1}function Ui(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Ui(e,a,r[a])})}return e}function qi(e={},t){return{dirtyHandlerIds:Bi(e.dirtyHandlerIds,{type:t.type,payload:Zi({},t.payload,{prevTargetIds:Fo(e,"dragOperation.targetIds",[])})}),dragOffset:Hi(e.dragOffset,t),refCount:Wi(e.refCount,t),dragOperation:Vi(e.dragOperation,t),stateId:Gi(e.stateId)}}function Yi(e,t=void 0,r={},n=!1){const a=Xi(n),o=new xi(a,new ki(a)),i=new fi(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function Xi(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return kn(qi,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Qi(e,t){if(e==null)return{};var r=Ji(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ji(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let ws=0;const Kt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var el=m.memo(function(t){var{children:r}=t,n=Qi(t,["children"]);const[a,o]=tl(n);return m.useEffect(()=>{if(o){const i=Fn();return++ws,()=>{--ws===0&&(i[Kt]=null)}}},[]),s.jsx(_n.Provider,{value:a,children:r})});function tl(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=rl(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function rl(e,t=Fn(),r,n){const a=t;return a[Kt]||(a[Kt]={dragDropManager:Yi(e,t,r,n)}),a[Kt]}function Fn(){return typeof global<"u"?global:window}function sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gr,js;function nl(){return js||(js=1,gr=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 n,a,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(a=n;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(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=n;a--!==0;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),gr}var al=nl();const ol=sl(al),or=typeof window<"u"?m.useLayoutEffect:m.useEffect;function il(e,t,r){const[n,a]=m.useState(()=>t(e)),o=m.useCallback(()=>{const i=t(e);ol(n,i)||(a(i),r&&r())},[n,e,r]);return or(o),[n,o]}function ll(e,t,r){const[n,a]=il(e,t,r);return or(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function cl(e,t,r){return ll(t,e||(()=>({})),()=>r.reconnect())}function dl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),m.useMemo(()=>typeof e=="function"?e():e,r)}let xr=!1;class ul{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;q(!xr,"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 xr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{xr=!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 fl(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function pl(e,t,r,n){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 o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let d=0;d<o.length;d++){const u=o[d];if(!l(u))return!1;const p=e[u],h=t[u];if(a=void 0,a===!1||a===void 0&&p!==h)return!1}return!0}function hl(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ml(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 gl(e){return(t=null,r=null)=>{if(!m.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return ml(n),bl(n,r?o=>e(o,r):e)}}function xl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=gl(n);t[r]=()=>a}}),t}function Ds(e,t){typeof e=="function"?e(t):e.current=t}function bl(e,t){const r=e.ref;return q(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?m.cloneElement(e,{ref:n=>{Ds(r,n),Ds(t,n)}}):m.cloneElement(e,{ref:t})}class vl{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!pl(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=xl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,hl(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 Qr(){const{dragDropManager:e}=m.useContext(_n);return q(e!=null,"Expected drag drop context"),e}function yl(e){return m.useMemo(()=>e.hooks.dropTarget(),[e])}function Cl(e){const t=Qr(),r=m.useMemo(()=>new vl(t.getBackend()),[t]);return or(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function Il(){const e=Qr();return m.useMemo(()=>new ul(e),[e])}function Sl(e){const{accept:t}=e;return m.useMemo(()=>(q(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Nl{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 wl(e,t){const r=m.useMemo(()=>new Nl(e,t),[t]);return m.useEffect(()=>{r.spec=e},[e]),r}function jl(e,t,r){const n=Qr(),a=wl(e,t),o=Sl(e);or(function(){const[l,d]=fl(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function Hn(e,t){const r=dl(e,t),n=Il(),a=Cl(r.options);return jl(r,n,a),[cl(r.collect,n,a),yl(a)]}function $n(e){let t=null;return()=>(t==null&&(t=e()),t)}function Dl(e,t){return e.filter(r=>r!==t)}function Tl(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const a=[];return r.forEach(o=>a.push(o)),a}class El{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Tl(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Dl(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Ll{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(n=>{const a=this.config.exposeProperties[n];a!=null&&(r[n]={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 ir="__NATIVE_FILE__",Kn="__NATIVE_URL__",Vn="__NATIVE_TEXT__",Wn="__NATIVE_HTML__",Ts=Object.freeze(Object.defineProperty({__proto__:null,FILE:ir,HTML:Wn,TEXT:Vn,URL:Kn},Symbol.toStringTag,{value:"Module"}));function br(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const _r={[ir]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Wn]:{exposeProperties:{html:(e,t)=>br(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Kn]:{exposeProperties:{urls:(e,t)=>br(e,t,"").split(`
|
|
2
|
+
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Vn]:{exposeProperties:{text:(e,t)=>br(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Al(e,t){const r=_r[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new Ll(r);return n.loadDataTransfer(t),n}function vr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(_r).filter(r=>{const n=_r[r];return n?.matchesTypes?n.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Ol=$n(()=>/firefox/i.test(navigator.userAgent)),Gn=$n(()=>!!window.safari);class Es{interpolate(t){const{xs:r,ys:n,c1s:a,c2s:o,c3s:i}=this;let l=r.length-1;if(t===r[l])return n[l];let d=0,u=i.length-1,p;for(;d<=u;){p=Math.floor(.5*(d+u));const g=r[p];if(g<t)d=p+1;else if(g>t)u=p-1;else return n[p]}l=Math.max(0,u);const h=t-r[l],x=h*h;return n[l]+a[l]*h+o[l]*x+i[l]*h*x}constructor(t,r){const{length:n}=t,a=[];for(let g=0;g<n;g++)a.push(g);a.sort((g,y)=>t[g]<t[y]?-1:1);const o=[],i=[];let l,d;for(let g=0;g<n-1;g++)l=t[g+1]-t[g],d=r[g+1]-r[g],o.push(l),i.push(d/l);const u=[i[0]];for(let g=0;g<o.length-1;g++){const y=i[g],v=i[g+1];if(y*v<=0)u.push(0);else{l=o[g];const b=o[g+1],I=l+b;u.push(3*I/((I+b)/y+(I+l)/v))}}u.push(i[i.length-1]);const p=[],h=[];let x;for(let g=0;g<u.length-1;g++){x=i[g];const y=u[g],v=1/o[g],b=y+u[g+1]-x-x;p.push((x-y-b)*v),h.push(b*v*v)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=p,this.c3s=h}}const _l=1;function Un(e){const t=e.nodeType===_l?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function Rt(e){return{x:e.clientX,y:e.clientY}}function kl(e){var t;return e.nodeName==="IMG"&&(Ol()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Rl(e,t,r,n){let a=e?t.width:r,o=e?t.height:n;return Gn()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function Ml(e,t,r,n,a){const o=kl(t),l=Un(o?e:t),d={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:p}=e,{anchorX:h,anchorY:x}=n,{dragPreviewWidth:g,dragPreviewHeight:y}=Rl(o,t,u,p),v=()=>{let L=new Es([0,.5,1],[d.y,d.y/p*y,d.y+y-p]).interpolate(x);return Gn()&&o&&(L+=(window.devicePixelRatio-1)*y),L},b=()=>new Es([0,.5,1],[d.x,d.x/u*g,d.x+g-u]).interpolate(h),{offsetX:I,offsetY:C}=a,N=I===0||I,w=C===0||C;return{x:N?I:b(),y:w?C:v()}}class Pl{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 Bl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ls(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Bl(e,a,r[a])})}return e}class zl{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,n){return this.sourcePreviewNodeOptions.set(t,n),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const a=i=>this.handleDragStart(i,t),o=i=>this.handleSelectStart(i);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",a),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",a),r.removeEventListener("drop",o)}}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 Ls({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 Ls({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Ts).some(r=>Ts[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Al(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 n;return(n=this.rootElement)===null||n===void 0?void 0:n.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,n){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 o=this.sourceNodes.get(a);return o&&Un(o)||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:o}=this;this.dragStartSourceIds=null;const i=Rt(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,d=vr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const p=this.monitor.getSourceId(),h=this.sourceNodes.get(p),x=this.sourcePreviewNodes.get(p)||h;if(x){const{anchorX:g,anchorY:y,offsetX:v,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),N=Ml(h,x,i,{anchorX:g,anchorY:y},{offsetX:v,offsetY:b});l.setDragImage(x,N.x,N.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(d)this.beginDragNativeItem(d);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 o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,d=vr(l);d&&this.beginDragNativeItem(d,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,o.length>0&&this.actions.hover(o,{clientOffset:Rt(a)}),o.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=Rt(a),this.scheduleHover(o),(o||[]).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 o;a.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}else vr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:Rt(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const o=a.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(a.preventDefault(),o.dragDrop()))},this.options=new Pl(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new El(this.isNodeInDocument)}}const Fl=function(t,r,n){return new zl(t,r,n)},Hl=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:n,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:d,fileSizeError:u,getIsFileFormatError:p,getIsFileSizeError:h})=>{const x=m.useRef(null),g=m.useRef(null),[y,v]=m.useState([]),[b,I]=m.useState(!1),[C,N]=m.useState(!1),w=m.useCallback(M=>{const H=M.target.files;if(H&&H.length>0){const V=Array.from(H),K=p?.(V),Z=h?.(V);K?I(!0):Z?N(!0):e(V)}},[p,h,e]),S=m.useCallback(M=>o&&M?.length>o,[o]),L=m.useMemo(()=>b||C||S(y),[b,C,S,y]),A=()=>{v([]),I(!1),N(!1)},E=m.useMemo(()=>b?s.jsx(Fe,{text:l}):C?s.jsx(Fe,{text:u}):S(y)?s.jsx(Fe,{text:d}):null,[d,l,u,y,S,b,C]);m.useEffect(()=>{A()},[a]);const[{isOver:D,canDrop:j},T]=Hn(()=>({accept:[ir],drop(M){const H=M.files,V=p?.(H)??!1,K=h?.(H)??!1,Z=S?.(H)??!1;if(I(V),N(K),V||K||Z){v(H);return}e(H),A()},collect:M=>({isOver:M.isOver(),canDrop:M.canDrop()})}),[e,p,h,S]),k=M=>{(M.key==="Enter"||M.key==="Space")&&(M.preventDefault(),g.current?.click())},P=M=>{M?.preventDefault();const H=Array.from(M.dataTransfer?.items??[]);I(!!p?.(H)),N(!!h?.(H)),v(H)},_=M=>{M.target===M.currentTarget&&A()},R=re("border border-dashed rounded size-full cursor-pointer relative hover:border-hover",!j&&!L&&"border-primary",j&&(D?"border-accent-primary":"border-hover"),L&&"border-error");return T(x),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:R,ref:x,onDragOver:P,onDragLeave:_,children:[s.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&&s.jsx("p",{className:"mb-1",children:t}),r&&s.jsx("p",{className:"mb-0.5",children:r}),n&&s.jsx(Wr,{appearance:c.ButtonAppearance.Ghost,label:n,onClick:()=>g.current?.click()})]}),s.jsx("input",{multiple:i,id:"file",type:"file",ref:g,hidden:!0,accept:a,onChange:w})]}),s.jsx(s.Fragment,{children:E})]})},$l=({iconBefore:e,className:t,...r})=>{const n=r.invalid,a=()=>s.jsx("div",{className:"mr-2",children:n?s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS,className:"text-error"}):e});return s.jsx(An,{...r,iconBefore:a(),containerClassName:re("h-[40px] p-0",n&&"h-[60px]"),className:re("rounded-r-none border-r-0",n&&"text-error",t)})},Kl=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:n,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:d})=>{const u=m.useRef(null),[p,h]=m.useState(!1),[x,g]=m.useState(!1),[y,v]=m.useState(0),b=m.useCallback(()=>{h(!1),g(!1),v(0)},[]),I=m.useCallback(D=>!!(o&&t.length+D.length>o),[o,t.length]),C=p||x,[{isOver:N,canDrop:w},S]=Hn(()=>({accept:[ir],drop(D){const j=D.files,T=[...t,...j],k=n?.(j)??!1,P=a?.(j)??!1,_=I?.(j)??!1;if(h(k),g(P),k||P||_){v(j.length);return}r(T),b()},collect:D=>({isOver:D.isOver(),canDrop:D.canDrop()})}),[t,r,n,a,I,b]),L=D=>{D.preventDefault();const j=Array.from(D.dataTransfer?.items??[]);h(!!n?.(j)),g(!1),v(j.length)},A=D=>{D.target===D.currentTarget&&b()};S(u);const E=I(Array.from({length:y}));return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{ref:u,onDragOver:L,onDragLeave:A,className:re("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!C&&!E&&(w&&N?"border-accent-primary":"border-primary"),(C||E)&&"border-error"),children:e}),p&&s.jsx(Fe,{text:i}),x&&s.jsx(Fe,{text:l}),!p&&!x&&E&&s.jsx(Fe,{text:d})]})},Zn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:n,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:d,multiFilesSizeError:u,getIsFileFormatError:p,getIsFileSizeError:h,maxFilesCount:x}=e,g=m.useCallback((b,I)=>{b.stopPropagation(),a(t?.filter(C=>C.name!==I)||[])},[a,t]),y=m.useCallback(b=>s.jsx(Ln,{"aria-label":l,onClick:I=>g(I,b)}),[l,g]),v=m.useMemo(()=>s.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((b,I)=>s.jsx($l,{id:b.name,value:b.name,iconAfter:y(b.name),iconBefore:r||n?.(b.name),invalid:o?.(b),error:o?.(b)?i:""},b.name+I))}),[t,r,n,o,i,y]);return s.jsx(el,{backend:Fl,children:!t||t.length===0?s.jsx(Hl,{...e,onChange:a}):s.jsxs(s.Fragment,{children:[s.jsx(Kl,{existingFiles:t,onDrop:a,getIsFileFormatError:p,getIsFileSizeError:h,maxFilesCount:x,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),d?.(t)&&s.jsx(Fe,{text:u})]})})},Vl=({onChange:e,fieldTitle:t,elementId:r,files:n,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:p,multiple:h=!0,acceptTypes:x,deleteAllButtonLabel:g,addButtonLabel:y,additionalActionButtons:v,...b})=>{const I=m.useRef(null),C=()=>I.current?.click(),N=()=>{e([])},w=m.useCallback(E=>E?.some(D=>!(x==="/"||x?.toLowerCase()?.includes(D?.type?.toLowerCase()))),[x]),S=m.useCallback(E=>{if(!o)return!1;const D=o*(1024*1024);return E?.some(j=>{const T=j.size;return!!T&&T>D})},[o]),L=m.useCallback(E=>{if(!i||!h)return!1;const D=i*1024*1024;return E.reduce((T,k)=>T+k.size,0)>D},[i,h]),A=m.useCallback(E=>{const D=E.target.files;if(D&&D.length>0){const j=Array.from(D),T=w(j),k=S(j);!T&&!k&&e([...n||[],...j])}},[w,S,e,n]);return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[s.jsx($r,{label:`${t}: ${h?n?.length||0:""}`,htmlFor:r}),h&&!!n?.length&&s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(Tn,{label:g,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS}),onClick:N}),(a?a>n?.length:!0)&&s.jsx(Wr,{appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconPlus,{...f.BASE_ICON_PROPS}),label:y,onClick:C}),v]})]}),n&&n.length>0&&s.jsx("input",{id:"file",type:"file",multiple:h,ref:I,hidden:!0,accept:x,onChange:A}),s.jsx(Zn,{files:n,onChange:e,acceptTypes:x,maxFilesCount:a,multiple:h,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:p,getIsFileFormatError:w,getIsFileSizeError:S,getIsMultiFilesSizeError:L,...b})]})};var Oe=(e=>(e.Row="Row",e.Column="Column",e))(Oe||{}),We=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(We||{}),it=(e=>(e.Info="info",e.Danger="danger",e))(it||{}),qn=(e=>(e.Normal="normal",e.Reverse="reverse",e))(qn||{}),Ae=(e=>(e.File="file",e.Folder="folder",e))(Ae||{}),It=(e=>(e.Left="left",e.Right="right",e))(It||{}),Q=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e.Loading="loading",e.General="general",e))(Q||{}),fe=(e=>(e.Toast="toast",e.SectionMessage="section-message",e))(fe||{}),qt=(e=>(e.Variant="variant",e.Neutral="neutral",e))(qt||{});const Jr="data-editable-container",Wl={[Jr]:""};function Gl({value:e,isEditing:t,isCreating:r,isLoading:n=!1,restoreOnCancel:a=!0,onValidate:o,onSave:i,onCancel:l,onCreateFolderSave:d,onCreateFolderCancel:u}){const[p,h]=m.useState(e),[x,g]=m.useState(!1),[y,v]=m.useState(""),b=m.useRef(null),I=m.useRef(!1),C=m.useRef(!1),N=m.useCallback((D=!1,j="")=>{g(D),v(j)},[]),w=m.useCallback(D=>{if(!o)return N(),!0;const j=o(D);return j?j.startsWith(`${Q.Warning}__`)?(N(!1,j),!0):(N(!0,j),!1):(N(),!0)},[o,N]),S=m.useCallback(D=>{const j=D??"";h(j),w(j)},[w]),L=m.useCallback(D=>{r&&!I.current&&!n?d?.(D):!r&&t&&i?.(D),I.current=!1},[i,d,r,t,n]),A=m.useCallback(()=>{a&&h(e),r?u?.():l?.(),I.current=!0,N()},[e,l,a,N,u,r]),E=m.useCallback(()=>{if(!C.current){if(C.current=!0,w(p)){L(p);return}!r&&w(e)?(h(e),N(),L(e)):A()}},[w,p,e,L,A,N,r]);return m.useEffect(()=>{!t&&!r||(I.current=!1,C.current=!1,h(e),N(),requestAnimationFrame(()=>{b.current?.focus(),b.current?.select()}))},[t,r,e,N]),m.useEffect(()=>{const D=b.current;if(!t&&!r||!D)return;const j=T=>{T.key==="Enter"?(T.preventDefault(),b.current?.blur()):T.key==="Escape"&&(T.preventDefault(),A())};return D.addEventListener("keydown",j),()=>D.removeEventListener("keydown",j)},[t,r,A]),m.useEffect(()=>{if(!t&&!r||n)return;const D=b.current;if(!D)return;const j=P=>P?(D.closest(`[${Jr}]`)??D).contains(P):!1,T=P=>{j(P.target)||E()},k=P=>{j(P.relatedTarget)||E()};return document.addEventListener("pointerdown",T,!0),D.addEventListener("blur",k),()=>{document.removeEventListener("pointerdown",T,!0),D.removeEventListener("blur",k)}},[t,r,n,E]),{inputRef:b,value:p,onChange:S,invalid:x,invalidMessage:y}}var be=(e=>(e.VALID="valid",e.ERROR="error",e))(be||{}),ze=(e=>(e.ITEM="item",e.FOLDER="folder",e))(ze||{}),es=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(es||{}),Yn=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(Yn||{});const Ul="application/octet-stream";function Zl(e,t){if(!e||e.length===0)return[];const r=e.find(d=>d.parentPath===""&&d.nodeType==="FOLDER");if(!r)return[];const n=r.path||r.url||"",a=yr(n,!0),o=e.filter(d=>d!==r).map(d=>{const u=d.path||d.url||"",p=ql(d.nodeType),h=p===ze.FOLDER,x=yr(u,h);let g;return d.parentPath===null||d.parentPath===void 0?g=a:d.parentPath===""?g="":g=yr(d.parentPath,!0),{...d,originalPath:u,path:x,parentPath:g,nodeType:p}}),i=new Map;o.forEach(d=>{const u={...d,id:d.originalPath,name:d.name,path:d.path,parentPath:d.parentPath,nodeType:d.nodeType,resourceType:Yl(d.resourceType),folderId:t,updatedAt:d.updatedAt?new Date(d.updatedAt).toISOString():new Date().toISOString(),items:d.nodeType===ze.FOLDER?[]:void 0};d.nodeType===ze.ITEM&&(u.extension=Xl(d.name),u.contentType=d.contentType||Ul,u.contentLength=d.contentLength||0),i.set(d.path,u)});const l=[];return i.forEach(d=>{if(d.parentPath===a)l.push(d);else{const u=d.path.lastIndexOf(d.name||""),p=d.path.slice(0,u),h=i.get(p);h&&h.nodeType===ze.FOLDER?(h.items=h.items||[],h.items.push(d)):l.push(d)}}),l}function yr(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 ql(e){return e.toUpperCase()==="FOLDER"?ze.FOLDER:ze.ITEM}function Yl(e){if(!e)return;const t=e.toUpperCase();return Object.values(es).find(n=>n.toUpperCase()===t)}function Xl(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function Ql(e,t="Prompts",r="prompts/public/",n="root"){const a=Zl(e,n);return[{id:n,name:t,path:r,parentPath:"",nodeType:ze.FOLDER,folderId:n,items:a}]}const Xn=({locale:e,timeZone:t,date:r=new Date}={})=>{const n=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:n,timeZoneName:"longOffset"}).formatToParts(r).find(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${n}`:n}catch{return n}},Qn=':;,=/{}%&\\"',ts=`(\r
|
|
3
3
|
|
|
|
4
|
-
|\r| )|[\0-]`,Jl=`[${Qn.replace(/\\/g,"\\\\")}]`,ec=new RegExp(`${Jl}|${ts}`),tc=new RegExp(ts);var nt=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(nt||{}),lr=(e=>(e.Select="select",e.Radio="radio",e))(lr||{}),cr=(e=>(e.Row="row",e.Column="column",e))(cr||{}),$=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))($||{});const rc={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"};function As(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function Q(e,t,r=0){if(r>10)return e;let n=e;if(n.$ref){const a=n.$ref.replace(/^#\//,"").split("/");let o=t;for(const h of a)o=o?.[h];if(!o||typeof o!="object")return e;const{$ref:i,...l}=n,d=o;n={...d.$ref?Q(d,t,r+1):d,...l}}if(n.allOf&&n.allOf.length>0){const{allOf:a,...o}=n;let i={};for(const l of a)i=As(i,Q(l,t,r+1));n=As(i,o)}return n}function Jn(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const n=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return n!==a?n-a:t.index-r.index}).map(({entry:t})=>t)}function dr(e){return e==null||e===""}function Ye(e){return e.type===$.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function Yt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const rs=e=>`"${e}" is required`;function ea(e,t){return e.type===$.Null?"null":e.$ref?Q(e,t).title??e.$ref.split("/").pop()??"Option":e.title?e.title:e.type?Array.isArray(e.type)?e.type.join(" | "):e.type:e.discriminator?Object.keys(e.discriminator.mapping).join(" | "):e.const!=null?String(e.const):e.oneOf?"One of options":"Option"}function He(e,t,r=0){if(r>15)return;const n=Q(e,t);if("default"in n)return n.default;if(n.discriminator&&n.oneOf){const a=Object.keys(n.discriminator.mapping)[0];if(a){const o=Q({$ref:n.discriminator.mapping[a]},t);return{...He(o,t,r+1)??{},[n.discriminator.propertyName]:a}}}if(Ye(n)){if(n.properties){const a={};let o=!1;for(const[i,l]of Object.entries(n.properties)){const d=He(l,t,r+1);d!==void 0&&(a[i]=d,o=!0)}return o?a:void 0}if(n.additionalProperties!=null&&n.additionalProperties!==!1)return{}}}function Be(e,t,r,n="",a=0){if(a>15)return[];const o=[],i=Q(t,r);if(i.anyOf){const u=i.anyOf.filter(h=>h.type!==$.Null);return e!=null&&u.length===1?Be(e,u[0],r,n,a+1):o}if(i.oneOf&&i.discriminator){const u=i.discriminator.propertyName,h=e?.[u];if(h&&i.discriminator.mapping[h]){const p={$ref:i.discriminator.mapping[h]},g=Q(p,r);return Be(e,g,r,n,a+1)}return o}if(i.type===$.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let u=0;u<e.length;u++){const h=Be(e[u],i.items,r,`${n}[${u}]`,a+1);o.push(...h)}return o}if(!Ye(i))return o;const l=i.required??[],d=e;for(const u of l){const h=i.properties?.[u];if(h&&Q(h,r).isHidden)continue;const p=n?`${n}.${u}`:u,g=d?.[u];if(dr(g)){const x=h?.title??Yt(u);o.push({path:p,message:rs(x)})}}if(d&&i.properties)for(const[u,h]of Object.entries(i.properties)){if(Q(h,r).isHidden)continue;const p=n?`${n}.${u}`:u,g=d[u];if(g!=null){const x=Be(g,h,r,p,a+1);o.push(...x)}}if(d&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const u=i.additionalProperties;for(const[h,p]of Object.entries(d)){const g=n?`${n}.${h}`:h,x=Be(p,u,r,g,a+1);o.push(...x)}}return o}function ss(e,t,r){const n=Q(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ye(n)&&n.properties){const a=Object.entries(n.properties).filter(([,d])=>!Q(d,r).isHidden),o=a.length,i=e;return`${a.filter(([d])=>{const u=i?.[d];return u!=null&&u!==""}).length}/${o} fields`}return""}function sc(e,t,r){if(e==null){const n=t.findIndex(a=>a.type===$.Null);return n>=0?n:0}if(Array.isArray(e)){const n=t.findIndex(a=>Q(a,r).type===$.Array);return n>=0?n:0}if(typeof e=="boolean"){const n=t.findIndex(a=>Q(a,r).type===$.Boolean);return n>=0?n:0}if(typeof e=="number"){const n=t.findIndex(a=>{const o=Q(a,r);return o.type===$.Number||o.type===$.Integer});return n>=0?n:0}if(typeof e=="string"){const n=t.findIndex(a=>Q(a,r).type===$.String);return n>=0?n:0}if(typeof e=="object"){const n=e;for(let a=0;a<t.length;a++){const o=Q(t[a],r);if(o.discriminator&&o.discriminator.propertyName in n)return a}for(let a=0;a<t.length;a++){const o=Q(t[a],r);if(Ye(o)||o.oneOf)return a}return 0}return 0}function nc(e,t,r){if(t&&typeof e=="object"&&e!==null){const n=e[t];if(n)return`Item ${r+1}: ${n}`}if(typeof e=="object"&&e!==null){const n=e,a=n.name??n.title??n.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function ta(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 ac=[$.String,$.Number,$.Boolean,$.Null,$.Object,$.Array];function oc(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 ic={[$.String]:"",[$.Number]:0,[$.Boolean]:!1,[$.Null]:null,[$.Object]:{},[$.Array]:[]};function lc(e){return ic[e]}const ra=m.createContext(null),ke=()=>{const e=m.useContext(ra);if(!e)throw new Error("useSchemaContext must be used inside SchemaRenderer");return e},St=(e,t=new Set,r=!1,n=!1)=>{if(!r||t.has(e))return!0;if(!n)return!1;const a=e+".";return[...t].some(o=>o.startsWith(a))},sa=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:n})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+n;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+r>e;)o--,a-=t[o]+n;return o};var Se=(e=>(e.Outlined="outlined",e.Selectable="selectable",e.Bordered="bordered",e))(Se||{});const na="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",cc={[Se.Outlined]:"dial-tiny-text",[Se.Selectable]:"dial-tiny-text",[Se.Bordered]:"h-[24px] rounded-md border px-2 dial-small-text"},aa={[Se.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Se.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"},[Se.Bordered]:{default:"border-tertiary bg-layer-sunken text-primary",selected:"border-accent bg-control-accent-alpha text-primary"}},oa="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",ia="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Le=({label:e,icon:t,appearance:r=Se.Outlined,selected:n=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:d,onClick:u,onRemove:h,onKeyDown:p,...g})=>{const x=r===Se.Selectable,y=!!u&&!a,v=o&&!!h&&!a,b=x&&n,C=I=>{p?.(I),!(!y||I.defaultPrevented)&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.currentTarget.click())};return s.jsxs("span",{...g,role:y?"button":g.role,tabIndex:y?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":x&&y?n:void 0,onClick:a?void 0:u,onKeyDown:C,className:f.mergeClasses(na,b?"dial-tiny-semi-text":cc[r],aa[r][n?"selected":"default"],a&&"cursor-not-allowed",y&&[oa,ia],l,c.DIAL_KIT_CLASS.tag),children:[t&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),s.jsx("span",{className:"truncate",title:d??e,children:e}),v&&s.jsx(c.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:c.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:I=>{I.stopPropagation(),h?.(I)}})]})},Xt="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",yt=({options:e,selectedValues:t,handleRemoveTag:r,tagClassName:n})=>s.jsx(s.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return s.jsx(Le,{label:o?.label??a,closable:!!r,onRemove:i=>r?.(i,a),icon:o?.icon,className:f.mergeClasses(Xt,n)},a)})}),dc=8,uc=e=>e.stopPropagation(),fc=e=>{e.key!=="Escape"&&e.stopPropagation()},pc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const n=m.useRef(null),a=m.useRef(null),[o,i]=m.useState(null),l=m.useCallback(()=>{const p=n.current,g=a.current;if(!p||!g)return;const x=Array.from(g.children,v=>v.offsetWidth),y=x.pop()??0;i(sa({tagWidths:x,overflowChipWidth:y,availableWidth:p.clientWidth,gap:dc}))},[]);m.useLayoutEffect(()=>{l()},[l,e,t]),m.useLayoutEffect(()=>{const p=n.current;return p?c.observeElementSize(p,l):void 0},[l]);const d=o??t.length,u=t.slice(0,d),h=t.slice(d);return s.jsxs("div",{ref:n,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[s.jsx(yt,{options:e,selectedValues:u,handleRemoveTag:r,tagClassName:"min-w-0"}),h.length>0&&s.jsx(c.InteractiveTooltip,{asChild:!0,placement:c.TooltipPlacement.Bottom,content:s.jsx("div",{className:"flex flex-wrap gap-2",onClick:uc,onKeyDown:fc,children:s.jsx(yt,{options:e,selectedValues:h,handleRemoveTag:r})}),children:s.jsx(Le,{label:`+${h.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${h.length} more selected: ${h.map(p=>e.find(g=>g.value===p)?.label??p).join(", ")}`,title:"",className:f.mergeClasses(Xt,"shrink-0")})}),s.jsxs("div",{ref:a,"aria-hidden":"true",inert:!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 w-max gap-2 overflow-hidden",children:[s.jsx(yt,{options:e,selectedValues:t,handleRemoveTag:r,tagClassName:"shrink-0"}),s.jsx(Le,{label:`+${t.length}`,className:f.mergeClasses(Xt,"shrink-0")})]})]})},hc=f.mergeClasses("w-full flex flex-col"),mc=c.overlayItemClassName,gc="!max-w-[var(--reference-width)]",xc=f.mergeClasses("max-h-[344px] overflow-y-auto py-1",c.overlayListClassName),bc=c.overlayGap,vc=c.overlaySubMenuListClassName,yc=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Cc="text-secondary transition-transform",Ic=8,Sc=s.jsx(F.IconSearch,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Nc=s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),wc=({opt:e,selectedValues:t,mark:r=c.MenuItemMark.Tint,onSelect:n})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:d,getReferenceProps:u,getFloatingProps:h}=c.useSubMenuFloating(bc,"listbox",!!e.disabled),p=e.children?.some(x=>t.includes(x.value)),g=s.jsx(c.MenuItem,{ref:i.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:yc,...u()});return s.jsxs(B.FloatingNode,{id:o,children:[e.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&s.jsx(c.SubMenuPanel,{refs:i,floatingStyles:l,context:d,getFloatingProps:h,role:"listbox",surfaceClassName:vc,children:e.children.map(x=>{const y=s.jsx(c.MenuItem,{role:"option","aria-selected":t.includes(x.value),"aria-disabled":!!x.disabled,disabled:x.disabled,mark:r,selected:t.includes(x.value),ellipsisLabel:!0,icon:x.icon,label:x.labelNode??x.label,rightControl:x.rightControl,onClick:()=>!x.disabled&&n(x.value)});return s.jsx(m.Fragment,{children:x.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:x.interactiveTooltip.placement,content:x.interactiveTooltip.content,contentClassName:x.interactiveTooltip.contentClassName,children:y}):y},x.value)})})]})},$e=({options:e,multiple:t=!1,id:r,value:n,defaultValue:a,size:o=c.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:d="Select...",labelProps:u,error:h,caption:p,ariaLabel:g,ariaDescribedBy:x,searchable:y=!1,searchSize:v=c.ElementSize.Standard,searchPlaceholder:b,selectAll:C=!1,invalid:I,selectAllLabel:S="Select all",collapseTagOverflow:w=!1,selectedOptionMark:N=c.MenuItemMark.Tint,emptyStateTitle:L="No options available",emptyStateDescription:A,emptyStateIcon:T,disabled:j=!1,className:D,fieldClassName:E,listClassName:k,closable:P=!1,header:O,footer:R,onClose:M,onChange:H,dismissRef:W,onFooterClick:K,open:V,onOpenChange:G,onSearchQueryChange:ee,customMultiSelectTagsRenderer:re})=>{const q=m.useId(),Y=r||q,se=`list-${Y}`,le=h?`${Y}-error`:void 0,oe=!h&&p?`${Y}-caption`:void 0,me=o===c.ElementSize.Small,[ve,_]=m.useState(!1),U=V!==void 0,de=U?!!V:ve,ne=m.useCallback(z=>{U||_(z),G?.(z)},[U,G]),[ge,Qe]=m.useState(""),ft=m.useCallback(z=>{z!==ge&&(Qe(z||""),ee?.(z||""))},[ee,ge]),pt=n!==void 0,[J,ce]=m.useState(a),he=pt?n:J,ue=m.useMemo(()=>t?Array.isArray(he)?he:[]:typeof he=="string"?[he]:[],[he,t]),Lt=m.useMemo(()=>{const z=ge.trim().toLowerCase();return z?e.filter(ae=>ae.label.toLowerCase().includes(z)):e},[e,ge]);m.useEffect(()=>{de||ft("")},[de,ft]);const Re=m.useCallback(z=>{pt||ce(z),H?.(z)},[pt,H]),ur=m.useCallback(z=>{if(t){const ae=new Set(ue);ae.has(z)?ae.delete(z):ae.add(z),Re(Array.from(ae));return}Re(z),ne(!1)},[t,Re,ne,ue]),At=m.useCallback((z,ae)=>{if(z.stopPropagation(),!t){Re("");return}const kt=ue.filter(Va=>Va!==ae);Re(kt)},[t,ue,Re]),De=m.useMemo(()=>Lt.filter(z=>!z.disabled),[Lt]),fr=m.useMemo(()=>De.filter(z=>ue.includes(z.value)).length,[De,ue]),{allSelectedInFiltered:pr,someSelectedInFiltered:Ma}=m.useMemo(()=>{const z=De.length>0&&fr===De.length;return{allSelectedInFiltered:z,someSelectedInFiltered:fr>0&&!z}},[De,fr]),Pa=m.useCallback(()=>{if(!(!t||De.length===0))if(pr){const z=new Set(De.map(ae=>ae.value));Re(ue.filter(ae=>!z.has(ae)))}else{const z=new Set(ue);De.forEach(ae=>z.add(ae.value)),Re(Array.from(z))}},[pr,t,De,ue,Re]),Ot=ue.length>0,_t=!t&&Ot?ue[0]:void 0,Ne=m.useMemo(()=>_t?e.find(z=>z.value===_t)??e.flatMap(z=>z.children??[]).find(z=>z.value===_t):void 0,[e,_t]),ht=Ne?i?`${i} ${Ne.label}`:Ne.label:void 0,Ba=c.useIsMobileScreen(),hr=t&&w&&!re&&!Ba,mt=m.useMemo(()=>t?Ot?hr?s.jsx(pc,{options:e,selectedValues:ue,handleRemoveTag:At}):s.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:re?.(e,ue,At)??s.jsx(yt,{options:e,selectedValues:ue,handleRemoveTag:At})}):null:!Ne||!Ne.labelNode&&!Ne.description?null:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.jsx(c.EllipsisTooltip,{text:Ne.labelNode??ht}),Ne.description&&s.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:Ne.description})]}),[hr,re,At,Ot,t,e,ht,ue,Ne]),za=t||mt?"":ht||(l&&n?l:""),Fa=typeof u?.label=="string"?u.label:void 0,Ha=mt?[c.resolveAccessibleName(g,Fa),t?ue.map(z=>e.find(ae=>ae.value===z)?.label??z).join(", "):ht].filter(Boolean).join(", ")||void 0:c.resolveAccessibleName(g);m.useImperativeHandle(W,()=>({dismiss:()=>{ne(!1)}}));const $a=m.useCallback(z=>{j||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),de||ne(!0))},[j,de,ne]),Ka=()=>s.jsxs("div",{id:se,role:"listbox","aria-multiselectable":t||void 0,className:hc,children:[O&&s.jsx(s.Fragment,{children:typeof O=="function"?O():O}),(y||P)&&(e.length>Ic||!!ge)&&s.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[y&&s.jsx(c.Input,{id:`search-${Y}`,size:v,placeholder:b,"aria-label":b||"Search options",onChange:z=>ft(z),value:ge,iconBefore:Sc,containerClassName:"w-full"}),P&&s.jsx(c.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:c.ElementSize.Small,icon:Nc,onClick:z=>{M?.(z),ne(!1)}})]}),t&&C&&De.length>0&&s.jsx("div",{className:f.mergeClasses(mc,"mt-2"),children:s.jsx(c.Checkbox,{id:`${Y}-selectAll`,labelProps:{label:S},isSelected:pr,isIndeterminate:Ma,onChange:Pa})}),s.jsx("div",{role:"none",className:xc,children:Lt.length===0?s.jsx("div",{className:"px-2 py-3",children:s.jsx(c.NoDataContent,{icon:T,title:L,description:A})}):Lt.map(z=>{const ae=ue.includes(z.value);if(z.children?.length)return s.jsx(wc,{opt:z,selectedValues:ue,mark:t?c.MenuItemMark.Checkbox:N,onSelect:ur},z.value);const kt=t?s.jsx(c.MenuItem,{id:`${Y}-${z.value}`,role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:c.MenuItemMark.Checkbox,selected:ae,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>ur(z.value)}):s.jsx(c.MenuItem,{role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:N,selected:ae,ellipsisLabel:!0,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>!z.disabled&&ur(z.value)});return s.jsx(m.Fragment,{children:z.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:z.interactiveTooltip.placement,content:z.interactiveTooltip.content,contentClassName:z.interactiveTooltip.contentClassName,children:kt}):kt},z.value)})}),R&&s.jsx("div",{onClick:z=>{K?.(z),K&&ne(!1)},children:typeof R=="function"?R():R})]});return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",D,c.DIAL_KIT_CLASS.select),children:[u&&s.jsx(c.Label,{...u,htmlFor:Y}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(c.Dropdown,{open:de,onOpenChange:ne,disabled:j,closable:P,onClose:M,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:f.mergeClasses(gc,k),className:"w-full",renderOverlay:Ka,children:s.jsx(c.Input,{id:Y,size:o,disabled:j,invalid:I,value:za,placeholder:mt?void 0:d,readOnly:!0,iconBefore:t?void 0:Ne?.icon,iconAfter:s.jsx(F.IconChevronDown,{size:me?f.DIAL_ICON_SIZE.SM:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses(Cc,de&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":de,"aria-controls":se,"aria-autocomplete":"none","aria-label":Ha,"aria-describedby":[x,le,oe].filter(Boolean).join(" ")||void 0,"aria-invalid":h||I?!0:void 0,containerClassName:"w-full",wrapperClassName:f.mergeClasses(!j&&"cursor-pointer",t&&Ot&&!hr&&["!h-auto flex-wrap py-2",me?"min-h-[24px]":"min-h-[40px]"],E),className:f.mergeClasses("cursor-pointer",mt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:$a,children:mt})}),s.jsx(c.ErrorText,{id:le,text:h}),!h&&s.jsx(c.CaptionText,{id:oe,text:p})]})]})},Os={[$.Array]:[],[$.String]:"",[$.Boolean]:!1,[$.Integer]:0,[$.Number]:0},jc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=ke(),u=e.anyOf??[],h=sc(t,u,i),p=u[h],g=!p||Q(p,i).type===$.Null,x=y=>{const v=Q(u[y],i);if(v.type===$.Null){r(null);return}const b=He(v,i);if(b!==void 0){r(b);return}const C=typeof v.type=="string"?v.type:"";r(C in Os?Os[C]:{})};return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:o??l.selectTypePlaceholder,options:u.map((y,v)=>({value:String(v),label:ea(y,i)})),value:String(h),disabled:d,onChange:y=>x(Number(typeof y=="string"?y:y[0])),className:"max-w-[280px]"}),!g&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(Ke,{schema:p,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},Xe=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:d="button",tooltipProps:u,href:h,target:p,rel:g,disabled:x,...y})=>{const v=f.mergeClasses("dial-kit-base-button",t&&c.getButtonClassNames(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",n===c.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",n===c.ElementSize.Small&&"dial-kit-base-button-small",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"px-2":"px-4"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),b=e?void 0:u?.tooltip,C=c.resolveAccessibleName(typeof e=="string"?e:void 0,y["aria-label"],b),I=s.jsxs(s.Fragment,{children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:o,children:e}),s.jsx(c.DialIcon,{icon:i})]}),S=y,w=h!==void 0?s.jsx("a",{...S,href:x?void 0:h,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":x||void 0,tabIndex:x?-1:S.tabIndex,onClick:x?void 0:S.onClick,className:v,"aria-label":C,children:I}):s.jsx("button",{...y,...c.getDisabledButtonProps(x,u,y.onClick),type:d,className:v,"aria-label":C,children:I});return u?s.jsx(c.Tooltip,{asChild:!0,...u,children:w}):w},ns=(e,t)=>({appearance:n,...a})=>s.jsx(Xe,{...a,variant:e,appearance:n||t}),as=(e,t)=>({variant:n,...a})=>s.jsx(Xe,{...a,variant:n||t,appearance:e}),la=ns(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),os=ns(c.ButtonVariant.Neutral,c.ButtonAppearance.Solid),Dc=ns(c.ButtonVariant.Danger,c.ButtonAppearance.Solid),tt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},Tc=s.jsx(F.IconSparkles,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),Ec=({appearance:e=c.ButtonAppearance.Outlined,iconBefore:t=Tc,iconAfter:r,style:n,...a})=>{const o=`dial-kit-starter-gradient-${m.useId().replace(/[^\w-]/g,"")}`,i=s.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:s.jsx("defs",{children:s.jsxs("linearGradient",{id:o,x1:tt.x1,y1:tt.y1,x2:tt.x2,y2:tt.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:tt.from}),s.jsx("stop",{offset:"1",stopColor:tt.to})]})})}),l=d=>s.jsxs(s.Fragment,{children:[i,d]});return s.jsx(Xe,{...a,variant:c.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:r&&!t?l(r):r,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...n}})},Lc=as(c.ButtonAppearance.Link,c.ButtonVariant.Primary),is=as(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Ac=as(c.ButtonAppearance.Outlined,c.ButtonVariant.Neutral),Nt=({title:e,description:t,summary:r,errorCount:n=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:d="Remove item"})=>{const[u,h]=m.useState(l),p=m.useId(),g=a===0;return s.jsxs("div",{className:f.mergeClasses("flex flex-col border border-tertiary",g?"rounded-xl bg-layer-raised":"rounded-lg",c.DIAL_KIT_CLASS.schemaRendererSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center gap-2",g?"px-4 py-3":"px-3 py-2"),children:[s.jsxs("button",{type:"button","aria-expanded":u,"aria-controls":u?p:void 0,onClick:()=>h(x=>!x),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-left text-primary focus-visible:outline focus-visible:outline-focus",children:[s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform",!u&&"-rotate-90")}),s.jsx("span",{className:f.mergeClasses("truncate",g?"dial-small-semi-text":"dial-small-text"),children:e})]}),s.jsx(c.InfoButton,{caption:t}),r&&s.jsx("span",{className:"dial-tiny-text whitespace-nowrap text-secondary",children:r}),n>0?s.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap dial-tiny-text text-error",children:[s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0"}),n," error",n>1?"s":""]}):s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0 text-success"}),i&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":d,onClick:i,className:"shrink-0"})]}),u&&s.jsx("div",{id:p,className:f.mergeClasses("border-t border-tertiary",g?"p-4":"p-3"),children:o})]})},Oc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:d=!0}=ke(),[u,h]=m.useState(),p=Array.isArray(t)?t:[],g=e.items;if(!g)return s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemSchema});const x=Q(g,o),y=x.discriminator,v=y?Object.keys(y.mapping).map(w=>({value:w,label:w})):[],b=u??v[0]?.value,C=()=>{let w;if(y&&b){const N=Q({$ref:y.mapping[b]},o);w={...He(N,o)??{},[y.propertyName]:b}}else w=He(x,o)??ta(x);r([...p,w])},I=w=>{r(p.filter((N,L)=>L!==w))},S=(w,N)=>{r(p.map((L,A)=>A===w?N:L))};return s.jsxs("div",{className:"flex flex-col gap-3",children:[p.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemsYet}),p.map((w,N)=>{const L=nc(w,y?.propertyName,N),A=Be(w,x,o,`${n.join(".")}[${N}]`);return s.jsx(Nt,{title:L,level:a,summary:ss(w,x,o),errorCount:A.length,onRemove:l?void 0:()=>I(N),defaultExpanded:d,removeItemAriaLabel:`${i.removeItemAriaLabel}: ${L}`,children:s.jsx(Ke,{schema:g,value:w,onChange:T=>S(N,T),path:[...n,String(N)],level:a+1,ariaLabel:L})},N)}),!l&&s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[v.length>0&&s.jsx($e,{ariaLabel:i.selectTypeToAdd,options:v,value:b,placeholder:i.selectTypeToAdd,onChange:w=>h(typeof w=="string"?w:w[0]),className:"max-w-[280px] flex-1"}),s.jsx(is,{label:i.addItem,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C})]})]})};var ls=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(ls||{});const _s={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},_c=e=>typeof e=="boolean"?_s[e?"both":"none"]:_s[e],ca=({className:e="",value:t,onChange:r,error:n,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:d,invalid:u,"aria-describedby":h,"aria-invalid":p,...g})=>{const x=m.useId(),y=d??x,v=n?`${y}-error`:void 0,b=!n&&l?`${y}-caption`:void 0,C=f.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",u&&"dial-kit-input-error",g.disabled&&"dial-kit-input-disable",_c(o),e);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",a),children:[i&&s.jsx(c.Label,{...i,htmlFor:y}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("textarea",{id:y,value:t||"",className:C,onChange:I=>r?.(I.currentTarget.value),"aria-describedby":[h,v,b].filter(Boolean).join(" ")||void 0,"aria-invalid":p??(n||u?!0:void 0),...g}),s.jsx(c.ErrorText,{id:v,text:n}),!n&&s.jsx(c.CaptionText,{id:b,text:l})]})]})},ks=e=>{try{return JSON.parse(e),!0}catch{return!1}},cs=({value:e,onChange:t,id:r,ariaLabel:n})=>{const{readonly:a,texts:o}=ke(),[i,l]=m.useState(()=>JSON.stringify(e,null,2)??""),d=!ks(i),u=h=>{l(h),ks(h)&&t(JSON.parse(h))};return s.jsx(ca,{id:r,"aria-label":n,value:i,onChange:u,readOnly:a,invalid:d,error:d?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:ls.Vertical,className:"font-mono !whitespace-pre"})},kc=/^0+\.(\d+)?$/,Rc=/^0+/,Mc=[".","-","+","e","E"],Rs=e=>!e||e==="-"?e:String(e).match(kc)?String(e).replace(Rc,"0"):Number(e),ds=({integer:e,onChange:t,min:r,max:n,onKeyDown:a,onPaste:o,...i})=>{const l=u=>{if(e&&Mc.includes(u.key)){u.preventDefault();return}c.handleKeyDown(u,"number",r,n),a?.(u)},d=u=>{if(e){const h=u.clipboardData.getData("text"),p=h.replace(/\D/g,"");if(p!==h&&(u.preventDefault(),p)){const g=u.currentTarget,x=g.selectionStart??0,y=g.selectionEnd??0,v=g.value.slice(0,x)+p+g.value.slice(y);t?.(Rs(v))}}o?.(u)};return s.jsx(c.Input,{...i,wrapperClassName:f.mergeClasses(i.wrapperClassName,c.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:n,onChange:u=>t?.(Rs(u)),onKeyDown:l,onPaste:d})},da=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,isToggleHidden:n,size:a=c.ElementSize.Standard,...o})=>{const[i,l]=m.useState(!1),d=!r&&!n,u=i&&d;return m.useEffect(()=>{d||l(!1)},[d]),s.jsx(c.Input,{...o,wrapperClassName:f.mergeClasses(o.wrapperClassName,c.DIAL_KIT_CLASS.passwordInput),size:a,disabled:r,type:u?"text":"password",iconAfter:d?s.jsx(c.GhostIconButton,{size:c.ElementSize.Small,"aria-label":u?t:e,"aria-pressed":u,icon:u?s.jsx(F.IconEyeOff,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconEye,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>l(h=>!h)}):void 0})},Pc="flex flex-col gap-2",Bc="flex",zc="mt-2 ml-[26px]",Fc={[Oe.Column]:"flex-col gap-y-3",[Oe.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},wt=({items:e,value:t,onChange:r,name:n,id:a,orientation:o=Oe.Column,labelProps:i,disabled:l,error:d,caption:u,ariaLabel:h,className:p,optionsClassName:g,radioClassName:x,contentClassName:y})=>{const v=m.useId(),b=a??v,C=`${b}-label`,I=d?`${b}-error`:void 0,S=!d&&u?`${b}-caption`:void 0,w=c.resolveAccessibleName(i?.label);return s.jsxs("div",{className:f.mergeClasses(Pc,p,c.DIAL_KIT_CLASS.radioGroup),children:[i&&s.jsx(c.Label,{...i,id:C}),s.jsx("div",{role:"radiogroup","aria-labelledby":w?C:void 0,"aria-label":w?void 0:c.resolveAccessibleName(h),"aria-describedby":[I,S].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:f.mergeClasses(Bc,Fc[o],g),children:e.map(N=>{const L=N.value===t;return s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx(c.Radio,{id:`${b}-${N.value}`,name:n??b,value:N.value,labelProps:N.label==null?void 0:{label:N.label},"aria-label":N["aria-label"],caption:N.caption,isSelected:L,disabled:l||N.disabled,onChange:r,className:x}),L&&N.content?s.jsx("div",{className:f.mergeClasses(zc,y),children:N.content}):null]},N.value)})}),s.jsx(c.ErrorText,{id:I,text:d}),!d&&s.jsx(c.CaptionText,{id:S,text:u})]})},ua=({id:e,labelProps:t,isOn:r=!1,disabled:n,onChange:a,caption:o,className:i,...l})=>{const d=m.useId(),u=e??d,h=o?`${u}-caption`:void 0,p=m.useCallback(g=>{a?.(g.target.checked)},[a]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("group/choice flex items-center gap-2",i,c.DIAL_KIT_CLASS.switch),children:[s.jsx("input",{...l,type:"checkbox",role:"switch",id:u,checked:r,"aria-checked":r,disabled:n,onChange:p,"aria-label":c.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":h,className:"peer sr-only"}),s.jsx("label",{htmlFor:u,className:f.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",n?"cursor-not-allowed bg-control-disable-primary":f.mergeClasses("cursor-pointer",r?"bg-control-accent group-has-[label:hover]/choice:bg-control-accent-hover":"bg-control-neutral-default group-has-[label:hover]/choice:bg-control-neutral-hover-strong")),children:s.jsx("span",{className:f.mergeClasses("size-3.5 shrink-0 rounded-full",n?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&s.jsx(c.Label,{size:c.ElementSize.Standard,...t,htmlFor:u,className:f.mergeClasses("py-[1px]",n?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&s.jsx("span",{id:h,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},Ms=e=>typeof e=="string"?e:e[0],Cr=e=>e!=null?String(e):"",Hc=e=>e!==void 0?Number(e):void 0,fa=({schema:e,value:t,onChange:r,invalid:n,id:a,ariaLabel:o,ariaDescribedBy:i})=>{const{texts:l,readonly:d=!1,inputClassName:u,acceptableResourceTypes:h}=ke(),p=e.const!==void 0,g=Array.isArray(e.enum)?e.enum:[],x=g.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===$.String||e.type===void 0)){const v=(e.acceptableResourceTypes??[]).flatMap(b=>{const C=h?.[b];return Array.isArray(C)?C.map(I=>{const S=String(I);return{value:S,label:S}}):[]});return s.jsx($e,{id:a,ariaLabel:o,ariaDescribedBy:i,options:v,value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:b=>r(Ms(b)),placeholder:l.enumSelectPlaceholder,className:u})}if(p)return s.jsx(c.Input,{id:a,"aria-label":o,value:String(e.const??""),disabled:!0,containerClassName:u});if(x&&e.enumDisplay===lr.Radio)return s.jsx(wt,{id:a,ariaLabel:o,items:g.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,orientation:e.enumOrientation===cr.Row?Oe.Row:Oe.Column,disabled:d,onChange:v=>r(v)});if(x)return s.jsx($e,{id:a,ariaLabel:o,ariaDescribedBy:i,options:g.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:v=>r(Ms(v)),placeholder:l.enumSelectPlaceholder,className:u});switch(e.type){case $.Boolean:return s.jsx(ua,{id:a,"aria-label":o,isOn:!!t,disabled:d,onChange:v=>r(v)});case $.Integer:case $.Number:return s.jsx(ds,{id:a,"aria-label":o,"aria-describedby":i,integer:e.type===$.Integer,value:Cr(t),invalid:n,disabled:d,onChange:v=>r(Hc(v)),placeholder:e.type===$.Integer?l.integerInputPlaceholder:l.numberInputPlaceholder,containerClassName:u});default:return e.isProtected?s.jsx(da,{id:a,"aria-label":o,"aria-describedby":i,value:Cr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u}):s.jsx(c.Input,{id:a,"aria-label":o,"aria-describedby":i,value:Cr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u})}},Ps=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),pa=e=>!!(e.oneOf||e.anyOf||e.type===$.Array||Ye(e)),$c={[$.String]:"entryTypeString",[$.Number]:"entryTypeNumber",[$.Boolean]:"entryTypeBoolean",[$.Null]:"entryTypeNull",[$.Object]:"entryTypeObject",[$.Array]:"entryTypeArray"},Bs=e=>typeof e=="string"?e:e[0],Kc=({pair:e,valueSchema:t,isUnschematizedValue:r,onKeyChange:n,onValueChange:a,onRemove:o,path:i,level:l})=>{const{rootSchema:d,texts:u,readonly:h=!1,inputClassName:p,defaultExpanded:g=!0,touchedPaths:x,markTouched:y,skipUntouched:v}=ke(),[b,C]=m.useState(e.key),[I,S]=m.useState(()=>oc(e.value)),w=pa(t),N=r&&(I===$.Object||I===$.Array),L=r&&I===$.Null,A=r&&I===$.Boolean,T=w||N,j=[...i,e.id,"key"].join("."),D=St(j,x,v)&&e.key==="",E=e.key||u.valueColumnHeader,k=K=>{a(lc(K)),S(K)},P=m.useMemo(()=>ac.map(K=>({value:K,label:u[$c[K]]})),[u]),O=m.useMemo(()=>[{value:"true",label:u.booleanTrueOption},{value:"false",label:u.booleanFalseOption}],[u]),R=()=>L?s.jsx(c.Input,{"aria-label":E,value:"null",disabled:!0}):A?s.jsx($e,{ariaLabel:E,options:O,value:e.value?"true":"false",disabled:h,onChange:K=>{const V=Bs(K);V&&a(V==="true")}}):s.jsx(fa,{schema:r?{type:I}:t,value:e.value,onChange:a,ariaLabel:E}),M=s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:T?"min-w-0 flex-1":"w-2/5 min-w-0",children:s.jsx(c.Input,{"aria-label":u.keyColumnHeader,value:b,disabled:h,invalid:D,error:D?`${u.keyColumnHeader} is required`:void 0,onChange:K=>C(K??""),onBlur:()=>{y?.(j),b!==e.key&&n(b)},placeholder:u.keyInputPlaceholder,containerClassName:p})}),!T&&s.jsx("div",{className:"min-w-0 flex-1",children:R()}),r&&s.jsx("div",{className:"w-28 shrink-0",children:s.jsx(c.Tooltip,{tooltip:u.entryTypeChangeWarning,triggerClassName:"block",children:s.jsx($e,{ariaLabel:u.typeColumnHeader,options:P,value:I,disabled:h,onChange:K=>{const V=Bs(K);V&&k(V)}})})}),!h&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":e.key?`${u.removeFieldAriaLabel}: ${e.key}`:u.removeFieldAriaLabel,onClick:o,className:"mt-2 shrink-0"})]});if(!T)return M;if(N)return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(cs,{value:e.value,onChange:a,ariaLabel:E},I)]});const H=[...i,e.key],W=Be(e.value,t,d,H.join("."));return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(Nt,{title:e.key,level:l,summary:ss(e.value,t,d),errorCount:W.length+(D?1:0),defaultExpanded:g,children:s.jsx(Ke,{schema:t,value:e.value,onChange:a,path:H,level:l+1,ariaLabel:E})})]})},Vc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=ke(),d=e.additionalProperties===!0||e.additionalProperties==null,u=!d&&typeof e.additionalProperties=="object"?Q(e.additionalProperties,o):{type:$.String},h=pa(u),[p,g]=m.useState(()=>Object.entries(t??{}).map(([b,C])=>Ps(b,C))),x=b=>{g(b),r(Object.fromEntries(b.filter(C=>C.key!=="").map(C=>[C.key,C.value])))},y=(b,C)=>x(p.map((I,S)=>S===b?{...I,...C}:I)),v=()=>{const b=h?He(u,o)??ta(u):"";g(C=>[...C,Ps("",b)])};return s.jsxs("div",{className:"flex flex-col gap-2",children:[p.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noFieldsYet}),p.length>0&&!h&&s.jsxs("div",{"aria-hidden":"true",className:"flex gap-2 pr-8",children:[s.jsx("span",{className:"w-2/5 dial-tiny-semi-text text-secondary",children:i.keyColumnHeader}),s.jsx("span",{className:"flex-1 dial-tiny-semi-text text-secondary",children:i.valueColumnHeader}),d&&s.jsx("span",{className:"w-28 shrink-0 dial-tiny-semi-text text-secondary",children:i.typeColumnHeader})]}),p.map((b,C)=>s.jsx(Kc,{pair:b,valueSchema:u,isUnschematizedValue:d,onKeyChange:I=>y(C,{key:I}),onValueChange:I=>y(C,{value:I}),onRemove:()=>x(p.filter((I,S)=>S!==C)),path:n,level:a},b.id)),!l&&s.jsx("div",{className:"pt-1",children:s.jsx(is,{label:i.addField,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:v})})]})},kr=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i}=ke(),l=Q(e,o),d=Jn(Object.entries(l.properties??{}).filter(([,p])=>!Q(p,o).isHidden)),u=l.required??[],h=t??{};return d.length===0?s.jsx("p",{className:"dial-small-text text-secondary",children:i.noConfigurableProperties}):s.jsx("div",{className:"flex flex-col gap-4",children:d.map(([p,g])=>{const x=Q(g,o);return s.jsx(ha,{schema:g,value:h[p],onChange:y=>r({...h,[p]:y}),path:[...n,p],level:a,required:u.includes(p),label:x.title??g.title??Yt(p)},p)})})},zs=e=>typeof e=="string"?e:e[0],Wc=(e,t)=>{const{[t]:r,...n}=e.properties??{};return{...e,properties:n}},Gc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=ke(),u=m.useId(),h=o??l.selectTypePlaceholder,p=e.discriminatorDisplay===lr.Radio,g=e.discriminator;if(g){const I=g.propertyName,S=g.mapping,w=T=>Q({$ref:S[T]},i),N=typeof t=="object"&&t!==null?t[I]:void 0,L=N?w(N):void 0,A=T=>{const j=He(w(T),i)??{};r({...j,[I]:T})};if(p){const T=e.discriminatorOrientation===cr.Row,j=E=>s.jsx(kr,{schema:Wc(E,I),value:t,onChange:r,path:n,level:a}),D=s.jsx(wt,{id:u,ariaLabel:h,value:N,onChange:A,disabled:d,orientation:T?Oe.Row:Oe.Column,items:Object.keys(S).map(E=>{const k=w(E);return{value:E,label:k.title??E,content:T?void 0:j(k)}})});return T?s.jsxs("div",{className:"flex flex-col gap-3",children:[D,L&&j(L)]}):D}return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:h,options:Object.keys(S).map(T=>({value:T,label:T})),value:N,placeholder:l.selectTypePlaceholder,disabled:d,onChange:T=>{const j=zs(T);j&&A(j)},className:"max-w-[280px]"}),L&&s.jsx("div",{className:"pl-3",children:s.jsx(kr,{schema:L,value:t,onChange:r,path:n,level:a})})]})}const x=e.oneOf??[],v=(()=>{if(typeof t!="object"||t===null||Array.isArray(t))return 0;const I=x.findIndex(S=>Q(S,i).required?.every(w=>w in t));return I>=0?I:0})(),b=x[v],C=I=>{const S=He(Q(x[I],i),i);r(S??null)};return p?s.jsx(wt,{id:u,ariaLabel:h,value:String(v),onChange:I=>C(Number(I)),disabled:d,items:x.map((I,S)=>({value:String(S),label:ea(I,i)??`Option ${S+1}`,content:s.jsx(Ke,{schema:Q(I,i),value:t,onChange:r,path:n,level:a,ariaLabel:o})}))}):s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:h,options:x.map((I,S)=>({value:String(S),label:Q(I,i).title??`Option ${S+1}`})),value:String(v),disabled:d,onChange:I=>C(Number(zs(I))),className:"max-w-[280px]"}),b&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(Ke,{schema:b,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},Ke=({schema:e,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:i=!1,fieldId:l,ariaLabel:d,ariaDescribedBy:u})=>{const h=m.useId(),{rootSchema:p,renderField:g,markTouched:x,touchedPaths:y,skipUntouched:v}=ke(),b=Q(e,p),C=n.join("."),I=N=>{x?.(C),r(N)},S={schema:b,value:t,onChange:I,path:n,level:a};let w;if(b.oneOf)w=s.jsx(Gc,{...S,ariaLabel:d});else if(b.anyOf&&b.type!==$.Object)w=s.jsx(jc,{...S,ariaLabel:d});else if(Ye(b)){const N=b.additionalProperties!=null&&b.additionalProperties!==!1,L=!b.properties||Object.keys(b.properties).length===0;N&&L?w=s.jsx(Vc,{...S}):L&&b.additionalProperties!==!1?w=s.jsx(cs,{value:t,onChange:I,id:l,ariaLabel:d}):w=s.jsx(kr,{...S})}else if(b.type===$.Array)w=s.jsx(Oc,{...S});else{const N=St(C,y,v)&&!!o&&dr(t),L=!i&&N?rs(b.title??d??"Field"):void 0;w=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(fa,{schema:b,value:t,onChange:I,invalid:N,id:l,ariaLabel:d,ariaDescribedBy:L?h:u}),s.jsx(c.ErrorText,{id:h,text:L})]})}return g?g(n,b,w):w},ha=({schema:e,value:t,onChange:r,path:n,level:a=0,required:o,label:i})=>{const l=m.useId(),{rootSchema:d,defaultExpanded:u=!0,touchedPaths:h,skipUntouched:p}=ke(),g=Q(e,d),x=n.join(".");if(Ye(g)||g.type===$.Array){const v=Be(t,g,d,x),b=i??g.title??n[n.length-1]??"Section";return s.jsx(Nt,{title:b,description:g.description,level:a,summary:ss(t,g,d),errorCount:St(x,h,p,!0)?v.length:0,defaultExpanded:u,children:s.jsx(Ke,{schema:g,value:t,onChange:r,path:n,level:a+1,required:o,ariaLabel:b})})}const y=St(x,h,p)&&o&&dr(t)?rs(i??"Field"):void 0;return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(c.Label,{htmlFor:l,label:i,required:o,caption:g.description}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(Ke,{schema:g,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:!0,fieldId:l,ariaLabel:i,ariaDescribedBy:y?`${l}-error`:void 0}),s.jsx(c.ErrorText,{id:`${l}-error`,text:y})]})]})},Fs="dial-small-semi-text text-primary",Uc=({schema:e,defaultValue:t,texts:r,className:n,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=nt.Sections,onChange:d,onPropertyChange:u,onDefaultValues:h,renderField:p,skipUntouched:g=!1,acceptableResourceTypes:x})=>{const y=m.useMemo(()=>({...rc,...r}),[r]),v=m.useMemo(()=>t||(He(e,e)??{}),[]),[b,C]=m.useState(v),[I,S]=m.useState(()=>new Set),w=m.useCallback(D=>{S(E=>E.has(D)?E:new Set([...E,D]))},[]);m.useEffect(()=>{h?.(v)},[]);const N=(D,E)=>{const k={...b,[D]:E};C(k),d?.(k),u?.(D,E)},L=new Set(Object.keys(e.properties??{})),A=Object.keys(b).filter(D=>!L.has(D)),T=Jn(Object.entries(e.properties??{}).filter(([,D])=>!Q(D,e).isHidden)),j=e.required??[];return s.jsx(ra.Provider,{value:{rootSchema:e,texts:y,readonly:a,defaultExpanded:o,inputClassName:i,acceptableResourceTypes:x,renderField:p,touchedPaths:I,markTouched:w,skipUntouched:g},children:s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-4",n,c.DIAL_KIT_CLASS.schemaRenderer),children:[T.map(([D,E])=>{const k=Q(E,e),P=k.title??E.title??Yt(D),O=j.includes(D),R=b[D],M=K=>N(D,K);if(l===nt.Flat)return s.jsx(ha,{schema:E,value:R,onChange:M,path:[D],level:0,required:O,label:P},D);if(l===nt.FlatSections)return s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Fs,children:P}),s.jsx(Ke,{schema:E,value:R,onChange:M,path:[D],level:0,required:O,ariaLabel:P})]},D);const H=Be(R,k,e,D),W=O&&dr(R)?Math.max(H.length,1):H.length;return s.jsx(Nt,{title:P,description:k.description,level:0,defaultExpanded:o,errorCount:St(D,I,g,!0)?W:0,children:s.jsx(Ke,{schema:E,value:R,onChange:M,path:[D],level:1,required:O,ariaLabel:P})},D)}),A.map(D=>{const E=Yt(D),k=s.jsx(cs,{value:b[D],onChange:P=>N(D,P),ariaLabel:E});return l===nt.Sections?s.jsx(Nt,{title:E,level:0,defaultExpanded:o,children:k},D):s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Fs,children:E}),k]},D)})]})})},Zc=e=>({info:s.jsx(F.IconInfoCircleFilled,{size:e.size}),error:s.jsx(F.IconAlertCircleFilled,{size:e.size}),warning:s.jsx(F.IconAlertTriangleFilled,{size:e.size}),success:s.jsx(F.IconCircleCheckFilled,{size:e.size}),loading:s.jsx(Ve,{size:e.size}),general:s.jsx(F.IconCheck,{size:e.size,stroke:e.stroke})}),qc={[X.Info]:"bg-info text-info",[X.Success]:"bg-success text-success",[X.Warning]:"bg-warning text-warning",[X.Error]:"bg-error text-error",[X.Loading]:"bg-layer-raised text-info",[X.General]:"bg-layer-sunken text-primary"},Yc="bg-layer-sunken text-primary",Xc={[X.Info]:"text-info",[X.Success]:"text-success",[X.Warning]:"text-warning-icon",[X.Error]:"text-error",[X.Loading]:"text-info",[X.General]:"text-primary"},Qc={[X.Info]:"status",[X.Success]:"status",[X.Warning]:"alert",[X.Error]:"alert",[X.Loading]:"status",[X.General]:"status"},Jc="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",us=({variant:e=X.Info,type:t=fe.Toast,surface:r=qt.Variant,title:n,message:a,action:o,className:i,iconSize:l=24,iconStroke:d=2,closable:u=!1,onClose:h,children:p,textClassName:g,...x})=>{const y=m.useMemo(()=>Zc({size:l,stroke:d})[e],[e,l,d]),v=r===qt.Neutral,b=g??(t===fe.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return s.jsxs("div",{role:Qc[e],...x,className:f.mergeClasses(Jc,v?Yc:qc[e],t===fe.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===fe.SectionMessage&&e===X.Loading&&"border-secondary",i,c.DIAL_KIT_CLASS.notification),children:[s.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("flex shrink-0",v&&Xc[e]),children:s.jsx(c.DialIcon,{icon:y})}),n?s.jsxs("div",{className:f.mergeClasses("flex min-w-0 text-primary break-words",b),children:[s.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:n}),s.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:a})]}):s.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:a})]}),o!=null&&s.jsx("div",{className:"flex shrink-0 items-center",children:o}),p,u&&s.jsx(c.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:C=>h?.(C)})]})},ed=({className:e,children:t,...r})=>s.jsx("article",{...r,className:f.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,c.DIAL_KIT_CLASS.cardShell),children:t}),dt=(e,t)=>({type:n,...a})=>s.jsx(us,{...a,variant:e,type:n||t}),ut=(e,t)=>({variant:n,...a})=>s.jsx(us,{...a,variant:n||t,type:e}),td=dt(X.Error,fe.Toast),rd=dt(X.Info,fe.Toast),sd=dt(X.Success,fe.Toast),nd=dt(X.Warning,fe.Toast),ad=dt(X.Loading,fe.Toast),od=dt(X.General,fe.Toast),id=ut(fe.SectionMessage,X.Error),ld=ut(fe.SectionMessage,X.Info),cd=ut(fe.SectionMessage,X.Success),dd=ut(fe.SectionMessage,X.Warning),ud=ut(fe.SectionMessage,X.Loading),fd=ut(fe.SectionMessage,X.General);var xe=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(xe||{});const pd="en-GB",hd={[xe.Date]:"Select date",[xe.DateTime]:"Select date and time",[xe.Time]:"--:--",[xe.Weekday]:"Select day"},ma="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-hidden transition-colors hover:border-accent-alpha focus-within:border-accent-focus",ga="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",xa="!border-error",md="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",gd="z-floating rounded-lg bg-layer-raised p-2 shadow-md",xd="absolute end-2 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-lg text-secondary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus disabled:cursor-not-allowed disabled:text-control-disable-primary disabled:hover:bg-transparent",bd="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-hidden focus-visible:outline focus-visible:outline-focus",vd="bg-control-accent text-control-permanent",yd="text-accent dial-small-semi-text",Cd="text-control-disable-primary",ba="text-secondary",Id=s.jsx(F.IconCalendar,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ba}),Hs={prev:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Sd=(e,t)=>{const n=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-n);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},$s=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Ks=(e,t,r)=>{const n=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(n<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(n>a)return!0}return!1},Nd=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Vs=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),wd=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),Mt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Ws=(e,t)=>{const[r,n]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,n||0,0,0),a},jd=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Dd=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const n=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),n.length===0)return r;const a=String(Math.min(Number(n),59)).padStart(n.length,"0");return`${r}:${a}`},va=5,ya=e=>e.charAt(0).toUpperCase()+e.slice(1),Td=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,va+r));return ya(n.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Ed=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,va+r));return{value:String(r+1),label:ya(n.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),Ld=Array.from({length:24},(e,t)=>String(t).padStart(2,"0")),Ad=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Od="flex w-full shrink-0 items-center justify-center rounded-lg px-3 py-2 dial-small-text text-primary hover:bg-control-accent-alpha-hover focus:outline-hidden focus-visible:outline focus-visible:outline-focus",_d="bg-control-accent text-control-permanent hover:bg-control-accent",Gs=({label:e,options:t,selected:r,onSelect:n})=>{const a=m.useRef(null);m.useEffect(()=>{const l=a.current,d=l?.querySelector('[aria-selected="true"]');!l||!d||(l.scrollTop=d.offsetTop-l.clientHeight/2+d.offsetHeight/2)},[]);const o=l=>{const d=Array.from(l.currentTarget.querySelectorAll("button")),u=d.indexOf(document.activeElement),h={ArrowDown:d[u+1],ArrowUp:d[u-1],Home:d[0],End:d[d.length-1]}[l.key];h&&(l.preventDefault(),h.focus())},i=r??t[0];return s.jsx("div",{ref:a,role:"listbox","aria-label":e,tabIndex:-1,className:"flex h-56 flex-1 flex-col gap-0.5 overflow-y-auto",onKeyDown:o,children:t.map(l=>s.jsx("button",{type:"button",role:"option","aria-selected":l===r,tabIndex:l===i?0:-1,className:f.mergeClasses(Od,l===r&&_d),onClick:()=>n(l),children:l},l))})},kd=({value:e,onSelect:t})=>{const[r,n]=m.useMemo(()=>{const a=/^(\d{2}):(\d{2})$/.exec(e);return a?[a[1],a[2]]:[void 0,void 0]},[e]);return s.jsxs("div",{className:"flex w-[168px] gap-1",children:[s.jsx(Gs,{label:"Hours",options:Ld,selected:r,onSelect:a=>t(`${a}:${n??"00"}`,!1)}),s.jsx(Gs,{label:"Minutes",options:Ad,selected:n,onSelect:a=>t(`${r??"00"}:${a}`,!0)})]})},Us=({id:e,disabled:t,invalid:r,trigger:n,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,panelLabel:d})=>{const u=c.useThemeScope(),[h,p]=m.useState(!1),{refs:g,floatingStyles:x,context:y}=B.useFloating({open:h,onOpenChange:w=>p(t?!1:w),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),v=B.useClick(y,{enabled:!t}),b=B.useDismiss(y),C=B.useRole(y,{role:"dialog"}),{getReferenceProps:I,getFloatingProps:S}=B.useInteractions([v,b,C]);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:f.mergeClasses(ma,"focus-visible:outline focus-visible:outline-focus",r&&xa,t&&ga,o),...I(),children:n}),h&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:y,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:g.setFloating,style:x,"aria-label":d,className:f.mergeClasses(md,u,a),...S(),children:i(()=>p(!1))})})})]})},Zs=({id:e,value:t,onChange:r,onBlur:n,disabled:a,invalid:o,className:i,ariaLabel:l,placeholder:d="--:--",timezoneLabel:u,timezoneLabelClassName:h,picker:p=!1})=>{const[g,x]=m.useState(t),[y,v]=m.useState(!1),b=c.useThemeScope(),{refs:C,floatingStyles:I,context:S}=B.useFloating({open:y,onOpenChange:T=>v(a?!1:T),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),w=B.useDismiss(S),N=B.useRole(S,{role:"dialog"}),{getFloatingProps:L}=B.useInteractions([w,N]);m.useEffect(()=>{x(t)},[t]);const A=s.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:d,disabled:a,value:g,onChange:T=>{const j=Dd(T.target.value);x(j),jd(j)&&r(j)},onBlur:n,className:f.mergeClasses(ma,o&&xa,a&&ga,p&&"pe-12",i)});return!u&&!p?A:s.jsxs("div",{ref:p?C.setReference:void 0,className:"relative w-full",children:[A,u&&s.jsx("span",{className:f.mergeClasses("dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",p&&"end-12",h),children:u}),p&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","aria-label":"Choose time","aria-haspopup":"dialog","aria-expanded":y,disabled:a,className:xd,onClick:()=>v(T=>!T),children:s.jsx(F.IconClock,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),y&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:S,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:C.setFloating,style:I,"aria-label":"Choose time",className:f.mergeClasses(gd,b),...L(),children:s.jsx(kd,{value:g,onSelect:(T,j)=>{x(T),r(T),j&&v(!1)}})})})})]})]})},Rd=({mode:e=xe.Date,value:t,onChange:r,onBlur:n,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,id:d,className:u,minDate:h,maxDate:p,locale:g=pd,fieldClassName:x,showTimezone:y=!1,showTimePicker:v=!0})=>{const b=o??hd[e],C=t instanceof Date?t:null,I=m.useId(),S=d??I,w=a?.id??`${S}-label`,N=!!a?.label,L=typeof a?.label=="string"?a.label:void 0,A=N?`${w} ${S}`:void 0,T=a?s.jsx(c.Label,{...a,id:w,htmlFor:S}):null,[j,D]=m.useState(()=>C??new Date),E=m.useMemo(()=>new Date,[]),k=m.useMemo(()=>y?Xn({locale:g}):null,[y,g]),P=m.useMemo(()=>Td(g),[g]),O=m.useMemo(()=>Ed(g),[g]),R=m.useMemo(()=>Sd(j.getFullYear(),j.getMonth()),[j]),M=V=>{D(G=>new Date(G.getFullYear(),G.getMonth()+V,1))},H=(V,G)=>{if(Ks(V,h,p))return;const ee=e===xe.DateTime&&C?Ws(V,Mt(C)):V;r?.(ee),e===xe.Date&&G()},W=V=>{r?.(Ws(C??new Date,V))},K=()=>C?e===xe.DateTime?`${Vs(C,g)}, ${Mt(C)}`:Vs(C,g):b;if(e===xe.Time){const V=typeof t=="string"?t:C?Mt(C):"";return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Zs,{id:S,value:V,onChange:G=>r?.(G),onBlur:n,disabled:i,invalid:l,placeholder:b,className:x,timezoneLabel:k,picker:v})]})}if(e===xe.Weekday){const V=typeof t=="string"?t:void 0,G=O.find(ee=>ee.value===V);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Us,{id:S,disabled:i,invalid:l,labelledBy:A,panelLabel:L??b,fieldClassName:x,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!G&&"text-secondary"),children:G?.label??b}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ba})]}),panel:ee=>s.jsx("div",{role:"listbox","aria-label":L??b,className:"flex flex-col gap-0.5",children:O.map(re=>s.jsx("button",{type:"button",role:"option","aria-selected":re.value===V,className:f.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",re.value===V&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(re.value),ee()},children:re.label},re.value))})})]})}return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Us,{id:S,disabled:i,invalid:l,labelledBy:A,panelLabel:L??b,fieldClassName:x,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!C&&"text-secondary"),children:K()}),Id]}),panel:V=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(c.StaticIconButton,{"aria-label":"Previous month",icon:Hs.prev,size:c.ElementSize.Small,onClick:()=>M(-1)}),s.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Nd(j,g)}),s.jsx(c.StaticIconButton,{"aria-label":"Next month",icon:Hs.next,size:c.ElementSize.Small,onClick:()=>M(1)})]}),s.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[P.map(G=>s.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:G},G)),R.map(G=>{const ee=G.getMonth()!==j.getMonth(),re=$s(G,C),q=$s(G,E),Y=Ks(G,h,p);return s.jsx("button",{type:"button",disabled:Y,"aria-label":wd(G,g),"aria-pressed":re,"aria-current":q?"date":void 0,className:f.mergeClasses(bd,ee&&Cd,q&&!re&&yd,re&&vd,Y&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>H(G,V),children:G.getDate()},G.toISOString())})]}),e===xe.DateTime&&s.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[s.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),s.jsx(Zs,{ariaLabel:"Time",value:C?Mt(C):"",onChange:W,onBlur:n,className:f.mergeClasses(!k&&"w-[120px]","px-3 py-1.5"),timezoneLabel:k,timezoneLabelClassName:"end-3 max-w-[60%]"})]})]})})]})},Md=3,Pd=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:n,ariaLabel:a="Folder path"})=>{const o=m.useRef(null),i=m.useRef(null),l=m.useRef(null),[d,u]=m.useState(!1),h=m.useRef(!1),p=m.useRef(0),g=m.useCallback(j=>{h.current=j,u(j)},[]),x=m.useCallback(()=>{const j=o.current;if(!j)return;if(h.current){j.clientWidth>=p.current&&g(!1);return}const D=i.current,E=l.current;if(!D||!E)return;const k=D.scrollWidth-D.clientWidth,P=parseFloat(getComputedStyle(E).minWidth)||0,O=E.clientWidth<=P+1;k>0&&O&&(p.current=j.clientWidth+k,g(!0))},[g]);m.useEffect(()=>{const j=o.current;if(j)return c.observeElementSize(j,x)},[x]);const y=e.join("\0");m.useEffect(()=>{g(!1),c.scheduleMeasure(x)},[y,x,g]),m.useEffect(()=>{d||c.scheduleMeasure(x)},[d,x]);const v=s.jsx(c.DialIcon,{icon:s.jsx(F.IconFolder,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),b=s.jsx("span",{className:Kr,children:s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronRight,{size:14,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"})}),C=f.mergeClasses(t,"text-secondary cursor-default"),I=e.length-1,S=e.length>=3?I-1:-1,w=e.length>Md||d,N=e.slice(1,d?I:I-1),L=j=>{const D=j===I,E=j===S;let k=e[j];return D&&(k=s.jsx("span",{className:r,children:e[j]})),s.jsxs("li",{className:f.mergeClasses(Zt,D&&"min-w-0",E&&"shrink-[1000]",!D&&!E&&"shrink-0"),children:[s.jsxs("span",{className:f.mergeClasses(Lr,wn,"pointer-events-none opacity-75",E&&"min-w-auto"),"aria-current":D?"page":void 0,"aria-disabled":"true",children:[j===0&&v,s.jsx("span",{ref:D&&i||E&&l||void 0,className:f.mergeClasses("truncate",D&&"min-w-0 flex-1",E&&"min-w-[2ch]",C),children:k})]}),!D&&b]},`item-${j}`)},A=()=>s.jsxs("li",{className:f.mergeClasses(Zt,"shrink-0"),children:[s.jsxs(c.Tooltip,{tooltip:e.join(" > "),triggerClassName:"inline-flex cursor-default items-center text-secondary",children:[s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),s.jsx("span",{className:"sr-only",children:N.join(", ")})]}),b]},"ellipsis"),T=[];return w?(T.push(L(0),A()),d||T.push(L(I-1)),T.push(L(I))):e.forEach((j,D)=>T.push(L(D))),s.jsx("nav",{ref:o,"aria-label":a,className:f.mergeClasses(Sn,n,c.DIAL_KIT_CLASS.folderPath),children:s.jsx("ol",{className:Nn,children:T})})};var Ze=(e=>(e.Small="small",e.Heading="heading",e))(Ze||{});const Bd="w-full overflow-hidden",zd="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",qs="flex min-w-0 items-center gap-2",Ys={[Ze.Small]:"dial-small-text",[Ze.Heading]:"dial-h2-text"},Fd={[Ze.Small]:"dial-small-semi-text",[Ze.Heading]:"dial-h2-text"},Hd={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},$d="flex min-w-0 flex-1 items-center gap-1 rounded-xs transition-colors",Kd="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Vd="cursor-default text-primary",Wd="cursor-default text-secondary",Xs="inline-flex flex-none items-center leading-none text-secondary",Gd="dial-kit-minimum-target flex shrink-0 items-center rounded-xs text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Ud=3,Zd=4,qd=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),Yd=({items:e,maxVisibleItems:t=Zd,size:r=Ze.Small,separator:n=qd,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const d=Math.max(t,Ud),u=m.useMemo(()=>e.length>d?e.slice(1,-(d-2)):[],[e,d]),h=m.useMemo(()=>u.map((y,v)=>({key:String(v),label:y.label,icon:y.icon})),[u]),p=m.useCallback(({key:y,domEvent:v})=>{const b=u[Number(y)];b&&(b.onClick?.(v),!b.onClick&&b.href&&!v.defaultPrevented&&(window.location.href=b.href))},[u]);if(e.length===0)return null;const g=e.slice(u.length+1),x=(y,{index:v,isFirst:b,isCurrent:C})=>{const I=!C&&(!!y.href||!!y.onClick),S=f.mergeClasses($d,I?Kd:C?f.mergeClasses(Vd,Fd[r]):Wd,l,c.DIAL_KIT_CLASS.breadcrumbsItem),w=s.jsxs(s.Fragment,{children:[y.icon,s.jsx(c.EllipsisTooltip,{text:y.label})]});return s.jsxs("li",{className:f.mergeClasses(qs,Ys[r],Hd[C?"last":b?"first":"middle"]),children:[I?y.href?s.jsx("a",{href:y.href,onClick:y.onClick,className:S,children:w}):s.jsx("button",{type:"button",onClick:y.onClick,className:S,children:w}):s.jsx("span",{className:S,"aria-current":C?"page":void 0,children:w}),!C&&s.jsx("span",{className:Xs,"aria-hidden":"true",children:n})]},`segment-${v}`)};return s.jsx("nav",{"aria-label":a,className:f.mergeClasses(Bd,i,c.DIAL_KIT_CLASS.breadcrumbs),children:s.jsxs("ol",{className:zd,children:[x(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),u.length>0&&s.jsxs("li",{className:f.mergeClasses(qs,Ys[r],"shrink-0"),children:[s.jsx(c.Dropdown,{items:h,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":o,className:Gd,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),s.jsx("span",{className:Xs,"aria-hidden":"true",children:n})]}),g.map((y,v)=>x(y,{index:e.length-g.length+v,isFirst:!1,isCurrent:v===g.length-1}))]})})},Xd=({className:e,icon:t,tooltipProps:r,type:n="button",...a})=>{const o=f.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),i=s.jsx("button",{...a,type:n,className:o,"aria-label":c.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||s.jsx(F.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?s.jsx(qe,{...r,children:i}):i},Qd=e=>s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",e&&"rotate-180")}),Jd=({variant:e,appearance:t,items:r,dropdownProps:n,...a})=>{const[o,i]=m.useState(!1),l=m.useMemo(()=>Qd(o),[o]);return s.jsx("div",{className:c.DIAL_KIT_CLASS.buttonDropdown,children:s.jsx(c.Dropdown,{...n,items:r,onOpenChange:d=>i(d),children:s.jsx(Xe,{...a,iconAfter:l,variant:e||c.ButtonVariant.Primary,appearance:t||c.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},Ca=({label:e,size:t,isOpen:r=!1,labelClassName:n,className:a,"aria-label":o,...i})=>{const l=t===c.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return s.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":r,"aria-label":o?`${o} ${e}`:void 0,className:f.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",l,a,c.DIAL_KIT_CLASS.inlineSelect),children:[s.jsx("span",{className:n,children:e}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",r&&"rotate-180")})]})},eu=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:n,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:d,listStyle:u,ariaLabel:h,triggerClassName:p,triggerLabelClassName:g,open:x,onOpenChange:y})=>{const[v,b]=m.useState(!1),C=x!==void 0,I=C?x:v,S=m.useCallback(D=>{C||b(D),y?.(D)},[C,y]),[w,N]=m.useState(r??e[0]?.key),L=t!==void 0,A=L?t:w,T=m.useMemo(()=>{const D=e.find(E=>E.key===A);return D?.label?String(D.label):""},[e,A]),j=m.useCallback(({key:D})=>{const E=e.find(k=>k.key===D);E&&(L||N(D),n?.(E))},[e,L,n]);return s.jsx(c.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:d,listStyle:u,disabled:o,open:C?x:void 0,onOpenChange:S,onItemClick:j,children:s.jsx(Ca,{label:T,size:a,isOpen:I,disabled:o,"aria-label":h,className:p,labelClassName:g})})},tu={[be.VALID]:"Completed",[be.ERROR]:"Error"},ru=(e,t)=>e.status===be.ERROR?t?"border-error text-primary":"border-error text-error":t?e.status===be.VALID?"border-success text-primary":"border-accent text-primary":e.status===be.VALID?"border-primary text-primary":"border-primary text-secondary",su=(e,t)=>e.status===be.ERROR?"bg-control-error text-control-permanent":e.status===be.VALID&&!t?"bg-success text-success":t?e.status===be.VALID?"bg-success text-success":"bg-control-accent text-control-permanent":"bg-layer-sunken text-secondary",nu=({steps:e,currentStep:t,onChangeStep:r,statusLabels:n,ariaLabel:a,className:o})=>{const i=l=>{if(l===t)return;const d=e.findIndex(p=>p.id===t),u=e.findIndex(p=>p.id===l);(e.slice(0,u).every(p=>p.status===be.VALID)||u<d)&&r(l)};return s.jsx("ol",{"aria-label":a,className:f.mergeClasses("m-0 flex list-none gap-x-3 p-0",o,c.DIAL_KIT_CLASS.steps),children:e.map((l,d)=>{const u=t===l.id,h=l.status?n?.[l.status]??tu[l.status]:void 0;let p=d+1;return u&&l.status===be.ERROR?p=s.jsx(F.IconExclamationCircle,{"aria-hidden":"true",size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):!u&&l.status===be.VALID&&(p=s.jsx(F.IconCheck,{"aria-hidden":"true",size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE})),s.jsx("li",{className:"flex min-w-[180px] flex-1",children:s.jsxs("button",{type:"button","aria-current":u?"step":void 0,onClick:()=>i(l.id),className:f.mergeClasses("flex h-8 w-full cursor-pointer items-center border-t-2 text-start dial-tiny-text","focus-visible:outline focus-visible:outline-focus",ru(l,u)),children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("me-2 flex size-[22px] shrink-0 items-center justify-center rounded-full",su(l,u)),children:p}),s.jsx("span",{children:l.name}),h&&s.jsx("span",{className:"sr-only",children:h})]})},l.id)})})};var _e=(e=>(e.Outlined="outlined",e.Filled="filled",e))(_e||{}),we=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(we||{});const au={[we.Blue]:"bg-blue text-blue",[we.Green]:"bg-green-2 text-green-1",[we.Violet]:"bg-violet-2 text-violet-1",[we.Indigo]:"bg-violet-1 text-violet-2",[we.Brown]:"bg-brown text-brown-2",[we.Red]:"bg-red text-red"},ou={[_e.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[_e.Filled]:"rounded-full"},iu={[_e.Outlined]:"dial-tiny-text",[_e.Filled]:"dial-caption-lead-semi-text"},fs=({label:e,variant:t=_e.Outlined,color:r=we.Blue,icon:n,textClassName:a,className:o,...i})=>s.jsxs("span",{...i,className:f.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",ou[t],t===_e.Filled&&au[r],o,c.DIAL_KIT_CLASS.badge),children:[n&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:n}),s.jsx("span",{className:a??iu[t],children:e})]});var jt=(e=>(e.Default="default",e.Compact="compact",e))(jt||{});const lu={[jt.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[jt.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},cu=({title:e,value:t,description:r,variant:n=jt.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:h})=>{const p=lu[n],g=d!==void 0?d:(l??0)>=0,x=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return s.jsxs("div",{className:f.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i,c.DIAL_KIT_CLASS.analyticsCard),children:[l!==void 0?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:p.title,children:e}),s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:x})]}):s.jsx("span",{className:p.title,children:e}),a?s.jsx(fs,{label:"Error",variant:_e.Filled,color:we.Red,textClassName:"dial-tiny-semi-text",className:"self-start"}):o?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-start"}):h?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:h[0].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[0].value})]}),s.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:h[1].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[1].value})]})]}):s.jsx("span",{className:p.value,children:t}),!a&&!o&&p.showDescription&&r!=null&&r!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},ps=[{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"}],du=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),uu=(e,t)=>{if(e<=0)return;let r;for(const n of t)(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=n.color);return r},Vt=({value:e,maxValue:t=1,error:r,isLoading:n,title:a,valueLabel:o,colorMap:i=ps,className:l,titleClassName:d,valueClassName:u,inline:h,ariaLabel:p})=>{const g=e==null,x=!!(r||n||!g),y=du(g?0:e,t),v=uu(y,i),b=o??(g?"—":e),C=p??(typeof a=="string"?a:void 0),I=r||n,S=r?s.jsx(fs,{label:"Error",variant:_e.Filled,color:we.Red,textClassName:"dial-tiny-semi-text"}):n?s.jsx(Ve,{size:18,fullWidth:!1}):s.jsx("span",{className:f.mergeClasses("shrink-0 tabular-nums text-end",h?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),w=x?s.jsx("div",{role:"progressbar","aria-valuenow":r||n||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":C,className:f.mergeClasses("w-full overflow-hidden rounded-xs",h?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!I&&s.jsx("div",{className:"h-full rounded-xs transition-[width] duration-300",style:{width:`${y*100}%`,backgroundColor:v}})}):null,N=s.jsx("span",{className:f.mergeClasses("dial-small-text text-primary",d),children:a});return h?s.jsxs("div",{className:f.mergeClasses("flex flex-row items-center gap-2",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsx("div",{className:"w-1/2 min-w-0",children:N}),s.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:w}),S]})]}):s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[N,S]}),w]})};var Qt=(e=>(e.Start="start",e.End="end",e))(Qt||{});const Ia=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:d,caretPosition:u=Qt.End,className:h,headerClassName:p,contentClassName:g})=>{const x=n!==void 0,[y,v]=m.useState(a),b=i?!0:x?n:y,C=m.useId(),I=`accordion-header-${C}`,S=`accordion-content-${C}`,w=()=>{if(o)return;const j=!b;x||v(j),d?.(j)},N=u===Qt.Start,L=i?null:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",b?"rotate-90":"rtl:rotate-180")}),A=s.jsxs(s.Fragment,{children:[N&&L,s.jsxs("span",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?s.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!N&&L]}),T=N?"justify-start gap-2":"justify-between";return s.jsxs("div",{className:f.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",h,c.DIAL_KIT_CLASS.accordion),children:[i?s.jsx("div",{id:I,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",T,p),children:A}):s.jsx("button",{id:I,type:"button","aria-expanded":b,"aria-controls":S,"aria-label":c.resolveAccessibleName(l),disabled:o,onClick:w,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",T,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:A}),s.jsx("div",{inert:!b,className:f.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",b?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:s.jsx("div",{className:"min-h-0 overflow-hidden",children:s.jsx("div",{className:"pt-3",children:s.jsx("div",{id:S,role:"region","aria-labelledby":I,className:f.mergeClasses("px-4 dial-small-text text-primary",g),children:r})})})})]})},fu=({title:e,titleTooltip:t,description:r,data:n,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:d=!0,nonCollapsible:u,isLoading:h,onBarClick:p,inline:g,barTitleClassName:x,barValueClassName:y,barClassName:v,barDescriptions:b,className:C})=>{const I=Object.entries(n),S=g?f.mergeClasses("text-secondary",x):x,w=o?"dial-tiny-text text-secondary":void 0,N=t?s.jsx(c.Tooltip,{tooltip:t,children:e}):e,L=a?[...new Set([...Object.keys(n),...Object.keys(a)])]:[],A="cursor-pointer rounded-xs text-left focus-visible:outline focus-visible:outline-focus",T="group flex flex-col gap-1.5",j=f.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 s.jsx(Ia,{title:N,description:r,defaultExpanded:d,nonCollapsible:u,className:f.mergeClasses(C,c.DIAL_KIT_CLASS.analyticsBarGroup),children:s.jsx("div",{className:f.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:h?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-center"}):a?L.map(D=>{const E=D in n?n[D]:null,k=D in a?a[D]:null,O=typeof E=="number"&&typeof k=="number"?parseFloat((k-E).toFixed(3)):null,R=O!=null&&O!==0,M=R&&O>0,H=R?M?`+${O}`:String(O):null,W=b?.[D],K=s.jsx("span",{className:"dial-small-text text-secondary",children:D}),V=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[W?s.jsx(c.Tooltip,{tooltip:W,children:K}):K,H!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",M?"bg-success text-success":"bg-error text-error"),children:H})]}),s.jsxs("div",{className:j,children:[s.jsx(Vt,{title:o?.[0],value:E,maxValue:i,colorMap:l,inline:g,titleClassName:w,ariaLabel:D}),s.jsx(Vt,{title:o?.[1],value:k,maxValue:i,colorMap:l,inline:g,titleClassName:w,ariaLabel:`${D} compare`})]})]});return p?s.jsx("button",{type:"button",onClick:()=>p(D,E),className:f.mergeClasses(T,A),children:V},D):s.jsx("div",{className:T,children:V},D)}):I.map(([D,E])=>{const k=s.jsx(Vt,{title:D,value:E,maxValue:i,colorMap:l,inline:g,titleClassName:S,valueClassName:y,className:v}),P=p?s.jsx("button",{type:"button",onClick:()=>p(D,E),className:A,children:k}):k,O=b?.[D];return O?s.jsx(c.Tooltip,{tooltip:O,triggerClassName:"flex flex-col",children:P},D):s.jsx(m.Fragment,{children:P},D)})})})},pu="#FF4E50",hu=(e,t)=>{let r=-1;return t.forEach((n,a)=>{(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=a)}),r},Qs=(e,t)=>{const r=t.map(()=>0);let n=0;e.forEach(d=>{if(d<=0){n+=1;return}const u=hu(d,t);u>=0&&(r[u]+=1)});const a=Math.max(0,n,...r),o=d=>a>0?d/a:0,i={from:0,to:0,color:pu,count:n,ratio:o(n),isZeroBucket:!0},l=t.map((d,u)=>({from:d.from,to:d.to,color:d.color,count:r[u],ratio:o(r[u]),isZeroBucket:!1}));return[i,...l]},Sa=e=>e<=0?2:e%2===0?e:e+1,mu=e=>{const t=Sa(e);return[t,t/2,0]},Ir=e=>`${Math.round(e*100)/100}`,Na=(e,t)=>e===t?Ir(e):`${Ir(e)}-${Ir(t)}`,Sr=128,gu=(e,t)=>{const r=Na(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Js=(e,t,r,n,a)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&s.jsx("strong",{children:e}),s.jsxs("span",{children:[t," out of ",r," ",n]}),s.jsx("span",{children:gu(a.from,a.to)})]}),xu=({title:e,values:t,colorMap:r=ps,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const h=Qs(t,r),p=l?Qs(l,r):void 0,g=t.length,x=l?.length??0,y=Math.max(g,x),v=Sa(y),b=mu(y),C=N=>N.map(L=>({...L,ratio:v>0?L.count/v:0})),I=C(h),S=p?C(p):void 0,w=(N,L,A,T)=>{if(N.count===0)return s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${N.ratio*100}%`}})});const j=T?{backgroundImage:`repeating-linear-gradient(135deg, ${N.color} 0px, ${N.color} 1px, transparent 1px, transparent 4px)`,borderColor:N.color}:{backgroundColor:N.color};return s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":A,className:"flex min-h-2 w-full items-center justify-center rounded-xs border border-transparent",style:{height:`${N.ratio*100}%`,...j},children:a&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:N.count})})})};return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",i,c.DIAL_KIT_CLASS.analyticsHistogram),children:[s.jsx("span",{className:"dial-small-text text-primary",children:e}),o?s.jsx("div",{className:"flex items-center justify-center",style:{height:Sr},children:s.jsx(Ve,{size:18,fullWidth:!1})}):s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[s.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:Sr},children:b.map((N,L)=>s.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${L/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:N},N))}),s.jsxs("div",{className:"relative min-w-0",children:[b.map((N,L)=>s.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${L/(b.length-1)*100}%`}},N)),s.jsx("div",{className:"relative flex items-end gap-1",style:{height:Sr},children:S?I.map((N,L)=>{const A=S[L],T=`${N.count} out of ${g} ${n}`,j=`${A.count} out of ${x} ${n}`;return s.jsxs("div",{className:"flex h-full flex-1 items-end",children:[w(N,Js(d,N.count,g,n,N),T,!0),w(A,Js(u,A.count,x,n,A),j,!1)]},L)}):I.map((N,L)=>{const A=`${N.count} out of ${g} ${n}`;return N.count===0?s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${N.ratio*100}%`}})},L):s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:A,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":A,className:f.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-xs border","border-transparent"),style:{height:`${N.ratio*100}%`,backgroundColor:N.color},children:a&&N.count>0&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:N.count})})},L)})})]}),s.jsx("div",{}),s.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((N,L)=>s.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Na(N.from,N.to)},L))})]})]})},bu=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>{const i=!!n||t!=null;return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",!n&&"max-w-[200px]",o,c.DIAL_KIT_CLASS.labelledText),children:[s.jsx(c.Label,{label:e}),i&&s.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-primary",children:[n??s.jsx(c.EllipsisTooltip,{text:t,customTooltipContent:r,className:"dial-small-text min-w-0 flex-1"}),!n&&a]})]})},vu="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",yu="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Cu="flex flex-row items-center justify-between px-6 py-4",Iu="flex-1 min-w-0 mr-3 truncate dial-h2-text text-primary",Su="border-b border-tertiary",Nu="flex flex-row items-center gap-2 px-6 py-4",wu="border-t border-tertiary",Nr="flex shrink-0 flex-row items-center gap-2",ju="ml-auto mobile:flex-1",Jt="mobile:flex-1",Du={[We.Sm]:"max-w-full md:max-w-[400px]",[We.Md]:"max-w-full md:max-w-[800px]",[We.Lg]:"max-w-full md:max-w-[1200px]"},hs=({open:e=!1,header:t,ariaLabel:r,portalId:n,className:a,overlayClassName:o,overlayStyle:i,titleClassName:l,headerClassName:d,bodyClassName:u,children:h,footer:p,footerClassName:g,onClose:x,onBack:y,backAriaLabel:v="Back",headerActions:b,headerDivider:C=!1,mainButtons:I,additionalButtons:S,additionalButtonsOnLeft:w=!1,footerDivider:N=!1,size:L=We.Md,hideClose:A=!1,closeAriaLabel:T="Close dialog",closeOnOutsideClick:j=!0,preventKeyboardOnOpen:D=!1})=>{const E=c.useThemeScope(),k=m.useRef(null),P=m.useId(),{refs:O,context:R}=B.useFloating({open:e,onOpenChange:q=>{q||x?.(null)}}),M=B.useRole(R,{role:"dialog"}),H=B.useDismiss(R,{outsidePress:j}),{getFloatingProps:W}=B.useInteractions([M,H]);if(!e)return null;const K=typeof t=="string"?`popup-heading-${P}`:void 0,V=q=>q?typeof q=="string"?s.jsx("h2",{id:K,className:f.mergeClasses(Iu,l),children:s.jsx(c.Tooltip,{tooltip:q,triggerClassName:"truncate",children:q})}):q:s.jsx("span",{}),G=A?null:s.jsx(c.CloseButton,{ariaLabel:T,onClose:q=>x?.(q)}),ee=(q,Y=[],se)=>Y.map(({variant:le=c.ButtonVariant.Neutral,className:oe,...me},ve)=>s.jsx(Xe,{variant:le,className:f.mergeClasses(se,oe),...me},`${q}-${ve}`)),re=()=>{if(p!==void 0)return p;if(!I?.length&&!S?.length)return null;const q=ee("additional",S,w?void 0:Jt);return s.jsxs("div",{className:f.mergeClasses(Nu,N&&wu,g),children:[w&&q.length>0&&s.jsx("div",{className:Nr,children:q}),s.jsxs("div",{className:f.mergeClasses(Nr,ju),children:[!w&&q,ee("main",I,Jt)]})]})};return s.jsx(B.FloatingPortal,{id:n,children:s.jsx(B.FloatingOverlay,{style:i,className:f.mergeClasses(vu,E,o),children:s.jsx(B.FloatingFocusManager,{context:R,initialFocus:D?k:O.floating,children:s.jsxs("div",{ref:O.setFloating,...W(),role:"dialog","aria-modal":"true","aria-labelledby":K,"aria-label":K?void 0:r,className:f.mergeClasses(yu,Du[L],a,c.DIAL_KIT_CLASS.popup),children:[D&&s.jsx("div",{ref:k,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),s.jsxs("div",{className:f.mergeClasses(Cu,C&&Su,d),children:[y&&s.jsx(c.GhostIconButton,{"aria-label":v,size:c.ElementSize.Small,className:"mr-2",onClick:y,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),V(t),b?s.jsxs("div",{className:Nr,children:[b,G]}):G]}),s.jsx("div",{className:f.mergeClasses("grow overflow-auto",u),children:h}),re()]})})})})},Tu="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Eu="text-secondary dial-small-paragraph-text px-6 pb-4",Lu="px-6 py-4 h-[120px]",Au="Cancel",Ou="Ok",en={[it.Info]:{confirm:{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Solid}},[it.Danger]:{confirm:{variant:c.ButtonVariant.Danger,appearance:c.ButtonAppearance.Solid}}},wa=({header:e,description:t,descriptionClassName:r,open:n=!1,confirmLabel:a=Ou,cancelLabel:o=Au,isLoading:i=!1,disableConfirmButton:l=!1,className:d,confirmClassName:u,onClose:h,onConfirm:p,onCancel:g,children:x,variant:y=it.Info,size:v=We.Sm,footer:b,hideClose:C,...I})=>{const S=i?null:s.jsxs("div",{className:Tu,children:[s.jsx(os,{className:Jt,label:o,onClick:()=>g?g():h?.()}),s.jsx(Xe,{variant:en[y].confirm.variant,appearance:en[y].confirm.appearance,className:f.mergeClasses(Jt,u),label:a,disabled:l,onClick:p})]}),w=m.useCallback(()=>i?s.jsx("div",{className:Lu,children:s.jsx(Ve,{size:40})}):x??(t?s.jsx("div",{className:f.mergeClasses(Eu,r),children:t}):null),[x,t,i,r]);return s.jsx(hs,{...I,open:n,header:e,className:f.mergeClasses(d,c.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>h?.(),footer:b??S,size:v,hideClose:C??(!i&&b===void 0),children:w()})},_u="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",ku="min-w-0 flex-1 truncate text-primary",Ru="min-w-0 flex-1 truncate text-secondary",Mu="shrink-0 text-secondary",Pu="px-6 pb-4",Bu="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",zu="Cancel",Fu="Apply",Hu=({items:e,value:t,customValue:r,header:n,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:d,onSelectionChange:u,onCancel:h,onClose:p,isValid:g=!0,applyButtonLabel:x=Fu,cancelButtonLabel:y=zu,size:v=We.Md,portalId:b,disabled:C,invalid:I,error:S,caption:w,ariaLabel:N,className:L,fieldClassName:A})=>{const T=m.useId(),j=o??T,D=`${j}-label`,E=`${j}-value`,k=S?`${j}-error`:void 0,P=!S&&w?`${j}-caption`:void 0,[O,R]=m.useState(!1),M=d!==void 0,[H,W]=m.useState(t),K=M?d:H,V=m.useCallback(()=>{C||(M||W(t),R(!0))},[C,M,t]),G=m.useCallback(()=>{R(!1),p?.()},[p]),ee=m.useCallback(()=>{h?.(),G()},[h,G]),re=m.useCallback(()=>{a(K),G()},[a,K,G]),q=m.useCallback(_=>{M||W(_),u?.(_)},[M,u]),Y=c.resolveAccessibleName(i?.label),se=Y?void 0:c.resolveAccessibleName(N),le=Y?D:se&&`${j}-name`,oe=c.resolveAccessibleName(n),me=e.find(_=>_.value===t)?.label,ve=r??me;return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",L,c.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&s.jsx(c.Label,{...i,id:D,htmlFor:j}),s.jsxs("div",{className:"flex flex-col gap-1",children:[se&&s.jsx("span",{id:le,className:"sr-only",children:se}),s.jsxs("button",{type:"button",id:j,disabled:C,"aria-haspopup":"dialog","aria-expanded":O,"aria-labelledby":le?`${le} ${E}`:void 0,"aria-describedby":[k,P].filter(Boolean).join(" ")||void 0,onClick:V,className:f.mergeClasses(_u,I&&"dial-kit-input-error",C&&"dial-kit-input-disable",A),children:[s.jsx("span",{id:E,className:ve==null?Ru:ku,children:ve??l}),s.jsx(F.IconMaximize,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Mu})]}),s.jsx(c.ErrorText,{id:k,text:S}),!S&&s.jsx(c.CaptionText,{id:P,text:w})]}),s.jsx(hs,{open:O,header:n,ariaLabel:oe?void 0:Y,portalId:b,size:v,onClose:ee,footer:s.jsxs("div",{className:Bu,children:[s.jsx(os,{label:y,onClick:ee}),s.jsx(la,{label:x,disabled:!g,onClick:re})]}),children:s.jsx("div",{className:Pu,children:s.jsx(wt,{id:`${j}-options`,items:e,value:K,onChange:q,orientation:Oe.Column,ariaLabel:Y??oe})})})]})},$u=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:n,onClick:a,tooltipProps:o,size:i=c.ElementSize.Small,className:l,...d})=>{const u=m.useCallback(p=>{a?.(p),n?.(!r)},[a,n,r]),h=s.jsx(c.IconButton,{...d,size:i,variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":c.resolveAccessibleName(d["aria-label"],o?.tooltip),onClick:u,className:f.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,c.DIAL_KIT_CLASS.toggleIconButton)});return o?s.jsx(c.Tooltip,{asChild:!0,...o,children:h}):h},Ku={default:"dial-tiny-text",selected:"dial-tiny-semi-text"},Vu={default:"cursor-not-allowed text-control-disable-primary",selected:"cursor-not-allowed bg-control-disable-primary text-control-disable-primary"},Wu=({label:e,icon:t,isSelected:r=!1,onToggle:n,onClick:a,disabled:o=!1,className:i,title:l,...d})=>{const u=m.useCallback(p=>{a?.(p),!p.defaultPrevented&&n?.(!r)},[a,n,r]),h=r?"selected":"default";return s.jsxs("button",{...d,type:"button","aria-pressed":r,disabled:o,title:l??(typeof e=="string"?e:void 0),onClick:u,className:f.mergeClasses(na,Ku[h],o?Vu[h]:[aa[Se.Selectable][h],oa,ia],i,c.DIAL_KIT_CLASS.toggleChip),children:[t&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),s.jsx("span",{className:"truncate",children:e})]})},Gu=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Uu="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Zu="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",qu="bg-layer-raised text-accent shadow-xs",Yu="bg-transparent text-secondary",Xu="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Qu="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Ju="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",ef="cursor-not-allowed bg-transparent text-control-disable-primary",tf=({items:e,value:t,onChange:r,disabled:n,className:a,segmentClassName:o,"aria-label":i})=>{const l=m.useRef({}),d=e.find(p=>p.value===t),u=d&&!d.disabled?d.value:e.find(p=>!p.disabled)?.value,h=m.useCallback(p=>{if(n||!Gu.includes(p.key))return;const g=e.filter(C=>!C.disabled);if(g.length===0)return;const x=Math.max(g.findIndex(C=>C.value===t),0),y=g.length-1;let v=x;switch(p.key){case"ArrowRight":case"ArrowDown":v=x===y?0:x+1;break;case"ArrowLeft":case"ArrowUp":v=x===0?y:x-1;break;case"Home":v=0;break;case"End":v=y;break}p.preventDefault();const b=g[v];l.current[b.value]?.focus(),b.value!==t&&r(b.value)},[n,e,t,r]);return s.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":n||void 0,onKeyDown:h,className:f.mergeClasses(Uu,a,c.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const g=p.value===t,x=n||p.disabled;return s.jsxs("button",{ref:y=>{l.current[p.value]=y},type:"button",role:"radio","aria-checked":g,"aria-label":c.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===u?0:-1,disabled:x,onClick:()=>r(p.value),className:f.mergeClasses(Zu,g?qu:Yu,x?g?Ju:ef:g?Xu:Qu,o,c.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},rf={[ot.Error]:"Error",[ot.Warning]:"Warning"},sf={[Ge.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[Ge.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},nf=({tabs:e,activeTabId:t,onTabChange:r,orientation:n=Ge.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:d,sectionLabelClassName:u})=>{const h=m.useRef({}),p=m.useId(),g=n===Ge.Vertical,x=e.find(C=>C.id===t),y=x&&!x.disabled?x.id:e.find(C=>!C.disabled)?.id,v=m.useCallback(C=>{const{next:I,previous:S}=sf[n];if(![I,S,"Home","End"].includes(C.key)||e.length===0)return;const w=e.filter(j=>!j.disabled);if(w.length===0)return;const N=Math.max(w.findIndex(j=>j.id===t),0),L=w.length-1;let A=N;C.key===I?A=N===L?0:N+1:C.key===S?A=N===0?L:N-1:C.key==="Home"?A=0:A=L,C.preventDefault();const T=w[A];h.current[T.id]?.focus(),T.id!==t&&r(T.id)},[e,t,r,n]),b=s.jsx("div",{role:"tablist","aria-orientation":g?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?p:void 0,onKeyDown:v,className:f.mergeClasses(g?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,c.DIAL_KIT_CLASS.tabList,!a&&c.DIAL_KIT_CLASS.tabs),children:e.map(C=>{const I=t===C.id,S=!!C.disabled;return s.jsxs("button",{ref:w=>{h.current[C.id]=w},type:"button",role:"tab","aria-selected":I,disabled:S,tabIndex:C.id===y?0:-1,onClick:()=>r(C.id),className:f.mergeClasses("dial-kit-enhanced-target flex items-center gap-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-focus",g?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",I?"dial-small-semi-text":"dial-small-text text-secondary"]:["dial-small-paragraph-semi-text border-b-2 border-transparent px-3 py-2","focus-visible:outline-offset-2"],S&&(g?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!S&&(g?I?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":I?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),d,c.DIAL_KIT_CLASS.tab,I&&c.DIAL_KIT_CLASS.tabSelected),children:[C.icon&&s.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:C.icon}),s.jsx("span",{className:f.mergeClasses(g&&!I&&!S&&"text-primary"),children:C.label}),C.status&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("flex shrink-0",C.status===ot.Error?"text-error":"text-warning",g&&C.count==null&&"ms-auto"),children:C.status===ot.Error?s.jsx(F.IconExclamationCircle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE})}),s.jsx("span",{className:"sr-only",children:C.statusLabel??rf[C.status]})]}),C.count!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"ms-auto",S&&"bg-layer-sunken text-control-disable-primary",!S&&(I?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:C.count})]},C.id)})});return a?s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.tabs),children:[s.jsx("div",{className:f.mergeClasses("flex h-16 shrink-0 items-center",g?"px-4":"px-3"),children:s.jsx("span",{id:p,className:f.mergeClasses("dial-h1-text text-primary",u,c.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),b]}):b},af="flex flex-nowrap items-center gap-1",of="min-w-max flex-1 justify-center",lf=({items:e,value:t,onChange:r,stretch:n=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>s.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:f.mergeClasses(af,a,c.DIAL_KIT_CLASS.filterChips),children:e.map(d=>s.jsx(Le,{label:d.label,icon:d.icon,appearance:Se.Selectable,selected:d.value===t,onClick:()=>r(d.value),className:f.mergeClasses(n&&of,o)},d.value))}),Rr=(e,t)=>{const r=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const n=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(o=>{if(o.startsWith("."))return n.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},cf=({labelProps:e,label:t,description:r,onChange:n,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:d,icon:u,id:h,ariaLabel:p,className:g})=>{const x=m.useId(),y=h??`file-dropzone-${x}`,v=d?`${y}-error`:void 0,[b,C]=m.useState(!1),I=m.useRef(0),S=m.useCallback(D=>{if(D.length===0)return;const E=i?D:D.slice(0,1),k=E.filter(O=>Rr(O,o)),P=E.filter(O=>!Rr(O,o));P.length>0&&a?.(P),k.length>0&&n(k)},[o,i,n,a]),w=m.useCallback(D=>{S(Array.from(D.target.files??[])),D.target.value=""},[S]),N=m.useCallback(()=>{I.current=0,C(!1)},[]),L=m.useCallback(D=>{l||(D.preventDefault(),I.current+=1,C(!0))},[l]),A=m.useCallback(D=>{l||(D.preventDefault(),D.dataTransfer.dropEffect="copy")},[l]),T=m.useCallback(()=>{l||(I.current-=1,I.current<=0&&N())},[l,N]),j=m.useCallback(D=>{D.preventDefault(),!l&&(N(),S(Array.from(D.dataTransfer?.files??[])))},[l,N,S]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[e&&s.jsx(c.Label,{...e,htmlFor:y}),s.jsx("input",{id:y,type:"file",accept:o,multiple:i,disabled:l,onChange:w,"aria-label":c.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":v,"aria-invalid":d?!0:void 0,className:"peer sr-only"}),s.jsxs("label",{htmlFor:y,onDragEnter:L,onDragOver:A,onDragLeave:T,onDrop:j,className:f.mergeClasses("flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center","transition-colors motion-reduce:transition-none","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",l?"cursor-not-allowed border-secondary bg-layer-sunken":"cursor-pointer bg-layer-base",!l&&b&&"border-accent bg-control-accent-alpha",!l&&!b&&"border-secondary hover:border-accent",d&&!b&&"border-error hover:border-error",g,c.DIAL_KIT_CLASS.fileDropzone),children:[u??s.jsx(F.IconUpload,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),s.jsxs("span",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:f.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&s.jsx("span",{className:f.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),s.jsx(c.ErrorText,{id:v,text:d})]})},ja=({label:e="Shared",tooltip:t,size:r=12,className:n})=>s.jsx(c.Tooltip,{tooltip:t||"Shared",asChild:!0,children:s.jsx("span",{role:"img","aria-label":e,className:f.mergeClasses("flex shrink-0 rounded-xs bg-layer-raised text-accent",n,c.DIAL_KIT_CLASS.sharedEntityIndicator),children:s.jsx(F.IconArrowUpRight,{size:r,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var Ce=(e=>(e.Images="images",e.Video="video",e.Audio="audio",e.Code="code",e.Text="text",e.Pdf="pdf",e.Spreadsheet="spreadsheet",e.Presentation="presentation",e.Archive="archive",e.Dial="dial",e.Other="other",e))(Ce||{});const df={images:["apng","avif","bmp","gif","heic","heif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],video:["avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"],audio:["aac","aiff","flac","m4a","mid","midi","mp3","oga","ogg","opus","wav","wma"],code:["bash","c","cjs","cpp","cs","css","go","h","hpp","htm","html","ini","ipynb","java","js","json","jsx","kt","less","lua","mjs","php","ps1","py","r","rb","rs","sass","scala","scss","sh","sql","svelte","swift","toml","ts","tsx","vue","xml","yaml","yml","zsh"],text:["doc","docx","log","markdown","md","odt","rtf","text","txt"],pdf:["pdf"],spreadsheet:["csv","numbers","ods","tsv","xls","xlsm","xlsx"],presentation:["key","odp","pps","ppsx","ppt","pptx"],archive:["7z","bz2","gz","rar","tar","tgz","xz","zip"],dial:["dial"]},uf=new Map(Object.entries(df).flatMap(([e,t])=>t.map(r=>[r,e]))),ff=e=>uf.get(e)??"other",tn="var(--text-control-permanent, #FCFCFC)",Pt={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},pf="#1B212D",hf={[Ce.Images]:{path:"M11.0002 8.66667H11.0036M7.00024 11.3333L8.66691 9.66667C8.97624 9.369 9.35758 9.369 9.66691 9.66667L11.3336 11.3333M10.6669 10.6667L11.0002 10.3333C11.3096 10.0357 11.6909 10.0357 12.0002 10.3333L13.0002 11.3333M7.00024 8C7.00024 7.73478 7.1056 7.48043 7.29314 7.29289C7.48067 7.10536 7.73503 7 8.00024 7H12.0002C12.2655 7 12.5198 7.10536 12.7074 7.29289C12.8949 7.48043 13.0002 7.73478 13.0002 8V12C13.0002 12.2652 12.8949 12.5196 12.7074 12.7071C12.5198 12.8946 12.2655 13 12.0002 13H8.00024C7.73503 13 7.48067 12.8946 7.29314 12.7071C7.1056 12.5196 7.00024 12.2652 7.00024 12V8Z",sheet:Pt},[Ce.Code]:{path:"M8.33358 8.66665L7.00024 9.99998L8.33358 11.3333M11.6669 8.66665L13.0002 9.99998L11.6669 11.3333M10.6669 7.33331L9.33358 12.6666",sheet:{x1:"16.6667",y1:"0",x2:"2.08333",y2:"20.4167",from:"var(--bg-control-inverted, #57647A)",to:pf}},[Ce.Text]:{path:"M7.3335 8H12.6668M7.3335 10H12.6668M7.3335 12H11.3335",sheet:{x1:"25.8333",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-violet-1, #DDE3F9)",to:"var(--bg-gradient-1, #1D4ED8)"}},[Ce.Spreadsheet]:{path:"M7.33325 10.1667H12.6666M9.99992 7.5V12.8333M7.33325 8.16667C7.33325 7.98986 7.40349 7.82029 7.52851 7.69526C7.65354 7.57024 7.82311 7.5 7.99992 7.5H11.9999C12.1767 7.5 12.3463 7.57024 12.4713 7.69526C12.5963 7.82029 12.6666 7.98986 12.6666 8.16667V12.1667C12.6666 12.3435 12.5963 12.513 12.4713 12.6381C12.3463 12.7631 12.1767 12.8333 11.9999 12.8333H7.99992C7.82311 12.8333 7.65354 12.7631 7.52851 12.6381C7.40349 12.513 7.33325 12.3435 7.33325 12.1667V8.16667Z",sheet:{x1:"20.4167",y1:"-3.75",x2:"2.91667",y2:"20.4167",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-1, #059669)"}},[Ce.Pdf]:{fillPath:"M12.5373 10.3151C12.0382 10.3151 11.4137 10.4021 11.2094 10.4328C10.3637 9.54967 10.1231 9.04771 10.069 8.91388C10.1423 8.72544 10.3975 8.0096 10.4338 7.09022C10.4517 6.62991 10.3544 6.28596 10.1447 6.06792C9.93533 5.85024 9.68191 5.83331 9.60924 5.83331C9.35443 5.83331 8.92697 5.96216 8.92697 6.82503C8.92697 7.5737 9.27603 8.36813 9.37252 8.57339C8.86416 10.0536 8.31837 11.0669 8.20248 11.2753C6.15974 12.0444 6 12.788 6 12.9988C6 13.3775 6.26973 13.6036 6.72152 13.6036C7.8192 13.6036 8.8209 11.7607 8.98653 11.4407C9.76614 11.1301 10.8096 10.9377 11.0749 10.8918C11.8357 11.6166 12.7157 11.81 13.0811 11.81C13.3561 11.81 14 11.81 14 11.148C14 10.5332 13.2121 10.3151 12.5373 10.3151ZM12.4844 10.7497C13.0773 10.7497 13.234 10.9458 13.234 11.0494C13.234 11.1145 13.2093 11.3268 12.8915 11.3268C12.6065 11.3268 12.1145 11.1621 11.6303 10.8047C11.8322 10.7782 12.131 10.7497 12.4844 10.7497ZM9.57812 6.25458C9.63218 6.25458 9.66777 6.27195 9.69711 6.31264C9.86764 6.54926 9.73014 7.32242 9.56279 7.92745C9.40124 7.40867 9.28 6.61264 9.45058 6.33259C9.48392 6.27793 9.52204 6.25458 9.57812 6.25458ZM9.29017 10.8856C9.50483 10.452 9.74542 9.81997 9.87646 9.46253C10.1387 9.90147 10.4914 10.309 10.6954 10.53C10.0603 10.6639 9.57969 10.7976 9.29017 10.8856ZM6.4264 13.0566C6.41226 13.0399 6.41017 13.0045 6.42083 12.9621C6.44317 12.8731 6.61396 12.4322 7.84924 11.8796C7.67236 12.1582 7.39585 12.5563 7.09208 12.8537C6.87825 13.0538 6.71174 13.1553 6.59719 13.1553C6.55621 13.1553 6.49974 13.1442 6.4264 13.0566Z",sheet:{x1:"26.25",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-red, #FCE7F3)",to:"var(--bg-control-error-active, #CC4545)"}},[Ce.Audio]:{path:"M9 11.5C9 11.7652 8.89464 12.0195 8.70711 12.2071C8.51957 12.3946 8.26522 12.5 8 12.5C7.73478 12.5 7.48043 12.3946 7.29289 12.2071C7.10536 12.0195 7 11.7652 7 11.5C7 11.2347 7.10536 10.9804 7.29289 10.7929C7.48043 10.6053 7.73478 10.5 8 10.5C8.26522 10.5 8.51957 10.6053 8.70711 10.7929C8.89464 10.9804 9 11.2347 9 11.5ZM9 11.5V7.16663H12.3333V11.5M12.3333 11.5C12.3333 11.7652 12.228 12.0195 12.0404 12.2071C11.8529 12.3946 11.5985 12.5 11.3333 12.5C11.0681 12.5 10.8138 12.3946 10.6262 12.2071C10.4387 12.0195 10.3333 11.7652 10.3333 11.5C10.3333 11.2347 10.4387 10.9804 10.6262 10.7929C10.8138 10.6053 11.0681 10.5 11.3333 10.5C11.5985 10.5 11.8529 10.6053 12.0404 10.7929C12.228 10.9804 12.3333 11.2347 12.3333 11.5ZM9 8.49996H12.3333",sheet:Pt},[Ce.Video]:{path:"M9.99996 13.1667C11.8409 13.1667 13.3333 11.6743 13.3333 9.83333C13.3333 7.99238 11.8409 6.5 9.99996 6.5C8.15901 6.5 6.66663 7.99238 6.66663 9.83333C6.66663 11.6743 8.15901 13.1667 9.99996 13.1667ZM9.33337 8.5L11.3334 9.83333L9.33337 11.1667V8.5Z",sheet:Pt},[Ce.Presentation]:{path:"M7 7.33331H13M7.33333 7.33331V10.6666C7.33333 10.8435 7.40357 11.013 7.5286 11.1381C7.65362 11.2631 7.82319 11.3333 8 11.3333H12C12.1768 11.3333 12.3464 11.2631 12.4714 11.1381C12.5964 11.013 12.6667 10.8435 12.6667 10.6666V7.33331M10 11.3333V12.6666M9 12.6666H11M8.66667 9.99998L9.66667 8.99998L10.3333 9.66665L11.3333 8.66665",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-brown, #FDE8D8)",to:"var(--text-visual-brown-2, #B45309)"}},[Ce.Archive]:{path:"M10.0001 6.66669H9.58341M10.8334 7.451H10.4167M10.0001 8.23531H9.58341M10.8334 9.01963H10.4167M10.0001 9.80394H9.58341M10.8334 10.5883H10.4167M10.0001 11.3726C10.2211 11.3726 10.4331 11.4552 10.5893 11.6023C10.7456 11.7494 10.8334 11.9489 10.8334 12.1569V12.9412C10.8334 13.0452 10.7895 13.1449 10.7114 13.2185C10.6332 13.292 10.5273 13.3334 10.4167 13.3334H9.58341C9.47291 13.3334 9.36693 13.292 9.28879 13.2185C9.21065 13.1449 9.16675 13.0452 9.16675 12.9412V12.1569C9.16675 11.9489 9.25455 11.7494 9.41083 11.6023C9.56711 11.4552 9.77907 11.3726 10.0001 11.3726Z",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-3, #065F46)"}},[Ce.Dial]:{path:"M8.26392 7.44049C8.80816 7.44049 9.28449 7.50578 9.69653 7.63092L9.69849 7.6319C10.1079 7.75343 10.4556 7.938 10.7463 8.1817L10.7483 8.18365C11.0312 8.41601 11.2537 8.72491 11.4104 9.12115V9.12213C11.5666 9.51456 11.6496 9.98403 11.6497 10.5381C11.6497 11.5957 11.3539 12.3492 10.8108 12.8565C10.2602 13.3708 9.47204 13.6504 8.39868 13.6505H6.71313V7.44049H8.26392Z",fillPath:"M12.7167 12.1008L12.9558 12.3564L12.9558 12.3564L12.7167 12.1008ZM11.4504 6.20825L11.3486 6.54311L11.3507 6.54375L11.4504 6.20825ZM12.637 6.833L12.4119 7.10109L12.4147 7.10334L12.637 6.833ZM13.4108 7.9263L13.0853 8.05488L13.0856 8.05566L13.4108 7.9263ZM11.1666 12.8853L11.0909 12.5436V12.5436L11.1666 12.8853ZM10.4391 12.6553C10.2487 12.689 10.1217 12.8706 10.1553 13.0609C10.189 13.2513 10.3706 13.3783 10.5609 13.3447L10.5 13L10.4391 12.6553ZM13.6781 9.49291H13.3281C13.3281 10.5655 13.0283 11.33 12.4776 11.8451L12.7167 12.1008L12.9558 12.3564C13.687 11.6724 14.0281 10.6984 14.0281 9.49291H13.6781ZM7.9751 6.12805H8.3251C8.3251 6.24476 8.23053 6.35 8.1009 6.35V6V5.65C7.83231 5.65 7.6251 5.86989 7.6251 6.12805H7.9751ZM8.1009 6V6.35H9.89799V6V5.65H8.1009V6ZM9.89799 6V6.35C10.449 6.35 10.9312 6.41618 11.3486 6.54311L11.4504 6.20825L11.5522 5.87339C11.0566 5.72265 10.5039 5.65 9.89799 5.65V6ZM11.4504 6.20825L11.3507 6.54375C11.7654 6.66701 12.1173 6.85376 12.4119 7.10107L12.637 6.833L12.862 6.56492C12.4875 6.2506 12.0484 6.02084 11.5501 5.87275L11.4504 6.20825ZM12.637 6.833L12.4147 7.10334C12.7016 7.33926 12.9264 7.65273 13.0853 8.05488L13.4108 7.9263L13.7363 7.79772C13.5387 7.29746 13.2477 6.88206 12.8593 6.56265L12.637 6.833ZM13.4108 7.9263L13.0856 8.05566C13.2441 8.45409 13.3281 8.93071 13.3281 9.49291H13.6781H14.0281C14.0281 8.86239 13.934 8.29465 13.736 7.79694L13.4108 7.9263ZM7.9751 7.21882H8.3251V6.12805H7.9751H7.6251V7.21882H7.9751ZM12.7167 12.1008L12.4776 11.8451C12.117 12.1824 11.6591 12.4177 11.0909 12.5436L11.1666 12.8853L11.2423 13.227C11.9168 13.0776 12.4923 12.7898 12.9558 12.3564L12.7167 12.1008ZM11.1666 12.8853L11.0909 12.5436C11.091 12.5435 11.0826 12.5452 11.0606 12.5493C11.041 12.5528 11.0155 12.5573 10.9857 12.5625C10.926 12.5729 10.8511 12.5857 10.7756 12.5984C10.6269 12.6236 10.472 12.6495 10.4391 12.6553L10.5 13L10.5609 13.3447C10.6064 13.3366 11.1725 13.2425 11.2423 13.227L11.1666 12.8853Z",sheet:"var(--bg-gradient-2, #885DF2)"},[Ce.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:Pt}},mf=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${m.useId().replace(/[^\w-]/g,"")}`,{path:n,fillPath:a,sheet:o}=hf[t],i=typeof o=="string";return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.jsx("path",{d:"M17.4999 3.97859V16C17.4999 18.2091 15.709 20 13.4999 20H6.5C4.29086 20 2.5 18.2091 2.5 16V4C2.5 1.79086 4.29086 0 6.5 0H13.1683H13.5213C15.7186 0 17.4999 1.78128 17.4999 3.97859Z",fill:i?o:`url(#${r})`}),n&&s.jsx("path",{d:n,stroke:tn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&s.jsx("path",{d:a,fill:tn}),!i&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:r,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:o.from}),s.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},gf=({size:e})=>{const t=`dial-kit-folder-gradient-${m.useId().replace(/[^\w-]/g,"")}`;return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.jsx("path",{d:"M6.38992 3.75H4.66663C3.00977 3.75 1.66663 5.09315 1.66663 6.75V7.91667H7.16339L10.8333 5.79247L7.85075 4.1297C7.40412 3.8807 6.90127 3.75 6.38992 3.75Z",fill:"var(--stroke-gradient-1, #5976E9)"}),s.jsx("path",{d:"M14.3333 5.41669C16.5424 5.41669 18.3333 7.20755 18.3333 9.41669V12.25C18.3333 14.4592 16.5424 16.25 14.3333 16.25H5.66663C3.45749 16.25 1.66663 14.4592 1.66663 12.25V7.6708C1.66663 7.11851 2.11434 6.6708 2.66663 6.6708H6.89447C7.43998 6.6708 7.97973 6.55922 8.48053 6.34291L9.86582 5.74458C10.3666 5.52827 10.9064 5.41669 11.4519 5.41669H14.3333Z",fill:`url(#${t})`}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),s.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},xf=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),bf=(e,t)=>e===Ae.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",vf=(e,t,r)=>e===Ae.Folder?s.jsx(gf,{size:r}):s.jsx(mf,{size:r,kind:ff(t)}),ms=({type:e,name:t,fileExtension:r,shared:n=!1,loading:a=!1,size:o=f.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:d,loadingLabel:u="Loading",sharedIndicatorClassName:h,sharedIndicatorTooltip:p})=>{if(e!==Ae.File&&e!==Ae.Folder)return null;const g=e===Ae.File?xf(t,r):"",x=bf(e,g),y=d??(n?`${x}, shared`:x),v=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":y};return s.jsxs("span",{className:f.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,c.DIAL_KIT_CLASS.fileIcon),...v,children:[a?s.jsx(Ve,{size:o,ariaLabel:u}):vf(e,g,o),n&&s.jsx(ja,{tooltip:p,className:f.mergeClasses("absolute -bottom-0.5 -left-0.5",h)})]})},Da=({name:e,type:t=Ae.File,fileExtension:r,icon:n,shared:a=!1,loading:o=!1,loadingLabel:i,iconSize:l,details:d,isInvalidName:u=!1,className:h,nameClassName:p,sharedIndicatorClassName:g,sharedIndicatorTooltip:x,sharedLabel:y="Shared",hideTooltip:v=!1,tooltipContent:b})=>s.jsxs("div",{className:f.mergeClasses("flex w-full min-w-0 items-center gap-2",h,c.DIAL_KIT_CLASS.fileName),children:[n!=null&&!o?s.jsx("span",{"aria-hidden":!0,className:"flex shrink-0 items-center justify-center",children:n}):s.jsx(ms,{name:e,type:t,fileExtension:r,shared:a,loading:o,loadingLabel:i,size:l,sharedIndicatorClassName:g,sharedIndicatorTooltip:x,decorative:!o}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!d}),children:[s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("dial-small-paragraph-text",u?"text-secondary":"text-primary",p),text:e,hideTooltip:v,customTooltipContent:b}),a&&s.jsx("span",{className:"sr-only",children:y}),d]})]}),yf=({className:e,...t})=>s.jsx(Da,{...t,type:Ae.Folder,className:f.mergeClasses(e,c.DIAL_KIT_CLASS.folderName)}),Cf=({open:e,onClose:t,title:r,ariaLabel:n,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:d,className:u,overlayClassName:h,headerClassName:p,style:g,overlayStyle:x,bodyClassName:y,titleClassName:v,portalId:b})=>{const C=c.useThemeScope(),I=`bottom-sheet-title-${m.useId()}`,{refs:S,context:w}=B.useFloating({open:e,onOpenChange:T=>{T||t()}}),N=B.useRole(w,{role:"dialog"}),L=B.useDismiss(w,{outsidePress:l}),{getFloatingProps:A}=B.useInteractions([N,L]);return e?s.jsx(B.FloatingPortal,{id:b,children:s.jsx(B.FloatingOverlay,{lockScroll:!0,style:x,className:f.mergeClasses("z-popup flex items-end bg-backdrop",C,h,c.DIAL_KIT_CLASS.bottomSheetOverlay),children:s.jsx(B.FloatingFocusManager,{context:w,initialFocus:S.floating,children:s.jsxs("div",{ref:S.setFloating,...A(),role:"dialog","aria-modal":"true","aria-labelledby":r?I:void 0,"aria-label":r?void 0:n,style:g,className:f.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-hidden","animate-slideUp motion-reduce:animate-none",u,c.DIAL_KIT_CLASS.bottomSheet),children:[r&&s.jsxs("div",{className:f.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",p),children:[a&&s.jsx(c.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:s.jsx(F.IconArrowLeft,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),s.jsx("h2",{id:I,className:f.mergeClasses("min-w-0 truncate text-primary",v??"dial-body-semi-text"),children:r}),s.jsx(c.CloseButton,{ariaLabel:i,onClose:t,size:c.ElementSize.Standard,className:"absolute end-4"})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 overflow-y-auto",y),children:d})]})})})}):null};var lt=(e=>(e.Circle="circle",e.Square="square",e))(lt||{}),Pe=(e=>(e.Green1="green-1",e.Violet2="violet-2",e.Brown="brown",e.Red="red",e.Green2="green-2",e.Blue="blue",e.Violet1="violet-1",e))(Pe||{});const Ta={[Pe.Green1]:{background:"bg-green-1",foreground:"text-green-2"},[Pe.Violet2]:{background:"bg-violet-2",foreground:"text-violet-1"},[Pe.Brown]:{background:"bg-brown",foreground:"text-brown-2"},[Pe.Red]:{background:"bg-red",foreground:"text-red"},[Pe.Green2]:{background:"bg-green-2",foreground:"text-green-3"},[Pe.Blue]:{background:"bg-blue",foreground:"text-accent"},[Pe.Violet1]:{background:"bg-violet-1",foreground:"text-violet-2"}},If=e=>{const t=Object.values(Ta);let r=0;for(let n=0;n<e.length;n++)r+=e.charCodeAt(n);return t[r%t.length]},rn=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",Ea=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(rn(t[0])+rn(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},Sf={[lt.Circle]:"rounded-full",[lt.Square]:"rounded-md"},La=({name:e,initials:t,src:r,alt:n="",size:a=32,shape:o=lt.Circle,color:i,className:l,textClassName:d,imageClassName:u,onImageError:h})=>{const[p,g]=m.useState(),x=!!r&&p!==r,y=n!=="",v=I=>f.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",Sf[o],I,l,c.DIAL_KIT_CLASS.avatar);if(x)return s.jsx("img",{src:r,alt:n,width:a,height:a,className:f.mergeClasses(v(u),"object-cover"),onError:I=>{g(r),h?.(I)}});const{background:b,foreground:C}=i??If(e);return s.jsx("span",{role:y?"img":void 0,"aria-label":y?n:void 0,"aria-hidden":y?void 0:!0,className:v(f.mergeClasses(b,C)),style:{width:a,height:a,fontSize:d?void 0:Math.round(a*.4)},children:s.jsx("span",{className:f.mergeClasses("leading-none",d??"font-semibold"),children:t??Ea(e)})})};var pe=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(pe||{});const Nf={[pe.Model]:"Model",[pe.Agent]:"Agent",[pe.Toolset]:"Toolset",[pe.Skill]:"Skill",[pe.Prompt]:"Prompt"},sn={[pe.Model]:"text-blue",[pe.Agent]:"text-green-1",[pe.Toolset]:"text-brown-2",[pe.Skill]:"text-violet-1",[pe.Prompt]:"text-violet-2"},wf={[pe.Model]:"bg-blue",[pe.Agent]:"bg-green-2",[pe.Toolset]:"bg-brown",[pe.Skill]:"bg-violet-2",[pe.Prompt]:"bg-violet-1"},jf=["h1","h2","h3","h4","h5","h6"],Df=e=>jf[Math.min(6,Math.max(1,Math.round(e)))-1],Aa=({item:e,labels:t,showType:r=!0,showVersion:n=!0,hasFeaturedTag:a=!0,iconSize:o=48,headingLevel:i=3,query:l,footer:d,statusBadge:u,className:h,nameClassName:p="dial-h3-text",typeClassName:g="dial-caption-lead-semi-text",versionClassName:x="dial-tiny-text",iconClassName:y,featuredChipClassName:v})=>{const b=Df(i),C=a&&!!e.isFeatured,I=u!=null||C,S=n?e.version:void 0,w=r?t?.type??Nf[e.type]:void 0;return s.jsxs("div",{className:f.mergeClasses("flex items-start gap-2",h,c.DIAL_KIT_CLASS.entityIdentity),children:[s.jsx(La,{name:e.name,src:e.iconUrl,size:o,shape:lt.Square,imageClassName:"bg-entity-icon",className:f.mergeClasses("rounded-[14px]",y)}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",d!=null&&"self-stretch"),children:[(I||w)&&s.jsxs("div",{className:"relative flex items-center justify-between",children:[w&&s.jsx("span",{className:f.mergeClasses("uppercase",g,sn[e.type]),children:w}),I&&s.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[u,C&&s.jsx("span",{className:f.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",wf[e.type],sn[e.type],v),children:t?.featured??"Featured"})]})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(b,{className:f.mergeClasses("min-w-0 shrink text-primary",p),children:l?s.jsx(c.Highlight,{text:e.name,query:l,maxLines:1}):s.jsx(c.EllipsisTooltip,{text:e.name})}),S!=null&&s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("max-w-[30%] shrink-0 text-secondary",x),text:S})]}),d!=null&&d]})]})},wr="bg-control-neutral-active",Tf=({iconSize:e})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"shrink-0 overflow-hidden rounded-[14px]",children:s.jsx($t,{variant:Ee.Rectangular,width:e,height:e,className:wr})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx($t,{variant:Ee.Text,width:"30%",height:12,className:wr}),s.jsx($t,{variant:Ee.Text,width:"60%",height:16,className:wr})]})]}),Ef=({entityId:e,item:t,isLoading:r=!1,isDisabled:n=!1,error:a,details:o,labels:i,showType:l=!0,iconSize:d=44,headingLevel:u=4,className:h})=>{const p=o!=null?s.jsx("span",{className:"dial-caption-text text-secondary",children:o}):void 0,g=()=>e?r?s.jsx(Tf,{iconSize:d}):t==null?s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:e}),p]}):s.jsx(Aa,{item:t,labels:{type:i?.type},hasFeaturedTag:!1,iconSize:d,headingLevel:u,nameClassName:"dial-body-semi-text",showType:l,footer:p}):s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:i?.placeholder??"Not selected"});return s.jsxs("div",{children:[s.jsx("div",{className:f.mergeClasses("rounded-2xl border bg-layer-raised p-3",a?"border-error":"border-tertiary",n&&"opacity-50",h,c.DIAL_KIT_CLASS.selectedEntityCard),children:g()}),s.jsx(c.ErrorText,{text:a,className:"mt-1 block"})]})},Lf=({open:e,onClose:t,header:r,ariaLabel:n,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:d="Close",closeDisabled:u=!1,hideClose:h=!1,closeOnOutsideClick:p=!0,children:g,className:x,overlayClassName:y,headerClassName:v,style:b,overlayStyle:C,bodyClassName:I,titleClassName:S,portalId:w})=>{const N=c.useThemeScope(),L=`side-drawer-title-${m.useId()}`,A=typeof r=="string",{refs:T,context:j}=B.useFloating({open:e,onOpenChange:O=>{O||t()}}),D=B.useRole(j,{role:"dialog"}),E=B.useDismiss(j,{outsidePress:p}),{getFloatingProps:k}=B.useInteractions([D,E]),P=r!=null||o!=null||!h;return s.jsx(B.FloatingPortal,{id:w,children:s.jsx(B.FloatingOverlay,{lockScroll:e,style:C,className:f.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",N,y),children:s.jsx(B.FloatingFocusManager,{context:j,disabled:!e,initialFocus:T.floating,children:s.jsxs("div",{ref:T.setFloating,...k(),role:"dialog","aria-modal":"true","aria-labelledby":A?L:void 0,"aria-label":A?void 0:n,inert:!e,style:b,className:f.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-hidden","desktop:w-[540px] desktop:rounded-s-xl desktop:border-s desktop:border-secondary","transition-transform duration-300 motion-reduce:transition-none",e?"translate-x-0":"translate-x-full rtl:-translate-x-full",x,c.DIAL_KIT_CLASS.sideDrawer),children:[P&&s.jsxs("div",{className:f.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",v),children:[o&&s.jsx(c.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),A?s.jsx("h2",{id:L,className:f.mergeClasses("min-w-0 flex-1 truncate text-primary",S??"dial-h2-text"),children:r}):s.jsx("div",{className:"min-w-0 flex-1",children:r}),a,!h&&s.jsx(c.CloseButton,{ariaLabel:d,onClose:t,disabled:u,size:c.ElementSize.Standard})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 flex-1 overflow-y-auto",I),children:g})]})})})})},Af=4,Of=24,nn=e=>parseFloat(e)||0,_f=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},kf=()=>{},Rf=({id:e,value:t,defaultValue:r,size:n=c.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:d,disabled:u=!1,readOnly:h=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:x="Tags",className:y,fieldClassName:v,tagClassName:b,onChange:C})=>{const I=m.useId(),S=e||I,w=n===c.ElementSize.Small,N=m.useRef(null),L=m.useRef([]),A=m.useRef(null),T=t!==void 0,[j,D]=m.useState(r??[]),E=T?t:j,k=E.length,[P,O]=m.useState(""),[R,M]=m.useState(k),H=!h&&!u,W=m.useCallback(_=>{T||D(_),C?.(_)},[T,C]),K=m.useCallback(_=>U=>{L.current[_]=U},[]),V=m.useCallback(()=>{const _=N.current;if(!_||_.clientWidth===0){M(E.length);return}const{paddingLeft:U,paddingRight:de}=getComputedStyle(_);M(sa({availableWidth:_.clientWidth-nn(U)-nn(de)-(h?0:Of),tagWidths:E.map((ne,ge)=>L.current[ge]?.offsetWidth??0),overflowChipWidth:A.current?.offsetWidth??0,gap:Af}))},[h,E]);m.useEffect(()=>{if(!p){M(k);return}const _=N.current;if(!_)return;const U=new ResizeObserver(()=>V());return U.observe(_),V(),()=>U.disconnect()},[p,V,k]);const G=f.mergeClasses(p?"shrink-0":"min-w-0",b),ee=_=>{const U=_f(_.trim()).trim();!U||E.includes(U)||W([...E,U])},re=_=>{W(E.filter(U=>U!==_))},q=()=>{ee(P),O("")},Y=_=>{if(H){if(_.key==="Enter"||_.key===","){_.preventDefault(),q();return}_.key==="Backspace"&&!P&&k>0&&(_.preventDefault(),W(E.slice(0,-1)))}},se=()=>{H&&P.trim()&&q()},le=p?E.slice(0,R):E,oe=p?E.slice(R):[],me=oe.join(", "),ve=k>0&&s.jsxs("span",{role:"list","aria-label":x,className:f.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[le.map(_=>s.jsx(Le,{role:"listitem",label:_,className:G,disabled:u,closable:H,onRemove:H?()=>re(_):void 0},_)),oe.length>0&&s.jsx(Le,{role:"listitem",label:`+${oe.length}`,"aria-label":me,title:me,className:f.mergeClasses("shrink-0",b),disabled:u}),p&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[E.map((_,U)=>s.jsx("span",{ref:K(U),className:"inline-flex",children:s.jsx(Le,{label:_,className:b,disabled:u,closable:H,onRemove:H?kf:void 0})},_)),s.jsx("span",{ref:A,className:"inline-flex",children:s.jsx(Le,{label:`+${k}`,className:b})})]})]});return s.jsx(c.Input,{id:S,size:n,labelProps:a,caption:i,error:l,invalid:d,disabled:u,readOnly:h,value:P,placeholder:k>0?void 0:o,"aria-label":g,wrapperRef:N,onChange:_=>O(_??""),onKeyDown:Y,onBlur:se,containerClassName:f.mergeClasses("w-full",y),wrapperClassName:f.mergeClasses(k>0&&["!h-auto",w?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",p?"flex-nowrap overflow-hidden":"flex-wrap"],v,c.DIAL_KIT_CLASS.tagInput),className:f.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",h&&"cursor-default"),children:ve})},Mf=(e,t,r,n)=>{const a=t.trim().toLowerCase(),o=new Set(r);return e.filter(({value:i,label:l,description:d})=>!o.has(i)&&[l,i,d].some(u=>u?.toLowerCase().includes(a))).slice(0,Math.max(n,0))},Pf=5,Bf=({id:e,value:t,defaultValue:r,suggestions:n,maxSuggestions:a=Pf,openOnFocus:o=!1,size:i=c.ElementSize.Standard,labelProps:l,placeholder:d,caption:u,error:h,invalid:p=!1,disabled:g=!1,readOnly:x=!1,ariaLabel:y,tagListLabel:v="Tags",getRemoveTagLabel:b,className:C,fieldClassName:I,tagClassName:S,listClassName:w,onChange:N})=>{const L=m.useId(),A=e||L,T=`${A}-listbox`,j=c.useThemeScope(),D=i===c.ElementSize.Small,E=t!==void 0,[k,P]=m.useState(r??[]),O=E?t:k,R=O.length>0,M=!x&&!g,[H,W]=m.useState(""),[K,V]=m.useState(!1),[G,ee]=m.useState(0),re=!H.trim(),q=m.useMemo(()=>Mf(n,H,O,o&&re?n.length:a),[H,re,a,o,n,O]),Y=K&&M&&q.length>0,se=Math.min(G,q.length-1),le=Y&&se>=0,oe=J=>`${T}-option-${J}`,{refs:me,floatingStyles:ve}=B.useFloating({open:Y,placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(c.overlayGap),B.flip({padding:c.overlayGap}),B.size({padding:c.overlayGap,apply({rects:J,availableHeight:ce,elements:he}){he.floating.style.width=`${Math.round(J.reference.width)}px`,he.floating.style.maxHeight=`${Math.floor(ce)}px`}})]}),_=m.useCallback(J=>{E||P(J),N?.(J)},[E,N]),U=()=>{V(!1),ee(0)},de=()=>{!o||!M||(V(!0),ee(re?-1:0))},ne=J=>{const ce=J.trim();ce&&!O.includes(ce)&&_([...O,ce]),W(""),o?ee(-1):U()},ge=J=>_(O.filter(ce=>ce!==J)),Qe=J=>{const ce=J??"",he=!!ce.trim();W(ce),V(he||o),ee(he?0:-1)},ft=J=>{if(M)switch(J.key){case"ArrowDown":case"ArrowUp":{if(J.preventDefault(),!Y){V(!0),ee(0);return}const ce=J.key==="ArrowDown"?1:-1,he=se<0?Math.min(-ce,0):se;ee((he+ce+q.length)%q.length);return}case"Enter":case",":J.preventDefault(),ne(le?q[se].value:H);return;case"Escape":Y&&J.preventDefault(),U();return;case"Backspace":!H&&R&&(J.preventDefault(),_(O.slice(0,-1)));return}},pt=J=>J.preventDefault();return s.jsxs(s.Fragment,{children:[s.jsx(c.Input,{id:A,role:"combobox","aria-autocomplete":"list","aria-expanded":Y,"aria-controls":T,"aria-activedescendant":le?oe(se):void 0,"aria-invalid":p||void 0,"aria-label":y,size:i,labelProps:l,caption:u,error:h,invalid:p,disabled:g,readOnly:x,value:H,placeholder:R?void 0:d,wrapperRef:me.setReference,onChange:Qe,onKeyDown:ft,onFocus:de,onClick:de,onBlur:U,containerClassName:f.mergeClasses("w-full",C),wrapperClassName:f.mergeClasses(R&&["!h-auto flex-wrap gap-1 py-2",D?"min-h-[24px]":"min-h-[40px]"],I,c.DIAL_KIT_CLASS.autocompleteTagInput),className:f.mergeClasses("w-auto min-w-[100px] flex-1",x&&"cursor-default"),children:R&&s.jsx("span",{role:"list","aria-label":v,className:"flex min-w-0 flex-wrap items-center gap-1",children:O.map(J=>s.jsx(Le,{role:"listitem",label:J,className:f.mergeClasses(Xt,"min-w-0",S),disabled:g,closable:M,removeLabel:b?.(J),onRemove:M?()=>ge(J):void 0},J))})}),s.jsx(B.FloatingPortal,{children:s.jsx("div",{ref:me.setFloating,id:T,role:"listbox","aria-label":v,hidden:!Y,style:ve,className:f.mergeClasses("z-floating overflow-y-auto",c.overlaySurfaceClassName,c.overlayListClassName,!Y&&"hidden",j,w),children:Y&&q.map((J,ce)=>{const he=ce===se;return s.jsx(c.MenuItem,{id:oe(ce),role:"option","aria-selected":he,tabIndex:-1,label:J.label,description:J.description,mark:c.MenuItemMark.Tint,selected:he,onMouseDown:pt,onMouseEnter:()=>ee(ce),onClick:()=>ne(J.value)},J.value)})})})]})},zf=(e,t)=>{if(e<=0||t<=0)return[];const r=Math.floor(e/t+1e-9);return Array.from({length:r},(n,a)=>(a+1)*t/e*100)},Oa=e=>(e.toString().split(".")[1]??"").length,Ff=(e,t,r,n)=>{const a=Math.min(r,Math.max(t,e));if(n<=0)return a;const o=Math.round(Number(((a-t)/n).toFixed(9))),i=t+o*n;return Number(Math.min(r,i).toFixed(Oa(n)))},Hf=12,an=e=>`calc(${e}% + ${(.5-e/100)*Hf}px)`,$f=(e,t)=>e&&t?"grid-cols-[auto_minmax(0,1fr)_auto]":e?"grid-cols-[auto_minmax(0,1fr)]":t?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]",Kf=({id:e,value:t,min:r=0,max:n=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:d,showValue:u=!1,showTooltip:h=!1,showTicks:p=!1,leftContent:g,rightContent:x,showValueInput:y=!1,valueInputAriaLabel:v,caption:b,error:C,onChange:I,containerClassName:S,trackClassName:w,fillClassName:N,className:L,...A})=>{const T=m.useId(),j=e??T,D=b&&!C?`${j}-caption`:void 0,E=C?`${j}-error`:void 0,k=n-r,P=k>0?Math.min(100,Math.max(0,(t-r)/k*100)):0,O=an(P),R=p&&!o?zf(k,a):[],M=h&&!o,H=g!=null,W=y||x!=null,K=Oa(a),[V,G]=m.useState(null),ee=d?d(t):t.toFixed(K),re=m.useCallback(se=>{I?.(Number(se.target.value))},[I]),q=m.useCallback(se=>{const le=se==null?"":String(se);G(le);const oe=Number(le);le!==""&&Number.isFinite(oe)&&I?.(Ff(oe,r,n,a))},[n,r,I,a]),Y=m.useCallback(()=>G(null),[]);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",S),children:[(i||u)&&s.jsxs("div",{className:"flex items-center gap-2",children:[i&&s.jsx(c.Label,{...i,htmlFor:j}),u&&s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:ee})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("grid items-center gap-y-1",y?"gap-x-2":"gap-x-3",$f(H,W),M&&"mt-2"),children:[H&&s.jsx("div",{className:"flex items-center",children:g}),s.jsxs("div",{className:"relative flex h-6 items-center",children:[s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-accent-muted",w)}),R.map(se=>s.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute size-0.5 -translate-x-1/2 rounded-full border border-accent-focus",style:{left:an(se)}},se)),s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",N),style:{width:O}}),M&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none absolute bottom-full mb-0.5 flex -translate-x-1/2 flex-col items-center",style:{left:O},children:[s.jsx("span",{className:"whitespace-nowrap rounded-md bg-control-inverted px-2 py-0.5 dial-small-text text-control-inverted shadow-xs",children:ee}),s.jsx("svg",{width:"8",height:"4",viewBox:"0 0 8 4",className:"fill-control-inverted",children:s.jsx("path",{d:"M0 0h8L4 4z"})})]}),s.jsx("input",{...A,type:"range",id:j,value:t,min:r,max:n,step:a,disabled:o,onChange:re,"aria-label":c.resolveAccessibleName(typeof i?.label!="string"?A["aria-label"]:void 0),"aria-valuetext":d?ee:void 0,"aria-describedby":E??D,className:f.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",L)})]}),W&&s.jsx("div",{className:"flex items-center",children:y?s.jsx(ds,{"aria-label":c.resolveAccessibleName(v??(typeof i?.label=="string"?i.label:void 0)),value:V??t.toFixed(K),min:r,max:n,step:a,disabled:o,size:c.ElementSize.Small,containerClassName:"w-12",className:"text-center",onChange:q,onBlur:Y}):x}),l&&s.jsx("div",{className:f.mergeClasses("dial-tiny-text flex text-secondary",H&&"col-start-2"),children:l.length===3?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"flex-1 text-center",children:l[1]}),s.jsx("span",{children:l[2]})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"ml-auto",children:l[1]})]})})]}),s.jsx(c.ErrorText,{id:E,text:C}),!C&&s.jsx(c.CaptionText,{id:D,text:b})]})]})},Vf=48,Wf=({children:e,title:t,width:r=280,collapsedWidth:n=Vf,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:d="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:h="Expand sidebar",className:p,titleClassName:g,contentClassName:x,footerClassName:y})=>{const v=a!==void 0,[b,C]=m.useState(o),I=v?a:b,S=`collapsible-sidebar-content-${m.useId()}`,w=I?u:h,N=L=>{const A=!I;v||C(A),i?.(A,L)};return s.jsxs("aside",{"aria-label":d,style:{width:`${I?r:n}px`},className:f.mergeClasses("flex flex-col justify-between",p,c.DIAL_KIT_CLASS.collapsibleSidebar),children:[s.jsx("div",{id:S,hidden:!I,className:f.mergeClasses("min-h-0 flex-1 overflow-auto p-4",x),children:e}),s.jsx("div",{hidden:I,className:f.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),s.jsxs("div",{className:f.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",I?"justify-end px-2":"justify-center",y),children:[I&&l,s.jsx(c.IconButton,{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,size:c.ElementSize.Standard,onClick:N,"aria-label":w,"aria-expanded":I,"aria-controls":S,tooltipProps:{tooltip:w},icon:I?s.jsx(F.IconChevronsLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconChevronsRight,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})};var ie=function(){return ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ie.apply(this,arguments)},on={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},ln={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Bt={width:"20px",height:"20px",position:"absolute",zIndex:1},Gf={top:ie(ie({},on),{top:"-5px"}),right:ie(ie({},ln),{left:void 0,right:"-5px"}),bottom:ie(ie({},on),{top:void 0,bottom:"-5px"}),left:ie(ie({},ln),{left:"-5px"}),topRight:ie(ie({},Bt),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:ie(ie({},Bt),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:ie(ie({},Bt),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:ie(ie({},Bt),{left:"-10px",top:"-10px",cursor:"nw-resize"})},Uf=m.memo(function(e){var t=e.onResizeStart,r=e.direction,n=e.children,a=e.replaceStyles,o=e.className,i=m.useCallback(function(u){t(u,r)},[t,r]),l=m.useCallback(function(u){t(u,r)},[t,r]),d=m.useMemo(function(){return ie(ie({position:"absolute",userSelect:"none"},Gf[r]),a??{})},[a,r]);return s.jsx("div",{className:o||void 0,style:d,onMouseDown:i,onTouchStart:l,children:n})}),Zf=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Te=function(){return Te=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Te.apply(this,arguments)},qf={width:"auto",height:"auto"},zt=function(e,t,r){return Math.max(Math.min(e,r),t)},cn=function(e,t,r){var n=Math.round(e/t);return n*t+r*(n-1)},rt=function(e,t){return new RegExp(e,"i").test(t)},Ft=function(e){return!!(e.touches&&e.touches.length)},Yf=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},dn=function(e,t,r){r===void 0&&(r=0);var n=t.reduce(function(o,i,l){return Math.abs(i-e)<Math.abs(t[o]-e)?l:o},0),a=Math.abs(t[n]-e);return r===0||a<r?t[n]:e},jr=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Ht=function(e,t,r,n){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var a=Number(e.replace("%",""))/100;return t*a}if(e.endsWith("vw")){var a=Number(e.replace("vw",""))/100;return r*a}if(e.endsWith("vh")){var a=Number(e.replace("vh",""))/100;return n*a}}return e},Xf=function(e,t,r,n,a,o,i){return n=Ht(n,e.width,t,r),a=Ht(a,e.height,t,r),o=Ht(o,e.width,t,r),i=Ht(i,e.height,t,r),{maxWidth:typeof n>"u"?void 0:Number(n),maxHeight:typeof a>"u"?void 0:Number(a),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof i>"u"?void 0:Number(i)}},Qf=function(e){return Array.isArray(e)?e:[e,e]},Jf=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],un="__resizable_base__",ep=(function(e){Zf(t,e);function t(r){var n,a,o,i,l=e.call(this,r)||this;return l.ratio=1,l.resizable=null,l.parentLeft=0,l.parentTop=0,l.resizableLeft=0,l.resizableRight=0,l.resizableTop=0,l.resizableBottom=0,l.targetLeft=0,l.targetTop=0,l.delta={width:0,height:0},l.appendBase=function(){if(!l.resizable||!l.window)return null;var d=l.parentNode;if(!d)return null;var u=l.window.document.createElement("div");return u.style.width="100%",u.style.height="100%",u.style.position="absolute",u.style.transform="scale(0, 0)",u.style.left="0",u.style.flex="0 0 100%",u.classList?u.classList.add(un):u.className+=un,d.appendChild(u),u},l.removeBase=function(d){var u=l.parentNode;u&&u.removeChild(d)},l.state={isResizing:!1,width:(a=(n=l.propsSize)===null||n===void 0?void 0:n.width)!==null&&a!==void 0?a:"auto",height:(i=(o=l.propsSize)===null||o===void 0?void 0:o.height)!==null&&i!==void 0?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},l.onResizeStart=l.onResizeStart.bind(l),l.onMouseMove=l.onMouseMove.bind(l),l.onMouseUp=l.onMouseUp.bind(l),l}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||qf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var r=0,n=0;if(this.resizable&&this.window){var a=this.resizable.offsetWidth,o=this.resizable.offsetHeight,i=this.resizable.style.position;i!=="relative"&&(this.resizable.style.position="relative"),r=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:a,n=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=i}return{width:r,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var r=this,n=this.props.size,a=function(l){var d;if(typeof r.state[l]>"u"||r.state[l]==="auto")return"auto";if(r.propsSize&&r.propsSize[l]&&(!((d=r.propsSize[l])===null||d===void 0)&&d.toString().endsWith("%"))){if(r.state[l].toString().endsWith("%"))return r.state[l].toString();var u=r.getParentSize(),h=Number(r.state[l].toString().replace("px","")),p=h/u[l]*100;return"".concat(p,"%")}return jr(r.state[l])},o=n&&typeof n.width<"u"&&!this.state.isResizing?jr(n.width):a("width"),i=n&&typeof n.height<"u"&&!this.state.isResizing?jr(n.height):a("height");return{width:o,height:i}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var r=this.appendBase();if(!r)return{width:0,height:0};var n=!1,a=this.parentNode.style.flexWrap;a!=="wrap"&&(n=!0,this.parentNode.style.flexWrap="wrap"),r.style.position="relative",r.style.minWidth="100%",r.style.minHeight="100%";var o={width:r.offsetWidth,height:r.offsetHeight};return n&&(this.parentNode.style.flexWrap=a),this.removeBase(r),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var r=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:r.flexBasis!=="auto"?r.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(r,n){var a=this.propsSize&&this.propsSize[n];return this.state[n]==="auto"&&this.state.original[n]===r&&(typeof a>"u"||a==="auto")?"auto":r},t.prototype.calculateNewMaxFromBoundary=function(r,n){var a=this.props.boundsByDirection,o=this.state.direction,i=a&&rt("left",o),l=a&&rt("top",o),d,u;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(d=i?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),u=l?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(d=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=l?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(d=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=l?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return d&&Number.isFinite(d)&&(r=r&&r<d?r:d),u&&Number.isFinite(u)&&(n=n&&n<u?n:u),{maxWidth:r,maxHeight:n}},t.prototype.calculateNewSizeFromDirection=function(r,n){var a=this.props.scale||1,o=Qf(this.props.resizeRatio||1),i=o[0],l=o[1],d=this.state,u=d.direction,h=d.original,p=this.props,g=p.lockAspectRatio,x=p.lockAspectRatioExtraHeight,y=p.lockAspectRatioExtraWidth,v=h.width,b=h.height,C=x||0,I=y||0;return rt("right",u)&&(v=h.width+(r-h.x)*i/a,g&&(b=(v-I)/this.ratio+C)),rt("left",u)&&(v=h.width-(r-h.x)*i/a,g&&(b=(v-I)/this.ratio+C)),rt("bottom",u)&&(b=h.height+(n-h.y)*l/a,g&&(v=(b-C)*this.ratio+I)),rt("top",u)&&(b=h.height-(n-h.y)*l/a,g&&(v=(b-C)*this.ratio+I)),{newWidth:v,newHeight:b}},t.prototype.calculateNewSizeFromAspectRatio=function(r,n,a,o){var i=this.props,l=i.lockAspectRatio,d=i.lockAspectRatioExtraHeight,u=i.lockAspectRatioExtraWidth,h=typeof o.width>"u"?10:o.width,p=typeof a.width>"u"||a.width<0?r:a.width,g=typeof o.height>"u"?10:o.height,x=typeof a.height>"u"||a.height<0?n:a.height,y=d||0,v=u||0;if(l){var b=(g-y)*this.ratio+v,C=(x-y)*this.ratio+v,I=(h-v)/this.ratio+y,S=(p-v)/this.ratio+y,w=Math.max(h,b),N=Math.min(p,C),L=Math.max(g,I),A=Math.min(x,S);r=zt(r,w,N),n=zt(n,L,A)}else r=zt(r,h,p),n=zt(n,g,x);return{newWidth:r,newHeight:n}},t.prototype.setBoundingClientRect=function(){var r=1/(this.props.scale||1);if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var a=n.getBoundingClientRect();this.parentLeft=a.left*r,this.parentTop=a.top*r}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left*r,this.targetTop=o.top*r}if(this.resizable){var i=this.resizable.getBoundingClientRect(),l=i.left,d=i.top,u=i.right,h=i.bottom;this.resizableLeft=l*r,this.resizableRight=u*r,this.resizableTop=d*r,this.resizableBottom=h*r}},t.prototype.onResizeStart=function(r,n){if(!(!this.resizable||!this.window)){var a=0,o=0;if(r.nativeEvent&&Yf(r.nativeEvent)?(a=r.nativeEvent.clientX,o=r.nativeEvent.clientY):r.nativeEvent&&Ft(r.nativeEvent)&&(a=r.nativeEvent.touches[0].clientX,o=r.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var i=this.props.onResizeStart(r,n,this.resizable);if(i===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var l,d=this.window.getComputedStyle(this.resizable);if(d.flexBasis!=="auto"){var u=this.parentNode;if(u){var h=this.window.getComputedStyle(u).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",l=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:a,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Te(Te({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(r.target).cursor||"auto"}),direction:n,flexBasis:l};this.setState(p)}},t.prototype.onMouseMove=function(r){var n=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Ft(r))try{r.preventDefault(),r.stopPropagation()}catch{}var a=this.props,o=a.maxWidth,i=a.maxHeight,l=a.minWidth,d=a.minHeight,u=Ft(r)?r.touches[0].clientX:r.clientX,h=Ft(r)?r.touches[0].clientY:r.clientY,p=this.state,g=p.direction,x=p.original,y=p.width,v=p.height,b=this.getParentSize(),C=Xf(b,this.window.innerWidth,this.window.innerHeight,o,i,l,d);o=C.maxWidth,i=C.maxHeight,l=C.minWidth,d=C.minHeight;var I=this.calculateNewSizeFromDirection(u,h),S=I.newHeight,w=I.newWidth,N=this.calculateNewMaxFromBoundary(o,i);this.props.snap&&this.props.snap.x&&(w=dn(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(S=dn(S,this.props.snap.y,this.props.snapGap));var L=this.calculateNewSizeFromAspectRatio(w,S,{width:N.maxWidth,height:N.maxHeight},{width:l,height:d});if(w=L.newWidth,S=L.newHeight,this.props.grid){var A=cn(w,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),T=cn(S,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),j=this.props.snapGap||0,D=j===0||Math.abs(A-w)<=j?A:w,E=j===0||Math.abs(T-S)<=j?T:S;w=D,S=E}var k={width:w-x.width,height:S-x.height};if(this.delta=k,y&&typeof y=="string"){if(y.endsWith("%")){var P=w/b.width*100;w="".concat(P,"%")}else if(y.endsWith("vw")){var O=w/this.window.innerWidth*100;w="".concat(O,"vw")}else if(y.endsWith("vh")){var R=w/this.window.innerHeight*100;w="".concat(R,"vh")}}if(v&&typeof v=="string"){if(v.endsWith("%")){var P=S/b.height*100;S="".concat(P,"%")}else if(v.endsWith("vw")){var O=S/this.window.innerWidth*100;S="".concat(O,"vw")}else if(v.endsWith("vh")){var R=S/this.window.innerHeight*100;S="".concat(R,"vh")}}var M={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(S,"height")};this.flexDir==="row"?M.flexBasis=M.width:this.flexDir==="column"&&(M.flexBasis=M.height);var H=this.state.width!==M.width,W=this.state.height!==M.height,K=this.state.flexBasis!==M.flexBasis,V=H||W||K;V&&Wa.flushSync(function(){n.setState(M)}),this.props.onResize&&V&&this.props.onResize(r,g,this.resizable,k)}},t.prototype.onMouseUp=function(r){var n,a,o=this.state,i=o.isResizing,l=o.direction;o.original,!(!i||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(r,l,this.resizable,this.delta),this.props.size&&this.setState({width:(n=this.props.size.width)!==null&&n!==void 0?n:"auto",height:(a=this.props.size.height)!==null&&a!==void 0?a:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Te(Te({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(r){var n,a;this.setState({width:(n=r.width)!==null&&n!==void 0?n:"auto",height:(a=r.height)!==null&&a!==void 0?a:"auto"})},t.prototype.renderResizer=function(){var r=this,n=this.props,a=n.enable,o=n.handleStyles,i=n.handleClasses,l=n.handleWrapperStyle,d=n.handleWrapperClass,u=n.handleComponent;if(!a)return null;var h=Object.keys(a).map(function(p){return a[p]!==!1?s.jsx(Uf,{direction:p,onResizeStart:r.onResizeStart,replaceStyles:o&&o[p],className:i&&i[p],children:u&&u[p]?u[p]:null},p):null});return s.jsx("div",{className:d,style:l,children:h})},t.prototype.render=function(){var r=this,n=Object.keys(this.props).reduce(function(i,l){return Jf.indexOf(l)!==-1||(i[l]=r.props[l]),i},{}),a=Te(Te(Te({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(a.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return s.jsxs(o,Te({style:a,className:this.props.className},n,{ref:function(i){i&&(r.resizable=i)},children:[this.state.isResizing&&s.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t})(m.PureComponent);const tp=({side:e,isResizing:t,width:r,minWidth:n,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:d,handlerClassName:u})=>{const h=e===It.Left,p=h?F.IconChevronLeft:F.IconChevronRight,g=x=>{let y;switch(x.key){case"ArrowLeft":y=r+(h?o:-o);break;case"ArrowRight":y=r+(h?-o:o);break;case"Home":y=n;break;case"End":y=a;break;default:return}x.preventDefault(),l(y)};return s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":i,"aria-valuenow":r,"aria-valuemin":n,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:f.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:d??s.jsx(p,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",h?"right-full":"left-full")})})},rp=16,_a=({children:e,minWidth:t,maxWidth:r,width:n,defaultWidth:a,onResizeStop:o,onResize:i,side:l=It.Right,keyboardStep:d=rp,ariaLabel:u="Resize panel",className:h,resizeHandlerClassName:p,resizeHandler:g})=>{const[x,y]=m.useState(!1),[v,b]=m.useState(a??t),C=n!==void 0,I=C?n:v,S=m.useRef(null),w=m.useCallback(()=>{y(!0)},[]),N=m.useCallback(()=>{y(!1);const T=S.current?.resizable?.getBoundingClientRect(),j=T?Math.round(T.width):t;C||b(j),o?.(j)},[o,C,t]),L=m.useCallback(T=>{const j=Math.min(r,Math.max(t,T));j!==I&&(C||(b(j),S.current?.updateSize({width:j,height:"100%"})),i?.(j),o?.(j))},[r,t,I,C,i,o]),A=m.useMemo(()=>{const T=l===It.Left,j=s.jsx(tp,{side:l,isResizing:x,width:I,minWidth:t,maxWidth:r,step:d,ariaLabel:u,onWidthChange:L,customHandler:g,handlerClassName:p});return{size:C?{width:I,height:"100%"}:void 0,defaultSize:C?void 0:{width:I,height:"100%"},minWidth:t,maxWidth:r,enable:{left:T,right:!T},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:T?j:void 0,right:T?void 0:j},onResizeStart:w,onResize:(D,E,k)=>{i?.(Math.round(k.offsetWidth))},onResizeStop:N}},[l,C,I,t,r,d,u,L,g,p,x,w,N,i]);return s.jsx(ep,{ref:S,...A,children:s.jsx("div",{className:f.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",h,c.DIAL_KIT_CLASS.resizableContainer),children:e})})},sp=16,np=1e3,ap=4,Dr=e=>e==null?!1:(e.closest("[dir]")?.getAttribute("dir")??e.ownerDocument.defaultView?.getComputedStyle(e).direction)==="rtl",op=({width:e,minWidth:t,maxWidth:r,defaultWidth:n,onWidthChange:a,label:o,tooltip:i,keyboardStep:l=sp,className:d})=>{const[u,h]=m.useState(!1),[p,g]=m.useState(!1),[x,y]=m.useState(!1),v=m.useRef(null),b=m.useRef(null),C=m.useRef({x:0,y:0}),I=m.useRef(null),S=m.useRef(void 0),w=m.useRef(void 0);m.useEffect(()=>()=>{clearTimeout(S.current),w.current!=null&&cancelAnimationFrame(w.current)},[]);const N=m.useCallback(R=>{const M=Number.isFinite(R)?R:t;return Math.round(Math.min(r,Math.max(t,M)))},[r,t]),L=R=>{b.current?.style.setProperty("transform",`translate(${R.clientX}px, ${R.clientY}px) translate(-50%, -50%)`),y(!0)},A=R=>{C.current={x:R.clientX,y:R.clientY},clearTimeout(S.current),S.current=setTimeout(()=>g(!0),np)},T=R=>{L(R),A(R)},j=()=>{y(!1),clearTimeout(S.current),g(!1)},D=R=>{R.button===0&&(R.currentTarget.setPointerCapture(R.pointerId),I.current={x:R.clientX,width:e},h(!0))},E=R=>{L(R);const M=I.current;if(M==null){Math.hypot(R.clientX-C.current.x,R.clientY-C.current.y)>ap&&(g(!1),A(R));return}const H=Dr(v.current)?-1:1,W=N(M.width+(R.clientX-M.x)*H);w.current!=null&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>a(W))},k=R=>{I.current!=null&&(I.current=null,h(!1),R.currentTarget.hasPointerCapture(R.pointerId)&&R.currentTarget.releasePointerCapture(R.pointerId))},P=R=>{const M=Dr(v.current)?-1:1;let H;switch(R.key){case"ArrowRight":H=e+l*M;break;case"ArrowLeft":H=e-l*M;break;case"Home":H=t;break;case"End":H=r;break;default:return}R.preventDefault(),a(N(H))},O=()=>{n!=null&&a(N(n))};return s.jsx("div",{ref:v,role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,tabIndex:0,className:f.mergeClasses("absolute inset-y-0 end-0 -me-1 w-2 touch-none select-none","dial-resize-handle",x&&"dial-resize-handle-cursor-ready",p&&"dial-resize-handle-hover",u&&"dial-resize-handle-dragging",d,c.DIAL_KIT_CLASS.resizeHandle),onPointerEnter:T,onPointerLeave:j,onPointerDown:D,onPointerMove:E,onPointerUp:k,onPointerCancel:k,onKeyDown:P,onDoubleClick:O,children:s.jsx(c.Tooltip,{tooltip:i,open:p&&!u,placement:Dr(v.current)?c.TooltipPlacement.Left:c.TooltipPlacement.Right,asChild:!0,children:s.jsx("span",{ref:b,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none fixed top-0 left-0 z-tooltip hidden text-secondary","dial-resize-handle-arrow"),children:s.jsx(F.IconArrowsHorizontal,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE})})})})},ip=({enabled:e=!0,children:t,...r})=>e?s.jsx(_a,{...r,children:t}):t,lp=({title:e,description:t,icon:r,action:n,className:a,titleClassName:o,descriptionClassName:i})=>{const l=m.useId();return s.jsxs("section",{"aria-labelledby":l,className:f.mergeClasses("flex size-full flex-col items-center justify-center px-4 text-center",a,c.DIAL_KIT_CLASS.stateScreen),children:[r!=null&&s.jsx("span",{"aria-hidden":"true",className:"mb-4 flex size-14 items-center justify-center rounded-full border border-secondary text-secondary",children:r}),s.jsx("h1",{id:l,className:f.mergeClasses("dial-body-semi-text text-primary",o),children:e}),t!=null&&s.jsx("p",{className:f.mergeClasses("dial-small-text mt-2 text-secondary",i),children:t}),n!=null&&s.jsx("div",{className:"mt-4",children:n})]})};var at=(e=>(e.Row="row",e.Caption="caption",e.Setting="setting",e))(at||{});const cp={[at.Row]:{header:"gap-2",title:"dial-small-semi-text",description:"dial-small-text"},[at.Caption]:{header:"gap-4",title:"dial-caption-lead-semi-text",description:"dial-tiny-text"},[at.Setting]:{header:"gap-4",title:"dial-tiny-semi-text",description:"dial-tiny-text"}},dp=({title:e,action:t,description:r,variant:n=at.Row,headingLevel:a=3,children:o,className:i,titleClassName:l,descriptionClassName:d,contentClassName:u})=>{const h=m.useId(),p=cp[n],g=`h${a}`;return s.jsxs("section",{"aria-labelledby":h,className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.formSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center justify-between",p.header),children:[s.jsx(g,{id:h,className:f.mergeClasses("min-w-0 text-primary",p.title,l),children:e}),t!=null&&s.jsx("div",{className:"shrink-0",children:t})]}),r!=null&&s.jsx("p",{className:f.mergeClasses("text-secondary",p.description,d),children:r}),o!=null&&s.jsx("div",{className:f.mergeClasses("relative",u),children:o})]})};var je=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(je||{});const ka=8e3,Dt="flex size-7 shrink-0 items-center justify-center",Ra={cancelItemAriaLabel:e=>`Cancel "${e}"`,itemProgressAriaLabel:e=>`"${e}" in progress`,successLabel:"Completed",canceledLabel:"Canceled",failedMessage:"Failed",warningMessage:"Completed with warnings",queueProgressAriaLabel:"Progress",queueProgressValueText:(e,t)=>`${e} of ${t}`,collapseAriaLabel:"Collapse",expandAriaLabel:"Expand",closeAriaLabel:"Close",closeConfirmHeader:"Close?",closeConfirmDescriptionInProgress:"Some items are still in progress.",closeConfirmDescriptionFailed:"Some items have failed.",closeConfirmDescriptionMixed:"Some items are still in progress, and some have failed.",closeConfirmLabel:"Close",closeCancelLabel:"Cancel"},up=({title:e,isCollapsed:t,itemsId:r,labels:n,onToggleCollapse:a,onClose:o})=>{const i=t?F.IconChevronUp:F.IconChevronDown;return s.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[s.jsx("span",{className:"dial-small-paragraph-semi-text min-w-0 truncate text-primary",children:e}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(c.GhostIconButton,{"aria-label":t?n.expandAriaLabel:n.collapseAriaLabel,"aria-expanded":!t,"aria-controls":r,size:c.ElementSize.Small,icon:s.jsx(i,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:a,className:Dt}),s.jsx(c.GhostIconButton,{"aria-label":n.closeAriaLabel,size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:Dt})]})]})},fn=({message:e,isError:t})=>{const r=t?F.IconAlertCircleFilled:F.IconAlertTriangleFilled;return s.jsx(c.Tooltip,{tooltip:e,asChild:!0,children:s.jsx("span",{className:Dt,role:"img","aria-label":e,tabIndex:0,children:s.jsx(r,{size:f.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},Mr=2,Pr=(f.DIAL_ICON_SIZE.SM-Mr)/2,pn=2*Math.PI*Pr,fp=({percent:e,label:t,className:r})=>{const n=Math.min(100,Math.max(0,Math.round(e))),a=f.DIAL_ICON_SIZE.SM/2;return s.jsx("span",{role:"progressbar","aria-label":t,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,className:f.mergeClasses("flex",r),children:s.jsxs("svg",{width:f.DIAL_ICON_SIZE.SM,height:f.DIAL_ICON_SIZE.SM,viewBox:`0 0 ${f.DIAL_ICON_SIZE.SM} ${f.DIAL_ICON_SIZE.SM}`,className:"-rotate-90","aria-hidden":!0,children:[s.jsx("circle",{cx:a,cy:a,r:Pr,fill:"none",strokeWidth:Mr,className:"stroke-(--stroke-secondary,#d1dbea)"}),s.jsx("circle",{cx:a,cy:a,r:Pr,fill:"none",strokeWidth:Mr,strokeLinecap:"round",strokeDasharray:pn,strokeDashoffset:pn*(1-n/100),className:"stroke-(--stroke-accent,#1d4ed8) transition-[stroke-dashoffset] duration-200 motion-reduce:transition-none"})]})})},pp=({item:e,labels:t,onCancel:r})=>{const n=e.status===je.Canceled,a=f.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0");return s.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[s.jsx(ms,{type:Ae.File,name:e.name,size:f.DIAL_ICON_SIZE.MD,className:f.mergeClasses(n&&"opacity-50"),decorative:!0}),s.jsx(c.EllipsisTooltip,{text:e.name,className:f.mergeClasses("dial-small-text",n?"text-secondary":"text-primary")}),e.status===je.InProgress&&s.jsxs("div",{className:f.mergeClasses(Dt,"grid"),children:[typeof e.percent=="number"?s.jsx(fp,{percent:e.percent,label:t.itemProgressAriaLabel(e.name),className:a}):s.jsx(Ve,{size:f.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:a}),r&&s.jsx(c.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===je.Success&&s.jsx("span",{className:Dt,role:"img","aria-label":t.successLabel,children:s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===je.Warning&&s.jsx(fn,{message:e.message||t.warningMessage,isError:!1}),e.status===je.Failed&&s.jsx(fn,{message:e.message||t.failedMessage,isError:!0}),n&&s.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},hp=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===je.InProgress?0:100)),0)/e.length),mp=(e,t)=>e?t.closeConfirmDescriptionMixed:t.closeConfirmDescriptionInProgress,gp=({title:e,items:t,onClose:r,onCancelItem:n,labels:a,autoCloseDelay:o=ka,className:i,bodyClassName:l})=>{const[d,u]=m.useState(!1),[h,p]=m.useState(!1),g=m.useId(),x={...Ra,...a},y=t.filter(N=>N.status===je.InProgress).length,v=y>0,b=t.some(N=>N.status===je.Failed),C=t.length>0&&t.every(N=>N.status===je.Success),I=m.useCallback(()=>{v?p(!0):r()},[v,r]),S=m.useCallback(()=>{p(!1),r()},[r]),w=m.useCallback(()=>{u(N=>!N)},[]);return m.useEffect(()=>{if(!C||o<=0)return;const N=setTimeout(r,o);return()=>clearTimeout(N)},[C,o,r]),t.length===0?null:s.jsxs("div",{role:"status","aria-live":"polite",className:f.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,c.DIAL_KIT_CLASS.transferQueue),children:[s.jsx(up,{title:e,isCollapsed:d,itemsId:g,labels:x,onToggleCollapse:w,onClose:I}),d&&v&&s.jsx(bn,{value:hp(t),size:c.ElementSize.Small,"aria-label":x.queueProgressAriaLabel,"aria-valuetext":x.queueProgressValueText(t.length-y,t.length)}),!d&&s.jsx("div",{id:g,className:f.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(N=>s.jsx(pp,{item:N,labels:x,onCancel:n},N.id))}),s.jsx(wa,{open:h,header:x.closeConfirmHeader,description:mp(b,x),confirmLabel:x.closeConfirmLabel,cancelLabel:x.closeCancelLabel,variant:it.Danger,onConfirm:S,onClose:()=>p(!1)})]})};exports.BASE_ICON_PROPS=f.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=f.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=f.DIAL_ICON_SIZE;exports.DIAL_KIT_ICON_STROKE=f.DIAL_KIT_ICON_STROKE;exports.mergeClasses=f.mergeClasses;exports.ButtonAppearance=c.ButtonAppearance;exports.ButtonVariant=c.ButtonVariant;exports.CaptionText=c.CaptionText;exports.Checkbox=c.Checkbox;exports.CheckboxBox=c.CheckboxBox;exports.CloseButton=c.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=c.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=c.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=c.DIAL_KIT_CLASS;exports.DangerIconButton=c.DangerIconButton;exports.DateCellRenderer=c.DateCellRenderer;exports.DialIcon=c.DialIcon;exports.Dropdown=c.Dropdown;exports.DropdownItemType=c.DropdownItemType;exports.DropdownOverlayRole=c.DropdownOverlayRole;exports.DropdownTrigger=c.DropdownTrigger;exports.DropdownType=c.DropdownType;exports.ElementSize=c.ElementSize;exports.EllipsisTooltip=c.EllipsisTooltip;exports.ErrorText=c.ErrorText;exports.GRID_ALIGN_RIGHT_CLASS=c.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=c.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=c.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=c.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=c.GRID_THEME_PARAMS;exports.GhostIconButton=c.GhostIconButton;exports.Grid=c.Grid;exports.GridAppearance=c.GridAppearance;exports.GridColorScheme=c.GridColorScheme;exports.GridSelectionMode=c.GridSelectionMode;exports.Highlight=c.Highlight;exports.IconButton=c.IconButton;exports.InfoButton=c.InfoButton;exports.Input=c.Input;exports.InteractiveTooltip=c.InteractiveTooltip;exports.InteractiveTooltipTrigger=c.InteractiveTooltipTrigger;exports.Label=c.Label;exports.LiveRegion=c.LiveRegion;exports.LiveRegionElement=c.LiveRegionElement;exports.LiveRegionPoliteness=c.LiveRegionPoliteness;exports.MenuItem=c.MenuItem;exports.MenuItemMark=c.MenuItemMark;exports.NeutralIconButton=c.NeutralIconButton;exports.NoDataContent=c.NoDataContent;exports.PrimaryIconButton=c.PrimaryIconButton;exports.Radio=c.Radio;exports.Search=c.Search;exports.StaticIconButton=c.StaticIconButton;exports.ThemeScope=c.ThemeScope;exports.Tooltip=c.Tooltip;exports.TooltipContainer=c.TooltipContainer;exports.TooltipContent=c.TooltipContent;exports.TooltipPlacement=c.TooltipPlacement;exports.TooltipTrigger=c.TooltipTrigger;exports.baseColumnComparator=c.baseColumnComparator;exports.checkColDefsChanges=c.checkColDefsChanges;exports.convertToDate=c.convertToDate;exports.useThemeScope=c.useThemeScope;exports.EditorThemes=hn.EditorThemes;exports.LazyMarkdownEditor=hn.LazyMarkdownEditor;exports.AVATAR_PALETTE=Ta;exports.Accordion=Ia;exports.AccordionCaretPosition=Qt;exports.AnalyticsBar=Vt;exports.AnalyticsBarGroup=fu;exports.AnalyticsCard=cu;exports.AnalyticsCardVariant=jt;exports.AnalyticsHistogram=xu;exports.AutocompleteTagInput=Bf;exports.Avatar=La;exports.AvatarColor=Pe;exports.AvatarShape=lt;exports.Badge=fs;exports.BadgeColor=we;exports.BadgeVariant=_e;exports.BottomSheet=Cf;exports.Breadcrumbs=Yd;exports.BreadcrumbsSize=Ze;exports.Button=Xe;exports.ButtonDropdown=Jd;exports.Calendar=Rd;exports.CalendarMode=xe;exports.CardShell=ed;exports.CollapsibleSidebar=Wf;exports.ConditionalResizableContainer=ip;exports.ConfirmationPopup=wa;exports.ConfirmationPopupVariant=it;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=ps;exports.DEFAULT_TRANSFER_QUEUE_LABELS=Ra;exports.DangerButton=Dc;exports.DialAccordion=Qa;exports.DialBreadcrumb=Do;exports.DialBreadcrumbItem=xt;exports.DialButton=Et;exports.DialCaptionText=Br;exports.DialCloseButton=In;exports.DialDangerButton=En;exports.DialDangerIconButton=yn;exports.DialDropdown=Gt;exports.DialEllipsisTooltip=er;exports.DialErrorText=Fe;exports.DialFileNodeType=ze;exports.DialFilePermission=Yn;exports.DialFileResourceType=es;exports.DialGhostButton=Eo;exports.DialGhostIconButton=Cn;exports.DialIconButton=Tt;exports.DialInput=An;exports.DialItemType=Ae;exports.DialLabel=$r;exports.DialLabelledText=ao;exports.DialLinkButton=To;exports.DialLoadFileArea=Zn;exports.DialLoadFileAreaField=Vl;exports.DialLoader=ro;exports.DialNeutralButton=Tn;exports.DialNeutralIconButton=go;exports.DialNoDataContent=no;exports.DialPrimaryButton=Wr;exports.DialPrimaryIconButton=mo;exports.DialRemoveButton=Ln;exports.DialSecondaryIconButton=xo;exports.DialSuccessIconButton=vo;exports.DialTabs=No;exports.DialTag=io;exports.DialTertiaryIconButton=bo;exports.DialTooltip=qe;exports.DialTooltipContainer=zr;exports.DialTooltipContent=Fr;exports.DialTooltipTrigger=Hr;exports.EDITABLE_CONTAINER_ATTRIBUTE=Jr;exports.EntityIdentity=Aa;exports.EntityType=pe;exports.ErrorMessageNotification=id;exports.ErrorToastNotification=td;exports.FabButton=Xd;exports.FileDropzone=cf;exports.FileIcon=ms;exports.FileName=Da;exports.FilterChips=lf;exports.FlexibleActionsDirection=qn;exports.FolderName=yf;exports.FolderPath=Pd;exports.FormSection=dp;exports.FormSectionVariant=at;exports.GeneralMessageNotification=fd;exports.GeneralToastNotification=od;exports.GhostButton=is;exports.InfoMessageNotification=ld;exports.InfoToastNotification=rd;exports.InlineSelect=eu;exports.InlineSelectTrigger=Ca;exports.JsonSchemaType=$;exports.LabelledText=bu;exports.LinkButton=Lc;exports.LoadingMessageNotification=ud;exports.LoadingToastNotification=ad;exports.MultiSelectTags=yt;exports.NOT_ALLOWED_SPACES=ts;exports.NOT_ALLOWED_SPACES_REGEXP=tc;exports.NOT_ALLOWED_SYMBOLS=Qn;exports.NOT_ALLOWED_SYMBOLS_REGEXP=ec;exports.NeutralButton=os;exports.Notification=us;exports.NotificationSurface=qt;exports.NotificationType=fe;exports.NotificationVariant=X;exports.NumberInput=ds;exports.OutlinedButton=Ac;exports.PasswordInput=da;exports.Popup=hs;exports.PopupSize=We;exports.PrimaryButton=la;exports.ProgressBar=bn;exports.ProgressBarRole=Ct;exports.RadioGroup=wt;exports.RadioGroupOrientation=Oe;exports.RadioGroupPopupField=Hu;exports.ResizableContainer=_a;exports.ResizableContainerSide=It;exports.ResizeHandle=op;exports.SchemaDisplayMode=lr;exports.SchemaOrientation=cr;exports.SchemaRenderer=Uc;exports.SchemaRendererVariant=nt;exports.ScreenResolution=Ut;exports.SegmentedControl=tf;exports.Select=$e;exports.SelectedEntityCard=Ef;exports.SharedEntityIndicator=ja;exports.SideDrawer=Lf;exports.Skeleton=$t;exports.SkeletonAvatarShape=Wt;exports.SkeletonAvatarSize=bt;exports.SkeletonVariant=Ee;exports.Slider=Kf;exports.Spinner=Ve;exports.StarterButton=Ec;exports.StateScreen=lp;exports.StepStatus=be;exports.Steps=nu;exports.SuccessMessageNotification=cd;exports.SuccessToastNotification=sd;exports.Switch=ua;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=ka;exports.TabOrientation=Ge;exports.TabStatus=ot;exports.TabView=Ue;exports.Tabs=nf;exports.Tag=Le;exports.TagAppearance=Se;exports.TagInput=Rf;exports.Textarea=ca;exports.TextareaResize=ls;exports.ToggleChip=Wu;exports.ToggleIconButton=$u;exports.TransferQueue=gp;exports.TransferQueueItemStatus=je;exports.WarningMessageNotification=dd;exports.WarningToastNotification=nd;exports.editableContainerProps=Wl;exports.extractInitials=Ea;exports.getTimezoneLabel=Xn;exports.matchesAccept=Rr;exports.useEditableItem=Gl;exports.wrapInRootFolder=Ql;
|
|
4
|
+
|\r| )|[\0-]`,Jl=`[${Qn.replace(/\\/g,"\\\\")}]`,ec=new RegExp(`${Jl}|${ts}`),tc=new RegExp(ts);var nt=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(nt||{}),lr=(e=>(e.Select="select",e.Radio="radio",e))(lr||{}),cr=(e=>(e.Row="row",e.Column="column",e))(cr||{}),$=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))($||{});const rc={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"};function As(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 n=e;if(n.$ref){const a=n.$ref.replace(/^#\//,"").split("/");let o=t;for(const p of a)o=o?.[p];if(!o||typeof o!="object")return e;const{$ref:i,...l}=n,d=o;n={...d.$ref?J(d,t,r+1):d,...l}}if(n.allOf&&n.allOf.length>0){const{allOf:a,...o}=n;let i={};for(const l of a)i=As(i,J(l,t,r+1));n=As(i,o)}return n}function Jn(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const n=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return n!==a?n-a:t.index-r.index}).map(({entry:t})=>t)}function dr(e){return e==null||e===""}function Ye(e){return e.type===$.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function Yt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const rs=e=>`"${e}" is required`;function ea(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 He(e,t,r=0){if(r>15)return;const n=J(e,t);if("default"in n)return n.default;if(n.discriminator&&n.oneOf){const a=Object.keys(n.discriminator.mapping)[0];if(a){const o=J({$ref:n.discriminator.mapping[a]},t);return{...He(o,t,r+1)??{},[n.discriminator.propertyName]:a}}}if(Ye(n)){if(n.properties){const a={};let o=!1;for(const[i,l]of Object.entries(n.properties)){const d=He(l,t,r+1);d!==void 0&&(a[i]=d,o=!0)}return o?a:void 0}if(n.additionalProperties!=null&&n.additionalProperties!==!1)return{}}}function Be(e,t,r,n="",a=0){if(a>15)return[];const o=[],i=J(t,r);if(i.anyOf){const u=i.anyOf.filter(p=>p.type!==$.Null);return e!=null&&u.length===1?Be(e,u[0],r,n,a+1):o}if(i.oneOf&&i.discriminator){const u=i.discriminator.propertyName,p=e?.[u];if(p&&i.discriminator.mapping[p]){const h={$ref:i.discriminator.mapping[p]},x=J(h,r);return Be(e,x,r,n,a+1)}return o}if(i.type===$.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let u=0;u<e.length;u++){const p=Be(e[u],i.items,r,`${n}[${u}]`,a+1);o.push(...p)}return o}if(!Ye(i))return o;const l=i.required??[],d=e;for(const u of l){const p=i.properties?.[u];if(p&&J(p,r).isHidden)continue;const h=n?`${n}.${u}`:u,x=d?.[u];if(dr(x)){const g=p?.title??Yt(u);o.push({path:h,message:rs(g)})}}if(d&&i.properties)for(const[u,p]of Object.entries(i.properties)){if(J(p,r).isHidden)continue;const h=n?`${n}.${u}`:u,x=d[u];if(x!=null){const g=Be(x,p,r,h,a+1);o.push(...g)}}if(d&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const u=i.additionalProperties;for(const[p,h]of Object.entries(d)){const x=n?`${n}.${p}`:p,g=Be(h,u,r,x,a+1);o.push(...g)}}return o}function ss(e,t,r){const n=J(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ye(n)&&n.properties){const a=Object.entries(n.properties).filter(([,d])=>!J(d,r).isHidden),o=a.length,i=e;return`${a.filter(([d])=>{const u=i?.[d];return u!=null&&u!==""}).length}/${o} fields`}return""}function sc(e,t,r){if(e==null){const n=t.findIndex(a=>a.type===$.Null);return n>=0?n:0}if(Array.isArray(e)){const n=t.findIndex(a=>J(a,r).type===$.Array);return n>=0?n:0}if(typeof e=="boolean"){const n=t.findIndex(a=>J(a,r).type===$.Boolean);return n>=0?n:0}if(typeof e=="number"){const n=t.findIndex(a=>{const o=J(a,r);return o.type===$.Number||o.type===$.Integer});return n>=0?n:0}if(typeof e=="string"){const n=t.findIndex(a=>J(a,r).type===$.String);return n>=0?n:0}if(typeof e=="object"){const n=e;for(let a=0;a<t.length;a++){const o=J(t[a],r);if(o.discriminator&&o.discriminator.propertyName in n)return a}for(let a=0;a<t.length;a++){const o=J(t[a],r);if(Ye(o)||o.oneOf)return a}return 0}return 0}function nc(e,t,r){if(t&&typeof e=="object"&&e!==null){const n=e[t];if(n)return`Item ${r+1}: ${n}`}if(typeof e=="object"&&e!==null){const n=e,a=n.name??n.title??n.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function ta(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 ac=[$.String,$.Number,$.Boolean,$.Null,$.Object,$.Array];function oc(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 ic={[$.String]:"",[$.Number]:0,[$.Boolean]:!1,[$.Null]:null,[$.Object]:{},[$.Array]:[]};function lc(e){return ic[e]}const ra=m.createContext(null),ke=()=>{const e=m.useContext(ra);if(!e)throw new Error("useSchemaContext must be used inside SchemaRenderer");return e},St=(e,t=new Set,r=!1,n=!1)=>{if(!r||t.has(e))return!0;if(!n)return!1;const a=e+".";return[...t].some(o=>o.startsWith(a))},sa=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:n})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+n;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+r>e;)o--,a-=t[o]+n;return o};var Se=(e=>(e.Outlined="outlined",e.Selectable="selectable",e.Bordered="bordered",e))(Se||{});const na="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",cc={[Se.Outlined]:"dial-tiny-text",[Se.Selectable]:"dial-tiny-text",[Se.Bordered]:"h-[24px] rounded-md border px-2 dial-small-text"},aa={[Se.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Se.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"},[Se.Bordered]:{default:"border-tertiary bg-layer-sunken text-primary",selected:"border-accent bg-control-accent-alpha text-primary"}},oa="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",ia="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Le=({label:e,icon:t,appearance:r=Se.Outlined,selected:n=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:d,onClick:u,onRemove:p,onKeyDown:h,...x})=>{const g=r===Se.Selectable,y=!!u&&!a,v=o&&!!p&&!a,b=g&&n,I=C=>{h?.(C),!(!y||C.defaultPrevented)&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.currentTarget.click())};return s.jsxs("span",{...x,role:y?"button":x.role,tabIndex:y?0:x.tabIndex,"aria-disabled":a||void 0,"aria-pressed":g&&y?n:void 0,onClick:a?void 0:u,onKeyDown:I,className:f.mergeClasses(na,b?"dial-tiny-semi-text":cc[r],aa[r][n?"selected":"default"],a&&"cursor-not-allowed",y&&[oa,ia],l,c.DIAL_KIT_CLASS.tag),children:[t&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),s.jsx("span",{className:"truncate",title:d??e,children:e}),v&&s.jsx(c.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:c.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C=>{C.stopPropagation(),p?.(C)}})]})},Xt="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",yt=({options:e,selectedValues:t,handleRemoveTag:r,tagClassName:n})=>s.jsx(s.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return s.jsx(Le,{label:o?.label??a,closable:!!r,onRemove:i=>r?.(i,a),icon:o?.icon,className:f.mergeClasses(Xt,n)},a)})}),dc=8,uc=e=>e.stopPropagation(),fc=e=>{e.key!=="Escape"&&e.stopPropagation()},pc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const n=m.useRef(null),a=m.useRef(null),[o,i]=m.useState(null),l=m.useCallback(()=>{const h=n.current,x=a.current;if(!h||!x)return;const g=Array.from(x.children,v=>v.offsetWidth),y=g.pop()??0;i(sa({tagWidths:g,overflowChipWidth:y,availableWidth:h.clientWidth,gap:dc}))},[]);m.useLayoutEffect(()=>{l()},[l,e,t]),m.useLayoutEffect(()=>{const h=n.current;return h?c.observeElementSize(h,l):void 0},[l]);const d=o??t.length,u=t.slice(0,d),p=t.slice(d);return s.jsxs("div",{ref:n,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[s.jsx(yt,{options:e,selectedValues:u,handleRemoveTag:r,tagClassName:"min-w-0"}),p.length>0&&s.jsx(c.InteractiveTooltip,{asChild:!0,placement:c.TooltipPlacement.Bottom,content:s.jsx("div",{className:"flex flex-wrap gap-2",onClick:uc,onKeyDown:fc,children:s.jsx(yt,{options:e,selectedValues:p,handleRemoveTag:r})}),children:s.jsx(Le,{label:`+${p.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${p.length} more selected: ${p.map(h=>e.find(x=>x.value===h)?.label??h).join(", ")}`,title:"",className:f.mergeClasses(Xt,"shrink-0")})}),s.jsxs("div",{ref:a,"aria-hidden":"true",inert:!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 w-max gap-2 overflow-hidden",children:[s.jsx(yt,{options:e,selectedValues:t,handleRemoveTag:r,tagClassName:"shrink-0"}),s.jsx(Le,{label:`+${t.length}`,className:f.mergeClasses(Xt,"shrink-0")})]})]})},hc=f.mergeClasses("w-full flex flex-col"),mc=c.overlayItemClassName,gc="!max-w-[var(--reference-width)]",xc=f.mergeClasses("max-h-[344px] overflow-y-auto py-1",c.overlayListClassName),bc=c.overlayGap,vc=c.overlaySubMenuListClassName,yc=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Cc="text-secondary transition-transform",Ic=8,Sc=s.jsx(F.IconSearch,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Nc=s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),wc=({opt:e,selectedValues:t,mark:r=c.MenuItemMark.Tint,onSelect:n})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:d,getReferenceProps:u,getFloatingProps:p}=c.useSubMenuFloating(bc,"listbox",!!e.disabled),h=e.children?.some(g=>t.includes(g.value)),x=s.jsx(c.MenuItem,{ref:i.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!h,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:yc,...u()});return s.jsxs(B.FloatingNode,{id:o,children:[e.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:x}):x,a&&s.jsx(c.SubMenuPanel,{refs:i,floatingStyles:l,context:d,getFloatingProps:p,role:"listbox",surfaceClassName:vc,children:e.children.map(g=>{const y=s.jsx(c.MenuItem,{role:"option","aria-selected":t.includes(g.value),"aria-disabled":!!g.disabled,disabled:g.disabled,mark:r,selected:t.includes(g.value),ellipsisLabel:!0,icon:g.icon,label:g.labelNode??g.label,rightControl:g.rightControl,onClick:()=>!g.disabled&&n(g.value)});return s.jsx(m.Fragment,{children:g.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:g.interactiveTooltip.placement,content:g.interactiveTooltip.content,contentClassName:g.interactiveTooltip.contentClassName,children:y}):y},g.value)})})]})},$e=({options:e,multiple:t=!1,id:r,value:n,defaultValue:a,size:o=c.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:d="Select...",labelProps:u,error:p,caption:h,ariaLabel:x,ariaDescribedBy:g,searchable:y=!1,searchSize:v=c.ElementSize.Standard,searchPlaceholder:b,selectAll:I=!1,invalid:C,selectAllLabel:N="Select all",collapseTagOverflow:w=!1,selectedOptionMark:S=c.MenuItemMark.Tint,emptyStateTitle:L="No options available",emptyStateDescription:A,emptyStateIcon:E,disabled:D=!1,className:j,fieldClassName:T,listClassName:k,closable:P=!1,header:_,footer:R,onClose:M,onChange:H,dismissRef:V,onFooterClick:K,open:Z,onOpenChange:Y,onSearchQueryChange:W,customMultiSelectTagsRenderer:se})=>{const G=m.useId(),X=r||G,te=`list-${X}`,le=p?`${X}-error`:void 0,oe=!p&&h?`${X}-caption`:void 0,me=o===c.ElementSize.Small,[ve,O]=m.useState(!1),U=Z!==void 0,de=U?!!Z:ve,ne=m.useCallback(z=>{U||O(z),Y?.(z)},[U,Y]),[ge,Qe]=m.useState(""),ft=m.useCallback(z=>{z!==ge&&(Qe(z||""),W?.(z||""))},[W,ge]),pt=n!==void 0,[ee,ce]=m.useState(a),he=pt?n:ee,ue=m.useMemo(()=>t?Array.isArray(he)?he:[]:typeof he=="string"?[he]:[],[he,t]),Lt=m.useMemo(()=>{const z=ge.trim().toLowerCase();return z?e.filter(ae=>ae.label.toLowerCase().includes(z)):e},[e,ge]);m.useEffect(()=>{de||ft("")},[de,ft]);const Re=m.useCallback(z=>{pt||ce(z),H?.(z)},[pt,H]),ur=m.useCallback(z=>{if(t){const ae=new Set(ue);ae.has(z)?ae.delete(z):ae.add(z),Re(Array.from(ae));return}Re(z),ne(!1)},[t,Re,ne,ue]),At=m.useCallback((z,ae)=>{if(z.stopPropagation(),!t){Re("");return}const kt=ue.filter(Va=>Va!==ae);Re(kt)},[t,ue,Re]),De=m.useMemo(()=>Lt.filter(z=>!z.disabled),[Lt]),fr=m.useMemo(()=>De.filter(z=>ue.includes(z.value)).length,[De,ue]),{allSelectedInFiltered:pr,someSelectedInFiltered:Ma}=m.useMemo(()=>{const z=De.length>0&&fr===De.length;return{allSelectedInFiltered:z,someSelectedInFiltered:fr>0&&!z}},[De,fr]),Pa=m.useCallback(()=>{if(!(!t||De.length===0))if(pr){const z=new Set(De.map(ae=>ae.value));Re(ue.filter(ae=>!z.has(ae)))}else{const z=new Set(ue);De.forEach(ae=>z.add(ae.value)),Re(Array.from(z))}},[pr,t,De,ue,Re]),Ot=ue.length>0,_t=!t&&Ot?ue[0]:void 0,Ne=m.useMemo(()=>_t?e.find(z=>z.value===_t)??e.flatMap(z=>z.children??[]).find(z=>z.value===_t):void 0,[e,_t]),ht=Ne?i?`${i} ${Ne.label}`:Ne.label:void 0,Ba=c.useIsMobileScreen(),hr=t&&w&&!se&&!Ba,mt=m.useMemo(()=>t?Ot?hr?s.jsx(pc,{options:e,selectedValues:ue,handleRemoveTag:At}):s.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:se?.(e,ue,At)??s.jsx(yt,{options:e,selectedValues:ue,handleRemoveTag:At})}):null:!Ne||!Ne.labelNode&&!Ne.description?null:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.jsx(c.EllipsisTooltip,{text:Ne.labelNode??ht}),Ne.description&&s.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:Ne.description})]}),[hr,se,At,Ot,t,e,ht,ue,Ne]),za=t||mt?"":ht||(l&&n?l:""),Fa=typeof u?.label=="string"?u.label:void 0,Ha=mt?[c.resolveAccessibleName(x,Fa),t?ue.map(z=>e.find(ae=>ae.value===z)?.label??z).join(", "):ht].filter(Boolean).join(", ")||void 0:c.resolveAccessibleName(x);m.useImperativeHandle(V,()=>({dismiss:()=>{ne(!1)}}));const $a=m.useCallback(z=>{D||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),de||ne(!0))},[D,de,ne]),Ka=()=>s.jsxs("div",{id:te,role:"listbox","aria-multiselectable":t||void 0,className:hc,children:[_&&s.jsx(s.Fragment,{children:typeof _=="function"?_():_}),(y||P)&&(e.length>Ic||!!ge)&&s.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[y&&s.jsx(c.Input,{id:`search-${X}`,size:v,placeholder:b,"aria-label":b||"Search options",onChange:z=>ft(z),value:ge,iconBefore:Sc,containerClassName:"w-full"}),P&&s.jsx(c.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:c.ElementSize.Small,icon:Nc,onClick:z=>{M?.(z),ne(!1)}})]}),t&&I&&De.length>0&&s.jsx("div",{className:f.mergeClasses(mc,"mt-2"),children:s.jsx(c.Checkbox,{id:`${X}-selectAll`,labelProps:{label:N},isSelected:pr,isIndeterminate:Ma,onChange:Pa})}),s.jsx("div",{role:"none",className:xc,children:Lt.length===0?s.jsx("div",{className:"px-2 py-3",children:s.jsx(c.NoDataContent,{icon:E,title:L,description:A})}):Lt.map(z=>{const ae=ue.includes(z.value);if(z.children?.length)return s.jsx(wc,{opt:z,selectedValues:ue,mark:t?c.MenuItemMark.Checkbox:S,onSelect:ur},z.value);const kt=t?s.jsx(c.MenuItem,{id:`${X}-${z.value}`,role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:c.MenuItemMark.Checkbox,selected:ae,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>ur(z.value)}):s.jsx(c.MenuItem,{role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:S,selected:ae,ellipsisLabel:!0,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>!z.disabled&&ur(z.value)});return s.jsx(m.Fragment,{children:z.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:z.interactiveTooltip.placement,content:z.interactiveTooltip.content,contentClassName:z.interactiveTooltip.contentClassName,children:kt}):kt},z.value)})}),R&&s.jsx("div",{onClick:z=>{K?.(z),K&&ne(!1)},children:typeof R=="function"?R():R})]});return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",j,c.DIAL_KIT_CLASS.select),children:[u&&s.jsx(c.Label,{...u,htmlFor:X}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(c.Dropdown,{open:de,onOpenChange:ne,disabled:D,closable:P,onClose:M,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:f.mergeClasses(gc,k),className:"w-full",renderOverlay:Ka,children:s.jsx(c.Input,{id:X,size:o,disabled:D,invalid:C,value:za,placeholder:mt?void 0:d,readOnly:!0,iconBefore:t?void 0:Ne?.icon,iconAfter:s.jsx(F.IconChevronDown,{size:me?f.DIAL_ICON_SIZE.SM:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses(Cc,de&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":de,"aria-controls":te,"aria-autocomplete":"none","aria-label":Ha,"aria-describedby":[g,le,oe].filter(Boolean).join(" ")||void 0,"aria-invalid":p||C?!0:void 0,containerClassName:"w-full",wrapperClassName:f.mergeClasses(!D&&"cursor-pointer",t&&Ot&&!hr&&["!h-auto flex-wrap py-2",me?"min-h-[24px]":"min-h-[40px]"],T),className:f.mergeClasses("cursor-pointer",mt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:$a,children:mt})}),s.jsx(c.ErrorText,{id:le,text:p}),!p&&s.jsx(c.CaptionText,{id:oe,text:h})]})]})},Os={[$.Array]:[],[$.String]:"",[$.Boolean]:!1,[$.Integer]:0,[$.Number]:0},jc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=ke(),u=e.anyOf??[],p=sc(t,u,i),h=u[p],x=!h||J(h,i).type===$.Null,g=y=>{const v=J(u[y],i);if(v.type===$.Null){r(null);return}const b=He(v,i);if(b!==void 0){r(b);return}const I=typeof v.type=="string"?v.type:"";r(I in Os?Os[I]:{})};return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:o??l.selectTypePlaceholder,options:u.map((y,v)=>({value:String(v),label:ea(y,i)})),value:String(p),disabled:d,onChange:y=>g(Number(typeof y=="string"?y:y[0])),className:"max-w-[280px]"}),!x&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(Ke,{schema:h,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},Xe=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:d="button",tooltipProps:u,href:p,target:h,rel:x,disabled:g,...y})=>{const v=f.mergeClasses("dial-kit-base-button",t&&c.getButtonClassNames(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",n===c.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",n===c.ElementSize.Small&&"dial-kit-base-button-small",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"px-2":"px-4"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),b=e?void 0:u?.tooltip,I=c.resolveAccessibleName(typeof e=="string"?e:void 0,y["aria-label"],b),C=s.jsxs(s.Fragment,{children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:o,children:e}),s.jsx(c.DialIcon,{icon:i})]}),N=y,w=p!==void 0?s.jsx("a",{...N,href:g?void 0:p,target:h,rel:x??(h==="_blank"?"noopener noreferrer":void 0),"aria-disabled":g||void 0,tabIndex:g?-1:N.tabIndex,onClick:g?void 0:N.onClick,className:v,"aria-label":I,children:C}):s.jsx("button",{...y,...c.getDisabledButtonProps(g,u,y.onClick),type:d,className:v,"aria-label":I,children:C});return u?s.jsx(c.Tooltip,{asChild:!0,...u,children:w}):w},ns=(e,t)=>({appearance:n,...a})=>s.jsx(Xe,{...a,variant:e,appearance:n||t}),as=(e,t)=>({variant:n,...a})=>s.jsx(Xe,{...a,variant:n||t,appearance:e}),la=ns(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),os=ns(c.ButtonVariant.Neutral,c.ButtonAppearance.Solid),Dc=ns(c.ButtonVariant.Danger,c.ButtonAppearance.Solid),tt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},Tc=s.jsx(F.IconSparkles,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),Ec=({appearance:e=c.ButtonAppearance.Outlined,iconBefore:t=Tc,iconAfter:r,style:n,...a})=>{const o=`dial-kit-starter-gradient-${m.useId().replace(/[^\w-]/g,"")}`,i=s.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:s.jsx("defs",{children:s.jsxs("linearGradient",{id:o,x1:tt.x1,y1:tt.y1,x2:tt.x2,y2:tt.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:tt.from}),s.jsx("stop",{offset:"1",stopColor:tt.to})]})})}),l=d=>s.jsxs(s.Fragment,{children:[i,d]});return s.jsx(Xe,{...a,variant:c.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:r&&!t?l(r):r,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...n}})},Lc=as(c.ButtonAppearance.Link,c.ButtonVariant.Primary),is=as(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Ac=as(c.ButtonAppearance.Outlined,c.ButtonVariant.Neutral),Nt=({title:e,description:t,summary:r,errorCount:n=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:d="Remove item"})=>{const[u,p]=m.useState(l),h=m.useId(),x=a===0;return s.jsxs("div",{className:f.mergeClasses("flex flex-col border border-tertiary",x?"rounded-xl bg-layer-raised":"rounded-lg",c.DIAL_KIT_CLASS.schemaRendererSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center gap-2",x?"px-4 py-3":"px-3 py-2"),children:[s.jsxs("button",{type:"button","aria-expanded":u,"aria-controls":u?h:void 0,onClick:()=>p(g=>!g),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-left text-primary focus-visible:outline focus-visible:outline-focus",children:[s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform",!u&&"-rotate-90")}),s.jsx("span",{className:f.mergeClasses("truncate",x?"dial-small-semi-text":"dial-small-text"),children:e})]}),s.jsx(c.InfoButton,{caption:t}),r&&s.jsx("span",{className:"dial-tiny-text whitespace-nowrap text-secondary",children:r}),n>0?s.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap dial-tiny-text text-error",children:[s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0"}),n," error",n>1?"s":""]}):s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0 text-success"}),i&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":d,onClick:i,className:"shrink-0"})]}),u&&s.jsx("div",{id:h,className:f.mergeClasses("border-t border-tertiary",x?"p-4":"p-3"),children:o})]})},Oc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:d=!0}=ke(),[u,p]=m.useState(),h=Array.isArray(t)?t:[],x=e.items;if(!x)return s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemSchema});const g=J(x,o),y=g.discriminator,v=y?Object.keys(y.mapping).map(w=>({value:w,label:w})):[],b=u??v[0]?.value,I=()=>{let w;if(y&&b){const S=J({$ref:y.mapping[b]},o);w={...He(S,o)??{},[y.propertyName]:b}}else w=He(g,o)??ta(g);r([...h,w])},C=w=>{r(h.filter((S,L)=>L!==w))},N=(w,S)=>{r(h.map((L,A)=>A===w?S:L))};return s.jsxs("div",{className:"flex flex-col gap-3",children:[h.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemsYet}),h.map((w,S)=>{const L=nc(w,y?.propertyName,S),A=Be(w,g,o,`${n.join(".")}[${S}]`);return s.jsx(Nt,{title:L,level:a,summary:ss(w,g,o),errorCount:A.length,onRemove:l?void 0:()=>C(S),defaultExpanded:d,removeItemAriaLabel:`${i.removeItemAriaLabel}: ${L}`,children:s.jsx(Ke,{schema:x,value:w,onChange:E=>N(S,E),path:[...n,String(S)],level:a+1,ariaLabel:L})},S)}),!l&&s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[v.length>0&&s.jsx($e,{ariaLabel:i.selectTypeToAdd,options:v,value:b,placeholder:i.selectTypeToAdd,onChange:w=>p(typeof w=="string"?w:w[0]),className:"max-w-[280px] flex-1"}),s.jsx(is,{label:i.addItem,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:I})]})]})};var ls=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(ls||{});const _s={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},_c=e=>typeof e=="boolean"?_s[e?"both":"none"]:_s[e],ca=({className:e="",value:t,onChange:r,error:n,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:d,invalid:u,"aria-describedby":p,"aria-invalid":h,...x})=>{const g=m.useId(),y=d??g,v=n?`${y}-error`:void 0,b=!n&&l?`${y}-caption`:void 0,I=f.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",u&&"dial-kit-input-error",x.disabled&&"dial-kit-input-disable",_c(o),e);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",a),children:[i&&s.jsx(c.Label,{...i,htmlFor:y}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("textarea",{id:y,value:t||"",className:I,onChange:C=>r?.(C.currentTarget.value),"aria-describedby":[p,v,b].filter(Boolean).join(" ")||void 0,"aria-invalid":h??(n||u?!0:void 0),...x}),s.jsx(c.ErrorText,{id:v,text:n}),!n&&s.jsx(c.CaptionText,{id:b,text:l})]})]})},ks=e=>{try{return JSON.parse(e),!0}catch{return!1}},cs=({value:e,onChange:t,id:r,ariaLabel:n})=>{const{readonly:a,texts:o}=ke(),[i,l]=m.useState(()=>JSON.stringify(e,null,2)??""),d=!ks(i),u=p=>{l(p),ks(p)&&t(JSON.parse(p))};return s.jsx(ca,{id:r,"aria-label":n,value:i,onChange:u,readOnly:a,invalid:d,error:d?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:ls.Vertical,className:"font-mono !whitespace-pre"})},kc=/^0+\.(\d+)?$/,Rc=/^0+/,Mc=[".","-","+","e","E"],Rs=e=>!e||e==="-"?e:String(e).match(kc)?String(e).replace(Rc,"0"):Number(e),ds=({integer:e,onChange:t,min:r,max:n,onKeyDown:a,onPaste:o,...i})=>{const l=u=>{if(e&&Mc.includes(u.key)){u.preventDefault();return}c.handleKeyDown(u,"number",r,n),a?.(u)},d=u=>{if(e){const p=u.clipboardData.getData("text"),h=p.replace(/\D/g,"");if(h!==p&&(u.preventDefault(),h)){const x=u.currentTarget,g=x.selectionStart??0,y=x.selectionEnd??0,v=x.value.slice(0,g)+h+x.value.slice(y);t?.(Rs(v))}}o?.(u)};return s.jsx(c.Input,{...i,wrapperClassName:f.mergeClasses(i.wrapperClassName,c.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:n,onChange:u=>t?.(Rs(u)),onKeyDown:l,onPaste:d})},da=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,isToggleHidden:n,size:a=c.ElementSize.Standard,...o})=>{const[i,l]=m.useState(!1),d=!r&&!n,u=i&&d;return m.useEffect(()=>{d||l(!1)},[d]),s.jsx(c.Input,{...o,wrapperClassName:f.mergeClasses(o.wrapperClassName,c.DIAL_KIT_CLASS.passwordInput),size:a,disabled:r,type:u?"text":"password",iconAfter:d?s.jsx(c.GhostIconButton,{size:c.ElementSize.Small,"aria-label":u?t:e,"aria-pressed":u,icon:u?s.jsx(F.IconEyeOff,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconEye,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>l(p=>!p)}):void 0})},Pc="flex flex-col gap-2",Bc="flex",zc="mt-2 ml-[26px]",Fc={[Oe.Column]:"flex-col gap-y-3",[Oe.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},wt=({items:e,value:t,onChange:r,name:n,id:a,orientation:o=Oe.Column,labelProps:i,disabled:l,error:d,caption:u,ariaLabel:p,className:h,optionsClassName:x,radioClassName:g,contentClassName:y})=>{const v=m.useId(),b=a??v,I=`${b}-label`,C=d?`${b}-error`:void 0,N=!d&&u?`${b}-caption`:void 0,w=c.resolveAccessibleName(i?.label);return s.jsxs("div",{className:f.mergeClasses(Pc,h,c.DIAL_KIT_CLASS.radioGroup),children:[i&&s.jsx(c.Label,{...i,id:I}),s.jsx("div",{role:"radiogroup","aria-labelledby":w?I:void 0,"aria-label":w?void 0:c.resolveAccessibleName(p),"aria-describedby":[C,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:f.mergeClasses(Bc,Fc[o],x),children:e.map(S=>{const L=S.value===t;return s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx(c.Radio,{id:`${b}-${S.value}`,name:n??b,value:S.value,labelProps:S.label==null?void 0:{label:S.label},"aria-label":S["aria-label"],caption:S.caption,isSelected:L,disabled:l||S.disabled,onChange:r,className:g}),L&&S.content?s.jsx("div",{className:f.mergeClasses(zc,y),children:S.content}):null]},S.value)})}),s.jsx(c.ErrorText,{id:C,text:d}),!d&&s.jsx(c.CaptionText,{id:N,text:u})]})},ua=({id:e,labelProps:t,isOn:r=!1,disabled:n,onChange:a,caption:o,className:i,...l})=>{const d=m.useId(),u=e??d,p=o?`${u}-caption`:void 0,h=m.useCallback(x=>{a?.(x.target.checked)},[a]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("group/choice flex items-center gap-2",i,c.DIAL_KIT_CLASS.switch),children:[s.jsx("input",{...l,type:"checkbox",role:"switch",id:u,checked:r,"aria-checked":r,disabled:n,onChange:h,"aria-label":c.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":p,className:"peer sr-only"}),s.jsx("label",{htmlFor:u,className:f.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",n?"cursor-not-allowed bg-control-disable-primary":f.mergeClasses("cursor-pointer",r?"bg-control-accent group-has-[label:hover]/choice:bg-control-accent-hover":"bg-control-neutral-default group-has-[label:hover]/choice:bg-control-neutral-hover-strong")),children:s.jsx("span",{className:f.mergeClasses("size-3.5 shrink-0 rounded-full",n?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&s.jsx(c.Label,{size:c.ElementSize.Standard,...t,htmlFor:u,className:f.mergeClasses("py-[1px]",n?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&s.jsx("span",{id:p,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},Ms=e=>typeof e=="string"?e:e[0],Cr=e=>e!=null?String(e):"",Hc=e=>e!==void 0?Number(e):void 0,fa=({schema:e,value:t,onChange:r,invalid:n,id:a,ariaLabel:o,ariaDescribedBy:i})=>{const{texts:l,readonly:d=!1,inputClassName:u,acceptableResourceTypes:p}=ke(),h=e.const!==void 0,x=Array.isArray(e.enum)?e.enum:[],g=x.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===$.String||e.type===void 0)){const v=(e.acceptableResourceTypes??[]).flatMap(b=>{const I=p?.[b];return Array.isArray(I)?I.map(C=>{const N=String(C);return{value:N,label:N}}):[]});return s.jsx($e,{id:a,ariaLabel:o,ariaDescribedBy:i,options:v,value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:b=>r(Ms(b)),placeholder:l.enumSelectPlaceholder,className:u})}if(h)return s.jsx(c.Input,{id:a,"aria-label":o,value:String(e.const??""),disabled:!0,containerClassName:u});if(g&&e.enumDisplay===lr.Radio)return s.jsx(wt,{id:a,ariaLabel:o,items:x.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,orientation:e.enumOrientation===cr.Row?Oe.Row:Oe.Column,disabled:d,onChange:v=>r(v)});if(g)return s.jsx($e,{id:a,ariaLabel:o,ariaDescribedBy:i,options:x.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:v=>r(Ms(v)),placeholder:l.enumSelectPlaceholder,className:u});switch(e.type){case $.Boolean:return s.jsx(ua,{id:a,"aria-label":o,isOn:!!t,disabled:d,onChange:v=>r(v)});case $.Integer:case $.Number:return s.jsx(ds,{id:a,"aria-label":o,"aria-describedby":i,integer:e.type===$.Integer,value:Cr(t),invalid:n,disabled:d,onChange:v=>r(Hc(v)),placeholder:e.type===$.Integer?l.integerInputPlaceholder:l.numberInputPlaceholder,containerClassName:u});default:return e.isProtected?s.jsx(da,{id:a,"aria-label":o,"aria-describedby":i,value:Cr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u}):s.jsx(c.Input,{id:a,"aria-label":o,"aria-describedby":i,value:Cr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u})}},Ps=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),pa=e=>!!(e.oneOf||e.anyOf||e.type===$.Array||Ye(e)),$c={[$.String]:"entryTypeString",[$.Number]:"entryTypeNumber",[$.Boolean]:"entryTypeBoolean",[$.Null]:"entryTypeNull",[$.Object]:"entryTypeObject",[$.Array]:"entryTypeArray"},Bs=e=>typeof e=="string"?e:e[0],Kc=({pair:e,valueSchema:t,isUnschematizedValue:r,onKeyChange:n,onValueChange:a,onRemove:o,path:i,level:l})=>{const{rootSchema:d,texts:u,readonly:p=!1,inputClassName:h,defaultExpanded:x=!0,touchedPaths:g,markTouched:y,skipUntouched:v}=ke(),[b,I]=m.useState(e.key),[C,N]=m.useState(()=>oc(e.value)),w=pa(t),S=r&&(C===$.Object||C===$.Array),L=r&&C===$.Null,A=r&&C===$.Boolean,E=w||S,D=[...i,e.id,"key"].join("."),j=St(D,g,v)&&e.key==="",T=e.key||u.valueColumnHeader,k=K=>{a(lc(K)),N(K)},P=m.useMemo(()=>ac.map(K=>({value:K,label:u[$c[K]]})),[u]),_=m.useMemo(()=>[{value:"true",label:u.booleanTrueOption},{value:"false",label:u.booleanFalseOption}],[u]),R=()=>L?s.jsx(c.Input,{"aria-label":T,value:"null",disabled:!0}):A?s.jsx($e,{ariaLabel:T,options:_,value:e.value?"true":"false",disabled:p,onChange:K=>{const Z=Bs(K);Z&&a(Z==="true")}}):s.jsx(fa,{schema:r?{type:C}:t,value:e.value,onChange:a,ariaLabel:T}),M=s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:E?"min-w-0 flex-1":"w-2/5 min-w-0",children:s.jsx(c.Input,{"aria-label":u.keyColumnHeader,value:b,disabled:p,invalid:j,error:j?`${u.keyColumnHeader} is required`:void 0,onChange:K=>I(K??""),onBlur:()=>{y?.(D),b!==e.key&&n(b)},placeholder:u.keyInputPlaceholder,containerClassName:h})}),!E&&s.jsx("div",{className:"min-w-0 flex-1",children:R()}),r&&s.jsx("div",{className:"w-28 shrink-0",children:s.jsx(c.Tooltip,{tooltip:u.entryTypeChangeWarning,triggerClassName:"block",children:s.jsx($e,{ariaLabel:u.typeColumnHeader,options:P,value:C,disabled:p,onChange:K=>{const Z=Bs(K);Z&&k(Z)}})})}),!p&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":e.key?`${u.removeFieldAriaLabel}: ${e.key}`:u.removeFieldAriaLabel,onClick:o,className:"mt-2 shrink-0"})]});if(!E)return M;if(S)return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(cs,{value:e.value,onChange:a,ariaLabel:T},C)]});const H=[...i,e.key],V=Be(e.value,t,d,H.join("."));return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(Nt,{title:e.key,level:l,summary:ss(e.value,t,d),errorCount:V.length+(j?1:0),defaultExpanded:x,children:s.jsx(Ke,{schema:t,value:e.value,onChange:a,path:H,level:l+1,ariaLabel:T})})]})},Vc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=ke(),d=e.additionalProperties===!0||e.additionalProperties==null,u=!d&&typeof e.additionalProperties=="object"?J(e.additionalProperties,o):{type:$.String},p=pa(u),[h,x]=m.useState(()=>Object.entries(t??{}).map(([b,I])=>Ps(b,I))),g=b=>{x(b),r(Object.fromEntries(b.filter(I=>I.key!=="").map(I=>[I.key,I.value])))},y=(b,I)=>g(h.map((C,N)=>N===b?{...C,...I}:C)),v=()=>{const b=p?He(u,o)??ta(u):"";x(I=>[...I,Ps("",b)])};return s.jsxs("div",{className:"flex flex-col gap-2",children:[h.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noFieldsYet}),h.length>0&&!p&&s.jsxs("div",{"aria-hidden":"true",className:"flex gap-2 pr-8",children:[s.jsx("span",{className:"w-2/5 dial-tiny-semi-text text-secondary",children:i.keyColumnHeader}),s.jsx("span",{className:"flex-1 dial-tiny-semi-text text-secondary",children:i.valueColumnHeader}),d&&s.jsx("span",{className:"w-28 shrink-0 dial-tiny-semi-text text-secondary",children:i.typeColumnHeader})]}),h.map((b,I)=>s.jsx(Kc,{pair:b,valueSchema:u,isUnschematizedValue:d,onKeyChange:C=>y(I,{key:C}),onValueChange:C=>y(I,{value:C}),onRemove:()=>g(h.filter((C,N)=>N!==I)),path:n,level:a},b.id)),!l&&s.jsx("div",{className:"pt-1",children:s.jsx(is,{label:i.addField,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:v})})]})},kr=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i}=ke(),l=J(e,o),d=Jn(Object.entries(l.properties??{}).filter(([,h])=>!J(h,o).isHidden)),u=l.required??[],p=t??{};return d.length===0?s.jsx("p",{className:"dial-small-text text-secondary",children:i.noConfigurableProperties}):s.jsx("div",{className:"flex flex-col gap-4",children:d.map(([h,x])=>{const g=J(x,o);return s.jsx(ha,{schema:x,value:p[h],onChange:y=>r({...p,[h]:y}),path:[...n,h],level:a,required:u.includes(h),label:g.title??x.title??Yt(h)},h)})})},zs=e=>typeof e=="string"?e:e[0],Wc=(e,t)=>{const{[t]:r,...n}=e.properties??{};return{...e,properties:n}},Gc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=ke(),u=m.useId(),p=o??l.selectTypePlaceholder,h=e.discriminatorDisplay===lr.Radio,x=e.discriminator;if(x){const C=x.propertyName,N=x.mapping,w=E=>J({$ref:N[E]},i),S=typeof t=="object"&&t!==null?t[C]:void 0,L=S?w(S):void 0,A=E=>{const D=He(w(E),i)??{};r({...D,[C]:E})};if(h){const E=e.discriminatorOrientation===cr.Row,D=T=>s.jsx(kr,{schema:Wc(T,C),value:t,onChange:r,path:n,level:a}),j=s.jsx(wt,{id:u,ariaLabel:p,value:S,onChange:A,disabled:d,orientation:E?Oe.Row:Oe.Column,items:Object.keys(N).map(T=>{const k=w(T);return{value:T,label:k.title??T,content:E?void 0:D(k)}})});return E?s.jsxs("div",{className:"flex flex-col gap-3",children:[j,L&&D(L)]}):j}return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:p,options:Object.keys(N).map(E=>({value:E,label:E})),value:S,placeholder:l.selectTypePlaceholder,disabled:d,onChange:E=>{const D=zs(E);D&&A(D)},className:"max-w-[280px]"}),L&&s.jsx("div",{className:"pl-3",children:s.jsx(kr,{schema:L,value:t,onChange:r,path:n,level:a})})]})}const g=e.oneOf??[],v=(()=>{if(typeof t!="object"||t===null||Array.isArray(t))return 0;const C=g.findIndex(N=>J(N,i).required?.every(w=>w in t));return C>=0?C:0})(),b=g[v],I=C=>{const N=He(J(g[C],i),i);r(N??null)};return h?s.jsx(wt,{id:u,ariaLabel:p,value:String(v),onChange:C=>I(Number(C)),disabled:d,items:g.map((C,N)=>({value:String(N),label:ea(C,i)??`Option ${N+1}`,content:s.jsx(Ke,{schema:J(C,i),value:t,onChange:r,path:n,level:a,ariaLabel:o})}))}):s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:p,options:g.map((C,N)=>({value:String(N),label:J(C,i).title??`Option ${N+1}`})),value:String(v),disabled:d,onChange:C=>I(Number(zs(C))),className:"max-w-[280px]"}),b&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(Ke,{schema:b,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},Ke=({schema:e,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:i=!1,fieldId:l,ariaLabel:d,ariaDescribedBy:u})=>{const p=m.useId(),{rootSchema:h,renderField:x,markTouched:g,touchedPaths:y,skipUntouched:v}=ke(),b=J(e,h),I=n.join("."),C=S=>{g?.(I),r(S)},N={schema:b,value:t,onChange:C,path:n,level:a};let w;if(b.oneOf)w=s.jsx(Gc,{...N,ariaLabel:d});else if(b.anyOf&&b.type!==$.Object)w=s.jsx(jc,{...N,ariaLabel:d});else if(Ye(b)){const S=b.additionalProperties!=null&&b.additionalProperties!==!1,L=!b.properties||Object.keys(b.properties).length===0;S&&L?w=s.jsx(Vc,{...N}):L&&b.additionalProperties!==!1?w=s.jsx(cs,{value:t,onChange:C,id:l,ariaLabel:d}):w=s.jsx(kr,{...N})}else if(b.type===$.Array)w=s.jsx(Oc,{...N});else{const S=St(I,y,v)&&!!o&&dr(t),L=!i&&S?rs(b.title??d??"Field"):void 0;w=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(fa,{schema:b,value:t,onChange:C,invalid:S,id:l,ariaLabel:d,ariaDescribedBy:L?p:u}),s.jsx(c.ErrorText,{id:p,text:L})]})}return x?x(n,b,w):w},ha=({schema:e,value:t,onChange:r,path:n,level:a=0,required:o,label:i})=>{const l=m.useId(),{rootSchema:d,defaultExpanded:u=!0,touchedPaths:p,skipUntouched:h}=ke(),x=J(e,d),g=n.join(".");if(Ye(x)||x.type===$.Array){const v=Be(t,x,d,g),b=i??x.title??n[n.length-1]??"Section";return s.jsx(Nt,{title:b,description:x.description,level:a,summary:ss(t,x,d),errorCount:St(g,p,h,!0)?v.length:0,defaultExpanded:u,children:s.jsx(Ke,{schema:x,value:t,onChange:r,path:n,level:a+1,required:o,ariaLabel:b})})}const y=St(g,p,h)&&o&&dr(t)?rs(i??"Field"):void 0;return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(c.Label,{htmlFor:l,label:i,required:o,caption:x.description}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(Ke,{schema:x,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:!0,fieldId:l,ariaLabel:i,ariaDescribedBy:y?`${l}-error`:void 0}),s.jsx(c.ErrorText,{id:`${l}-error`,text:y})]})]})},Fs="dial-small-semi-text text-primary",Uc=({schema:e,defaultValue:t,texts:r,className:n,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=nt.Sections,onChange:d,onPropertyChange:u,onDefaultValues:p,renderField:h,skipUntouched:x=!1,acceptableResourceTypes:g})=>{const y=m.useMemo(()=>({...rc,...r}),[r]),v=m.useMemo(()=>t||(He(e,e)??{}),[]),[b,I]=m.useState(v),[C,N]=m.useState(()=>new Set),w=m.useCallback(j=>{N(T=>T.has(j)?T:new Set([...T,j]))},[]);m.useEffect(()=>{p?.(v)},[]);const S=(j,T)=>{const k={...b,[j]:T};I(k),d?.(k),u?.(j,T)},L=new Set(Object.keys(e.properties??{})),A=Object.keys(b).filter(j=>!L.has(j)),E=Jn(Object.entries(e.properties??{}).filter(([,j])=>!J(j,e).isHidden)),D=e.required??[];return s.jsx(ra.Provider,{value:{rootSchema:e,texts:y,readonly:a,defaultExpanded:o,inputClassName:i,acceptableResourceTypes:g,renderField:h,touchedPaths:C,markTouched:w,skipUntouched:x},children:s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-4",n,c.DIAL_KIT_CLASS.schemaRenderer),children:[E.map(([j,T])=>{const k=J(T,e),P=k.title??T.title??Yt(j),_=D.includes(j),R=b[j],M=K=>S(j,K);if(l===nt.Flat)return s.jsx(ha,{schema:T,value:R,onChange:M,path:[j],level:0,required:_,label:P},j);if(l===nt.FlatSections)return s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Fs,children:P}),s.jsx(Ke,{schema:T,value:R,onChange:M,path:[j],level:0,required:_,ariaLabel:P})]},j);const H=Be(R,k,e,j),V=_&&dr(R)?Math.max(H.length,1):H.length;return s.jsx(Nt,{title:P,description:k.description,level:0,defaultExpanded:o,errorCount:St(j,C,x,!0)?V:0,children:s.jsx(Ke,{schema:T,value:R,onChange:M,path:[j],level:1,required:_,ariaLabel:P})},j)}),A.map(j=>{const T=Yt(j),k=s.jsx(cs,{value:b[j],onChange:P=>S(j,P),ariaLabel:T});return l===nt.Sections?s.jsx(Nt,{title:T,level:0,defaultExpanded:o,children:k},j):s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Fs,children:T}),k]},j)})]})})},Zc=e=>({info:s.jsx(F.IconInfoCircleFilled,{size:e.size}),error:s.jsx(F.IconAlertCircleFilled,{size:e.size}),warning:s.jsx(F.IconAlertTriangleFilled,{size:e.size}),success:s.jsx(F.IconCircleCheckFilled,{size:e.size}),loading:s.jsx(Ve,{size:e.size}),general:s.jsx(F.IconCheck,{size:e.size,stroke:e.stroke})}),qc={[Q.Info]:"bg-info text-info",[Q.Success]:"bg-success text-success",[Q.Warning]:"bg-warning text-warning",[Q.Error]:"bg-error text-error",[Q.Loading]:"bg-layer-raised text-info",[Q.General]:"bg-layer-sunken text-primary"},Yc="bg-layer-sunken text-primary",Xc={[Q.Info]:"text-info",[Q.Success]:"text-success",[Q.Warning]:"text-warning-icon",[Q.Error]:"text-error",[Q.Loading]:"text-info",[Q.General]:"text-primary"},Qc={[Q.Info]:"status",[Q.Success]:"status",[Q.Warning]:"alert",[Q.Error]:"alert",[Q.Loading]:"status",[Q.General]:"status"},Jc="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",us=({variant:e=Q.Info,type:t=fe.Toast,surface:r=qt.Variant,title:n,message:a,action:o,className:i,iconSize:l=24,iconStroke:d=2,closable:u=!1,closeAriaLabel:p="Close notification",onClose:h,children:x,textClassName:g,...y})=>{const v=m.useMemo(()=>Zc({size:l,stroke:d})[e],[e,l,d]),b=r===qt.Neutral,I=g??(t===fe.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return s.jsxs("div",{role:Qc[e],...y,className:f.mergeClasses(Jc,b?Yc:qc[e],t===fe.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===fe.SectionMessage&&e===Q.Loading&&"border-secondary",i,c.DIAL_KIT_CLASS.notification),children:[s.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("flex shrink-0",b&&Xc[e]),children:s.jsx(c.DialIcon,{icon:v})}),n?s.jsxs("div",{className:f.mergeClasses("flex min-w-0 text-primary break-words",I),children:[s.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:n}),s.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:a})]}):s.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:a})]}),o!=null&&s.jsx("div",{className:"flex shrink-0 items-center",children:o}),x,u&&s.jsx(c.CloseButton,{className:"shrink-0 self-start",ariaLabel:p,onClose:C=>h?.(C)})]})},ed=({className:e,children:t,...r})=>s.jsx("article",{...r,className:f.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,c.DIAL_KIT_CLASS.cardShell),children:t}),dt=(e,t)=>({type:n,...a})=>s.jsx(us,{...a,variant:e,type:n||t}),ut=(e,t)=>({variant:n,...a})=>s.jsx(us,{...a,variant:n||t,type:e}),td=dt(Q.Error,fe.Toast),rd=dt(Q.Info,fe.Toast),sd=dt(Q.Success,fe.Toast),nd=dt(Q.Warning,fe.Toast),ad=dt(Q.Loading,fe.Toast),od=dt(Q.General,fe.Toast),id=ut(fe.SectionMessage,Q.Error),ld=ut(fe.SectionMessage,Q.Info),cd=ut(fe.SectionMessage,Q.Success),dd=ut(fe.SectionMessage,Q.Warning),ud=ut(fe.SectionMessage,Q.Loading),fd=ut(fe.SectionMessage,Q.General);var xe=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(xe||{});const pd="en-GB",hd={[xe.Date]:"Select date",[xe.DateTime]:"Select date and time",[xe.Time]:"--:--",[xe.Weekday]:"Select day"},ma="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-hidden transition-colors hover:border-accent-alpha focus-within:border-accent-focus",ga="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",xa="!border-error",md="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",gd="z-floating rounded-lg bg-layer-raised p-2 shadow-md",xd="absolute end-2 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-lg text-secondary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus disabled:cursor-not-allowed disabled:text-control-disable-primary disabled:hover:bg-transparent",bd="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-hidden focus-visible:outline focus-visible:outline-focus",vd="bg-control-accent text-control-permanent",yd="text-accent dial-small-semi-text",Cd="text-control-disable-primary",ba="text-secondary",Id=s.jsx(F.IconCalendar,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ba}),Hs={prev:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Sd=(e,t)=>{const n=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-n);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},$s=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Ks=(e,t,r)=>{const n=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(n<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(n>a)return!0}return!1},Nd=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Vs=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),wd=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),Mt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Ws=(e,t)=>{const[r,n]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,n||0,0,0),a},jd=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Dd=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const n=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),n.length===0)return r;const a=String(Math.min(Number(n),59)).padStart(n.length,"0");return`${r}:${a}`},va=5,ya=e=>e.charAt(0).toUpperCase()+e.slice(1),Td=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,va+r));return ya(n.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Ed=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,va+r));return{value:String(r+1),label:ya(n.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),Ld=Array.from({length:24},(e,t)=>String(t).padStart(2,"0")),Ad=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Od="flex w-full shrink-0 items-center justify-center rounded-lg px-3 py-2 dial-small-text text-primary hover:bg-control-accent-alpha-hover focus:outline-hidden focus-visible:outline focus-visible:outline-focus",_d="bg-control-accent text-control-permanent hover:bg-control-accent",Gs=({label:e,options:t,selected:r,onSelect:n})=>{const a=m.useRef(null);m.useEffect(()=>{const l=a.current,d=l?.querySelector('[aria-selected="true"]');!l||!d||(l.scrollTop=d.offsetTop-l.clientHeight/2+d.offsetHeight/2)},[]);const o=l=>{const d=Array.from(l.currentTarget.querySelectorAll("button")),u=d.indexOf(document.activeElement),p={ArrowDown:d[u+1],ArrowUp:d[u-1],Home:d[0],End:d[d.length-1]}[l.key];p&&(l.preventDefault(),p.focus())},i=r??t[0];return s.jsx("div",{ref:a,role:"listbox","aria-label":e,tabIndex:-1,className:"flex h-56 flex-1 flex-col gap-0.5 overflow-y-auto",onKeyDown:o,children:t.map(l=>s.jsx("button",{type:"button",role:"option","aria-selected":l===r,tabIndex:l===i?0:-1,className:f.mergeClasses(Od,l===r&&_d),onClick:()=>n(l),children:l},l))})},kd=({value:e,onSelect:t})=>{const[r,n]=m.useMemo(()=>{const a=/^(\d{2}):(\d{2})$/.exec(e);return a?[a[1],a[2]]:[void 0,void 0]},[e]);return s.jsxs("div",{className:"flex w-[168px] gap-1",children:[s.jsx(Gs,{label:"Hours",options:Ld,selected:r,onSelect:a=>t(`${a}:${n??"00"}`,!1)}),s.jsx(Gs,{label:"Minutes",options:Ad,selected:n,onSelect:a=>t(`${r??"00"}:${a}`,!0)})]})},Us=({id:e,disabled:t,invalid:r,trigger:n,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,describedBy:d,panelLabel:u})=>{const p=c.useThemeScope(),[h,x]=m.useState(!1),{refs:g,floatingStyles:y,context:v}=B.useFloating({open:h,onOpenChange:S=>x(t?!1:S),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),b=B.useClick(v,{enabled:!t}),I=B.useDismiss(v),C=B.useRole(v,{role:"dialog"}),{getReferenceProps:N,getFloatingProps:w}=B.useInteractions([b,I,C]);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-disabled":t,"aria-labelledby":l,"aria-describedby":d,tabIndex:t?-1:0,className:f.mergeClasses(ma,"focus-visible:outline focus-visible:outline-focus",r&&xa,t&&ga,o),...N(),children:n}),h&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:v,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:g.setFloating,style:y,"aria-label":u,className:f.mergeClasses(md,p,a),...w(),children:i(()=>x(!1))})})})]})},Zs=({id:e,value:t,onChange:r,onBlur:n,disabled:a,invalid:o,className:i,ariaLabel:l,describedBy:d,placeholder:u="--:--",timezoneLabel:p,timezoneLabelClassName:h,picker:x=!1})=>{const[g,y]=m.useState(t),[v,b]=m.useState(!1),I=c.useThemeScope(),{refs:C,floatingStyles:N,context:w}=B.useFloating({open:v,onOpenChange:D=>b(a?!1:D),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),S=B.useDismiss(w),L=B.useRole(w,{role:"dialog"}),{getFloatingProps:A}=B.useInteractions([S,L]);m.useEffect(()=>{y(t)},[t]);const E=s.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,"aria-describedby":d,"aria-invalid":o||void 0,placeholder:u,disabled:a,value:g,onChange:D=>{const j=Dd(D.target.value);y(j),jd(j)&&r(j)},onBlur:n,className:f.mergeClasses(ma,o&&xa,a&&ga,x&&"pe-12",i)});return!p&&!x?E:s.jsxs("div",{ref:x?C.setReference:void 0,className:"relative w-full",children:[E,p&&s.jsx("span",{className:f.mergeClasses("dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",x&&"end-12",h),children:p}),x&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","aria-label":"Choose time","aria-haspopup":"dialog","aria-expanded":v,disabled:a,className:xd,onClick:()=>b(D=>!D),children:s.jsx(F.IconClock,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),v&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:w,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:C.setFloating,style:N,"aria-label":"Choose time",className:f.mergeClasses(gd,I),...A(),children:s.jsx(kd,{value:g,onSelect:(D,j)=>{y(D),r(D),j&&b(!1)}})})})})]})]})},Rd=({mode:e=xe.Date,value:t,onChange:r,onBlur:n,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,ariaDescribedBy:d,id:u,className:p,minDate:h,maxDate:x,locale:g=pd,fieldClassName:y,showTimezone:v=!1,showTimePicker:b=!0})=>{const I=o??hd[e],C=t instanceof Date?t:null,N=m.useId(),w=u??N,S=a?.id??`${w}-label`,L=!!a?.label,A=typeof a?.label=="string"?a.label:void 0,E=L?`${S} ${w}`:void 0,D=a?s.jsx(c.Label,{...a,id:S,htmlFor:w}):null,[j,T]=m.useState(()=>C??new Date),k=m.useMemo(()=>new Date,[]),P=m.useMemo(()=>v?Xn({locale:g}):null,[v,g]),_=m.useMemo(()=>Td(g),[g]),R=m.useMemo(()=>Ed(g),[g]),M=m.useMemo(()=>Sd(j.getFullYear(),j.getMonth()),[j]),H=Y=>{T(W=>new Date(W.getFullYear(),W.getMonth()+Y,1))},V=(Y,W)=>{if(Ks(Y,h,x))return;const se=e===xe.DateTime&&C?Ws(Y,Mt(C)):Y;r?.(se),e===xe.Date&&W()},K=Y=>{r?.(Ws(C??new Date,Y))},Z=()=>C?e===xe.DateTime?`${Vs(C,g)}, ${Mt(C)}`:Vs(C,g):I;if(e===xe.Time){const Y=typeof t=="string"?t:C?Mt(C):"";return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",p,c.DIAL_KIT_CLASS.calendar),children:[D,s.jsx(Zs,{id:w,value:Y,onChange:W=>r?.(W),onBlur:n,disabled:i,invalid:l,describedBy:d,placeholder:I,className:y,timezoneLabel:P,picker:b})]})}if(e===xe.Weekday){const Y=typeof t=="string"?t:void 0,W=R.find(se=>se.value===Y);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",p,c.DIAL_KIT_CLASS.calendar),children:[D,s.jsx(Us,{id:w,disabled:i,invalid:l,labelledBy:E,describedBy:d,panelLabel:A??I,fieldClassName:y,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!W&&"text-secondary"),children:W?.label??I}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ba})]}),panel:se=>s.jsx("div",{role:"listbox","aria-label":A??I,className:"flex flex-col gap-0.5",children:R.map(G=>s.jsx("button",{type:"button",role:"option","aria-selected":G.value===Y,className:f.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",G.value===Y&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(G.value),se()},children:G.label},G.value))})})]})}return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",p,c.DIAL_KIT_CLASS.calendar),children:[D,s.jsx(Us,{id:w,disabled:i,invalid:l,labelledBy:E,describedBy:d,panelLabel:A??I,fieldClassName:y,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!C&&"text-secondary"),children:Z()}),Id]}),panel:Y=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(c.StaticIconButton,{"aria-label":"Previous month",icon:Hs.prev,size:c.ElementSize.Small,onClick:()=>H(-1)}),s.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Nd(j,g)}),s.jsx(c.StaticIconButton,{"aria-label":"Next month",icon:Hs.next,size:c.ElementSize.Small,onClick:()=>H(1)})]}),s.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[_.map(W=>s.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:W},W)),M.map(W=>{const se=W.getMonth()!==j.getMonth(),G=$s(W,C),X=$s(W,k),te=Ks(W,h,x);return s.jsx("button",{type:"button",disabled:te,"aria-label":wd(W,g),"aria-pressed":G,"aria-current":X?"date":void 0,className:f.mergeClasses(bd,se&&Cd,X&&!G&&yd,G&&vd,te&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>V(W,Y),children:W.getDate()},W.toISOString())})]}),e===xe.DateTime&&s.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[s.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),s.jsx(Zs,{ariaLabel:"Time",value:C?Mt(C):"",onChange:K,onBlur:n,className:f.mergeClasses(!P&&"w-[120px]","px-3 py-1.5"),timezoneLabel:P,timezoneLabelClassName:"end-3 max-w-[60%]"})]})]})})]})},Md=3,Pd=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:n,ariaLabel:a="Folder path"})=>{const o=m.useRef(null),i=m.useRef(null),l=m.useRef(null),[d,u]=m.useState(!1),p=m.useRef(!1),h=m.useRef(0),x=m.useCallback(D=>{p.current=D,u(D)},[]),g=m.useCallback(()=>{const D=o.current;if(!D)return;if(p.current){D.clientWidth>=h.current&&x(!1);return}const j=i.current,T=l.current;if(!j||!T)return;const k=j.scrollWidth-j.clientWidth,P=parseFloat(getComputedStyle(T).minWidth)||0,_=T.clientWidth<=P+1;k>0&&_&&(h.current=D.clientWidth+k,x(!0))},[x]);m.useEffect(()=>{const D=o.current;if(D)return c.observeElementSize(D,g)},[g]);const y=e.join("\0");m.useEffect(()=>{x(!1),c.scheduleMeasure(g)},[y,g,x]),m.useEffect(()=>{d||c.scheduleMeasure(g)},[d,g]);const v=s.jsx(c.DialIcon,{icon:s.jsx(F.IconFolder,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),b=s.jsx("span",{className:Kr,children:s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronRight,{size:14,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"})}),I=f.mergeClasses(t,"text-secondary cursor-default"),C=e.length-1,N=e.length>=3?C-1:-1,w=e.length>Md||d,S=e.slice(1,d?C:C-1),L=D=>{const j=D===C,T=D===N;let k=e[D];return j&&(k=s.jsx("span",{className:r,children:e[D]})),s.jsxs("li",{className:f.mergeClasses(Zt,j&&"min-w-0",T&&"shrink-[1000]",!j&&!T&&"shrink-0"),children:[s.jsxs("span",{className:f.mergeClasses(Lr,wn,"pointer-events-none opacity-75",T&&"min-w-auto"),"aria-current":j?"page":void 0,"aria-disabled":"true",children:[D===0&&v,s.jsx("span",{ref:j&&i||T&&l||void 0,className:f.mergeClasses("truncate",j&&"min-w-0 flex-1",T&&"min-w-[2ch]",I),children:k})]}),!j&&b]},`item-${D}`)},A=()=>s.jsxs("li",{className:f.mergeClasses(Zt,"shrink-0"),children:[s.jsxs(c.Tooltip,{tooltip:e.join(" > "),triggerClassName:"inline-flex cursor-default items-center text-secondary",children:[s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),s.jsx("span",{className:"sr-only",children:S.join(", ")})]}),b]},"ellipsis"),E=[];return w?(E.push(L(0),A()),d||E.push(L(C-1)),E.push(L(C))):e.forEach((D,j)=>E.push(L(j))),s.jsx("nav",{ref:o,"aria-label":a,className:f.mergeClasses(Sn,n,c.DIAL_KIT_CLASS.folderPath),children:s.jsx("ol",{className:Nn,children:E})})};var Ze=(e=>(e.Small="small",e.Heading="heading",e))(Ze||{});const Bd="w-full overflow-hidden",zd="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",qs="flex min-w-0 items-center gap-2",Ys={[Ze.Small]:"dial-small-text",[Ze.Heading]:"dial-h2-text"},Fd={[Ze.Small]:"dial-small-semi-text",[Ze.Heading]:"dial-h2-text"},Hd={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},$d="flex min-w-0 flex-1 items-center gap-1 rounded-xs transition-colors",Kd="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Vd="cursor-default text-primary",Wd="cursor-default text-secondary",Xs="inline-flex flex-none items-center leading-none text-secondary",Gd="dial-kit-minimum-target flex shrink-0 items-center rounded-xs text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Ud=3,Zd=4,qd=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),Yd=({items:e,maxVisibleItems:t=Zd,size:r=Ze.Small,separator:n=qd,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const d=Math.max(t,Ud),u=m.useMemo(()=>e.length>d?e.slice(1,-(d-2)):[],[e,d]),p=m.useMemo(()=>u.map((y,v)=>({key:String(v),label:y.label,icon:y.icon})),[u]),h=m.useCallback(({key:y,domEvent:v})=>{const b=u[Number(y)];b&&(b.onClick?.(v),!b.onClick&&b.href&&!v.defaultPrevented&&(window.location.href=b.href))},[u]);if(e.length===0)return null;const x=e.slice(u.length+1),g=(y,{index:v,isFirst:b,isCurrent:I})=>{const C=!I&&(!!y.href||!!y.onClick),N=f.mergeClasses($d,C?Kd:I?f.mergeClasses(Vd,Fd[r]):Wd,l,c.DIAL_KIT_CLASS.breadcrumbsItem),w=s.jsxs(s.Fragment,{children:[y.icon,s.jsx(c.EllipsisTooltip,{text:y.label})]});return s.jsxs("li",{className:f.mergeClasses(qs,Ys[r],Hd[I?"last":b?"first":"middle"]),children:[C?y.href?s.jsx("a",{href:y.href,onClick:y.onClick,className:N,children:w}):s.jsx("button",{type:"button",onClick:y.onClick,className:N,children:w}):s.jsx("span",{className:N,"aria-current":I?"page":void 0,children:w}),!I&&s.jsx("span",{className:Xs,"aria-hidden":"true",children:n})]},`segment-${v}`)};return s.jsx("nav",{"aria-label":a,className:f.mergeClasses(Bd,i,c.DIAL_KIT_CLASS.breadcrumbs),children:s.jsxs("ol",{className:zd,children:[g(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),u.length>0&&s.jsxs("li",{className:f.mergeClasses(qs,Ys[r],"shrink-0"),children:[s.jsx(c.Dropdown,{items:p,onItemClick:h,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":o,className:Gd,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),s.jsx("span",{className:Xs,"aria-hidden":"true",children:n})]}),x.map((y,v)=>g(y,{index:e.length-x.length+v,isFirst:!1,isCurrent:v===x.length-1}))]})})},Xd=({className:e,icon:t,tooltipProps:r,type:n="button",...a})=>{const o=f.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),i=s.jsx("button",{...a,type:n,className:o,"aria-label":c.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||s.jsx(F.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?s.jsx(qe,{...r,children:i}):i},Qd=e=>s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",e&&"rotate-180")}),Jd=({variant:e,appearance:t,items:r,dropdownProps:n,...a})=>{const[o,i]=m.useState(!1),l=m.useMemo(()=>Qd(o),[o]);return s.jsx("div",{className:c.DIAL_KIT_CLASS.buttonDropdown,children:s.jsx(c.Dropdown,{...n,items:r,onOpenChange:d=>i(d),children:s.jsx(Xe,{...a,iconAfter:l,variant:e||c.ButtonVariant.Primary,appearance:t||c.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},Ca=({label:e,size:t,isOpen:r=!1,labelClassName:n,className:a,"aria-label":o,...i})=>{const l=t===c.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return s.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":r,"aria-label":o?`${o} ${e}`:void 0,className:f.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",l,a,c.DIAL_KIT_CLASS.inlineSelect),children:[s.jsx("span",{className:n,children:e}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",r&&"rotate-180")})]})},eu=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:n,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:d,listStyle:u,ariaLabel:p,triggerClassName:h,triggerLabelClassName:x,open:g,onOpenChange:y})=>{const[v,b]=m.useState(!1),I=g!==void 0,C=I?g:v,N=m.useCallback(j=>{I||b(j),y?.(j)},[I,y]),[w,S]=m.useState(r??e[0]?.key),L=t!==void 0,A=L?t:w,E=m.useMemo(()=>{const j=e.find(T=>T.key===A);return j?.label?String(j.label):""},[e,A]),D=m.useCallback(({key:j})=>{const T=e.find(k=>k.key===j);T&&(L||S(j),n?.(T))},[e,L,n]);return s.jsx(c.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:d,listStyle:u,disabled:o,open:I?g:void 0,onOpenChange:N,onItemClick:D,children:s.jsx(Ca,{label:E,size:a,isOpen:C,disabled:o,"aria-label":p,className:h,labelClassName:x})})},tu={[be.VALID]:"Completed",[be.ERROR]:"Error"},ru=(e,t)=>e.status===be.ERROR?t?"border-error text-primary":"border-error text-error":t?e.status===be.VALID?"border-success text-primary":"border-accent text-primary":e.status===be.VALID?"border-primary text-primary":"border-primary text-secondary",su=(e,t)=>e.status===be.ERROR?"bg-control-error text-control-permanent":e.status===be.VALID&&!t?"bg-success text-success":t?e.status===be.VALID?"bg-success text-success":"bg-control-accent text-control-permanent":"bg-layer-sunken text-secondary",nu=({steps:e,currentStep:t,onChangeStep:r,statusLabels:n,ariaLabel:a,className:o})=>{const i=l=>{if(l===t)return;const d=e.findIndex(h=>h.id===t),u=e.findIndex(h=>h.id===l);(e.slice(0,u).every(h=>h.status===be.VALID)||u<d)&&r(l)};return s.jsx("ol",{"aria-label":a,className:f.mergeClasses("m-0 flex list-none gap-x-3 p-0",o,c.DIAL_KIT_CLASS.steps),children:e.map((l,d)=>{const u=t===l.id,p=l.status?n?.[l.status]??tu[l.status]:void 0;let h=d+1;return u&&l.status===be.ERROR?h=s.jsx(F.IconExclamationCircle,{"aria-hidden":"true",size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):!u&&l.status===be.VALID&&(h=s.jsx(F.IconCheck,{"aria-hidden":"true",size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE})),s.jsx("li",{className:"flex min-w-[180px] flex-1",children:s.jsxs("button",{type:"button","aria-current":u?"step":void 0,disabled:l.disabled,onClick:()=>i(l.id),className:f.mergeClasses("flex h-8 w-full cursor-pointer items-center border-t-2 text-start dial-tiny-text","focus-visible:outline focus-visible:outline-focus",ru(l,u),"disabled:cursor-not-allowed disabled:text-control-disable-primary"),children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("me-2 flex size-[22px] shrink-0 items-center justify-center rounded-full",su(l,u)),children:h}),s.jsx("span",{children:l.name}),p&&s.jsx("span",{className:"sr-only",children:p})]})},l.id)})})};var _e=(e=>(e.Outlined="outlined",e.Filled="filled",e))(_e||{}),we=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(we||{});const au={[we.Blue]:"bg-blue text-blue",[we.Green]:"bg-green-2 text-green-1",[we.Violet]:"bg-violet-2 text-violet-1",[we.Indigo]:"bg-violet-1 text-violet-2",[we.Brown]:"bg-brown text-brown-2",[we.Red]:"bg-red text-red"},ou={[_e.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[_e.Filled]:"rounded-full"},iu={[_e.Outlined]:"dial-tiny-text",[_e.Filled]:"dial-caption-lead-semi-text"},fs=({label:e,variant:t=_e.Outlined,color:r=we.Blue,icon:n,textClassName:a,className:o,...i})=>s.jsxs("span",{...i,className:f.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",ou[t],t===_e.Filled&&au[r],o,c.DIAL_KIT_CLASS.badge),children:[n&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:n}),s.jsx("span",{className:a??iu[t],children:e})]});var jt=(e=>(e.Default="default",e.Compact="compact",e))(jt||{});const lu={[jt.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[jt.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},cu=({title:e,value:t,description:r,variant:n=jt.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:p})=>{const h=lu[n],x=d!==void 0?d:(l??0)>=0,g=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return s.jsxs("div",{className:f.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",h.container,i,c.DIAL_KIT_CLASS.analyticsCard),children:[l!==void 0?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:h.title,children:e}),s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",x?"bg-success text-success":"bg-error text-error"),children:g})]}):s.jsx("span",{className:h.title,children:e}),a?s.jsx(fs,{label:"Error",variant:_e.Filled,color:we.Red,textClassName:"dial-tiny-semi-text",className:"self-start"}):o?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-start"}):p?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:p[0].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:h.value,children:p[0].value})]}),s.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:p[1].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:h.value,children:p[1].value})]})]}):s.jsx("span",{className:h.value,children:t}),!a&&!o&&h.showDescription&&r!=null&&r!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},ps=[{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"}],du=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),uu=(e,t)=>{if(e<=0)return;let r;for(const n of t)(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=n.color);return r},Vt=({value:e,maxValue:t=1,error:r,isLoading:n,title:a,valueLabel:o,colorMap:i=ps,className:l,titleClassName:d,valueClassName:u,inline:p,ariaLabel:h})=>{const x=e==null,g=!!(r||n||!x),y=du(x?0:e,t),v=uu(y,i),b=o??(x?"—":e),I=h??(typeof a=="string"?a:void 0),C=r||n,N=r?s.jsx(fs,{label:"Error",variant:_e.Filled,color:we.Red,textClassName:"dial-tiny-semi-text"}):n?s.jsx(Ve,{size:18,fullWidth:!1}):s.jsx("span",{className:f.mergeClasses("shrink-0 tabular-nums text-end",p?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),w=g?s.jsx("div",{role:"progressbar","aria-valuenow":r||n||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":I,className:f.mergeClasses("w-full overflow-hidden rounded-xs",p?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!C&&s.jsx("div",{className:"h-full rounded-xs transition-[width] duration-300",style:{width:`${y*100}%`,backgroundColor:v}})}):null,S=s.jsx("span",{className:f.mergeClasses("dial-small-text text-primary",d),children:a});return p?s.jsxs("div",{className:f.mergeClasses("flex flex-row items-center gap-2",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsx("div",{className:"w-1/2 min-w-0",children:S}),s.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:w}),N]})]}):s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[S,N]}),w]})};var Qt=(e=>(e.Start="start",e.End="end",e))(Qt||{});const Ia=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:d,caretPosition:u=Qt.End,className:p,headerClassName:h,contentClassName:x})=>{const g=n!==void 0,[y,v]=m.useState(a),b=i?!0:g?n:y,I=m.useId(),C=`accordion-header-${I}`,N=`accordion-content-${I}`,w=()=>{if(o)return;const D=!b;g||v(D),d?.(D)},S=u===Qt.Start,L=i?null:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",b?"rotate-90":"rtl:rotate-180")}),A=s.jsxs(s.Fragment,{children:[S&&L,s.jsxs("span",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?s.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!S&&L]}),E=S?"justify-start gap-2":"justify-between";return s.jsxs("div",{className:f.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",p,c.DIAL_KIT_CLASS.accordion),children:[i?s.jsx("div",{id:C,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,h),children:A}):s.jsx("button",{id:C,type:"button","aria-expanded":b,"aria-controls":N,"aria-label":c.resolveAccessibleName(l),disabled:o,onClick:w,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",h),children:A}),s.jsx("div",{inert:!b,className:f.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",b?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:s.jsx("div",{className:"min-h-0 overflow-hidden",children:s.jsx("div",{className:"pt-3",children:s.jsx("div",{id:N,role:"region","aria-labelledby":C,className:f.mergeClasses("px-4 dial-small-text text-primary",x),children:r})})})})]})},fu=({title:e,titleTooltip:t,description:r,data:n,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:d=!0,nonCollapsible:u,isLoading:p,onBarClick:h,inline:x,barTitleClassName:g,barValueClassName:y,barClassName:v,barDescriptions:b,className:I})=>{const C=Object.entries(n),N=x?f.mergeClasses("text-secondary",g):g,w=o?"dial-tiny-text text-secondary":void 0,S=t?s.jsx(c.Tooltip,{tooltip:t,children:e}):e,L=a?[...new Set([...Object.keys(n),...Object.keys(a)])]:[],A="cursor-pointer rounded-xs text-left focus-visible:outline focus-visible:outline-focus",E="group flex flex-col gap-1.5",D=f.mergeClasses("flex flex-col gap-1.5 pl-2",h&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return s.jsx(Ia,{title:S,description:r,defaultExpanded:d,nonCollapsible:u,className:f.mergeClasses(I,c.DIAL_KIT_CLASS.analyticsBarGroup),children:s.jsx("div",{className:f.mergeClasses("flex flex-col",a?"gap-4":x?"gap-2":"gap-3"),children:p?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-center"}):a?L.map(j=>{const T=j in n?n[j]:null,k=j in a?a[j]:null,_=typeof T=="number"&&typeof k=="number"?parseFloat((k-T).toFixed(3)):null,R=_!=null&&_!==0,M=R&&_>0,H=R?M?`+${_}`:String(_):null,V=b?.[j],K=s.jsx("span",{className:"dial-small-text text-secondary",children:j}),Z=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[V?s.jsx(c.Tooltip,{tooltip:V,children:K}):K,H!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",M?"bg-success text-success":"bg-error text-error"),children:H})]}),s.jsxs("div",{className:D,children:[s.jsx(Vt,{title:o?.[0],value:T,maxValue:i,colorMap:l,inline:x,titleClassName:w,ariaLabel:j}),s.jsx(Vt,{title:o?.[1],value:k,maxValue:i,colorMap:l,inline:x,titleClassName:w,ariaLabel:`${j} compare`})]})]});return h?s.jsx("button",{type:"button",onClick:()=>h(j,T),className:f.mergeClasses(E,A),children:Z},j):s.jsx("div",{className:E,children:Z},j)}):C.map(([j,T])=>{const k=s.jsx(Vt,{title:j,value:T,maxValue:i,colorMap:l,inline:x,titleClassName:N,valueClassName:y,className:v}),P=h?s.jsx("button",{type:"button",onClick:()=>h(j,T),className:A,children:k}):k,_=b?.[j];return _?s.jsx(c.Tooltip,{tooltip:_,triggerClassName:"flex flex-col",children:P},j):s.jsx(m.Fragment,{children:P},j)})})})},pu="#FF4E50",hu=(e,t)=>{let r=-1;return t.forEach((n,a)=>{(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=a)}),r},Qs=(e,t)=>{const r=t.map(()=>0);let n=0;e.forEach(d=>{if(d<=0){n+=1;return}const u=hu(d,t);u>=0&&(r[u]+=1)});const a=Math.max(0,n,...r),o=d=>a>0?d/a:0,i={from:0,to:0,color:pu,count:n,ratio:o(n),isZeroBucket:!0},l=t.map((d,u)=>({from:d.from,to:d.to,color:d.color,count:r[u],ratio:o(r[u]),isZeroBucket:!1}));return[i,...l]},Sa=e=>e<=0?2:e%2===0?e:e+1,mu=e=>{const t=Sa(e);return[t,t/2,0]},Ir=e=>`${Math.round(e*100)/100}`,Na=(e,t)=>e===t?Ir(e):`${Ir(e)}-${Ir(t)}`,Sr=128,gu=(e,t)=>{const r=Na(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Js=(e,t,r,n,a)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&s.jsx("strong",{children:e}),s.jsxs("span",{children:[t," out of ",r," ",n]}),s.jsx("span",{children:gu(a.from,a.to)})]}),xu=({title:e,values:t,colorMap:r=ps,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const p=Qs(t,r),h=l?Qs(l,r):void 0,x=t.length,g=l?.length??0,y=Math.max(x,g),v=Sa(y),b=mu(y),I=S=>S.map(L=>({...L,ratio:v>0?L.count/v:0})),C=I(p),N=h?I(h):void 0,w=(S,L,A,E)=>{if(S.count===0)return s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})});const D=E?{backgroundImage:`repeating-linear-gradient(135deg, ${S.color} 0px, ${S.color} 1px, transparent 1px, transparent 4px)`,borderColor:S.color}:{backgroundColor:S.color};return s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":A,className:"flex min-h-2 w-full items-center justify-center rounded-xs border border-transparent",style:{height:`${S.ratio*100}%`,...D},children:a&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})})};return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",i,c.DIAL_KIT_CLASS.analyticsHistogram),children:[s.jsx("span",{className:"dial-small-text text-primary",children:e}),o?s.jsx("div",{className:"flex items-center justify-center",style:{height:Sr},children:s.jsx(Ve,{size:18,fullWidth:!1})}):s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[s.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:Sr},children:b.map((S,L)=>s.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${L/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:S},S))}),s.jsxs("div",{className:"relative min-w-0",children:[b.map((S,L)=>s.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${L/(b.length-1)*100}%`}},S)),s.jsx("div",{className:"relative flex items-end gap-1",style:{height:Sr},children:N?C.map((S,L)=>{const A=N[L],E=`${S.count} out of ${x} ${n}`,D=`${A.count} out of ${g} ${n}`;return s.jsxs("div",{className:"flex h-full flex-1 items-end",children:[w(S,Js(d,S.count,x,n,S),E,!0),w(A,Js(u,A.count,g,n,A),D,!1)]},L)}):C.map((S,L)=>{const A=`${S.count} out of ${x} ${n}`;return S.count===0?s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})},L):s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:A,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":A,className:f.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-xs border","border-transparent"),style:{height:`${S.ratio*100}%`,backgroundColor:S.color},children:a&&S.count>0&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})},L)})})]}),s.jsx("div",{}),s.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:C.map((S,L)=>s.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Na(S.from,S.to)},L))})]})]})},bu=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>{const i=!!n||t!=null;return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",!n&&"max-w-[200px]",o,c.DIAL_KIT_CLASS.labelledText),children:[s.jsx(c.Label,{label:e}),i&&s.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-primary",children:[n??s.jsx(c.EllipsisTooltip,{text:t,customTooltipContent:r,className:"dial-small-text min-w-0 flex-1"}),!n&&a]})]})},vu="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",yu="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Cu="flex flex-row items-center justify-between px-6 py-4",Iu="flex-1 min-w-0 mr-3 truncate dial-h2-text text-primary",Su="border-b border-tertiary",Nu="flex flex-row items-center gap-2 px-6 py-4",wu="border-t border-tertiary",Nr="flex shrink-0 flex-row items-center gap-2",ju="ml-auto mobile:flex-1",Jt="mobile:flex-1",Du={[We.Sm]:"max-w-full md:max-w-[400px]",[We.Md]:"max-w-full md:max-w-[800px]",[We.Lg]:"max-w-full md:max-w-[1200px]"},hs=({open:e=!1,header:t,ariaLabel:r,portalId:n,className:a,overlayClassName:o,overlayStyle:i,titleClassName:l,headerClassName:d,bodyClassName:u,children:p,footer:h,footerClassName:x,onClose:g,onBack:y,backAriaLabel:v="Back",headerActions:b,headerDivider:I=!1,mainButtons:C,additionalButtons:N,additionalButtonsOnLeft:w=!1,footerDivider:S=!1,size:L=We.Md,hideClose:A=!1,closeAriaLabel:E="Close dialog",closeOnOutsideClick:D=!0,preventKeyboardOnOpen:j=!1})=>{const T=c.useThemeScope(),k=m.useRef(null),P=m.useId(),{refs:_,context:R}=B.useFloating({open:e,onOpenChange:G=>{G||g?.(null)}}),M=B.useRole(R,{role:"dialog"}),H=B.useDismiss(R,{outsidePress:D}),{getFloatingProps:V}=B.useInteractions([M,H]);if(!e)return null;const K=typeof t=="string"?`popup-heading-${P}`:void 0,Z=G=>G?typeof G=="string"?s.jsx("h2",{id:K,className:f.mergeClasses(Iu,l),children:s.jsx(c.Tooltip,{tooltip:G,triggerClassName:"truncate",children:G})}):G:s.jsx("span",{}),Y=A?null:s.jsx(c.CloseButton,{ariaLabel:E,onClose:G=>g?.(G)}),W=(G,X=[],te)=>X.map(({variant:le=c.ButtonVariant.Neutral,className:oe,...me},ve)=>s.jsx(Xe,{variant:le,className:f.mergeClasses(te,oe),...me},`${G}-${ve}`)),se=()=>{if(h!==void 0)return h;if(!C?.length&&!N?.length)return null;const G=W("additional",N,w?void 0:Jt);return s.jsxs("div",{className:f.mergeClasses(Nu,S&&wu,x),children:[w&&G.length>0&&s.jsx("div",{className:Nr,children:G}),s.jsxs("div",{className:f.mergeClasses(Nr,ju),children:[!w&&G,W("main",C,Jt)]})]})};return s.jsx(B.FloatingPortal,{id:n,children:s.jsx(B.FloatingOverlay,{style:i,className:f.mergeClasses(vu,T,o),children:s.jsx(B.FloatingFocusManager,{context:R,initialFocus:j?k:_.floating,children:s.jsxs("div",{ref:_.setFloating,...V(),role:"dialog","aria-modal":"true","aria-labelledby":K,"aria-label":K?void 0:r,className:f.mergeClasses(yu,Du[L],a,c.DIAL_KIT_CLASS.popup),children:[j&&s.jsx("div",{ref:k,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),s.jsxs("div",{className:f.mergeClasses(Cu,I&&Su,d),children:[y&&s.jsx(c.GhostIconButton,{"aria-label":v,size:c.ElementSize.Small,className:"mr-2",onClick:y,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),Z(t),b?s.jsxs("div",{className:Nr,children:[b,Y]}):Y]}),s.jsx("div",{className:f.mergeClasses("grow overflow-auto",u),children:p}),se()]})})})})},Tu="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Eu="text-secondary dial-small-paragraph-text px-6 pb-4",Lu="px-6 py-4 h-[120px]",Au="Cancel",Ou="Ok",en={[it.Info]:{confirm:{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Solid}},[it.Danger]:{confirm:{variant:c.ButtonVariant.Danger,appearance:c.ButtonAppearance.Solid}}},wa=({header:e,description:t,descriptionClassName:r,open:n=!1,confirmLabel:a=Ou,cancelLabel:o=Au,isLoading:i=!1,disableConfirmButton:l=!1,className:d,confirmClassName:u,onClose:p,onConfirm:h,onCancel:x,children:g,variant:y=it.Info,size:v=We.Sm,footer:b,hideClose:I,...C})=>{const N=i?null:s.jsxs("div",{className:Tu,children:[s.jsx(os,{className:Jt,label:o,onClick:()=>x?x():p?.()}),s.jsx(Xe,{variant:en[y].confirm.variant,appearance:en[y].confirm.appearance,className:f.mergeClasses(Jt,u),label:a,disabled:l,onClick:h})]}),w=m.useCallback(()=>i?s.jsx("div",{className:Lu,children:s.jsx(Ve,{size:40})}):g??(t?s.jsx("div",{className:f.mergeClasses(Eu,r),children:t}):null),[g,t,i,r]);return s.jsx(hs,{...C,open:n,header:e,className:f.mergeClasses(d,c.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>p?.(),footer:b??N,size:v,hideClose:I??(!i&&b===void 0),children:w()})},_u="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",ku="min-w-0 flex-1 truncate text-primary",Ru="min-w-0 flex-1 truncate text-secondary",Mu="shrink-0 text-secondary",Pu="px-6 pb-4",Bu="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",zu="Cancel",Fu="Apply",Hu=({items:e,value:t,customValue:r,header:n,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:d,onSelectionChange:u,onCancel:p,onClose:h,isValid:x=!0,applyButtonLabel:g=Fu,cancelButtonLabel:y=zu,size:v=We.Md,portalId:b,disabled:I,invalid:C,error:N,caption:w,ariaLabel:S,className:L,fieldClassName:A})=>{const E=m.useId(),D=o??E,j=`${D}-label`,T=`${D}-value`,k=N?`${D}-error`:void 0,P=!N&&w?`${D}-caption`:void 0,[_,R]=m.useState(!1),M=d!==void 0,[H,V]=m.useState(t),K=M?d:H,Z=m.useCallback(()=>{I||(M||V(t),R(!0))},[I,M,t]),Y=m.useCallback(()=>{R(!1),h?.()},[h]),W=m.useCallback(()=>{p?.(),Y()},[p,Y]),se=m.useCallback(()=>{a(K),Y()},[a,K,Y]),G=m.useCallback(O=>{M||V(O),u?.(O)},[M,u]),X=c.resolveAccessibleName(i?.label),te=X?void 0:c.resolveAccessibleName(S),le=X?j:te&&`${D}-name`,oe=c.resolveAccessibleName(n),me=e.find(O=>O.value===t)?.label,ve=r??me;return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",L,c.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&s.jsx(c.Label,{...i,id:j,htmlFor:D}),s.jsxs("div",{className:"flex flex-col gap-1",children:[te&&s.jsx("span",{id:le,className:"sr-only",children:te}),s.jsxs("button",{type:"button",id:D,disabled:I,"aria-haspopup":"dialog","aria-expanded":_,"aria-labelledby":le?`${le} ${T}`:void 0,"aria-describedby":[k,P].filter(Boolean).join(" ")||void 0,onClick:Z,className:f.mergeClasses(_u,C&&"dial-kit-input-error",I&&"dial-kit-input-disable",A),children:[s.jsx("span",{id:T,className:ve==null?Ru:ku,children:ve??l}),s.jsx(F.IconMaximize,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Mu})]}),s.jsx(c.ErrorText,{id:k,text:N}),!N&&s.jsx(c.CaptionText,{id:P,text:w})]}),s.jsx(hs,{open:_,header:n,ariaLabel:oe?void 0:X,portalId:b,size:v,onClose:W,footer:s.jsxs("div",{className:Bu,children:[s.jsx(os,{label:y,onClick:W}),s.jsx(la,{label:g,disabled:!x,onClick:se})]}),children:s.jsx("div",{className:Pu,children:s.jsx(wt,{id:`${D}-options`,items:e,value:K,onChange:G,orientation:Oe.Column,ariaLabel:X??oe})})})]})},$u=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:n,onClick:a,tooltipProps:o,size:i=c.ElementSize.Small,className:l,...d})=>{const u=m.useCallback(h=>{a?.(h),n?.(!r)},[a,n,r]),p=s.jsx(c.IconButton,{...d,size:i,variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":c.resolveAccessibleName(d["aria-label"],o?.tooltip),onClick:u,className:f.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,c.DIAL_KIT_CLASS.toggleIconButton)});return o?s.jsx(c.Tooltip,{asChild:!0,...o,children:p}):p},Ku={default:"dial-tiny-text",selected:"dial-tiny-semi-text"},Vu={default:"cursor-not-allowed text-control-disable-primary",selected:"cursor-not-allowed bg-control-disable-primary text-control-disable-primary"},Wu=({label:e,icon:t,isSelected:r=!1,onToggle:n,onClick:a,disabled:o=!1,className:i,title:l,...d})=>{const u=m.useCallback(h=>{a?.(h),!h.defaultPrevented&&n?.(!r)},[a,n,r]),p=r?"selected":"default";return s.jsxs("button",{...d,type:"button","aria-pressed":r,disabled:o,title:l??(typeof e=="string"?e:void 0),onClick:u,className:f.mergeClasses(na,Ku[p],o?Vu[p]:[aa[Se.Selectable][p],oa,ia],i,c.DIAL_KIT_CLASS.toggleChip),children:[t&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),s.jsx("span",{className:"truncate",children:e})]})},Gu=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Uu="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Zu="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",qu="bg-layer-raised text-accent shadow-xs",Yu="bg-transparent text-secondary",Xu="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Qu="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Ju="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",ef="cursor-not-allowed bg-transparent text-control-disable-primary",tf=({items:e,value:t,onChange:r,disabled:n,className:a,segmentClassName:o,"aria-label":i})=>{const l=m.useRef({}),d=e.find(h=>h.value===t),u=d&&!d.disabled?d.value:e.find(h=>!h.disabled)?.value,p=m.useCallback(h=>{if(n||!Gu.includes(h.key))return;const x=e.filter(I=>!I.disabled);if(x.length===0)return;const g=Math.max(x.findIndex(I=>I.value===t),0),y=x.length-1;let v=g;switch(h.key){case"ArrowRight":case"ArrowDown":v=g===y?0:g+1;break;case"ArrowLeft":case"ArrowUp":v=g===0?y:g-1;break;case"Home":v=0;break;case"End":v=y;break}h.preventDefault();const b=x[v];l.current[b.value]?.focus(),b.value!==t&&r(b.value)},[n,e,t,r]);return s.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":n||void 0,onKeyDown:p,className:f.mergeClasses(Uu,a,c.DIAL_KIT_CLASS.segmentedControl),children:e.map(h=>{const x=h.value===t,g=n||h.disabled;return s.jsxs("button",{ref:y=>{l.current[h.value]=y},type:"button",role:"radio","aria-checked":x,"aria-label":c.resolveAccessibleName(h["aria-label"],typeof h.label=="string"?h.label:void 0),tabIndex:h.value===u?0:-1,disabled:g,onClick:()=>r(h.value),className:f.mergeClasses(Zu,x?qu:Yu,g?x?Ju:ef:x?Xu:Qu,o,c.DIAL_KIT_CLASS.segmentedControlItem),children:[h.icon,h.label]},h.value)})})},rf={[ot.Error]:"Error",[ot.Warning]:"Warning"},sf={[Ge.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[Ge.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},nf=({tabs:e,activeTabId:t,onTabChange:r,orientation:n=Ge.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:d,sectionLabelClassName:u})=>{const p=m.useRef({}),h=m.useId(),x=n===Ge.Vertical,g=e.find(I=>I.id===t),y=g&&!g.disabled?g.id:e.find(I=>!I.disabled)?.id,v=m.useCallback(I=>{const{next:C,previous:N}=sf[n];if(![C,N,"Home","End"].includes(I.key)||e.length===0)return;const w=e.filter(D=>!D.disabled);if(w.length===0)return;const S=Math.max(w.findIndex(D=>D.id===t),0),L=w.length-1;let A=S;I.key===C?A=S===L?0:S+1:I.key===N?A=S===0?L:S-1:I.key==="Home"?A=0:A=L,I.preventDefault();const E=w[A];p.current[E.id]?.focus(),E.id!==t&&r(E.id)},[e,t,r,n]),b=s.jsx("div",{role:"tablist","aria-orientation":x?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?h:void 0,onKeyDown:v,className:f.mergeClasses(x?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,c.DIAL_KIT_CLASS.tabList,!a&&c.DIAL_KIT_CLASS.tabs),children:e.map(I=>{const C=t===I.id,N=!!I.disabled;return s.jsxs("button",{ref:w=>{p.current[I.id]=w},type:"button",role:"tab","aria-selected":C,disabled:N,tabIndex:I.id===y?0:-1,onClick:()=>r(I.id),className:f.mergeClasses("dial-kit-enhanced-target flex items-center gap-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-focus",x?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",C?"dial-small-semi-text":"dial-small-text text-secondary"]:["dial-small-paragraph-semi-text border-b-2 border-transparent px-3 py-2","focus-visible:outline-offset-2"],N&&(x?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!N&&(x?C?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":C?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),d,c.DIAL_KIT_CLASS.tab,C&&c.DIAL_KIT_CLASS.tabSelected),children:[I.icon&&s.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:I.icon}),s.jsx("span",{className:f.mergeClasses(x&&!C&&!N&&"text-primary"),children:I.label}),I.status&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("flex shrink-0",I.status===ot.Error?"text-error":"text-warning",x&&I.count==null&&"ms-auto"),children:I.status===ot.Error?s.jsx(F.IconExclamationCircle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE})}),s.jsx("span",{className:"sr-only",children:I.statusLabel??rf[I.status]})]}),I.count!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",x&&"ms-auto",N&&"bg-layer-sunken text-control-disable-primary",!N&&(C?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:I.count})]},I.id)})});return a?s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.tabs),children:[s.jsx("div",{className:f.mergeClasses("flex h-16 shrink-0 items-center",x?"px-4":"px-3"),children:s.jsx("span",{id:h,className:f.mergeClasses("dial-h1-text text-primary",u,c.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),b]}):b},af="flex flex-nowrap items-center gap-1",of="min-w-max flex-1 justify-center",lf=({items:e,value:t,onChange:r,stretch:n=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>s.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:f.mergeClasses(af,a,c.DIAL_KIT_CLASS.filterChips),children:e.map(d=>s.jsx(Le,{label:d.label,icon:d.icon,appearance:Se.Selectable,selected:d.value===t,onClick:()=>r(d.value),className:f.mergeClasses(n&&of,o)},d.value))}),Rr=(e,t)=>{const r=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const n=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(o=>{if(o.startsWith("."))return n.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},cf=({labelProps:e,label:t,description:r,onChange:n,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:d,icon:u,id:p,ariaLabel:h,className:x})=>{const g=m.useId(),y=p??`file-dropzone-${g}`,v=d?`${y}-error`:void 0,[b,I]=m.useState(!1),C=m.useRef(0),N=m.useCallback(j=>{if(j.length===0)return;const T=i?j:j.slice(0,1),k=T.filter(_=>Rr(_,o)),P=T.filter(_=>!Rr(_,o));P.length>0&&a?.(P),k.length>0&&n(k)},[o,i,n,a]),w=m.useCallback(j=>{N(Array.from(j.target.files??[])),j.target.value=""},[N]),S=m.useCallback(()=>{C.current=0,I(!1)},[]),L=m.useCallback(j=>{l||(j.preventDefault(),C.current+=1,I(!0))},[l]),A=m.useCallback(j=>{l||(j.preventDefault(),j.dataTransfer.dropEffect="copy")},[l]),E=m.useCallback(()=>{l||(C.current-=1,C.current<=0&&S())},[l,S]),D=m.useCallback(j=>{j.preventDefault(),!l&&(S(),N(Array.from(j.dataTransfer?.files??[])))},[l,S,N]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[e&&s.jsx(c.Label,{...e,htmlFor:y}),s.jsx("input",{id:y,type:"file",accept:o,multiple:i,disabled:l,onChange:w,"aria-label":c.resolveAccessibleName(typeof t!="string"?h:void 0),"aria-describedby":v,"aria-invalid":d?!0:void 0,className:"peer sr-only"}),s.jsxs("label",{htmlFor:y,onDragEnter:L,onDragOver:A,onDragLeave:E,onDrop:D,className:f.mergeClasses("flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center","transition-colors motion-reduce:transition-none","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",l?"cursor-not-allowed border-secondary bg-layer-sunken":"cursor-pointer bg-layer-base",!l&&b&&"border-accent bg-control-accent-alpha",!l&&!b&&"border-secondary hover:border-accent",d&&!b&&"border-error hover:border-error",x,c.DIAL_KIT_CLASS.fileDropzone),children:[u??s.jsx(F.IconUpload,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),s.jsxs("span",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:f.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&s.jsx("span",{className:f.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),s.jsx(c.ErrorText,{id:v,text:d})]})},ja=({label:e="Shared",tooltip:t,size:r=12,className:n})=>s.jsx(c.Tooltip,{tooltip:t||"Shared",asChild:!0,children:s.jsx("span",{role:"img","aria-label":e,className:f.mergeClasses("flex shrink-0 rounded-xs bg-layer-raised text-accent",n,c.DIAL_KIT_CLASS.sharedEntityIndicator),children:s.jsx(F.IconArrowUpRight,{size:r,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var Ce=(e=>(e.Images="images",e.Video="video",e.Audio="audio",e.Code="code",e.Text="text",e.Pdf="pdf",e.Spreadsheet="spreadsheet",e.Presentation="presentation",e.Archive="archive",e.Dial="dial",e.Other="other",e))(Ce||{});const df={images:["apng","avif","bmp","gif","heic","heif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],video:["avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"],audio:["aac","aiff","flac","m4a","mid","midi","mp3","oga","ogg","opus","wav","wma"],code:["bash","c","cjs","cpp","cs","css","go","h","hpp","htm","html","ini","ipynb","java","js","json","jsx","kt","less","lua","mjs","php","ps1","py","r","rb","rs","sass","scala","scss","sh","sql","svelte","swift","toml","ts","tsx","vue","xml","yaml","yml","zsh"],text:["doc","docx","log","markdown","md","odt","rtf","text","txt"],pdf:["pdf"],spreadsheet:["csv","numbers","ods","tsv","xls","xlsm","xlsx"],presentation:["key","odp","pps","ppsx","ppt","pptx"],archive:["7z","bz2","gz","rar","tar","tgz","xz","zip"],dial:["dial"]},uf=new Map(Object.entries(df).flatMap(([e,t])=>t.map(r=>[r,e]))),ff=e=>uf.get(e)??"other",tn="var(--text-control-permanent, #FCFCFC)",Pt={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},pf="#1B212D",hf={[Ce.Images]:{path:"M11.0002 8.66667H11.0036M7.00024 11.3333L8.66691 9.66667C8.97624 9.369 9.35758 9.369 9.66691 9.66667L11.3336 11.3333M10.6669 10.6667L11.0002 10.3333C11.3096 10.0357 11.6909 10.0357 12.0002 10.3333L13.0002 11.3333M7.00024 8C7.00024 7.73478 7.1056 7.48043 7.29314 7.29289C7.48067 7.10536 7.73503 7 8.00024 7H12.0002C12.2655 7 12.5198 7.10536 12.7074 7.29289C12.8949 7.48043 13.0002 7.73478 13.0002 8V12C13.0002 12.2652 12.8949 12.5196 12.7074 12.7071C12.5198 12.8946 12.2655 13 12.0002 13H8.00024C7.73503 13 7.48067 12.8946 7.29314 12.7071C7.1056 12.5196 7.00024 12.2652 7.00024 12V8Z",sheet:Pt},[Ce.Code]:{path:"M8.33358 8.66665L7.00024 9.99998L8.33358 11.3333M11.6669 8.66665L13.0002 9.99998L11.6669 11.3333M10.6669 7.33331L9.33358 12.6666",sheet:{x1:"16.6667",y1:"0",x2:"2.08333",y2:"20.4167",from:"var(--bg-control-inverted, #57647A)",to:pf}},[Ce.Text]:{path:"M7.3335 8H12.6668M7.3335 10H12.6668M7.3335 12H11.3335",sheet:{x1:"25.8333",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-violet-1, #DDE3F9)",to:"var(--bg-gradient-1, #1D4ED8)"}},[Ce.Spreadsheet]:{path:"M7.33325 10.1667H12.6666M9.99992 7.5V12.8333M7.33325 8.16667C7.33325 7.98986 7.40349 7.82029 7.52851 7.69526C7.65354 7.57024 7.82311 7.5 7.99992 7.5H11.9999C12.1767 7.5 12.3463 7.57024 12.4713 7.69526C12.5963 7.82029 12.6666 7.98986 12.6666 8.16667V12.1667C12.6666 12.3435 12.5963 12.513 12.4713 12.6381C12.3463 12.7631 12.1767 12.8333 11.9999 12.8333H7.99992C7.82311 12.8333 7.65354 12.7631 7.52851 12.6381C7.40349 12.513 7.33325 12.3435 7.33325 12.1667V8.16667Z",sheet:{x1:"20.4167",y1:"-3.75",x2:"2.91667",y2:"20.4167",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-1, #059669)"}},[Ce.Pdf]:{fillPath:"M12.5373 10.3151C12.0382 10.3151 11.4137 10.4021 11.2094 10.4328C10.3637 9.54967 10.1231 9.04771 10.069 8.91388C10.1423 8.72544 10.3975 8.0096 10.4338 7.09022C10.4517 6.62991 10.3544 6.28596 10.1447 6.06792C9.93533 5.85024 9.68191 5.83331 9.60924 5.83331C9.35443 5.83331 8.92697 5.96216 8.92697 6.82503C8.92697 7.5737 9.27603 8.36813 9.37252 8.57339C8.86416 10.0536 8.31837 11.0669 8.20248 11.2753C6.15974 12.0444 6 12.788 6 12.9988C6 13.3775 6.26973 13.6036 6.72152 13.6036C7.8192 13.6036 8.8209 11.7607 8.98653 11.4407C9.76614 11.1301 10.8096 10.9377 11.0749 10.8918C11.8357 11.6166 12.7157 11.81 13.0811 11.81C13.3561 11.81 14 11.81 14 11.148C14 10.5332 13.2121 10.3151 12.5373 10.3151ZM12.4844 10.7497C13.0773 10.7497 13.234 10.9458 13.234 11.0494C13.234 11.1145 13.2093 11.3268 12.8915 11.3268C12.6065 11.3268 12.1145 11.1621 11.6303 10.8047C11.8322 10.7782 12.131 10.7497 12.4844 10.7497ZM9.57812 6.25458C9.63218 6.25458 9.66777 6.27195 9.69711 6.31264C9.86764 6.54926 9.73014 7.32242 9.56279 7.92745C9.40124 7.40867 9.28 6.61264 9.45058 6.33259C9.48392 6.27793 9.52204 6.25458 9.57812 6.25458ZM9.29017 10.8856C9.50483 10.452 9.74542 9.81997 9.87646 9.46253C10.1387 9.90147 10.4914 10.309 10.6954 10.53C10.0603 10.6639 9.57969 10.7976 9.29017 10.8856ZM6.4264 13.0566C6.41226 13.0399 6.41017 13.0045 6.42083 12.9621C6.44317 12.8731 6.61396 12.4322 7.84924 11.8796C7.67236 12.1582 7.39585 12.5563 7.09208 12.8537C6.87825 13.0538 6.71174 13.1553 6.59719 13.1553C6.55621 13.1553 6.49974 13.1442 6.4264 13.0566Z",sheet:{x1:"26.25",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-red, #FCE7F3)",to:"var(--bg-control-error-active, #CC4545)"}},[Ce.Audio]:{path:"M9 11.5C9 11.7652 8.89464 12.0195 8.70711 12.2071C8.51957 12.3946 8.26522 12.5 8 12.5C7.73478 12.5 7.48043 12.3946 7.29289 12.2071C7.10536 12.0195 7 11.7652 7 11.5C7 11.2347 7.10536 10.9804 7.29289 10.7929C7.48043 10.6053 7.73478 10.5 8 10.5C8.26522 10.5 8.51957 10.6053 8.70711 10.7929C8.89464 10.9804 9 11.2347 9 11.5ZM9 11.5V7.16663H12.3333V11.5M12.3333 11.5C12.3333 11.7652 12.228 12.0195 12.0404 12.2071C11.8529 12.3946 11.5985 12.5 11.3333 12.5C11.0681 12.5 10.8138 12.3946 10.6262 12.2071C10.4387 12.0195 10.3333 11.7652 10.3333 11.5C10.3333 11.2347 10.4387 10.9804 10.6262 10.7929C10.8138 10.6053 11.0681 10.5 11.3333 10.5C11.5985 10.5 11.8529 10.6053 12.0404 10.7929C12.228 10.9804 12.3333 11.2347 12.3333 11.5ZM9 8.49996H12.3333",sheet:Pt},[Ce.Video]:{path:"M9.99996 13.1667C11.8409 13.1667 13.3333 11.6743 13.3333 9.83333C13.3333 7.99238 11.8409 6.5 9.99996 6.5C8.15901 6.5 6.66663 7.99238 6.66663 9.83333C6.66663 11.6743 8.15901 13.1667 9.99996 13.1667ZM9.33337 8.5L11.3334 9.83333L9.33337 11.1667V8.5Z",sheet:Pt},[Ce.Presentation]:{path:"M7 7.33331H13M7.33333 7.33331V10.6666C7.33333 10.8435 7.40357 11.013 7.5286 11.1381C7.65362 11.2631 7.82319 11.3333 8 11.3333H12C12.1768 11.3333 12.3464 11.2631 12.4714 11.1381C12.5964 11.013 12.6667 10.8435 12.6667 10.6666V7.33331M10 11.3333V12.6666M9 12.6666H11M8.66667 9.99998L9.66667 8.99998L10.3333 9.66665L11.3333 8.66665",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-brown, #FDE8D8)",to:"var(--text-visual-brown-2, #B45309)"}},[Ce.Archive]:{path:"M10.0001 6.66669H9.58341M10.8334 7.451H10.4167M10.0001 8.23531H9.58341M10.8334 9.01963H10.4167M10.0001 9.80394H9.58341M10.8334 10.5883H10.4167M10.0001 11.3726C10.2211 11.3726 10.4331 11.4552 10.5893 11.6023C10.7456 11.7494 10.8334 11.9489 10.8334 12.1569V12.9412C10.8334 13.0452 10.7895 13.1449 10.7114 13.2185C10.6332 13.292 10.5273 13.3334 10.4167 13.3334H9.58341C9.47291 13.3334 9.36693 13.292 9.28879 13.2185C9.21065 13.1449 9.16675 13.0452 9.16675 12.9412V12.1569C9.16675 11.9489 9.25455 11.7494 9.41083 11.6023C9.56711 11.4552 9.77907 11.3726 10.0001 11.3726Z",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-3, #065F46)"}},[Ce.Dial]:{path:"M8.26392 7.44049C8.80816 7.44049 9.28449 7.50578 9.69653 7.63092L9.69849 7.6319C10.1079 7.75343 10.4556 7.938 10.7463 8.1817L10.7483 8.18365C11.0312 8.41601 11.2537 8.72491 11.4104 9.12115V9.12213C11.5666 9.51456 11.6496 9.98403 11.6497 10.5381C11.6497 11.5957 11.3539 12.3492 10.8108 12.8565C10.2602 13.3708 9.47204 13.6504 8.39868 13.6505H6.71313V7.44049H8.26392Z",fillPath:"M12.7167 12.1008L12.9558 12.3564L12.9558 12.3564L12.7167 12.1008ZM11.4504 6.20825L11.3486 6.54311L11.3507 6.54375L11.4504 6.20825ZM12.637 6.833L12.4119 7.10109L12.4147 7.10334L12.637 6.833ZM13.4108 7.9263L13.0853 8.05488L13.0856 8.05566L13.4108 7.9263ZM11.1666 12.8853L11.0909 12.5436V12.5436L11.1666 12.8853ZM10.4391 12.6553C10.2487 12.689 10.1217 12.8706 10.1553 13.0609C10.189 13.2513 10.3706 13.3783 10.5609 13.3447L10.5 13L10.4391 12.6553ZM13.6781 9.49291H13.3281C13.3281 10.5655 13.0283 11.33 12.4776 11.8451L12.7167 12.1008L12.9558 12.3564C13.687 11.6724 14.0281 10.6984 14.0281 9.49291H13.6781ZM7.9751 6.12805H8.3251C8.3251 6.24476 8.23053 6.35 8.1009 6.35V6V5.65C7.83231 5.65 7.6251 5.86989 7.6251 6.12805H7.9751ZM8.1009 6V6.35H9.89799V6V5.65H8.1009V6ZM9.89799 6V6.35C10.449 6.35 10.9312 6.41618 11.3486 6.54311L11.4504 6.20825L11.5522 5.87339C11.0566 5.72265 10.5039 5.65 9.89799 5.65V6ZM11.4504 6.20825L11.3507 6.54375C11.7654 6.66701 12.1173 6.85376 12.4119 7.10107L12.637 6.833L12.862 6.56492C12.4875 6.2506 12.0484 6.02084 11.5501 5.87275L11.4504 6.20825ZM12.637 6.833L12.4147 7.10334C12.7016 7.33926 12.9264 7.65273 13.0853 8.05488L13.4108 7.9263L13.7363 7.79772C13.5387 7.29746 13.2477 6.88206 12.8593 6.56265L12.637 6.833ZM13.4108 7.9263L13.0856 8.05566C13.2441 8.45409 13.3281 8.93071 13.3281 9.49291H13.6781H14.0281C14.0281 8.86239 13.934 8.29465 13.736 7.79694L13.4108 7.9263ZM7.9751 7.21882H8.3251V6.12805H7.9751H7.6251V7.21882H7.9751ZM12.7167 12.1008L12.4776 11.8451C12.117 12.1824 11.6591 12.4177 11.0909 12.5436L11.1666 12.8853L11.2423 13.227C11.9168 13.0776 12.4923 12.7898 12.9558 12.3564L12.7167 12.1008ZM11.1666 12.8853L11.0909 12.5436C11.091 12.5435 11.0826 12.5452 11.0606 12.5493C11.041 12.5528 11.0155 12.5573 10.9857 12.5625C10.926 12.5729 10.8511 12.5857 10.7756 12.5984C10.6269 12.6236 10.472 12.6495 10.4391 12.6553L10.5 13L10.5609 13.3447C10.6064 13.3366 11.1725 13.2425 11.2423 13.227L11.1666 12.8853Z",sheet:"var(--bg-gradient-2, #885DF2)"},[Ce.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:Pt}},mf=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${m.useId().replace(/[^\w-]/g,"")}`,{path:n,fillPath:a,sheet:o}=hf[t],i=typeof o=="string";return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.jsx("path",{d:"M17.4999 3.97859V16C17.4999 18.2091 15.709 20 13.4999 20H6.5C4.29086 20 2.5 18.2091 2.5 16V4C2.5 1.79086 4.29086 0 6.5 0H13.1683H13.5213C15.7186 0 17.4999 1.78128 17.4999 3.97859Z",fill:i?o:`url(#${r})`}),n&&s.jsx("path",{d:n,stroke:tn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&s.jsx("path",{d:a,fill:tn}),!i&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:r,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:o.from}),s.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},gf=({size:e})=>{const t=`dial-kit-folder-gradient-${m.useId().replace(/[^\w-]/g,"")}`;return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.jsx("path",{d:"M6.38992 3.75H4.66663C3.00977 3.75 1.66663 5.09315 1.66663 6.75V7.91667H7.16339L10.8333 5.79247L7.85075 4.1297C7.40412 3.8807 6.90127 3.75 6.38992 3.75Z",fill:"var(--stroke-gradient-1, #5976E9)"}),s.jsx("path",{d:"M14.3333 5.41669C16.5424 5.41669 18.3333 7.20755 18.3333 9.41669V12.25C18.3333 14.4592 16.5424 16.25 14.3333 16.25H5.66663C3.45749 16.25 1.66663 14.4592 1.66663 12.25V7.6708C1.66663 7.11851 2.11434 6.6708 2.66663 6.6708H6.89447C7.43998 6.6708 7.97973 6.55922 8.48053 6.34291L9.86582 5.74458C10.3666 5.52827 10.9064 5.41669 11.4519 5.41669H14.3333Z",fill:`url(#${t})`}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),s.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},xf=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),bf=(e,t)=>e===Ae.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",vf=(e,t,r)=>e===Ae.Folder?s.jsx(gf,{size:r}):s.jsx(mf,{size:r,kind:ff(t)}),ms=({type:e,name:t,fileExtension:r,shared:n=!1,loading:a=!1,size:o=f.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:d,loadingLabel:u="Loading",sharedIndicatorClassName:p,sharedIndicatorTooltip:h})=>{if(e!==Ae.File&&e!==Ae.Folder)return null;const x=e===Ae.File?xf(t,r):"",g=bf(e,x),y=d??(n?`${g}, shared`:g),v=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":y};return s.jsxs("span",{className:f.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,c.DIAL_KIT_CLASS.fileIcon),...v,children:[a?s.jsx(Ve,{size:o,ariaLabel:u}):vf(e,x,o),n&&s.jsx(ja,{tooltip:h,className:f.mergeClasses("absolute -bottom-0.5 -left-0.5",p)})]})},Da=({name:e,type:t=Ae.File,fileExtension:r,icon:n,shared:a=!1,loading:o=!1,loadingLabel:i,iconSize:l,details:d,isInvalidName:u=!1,className:p,nameClassName:h,sharedIndicatorClassName:x,sharedIndicatorTooltip:g,sharedLabel:y="Shared",hideTooltip:v=!1,tooltipContent:b})=>s.jsxs("div",{className:f.mergeClasses("flex w-full min-w-0 items-center gap-2",p,c.DIAL_KIT_CLASS.fileName),children:[n!=null&&!o?s.jsx("span",{"aria-hidden":!0,className:"flex shrink-0 items-center justify-center",children:n}):s.jsx(ms,{name:e,type:t,fileExtension:r,shared:a,loading:o,loadingLabel:i,size:l,sharedIndicatorClassName:x,sharedIndicatorTooltip:g,decorative:!o}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!d}),children:[s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("dial-small-paragraph-text",u?"text-secondary":"text-primary",h),text:e,hideTooltip:v,customTooltipContent:b}),a&&s.jsx("span",{className:"sr-only",children:y}),d]})]}),yf=({className:e,...t})=>s.jsx(Da,{...t,type:Ae.Folder,className:f.mergeClasses(e,c.DIAL_KIT_CLASS.folderName)}),Cf=({open:e,onClose:t,title:r,ariaLabel:n,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:d,className:u,overlayClassName:p,headerClassName:h,style:x,overlayStyle:g,bodyClassName:y,titleClassName:v,portalId:b})=>{const I=c.useThemeScope(),C=`bottom-sheet-title-${m.useId()}`,{refs:N,context:w}=B.useFloating({open:e,onOpenChange:E=>{E||t()}}),S=B.useRole(w,{role:"dialog"}),L=B.useDismiss(w,{outsidePress:l}),{getFloatingProps:A}=B.useInteractions([S,L]);return e?s.jsx(B.FloatingPortal,{id:b,children:s.jsx(B.FloatingOverlay,{lockScroll:!0,style:g,className:f.mergeClasses("z-popup flex items-end bg-backdrop",I,p,c.DIAL_KIT_CLASS.bottomSheetOverlay),children:s.jsx(B.FloatingFocusManager,{context:w,initialFocus:N.floating,children:s.jsxs("div",{ref:N.setFloating,...A(),role:"dialog","aria-modal":"true","aria-labelledby":r?C:void 0,"aria-label":r?void 0:n,style:x,className:f.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-hidden","animate-slideUp motion-reduce:animate-none",u,c.DIAL_KIT_CLASS.bottomSheet),children:[r&&s.jsxs("div",{className:f.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",h),children:[a&&s.jsx(c.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:s.jsx(F.IconArrowLeft,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),s.jsx("h2",{id:C,className:f.mergeClasses("min-w-0 truncate text-primary",v??"dial-body-semi-text"),children:r}),s.jsx(c.CloseButton,{ariaLabel:i,onClose:t,size:c.ElementSize.Standard,className:"absolute end-4"})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 overflow-y-auto",y),children:d})]})})})}):null};var lt=(e=>(e.Circle="circle",e.Square="square",e))(lt||{}),Pe=(e=>(e.Green1="green-1",e.Violet2="violet-2",e.Brown="brown",e.Red="red",e.Green2="green-2",e.Blue="blue",e.Violet1="violet-1",e))(Pe||{});const Ta={[Pe.Green1]:{background:"bg-green-1",foreground:"text-green-2"},[Pe.Violet2]:{background:"bg-violet-2",foreground:"text-violet-1"},[Pe.Brown]:{background:"bg-brown",foreground:"text-brown-2"},[Pe.Red]:{background:"bg-red",foreground:"text-red"},[Pe.Green2]:{background:"bg-green-2",foreground:"text-green-3"},[Pe.Blue]:{background:"bg-blue",foreground:"text-accent"},[Pe.Violet1]:{background:"bg-violet-1",foreground:"text-violet-2"}},If=e=>{const t=Object.values(Ta);let r=0;for(let n=0;n<e.length;n++)r+=e.charCodeAt(n);return t[r%t.length]},rn=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",Ea=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(rn(t[0])+rn(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},Sf={[lt.Circle]:"rounded-full",[lt.Square]:"rounded-md"},La=({name:e,initials:t,src:r,alt:n="",size:a=32,shape:o=lt.Circle,color:i,className:l,textClassName:d,imageClassName:u,onImageError:p})=>{const[h,x]=m.useState(),g=!!r&&h!==r,y=n!=="",v=C=>f.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",Sf[o],C,l,c.DIAL_KIT_CLASS.avatar);if(g)return s.jsx("img",{src:r,alt:n,width:a,height:a,className:f.mergeClasses(v(u),"object-cover"),onError:C=>{x(r),p?.(C)}});const{background:b,foreground:I}=i??If(e);return s.jsx("span",{role:y?"img":void 0,"aria-label":y?n:void 0,"aria-hidden":y?void 0:!0,className:v(f.mergeClasses(b,I)),style:{width:a,height:a,fontSize:d?void 0:Math.round(a*.4)},children:s.jsx("span",{className:f.mergeClasses("leading-none",d??"font-semibold"),children:t??Ea(e)})})};var pe=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(pe||{});const Nf={[pe.Model]:"Model",[pe.Agent]:"Agent",[pe.Toolset]:"Toolset",[pe.Skill]:"Skill",[pe.Prompt]:"Prompt"},sn={[pe.Model]:"text-blue",[pe.Agent]:"text-green-1",[pe.Toolset]:"text-brown-2",[pe.Skill]:"text-violet-1",[pe.Prompt]:"text-violet-2"},wf={[pe.Model]:"bg-blue",[pe.Agent]:"bg-green-2",[pe.Toolset]:"bg-brown",[pe.Skill]:"bg-violet-2",[pe.Prompt]:"bg-violet-1"},jf=["h1","h2","h3","h4","h5","h6"],Df=e=>jf[Math.min(6,Math.max(1,Math.round(e)))-1],Aa=({item:e,labels:t,showType:r=!0,showVersion:n=!0,hasFeaturedTag:a=!0,iconSize:o=48,headingLevel:i=3,query:l,footer:d,statusBadge:u,className:p,nameClassName:h="dial-h3-text",typeClassName:x="dial-caption-lead-semi-text",versionClassName:g="dial-tiny-text",iconClassName:y,featuredChipClassName:v})=>{const b=Df(i),I=a&&!!e.isFeatured,C=u!=null||I,N=n?e.version:void 0,w=r?t?.type??Nf[e.type]:void 0;return s.jsxs("div",{className:f.mergeClasses("flex items-start gap-2",p,c.DIAL_KIT_CLASS.entityIdentity),children:[s.jsx(La,{name:e.name,src:e.iconUrl,size:o,shape:lt.Square,imageClassName:"bg-entity-icon",className:f.mergeClasses("rounded-[14px]",y)}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",d!=null&&"self-stretch"),children:[(C||w)&&s.jsxs("div",{className:"relative flex items-center justify-between",children:[w&&s.jsx("span",{className:f.mergeClasses("uppercase",x,sn[e.type]),children:w}),C&&s.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[u,I&&s.jsx("span",{className:f.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",wf[e.type],sn[e.type],v),children:t?.featured??"Featured"})]})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(b,{className:f.mergeClasses("min-w-0 shrink text-primary",h),children:l?s.jsx(c.Highlight,{text:e.name,query:l,maxLines:1}):s.jsx(c.EllipsisTooltip,{text:e.name})}),N!=null&&s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("max-w-[30%] shrink-0 text-secondary",g),text:N})]}),d!=null&&d]})]})},wr="bg-control-neutral-active",Tf=({iconSize:e})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"shrink-0 overflow-hidden rounded-[14px]",children:s.jsx($t,{variant:Ee.Rectangular,width:e,height:e,className:wr})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx($t,{variant:Ee.Text,width:"30%",height:12,className:wr}),s.jsx($t,{variant:Ee.Text,width:"60%",height:16,className:wr})]})]}),Ef=({entityId:e,item:t,isLoading:r=!1,isDisabled:n=!1,error:a,details:o,labels:i,showType:l=!0,iconSize:d=44,headingLevel:u=4,className:p})=>{const h=o!=null?s.jsx("span",{className:"dial-caption-text text-secondary",children:o}):void 0,x=()=>e?r?s.jsx(Tf,{iconSize:d}):t==null?s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:e}),h]}):s.jsx(Aa,{item:t,labels:{type:i?.type},hasFeaturedTag:!1,iconSize:d,headingLevel:u,nameClassName:"dial-body-semi-text",showType:l,footer:h}):s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:i?.placeholder??"Not selected"});return s.jsxs("div",{children:[s.jsx("div",{className:f.mergeClasses("rounded-2xl border bg-layer-raised p-3",a?"border-error":"border-tertiary",n&&"opacity-50",p,c.DIAL_KIT_CLASS.selectedEntityCard),children:x()}),s.jsx(c.ErrorText,{text:a,className:"mt-1 block"})]})},Lf=({open:e,onClose:t,header:r,ariaLabel:n,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:d="Close",closeDisabled:u=!1,hideClose:p=!1,closeOnOutsideClick:h=!0,children:x,className:g,overlayClassName:y,headerClassName:v,style:b,overlayStyle:I,bodyClassName:C,titleClassName:N,portalId:w})=>{const S=c.useThemeScope(),L=`side-drawer-title-${m.useId()}`,A=typeof r=="string",{refs:E,context:D}=B.useFloating({open:e,onOpenChange:_=>{_||t()}}),j=B.useRole(D,{role:"dialog"}),T=B.useDismiss(D,{outsidePress:h}),{getFloatingProps:k}=B.useInteractions([j,T]),P=r!=null||o!=null||!p;return s.jsx(B.FloatingPortal,{id:w,children:s.jsx(B.FloatingOverlay,{lockScroll:e,style:I,className:f.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",S,y),children:s.jsx(B.FloatingFocusManager,{context:D,disabled:!e,initialFocus:E.floating,children:s.jsxs("div",{ref:E.setFloating,...k(),role:"dialog","aria-modal":"true","aria-labelledby":A?L:void 0,"aria-label":A?void 0:n,inert:!e,style:b,className:f.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-hidden","desktop:w-[540px] desktop:rounded-s-xl desktop:border-s desktop:border-secondary","transition-transform duration-300 motion-reduce:transition-none",e?"translate-x-0":"translate-x-full rtl:-translate-x-full",g,c.DIAL_KIT_CLASS.sideDrawer),children:[P&&s.jsxs("div",{className:f.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",v),children:[o&&s.jsx(c.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),A?s.jsx("h2",{id:L,className:f.mergeClasses("min-w-0 flex-1 truncate text-primary",N??"dial-h2-text"),children:r}):s.jsx("div",{className:"min-w-0 flex-1",children:r}),a,!p&&s.jsx(c.CloseButton,{ariaLabel:d,onClose:t,disabled:u,size:c.ElementSize.Standard})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 flex-1 overflow-y-auto",C),children:x})]})})})})},Af=4,Of=24,nn=e=>parseFloat(e)||0,_f=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},kf=()=>{},Rf=({id:e,value:t,defaultValue:r,size:n=c.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:d,disabled:u=!1,readOnly:p=!1,collapseTagOverflow:h=!1,ariaLabel:x,tagListLabel:g="Tags",className:y,fieldClassName:v,tagClassName:b,onChange:I})=>{const C=m.useId(),N=e||C,w=n===c.ElementSize.Small,S=m.useRef(null),L=m.useRef([]),A=m.useRef(null),E=t!==void 0,[D,j]=m.useState(r??[]),T=E?t:D,k=T.length,[P,_]=m.useState(""),[R,M]=m.useState(k),H=!p&&!u,V=m.useCallback(O=>{E||j(O),I?.(O)},[E,I]),K=m.useCallback(O=>U=>{L.current[O]=U},[]),Z=m.useCallback(()=>{const O=S.current;if(!O||O.clientWidth===0){M(T.length);return}const{paddingLeft:U,paddingRight:de}=getComputedStyle(O);M(sa({availableWidth:O.clientWidth-nn(U)-nn(de)-(p?0:Of),tagWidths:T.map((ne,ge)=>L.current[ge]?.offsetWidth??0),overflowChipWidth:A.current?.offsetWidth??0,gap:Af}))},[p,T]);m.useEffect(()=>{if(!h){M(k);return}const O=S.current;if(!O)return;const U=new ResizeObserver(()=>Z());return U.observe(O),Z(),()=>U.disconnect()},[h,Z,k]);const Y=f.mergeClasses(h?"shrink-0":"min-w-0",b),W=O=>{const U=_f(O.trim()).trim();!U||T.includes(U)||V([...T,U])},se=O=>{V(T.filter(U=>U!==O))},G=()=>{W(P),_("")},X=O=>{if(H){if(O.key==="Enter"||O.key===","){O.preventDefault(),G();return}O.key==="Backspace"&&!P&&k>0&&(O.preventDefault(),V(T.slice(0,-1)))}},te=()=>{H&&P.trim()&&G()},le=h?T.slice(0,R):T,oe=h?T.slice(R):[],me=oe.join(", "),ve=k>0&&s.jsxs("span",{role:"list","aria-label":g,className:f.mergeClasses("relative flex min-w-0 items-center gap-1",h?"flex-nowrap":"flex-wrap"),children:[le.map(O=>s.jsx(Le,{role:"listitem",label:O,className:Y,disabled:u,closable:H,onRemove:H?()=>se(O):void 0},O)),oe.length>0&&s.jsx(Le,{role:"listitem",label:`+${oe.length}`,"aria-label":me,title:me,className:f.mergeClasses("shrink-0",b),disabled:u}),h&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[T.map((O,U)=>s.jsx("span",{ref:K(U),className:"inline-flex",children:s.jsx(Le,{label:O,className:b,disabled:u,closable:H,onRemove:H?kf:void 0})},O)),s.jsx("span",{ref:A,className:"inline-flex",children:s.jsx(Le,{label:`+${k}`,className:b})})]})]});return s.jsx(c.Input,{id:N,size:n,labelProps:a,caption:i,error:l,invalid:d,disabled:u,readOnly:p,value:P,placeholder:k>0?void 0:o,"aria-label":x,wrapperRef:S,onChange:O=>_(O??""),onKeyDown:X,onBlur:te,containerClassName:f.mergeClasses("w-full",y),wrapperClassName:f.mergeClasses(k>0&&["!h-auto",w?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",h?"flex-nowrap overflow-hidden":"flex-wrap"],v,c.DIAL_KIT_CLASS.tagInput),className:f.mergeClasses("w-auto flex-1",h?"min-w-[24px]":"min-w-[100px]",p&&"cursor-default"),children:ve})},Mf=(e,t,r,n)=>{const a=t.trim().toLowerCase(),o=new Set(r);return e.filter(({value:i,label:l,description:d})=>!o.has(i)&&[l,i,d].some(u=>u?.toLowerCase().includes(a))).slice(0,Math.max(n,0))},Pf=5,Bf=({id:e,value:t,defaultValue:r,suggestions:n,maxSuggestions:a=Pf,openOnFocus:o=!1,size:i=c.ElementSize.Standard,labelProps:l,placeholder:d,caption:u,error:p,invalid:h=!1,disabled:x=!1,readOnly:g=!1,ariaLabel:y,tagListLabel:v="Tags",getRemoveTagLabel:b,className:I,fieldClassName:C,tagClassName:N,listClassName:w,onChange:S})=>{const L=m.useId(),A=e||L,E=`${A}-listbox`,D=c.useThemeScope(),j=i===c.ElementSize.Small,T=t!==void 0,[k,P]=m.useState(r??[]),_=T?t:k,R=_.length>0,M=!g&&!x,[H,V]=m.useState(""),[K,Z]=m.useState(!1),[Y,W]=m.useState(0),se=!H.trim(),G=m.useMemo(()=>Mf(n,H,_,o&&se?n.length:a),[H,se,a,o,n,_]),X=K&&M&&G.length>0,te=Math.min(Y,G.length-1),le=X&&te>=0,oe=ee=>`${E}-option-${ee}`,{refs:me,floatingStyles:ve}=B.useFloating({open:X,placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(c.overlayGap),B.flip({padding:c.overlayGap}),B.size({padding:c.overlayGap,apply({rects:ee,availableHeight:ce,elements:he}){he.floating.style.width=`${Math.round(ee.reference.width)}px`,he.floating.style.maxHeight=`${Math.floor(ce)}px`}})]}),O=m.useCallback(ee=>{T||P(ee),S?.(ee)},[T,S]),U=()=>{Z(!1),W(0)},de=()=>{!o||!M||(Z(!0),W(se?-1:0))},ne=ee=>{const ce=ee.trim();ce&&!_.includes(ce)&&O([..._,ce]),V(""),o?W(-1):U()},ge=ee=>O(_.filter(ce=>ce!==ee)),Qe=ee=>{const ce=ee??"",he=!!ce.trim();V(ce),Z(he||o),W(he?0:-1)},ft=ee=>{if(M)switch(ee.key){case"ArrowDown":case"ArrowUp":{if(ee.preventDefault(),!X){Z(!0),W(0);return}const ce=ee.key==="ArrowDown"?1:-1,he=te<0?Math.min(-ce,0):te;W((he+ce+G.length)%G.length);return}case"Enter":case",":ee.preventDefault(),ne(le?G[te].value:H);return;case"Escape":X&&ee.preventDefault(),U();return;case"Backspace":!H&&R&&(ee.preventDefault(),O(_.slice(0,-1)));return}},pt=ee=>ee.preventDefault();return s.jsxs(s.Fragment,{children:[s.jsx(c.Input,{id:A,role:"combobox","aria-autocomplete":"list","aria-expanded":X,"aria-controls":E,"aria-activedescendant":le?oe(te):void 0,"aria-invalid":h||void 0,"aria-label":y,size:i,labelProps:l,caption:u,error:p,invalid:h,disabled:x,readOnly:g,value:H,placeholder:R?void 0:d,wrapperRef:me.setReference,onChange:Qe,onKeyDown:ft,onFocus:de,onClick:de,onBlur:U,containerClassName:f.mergeClasses("w-full",I),wrapperClassName:f.mergeClasses(R&&["!h-auto flex-wrap gap-1 py-2",j?"min-h-[24px]":"min-h-[40px]"],C,c.DIAL_KIT_CLASS.autocompleteTagInput),className:f.mergeClasses("w-auto min-w-[100px] flex-1",g&&"cursor-default"),children:R&&s.jsx("span",{role:"list","aria-label":v,className:"flex min-w-0 flex-wrap items-center gap-1",children:_.map(ee=>s.jsx(Le,{role:"listitem",label:ee,className:f.mergeClasses(Xt,"min-w-0",N),disabled:x,closable:M,removeLabel:b?.(ee),onRemove:M?()=>ge(ee):void 0},ee))})}),s.jsx(B.FloatingPortal,{children:s.jsx("div",{ref:me.setFloating,id:E,role:"listbox","aria-label":v,hidden:!X,style:ve,className:f.mergeClasses("z-floating overflow-y-auto",c.overlaySurfaceClassName,c.overlayListClassName,!X&&"hidden",D,w),children:X&&G.map((ee,ce)=>{const he=ce===te;return s.jsx(c.MenuItem,{id:oe(ce),role:"option","aria-selected":he,tabIndex:-1,label:ee.label,description:ee.description,mark:c.MenuItemMark.Tint,selected:he,onMouseDown:pt,onMouseEnter:()=>W(ce),onClick:()=>ne(ee.value)},ee.value)})})})]})},zf=(e,t)=>{if(e<=0||t<=0)return[];const r=Math.floor(e/t+1e-9);return Array.from({length:r},(n,a)=>(a+1)*t/e*100)},Oa=e=>(e.toString().split(".")[1]??"").length,Ff=(e,t,r,n)=>{const a=Math.min(r,Math.max(t,e));if(n<=0)return a;const o=Math.round(Number(((a-t)/n).toFixed(9))),i=t+o*n;return Number(Math.min(r,i).toFixed(Oa(n)))},Hf=12,an=e=>`calc(${e}% + ${(.5-e/100)*Hf}px)`,$f=(e,t)=>e&&t?"grid-cols-[auto_minmax(0,1fr)_auto]":e?"grid-cols-[auto_minmax(0,1fr)]":t?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]",Kf=({id:e,value:t,min:r=0,max:n=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:d,showValue:u=!1,showTooltip:p=!1,showTicks:h=!1,leftContent:x,rightContent:g,showValueInput:y=!1,valueInputAriaLabel:v,caption:b,error:I,onChange:C,containerClassName:N,trackClassName:w,fillClassName:S,className:L,...A})=>{const E=m.useId(),D=e??E,j=b&&!I?`${D}-caption`:void 0,T=I?`${D}-error`:void 0,k=n-r,P=k>0?Math.min(100,Math.max(0,(t-r)/k*100)):0,_=an(P),R=h&&!o?zf(k,a):[],M=p&&!o,H=x!=null,V=y||g!=null,K=Oa(a),[Z,Y]=m.useState(null),W=d?d(t):t.toFixed(K),se=m.useCallback(te=>{C?.(Number(te.target.value))},[C]),G=m.useCallback(te=>{const le=te==null?"":String(te);Y(le);const oe=Number(le);le!==""&&Number.isFinite(oe)&&C?.(Ff(oe,r,n,a))},[n,r,C,a]),X=m.useCallback(()=>Y(null),[]);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",N),children:[(i||u)&&s.jsxs("div",{className:"flex items-center gap-2",children:[i&&s.jsx(c.Label,{...i,htmlFor:D}),u&&s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:W})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("grid items-center gap-y-1",y?"gap-x-2":"gap-x-3",$f(H,V),M&&"mt-2"),children:[H&&s.jsx("div",{className:"flex items-center",children:x}),s.jsxs("div",{className:"relative flex h-6 items-center",children:[s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-accent-muted",w)}),R.map(te=>s.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute size-0.5 -translate-x-1/2 rounded-full border border-accent-focus",style:{left:an(te)}},te)),s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",S),style:{width:_}}),M&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none absolute bottom-full mb-0.5 flex -translate-x-1/2 flex-col items-center",style:{left:_},children:[s.jsx("span",{className:"whitespace-nowrap rounded-md bg-control-inverted px-2 py-0.5 dial-small-text text-control-inverted shadow-xs",children:W}),s.jsx("svg",{width:"8",height:"4",viewBox:"0 0 8 4",className:"fill-control-inverted",children:s.jsx("path",{d:"M0 0h8L4 4z"})})]}),s.jsx("input",{...A,type:"range",id:D,value:t,min:r,max:n,step:a,disabled:o,onChange:se,"aria-label":c.resolveAccessibleName(typeof i?.label!="string"?A["aria-label"]:void 0),"aria-valuetext":d?W:void 0,"aria-describedby":T??j,className:f.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",L)})]}),V&&s.jsx("div",{className:"flex items-center",children:y?s.jsx(ds,{"aria-label":c.resolveAccessibleName(v??(typeof i?.label=="string"?i.label:void 0)),value:Z??t.toFixed(K),min:r,max:n,step:a,disabled:o,size:c.ElementSize.Small,containerClassName:"w-12",className:"text-center",onChange:G,onBlur:X}):g}),l&&s.jsx("div",{className:f.mergeClasses("dial-tiny-text flex text-secondary",H&&"col-start-2"),children:l.length===3?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"flex-1 text-center",children:l[1]}),s.jsx("span",{children:l[2]})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"ml-auto",children:l[1]})]})})]}),s.jsx(c.ErrorText,{id:T,text:I}),!I&&s.jsx(c.CaptionText,{id:j,text:b})]})]})},Vf=48,Wf=({children:e,title:t,width:r=280,collapsedWidth:n=Vf,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:d="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:p="Expand sidebar",className:h,titleClassName:x,contentClassName:g,footerClassName:y})=>{const v=a!==void 0,[b,I]=m.useState(o),C=v?a:b,N=`collapsible-sidebar-content-${m.useId()}`,w=C?u:p,S=L=>{const A=!C;v||I(A),i?.(A,L)};return s.jsxs("aside",{"aria-label":d,style:{width:`${C?r:n}px`},className:f.mergeClasses("flex flex-col justify-between",h,c.DIAL_KIT_CLASS.collapsibleSidebar),children:[s.jsx("div",{id:N,hidden:!C,className:f.mergeClasses("min-h-0 flex-1 overflow-auto p-4",g),children:e}),s.jsx("div",{hidden:C,className:f.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",x),children:t}),s.jsxs("div",{className:f.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",y),children:[C&&l,s.jsx(c.IconButton,{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,size:c.ElementSize.Standard,onClick:S,"aria-label":w,"aria-expanded":C,"aria-controls":N,tooltipProps:{tooltip:w},icon:C?s.jsx(F.IconChevronsLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconChevronsRight,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})};var ie=function(){return ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ie.apply(this,arguments)},on={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},ln={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Bt={width:"20px",height:"20px",position:"absolute",zIndex:1},Gf={top:ie(ie({},on),{top:"-5px"}),right:ie(ie({},ln),{left:void 0,right:"-5px"}),bottom:ie(ie({},on),{top:void 0,bottom:"-5px"}),left:ie(ie({},ln),{left:"-5px"}),topRight:ie(ie({},Bt),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:ie(ie({},Bt),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:ie(ie({},Bt),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:ie(ie({},Bt),{left:"-10px",top:"-10px",cursor:"nw-resize"})},Uf=m.memo(function(e){var t=e.onResizeStart,r=e.direction,n=e.children,a=e.replaceStyles,o=e.className,i=m.useCallback(function(u){t(u,r)},[t,r]),l=m.useCallback(function(u){t(u,r)},[t,r]),d=m.useMemo(function(){return ie(ie({position:"absolute",userSelect:"none"},Gf[r]),a??{})},[a,r]);return s.jsx("div",{className:o||void 0,style:d,onMouseDown:i,onTouchStart:l,children:n})}),Zf=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Te=function(){return Te=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Te.apply(this,arguments)},qf={width:"auto",height:"auto"},zt=function(e,t,r){return Math.max(Math.min(e,r),t)},cn=function(e,t,r){var n=Math.round(e/t);return n*t+r*(n-1)},rt=function(e,t){return new RegExp(e,"i").test(t)},Ft=function(e){return!!(e.touches&&e.touches.length)},Yf=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},dn=function(e,t,r){r===void 0&&(r=0);var n=t.reduce(function(o,i,l){return Math.abs(i-e)<Math.abs(t[o]-e)?l:o},0),a=Math.abs(t[n]-e);return r===0||a<r?t[n]:e},jr=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Ht=function(e,t,r,n){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var a=Number(e.replace("%",""))/100;return t*a}if(e.endsWith("vw")){var a=Number(e.replace("vw",""))/100;return r*a}if(e.endsWith("vh")){var a=Number(e.replace("vh",""))/100;return n*a}}return e},Xf=function(e,t,r,n,a,o,i){return n=Ht(n,e.width,t,r),a=Ht(a,e.height,t,r),o=Ht(o,e.width,t,r),i=Ht(i,e.height,t,r),{maxWidth:typeof n>"u"?void 0:Number(n),maxHeight:typeof a>"u"?void 0:Number(a),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof i>"u"?void 0:Number(i)}},Qf=function(e){return Array.isArray(e)?e:[e,e]},Jf=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],un="__resizable_base__",ep=(function(e){Zf(t,e);function t(r){var n,a,o,i,l=e.call(this,r)||this;return l.ratio=1,l.resizable=null,l.parentLeft=0,l.parentTop=0,l.resizableLeft=0,l.resizableRight=0,l.resizableTop=0,l.resizableBottom=0,l.targetLeft=0,l.targetTop=0,l.delta={width:0,height:0},l.appendBase=function(){if(!l.resizable||!l.window)return null;var d=l.parentNode;if(!d)return null;var u=l.window.document.createElement("div");return u.style.width="100%",u.style.height="100%",u.style.position="absolute",u.style.transform="scale(0, 0)",u.style.left="0",u.style.flex="0 0 100%",u.classList?u.classList.add(un):u.className+=un,d.appendChild(u),u},l.removeBase=function(d){var u=l.parentNode;u&&u.removeChild(d)},l.state={isResizing:!1,width:(a=(n=l.propsSize)===null||n===void 0?void 0:n.width)!==null&&a!==void 0?a:"auto",height:(i=(o=l.propsSize)===null||o===void 0?void 0:o.height)!==null&&i!==void 0?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},l.onResizeStart=l.onResizeStart.bind(l),l.onMouseMove=l.onMouseMove.bind(l),l.onMouseUp=l.onMouseUp.bind(l),l}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||qf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var r=0,n=0;if(this.resizable&&this.window){var a=this.resizable.offsetWidth,o=this.resizable.offsetHeight,i=this.resizable.style.position;i!=="relative"&&(this.resizable.style.position="relative"),r=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:a,n=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=i}return{width:r,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var r=this,n=this.props.size,a=function(l){var d;if(typeof r.state[l]>"u"||r.state[l]==="auto")return"auto";if(r.propsSize&&r.propsSize[l]&&(!((d=r.propsSize[l])===null||d===void 0)&&d.toString().endsWith("%"))){if(r.state[l].toString().endsWith("%"))return r.state[l].toString();var u=r.getParentSize(),p=Number(r.state[l].toString().replace("px","")),h=p/u[l]*100;return"".concat(h,"%")}return jr(r.state[l])},o=n&&typeof n.width<"u"&&!this.state.isResizing?jr(n.width):a("width"),i=n&&typeof n.height<"u"&&!this.state.isResizing?jr(n.height):a("height");return{width:o,height:i}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var r=this.appendBase();if(!r)return{width:0,height:0};var n=!1,a=this.parentNode.style.flexWrap;a!=="wrap"&&(n=!0,this.parentNode.style.flexWrap="wrap"),r.style.position="relative",r.style.minWidth="100%",r.style.minHeight="100%";var o={width:r.offsetWidth,height:r.offsetHeight};return n&&(this.parentNode.style.flexWrap=a),this.removeBase(r),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var r=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:r.flexBasis!=="auto"?r.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(r,n){var a=this.propsSize&&this.propsSize[n];return this.state[n]==="auto"&&this.state.original[n]===r&&(typeof a>"u"||a==="auto")?"auto":r},t.prototype.calculateNewMaxFromBoundary=function(r,n){var a=this.props.boundsByDirection,o=this.state.direction,i=a&&rt("left",o),l=a&&rt("top",o),d,u;if(this.props.bounds==="parent"){var p=this.parentNode;p&&(d=i?this.resizableRight-this.parentLeft:p.offsetWidth+(this.parentLeft-this.resizableLeft),u=l?this.resizableBottom-this.parentTop:p.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(d=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=l?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(d=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=l?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return d&&Number.isFinite(d)&&(r=r&&r<d?r:d),u&&Number.isFinite(u)&&(n=n&&n<u?n:u),{maxWidth:r,maxHeight:n}},t.prototype.calculateNewSizeFromDirection=function(r,n){var a=this.props.scale||1,o=Qf(this.props.resizeRatio||1),i=o[0],l=o[1],d=this.state,u=d.direction,p=d.original,h=this.props,x=h.lockAspectRatio,g=h.lockAspectRatioExtraHeight,y=h.lockAspectRatioExtraWidth,v=p.width,b=p.height,I=g||0,C=y||0;return rt("right",u)&&(v=p.width+(r-p.x)*i/a,x&&(b=(v-C)/this.ratio+I)),rt("left",u)&&(v=p.width-(r-p.x)*i/a,x&&(b=(v-C)/this.ratio+I)),rt("bottom",u)&&(b=p.height+(n-p.y)*l/a,x&&(v=(b-I)*this.ratio+C)),rt("top",u)&&(b=p.height-(n-p.y)*l/a,x&&(v=(b-I)*this.ratio+C)),{newWidth:v,newHeight:b}},t.prototype.calculateNewSizeFromAspectRatio=function(r,n,a,o){var i=this.props,l=i.lockAspectRatio,d=i.lockAspectRatioExtraHeight,u=i.lockAspectRatioExtraWidth,p=typeof o.width>"u"?10:o.width,h=typeof a.width>"u"||a.width<0?r:a.width,x=typeof o.height>"u"?10:o.height,g=typeof a.height>"u"||a.height<0?n:a.height,y=d||0,v=u||0;if(l){var b=(x-y)*this.ratio+v,I=(g-y)*this.ratio+v,C=(p-v)/this.ratio+y,N=(h-v)/this.ratio+y,w=Math.max(p,b),S=Math.min(h,I),L=Math.max(x,C),A=Math.min(g,N);r=zt(r,w,S),n=zt(n,L,A)}else r=zt(r,p,h),n=zt(n,x,g);return{newWidth:r,newHeight:n}},t.prototype.setBoundingClientRect=function(){var r=1/(this.props.scale||1);if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var a=n.getBoundingClientRect();this.parentLeft=a.left*r,this.parentTop=a.top*r}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left*r,this.targetTop=o.top*r}if(this.resizable){var i=this.resizable.getBoundingClientRect(),l=i.left,d=i.top,u=i.right,p=i.bottom;this.resizableLeft=l*r,this.resizableRight=u*r,this.resizableTop=d*r,this.resizableBottom=p*r}},t.prototype.onResizeStart=function(r,n){if(!(!this.resizable||!this.window)){var a=0,o=0;if(r.nativeEvent&&Yf(r.nativeEvent)?(a=r.nativeEvent.clientX,o=r.nativeEvent.clientY):r.nativeEvent&&Ft(r.nativeEvent)&&(a=r.nativeEvent.touches[0].clientX,o=r.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var i=this.props.onResizeStart(r,n,this.resizable);if(i===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var l,d=this.window.getComputedStyle(this.resizable);if(d.flexBasis!=="auto"){var u=this.parentNode;if(u){var p=this.window.getComputedStyle(u).flexDirection;this.flexDir=p.startsWith("row")?"row":"column",l=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:a,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Te(Te({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(r.target).cursor||"auto"}),direction:n,flexBasis:l};this.setState(h)}},t.prototype.onMouseMove=function(r){var n=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Ft(r))try{r.preventDefault(),r.stopPropagation()}catch{}var a=this.props,o=a.maxWidth,i=a.maxHeight,l=a.minWidth,d=a.minHeight,u=Ft(r)?r.touches[0].clientX:r.clientX,p=Ft(r)?r.touches[0].clientY:r.clientY,h=this.state,x=h.direction,g=h.original,y=h.width,v=h.height,b=this.getParentSize(),I=Xf(b,this.window.innerWidth,this.window.innerHeight,o,i,l,d);o=I.maxWidth,i=I.maxHeight,l=I.minWidth,d=I.minHeight;var C=this.calculateNewSizeFromDirection(u,p),N=C.newHeight,w=C.newWidth,S=this.calculateNewMaxFromBoundary(o,i);this.props.snap&&this.props.snap.x&&(w=dn(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(N=dn(N,this.props.snap.y,this.props.snapGap));var L=this.calculateNewSizeFromAspectRatio(w,N,{width:S.maxWidth,height:S.maxHeight},{width:l,height:d});if(w=L.newWidth,N=L.newHeight,this.props.grid){var A=cn(w,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),E=cn(N,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),D=this.props.snapGap||0,j=D===0||Math.abs(A-w)<=D?A:w,T=D===0||Math.abs(E-N)<=D?E:N;w=j,N=T}var k={width:w-g.width,height:N-g.height};if(this.delta=k,y&&typeof y=="string"){if(y.endsWith("%")){var P=w/b.width*100;w="".concat(P,"%")}else if(y.endsWith("vw")){var _=w/this.window.innerWidth*100;w="".concat(_,"vw")}else if(y.endsWith("vh")){var R=w/this.window.innerHeight*100;w="".concat(R,"vh")}}if(v&&typeof v=="string"){if(v.endsWith("%")){var P=N/b.height*100;N="".concat(P,"%")}else if(v.endsWith("vw")){var _=N/this.window.innerWidth*100;N="".concat(_,"vw")}else if(v.endsWith("vh")){var R=N/this.window.innerHeight*100;N="".concat(R,"vh")}}var M={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(N,"height")};this.flexDir==="row"?M.flexBasis=M.width:this.flexDir==="column"&&(M.flexBasis=M.height);var H=this.state.width!==M.width,V=this.state.height!==M.height,K=this.state.flexBasis!==M.flexBasis,Z=H||V||K;Z&&Wa.flushSync(function(){n.setState(M)}),this.props.onResize&&Z&&this.props.onResize(r,x,this.resizable,k)}},t.prototype.onMouseUp=function(r){var n,a,o=this.state,i=o.isResizing,l=o.direction;o.original,!(!i||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(r,l,this.resizable,this.delta),this.props.size&&this.setState({width:(n=this.props.size.width)!==null&&n!==void 0?n:"auto",height:(a=this.props.size.height)!==null&&a!==void 0?a:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Te(Te({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(r){var n,a;this.setState({width:(n=r.width)!==null&&n!==void 0?n:"auto",height:(a=r.height)!==null&&a!==void 0?a:"auto"})},t.prototype.renderResizer=function(){var r=this,n=this.props,a=n.enable,o=n.handleStyles,i=n.handleClasses,l=n.handleWrapperStyle,d=n.handleWrapperClass,u=n.handleComponent;if(!a)return null;var p=Object.keys(a).map(function(h){return a[h]!==!1?s.jsx(Uf,{direction:h,onResizeStart:r.onResizeStart,replaceStyles:o&&o[h],className:i&&i[h],children:u&&u[h]?u[h]:null},h):null});return s.jsx("div",{className:d,style:l,children:p})},t.prototype.render=function(){var r=this,n=Object.keys(this.props).reduce(function(i,l){return Jf.indexOf(l)!==-1||(i[l]=r.props[l]),i},{}),a=Te(Te(Te({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(a.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return s.jsxs(o,Te({style:a,className:this.props.className},n,{ref:function(i){i&&(r.resizable=i)},children:[this.state.isResizing&&s.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t})(m.PureComponent);const tp=({side:e,isResizing:t,width:r,minWidth:n,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:d,handlerClassName:u})=>{const p=e===It.Left,h=p?F.IconChevronLeft:F.IconChevronRight,x=g=>{let y;switch(g.key){case"ArrowLeft":y=r+(p?o:-o);break;case"ArrowRight":y=r+(p?-o:o);break;case"Home":y=n;break;case"End":y=a;break;default:return}g.preventDefault(),l(y)};return s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":i,"aria-valuenow":r,"aria-valuemin":n,"aria-valuemax":a,tabIndex:0,onKeyDown:x,className:f.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:d??s.jsx(h,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",p?"right-full":"left-full")})})},rp=16,_a=({children:e,minWidth:t,maxWidth:r,width:n,defaultWidth:a,onResizeStop:o,onResize:i,side:l=It.Right,keyboardStep:d=rp,ariaLabel:u="Resize panel",className:p,resizeHandlerClassName:h,resizeHandler:x})=>{const[g,y]=m.useState(!1),[v,b]=m.useState(a??t),I=n!==void 0,C=I?n:v,N=m.useRef(null),w=m.useCallback(()=>{y(!0)},[]),S=m.useCallback(()=>{y(!1);const E=N.current?.resizable?.getBoundingClientRect(),D=E?Math.round(E.width):t;I||b(D),o?.(D)},[o,I,t]),L=m.useCallback(E=>{const D=Math.min(r,Math.max(t,E));D!==C&&(I||(b(D),N.current?.updateSize({width:D,height:"100%"})),i?.(D),o?.(D))},[r,t,C,I,i,o]),A=m.useMemo(()=>{const E=l===It.Left,D=s.jsx(tp,{side:l,isResizing:g,width:C,minWidth:t,maxWidth:r,step:d,ariaLabel:u,onWidthChange:L,customHandler:x,handlerClassName:h});return{size:I?{width:C,height:"100%"}:void 0,defaultSize:I?void 0:{width:C,height:"100%"},minWidth:t,maxWidth:r,enable:{left:E,right:!E},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:E?D:void 0,right:E?void 0:D},onResizeStart:w,onResize:(j,T,k)=>{i?.(Math.round(k.offsetWidth))},onResizeStop:S}},[l,I,C,t,r,d,u,L,x,h,g,w,S,i]);return s.jsx(ep,{ref:N,...A,children:s.jsx("div",{className:f.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",p,c.DIAL_KIT_CLASS.resizableContainer),children:e})})},sp=16,np=1e3,ap=4,Dr=e=>e==null?!1:(e.closest("[dir]")?.getAttribute("dir")??e.ownerDocument.defaultView?.getComputedStyle(e).direction)==="rtl",op=({width:e,minWidth:t,maxWidth:r,defaultWidth:n,onWidthChange:a,label:o,tooltip:i,keyboardStep:l=sp,className:d})=>{const[u,p]=m.useState(!1),[h,x]=m.useState(!1),[g,y]=m.useState(!1),v=m.useRef(null),b=m.useRef(null),I=m.useRef({x:0,y:0}),C=m.useRef(null),N=m.useRef(void 0),w=m.useRef(void 0);m.useEffect(()=>()=>{clearTimeout(N.current),w.current!=null&&cancelAnimationFrame(w.current)},[]);const S=m.useCallback(R=>{const M=Number.isFinite(R)?R:t;return Math.round(Math.min(r,Math.max(t,M)))},[r,t]),L=R=>{b.current?.style.setProperty("transform",`translate(${R.clientX}px, ${R.clientY}px) translate(-50%, -50%)`),y(!0)},A=R=>{I.current={x:R.clientX,y:R.clientY},clearTimeout(N.current),N.current=setTimeout(()=>x(!0),np)},E=R=>{L(R),A(R)},D=()=>{y(!1),clearTimeout(N.current),x(!1)},j=R=>{R.button===0&&(R.currentTarget.setPointerCapture(R.pointerId),C.current={x:R.clientX,width:e},p(!0))},T=R=>{L(R);const M=C.current;if(M==null){Math.hypot(R.clientX-I.current.x,R.clientY-I.current.y)>ap&&(x(!1),A(R));return}const H=Dr(v.current)?-1:1,V=S(M.width+(R.clientX-M.x)*H);w.current!=null&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>a(V))},k=R=>{C.current!=null&&(C.current=null,p(!1),R.currentTarget.hasPointerCapture(R.pointerId)&&R.currentTarget.releasePointerCapture(R.pointerId))},P=R=>{const M=Dr(v.current)?-1:1;let H;switch(R.key){case"ArrowRight":H=e+l*M;break;case"ArrowLeft":H=e-l*M;break;case"Home":H=t;break;case"End":H=r;break;default:return}R.preventDefault(),a(S(H))},_=()=>{n!=null&&a(S(n))};return s.jsx("div",{ref:v,role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,tabIndex:0,className:f.mergeClasses("absolute inset-y-0 end-0 -me-1 w-2 touch-none select-none","dial-resize-handle",g&&"dial-resize-handle-cursor-ready",h&&"dial-resize-handle-hover",u&&"dial-resize-handle-dragging",d,c.DIAL_KIT_CLASS.resizeHandle),onPointerEnter:E,onPointerLeave:D,onPointerDown:j,onPointerMove:T,onPointerUp:k,onPointerCancel:k,onKeyDown:P,onDoubleClick:_,children:s.jsx(c.Tooltip,{tooltip:i,open:h&&!u,placement:Dr(v.current)?c.TooltipPlacement.Left:c.TooltipPlacement.Right,asChild:!0,children:s.jsx("span",{ref:b,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none fixed top-0 left-0 z-tooltip hidden text-secondary","dial-resize-handle-arrow"),children:s.jsx(F.IconArrowsHorizontal,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE})})})})},ip=({enabled:e=!0,children:t,...r})=>e?s.jsx(_a,{...r,children:t}):t,lp=({title:e,description:t,icon:r,action:n,className:a,titleClassName:o,descriptionClassName:i,announce:l})=>{const d=m.useId(),u=s.jsxs("section",{"aria-labelledby":d,className:f.mergeClasses("flex size-full flex-col items-center justify-center px-4 text-center",a,c.DIAL_KIT_CLASS.stateScreen),children:[r!=null&&s.jsx("span",{"aria-hidden":"true",className:"mb-4 flex size-14 items-center justify-center rounded-full border border-secondary text-secondary",children:r}),s.jsx("h1",{id:d,className:f.mergeClasses("dial-body-semi-text text-primary",o),children:e}),t!=null&&s.jsx("p",{className:f.mergeClasses("dial-small-text mt-2 text-secondary",i),children:t}),n!=null&&s.jsx("div",{className:"mt-4",children:n})]});return l==null?u:s.jsx(c.LiveRegion,{politeness:l,className:"size-full",children:u})};var at=(e=>(e.Row="row",e.Caption="caption",e.Setting="setting",e))(at||{});const cp={[at.Row]:{header:"gap-2",title:"dial-small-semi-text",description:"dial-small-text"},[at.Caption]:{header:"gap-4",title:"dial-caption-lead-semi-text",description:"dial-tiny-text"},[at.Setting]:{header:"gap-4",title:"dial-tiny-semi-text",description:"dial-tiny-text"}},dp=({title:e,action:t,description:r,variant:n=at.Row,headingLevel:a=3,children:o,className:i,titleClassName:l,descriptionClassName:d,contentClassName:u})=>{const p=m.useId(),h=cp[n],x=`h${a}`;return s.jsxs("section",{"aria-labelledby":p,className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.formSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center justify-between",h.header),children:[s.jsx(x,{id:p,className:f.mergeClasses("min-w-0 text-primary",h.title,l),children:e}),t!=null&&s.jsx("div",{className:"shrink-0",children:t})]}),r!=null&&s.jsx("p",{className:f.mergeClasses("text-secondary",h.description,d),children:r}),o!=null&&s.jsx("div",{className:f.mergeClasses("relative",u),children:o})]})};var je=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(je||{});const ka=8e3,Dt="flex size-7 shrink-0 items-center justify-center",Ra={cancelItemAriaLabel:e=>`Cancel "${e}"`,itemProgressAriaLabel:e=>`"${e}" in progress`,successLabel:"Completed",canceledLabel:"Canceled",failedMessage:"Failed",warningMessage:"Completed with warnings",queueProgressAriaLabel:"Progress",queueProgressValueText:(e,t)=>`${e} of ${t}`,collapseAriaLabel:"Collapse",expandAriaLabel:"Expand",closeAriaLabel:"Close",closeConfirmHeader:"Close?",closeConfirmDescriptionInProgress:"Some items are still in progress.",closeConfirmDescriptionFailed:"Some items have failed.",closeConfirmDescriptionMixed:"Some items are still in progress, and some have failed.",closeConfirmLabel:"Close",closeCancelLabel:"Cancel"},up=({title:e,isCollapsed:t,itemsId:r,labels:n,onToggleCollapse:a,onClose:o})=>{const i=t?F.IconChevronUp:F.IconChevronDown;return s.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[s.jsx("span",{className:"dial-small-paragraph-semi-text min-w-0 truncate text-primary",children:e}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(c.GhostIconButton,{"aria-label":t?n.expandAriaLabel:n.collapseAriaLabel,"aria-expanded":!t,"aria-controls":r,size:c.ElementSize.Small,icon:s.jsx(i,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:a,className:Dt}),s.jsx(c.GhostIconButton,{"aria-label":n.closeAriaLabel,size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:Dt})]})]})},fn=({message:e,isError:t})=>{const r=t?F.IconAlertCircleFilled:F.IconAlertTriangleFilled;return s.jsx(c.Tooltip,{tooltip:e,asChild:!0,children:s.jsx("span",{className:Dt,role:"img","aria-label":e,tabIndex:0,children:s.jsx(r,{size:f.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},Mr=2,Pr=(f.DIAL_ICON_SIZE.SM-Mr)/2,pn=2*Math.PI*Pr,fp=({percent:e,label:t,className:r})=>{const n=Math.min(100,Math.max(0,Math.round(e))),a=f.DIAL_ICON_SIZE.SM/2;return s.jsx("span",{role:"progressbar","aria-label":t,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,className:f.mergeClasses("flex",r),children:s.jsxs("svg",{width:f.DIAL_ICON_SIZE.SM,height:f.DIAL_ICON_SIZE.SM,viewBox:`0 0 ${f.DIAL_ICON_SIZE.SM} ${f.DIAL_ICON_SIZE.SM}`,className:"-rotate-90","aria-hidden":!0,children:[s.jsx("circle",{cx:a,cy:a,r:Pr,fill:"none",strokeWidth:Mr,className:"stroke-(--stroke-secondary,#d1dbea)"}),s.jsx("circle",{cx:a,cy:a,r:Pr,fill:"none",strokeWidth:Mr,strokeLinecap:"round",strokeDasharray:pn,strokeDashoffset:pn*(1-n/100),className:"stroke-(--stroke-accent,#1d4ed8) transition-[stroke-dashoffset] duration-200 motion-reduce:transition-none"})]})})},pp=({item:e,labels:t,onCancel:r})=>{const n=e.status===je.Canceled,a=f.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0");return s.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[s.jsx(ms,{type:Ae.File,name:e.name,size:f.DIAL_ICON_SIZE.MD,className:f.mergeClasses(n&&"opacity-50"),decorative:!0}),s.jsx(c.EllipsisTooltip,{text:e.name,className:f.mergeClasses("dial-small-text",n?"text-secondary":"text-primary")}),e.status===je.InProgress&&s.jsxs("div",{className:f.mergeClasses(Dt,"grid"),children:[typeof e.percent=="number"?s.jsx(fp,{percent:e.percent,label:t.itemProgressAriaLabel(e.name),className:a}):s.jsx(Ve,{size:f.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:a}),r&&s.jsx(c.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===je.Success&&s.jsx("span",{className:Dt,role:"img","aria-label":t.successLabel,children:s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===je.Warning&&s.jsx(fn,{message:e.message||t.warningMessage,isError:!1}),e.status===je.Failed&&s.jsx(fn,{message:e.message||t.failedMessage,isError:!0}),n&&s.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},hp=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===je.InProgress?0:100)),0)/e.length),mp=(e,t)=>e?t.closeConfirmDescriptionMixed:t.closeConfirmDescriptionInProgress,gp=({title:e,items:t,onClose:r,onCancelItem:n,labels:a,autoCloseDelay:o=ka,className:i,bodyClassName:l})=>{const[d,u]=m.useState(!1),[p,h]=m.useState(!1),x=m.useId(),g={...Ra,...a},y=t.filter(S=>S.status===je.InProgress).length,v=y>0,b=t.some(S=>S.status===je.Failed),I=t.length>0&&t.every(S=>S.status===je.Success),C=m.useCallback(()=>{v?h(!0):r()},[v,r]),N=m.useCallback(()=>{h(!1),r()},[r]),w=m.useCallback(()=>{u(S=>!S)},[]);return m.useEffect(()=>{if(!I||o<=0)return;const S=setTimeout(r,o);return()=>clearTimeout(S)},[I,o,r]),t.length===0?null:s.jsxs("div",{role:"status","aria-live":"polite",className:f.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,c.DIAL_KIT_CLASS.transferQueue),children:[s.jsx(up,{title:e,isCollapsed:d,itemsId:x,labels:g,onToggleCollapse:w,onClose:C}),d&&v&&s.jsx(bn,{value:hp(t),size:c.ElementSize.Small,"aria-label":g.queueProgressAriaLabel,"aria-valuetext":g.queueProgressValueText(t.length-y,t.length)}),!d&&s.jsx("div",{id:x,className:f.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(S=>s.jsx(pp,{item:S,labels:g,onCancel:n},S.id))}),s.jsx(wa,{open:p,header:g.closeConfirmHeader,description:mp(b,g),confirmLabel:g.closeConfirmLabel,cancelLabel:g.closeCancelLabel,variant:it.Danger,onConfirm:N,onClose:()=>h(!1)})]})};exports.BASE_ICON_PROPS=f.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=f.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=f.DIAL_ICON_SIZE;exports.DIAL_KIT_ICON_STROKE=f.DIAL_KIT_ICON_STROKE;exports.mergeClasses=f.mergeClasses;exports.ButtonAppearance=c.ButtonAppearance;exports.ButtonVariant=c.ButtonVariant;exports.CaptionText=c.CaptionText;exports.Checkbox=c.Checkbox;exports.CheckboxBox=c.CheckboxBox;exports.CloseButton=c.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=c.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=c.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=c.DIAL_KIT_CLASS;exports.DangerIconButton=c.DangerIconButton;exports.DateCellRenderer=c.DateCellRenderer;exports.DialIcon=c.DialIcon;exports.Dropdown=c.Dropdown;exports.DropdownItemType=c.DropdownItemType;exports.DropdownOverlayRole=c.DropdownOverlayRole;exports.DropdownTrigger=c.DropdownTrigger;exports.DropdownType=c.DropdownType;exports.ElementSize=c.ElementSize;exports.EllipsisTooltip=c.EllipsisTooltip;exports.ErrorText=c.ErrorText;exports.GRID_ALIGN_RIGHT_CLASS=c.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=c.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=c.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=c.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=c.GRID_THEME_PARAMS;exports.GhostIconButton=c.GhostIconButton;exports.Grid=c.Grid;exports.GridAppearance=c.GridAppearance;exports.GridColorScheme=c.GridColorScheme;exports.GridSelectionMode=c.GridSelectionMode;exports.Highlight=c.Highlight;exports.IconButton=c.IconButton;exports.InfoButton=c.InfoButton;exports.Input=c.Input;exports.InteractiveTooltip=c.InteractiveTooltip;exports.InteractiveTooltipTrigger=c.InteractiveTooltipTrigger;exports.Label=c.Label;exports.LiveRegion=c.LiveRegion;exports.LiveRegionElement=c.LiveRegionElement;exports.LiveRegionPoliteness=c.LiveRegionPoliteness;exports.MenuItem=c.MenuItem;exports.MenuItemMark=c.MenuItemMark;exports.NeutralIconButton=c.NeutralIconButton;exports.NoDataContent=c.NoDataContent;exports.PrimaryIconButton=c.PrimaryIconButton;exports.Radio=c.Radio;exports.Search=c.Search;exports.StaticIconButton=c.StaticIconButton;exports.ThemeScope=c.ThemeScope;exports.Tooltip=c.Tooltip;exports.TooltipContainer=c.TooltipContainer;exports.TooltipContent=c.TooltipContent;exports.TooltipPlacement=c.TooltipPlacement;exports.TooltipTrigger=c.TooltipTrigger;exports.baseColumnComparator=c.baseColumnComparator;exports.checkColDefsChanges=c.checkColDefsChanges;exports.convertToDate=c.convertToDate;exports.useThemeScope=c.useThemeScope;exports.EditorThemes=hn.EditorThemes;exports.LazyMarkdownEditor=hn.LazyMarkdownEditor;exports.AVATAR_PALETTE=Ta;exports.Accordion=Ia;exports.AccordionCaretPosition=Qt;exports.AnalyticsBar=Vt;exports.AnalyticsBarGroup=fu;exports.AnalyticsCard=cu;exports.AnalyticsCardVariant=jt;exports.AnalyticsHistogram=xu;exports.AutocompleteTagInput=Bf;exports.Avatar=La;exports.AvatarColor=Pe;exports.AvatarShape=lt;exports.Badge=fs;exports.BadgeColor=we;exports.BadgeVariant=_e;exports.BottomSheet=Cf;exports.Breadcrumbs=Yd;exports.BreadcrumbsSize=Ze;exports.Button=Xe;exports.ButtonDropdown=Jd;exports.Calendar=Rd;exports.CalendarMode=xe;exports.CardShell=ed;exports.CollapsibleSidebar=Wf;exports.ConditionalResizableContainer=ip;exports.ConfirmationPopup=wa;exports.ConfirmationPopupVariant=it;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=ps;exports.DEFAULT_TRANSFER_QUEUE_LABELS=Ra;exports.DangerButton=Dc;exports.DialAccordion=Qa;exports.DialBreadcrumb=Do;exports.DialBreadcrumbItem=xt;exports.DialButton=Et;exports.DialCaptionText=Br;exports.DialCloseButton=In;exports.DialDangerButton=En;exports.DialDangerIconButton=yn;exports.DialDropdown=Gt;exports.DialEllipsisTooltip=er;exports.DialErrorText=Fe;exports.DialFileNodeType=ze;exports.DialFilePermission=Yn;exports.DialFileResourceType=es;exports.DialGhostButton=Eo;exports.DialGhostIconButton=Cn;exports.DialIconButton=Tt;exports.DialInput=An;exports.DialItemType=Ae;exports.DialLabel=$r;exports.DialLabelledText=ao;exports.DialLinkButton=To;exports.DialLoadFileArea=Zn;exports.DialLoadFileAreaField=Vl;exports.DialLoader=ro;exports.DialNeutralButton=Tn;exports.DialNeutralIconButton=go;exports.DialNoDataContent=no;exports.DialPrimaryButton=Wr;exports.DialPrimaryIconButton=mo;exports.DialRemoveButton=Ln;exports.DialSecondaryIconButton=xo;exports.DialSuccessIconButton=vo;exports.DialTabs=No;exports.DialTag=io;exports.DialTertiaryIconButton=bo;exports.DialTooltip=qe;exports.DialTooltipContainer=zr;exports.DialTooltipContent=Fr;exports.DialTooltipTrigger=Hr;exports.EDITABLE_CONTAINER_ATTRIBUTE=Jr;exports.EntityIdentity=Aa;exports.EntityType=pe;exports.ErrorMessageNotification=id;exports.ErrorToastNotification=td;exports.FabButton=Xd;exports.FileDropzone=cf;exports.FileIcon=ms;exports.FileName=Da;exports.FilterChips=lf;exports.FlexibleActionsDirection=qn;exports.FolderName=yf;exports.FolderPath=Pd;exports.FormSection=dp;exports.FormSectionVariant=at;exports.GeneralMessageNotification=fd;exports.GeneralToastNotification=od;exports.GhostButton=is;exports.InfoMessageNotification=ld;exports.InfoToastNotification=rd;exports.InlineSelect=eu;exports.InlineSelectTrigger=Ca;exports.JsonSchemaType=$;exports.LabelledText=bu;exports.LinkButton=Lc;exports.LoadingMessageNotification=ud;exports.LoadingToastNotification=ad;exports.MultiSelectTags=yt;exports.NOT_ALLOWED_SPACES=ts;exports.NOT_ALLOWED_SPACES_REGEXP=tc;exports.NOT_ALLOWED_SYMBOLS=Qn;exports.NOT_ALLOWED_SYMBOLS_REGEXP=ec;exports.NeutralButton=os;exports.Notification=us;exports.NotificationSurface=qt;exports.NotificationType=fe;exports.NotificationVariant=Q;exports.NumberInput=ds;exports.OutlinedButton=Ac;exports.PasswordInput=da;exports.Popup=hs;exports.PopupSize=We;exports.PrimaryButton=la;exports.ProgressBar=bn;exports.ProgressBarRole=Ct;exports.RadioGroup=wt;exports.RadioGroupOrientation=Oe;exports.RadioGroupPopupField=Hu;exports.ResizableContainer=_a;exports.ResizableContainerSide=It;exports.ResizeHandle=op;exports.SchemaDisplayMode=lr;exports.SchemaOrientation=cr;exports.SchemaRenderer=Uc;exports.SchemaRendererVariant=nt;exports.ScreenResolution=Ut;exports.SegmentedControl=tf;exports.Select=$e;exports.SelectedEntityCard=Ef;exports.SharedEntityIndicator=ja;exports.SideDrawer=Lf;exports.Skeleton=$t;exports.SkeletonAvatarShape=Wt;exports.SkeletonAvatarSize=bt;exports.SkeletonVariant=Ee;exports.Slider=Kf;exports.Spinner=Ve;exports.StarterButton=Ec;exports.StateScreen=lp;exports.StepStatus=be;exports.Steps=nu;exports.SuccessMessageNotification=cd;exports.SuccessToastNotification=sd;exports.Switch=ua;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=ka;exports.TabOrientation=Ge;exports.TabStatus=ot;exports.TabView=Ue;exports.Tabs=nf;exports.Tag=Le;exports.TagAppearance=Se;exports.TagInput=Rf;exports.Textarea=ca;exports.TextareaResize=ls;exports.ToggleChip=Wu;exports.ToggleIconButton=$u;exports.TransferQueue=gp;exports.TransferQueueItemStatus=je;exports.WarningMessageNotification=dd;exports.WarningToastNotification=nd;exports.editableContainerProps=Wl;exports.extractInitials=Ea;exports.getTimezoneLabel=Xn;exports.matchesAccept=Rr;exports.useEditableItem=Gl;exports.wrapInRootFolder=Ql;
|