@ngrr/ds 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ds-nagarro.umd.js
CHANGED
|
@@ -277,7 +277,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
277
277
|
*
|
|
278
278
|
* This source code is licensed under the ISC license.
|
|
279
279
|
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const gr=je("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function VC({size:e="md",variant:t="secondary",children:n,leadingIcon:r,disabled:i=!1,loading:a=!1,triggerIcon:s,onMainClick:o,onDropdownClick:l,dropdownAriaLabel:u="More options",className:c}){const d=s??h.jsx(Fr,{size:16,strokeWidth:1.5,"aria-hidden":"true"});return h.jsxs("div",{className:`dsn-split-button${c?` ${c}`:""}`,"data-size":e,role:"group",children:[h.jsx(be,{variant:t,size:e,showLeadingIcon:r!=null,leadingIcon:r,disabled:i,loading:a,onClick:o,children:n}),h.jsx(be,{variant:t,size:e,showLabel:!1,showLeadingIcon:!0,leadingIcon:d,disabled:i||a,"aria-label":u,"aria-haspopup":"true",onClick:l})]})}function Wi({size:e="md",variant:t="profile",fill:n="initials",src:r,initials:i,icon:a,name:s,alt:o,className:l,style:u}){const c=["dsn-avatar",l].filter(Boolean).join(" "),d=s??void 0,f=s?void 0:!0,g=i?i.trim().slice(0,2).toUpperCase():void 0;return h.jsxs("div",{className:c,"data-size":e,"data-variant":t,"data-fill":n,role:"img","aria-label":d,"aria-hidden":f,style:u,children:[n==="picture"&&r&&h.jsx("img",{className:"dsn-avatar-image",src:r,alt:o??s??""}),n==="initials"&&g,n==="icon"&&h.jsx("span",{className:"dsn-avatar-icon","aria-hidden":"true",children:(()=>{const p=a??(t==="organization"?xC:qC);return h.jsx(p,{"aria-hidden":"true"})})()})]})}function KC({size:e="sm",avatars:t,maxVisible:n=5,className:r,"aria-label":i}){const a=t.slice(0,n),s=t.length-a.length,o=i??(()=>{const u=t.map(d=>d.name);return u.length<=n?u.join(", "):`${u.slice(0,n).join(", ")}, and ${s} ${s===1?"other":"others"}`})(),l=["dsn-avatar-group",r].filter(Boolean).join(" ");return h.jsxs("div",{className:l,"data-size":e,role:"group","aria-label":o,children:[a.map((u,c)=>h.jsx(Wi,{size:e,variant:u.variant??"profile",fill:u.fill??(u.src?"picture":u.initials?"initials":"icon"),src:u.src,initials:u.initials,name:u.name,style:{zIndex:c+1}},c)),s>0&&h.jsxs("span",{className:"dsn-avatar-group-overflow","aria-hidden":"true",style:{zIndex:a.length+1},children:["+",s]})]})}function Gs({size:e="sm",variant:t="highlight-soft",count:n,className:r,"aria-label":i}){const a=e==="dot",s=a?void 0:n!==void 0?n>99?"99+":String(n):void 0,o=["dsn-badge",r].filter(Boolean).join(" ");return h.jsx("span",{className:o,"data-size":e,"data-variant":t,"aria-label":i,"aria-hidden":a&&!i?!0:void 0,children:s})}function YC({title:e,value:t,variant:n="default",className:r,"aria-label":i}){const a=["dsn-stat",r].filter(Boolean).join(" ");return h.jsxs("div",{className:a,"data-variant":n,"aria-label":i,children:[h.jsx("p",{className:"dsn-stat-title",children:e}),h.jsx("p",{className:"dsn-stat-value",children:t})]})}function zr({label:e,variant:t="neutral",size:n="md",icon:r,showIcon:i=!0,className:a,"aria-label":s}){const o=["dsn-tag",a].filter(Boolean).join(" ");return h.jsxs("span",{className:o,"data-variant":t,"data-size":n,role:"status","aria-label":s,children:[i&&h.jsx("span",{className:"dsn-tag-icon","aria-hidden":"true","data-icon":r?"custom":void 0,children:r&&(()=>{const l=r;return h.jsx(l,{size:12,"aria-hidden":"true"})})()}),h.jsx("span",{className:"dsn-tag-label",children:e})]})}function Xs({label:e,selected:t=!1,disabled:n=!1,size:r="md",leadingIcon:i,trailingIcon:a,showLeadingIcon:s=!0,showTrailingIcon:o=!0,onDismiss:l,onClick:u,className:c,"aria-label":d}){const f=["dsn-chip",c].filter(Boolean).join(" ");function g(p){(p.key===" "||p.key==="Enter")&&!n&&(p.preventDefault(),u==null||u())}return h.jsxs("div",{role:"checkbox","aria-checked":t,"aria-disabled":n?!0:void 0,tabIndex:n?-1:0,className:f,"data-size":r,"data-selected":t,onClick:n?void 0:u,onKeyDown:g,"aria-label":d,children:[s&&h.jsx("span",{className:"dsn-chip-leading","aria-hidden":"true","data-icon":i?"custom":void 0,children:i&&(()=>{const p=i;return h.jsx(p,{size:12,"aria-hidden":"true"})})()}),h.jsx("span",{className:"dsn-chip-label",children:e}),l?h.jsx("button",{type:"button",className:"dsn-chip-dismiss","aria-label":`Remove ${e}`,tabIndex:n?-1:0,onClick:p=>{p.stopPropagation(),n||l()},children:h.jsx(gr,{size:12,"aria-hidden":"true"})}):o?h.jsx("span",{className:"dsn-chip-trailing","aria-hidden":"true","data-icon":a?"custom":void 0,children:a&&(()=>{const p=a;return h.jsx(p,{size:12,"aria-hidden":"true"})})()}):null]})}function Jl({label:e,children:t,className:n}){const r=["dsn-chip-group",n].filter(Boolean).join(" ");return h.jsx("div",{role:"group","aria-label":e,className:r,children:t})}const GC="https://images.unsplash.com/photo-1541701494587-cb58502866ab?auto=format&fit=crop&w=512&q=80";function XC(e){switch(e){case"xxSmall":return 12;case"xSmall":case"small":case"medium":return 16;case"large":case"xLarge":return 24;case"xxLarge":return 48;default:return 16}}function Zd({variant:e="file",size:t="xxSmall",imageSrc:n,imageAlt:r="Image thumbnail",icon:i,className:a,"aria-label":s}){const o=["dsn-file-thumbnail",a].filter(Boolean).join(" "),l=XC(t),u=n??GC;return h.jsxs("span",{className:o,"data-variant":e,"data-size":t,role:"img","aria-label":s??(e==="image"?r:"File thumbnail"),children:[e==="image"?h.jsx("img",{src:u,alt:"",className:"dsn-file-thumbnail-image","aria-hidden":"true"}):null,e==="file"?h.jsx("span",{className:"dsn-file-thumbnail-icon","aria-hidden":"true",children:i??h.jsx(Fy,{size:l,strokeWidth:1.75,"aria-hidden":"true"})}):null]})}function Da({checked:e,onChange:t,disabled:n=!1,size:r="md",id:i,className:a,"aria-label":s,"aria-labelledby":o}){const l=["dsn-switcher",a].filter(Boolean).join(" ");function u(){t==null||t(!e)}return h.jsx("button",{type:"button",role:"switch",id:i,"aria-checked":e,"aria-disabled":n?!0:void 0,disabled:n,"aria-label":s,"aria-labelledby":o,className:l,"data-size":r,"data-checked":e,onClick:u,children:h.jsx("span",{className:"dsn-switcher-track","aria-hidden":"true",children:h.jsx("span",{className:"dsn-switcher-thumb"})})})}function mr({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M8 2 L14 8 L8 14 L2 8 Z",fill:"none",stroke:"currentColor",strokeOpacity:.85,strokeWidth:"1.5",strokeLinejoin:"round"})})}function JC(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ui=_.forwardRef(function({variant:t="default",destructive:n=!1,disabled:r=!1,selected:i=!1,fullWidth:a=!1,label:s="Label",description:o="Description",descriptionRight:l="Description",showLabel:u=!0,showDescription:c=!1,showDescriptionRight:d=!1,showLeadingIcon:f=!0,leadingIcon:g,showTrailingIcon:p=!0,trailingIcon:m,showAvatar:v=!1,avatarProps:x,shortcut:y=!1,shortcutLabel:b="⌘ ↵",shortcutAriaLabel:k="Command Enter",showBadge:w=!1,badgeCount:S=1,badgeSize:N="sm",badgeVariant:E="critical",showTag:T=!1,tagLabel:C="Label",tagVariant:O="highlight",showButtons:$=!1,actionAriaLabel:j="Open actions",onActionClick:M,switcherChecked:A,onSwitcherChange:z,onClick:B,onKeyDown:R,tabIndex:H,className:F,"aria-label":L},U){const K=["dsn-menu-cell",a&&"dsn-menu-cell--full-width",F].filter(Boolean).join(" "),Y=t==="switcher",G=A??i,ne=!($||Y),se=D=>{R==null||R(D),D.target===D.currentTarget&&(r||!B||(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),B(D)))},W={className:K,"data-variant":t,"data-destructive":n||void 0,"data-selected":i||void 0,"data-disabled":r||void 0,role:"menuitem","aria-label":L,"aria-disabled":r||void 0},X=h.jsxs(h.Fragment,{children:[v&&h.jsx("span",{className:"dsn-menu-cell-avatar-wrap",children:h.jsx(Wi,{size:"xs",variant:"profile",fill:"initials",initials:"AC",name:"Avatar",...x})}),!v&&f&&h.jsx("span",{className:"dsn-menu-cell-icon-wrap","aria-hidden":"true",children:g??h.jsx(mr,{})}),u&&h.jsxs("span",{className:"dsn-menu-cell-label-wrap",children:[h.jsx("span",{className:"dsn-menu-cell-label",children:s}),c&&h.jsx("span",{className:"dsn-menu-cell-description",children:o})]}),d&&h.jsx("span",{className:"dsn-menu-cell-description-right",children:l}),w&&h.jsx("span",{className:"dsn-menu-cell-badge-wrap",children:h.jsx(Gs,{size:N,variant:E,count:S})}),T&&h.jsx("span",{className:"dsn-menu-cell-tag-wrap",children:h.jsx(zr,{size:"sm",variant:O,label:C})}),p&&h.jsx("span",{className:"dsn-menu-cell-icon-wrap","aria-hidden":"true",children:i&&!Y?h.jsx(JC,{}):m??h.jsx(mr,{})}),y&&h.jsx("span",{className:"dsn-menu-cell-shortcut-wrap",children:h.jsx(Yd,{label:b,"aria-label":k})}),$&&h.jsx("span",{className:"dsn-menu-cell-action-wrap",onClick:D=>D.stopPropagation(),onKeyDown:D=>D.stopPropagation(),children:h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(mr,{}),"aria-label":j,onClick:D=>{D.stopPropagation(),M==null||M(D)}})}),Y&&h.jsx("span",{className:"dsn-menu-cell-switcher-wrap",onClick:D=>D.stopPropagation(),onKeyDown:D=>D.stopPropagation(),children:h.jsx(Da,{size:"sm",checked:G,disabled:r,"aria-label":"Toggle option",onChange:z})})]});return ne?h.jsx("button",{type:"button",...W,ref:U,disabled:r,onClick:B,onKeyDown:R,tabIndex:H,children:X}):h.jsx("div",{...W,ref:U,tabIndex:H??(r?-1:0),onClick:r?void 0:B,onKeyDown:se,children:X})});function By(e,t){if(typeof window>"u"||typeof document>"u")return t;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e).trim(),r=Number.parseFloat(n);return Number.isFinite(r)?r:t}function Rr({header:e,segment:t,search:n,content:r,bottomBar:i,role:a="menu",width:s,contentPadding:o="none",className:l,contentClassName:u,anchorRef:c,offset:d,viewportMargin:f,matchAnchorWidth:g=!1,minWidth:p,"aria-label":m="Popover"}){const v=_.useRef(null),[x,y]=_.useState(null),b=d??By("--space-tiny",4),k=f??By("--space-medium",16),w=p??192,S=_.useCallback(()=>{if(!(c!=null&&c.current)||!v.current)return;const C=c.current.getBoundingClientRect(),O=v.current.getBoundingClientRect(),$=O.height,j=Math.max(g?C.width:O.width,w),M=j,A=window.innerHeight-C.bottom-k,z=C.top-k,B=$+b>A&&z>=$+b,R=B?C.top-$-b:C.bottom+b,H=Math.max(k,window.innerHeight-$-k),F=Math.min(Math.max(R,k),H),L=C.left,U=Math.max(k,window.innerWidth-M-k),K=Math.min(Math.max(L,k),U);y({top:F,left:K,width:g?j:void 0,placement:B?"top":"bottom"})},[c,g,w,b,k]);_.useEffect(()=>{if(!(c!=null&&c.current))return;S();const C=()=>S(),O=()=>S();return window.addEventListener("resize",C),window.addEventListener("scroll",O,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",O,!0)}},[c,S]),_.useEffect(()=>{if(!(c!=null&&c.current)||!v.current||typeof ResizeObserver>"u")return;const C=new ResizeObserver(()=>S());return C.observe(c.current),C.observe(v.current),()=>C.disconnect()},[c,S]);const N=["dsn-popover-wrapper",l].filter(Boolean).join(" "),E=["dsn-popover-wrapper-content-slot",u].filter(Boolean).join(" "),T=_.useMemo(()=>{const C={};return s!==void 0&&(C.width=s),C.minWidth=w,c!=null&&c.current&&x&&(C.position="fixed",C.top=x.top,C.left=x.left,x.width!==void 0&&s===void 0&&(C.width=x.width),C.zIndex=1e3),Object.keys(C).length>0?C:void 0},[c,x,w,s]);return h.jsxs("div",{ref:v,className:N,role:a,"aria-label":m,"data-content-padding":o,"data-placement":x==null?void 0:x.placement,style:T,children:[e&&h.jsx("div",{className:"dsn-popover-wrapper-header",children:e}),t&&h.jsx("div",{className:"dsn-popover-wrapper-segment",children:t}),n&&h.jsx("div",{className:"dsn-popover-wrapper-search",children:n}),h.jsx("div",{className:"dsn-popover-wrapper-content",children:h.jsx("div",{className:E,children:r})}),i&&h.jsx("div",{className:"dsn-popover-wrapper-bottom-bar",children:i})]})}const ZC=[{id:"download",label:"Download",icon:h.jsx(Iy,{size:16,"aria-hidden":"true"})},{id:"rename",label:"Rename",icon:h.jsx(OC,{size:16,"aria-hidden":"true"})},{id:"details",label:"Details",icon:h.jsx(Jd,{size:16,"aria-hidden":"true"})}];function Qd({fileName:e,fileSize:t,previewVariant:n="file",previewSrc:r,size:i="md",disabled:a=!1,loading:s=!1,action:o="none",menuOptions:l=ZC,onMenuSelect:u,onRemove:c,className:d,"aria-label":f}){const p=`dsn-attachment-chip-menu-${_.useId()}`,m=_.useRef(null),v=_.useRef(null),[x,y]=_.useState(!1),b=o==="more"&&!a&&!s;return _.useEffect(()=>{if(!x)return;const k=S=>{var N;(N=m.current)!=null&&N.contains(S.target)||y(!1)},w=S=>{var N;S.key==="Escape"&&(y(!1),(N=v.current)==null||N.focus())};return document.addEventListener("mousedown",k),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",w)}},[x]),h.jsxs("div",{ref:m,className:["dsn-attachment-chip",d].filter(Boolean).join(" "),"data-size":i,"data-disabled":a||void 0,"data-loading":s||void 0,role:"group","aria-label":f??e,children:[h.jsxs("div",{className:"dsn-attachment-chip-content",children:[h.jsx("span",{className:"dsn-attachment-chip-preview","aria-hidden":"true",children:s?h.jsx(jC,{size:16,className:"dsn-attachment-chip-spinner"}):h.jsx(Zd,{variant:n,imageSrc:r,size:"xSmall","aria-label":`${n} preview`})}),h.jsxs("span",{className:"dsn-attachment-chip-label-wrap",children:[h.jsx("span",{className:"dsn-attachment-chip-label",children:e}),h.jsx("span",{className:"dsn-attachment-chip-meta",children:t})]})]}),o==="remove"&&h.jsx("button",{type:"button",disabled:a||s,"aria-label":`Remove ${e}`,className:"dsn-attachment-chip-action",onClick:c,children:h.jsx(gr,{size:16,"aria-hidden":"true"})}),o==="more"&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",disabled:a||s,"aria-label":`More options for ${e}`,"aria-haspopup":"menu","aria-controls":x?p:void 0,className:"dsn-attachment-chip-action",onClick:()=>{b&&y(k=>!k)},ref:v,children:h.jsx(Xd,{size:16,"aria-hidden":"true"})}),x&&b&&h.jsx(Rr,{role:"menu","aria-label":"Attachment options",contentPadding:"small",className:"dsn-attachment-chip-popover",contentClassName:"dsn-attachment-chip-menu",anchorRef:v,matchAnchorWidth:!0,content:h.jsx("div",{id:p,children:l.map(k=>h.jsx(Ui,{className:"dsn-attachment-chip-menu-item",label:k.label,showLeadingIcon:!!k.icon,leadingIcon:k.icon,showTrailingIcon:!1,disabled:k.disabled,onClick:()=>{var w;k.disabled||(u==null||u(k.id),y(!1),(w=v.current)==null||w.focus())}},k.id))})})]})]})}function QC(e){return e>=1024*1024*1024?`${Math.round(e/(1024*1024*1024)*10)/10} GB`:e>=1024*1024?`${Math.round(e/(1024*1024)*10)/10} MB`:e>=1024?`${Math.round(e/1024*10)/10} KB`:`${e} B`}function ej({id:e,label:t="Label",showLabel:n=!0,helperText:r="Help text",showHelpText:i=!0,error:a=!1,errorMessage:s="File extends size limit",disabled:o=!1,loading:l=!1,accept:u,uploadButtonLabel:c="Upload file",value:d,defaultValue:f=null,onChange:g,className:p,"aria-label":m}){const v=_.useId(),x=e??`dsn-attachment-field-${v}`,y=`${x}-helper`,b=_.useRef(null),k=d!==void 0,[w,S]=_.useState(f),N=k?d??null:w,[E,T]=_.useState(void 0);_.useEffect(()=>{if(!N||!N.type.startsWith("image/")){T(void 0);return}const j=URL.createObjectURL(N);return T(j),()=>URL.revokeObjectURL(j)},[N]);const C=a?s:r,O=_.useMemo(()=>N?QC(N.size):"",[N]);function $(j){k||S(j),g==null||g(j)}return h.jsxs("div",{className:["dsn-attachment-field",p].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-error":a||void 0,children:[n&&h.jsx("p",{className:"dsn-attachment-field-label",children:t}),h.jsxs("div",{className:"dsn-attachment-field-control",children:[N?h.jsx(Qd,{fileName:N.name,fileSize:O,previewVariant:N.type.startsWith("image/")?"image":"file",previewSrc:E,loading:l,disabled:o,action:"remove",onRemove:o||l?void 0:()=>{$(null),b.current&&(b.current.value="")},"aria-label":N.name}):h.jsx(be,{variant:"secondary",size:"md",disabled:o,showLeadingIcon:!0,leadingIcon:h.jsx(HC,{size:16,"aria-hidden":"true"}),onClick:()=>{var j;return(j=b.current)==null?void 0:j.click()},"aria-label":m??c,children:c}),h.jsx("input",{ref:b,id:x,className:"dsn-attachment-field-native",type:"file",disabled:o,accept:u,"aria-label":m??c,"aria-describedby":i&&C?y:void 0,onChange:j=>{var A;const M=((A=j.target.files)==null?void 0:A[0])??null;$(M)}})]}),i&&C&&h.jsx("p",{id:y,className:"dsn-attachment-field-helper",children:C})]})}const ef=15,Wy=2*Math.PI*ef,tj="70.7 23.6";function Uy({value:e,size:t="lg",label:n,className:r}){const i=e!==void 0,a=i?Math.min(100,Math.max(0,e)):void 0,s=i?Wy*(1-a/100):void 0,o=["dsn-progress-ring",r].filter(Boolean).join(" "),l=i?"progressbar":"status";return h.jsx("div",{role:l,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,"aria-label":n,"aria-live":"polite",className:o,"data-size":t,"data-mode":i?"determinate":"indeterminate",children:h.jsxs("svg",{viewBox:"0 0 36 36","aria-hidden":"true",focusable:"false",children:[i&&h.jsx("circle",{className:"dsn-progress-ring-track",cx:"18",cy:"18",r:ef,fill:"none",strokeWidth:"3"}),h.jsx("circle",{className:"dsn-progress-ring-fill",cx:"18",cy:"18",r:ef,fill:"none",strokeWidth:"3",strokeLinecap:"round",transform:"rotate(-90 18 18)",strokeDasharray:i?Wy:tj,strokeDashoffset:s})]})})}function nj({variant:e="file",descriptionPosition:t="outside",loading:n=!1,title:r="Title",metaData:i="Meta data",hasMetadata:a=!0,showDescription:s=!0,imageSrc:o,imageAlt:l="Attachment preview",action:u="remove",showActionOnHover:c=!1,onActionClick:d,className:f,"aria-label":g}){const p=["dsn-attachment-card",f].filter(Boolean).join(" "),m=u!=="none",v=u==="more"?`More options for ${r}`:`Remove ${r}`;return h.jsxs("article",{className:p,"data-variant":e,"data-description-position":t,"data-loading":n||void 0,"data-show-action-on-hover":c||void 0,"aria-label":g??r,children:[h.jsxs("div",{className:"dsn-attachment-card-thumbnail",children:[e==="picture"&&o?h.jsx("img",{src:o,alt:l,className:"dsn-attachment-card-image"}):null,e==="file"&&!n&&h.jsx("span",{className:"dsn-attachment-card-file-icon","aria-hidden":"true",children:h.jsx(Fy,{size:32,strokeWidth:1.75})}),n&&h.jsx("span",{className:"dsn-attachment-card-loading",children:h.jsx(Uy,{size:"lg",label:`Loading ${r}`})}),m&&h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:u==="more"?h.jsx(Xd,{size:16,"aria-hidden":"true"}):h.jsx(gr,{size:16,"aria-hidden":"true"}),className:"dsn-attachment-card-action",onClick:d,"aria-label":v,"aria-haspopup":u==="more"?"menu":void 0}),s&&t==="inside"&&h.jsxs("div",{className:"dsn-attachment-card-info dsn-attachment-card-info--inside",children:[h.jsx("p",{className:"dsn-attachment-card-title",children:r}),a&&h.jsx("p",{className:"dsn-attachment-card-meta",children:i})]})]}),s&&t==="outside"&&h.jsxs("div",{className:"dsn-attachment-card-info dsn-attachment-card-info--outside",children:[h.jsx("p",{className:"dsn-attachment-card-title",children:r}),a&&h.jsx("p",{className:"dsn-attachment-card-meta",children:i})]})]})}function Hy(e,t){if(typeof window>"u"||typeof document>"u")return t;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e).trim(),r=Number.parseFloat(n);return Number.isFinite(r)?r:t}function rj(e,t,n){return n?e:e?`${e} ${t}`:t}function tf({content:e,children:t,placement:n="top",delay:r=150,open:i,defaultOpen:a=!1,disabled:s=!1,className:o,id:l}){const u=_.useId(),c=l??`dsn-tooltip-${u}`,d=_.useRef(null),f=_.useRef(null),g=_.useRef(null),p=_.useRef(null),m=i!==void 0,[v,x]=_.useState(a),[y,b]=_.useState(null),k=s?!1:m?i:v,w=C=>{m||x(C)},S=()=>{p.current&&(clearTimeout(p.current),p.current=null)},N=()=>{s||(S(),p.current=setTimeout(()=>w(!0),r))},E=()=>{S(),w(!1)};_.useEffect(()=>()=>S(),[]),_.useEffect(()=>{if(!k)return;const C=O=>{O.key==="Escape"&&w(!1)};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[k]),_.useEffect(()=>{if(!k||!f.current||!g.current)return;const C=Hy("--space-small",8),O=Hy("--space-tiny",4),$=()=>{if(!f.current||!g.current)return;const A=f.current.getBoundingClientRect(),z=g.current.getBoundingClientRect(),B=z.width,R=z.height,H=A.left+A.width/2,F=A.top-R-O,L=F>=C,U=L?"top":"bottom",K=L?F:A.bottom+O,Y=Math.max(C,window.innerHeight-R-C),G=Math.min(Math.max(K,C),Y),Q=H-B/2,ne=Math.max(C,window.innerWidth-B-C),se=Math.min(Math.max(Q,C),ne);b({top:G,left:se,placement:U})};$();const j=window.requestAnimationFrame($),M=typeof ResizeObserver<"u"?new ResizeObserver(()=>$()):null;return M&&(M.observe(f.current),M.observe(g.current)),window.addEventListener("resize",$),window.addEventListener("scroll",$,!0),()=>{window.cancelAnimationFrame(j),M==null||M.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)}},[k]);const T=_.cloneElement(t,{"aria-describedby":rj(t.props["aria-describedby"],c,s)});return h.jsxs("span",{ref:d,className:["dsn-tooltip",o].filter(Boolean).join(" "),onMouseEnter:N,onMouseLeave:E,onFocus:N,onBlur:C=>{var $;const O=C.relatedTarget;O&&(($=d.current)!=null&&$.contains(O))||E()},children:[h.jsx("span",{ref:f,className:"dsn-tooltip-trigger",children:T}),h.jsx("span",{ref:g,id:c,role:"tooltip",className:"dsn-tooltip-bubble","data-placement":(y==null?void 0:y.placement)??n,hidden:!k,style:y?{top:y.top,left:y.left}:void 0,children:e})]})}function qy({value:e,label:t,className:n}){const r=Math.min(100,Math.max(0,e)),i=r===0?"0px":`calc(${r}% + 2px)`,a=["dsn-progress-bar",n].filter(Boolean).join(" ");return h.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r,"aria-label":t,className:a,children:h.jsx("div",{className:"dsn-progress-bar-track",children:h.jsx("div",{className:"dsn-progress-bar-fill",style:{width:i}})})})}function ij({fileName:e="File name",fileType:t="PDF",fileSize:n="10 Mb",previewVariant:r="image",previewSrc:i,state:a="default",uploadProgress:s=40,className:o,onCopyLink:l,onDownload:u,onCancelUpload:c,"aria-label":d}){const f=a==="uploading",g=["dsn-file-row",o].filter(Boolean).join(" ");return h.jsxs("article",{className:g,"data-state":a,"aria-label":d??e,children:[h.jsx("div",{className:"dsn-file-row-thumbnail",children:h.jsx(Zd,{variant:r,imageSrc:i,size:"large","aria-label":`${r} preview`})}),h.jsxs("div",{className:"dsn-file-row-content",children:[h.jsxs("div",{className:"dsn-file-row-title-wrap",children:[h.jsx("p",{className:"dsn-file-row-title",children:e}),f&&h.jsx(be,{variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,"aria-hidden":"true"}),className:"dsn-file-row-action-btn","aria-label":`Cancel upload for ${e}`,onClick:c})]}),!f&&h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"dsn-file-row-meta",children:[h.jsx("span",{children:t}),h.jsx("span",{"aria-hidden":"true",children:"•"}),h.jsx("span",{children:n})]}),h.jsxs(ui,{size:"sm",spaceBetween:!0,className:"dsn-file-row-actions","aria-label":`Actions for ${e}`,children:[h.jsx(tf,{content:"Copy link",children:h.jsx(be,{variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(zy,{size:16,"aria-hidden":"true"}),className:"dsn-file-row-action-btn","aria-label":`Copy link for ${e}`,onClick:l})}),h.jsx(tf,{content:"Download",children:h.jsx(be,{variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(Iy,{size:16,"aria-hidden":"true"}),className:"dsn-file-row-action-btn","aria-label":`Download ${e}`,onClick:u})})]})]}),f&&h.jsx("div",{className:"dsn-file-row-progress",children:h.jsx(qy,{value:s,label:`Uploading ${e}`})})]})]})}function nf({direction:e="horizontal",decorative:t=!1,className:n}){const r=["dsn-separator",n].filter(Boolean).join(" ");return e==="horizontal"?h.jsx("hr",{className:r,"data-direction":"horizontal","aria-hidden":t?!0:void 0}):h.jsx("div",{role:"separator","aria-orientation":"vertical",className:r,"data-direction":"vertical","aria-hidden":t?!0:void 0})}function aj({value:e,label:t,className:n}){const r=e!==void 0,i=r?Math.min(100,Math.max(0,e)):void 0,a=["dsn-loading-bar",n].filter(Boolean).join(" ");return h.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,"aria-label":t,"aria-live":"polite",className:a,"data-mode":r?"determinate":"indeterminate",children:h.jsx("div",{className:"dsn-loading-bar-fill",style:r?{width:`${i}%`}:void 0})})}function sj({type:e="avatar",className:t}){const n=["dsn-skeleton-loading",t].filter(Boolean).join(" ");return h.jsx("div",{className:n,"data-type":e,"aria-hidden":"true",children:h.jsx("div",{className:"dsn-skeleton-loading-glow"})})}function oj(){return h.jsx("svg",{width:"9",height:"7",viewBox:"0 0 9 7",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M0.625 3.125L3.125 5.625L8.125 0.625",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function lj(){return h.jsx("svg",{width:"8",height:"2",viewBox:"0 0 8 2",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M0.5 1H7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function Xn({size:e="md",checked:t=!1,indeterminate:n=!1,disabled:r=!1,label:i="Label",description:a="Description",descriptionRight:s="Assist label",showContent:o=!0,showLabel:l=!0,showDescription:u=!1,showDescriptionRight:c=!1,showAvatar:d=!1,avatarProps:f,showLeadingIcon:g=!1,leadingIcon:p,showTrailingIcon:m=!0,trailingIcon:v,showBadge:x=!1,badgeCount:y=1,badgeSize:b="sm",badgeVariant:k="critical",showTag:w=!1,tagLabel:S="Label",tagVariant:N="error",showButtons:E=!1,actionAriaLabel:T="Open actions",onActionClick:C,showSwitcherRight:O=!1,switcherChecked:$=!1,onSwitcherChange:j,onCheckedChange:M,className:A,"aria-label":z}){const B=["dsn-checkbox",A].filter(Boolean).join(" "),R=n?"mixed":t?"true":"false";function H(){r||M==null||M(!t)}function F(L){L.target===L.currentTarget&&L.key===" "&&(L.preventDefault(),H())}return h.jsxs("div",{className:B,"data-size":e,"data-has-content":o||void 0,"data-disabled":r||void 0,"data-checked":t||void 0,"data-indeterminate":n||void 0,role:"checkbox","aria-checked":R,"aria-disabled":r||void 0,"aria-label":z,tabIndex:r?-1:0,onClick:r?void 0:H,onKeyDown:F,children:[h.jsx("span",{className:"dsn-checkbox-indicator-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-checkbox-indicator",children:(t||n)&&h.jsx("span",{className:"dsn-checkbox-mark",children:n?h.jsx(lj,{}):h.jsx(oj,{})})})}),o&&h.jsxs("span",{className:"dsn-checkbox-content",children:[d&&h.jsx("span",{className:"dsn-checkbox-avatar-wrap",children:h.jsx(Wi,{size:"xs",variant:"profile",fill:"initials",initials:"AC",name:"Avatar",...f})}),g&&h.jsx("span",{className:"dsn-checkbox-icon-wrap","aria-hidden":"true",children:p??h.jsx(mr,{})}),l&&h.jsxs("span",{className:"dsn-checkbox-label-wrap",children:[h.jsx("span",{className:"dsn-checkbox-label",children:i}),u&&h.jsx("span",{className:"dsn-checkbox-description",children:a})]}),c&&h.jsx("span",{className:"dsn-checkbox-description-right",children:s}),x&&h.jsx("span",{className:"dsn-checkbox-badge-wrap",children:h.jsx(Gs,{size:b,variant:k,count:y})}),w&&h.jsx("span",{className:"dsn-checkbox-tag-wrap",children:h.jsx(zr,{size:"sm",variant:N,label:S})}),m&&h.jsx("span",{className:"dsn-checkbox-icon-wrap","aria-hidden":"true",children:v??h.jsx(mr,{})}),E&&h.jsx("span",{className:"dsn-checkbox-action-wrap",onClick:L=>L.stopPropagation(),onKeyDown:L=>L.stopPropagation(),children:h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(mr,{}),"aria-label":T,onClick:L=>{L.stopPropagation(),C==null||C(L)}})}),O&&h.jsx("span",{className:"dsn-checkbox-switcher-wrap",onClick:L=>L.stopPropagation(),onKeyDown:L=>L.stopPropagation(),children:h.jsx(Da,{size:"sm",checked:$,disabled:r,"aria-label":"Toggle option",onChange:j})})]})]})}function rf({size:e="md",checked:t=!1,disabled:n=!1,label:r="Label",description:i="Description",descriptionRight:a="Assist label",showContent:s=!0,showLabel:o=!0,showDescription:l=!1,showDescriptionRight:u=!1,showAvatar:c=!1,avatarProps:d,showLeadingIcon:f=!1,leadingIcon:g,showTrailingIcon:p=!0,trailingIcon:m,showBadge:v=!1,badgeCount:x=1,badgeSize:y="sm",badgeVariant:b="critical",showTag:k=!1,tagLabel:w="Label",tagVariant:S="error",showButtons:N=!1,actionAriaLabel:E="Open actions",onActionClick:T,showSwitcherRight:C=!1,switcherChecked:O=!1,onSwitcherChange:$,onCheckedChange:j,className:M,"aria-label":A}){const z=["dsn-radio",M].filter(Boolean).join(" ");function B(){n||t||j==null||j(!0)}function R(H){H.target===H.currentTarget&&H.key===" "&&(H.preventDefault(),B())}return h.jsxs("div",{className:z,"data-size":e,"data-has-content":s||void 0,"data-disabled":n||void 0,"data-checked":t||void 0,role:"radio","aria-checked":t?"true":"false","aria-disabled":n||void 0,"aria-label":A,tabIndex:n?-1:0,onClick:n?void 0:B,onKeyDown:R,children:[h.jsx("span",{className:"dsn-radio-indicator-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-radio-indicator",children:h.jsx("span",{className:"dsn-radio-dot"})})}),s&&h.jsxs("span",{className:"dsn-radio-content",children:[c&&h.jsx("span",{className:"dsn-radio-avatar-wrap",children:h.jsx(Wi,{size:"xs",variant:"profile",fill:"initials",initials:"AC",name:"Avatar",...d})}),f&&h.jsx("span",{className:"dsn-radio-icon-wrap","aria-hidden":"true",children:g??h.jsx(mr,{})}),o&&h.jsxs("span",{className:"dsn-radio-label-wrap",children:[h.jsx("span",{className:"dsn-radio-label",children:r}),l&&h.jsx("span",{className:"dsn-radio-description",children:i})]}),u&&h.jsx("span",{className:"dsn-radio-description-right",children:a}),v&&h.jsx("span",{className:"dsn-radio-badge-wrap",children:h.jsx(Gs,{size:y,variant:b,count:x})}),k&&h.jsx("span",{className:"dsn-radio-tag-wrap",children:h.jsx(zr,{size:"sm",variant:S,label:w})}),p&&h.jsx("span",{className:"dsn-radio-icon-wrap","aria-hidden":"true",children:m??h.jsx(mr,{})}),N&&h.jsx("span",{className:"dsn-radio-action-wrap",onClick:H=>H.stopPropagation(),onKeyDown:H=>H.stopPropagation(),children:h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(mr,{}),"aria-label":E,onClick:H=>{H.stopPropagation(),T==null||T(H)}})}),C&&h.jsx("span",{className:"dsn-radio-switcher-wrap",onClick:H=>H.stopPropagation(),onKeyDown:H=>H.stopPropagation(),children:h.jsx(Da,{size:"sm",checked:O,disabled:n,"aria-label":"Toggle option",onChange:$})})]})]})}function uj({id:e,label:t,placeholder:n,value:r,defaultValue:i,disabled:a=!1,error:s=!1,required:o=!1,helperText:l,errorMessage:u,maxLength:c,leadingIcon:d,trailingIcon:f,helperIcon:g,onChange:p,onBlur:m,onFocus:v,"aria-label":x,"aria-labelledby":y,autoComplete:b,name:k,className:w}){const S=_.useId(),N=e??`dsn-text-input-${S}`,E=`${N}-helper`,C=!!l||s&&!!u?E:void 0,[O,$]=_.useState(()=>(r??i??"").length),j=r!==void 0?r.length:O;function M(R){r===void 0&&$(R.target.value.length),p==null||p(R)}const A=!!l||s&&!!u||c!==void 0,z=f!=null&&c===void 0,B=s&&u?u:l;return h.jsxs("div",{className:`dsn-text-input${w?` ${w}`:""}`,"data-error":s||void 0,"data-disabled":a||void 0,children:[t&&h.jsxs("label",{className:"dsn-text-input-label",htmlFor:N,children:[t,o&&h.jsxs("span",{className:"dsn-text-input-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-text-input-control",children:[d&&h.jsx("span",{className:"dsn-text-input-icon","aria-hidden":"true",children:d}),h.jsx("input",{type:"text",id:N,className:"dsn-text-input-field",placeholder:n,value:r,defaultValue:i,disabled:a,maxLength:c,"aria-invalid":s||void 0,"aria-required":o||void 0,"aria-describedby":C,"aria-label":x,"aria-labelledby":y,autoComplete:b,name:k,onChange:M,onBlur:m,onFocus:v}),z&&h.jsx("span",{className:"dsn-text-input-icon","aria-hidden":"true",children:f})]}),A&&h.jsxs("div",{className:"dsn-text-input-meta",children:[h.jsxs("div",{className:"dsn-text-input-helper-inner",children:[g&&h.jsx("span",{className:"dsn-text-input-icon","aria-hidden":"true",children:g}),B!==void 0&&h.jsx("p",{id:E,className:"dsn-text-input-helper",children:B})]}),c!==void 0&&h.jsxs("span",{className:"dsn-text-input-count","aria-live":"polite","aria-atomic":"true",children:[j,"/",c]})]})]})}function cj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function dj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M8 3V13M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function af(e,t,n){let r=e;return t!==void 0&&(r=Math.max(t,r)),n!==void 0&&(r=Math.min(n,r)),r}function Hi({id:e,label:t,placeholder:n,value:r,defaultValue:i,min:a,max:s,step:o=1,disabled:l=!1,error:u=!1,required:c=!1,helperText:d,errorMessage:f,helperIcon:g,onChange:p,onBlur:m,onFocus:v,"aria-label":x,"aria-labelledby":y,name:b,className:k}){const w=_.useId(),S=e??`dsn-number-input-${w}`,N=`${S}-helper`,T=!!d||u&&!!f?N:void 0,[C,O]=_.useState(()=>i!==void 0?String(i):""),$=r!==void 0?String(r):C,j=r!==void 0?r:C!==""?parseFloat(C):NaN,M=l||a!==void 0&&!isNaN(j)&&j<=a,A=l||s!==void 0&&!isNaN(j)&&j>=s;function z(U){const K=U.target.value;if(r===void 0&&O(K),K===""||K==="-")p==null||p(null);else{const Y=parseFloat(K);isNaN(Y)||p==null||p(Y)}}function B(U){const K=parseFloat($);if(!isNaN(K)){const Y=af(K,a,s);if(Y!==K){const G=String(Y);r===void 0&&O(G),p==null||p(Y)}}m==null||m(U)}function R(){if(l||M)return;const U=isNaN(j)?a??0:j,K=af(U-o,a,s);r===void 0&&O(String(K)),p==null||p(K)}function H(){if(l||A)return;const U=isNaN(j)?a??0:j,K=af(U+o,a,s);r===void 0&&O(String(K)),p==null||p(K)}const F=!!d||u&&!!f,L=u&&f?f:d;return h.jsxs("div",{className:`dsn-number-input${k?` ${k}`:""}`,"data-error":u||void 0,"data-disabled":l||void 0,children:[t&&h.jsxs("label",{className:"dsn-number-input-label",htmlFor:S,children:[t,c&&h.jsxs("span",{className:"dsn-number-input-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-number-input-control",children:[h.jsx("input",{type:"text",inputMode:"numeric",id:S,className:"dsn-number-input-field",value:$,placeholder:n,disabled:l,name:b,"aria-invalid":u||void 0,"aria-required":c||void 0,"aria-describedby":T,"aria-label":x,"aria-labelledby":y,onChange:z,onBlur:B,onFocus:v}),h.jsxs("div",{className:"dsn-number-input-stepper",role:"group","aria-label":"Adjust value",children:[h.jsx("button",{type:"button",className:"dsn-number-input-btn","aria-label":"Decrease value",disabled:M,onClick:R,tabIndex:l?-1:void 0,children:h.jsx(cj,{})}),h.jsx("button",{type:"button",className:"dsn-number-input-btn","aria-label":"Increase value",disabled:A,onClick:H,tabIndex:l?-1:void 0,children:h.jsx(dj,{})})]})]}),F&&h.jsx("div",{className:"dsn-number-input-meta",children:h.jsxs("div",{className:"dsn-number-input-helper-inner",children:[g&&h.jsx("span",{className:"dsn-number-input-icon","aria-hidden":"true",children:g}),L!==void 0&&h.jsx("p",{id:N,className:"dsn-number-input-helper",children:L})]})})]})}function fj(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("rect",{x:"2.5",y:"7.5",width:"11",height:"7",rx:"1.5",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("path",{d:"M5.5 7.5V5.5a2.5 2.5 0 0 1 5 0v2",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function hj(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M1.5 8C2.5 5.5 5 3.5 8 3.5S13.5 5.5 14.5 8 12 12.5 8 12.5 2.5 10.5 1.5 8Z",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("circle",{cx:"8",cy:"8",r:"2",stroke:"currentColor",strokeWidth:"1.25"})]})}function pj(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M2 2.5L14 13.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M6.5 6.8A2 2 0 0 0 8 10a2 2 0 0 0 1.5-.7M4.2 4.7C2.7 5.8 1.5 8 1.5 8s2 4.5 6.5 4.5c1.2 0 2.2-.3 3-.8M8 3.5c4 0 6.5 4.5 6.5 4.5s-.5 1-1.5 2",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function gj({id:e,label:t,placeholder:n,value:r,defaultValue:i,disabled:a=!1,error:s=!1,required:o=!1,helperText:l,errorMessage:u,helperIcon:c,trailingIcon:d,labelAction:f,autoComplete:g="current-password",name:p,className:m,onChange:v,onBlur:x,onFocus:y,"aria-label":b,"aria-labelledby":k}){const w=_.useId(),S=e??`dsn-password-input-${w}`,N=`${S}-helper`,[E,T]=_.useState(!1),C=s&&u?u:l,O=!!l||s&&!!u,$=O?N:void 0,j=O;return h.jsxs("div",{className:`dsn-password-input${m?` ${m}`:""}`,"data-error":s||void 0,"data-disabled":a||void 0,children:[t&&h.jsxs("div",{className:"dsn-password-input-label-row",children:[h.jsxs("label",{className:"dsn-password-input-label",htmlFor:S,children:[t,o&&h.jsxs("span",{className:"dsn-password-input-required","aria-hidden":"true",children:[" ","*"]})]}),f&&h.jsx("span",{className:"dsn-password-input-label-action",children:f})]}),h.jsxs("div",{className:"dsn-password-input-control",children:[h.jsx("span",{className:"dsn-password-input-lock","aria-hidden":"true",children:h.jsx(fj,{})}),h.jsx("input",{type:E?"text":"password",id:S,className:"dsn-password-input-field",placeholder:n,value:r,defaultValue:i,disabled:a,"aria-invalid":s||void 0,"aria-required":o||void 0,"aria-describedby":$,"aria-label":b,"aria-labelledby":k,autoComplete:g,name:p,onChange:v,onBlur:x,onFocus:y}),d&&h.jsx("span",{className:"dsn-password-input-trailing","aria-hidden":"true",children:d}),h.jsx("button",{type:"button",className:"dsn-password-input-toggle","aria-label":E?"Hide password":"Show password","aria-pressed":E,onClick:()=>T(M=>!M),disabled:a,tabIndex:a?-1:void 0,children:E?h.jsx(pj,{}):h.jsx(hj,{})})]}),j&&h.jsx("div",{className:"dsn-password-input-meta",children:h.jsxs("div",{className:"dsn-password-input-helper-inner",children:[c&&h.jsx("span",{className:"dsn-password-input-icon","aria-hidden":"true",children:c}),h.jsx("p",{id:N,className:"dsn-password-input-helper",children:C})]})})]})}function mj(){return h.jsx("span",{className:"dsn-pw-req-radio","aria-hidden":"true"})}function vj(){return h.jsxs("svg",{className:"dsn-pw-req-check",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:"6.5",fill:"var(--surface-toggle-on)"}),h.jsx("path",{d:"M5.5 8.5l1.75 1.75L10.5 6.5",stroke:"white",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function yj({label:e,met:t,className:n}){return h.jsxs("div",{className:`dsn-pw-requirement${n?` ${n}`:""}`,"data-met":t||void 0,role:"status","aria-label":`${e}: ${t?"satisfied":"not satisfied"}`,children:[t?h.jsx(vj,{}):h.jsx(mj,{}),h.jsx("span",{className:"dsn-pw-requirement-label",children:e})]})}function xj({length:e=6,value:t,defaultValue:n,status:r="idle",disabled:i=!1,label:a,labelAction:s,helperText:o,helperIcon:l,errorMessage:u,onChange:c,onComplete:d,"aria-label":f,className:g}){const v=`${`dsn-otp-${_.useId()}`}-status`,[x,y]=_.useState(()=>{const j=(t??n??"").slice(0,e);return Array.from({length:e},(M,A)=>j[A]??"")});_.useEffect(()=>{t!==void 0&&y(Array.from({length:e},(j,M)=>t[M]??""))},[t,e]);const b=_.useRef([]),k=!i&&r!=="verifying"&&r!=="correct";function w(j){y(j);const M=j.join("");c==null||c(M),j.every(A=>A!=="")&&(d==null||d(M))}function S(j,M){var R;const z=M.target.value.replace(/[^0-9]/g,"").slice(-1),B=[...x];B[j]=z,w(B),z&&j<e-1&&((R=b.current[j+1])==null||R.focus())}function N(j,M){var A,z,B;if(M.key==="Backspace"){M.preventDefault();const R=[...x];R[j]?(R[j]="",w(R)):j>0&&(R[j-1]="",w(R),(A=b.current[j-1])==null||A.focus())}else M.key==="ArrowLeft"&&j>0?(M.preventDefault(),(z=b.current[j-1])==null||z.focus()):M.key==="ArrowRight"&&j<e-1&&(M.preventDefault(),(B=b.current[j+1])==null||B.focus())}function E(j){j.target.select()}function T(j){var H;j.preventDefault();const M=j.clipboardData.getData("text").replace(/[^0-9]/g,"").slice(0,e);if(!M)return;const A=[...x];for(let F=0;F<M.length;F++)A[F]=M[F];y(A);const z=A.join("");c==null||c(z);const B=A.findIndex(F=>F===""),R=B===-1?e-1:B;(H=b.current[R])==null||H.focus(),A.every(F=>F!=="")&&(d==null||d(z))}function C(){return r==="verifying"?"Verifying code…":r==="correct"?"Verification successful":r==="error"?u??"Verification failed":""}const O=r==="error"&&u?u:o,$=!!O;return h.jsxs("div",{className:`dsn-otp${g?` ${g}`:""}`,"data-status":r!=="idle"?r:void 0,"data-disabled":i||void 0,children:[(a||s)&&h.jsxs("div",{className:"dsn-otp-label-row",children:[a&&h.jsx("span",{className:"dsn-otp-label",children:a}),s&&h.jsx("span",{className:"dsn-otp-label-action",children:s})]}),h.jsx("div",{className:"dsn-otp-stack",role:"group","aria-label":f??`Enter ${e}-digit verification code`,"aria-describedby":r!=="idle"?v:void 0,children:x.map((j,M)=>h.jsx("input",{ref:A=>{b.current[M]=A},className:"dsn-otp-cell",type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:M===0?"one-time-code":"off",maxLength:1,value:j,disabled:!k,"aria-label":`Digit ${M+1} of ${e}`,onChange:A=>S(M,A),onKeyDown:A=>N(M,A),onFocus:E,onPaste:T},M))}),h.jsx("div",{id:v,role:"status","aria-live":"polite","aria-atomic":"true",className:"dsn-otp-sr-only",children:C()}),$&&h.jsxs("div",{className:"dsn-otp-helper-row",children:[l&&h.jsx("span",{className:"dsn-otp-helper-icon","aria-hidden":"true",children:l}),h.jsx("p",{className:"dsn-otp-helper",children:O})]})]})}const Vy=[{label:"United States (+1)",value:"+1"},{label:"Portugal (+351)",value:"+351"},{label:"United Kingdom (+44)",value:"+44"},{label:"Germany (+49)",value:"+49"}];function Zl(e){return e.replace(/\s+/g,"").replace(/^\+/,"")}function bj(e,t){const n=e.trim();if(!n.startsWith("+"))return null;const i=n.replace(/[^\d+]/g,"").slice(1);if(!i)return null;const s=[...t].sort((l,u)=>Zl(u.value).length-Zl(l.value).length).find(l=>i.startsWith(Zl(l.value)));if(!s)return null;const o=i.slice(Zl(s.value).length);return{countryCode:s.value,localNumber:o}}function _j({id:e,label:t,placeholder:n="1234567890",value:r,defaultValue:i,disabled:a=!1,error:s=!1,required:o=!1,helperText:l,errorMessage:u,helperIcon:c,countryCode:d,defaultCountryCode:f="+1",countryOptions:g=Vy,onChange:p,onCountryCodeChange:m,onBlur:v,onFocus:x,"aria-label":y,"aria-labelledby":b,countryCodeAriaLabel:k="Country code",autoComplete:w="tel",name:S,className:N}){const E=_.useId(),T=e??`dsn-phone-input-${E}`,C=`${T}-helper`,O=`${T}-country-menu`,[$,j]=_.useState(f),M=d??$,[A,z]=_.useState(i??""),B=r??A,[R,H]=_.useState(!1),F=_.useRef(null),L=_.useRef(null),U=_.useRef([]),[K,Y]=_.useState(-1),G=s&&u?u:l,ne=!!l||s&&!!u?C:void 0,se=_.useMemo(()=>g.length===0?Vy:g,[g]);function W(ee=!1){const he=se.findIndex(re=>re.value===M);return he>=0?he:se.length===0?-1:ee?se.length-1:0}function X(ee,he){return se.length===0?-1:(ee+he+se.length)%se.length}function D(ee){d===void 0&&j(ee),m==null||m(ee)}function P(ee){r===void 0&&z(ee.target.value),p==null||p(ee)}function q(ee){const he=bj(ee.clipboardData.getData("text"),se);he&&(ee.preventDefault(),D(he.countryCode??M),r===void 0&&z(he.localNumber))}return _.useEffect(()=>{const ee=he=>{!F.current||!R||F.current.contains(he.target)||H(!1)};return document.addEventListener("mousedown",ee),()=>document.removeEventListener("mousedown",ee)},[R]),_.useEffect(()=>{var he;if(!R||a){Y(-1);return}const ee=W();Y(ee),ee>=0&&((he=U.current[ee])==null||he.focus())},[M,a,R,se]),h.jsxs("div",{ref:F,className:`dsn-phone-input${N?` ${N}`:""}`,"data-error":s||void 0,"data-disabled":a||void 0,children:[t&&h.jsxs("label",{className:"dsn-phone-input-label",htmlFor:T,children:[t,o&&h.jsxs("span",{className:"dsn-phone-input-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-phone-input-control",role:"group","aria-label":"Phone number",children:[h.jsxs("span",{className:"dsn-phone-input-country-wrap",children:[h.jsxs("button",{ref:L,type:"button",className:"dsn-phone-input-country-visual",disabled:a,"aria-label":k,"aria-haspopup":"menu","aria-expanded":R,"aria-controls":R?O:void 0,onClick:()=>H(ee=>!ee),onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" "||ee.key==="ArrowDown")&&(ee.preventDefault(),H(!0)),ee.key==="ArrowUp"&&(ee.preventDefault(),Y(W(!0)),H(!0)),ee.key==="Escape"&&H(!1)},children:[h.jsx("span",{className:"dsn-phone-input-country-code",children:M}),h.jsx("span",{className:"dsn-phone-input-country-chevron","aria-hidden":"true",children:h.jsx(Fr,{size:16,strokeWidth:1.5,"aria-hidden":"true"})})]}),R&&!a&&h.jsx(Rr,{role:"menu","aria-label":`${k} options`,className:"dsn-phone-input-country-popover",contentClassName:"dsn-phone-input-country-popover-content",contentPadding:"small",anchorRef:L,offset:4,viewportMargin:16,matchAnchorWidth:!0,content:h.jsx("div",{id:O,children:se.map((ee,he)=>h.jsx(Ui,{ref:re=>{U.current[he]=re},tabIndex:K===he?0:-1,onKeyDown:re=>{var pe,ke,Ue,Qe,vt;if(re.key==="ArrowDown"){re.preventDefault();const Re=X(K>=0?K:W(),1);Y(Re),(pe=U.current[Re])==null||pe.focus();return}if(re.key==="ArrowUp"){re.preventDefault();const Re=X(K>=0?K:W(!0),-1);Y(Re),(ke=U.current[Re])==null||ke.focus();return}if(re.key==="Home"){re.preventDefault(),Y(0),(Ue=U.current[0])==null||Ue.focus();return}if(re.key==="End"){re.preventDefault();const Re=se.length-1;Y(Re),(Qe=U.current[Re])==null||Qe.focus();return}re.key==="Escape"&&(re.preventDefault(),H(!1),(vt=L.current)==null||vt.focus())},className:"dsn-phone-input-country-option",label:ee.label,showLeadingIcon:!1,showTrailingIcon:M===ee.value,selected:M===ee.value,"aria-label":ee.label,onClick:()=>{var re;D(ee.value),H(!1),(re=L.current)==null||re.focus()}},ee.value))})})]}),h.jsx("input",{type:"tel",id:T,className:"dsn-phone-input-field",placeholder:n,value:B,defaultValue:i,disabled:a,name:S,autoComplete:w,"aria-invalid":s||void 0,"aria-required":o||void 0,"aria-describedby":ne,"aria-label":y,"aria-labelledby":b,onChange:P,onPaste:q,onBlur:v,onFocus:x})]}),G&&h.jsx("div",{className:"dsn-phone-input-meta",children:h.jsxs("div",{className:"dsn-phone-input-helper-inner",children:[c&&h.jsx("span",{className:"dsn-phone-input-icon","aria-hidden":"true",children:c}),h.jsx("p",{id:C,className:"dsn-phone-input-helper",children:G})]})})]})}function wj({error:e=!1}){return e?h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 5V8M8 11H8.01M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}):h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.5L13.5 8L8 13.5L2.5 8L8 2.5Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}function kj({id:e,label:t,placeholder:n="Placeholder",value:r,defaultValue:i,disabled:a=!1,error:s=!1,required:o=!1,helperText:l,errorMessage:u,maxLength:c,minRows:d=3,helperIcon:f,leadingIcon:g,onChange:p,onBlur:m,onFocus:v,"aria-label":x,"aria-labelledby":y,autoComplete:b,name:k,className:w}){const S=_.useId(),N=e??`dsn-text-area-${S}`,E=`${N}-helper`,[T,C]=_.useState(()=>(r??i??"").length),O=r!==void 0?r.length:T,$=s&&u?u:l,j=!!l||s&&!!u,M=j||c!==void 0,A=j?E:void 0,z=f??(j?h.jsx(wj,{error:s}):null);function B(R){r===void 0&&C(R.target.value.length),p==null||p(R)}return h.jsxs("div",{className:`dsn-text-area${w?` ${w}`:""}`,"data-error":s||void 0,"data-disabled":a||void 0,children:[t&&h.jsxs("label",{className:"dsn-text-area-label",htmlFor:N,children:[t,o&&h.jsxs("span",{className:"dsn-text-area-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-text-area-control",children:[g&&h.jsx("span",{className:"dsn-text-area-leading-icon","aria-hidden":"true",children:g}),h.jsx("textarea",{id:N,className:"dsn-text-area-field",rows:d,placeholder:n,value:r,defaultValue:i,disabled:a,maxLength:c,"aria-invalid":s||void 0,"aria-required":o||void 0,"aria-describedby":A,"aria-label":x,"aria-labelledby":y,autoComplete:b,name:k,onChange:B,onBlur:m,onFocus:v})]}),M&&h.jsxs("div",{className:"dsn-text-area-meta",children:[h.jsxs("div",{className:"dsn-text-area-helper-inner",children:[z&&h.jsx("span",{className:"dsn-text-area-helper-icon","aria-hidden":"true",children:z}),$&&h.jsx("p",{id:E,className:"dsn-text-area-helper",children:$})]}),c!==void 0&&h.jsxs("span",{className:"dsn-text-area-count","aria-live":"polite","aria-atomic":"true",children:[O,"/",c]})]})]})}function Sj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M11.5 11.5L14 14M12.6667 7.33333C12.6667 10.2789 10.2789 12.6667 7.33333 12.6667C4.38781 12.6667 2 10.2789 2 7.33333C2 4.38781 4.38781 2 7.33333 2C10.2789 2 12.6667 4.38781 12.6667 7.33333Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M11.5 4.5L4.5 11.5M4.5 4.5L11.5 11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ky({id:e,variant:t="default",label:n="Label",placeholder:r="Search",value:i,defaultValue:a,disabled:s=!1,error:o=!1,helperText:l="Help text",errorMessage:u,maxLength:c,required:d=!1,helperIcon:f,onChange:g,onFocus:p,onBlur:m,onClear:v,className:x,name:y,autoComplete:b,"aria-label":k,"aria-labelledby":w}){const S=_.useId(),N=e??`dsn-search-bar-${S}`,E=`${N}-helper`,[T,C]=_.useState(()=>(i??a??"").length),O=i!==void 0,$=i??void 0,j=(i??"").length,M=O?j:T,A=O?j>0:T>0,B=t==="default"&&(!!l||o&&!!u||c!==void 0||o&&!!u),R=o&&u?u:l,H=["dsn-search-bar",x].filter(Boolean).join(" ");function F(U){O||C(U.target.value.length),g==null||g(U)}function L(){if(!O){C(0);const U=document.getElementById(N);U&&(U.value="",U.focus())}v==null||v()}return h.jsxs("div",{className:H,"data-variant":t,"data-error":o||void 0,"data-disabled":s||void 0,children:[t==="default"&&h.jsxs("label",{className:"dsn-search-bar-label",htmlFor:N,children:[n,d&&h.jsxs("span",{className:"dsn-search-bar-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-search-bar-control",children:[h.jsx("span",{className:"dsn-search-bar-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-search-bar-icon",children:h.jsx(Sj,{})})}),h.jsx("span",{className:"dsn-search-bar-label-wrap",children:h.jsx("input",{id:N,type:"search",className:"dsn-search-bar-field",placeholder:r,value:$,defaultValue:a,disabled:s,maxLength:c,name:y,autoComplete:b,"aria-invalid":o||void 0,"aria-required":d||void 0,"aria-describedby":B?E:void 0,"aria-label":k,"aria-labelledby":w,onChange:F,onFocus:p,onBlur:m})}),A&&!s&&h.jsx("span",{className:"dsn-search-bar-icon-wrap dsn-search-bar-clear",children:h.jsx("button",{type:"button",className:"dsn-search-bar-clear-btn","aria-label":"Clear search",onClick:L,children:h.jsx("span",{className:"dsn-search-bar-icon","aria-hidden":"true",children:h.jsx(Nj,{})})})})]}),B&&h.jsxs("div",{className:"dsn-search-bar-meta",children:[h.jsxs("div",{className:"dsn-search-bar-helper-inner",children:[f&&h.jsx("span",{className:"dsn-search-bar-helper-icon","aria-hidden":"true",children:f}),R!==void 0&&h.jsx("p",{id:E,className:"dsn-search-bar-helper",children:R})]}),c!==void 0&&h.jsxs("span",{className:"dsn-search-bar-count","aria-live":"polite","aria-atomic":"true",children:[M,"/",c]})]})]})}const Ej=[{value:"placeholder-a",label:"Placeholder A"},{value:"placeholder-b",label:"Placeholder B"},{value:"placeholder-c",label:"Placeholder C"},{value:"placeholder-d",label:"Placeholder D"}];function Tj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Cj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.5L13.5 8L8 13.5L2.5 8L8 2.5Z",stroke:"currentColor",strokeWidth:"1.5"})})}function jj({id:e,label:t="Label",placeholder:n="Placeholder",options:r=Ej,value:i,defaultValue:a,open:s,defaultOpen:o=!1,disabled:l=!1,error:u=!1,helperText:c="Help text",errorMessage:d,required:f=!1,helperIcon:g,className:p,name:m,onChange:v,onOpenChange:x,"aria-label":y,"aria-labelledby":b}){const k=_.useId(),w=e??`dsn-select-${k}`,S=`${w}-menu`,N=`${w}-helper`,E=`${w}-label`,T=i!==void 0,[C,O]=_.useState(a??""),$=T?i:C,j=s!==void 0,[M,A]=_.useState(o),z=j?s:M,B=_.useRef(null),R=_.useRef(null),H=_.useRef(null),F=_.useRef([]),[L,U]=_.useState(-1),K=_.useMemo(()=>r.find(W=>W.value===$),[r,$]),Y=u&&d?d:c,G=_.useCallback((W,X)=>{var P;if(r.length===0)return-1;let D=W;for(let q=0;q<r.length;q+=1)if(D=(D+X+r.length)%r.length,!((P=r[D])!=null&&P.disabled))return D;return-1},[r]),Q=_.useCallback((W=!1)=>{var D;if(r.length===0)return-1;const X=r.findIndex(P=>P.value===$&&!P.disabled);if(X>=0)return X;if(W){for(let P=r.length-1;P>=0;P-=1)if(!((D=r[P])!=null&&D.disabled))return P;return-1}return r.findIndex(P=>!P.disabled)},[r,$]),ne=_.useCallback(W=>{j||A(W),x==null||x(W)},[j,x]);function se(W){var X;W.disabled||l||(T||O(W.value),v==null||v(W.value,W),ne(!1),(X=H.current)==null||X.focus())}return _.useEffect(()=>{function W(X){B.current&&(B.current.contains(X.target)||ne(!1))}return document.addEventListener("mousedown",W),()=>{document.removeEventListener("mousedown",W)}},[ne]),_.useEffect(()=>{var X;if(!z||l){U(-1);return}const W=Q();U(W),W>=0&&((X=F.current[W])==null||X.focus())},[l,Q,z]),h.jsxs("div",{ref:B,className:["dsn-select",p].filter(Boolean).join(" "),"data-disabled":l||void 0,"data-error":u||void 0,"data-open":z||void 0,children:[h.jsxs("label",{className:"dsn-select-label",id:E,htmlFor:w,children:[t,f&&h.jsxs("span",{className:"dsn-select-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{ref:R,className:"dsn-select-control-wrap",children:[h.jsxs("button",{ref:H,id:w,type:"button",className:"dsn-select-control",disabled:l,"aria-haspopup":"menu","aria-expanded":z,"aria-controls":z?S:void 0,"aria-label":y,"aria-labelledby":b??E,"aria-invalid":u||void 0,"aria-required":f||void 0,"aria-describedby":Y?N:void 0,onClick:()=>ne(!z),onKeyDown:W=>{(W.key==="ArrowDown"||W.key==="ArrowUp"||W.key==="Enter"||W.key===" ")&&(W.preventDefault(),W.key==="ArrowUp"&&U(Q(!0)),ne(!0)),W.key==="Escape"&&ne(!1)},children:[h.jsx("span",{className:"dsn-select-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-select-icon",children:h.jsx(Cj,{})})}),h.jsx("span",{className:"dsn-select-label-wrap",children:h.jsx("span",{className:"dsn-select-value","data-placeholder":!K||void 0,children:(K==null?void 0:K.label)??n})}),h.jsx("span",{className:"dsn-select-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-select-icon",children:h.jsx(Tj,{})})})]}),z&&!l&&h.jsx(Rr,{role:"menu","aria-label":`${t} options`,className:"dsn-select-popover",contentClassName:"dsn-select-popover-stack",contentPadding:"small",anchorRef:R,offset:4,viewportMargin:16,matchAnchorWidth:!0,content:h.jsx("div",{id:S,children:r.map((W,X)=>h.jsx(Ui,{tabIndex:L===X?0:-1,onKeyDown:D=>{var P,q,ee,he,re,pe;if(D.key==="ArrowDown"){D.preventDefault();const ke=G(L>=0?L:Q(),1);U(ke),ke>=0&&((P=F.current[ke])==null||P.focus());return}if(D.key==="ArrowUp"){D.preventDefault();const ke=G(L>=0?L:Q(!0),-1);U(ke),ke>=0&&((q=F.current[ke])==null||q.focus());return}if(D.key==="Home"){D.preventDefault();const ke=r.findIndex(Ue=>!Ue.disabled);U(ke),ke>=0&&((ee=F.current[ke])==null||ee.focus());return}if(D.key==="End"){D.preventDefault();let ke=-1;for(let Ue=r.length-1;Ue>=0;Ue-=1)if(!((he=r[Ue])!=null&&he.disabled)){ke=Ue;break}U(ke),ke>=0&&((re=F.current[ke])==null||re.focus());return}D.key==="Escape"&&(D.preventDefault(),ne(!1),(pe=H.current)==null||pe.focus())},ref:D=>{F.current[X]=D},className:"dsn-select-option",label:W.label,description:W.description,showDescription:!!W.description,showLeadingIcon:!0,showTrailingIcon:$===W.value,selected:$===W.value,disabled:W.disabled,onClick:()=>se(W),"aria-label":W.label},W.value))})})]}),m&&h.jsx("input",{type:"hidden",name:m,value:$??""}),Y&&h.jsxs("div",{className:"dsn-select-meta",children:[g&&h.jsx("span",{className:"dsn-select-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-select-meta-icon",children:g})}),h.jsx("p",{id:N,className:"dsn-select-helper",children:Y})]})]})}const Mj=[{value:"placeholder-a",label:"Label A"},{value:"placeholder-b",label:"Label B"},{value:"placeholder-c",label:"Label C"},{value:"placeholder-d",label:"Label D"}];function Yy({selectionMode:e="single",id:t,label:n="Label",showLabel:r=!0,placeholder:i="Placeholder",options:a=Mj,value:s,defaultValue:o,values:l,defaultValues:u=[],open:c,defaultOpen:d=!1,disabled:f=!1,error:g=!1,helperText:p="Help text",showHelper:m=!0,errorMessage:v,required:x=!1,helperIcon:y,className:b,name:k,onChange:w,onValuesChange:S,onOpenChange:N,onInputChange:E,confirmLabel:T="Confirm","aria-label":C,"aria-labelledby":O}){const $=e==="multi",j=_.useId(),M=t??`dsn-combobox-${j}`,A=`${M}-listbox`,z=`${M}-helper`,B=`${M}-label`,R=s!==void 0,[H,F]=_.useState(o??""),L=R?s:H,U=_.useMemo(()=>a.find(ie=>ie.value===L),[a,L]),K=l!==void 0,[Y,G]=_.useState(u),Q=_.useMemo(()=>(K?l??[]:Y).filter(ie=>a.some(xe=>xe.value===ie)),[Y,K,a,l]),ne=_.useMemo(()=>new Set(Q),[Q]),[se,W]=_.useState(Q),X=_.useMemo(()=>new Set(se),[se]),D=_.useMemo(()=>a.filter(ie=>ne.has(ie.value)),[ne,a]),[P,q]=_.useState($?"":(U==null?void 0:U.label)??"");_.useEffect(()=>{$||q((U==null?void 0:U.label)??"")},[$,U==null?void 0:U.label]),_.useEffect(()=>{if($&&!K){const ie=Y.filter(xe=>a.some(ve=>ve.value===xe));ie.length!==Y.length&&G(ie)}},[Y,$,K,a]);const ee=c!==void 0,[he,re]=_.useState(d),pe=ee?c:he,ke=_.useRef(null),Ue=_.useRef(null),Qe=_.useRef(null),vt=_.useRef(!1),Re=_.useRef([]),[Ke,ft]=_.useState(-1),ut=g&&v?v:p,yt=P.trim().toLowerCase(),Le=_.useMemo(()=>yt.length===0?a:a.filter(ie=>ie.label.toLowerCase().includes(yt)),[yt,a]),Et=_.useCallback((ie,xe)=>{var Ne;if(Le.length===0)return-1;let ve=ie;for(let gt=0;gt<Le.length;gt+=1)if(ve=(ve+xe+Le.length)%Le.length,!((Ne=Le[ve])!=null&&Ne.disabled))return ve;return-1},[Le]),Tt=_.useCallback((ie=!1)=>{var ve;if(Le.length===0)return-1;const xe=Le.findIndex(Ne=>Ne.value===L&&!Ne.disabled);if(xe>=0)return xe;if(ie){for(let Ne=Le.length-1;Ne>=0;Ne-=1)if(!((ve=Le[Ne])!=null&&ve.disabled))return Ne;return-1}return Le.findIndex(Ne=>!Ne.disabled)},[Le,L]),at=_.useCallback(ie=>{ee||re(ie),N==null||N(ie)},[ee,N]),fr=_.useCallback(ie=>{const xe=new Set(ie);return a.filter(ve=>xe.has(ve.value)).map(ve=>ve.value)},[a]),jn=_.useCallback(()=>{if(!$)return;const ie=fr(se);K||G(ie),S==null||S(ie,a.filter(xe=>ie.includes(xe.value)))},[$,K,fr,S,a,se]),Ut=_.useCallback(()=>{jn(),at(!1)},[jn,at]),ye=_.useCallback(ie=>{W(xe=>xe.includes(ie)?xe.filter(ve=>ve!==ie):[...xe,ie])},[]),Ie=_.useCallback(ie=>{const xe=Q.filter(ve=>ve!==ie);K||G(xe),S==null||S(xe,a.filter(ve=>xe.includes(ve.value))),pe&&W(ve=>ve.filter(Ne=>Ne!==ie))},[Q,pe,K,S,a]);function Ct(ie){var xe;ie.disabled||f||(R||F(ie.value),q(ie.label),E==null||E(ie.label),w==null||w(ie.value,ie),at(!1),vt.current=!0,(xe=Qe.current)==null||xe.focus())}function _t(){var ie,xe;if($){q(""),E==null||E(""),at(!0),(ie=Qe.current)==null||ie.focus();return}R||F(""),q(""),E==null||E(""),at(!0),(xe=Qe.current)==null||xe.focus()}return _.useEffect(()=>{function ie(xe){ke.current&&(ke.current.contains(xe.target)||at(!1))}return document.addEventListener("mousedown",ie),()=>{document.removeEventListener("mousedown",ie)}},[at]),_.useEffect(()=>{if(!pe||f){ft(-1);return}ft(Tt())},[f,Tt,pe]),_.useEffect(()=>{$&&pe&&W(Q)},[Q,$,pe]),h.jsxs("div",{ref:ke,className:["dsn-combobox",b].filter(Boolean).join(" "),"data-disabled":f||void 0,"data-error":g||void 0,"data-open":pe||void 0,"data-filled":($?D.length>0:!!U)||void 0,children:[r&&h.jsxs("label",{className:"dsn-combobox-label",id:B,htmlFor:M,children:[n,x&&h.jsxs("span",{className:"dsn-combobox-required","aria-hidden":"true",children:[" ","*"]})]}),$&&D.length>0&&h.jsx("div",{className:"dsn-combobox-chip-stack",children:D.map(ie=>h.jsx(Xs,{size:"md",label:ie.label,showLeadingIcon:!1,showTrailingIcon:!1,onDismiss:()=>Ie(ie.value)},ie.value))}),h.jsxs("div",{ref:Ue,className:"dsn-combobox-control-wrap",children:[h.jsx("div",{className:"dsn-combobox-control",children:h.jsxs("div",{className:"dsn-combobox-input-row",children:[h.jsx("span",{className:"dsn-combobox-value-wrap",children:h.jsx("input",{ref:Qe,id:M,className:"dsn-combobox-input",type:"text",role:"combobox",autoComplete:"off",disabled:f,value:P,placeholder:i,"aria-expanded":pe,"aria-controls":pe?A:void 0,"aria-haspopup":$?"dialog":"listbox","aria-autocomplete":"list","aria-label":C,"aria-labelledby":O??(r?B:void 0),"aria-invalid":g||void 0,"aria-required":x||void 0,"aria-describedby":ut?z:void 0,onFocus:()=>{if(vt.current){vt.current=!1;return}f||at(!0)},onBlur:ie=>{var xe;if($){const ve=ie.relatedTarget;if(ve&&((xe=ke.current)!=null&&xe.contains(ve)))return;Ut()}},onClick:()=>{f||at(!0)},onChange:ie=>{const xe=ie.target.value;q(xe),E==null||E(xe),pe||at(!0)},onKeyDown:ie=>{var xe,ve;if(ie.key==="ArrowDown"){if(ie.preventDefault(),!pe){at(!0);return}const Ne=Et(Ke>=0?Ke:Tt(),1);ft(Ne),Ne>=0&&((xe=Re.current[Ne])==null||xe.focus())}if(ie.key==="ArrowUp"){if(ie.preventDefault(),!pe){at(!0);return}const Ne=Et(Ke>=0?Ke:Tt(!0),-1);ft(Ne),Ne>=0&&((ve=Re.current[Ne])==null||ve.focus())}if(ie.key==="Enter"&&pe){if($)ie.preventDefault(),Ut();else if(Ke>=0){ie.preventDefault();const Ne=Le[Ke];Ne&&Ct(Ne)}}ie.key==="Escape"&&(ie.preventDefault(),$?Ut():at(!1))}})}),!!P&&!f&&h.jsx("button",{type:"button",className:"dsn-combobox-clear","aria-label":$?"Clear search":"Clear selection",onClick:_t,children:h.jsx(Gd,{size:16,"aria-hidden":"true"})}),h.jsx("span",{className:"dsn-combobox-chevron","aria-hidden":"true",children:h.jsx(Fr,{size:16})})]})}),pe&&!f&&h.jsx(Rr,{role:$?"dialog":"listbox","aria-label":`${n} options`,className:"dsn-combobox-popover",contentClassName:"dsn-combobox-popover-stack",contentPadding:"small",anchorRef:Ue,offset:4,viewportMargin:16,matchAnchorWidth:!0,content:h.jsx("div",{id:A,children:Le.length===0?h.jsx("div",{className:"dsn-combobox-empty",children:"No options"}):$?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"dsn-combobox-multi-options",onMouseDown:ie=>{ie.preventDefault()},children:Le.map((ie,xe)=>h.jsx("div",{ref:ve=>{Re.current[xe]=ve},className:"dsn-combobox-multi-option","aria-disabled":ie.disabled||void 0,tabIndex:Ke===xe?0:-1,onKeyDown:ve=>{var Ne,gt;if(ve.key==="ArrowDown"){ve.preventDefault();const jt=Et(Ke>=0?Ke:Tt(),1);ft(jt),jt>=0&&((Ne=Re.current[jt])==null||Ne.focus());return}if(ve.key==="ArrowUp"){ve.preventDefault();const jt=Et(Ke>=0?Ke:Tt(!0),-1);ft(jt),jt>=0&&((gt=Re.current[jt])==null||gt.focus());return}if(ve.key==="Enter"||ve.key===" "){ve.preventDefault(),ie.disabled||ye(ie.value);return}ve.key==="Escape"&&(ve.preventDefault(),Ut())},children:h.jsx(Xn,{size:"md",checked:X.has(ie.value),disabled:ie.disabled,label:ie.label,showLeadingIcon:!1,showTrailingIcon:!1,onCheckedChange:()=>{ie.disabled||ye(ie.value)}})},ie.value))}),h.jsx("div",{className:"dsn-combobox-multi-footer",children:h.jsx(be,{size:"md",variant:"primary",onClick:Ut,children:T})})]}):Le.map((ie,xe)=>h.jsx(Ui,{tabIndex:Ke===xe?0:-1,ref:ve=>{Re.current[xe]=ve},className:"dsn-combobox-option",label:ie.label,description:ie.description,showDescription:!!ie.description,showLeadingIcon:!1,showTrailingIcon:!1,selected:L===ie.value,disabled:ie.disabled,onClick:()=>Ct(ie),onKeyDown:ve=>{var Ne,gt,jt;if(ve.key==="ArrowDown"){ve.preventDefault();const un=Et(Ke>=0?Ke:Tt(),1);ft(un),un>=0&&((Ne=Re.current[un])==null||Ne.focus());return}if(ve.key==="ArrowUp"){ve.preventDefault();const un=Et(Ke>=0?Ke:Tt(!0),-1);ft(un),un>=0&&((gt=Re.current[un])==null||gt.focus());return}if(ve.key==="Enter"||ve.key===" "){ve.preventDefault(),Ct(ie);return}ve.key==="Escape"&&(ve.preventDefault(),at(!1),(jt=Qe.current)==null||jt.focus())}},ie.value))})})]}),k&&($?Q.map(ie=>h.jsx("input",{type:"hidden",name:k,value:ie},ie)):h.jsx("input",{type:"hidden",name:k,value:L??""})),m&&ut&&h.jsxs("div",{className:"dsn-combobox-meta",children:[y&&h.jsx("span",{className:"dsn-combobox-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-combobox-meta-icon",children:y})}),h.jsx("p",{id:z,className:"dsn-combobox-helper",children:ut})]})]})}function Oj({id:e,label:t,active:n,disabled:r,tabIndex:i,showLeadingIcon:a=!1,leadingIcon:s,showTrailingIcon:o=!1,trailingIcon:l,onSelect:u,onKeyDown:c,onFocus:d,buttonRef:f,ariaLabel:g}){return h.jsxs("button",{ref:f,id:e,type:"button",className:"dsn-segment-control-selector",role:"radio","aria-checked":n,"aria-disabled":r||void 0,"aria-label":g,"data-active":n||void 0,disabled:r,tabIndex:i,onClick:u,onKeyDown:c,onFocus:d,children:[a&&s&&h.jsx("span",{className:"dsn-segment-control-selector-icon","aria-hidden":"true",children:s}),h.jsx("span",{className:"dsn-segment-control-selector-label-wrap",children:h.jsx("span",{className:"dsn-segment-control-selector-label",children:t})}),o&&l&&h.jsx("span",{className:"dsn-segment-control-selector-icon","aria-hidden":"true",children:l})]})}function $j(e){var n;return((n=e.find(r=>!r.disabled)??e[0])==null?void 0:n.value)??""}function sf({options:e,value:t,defaultValue:n,onChange:r,fullWidth:i=!0,className:a,"aria-label":s="Segment control"}){const o=_.useMemo(()=>$j(e),[e]),l=t!==void 0,[u,c]=_.useState(n??o),d=l?t:u,[f,g]=_.useState(()=>{const y=e.findIndex(b=>b.value===d);return y>=0?y:0}),p=_.useRef([]);_.useEffect(()=>{!l&&e.every(y=>y.value!==u)&&c(o)},[o,u,l,e]),_.useEffect(()=>{const y=e.findIndex(b=>b.value===d);y>=0&&g(y)},[e,d]);const m=_.useCallback(y=>{const b=e.find(k=>k.value===y);!b||b.disabled||(l||c(y),y!==d&&(r==null||r(y)))},[l,r,e,d]),v=_.useCallback((y,b)=>{var w;if(e.length===0)return;let k=y;for(let S=0;S<e.length;S+=1)if(k=(k+b+e.length)%e.length,!e[k].disabled){const N=e[k];g(k),m(N.value),(w=p.current[k])==null||w.focus();return}},[e,m]),x=["dsn-segment-control",a].filter(Boolean).join(" ");return h.jsx("div",{className:x,role:"radiogroup","aria-label":s,"data-full-width":i,children:e.map((y,b)=>{const k=y.value===d,w=b===f?0:-1,S=`dsn-segment-control-${y.value}`;return h.jsx(Oj,{id:S,label:y.label,active:k,disabled:!!y.disabled,tabIndex:w,showLeadingIcon:y.showLeadingIcon,leadingIcon:y.leadingIcon,showTrailingIcon:y.showTrailingIcon,trailingIcon:y.trailingIcon,ariaLabel:y["aria-label"],buttonRef:N=>{p.current[b]=N},onSelect:()=>m(y.value),onFocus:()=>g(b),onKeyDown:N=>{if(N.key==="ArrowRight"||N.key==="ArrowDown"){N.preventDefault(),v(b,1);return}if(N.key==="ArrowLeft"||N.key==="ArrowUp"){N.preventDefault(),v(b,-1);return}(N.key===" "||N.key==="Enter")&&(N.preventDefault(),m(y.value))}},y.value)})})}function of(e,t){const n=t==="sm"?"sm":"md";return _.Children.map(e,r=>{if(!_.isValidElement(r))return r;const i=of(r.props.children,t);if(r.type===be){const a=r.props.variant,s=a==="plain"?"secondary":a??"primary";return _.cloneElement(r,{variant:s,size:n,children:i})}return _.cloneElement(r,{children:i})})}function Ia({size:e="lg",variant:t="default",leftActions:n,rightActions:r,className:i,"aria-label":a="Toolbar"}){const s=["dsn-toolbar",i].filter(Boolean).join(" "),o=of(n,e),l=of(r,e);return h.jsxs("div",{className:s,"data-size":e,"data-variant":t,role:"toolbar","aria-label":a,children:[h.jsx("div",{className:"dsn-toolbar-side dsn-toolbar-side-left",children:o}),h.jsx("div",{className:"dsn-toolbar-side dsn-toolbar-side-right",children:l})]})}const Pj=["S","M","T","W","T","F","S"],Aj=["07:00","08:00","09:00","10:00","11:00","12:00","01:00","02:00","03:00","04:00","05:00","06:00"];function Lj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M9.5 4.5L6 8L9.5 11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M6.5 4.5L10 8L6.5 11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function lf(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M5.33333 2V4M10.6667 2V4M2.66667 6H13.3333M4 3.33333H12C12.7364 3.33333 13.3333 3.93029 13.3333 4.66667V12C13.3333 12.7364 12.7364 13.3333 12 13.3333H4C3.26362 13.3333 2.66667 12.7364 2.66667 12V4.66667C2.66667 3.93029 3.26362 3.33333 4 3.33333Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ij(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M11.5 4.5L4.5 11.5M4.5 4.5L11.5 11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Br(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Js(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Gy(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function qi(e){const t=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),r=String(e.getFullYear());return`${t}-${n}-${r}`}function Fj(e,t,n){return`${qi(e)} ${t} ${n}`}function zj(e){return e.toLocaleDateString("en-US",{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function Rj(e){const r=(e.trim().split(/\s+/)[0]??"").match(/^(\d{1,2})[-/](\d{1,2})[-/](\d{4})$/);if(!r)return null;const i=Number(r[1]),a=Number(r[2]),s=Number(r[3]),o=new Date(s,i-1,a);return o.getFullYear()!==s||o.getMonth()!==i-1||o.getDate()!==a?null:Br(o)}function ci(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Ql(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function bn(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),Br(n)}function Bj(e){return e.toLocaleDateString("en-US",{month:"short"})}function Wj(e){const t=ci(e),n=t.getDay(),r=bn(t,-n);return Array.from({length:42},(i,a)=>bn(r,a))}function Uj(e){return!e||e instanceof Date?{start:null,end:null}:{start:e.start?Br(e.start):null,end:e.end?Br(e.end):null}}function Hj(e){return!e||!(e instanceof Date)?null:Br(e)}function qj(e,t,n){if(!t||!n)return!1;const r=e.getTime();return r>t.getTime()&&r<n.getTime()}function Vj({id:e,displayMode:t="popover",selectionMode:n="single",withTime:r=!1,label:i="Date and time",placeholder:a="MM-DD-YYY 00:00 AM",startPlaceholder:s="Start date",endPlaceholder:o="End date",value:l,defaultValue:u=null,open:c,defaultOpen:d=!1,disabled:f=!1,required:g=!1,error:p=!1,helperText:m="Help text",errorMessage:v,helperIcon:x,className:y,onChange:b,onOpenChange:k,presets:w,selectedPresetId:S,defaultSelectedPresetId:N=null,onPresetSelect:E,showActions:T=!0,cancelLabel:C="Cancel",confirmLabel:O="Confirm",onCancel:$,onConfirm:j,"aria-label":M,"aria-labelledby":A}){const z=_.useId(),B=e??`dsn-date-time-picker-${z}`,R=`${B}-label`,H=`${B}-helper`,F=`${B}-dialog`,L=n==="range",U=t==="popover",K=p&&v?v:m,Y=c!==void 0,[G,Q]=_.useState(d),ne=Y?c:G,se=l!==void 0,[W,X]=_.useState(u),D=se?l:W,P=Hj(D),q=Uj(D),ee=_.useMemo(()=>P?ci(P):q.start?ci(q.start):ci(new Date),[q.start,P]),[he,re]=_.useState(ee),pe=_.useMemo(()=>{const te=Br(new Date),Xe=bn(te,-1);if(L){const ot=bn(te,-4);return[{id:"today",label:"Today",value:{start:te,end:te}},{id:"yesterday",label:"Yesterday",value:{start:Xe,end:Xe}},{id:"last-week",label:"Last week",value:{start:ot,end:te}},{id:"last-month",label:"Last month",value:{start:bn(te,-30),end:te}},{id:"last-year",label:"Last year",value:{start:bn(te,-365),end:te}}]}return[{id:"today",label:"Today",value:te},{id:"yesterday",label:"Yesterday",value:Xe},{id:"last-friday",label:"Last Friday",value:bn(te,-2)}]},[L]),ke=w??pe,Ue=T,Qe=S!==void 0,[vt,Re]=_.useState(N),Ke=Qe?S??null:vt,[ft,ut]=_.useState(Br(new Date)),[yt,Le]=_.useState(null),[Et,Tt]=_.useState("07:00"),[at,fr]=_.useState("AM"),[jn,Ut]=_.useState(P?qi(P):""),[ye,Ie]=_.useState(q.start?qi(q.start):""),[Ct,_t]=_.useState(q.end?qi(q.end):""),ie=_.useRef(null),xe=_.useRef(null),ve=_.useRef(null),Ne=_.useRef({}),gt=L&&q.start?qi(q.start):"",jt=L&&q.end?qi(q.end):"",un=!L&&P?r?Fj(P,Et,at):qi(P):"",Pa=_.useMemo(()=>Wj(he),[he]),Mt=te=>{Y||Q(te),k==null||k(te)},st=te=>{se||X(te),b==null||b(te)},Jt=te=>{const Xe=Gy(te),ot=Ne.current[Xe];ot&&ot.focus()},Mn=(te,Xe)=>{const ot=Rj(te);if(!ot)return;if(Xe==="single"){st(ot),re(ci(ot)),ut(ot);return}const pr=Xe==="range-start"?ot:q.start,I=Xe==="range-end"?ot:q.end;if(pr&&I&&pr.getTime()>I.getTime()){st({start:I,end:pr}),re(ci(I)),ut(I);return}st({start:pr??null,end:I??null}),re(ci(ot)),ut(ot)},Yn=te=>{Qe||Re(te.id),E==null||E(te.id),st(te.value)},Ht=te=>{if(Le(null),!L){st(te),ut(te),!r&&!Ue&&U&&Mt(!1);return}const{start:Xe,end:ot}=q;if(!Xe||Xe&&ot){st({start:te,end:null}),ut(te);return}te.getTime()<Xe.getTime()?(st({start:te,end:Xe}),ut(te)):(st({start:Xe,end:te}),ut(te)),!r&&!Ue&&U&&Mt(!1)};_.useEffect(()=>{if(!ne)return;const te=L?q.start??ft:P??ft;Js(te,ft)||ut(te);const Xe=setTimeout(()=>Jt(te),0);return()=>clearTimeout(Xe)},[ft,ne,L,q.start,P]),_.useEffect(()=>{const te=Xe=>{!ie.current||!ne||ie.current.contains(Xe.target)||Mt(!1)};return document.addEventListener("mousedown",te),()=>document.removeEventListener("mousedown",te)},[ne]),_.useEffect(()=>{L||Ut(un)},[L,un]),_.useEffect(()=>{(!L||!ne||q.end)&&Le(null)},[ne,L,q.end]),_.useEffect(()=>{L&&(Ie(gt),_t(jt))},[jt,L,gt]);const hr=h.jsxs("div",{className:"dsn-date-time-picker-panel",children:[h.jsxs("div",{className:"dsn-date-time-picker-calendar-header",children:[h.jsx("button",{type:"button",className:"dsn-date-time-picker-nav-button","aria-label":"Previous month",onClick:()=>re(te=>Ql(te,-1)),children:h.jsx(Lj,{})}),h.jsxs("div",{className:"dsn-date-time-picker-calendar-title-wrap",children:[h.jsx("span",{className:"dsn-date-time-picker-calendar-title",children:Bj(he)}),h.jsx("span",{className:"dsn-date-time-picker-calendar-title",children:he.getFullYear()})]}),h.jsx("button",{type:"button",className:"dsn-date-time-picker-nav-button","aria-label":"Next month",onClick:()=>re(te=>Ql(te,1)),children:h.jsx(Dj,{})})]}),h.jsx("div",{className:"dsn-date-time-picker-weekday-row",children:Pj.map((te,Xe)=>h.jsx("span",{className:"dsn-date-time-picker-weekday",children:te},`${te}-${Xe}`))}),h.jsx("div",{className:"dsn-date-time-picker-days-grid",role:"grid","aria-label":"Calendar",onMouseLeave:()=>Le(null),children:Pa.map(te=>{const Xe=te.getMonth()===he.getMonth(),ot=L&&!!(q.start&&!q.end&&yt),pr=ot&&q.start&&yt?yt.getTime()<q.start.getTime()?yt:q.start:null,I=ot&&q.start&&yt?yt.getTime()<q.start.getTime()?q.start:yt:null,ce=L?q.end?q.start:pr??q.start:P,ge=L?q.end??I:null,Se=Js(te,ce),Fe=L&&Js(te,ge),Ye=Se||Fe,De=L&&qj(te,ce,ge),Ae=L&&!!(ce&&ge&&te.getTime()>=ce.getTime()&&te.getTime()<=ge.getTime()),qt=Js(te,Br(new Date)),ht=Js(te,ft),pt=Gy(te);return h.jsx("button",{ref:Je=>{Ne.current[pt]=Je},type:"button",role:"gridcell",className:"dsn-date-time-picker-day","data-selected":Ye||void 0,"data-in-range":De||void 0,"data-within-range":Ae||void 0,"data-range-start":L&&Se?!0:void 0,"data-range-end":L&&Fe?!0:void 0,"data-today":qt||void 0,"data-outside-month":!Xe||void 0,"aria-selected":Ye,"aria-label":zj(te),tabIndex:ht?0:-1,onClick:()=>Ht(te),onFocus:()=>ut(te),onMouseEnter:()=>{L&&q.start&&!q.end&&Le(te)},onKeyDown:Je=>{var Ir;let Vt=null;if(Je.key==="ArrowRight"&&(Vt=bn(te,1)),Je.key==="ArrowLeft"&&(Vt=bn(te,-1)),Je.key==="ArrowDown"&&(Vt=bn(te,7)),Je.key==="ArrowUp"&&(Vt=bn(te,-7)),Je.key==="Home"&&(Vt=bn(te,-te.getDay())),Je.key==="End"&&(Vt=bn(te,6-te.getDay())),Je.key==="PageUp"){const ct=Ql(te,-1);Vt=new Date(ct.getFullYear(),ct.getMonth(),te.getDate())}if(Je.key==="PageDown"){const ct=Ql(te,1);Vt=new Date(ct.getFullYear(),ct.getMonth(),te.getDate())}if(Vt){Je.preventDefault();const ct=Br(Vt);ut(ct),re(ci(ct)),setTimeout(()=>Jt(ct),0);return}if(Je.key==="Enter"||Je.key===" "){Je.preventDefault(),Ht(te);return}Je.key==="Escape"&&(Je.preventDefault(),Mt(!1),(Ir=xe.current)==null||Ir.focus())},children:h.jsx("span",{className:"dsn-date-time-picker-day-inner",children:te.getDate()})},pt)})}),r&&h.jsxs("div",{className:"dsn-date-time-picker-time-bar",children:[h.jsx("div",{className:"dsn-date-time-picker-time-hour",children:h.jsx(Yy,{label:"Hour",showLabel:!1,showHelper:!1,placeholder:"07:00",helperText:"",selectionMode:"single",defaultValue:Et,options:Aj.map(te=>({value:te,label:te})),onChange:te=>Tt(te),onInputChange:te=>Tt(te),"aria-label":"Select time"})}),h.jsx("div",{className:"dsn-date-time-picker-time-meridiem",children:h.jsx(sf,{fullWidth:!1,"aria-label":"Select meridiem",value:at,onChange:fr,options:[{value:"AM",label:"AM"},{value:"PM",label:"PM"}]})})]})]});return U?h.jsxs("div",{ref:ie,className:["dsn-date-time-picker",y].filter(Boolean).join(" "),"data-error":p||void 0,"data-disabled":f||void 0,"data-open":ne||void 0,children:[!L&&h.jsxs("label",{id:R,className:"dsn-date-time-picker-label",htmlFor:`${B}-single`,children:[i,g&&h.jsxs("span",{className:"dsn-date-time-picker-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{ref:ve,className:"dsn-date-time-picker-control-wrap",children:[!L&&h.jsxs("div",{className:"dsn-date-time-picker-control",children:[h.jsx("span",{className:"dsn-date-time-picker-leading-icon","aria-hidden":"true",children:h.jsx(lf,{})}),h.jsx("input",{ref:xe,id:`${B}-single`,className:"dsn-date-time-picker-control-input",placeholder:a,value:jn,onChange:te=>Ut(te.target.value),disabled:f,"aria-label":M,"aria-labelledby":A??R,"aria-required":g||void 0,"aria-invalid":p||void 0,"aria-describedby":K?H:void 0,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?F:void 0,onFocus:()=>{f||Mt(!0)},onClick:()=>{f||Mt(!0)},onKeyDown:te=>{(te.key==="ArrowDown"||te.key==="Enter")&&(te.preventDefault(),Mt(!0)),te.key==="Escape"&&Mt(!1)},onBlur:te=>Mn(te.target.value,"single")}),jn&&!f&&h.jsx("button",{type:"button",className:"dsn-date-time-picker-clear-button","aria-label":"Clear date value",onClick:()=>{var te;Ut(""),st(null),Mt(!1),(te=xe.current)==null||te.focus()},children:h.jsx(Ij,{})})]}),L&&h.jsxs("div",{className:"dsn-date-time-picker-range-fields",children:[h.jsxs("div",{className:"dsn-date-time-picker-range-field",children:[h.jsx("label",{className:"dsn-date-time-picker-range-field-label",htmlFor:`${B}-start`,children:"Start"}),h.jsxs("div",{className:"dsn-date-time-picker-control",children:[h.jsx("span",{className:"dsn-date-time-picker-leading-icon","aria-hidden":"true",children:h.jsx(lf,{})}),h.jsx("input",{ref:xe,id:`${B}-start`,className:"dsn-date-time-picker-control-input",placeholder:s,value:ye,onChange:te=>Ie(te.target.value),disabled:f,"aria-label":M??"Start date","aria-required":g||void 0,"aria-invalid":p||void 0,"aria-describedby":K?H:void 0,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?F:void 0,onFocus:()=>{f||Mt(!0)},onClick:()=>{f||Mt(!0)},onBlur:te=>Mn(te.target.value,"range-start")})]})]}),h.jsxs("div",{className:"dsn-date-time-picker-range-field",children:[h.jsx("label",{className:"dsn-date-time-picker-range-field-label",htmlFor:`${B}-end`,children:"End"}),h.jsxs("div",{className:"dsn-date-time-picker-control",children:[h.jsx("span",{className:"dsn-date-time-picker-leading-icon","aria-hidden":"true",children:h.jsx(lf,{})}),h.jsx("input",{id:`${B}-end`,className:"dsn-date-time-picker-control-input",placeholder:o,value:Ct,onChange:te=>_t(te.target.value),disabled:f,"aria-label":"End date","aria-required":g||void 0,"aria-invalid":p||void 0,"aria-describedby":K?H:void 0,onFocus:()=>{f||Mt(!0)},onClick:()=>{f||Mt(!0)},onBlur:te=>Mn(te.target.value,"range-end")})]})]})]}),ne&&!f&&h.jsx(Rr,{role:"dialog","aria-label":L?"Choose date range":"Choose date",className:"dsn-date-time-picker-popover",contentClassName:"dsn-date-time-picker-popover-content",contentPadding:"none",anchorRef:ve,width:320,matchAnchorWidth:!1,minWidth:192,segment:ke.length>0?h.jsx("div",{className:"dsn-date-time-picker-presets",children:h.jsx(Jl,{label:"Date shortcuts",children:ke.map(te=>h.jsx(Xs,{size:"md",label:te.label,showLeadingIcon:!1,showTrailingIcon:!1,selected:Ke===te.id,onClick:()=>Yn(te)},te.id))})}):void 0,content:h.jsx("div",{id:F,children:hr}),bottomBar:Ue?h.jsx(Ia,{size:"md",leftActions:null,rightActions:h.jsxs(ui,{size:"md",spaceBetween:!0,"aria-label":"Date picker actions",children:[h.jsx(be,{variant:"ghost",size:"md",onClick:()=>{$==null||$(),Mt(!1)},children:C}),h.jsx(be,{variant:"primary",size:"md",onClick:()=>{j==null||j(D??null),Mt(!1)},children:O})]})}):void 0})]}),K&&h.jsxs("div",{className:"dsn-date-time-picker-meta",children:[x&&h.jsx("span",{className:"dsn-date-time-picker-meta-icon",children:x}),h.jsx("p",{id:H,className:"dsn-date-time-picker-helper",children:K})]})]}):h.jsxs("div",{ref:ie,className:["dsn-date-time-picker",y].filter(Boolean).join(" "),"data-error":p||void 0,"data-disabled":f||void 0,children:[i&&h.jsx("p",{id:R,className:"dsn-date-time-picker-label",children:i}),ke.length>0&&h.jsx("div",{className:"dsn-date-time-picker-presets",children:h.jsx(Jl,{label:"Quick date presets",children:ke.map(te=>h.jsx(Xs,{size:"md",label:te.label,showLeadingIcon:!1,showTrailingIcon:!1,selected:Ke===te.id,onClick:()=>Yn(te)},te.id))})}),h.jsx("div",{role:"dialog","aria-label":L?"Choose date range":"Choose date",children:hr}),K&&h.jsxs("div",{className:"dsn-date-time-picker-meta",children:[x&&h.jsx("span",{className:"dsn-date-time-picker-meta-icon",children:x}),h.jsx("p",{id:H,className:"dsn-date-time-picker-helper",children:K})]})]})}function Kj(){return h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M16 16L12 12M12 12L8 16M12 12V20M20.39 18.39C21.3655 17.8573 22.1359 17.0176 22.5789 16.0004C23.0218 14.9833 23.1125 13.8474 22.836 12.7737C22.5595 11.7 21.9317 10.7502 21.051 10.0757C20.1703 9.40118 19.0898 9.0399 17.98 9.05H16.72C16.4176 7.88024 15.854 6.79419 15.0709 5.87368C14.2878 4.95316 13.3058 4.22212 12.1998 3.73454C11.0938 3.24696 9.89114 3.01595 8.68219 3.05892C7.47325 3.10189 6.29018 3.41772 5.22287 3.98282C4.15556 4.54793 3.23226 5.3472 2.52208 6.32053C1.81191 7.29386 1.33398 8.41797 1.12408 9.605C0.914179 10.792 0.977588 12.0116 1.30956 13.1704C1.64154 14.3292 2.23322 15.3974 3.03999 16.29",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Yj({id:e,label:t="Label",helperText:n="Help text",helperIcon:r,disabled:i=!1,accept:a,multiple:s=!1,maxSizeText:o="Up to 100Mb",dragText:l="Drag and drop or press to upload",dropText:u="Drop here",onFilesSelected:c,onFocus:d,onBlur:f,className:g,"aria-label":p}){const m=_.useId(),v=e??`dsn-upload-area-${m}`,x=`${v}-label`,y=`${v}-helper`,b=_.useRef(null),[k,w]=_.useState(!1);function S(){var E;i||(E=b.current)==null||E.click()}function N(E){!E||E.length===0||c==null||c(Array.from(E))}return h.jsxs("div",{className:["dsn-upload-area",g].filter(Boolean).join(" "),children:[t&&h.jsx("p",{className:"dsn-upload-area-label",id:x,children:t}),h.jsxs("button",{id:v,type:"button",className:"dsn-upload-area-zone","data-disabled":i||void 0,"data-dragging":k||void 0,disabled:i,"aria-label":p??"Upload files - click or drag and drop","aria-labelledby":t?x:void 0,"aria-describedby":n?y:void 0,onClick:S,onFocus:d,onBlur:f,onDragOver:E=>{E.preventDefault(),i||w(!0)},onDragLeave:E=>{E.preventDefault(),w(!1)},onDrop:E=>{E.preventDefault(),w(!1),i||N(E.dataTransfer.files)},children:[h.jsx("span",{className:"dsn-upload-area-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-upload-area-icon",children:h.jsx(Kj,{})})}),h.jsx("span",{className:"dsn-upload-area-label-wrap",children:h.jsx("span",{className:"dsn-upload-area-main-text",children:k&&!i?u:l})}),!k&&h.jsx("span",{className:"dsn-upload-area-size-text",children:o})]}),h.jsx("input",{ref:b,type:"file",className:"dsn-upload-area-native",accept:a,multiple:s,disabled:i,onChange:E=>N(E.target.files)}),n&&h.jsxs("div",{className:"dsn-upload-area-meta",children:[r&&h.jsx("span",{className:"dsn-upload-area-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-upload-area-meta-icon",children:r})}),h.jsx("p",{id:y,className:"dsn-upload-area-helper",children:n})]})]})}function uf(e){if(e==null||typeof e=="boolean")return null;if(typeof e=="string"||typeof e=="number")return e;if(Array.isArray(e)){const t=e.map(n=>uf(n)).filter(n=>n!==null);return t.length>0?t:null}return _.isValidElement(e)?e:null}function vr({title:e,description:t,size:n="medium",leadingControl:r,trailingControl:i,className:a}){const s=["dsn-section-header",a].filter(Boolean).join(" "),o=uf(r),l=uf(i);return h.jsxs("div",{className:s,"data-size":n,"data-has-description":!!t||void 0,"data-has-leading-control":!!o||void 0,"data-has-trailing-control":!!l||void 0,children:[o&&h.jsx("div",{className:"dsn-section-header-control",children:o}),h.jsx("div",{className:"dsn-section-header-title-wrapper",children:h.jsxs("div",{className:"dsn-section-header-text",children:[h.jsx("p",{className:"dsn-section-header-title",children:e}),t&&h.jsx("p",{className:"dsn-section-header-description",children:t})]})}),l&&h.jsx("div",{className:"dsn-section-header-control",children:l})]})}function Gj(e){var n;return((n=e.find(r=>!r.disabled)??e[0])==null?void 0:n.value)??""}function Xj({tabs:e,value:t,defaultValue:n,onChange:r,className:i,showPanels:a=!0,panelClassName:s,"aria-label":o="Tabs"}){const l=_.useMemo(()=>Gj(e),[e]),u=t!==void 0,[c,d]=_.useState(n??l),f=u?t:c,g=_.useRef([]);_.useEffect(()=>{!u&&e.every(b=>b.value!==c)&&d(l)},[l,c,u,e]);const p=_.useCallback(b=>{const k=e.find(w=>w.value===b);!k||k.disabled||(u||d(b),b!==f&&(r==null||r(b)))},[u,r,f,e]),m=_.useCallback((b,k)=>{if(e.length===0)return-1;let w=b;for(let S=0;S<e.length;S+=1)if(w=(w+k+e.length)%e.length,!e[w].disabled)return w;return-1},[e]),v=_.useCallback(b=>{var k;b<0||(k=g.current[b])==null||k.focus()},[]),x=["dsn-tab",i].filter(Boolean).join(" "),y=["dsn-tab-panel",s].filter(Boolean).join(" ");return h.jsxs("div",{className:x,children:[h.jsx("div",{className:"dsn-tab-list",role:"tablist","aria-label":o,children:e.map((b,k)=>{const w=b.value===f,S=!!b.disabled,N=`dsn-tab-${b.value}`,E=`dsn-tabpanel-${b.value}`,T=w?0:-1;return h.jsx("button",{ref:C=>{g.current[k]=C},className:"dsn-tab-trigger",type:"button",role:"tab",id:N,"aria-controls":E,"aria-selected":w,"aria-label":b["aria-label"],"aria-disabled":S||void 0,disabled:S,"data-selected":w||void 0,tabIndex:T,onClick:()=>p(b.value),onKeyDown:C=>{if(C.key==="ArrowRight"){C.preventDefault();const O=m(k,1);v(O);return}if(C.key==="ArrowLeft"){C.preventDefault();const O=m(k,-1);v(O);return}if(C.key==="Home"){C.preventDefault();const O=e.findIndex($=>!$.disabled);v(O);return}if(C.key==="End"){C.preventDefault();const O=[...e].reverse().findIndex(j=>!j.disabled),$=O<0?-1:e.length-1-O;v($);return}(C.key===" "||C.key==="Enter")&&(C.preventDefault(),p(b.value))},children:h.jsxs("span",{className:"dsn-tab-trigger-content",children:[b.showLeadingIcon&&h.jsx("span",{className:"dsn-tab-icon-wrap","aria-hidden":"true",children:b.leadingIcon}),h.jsx("span",{className:"dsn-tab-label-wrap",children:h.jsx("span",{className:"dsn-tab-label",children:b.label})}),b.showTrailingIcon&&h.jsx("span",{className:"dsn-tab-icon-wrap","aria-hidden":"true",children:b.trailingIcon})]})},b.value)})}),a&&e.map(b=>{const k=`dsn-tabpanel-${b.value}`,w=`dsn-tab-${b.value}`,S=b.value===f;return h.jsx("div",{className:y,role:"tabpanel",id:k,"aria-labelledby":w,hidden:!S,children:b.panel},b.value)})]})}function Jj(e){var n;return((n=e.find(r=>!r.disabled)??e[0])==null?void 0:n.value)??""}function Xy({tabs:e,value:t,defaultValue:n,onChange:r,onRemove:i,addActionLabel:a,addActionLeadingIcon:s,onAddAction:o,addActionAriaLabel:l,className:u,showPanels:c=!0,panelClassName:d,"aria-label":f="Custom views"}){const g=_.useMemo(()=>Jj(e),[e]),p=t!==void 0,[m,v]=_.useState(n??g),x=p?t:m,y=_.useRef([]);_.useEffect(()=>{!p&&e.every(E=>E.value!==m)&&v(g)},[g,m,p,e]);const b=_.useCallback(E=>{const T=e.find(C=>C.value===E);!T||T.disabled||(p||v(E),E!==x&&(r==null||r(E)))},[p,r,x,e]),k=_.useCallback((E,T)=>{if(e.length===0)return-1;let C=E;for(let O=0;O<e.length;O+=1)if(C=(C+T+e.length)%e.length,!e[C].disabled)return C;return-1},[e]),w=_.useCallback(E=>{var T;E<0||(T=y.current[E])==null||T.focus()},[]),S=["dsn-custom-view-tabs",u].filter(Boolean).join(" "),N=["dsn-custom-view-tabs-panel",d].filter(Boolean).join(" ");return h.jsxs("div",{className:S,children:[h.jsxs("div",{className:"dsn-custom-view-tabs-list",role:"tablist","aria-label":f,children:[e.map((E,T)=>{const C=E.value===x,O=!!E.disabled,$=E.removable!==!1,j=E.showLeadingIcon!==!1,M=`dsn-custom-tab-${E.value}`,A=`dsn-custom-tabpanel-${E.value}`,z=C?0:-1;return h.jsxs("div",{className:"dsn-custom-view-tabs-item",ref:B=>{y.current[T]=B},role:"tab",id:M,"aria-controls":A,"aria-selected":C,"aria-label":E["aria-label"],"aria-disabled":O||void 0,"data-selected":C||void 0,"data-disabled":O||void 0,tabIndex:O?-1:z,onClick:()=>{O||b(E.value)},onKeyDown:B=>{if(!O){if(B.key==="ArrowRight"){B.preventDefault();const R=k(T,1);w(R);return}if(B.key==="ArrowLeft"){B.preventDefault();const R=k(T,-1);w(R);return}if(B.key==="Home"){B.preventDefault();const R=e.findIndex(H=>!H.disabled);w(R);return}if(B.key==="End"){B.preventDefault();const R=[...e].reverse().findIndex(F=>!F.disabled),H=R<0?-1:e.length-1-R;w(H);return}(B.key===" "||B.key==="Enter")&&(B.preventDefault(),b(E.value))}},children:[j&&h.jsx("span",{className:"dsn-custom-view-tabs-icon","data-icon":E.leadingIcon?"custom":"default","aria-hidden":"true",children:E.leadingIcon}),h.jsx("span",{className:"dsn-custom-view-tabs-label-wrap",children:h.jsx("span",{className:"dsn-custom-view-tabs-label",children:E.label})}),$&&h.jsx(be,{className:"dsn-custom-view-tabs-remove",variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,"aria-hidden":"true"}),"aria-label":E.removeAriaLabel??`Remove ${E.label}`,disabled:O,onClick:B=>{B.stopPropagation(),B.preventDefault(),i==null||i(E.value)}})]},E.value)}),a&&h.jsx("span",{className:"dsn-custom-view-tabs-add-wrap",children:h.jsx(be,{className:"dsn-custom-view-tabs-add-button",variant:"ghost",size:"md",showLeadingIcon:!0,leadingIcon:s??h.jsx($C,{size:16,"aria-hidden":"true"}),"aria-label":l??a,onClick:o,children:a})})]}),c&&e.map(E=>{const T=`dsn-custom-tabpanel-${E.value}`,C=`dsn-custom-tab-${E.value}`,O=E.value===x;return h.jsx("div",{className:N,role:"tabpanel",id:T,"aria-labelledby":C,hidden:!O,children:E.panel},E.value)})]})}const Zj=Xy;function Qj(e){return e==="none"?"desc":e==="desc"?"asc":"desc"}function eM(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function Jy({variant:e="title",state:t="default",label:n="Label",width:r,sortable:i=!1,sortDirection:a="none",reorderable:s=!0,resizable:o=!0,checkboxChecked:l=!1,checkboxIndeterminate:u=!1,onCheckboxChange:c,onSortChange:d,onReorderCommand:f,onResizeCommand:g,onResizePointerDown:p,onMoreClick:m,onReorderDragStart:v,onReorderDragEnd:x,filterValue:y,onFilterChange:b,leadingAccessory:k,className:w,"aria-label":S}){const N=["dsn-data-table-header-cell",w].filter(Boolean).join(" "),E=e==="title",T=E&&i,C=()=>{T&&(d==null||d(Qj(a)))},O=j=>{T&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),C())},$=E&&typeof r=="number"?{width:`${r}px`}:void 0;return h.jsx("div",{className:N,"data-variant":e,"data-state":t,role:"columnheader","aria-sort":E&&i?eM(a):void 0,"aria-label":S,style:$,tabIndex:T||s?0:-1,draggable:s||void 0,onClick:C,onKeyDown:O,onDragStart:s?v:void 0,onDragEnd:s?x:void 0,children:E?h.jsxs(h.Fragment,{children:[s&&h.jsxs("div",{className:"dsn-data-table-header-drag-indicator","aria-hidden":"true",children:[h.jsx("span",{}),h.jsx("span",{}),h.jsx("span",{}),h.jsx("span",{})]}),h.jsxs("div",{className:"dsn-data-table-header-cell-main",children:[k&&h.jsx("span",{className:"dsn-data-table-header-cell-leading-accessory",onClick:j=>j.stopPropagation(),children:k}),h.jsxs("div",{className:"dsn-data-table-header-cell-title",children:[h.jsx("span",{className:"dsn-data-table-header-cell-label",children:n}),i&&h.jsx("span",{className:"dsn-data-table-header-cell-sort","data-direction":a,"aria-hidden":"true",children:a==="asc"?h.jsx(vC,{size:14,strokeWidth:1.5}):h.jsx(gC,{size:14,strokeWidth:1.5})})]})]}),h.jsx("div",{className:"dsn-data-table-header-cell-controls",children:h.jsx(be,{variant:"ghost",size:"sm",showLeadingIcon:!0,leadingIcon:h.jsx(Xd,{size:14,strokeWidth:1.5,"aria-hidden":"true"}),showLabel:!1,onClick:j=>{j.stopPropagation(),m==null||m(j)},"aria-label":"Column options"})}),o&&h.jsx("button",{type:"button",className:"dsn-data-table-header-resizer","aria-label":"Resize column",onClick:j=>j.stopPropagation(),onPointerDown:j=>{j.stopPropagation(),p==null||p(j)},onKeyDown:j=>{j.stopPropagation(),j.key==="ArrowLeft"?(j.preventDefault(),g==null||g("decrease")):j.key==="ArrowRight"&&(j.preventDefault(),g==null||g("increase"))}})]}):h.jsx("div",{className:"dsn-data-table-header-cell-checkbox-wrap",onClick:j=>j.stopPropagation(),children:h.jsx(Xn,{size:"sm",checked:l,indeterminate:u,showContent:!1,"aria-label":S??"Select all rows",onCheckedChange:c})})})}function tM({values:e}){const t=_.useRef(null),n=_.useRef(null),r=_.useRef(null),i=_.useRef(null),a=_.useRef(null),[s,o]=_.useState(e.length),[l,u]=_.useState(!1),c=Math.max(0,e.length-s),d=_.useCallback(()=>{const f=t.current,g=n.current,p=r.current;if(!f||!g)return;const m=f.clientWidth;if(m<=0)return;const x=Array.from(g.querySelectorAll("[data-measure-tag]")).map(S=>S.getBoundingClientRect().width),y=Number.parseFloat(window.getComputedStyle(f).columnGap||"0")||0,b=(p==null?void 0:p.getBoundingClientRect().width)??0;let k=0,w=0;for(let S=0;S<x.length;S+=1){const N=k+(w>0?y:0)+x[S],T=x.length-(S+1)>0?(w>=0?y:0)+b:0;if(N+T<=m)k=N,w+=1;else break}o(w)},[]);return _.useEffect(()=>{o(e.length)},[e]),_.useEffect(()=>{d()},[d,e]),_.useEffect(()=>{c===0&&l&&u(!1)},[l,c]),_.useEffect(()=>{const f=t.current;if(!f||typeof ResizeObserver>"u")return;const g=new ResizeObserver(()=>d());return g.observe(f),()=>g.disconnect()},[d]),_.useEffect(()=>{if(!l)return;const f=p=>{p.key==="Escape"&&u(!1)},g=p=>{const m=p.target,v=i.current,x=a.current;v!=null&&v.contains(m)||x!=null&&x.contains(m)||u(!1)};return window.addEventListener("keydown",f),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",f),window.removeEventListener("mousedown",g)}},[l]),h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"dsn-data-table-cell-tags",ref:t,children:[e.slice(0,s).map((f,g)=>h.jsx(zr,{size:"sm",variant:"highlight",label:f,showIcon:!1},`${f}-${g}`)),c>0&&h.jsx("button",{ref:i,type:"button",className:"dsn-data-table-cell-tags-overflow-trigger","aria-label":`Show ${c} more tags`,"aria-haspopup":"dialog","aria-expanded":l,onClick:f=>{f.stopPropagation(),u(g=>!g)},children:h.jsx(zr,{size:"sm",variant:"neutral",label:`+${c}`,showIcon:!1})})]}),h.jsxs("span",{className:"dsn-data-table-cell-tags-measure",ref:n,"aria-hidden":"true",children:[e.map((f,g)=>h.jsx("span",{"data-measure-tag":!0,children:h.jsx(zr,{size:"sm",variant:"highlight",label:f,showIcon:!1})},`${f}-${g}`)),h.jsx("span",{ref:r,children:h.jsx(zr,{size:"sm",variant:"neutral",label:`+${e.length}`,showIcon:!1})})]}),l&&c>0&&h.jsx("div",{className:"dsn-data-table-cell-tags-popover",ref:a,children:h.jsx(Rr,{anchorRef:i,role:"dialog","aria-label":"Hidden tags",width:280,contentPadding:"small",content:h.jsx("div",{className:"dsn-data-table-cell-tags-popover-content",children:e.map((f,g)=>h.jsx(zr,{size:"sm",variant:"highlight",label:f,showIcon:!1},`${f}-${g}`))})})})]})}function eu(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M6 6.5H3.5V12.5H9.5V10",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M6.5 3.5H12.5V9.5H6.5V3.5Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function nM(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M3 11.5L5 11L11.5 4.5L10 3L3.5 9.5L3 11.5Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function Zy(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M5.5 5.5V11",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M8 5.5V11",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M10.5 5.5V11",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M3.5 4H12.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M5 4V3.5C5 3.22 5.22 3 5.5 3H10.5C10.78 3 11 3.22 11 3.5V4",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M4.5 4L5 12.5H11L11.5 4",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function rM(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("rect",{x:"3",y:"4.5",width:"10",height:"8.5",rx:"1.5",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("path",{d:"M3 7H13",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M5.5 3V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M10.5 3V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function iM(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M6.5 3.5H3.5V12.5H12.5V9.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M9.5 3.5H12.5M12.5 3.5V6.5M12.5 3.5L7.5 8.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function aM(e,t,n){switch(e){case"number":return h.jsx("span",{children:typeof t=="number"?t.toLocaleString():t??""});case"date":return h.jsx("span",{children:String(t??"")});case"tag":{const i=(Array.isArray(t)?t:t!=null?[t]:[]).map(a=>String(a));return h.jsx(tM,{values:i})}case"user":{const r=t??{name:""};return h.jsxs("span",{className:"dsn-data-table-cell-user",children:[h.jsx(Wi,{size:"xs",variant:"profile",fill:"initials",initials:r.initials??r.name.slice(0,2).toUpperCase(),name:r.name}),h.jsx("span",{children:r.name})]})}case"boolean":return h.jsx(Da,{size:"sm",checked:!!t,disabled:!0,"aria-label":t?"True value":"False value"});case"checkbox":return h.jsx(Xn,{size:"sm",checked:!!t,showContent:!1,"aria-label":t?"Selected row":"Unselected row",onCheckedChange:n});case"url":return h.jsx("a",{className:"dsn-data-table-cell-link",href:String(t??"#"),children:String(t??"")});case"empty":return h.jsx("span",{className:"dsn-data-table-cell-empty",children:String(t??"Add [field name]")});case"string":default:return h.jsx("span",{children:String(t??"")})}}function sM(e){return e==="string"?h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(eu,{}),"aria-label":"Copy cell value"}):e==="number"?h.jsxs(ui,{size:"sm",spaceBetween:!1,"aria-label":"Number cell actions",children:[h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(nM,{}),"aria-label":"Edit number value"}),h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(Zy,{}),"aria-label":"Delete number value"})]}):e==="date"?h.jsxs(ui,{size:"sm",spaceBetween:!1,"aria-label":"Date cell actions",children:[h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(rM,{}),"aria-label":"Open date picker"}),h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(Zy,{}),"aria-label":"Clear date value"})]}):e==="user"?h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(eu,{}),"aria-label":"Copy user name"}):e==="tag"?h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(eu,{}),"aria-label":"Copy tags"}):e==="url"?h.jsxs(ui,{size:"sm",spaceBetween:!1,"aria-label":"URL cell actions",children:[h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(eu,{}),"aria-label":"Copy URL"}),h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(iM,{}),"aria-label":"Open URL in new tab"})]}):null}function Qy({fieldType:e="string",state:t="default",loading:n=!1,value:r="Label",width:i,onCheckboxChange:a,leadingAccessory:s,align:o="left",className:l,"aria-label":u}){const c=["dsn-data-table-cell",l].filter(Boolean).join(" "),d=t==="hover"&&!n?sM(e):null,f=typeof i=="number"?{width:`${i}px`}:void 0;return h.jsx("div",{className:c,"data-field-type":e,"data-state":t,"data-loading":n||void 0,"data-align":o,"aria-label":u,style:f,children:n?h.jsx("span",{className:"dsn-data-table-cell-skeleton","aria-hidden":"true"}):h.jsxs(h.Fragment,{children:[s&&h.jsx("span",{className:"dsn-data-table-cell-leading-accessory",children:s}),h.jsx("span",{className:"dsn-data-table-cell-content",children:aM(e,r,a)}),d&&h.jsx("span",{className:"dsn-data-table-cell-actions",children:d})]})})}function e0(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.5L13.5 8L8 13.5L2.5 8L8 2.5Z",stroke:"currentColor",strokeWidth:"var(--border-width-medium)",strokeLinejoin:"round"})})}function oM(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M6 6.5H3.5V12.5H9.5V10",stroke:"currentColor",strokeWidth:"var(--border-width-medium)",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M6.5 3.5H12.5V9.5H6.5V3.5Z",stroke:"currentColor",strokeWidth:"var(--border-width-medium)",strokeLinecap:"round",strokeLinejoin:"round"})]})}function lM({alignment:e="inline",variant:t="with-title",state:n="default",title:r="Title",description:i="Description",content:a,showIcon:s=!0,icon:o,showActions:l=!0,actionAriaLabel:u="Copy description",onActionClick:c,className:d,"aria-label":f}){const g=t==="with-title",p=a!=null,m=["dsn-data-list-cell",d].filter(Boolean).join(" "),v=p?h.jsx("span",{className:"dsn-data-list-cell-interactive-content",children:a}):h.jsx("p",{className:"dsn-data-list-cell-description",children:i});return h.jsxs("div",{className:m,"data-alignment":e,"data-variant":t,"data-state":n,role:"group","aria-label":f,children:[e==="inline"?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"dsn-data-list-cell-title-wrapper",children:[s&&h.jsx("span",{className:"dsn-data-list-cell-icon","aria-hidden":"true",children:o??h.jsx(e0,{})}),g&&h.jsx("p",{className:"dsn-data-list-cell-title",children:r})]}),h.jsx("div",{className:"dsn-data-list-cell-text-block",children:v})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"dsn-data-list-cell-title-description-wrapper",children:h.jsxs("div",{className:"dsn-data-list-cell-title-wrapper",children:[s&&h.jsx("span",{className:"dsn-data-list-cell-icon","aria-hidden":"true",children:o??h.jsx(e0,{})}),g&&h.jsx("p",{className:"dsn-data-list-cell-title",children:r})]})}),h.jsx("div",{className:"dsn-data-list-cell-text-block",children:v})]}),l&&h.jsx("span",{className:"dsn-data-list-cell-actions",children:h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(oM,{}),"aria-label":u,onClick:x=>{x.stopPropagation(),c==null||c(x)}})})]})}function uM(e){if(e.kind==="menu-cell"){const n=e.props??{};return h.jsx(Ui,{variant:e.variant??"default",label:"Label",showLeadingIcon:!0,...n})}if(e.kind==="checkbox-cell"){const n=e.props??{};return h.jsx(Xn,{label:"Label",showLeadingIcon:!0,...n})}const t=e.props??{};return h.jsx(rf,{label:"Label",showLeadingIcon:!0,...t})}function t0({title:e="Choice list",description:t,sections:n,showHeader:r=!0,showSectionHeaders:i=!0,className:a,sectionClassName:s,enableMenuKeyboardNavigation:o=!1,onMenuEscape:l}){const u=_.useRef(null),c=["dsn-choice-list",a].filter(Boolean).join(" "),d=["dsn-choice-list-section",s].filter(Boolean).join(" "),f=_.useCallback(()=>u.current?Array.from(u.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')):[],[]),g=_.useCallback(p=>{const m=f();if(m.length===0)return;const v=Math.min(Math.max(p,0),m.length-1);m.forEach((x,y)=>{x.tabIndex=y===v?0:-1})},[f]);return _.useEffect(()=>{o&&g(0)},[o,n,g]),h.jsxs("section",{ref:u,className:c,"aria-label":e,onKeyDown:p=>{var b,k,w,S;if(!o)return;const m=f();if(m.length===0)return;const v=document.activeElement,x=v?m.indexOf(v):-1,y=x>=0?x:0;if(p.key==="ArrowDown"){p.preventDefault();const N=(y+1)%m.length;g(N),(b=m[N])==null||b.focus();return}if(p.key==="ArrowUp"){p.preventDefault();const N=(y-1+m.length)%m.length;g(N),(k=m[N])==null||k.focus();return}if(p.key==="Home"){p.preventDefault(),g(0),(w=m[0])==null||w.focus();return}if(p.key==="End"){p.preventDefault();const N=m.length-1;g(N),(S=m[N])==null||S.focus();return}p.key==="Escape"&&(p.preventDefault(),l==null||l())},children:[r&&h.jsx("header",{className:"dsn-choice-list-header",children:h.jsx(vr,{title:e,description:t,size:"large"})}),h.jsx("div",{className:"dsn-choice-list-sections",children:n.map(p=>h.jsxs("section",{className:d,"aria-label":p.title,children:[i&&h.jsx(vr,{title:p.title,size:"small"}),h.jsx("div",{className:"dsn-choice-list-items",children:p.items.map(m=>h.jsx("div",{className:"dsn-choice-list-item",children:uM(m)},m.id))})]},p.id))})]})}function cM({id:e,label:t="Label",checkboxLabel:n="Label",checked:r,defaultChecked:i=!1,disabled:a=!1,helperText:s="Help text",helperIcon:o,error:l=!1,errorMessage:u,required:c=!1,className:d,checkboxProps:f,onCheckedChange:g,"aria-label":p}){const m=_.useId(),x=`${e??`dsn-checkbox-field-${m}`}-helper`,y=r!==void 0,[b,k]=_.useState(i),w=y?r:b,S=l&&u?u:s;function N(E){y||k(E),g==null||g(E)}return h.jsxs("div",{className:["dsn-checkbox-field",d].filter(Boolean).join(" "),"data-error":l||void 0,"data-disabled":a||void 0,children:[h.jsxs("fieldset",{className:"dsn-checkbox-fieldset","aria-label":p,"aria-describedby":S?x:void 0,"aria-invalid":l||void 0,"aria-required":c||void 0,children:[h.jsxs("legend",{className:"dsn-checkbox-field-label",children:[t,c&&h.jsxs("span",{className:"dsn-checkbox-field-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsx("div",{className:"dsn-checkbox-field-control",children:h.jsx(Xn,{className:"dsn-checkbox--full-width",label:n,checked:w,disabled:a,showTrailingIcon:!1,onCheckedChange:N,...f})})]}),S&&h.jsxs("div",{className:"dsn-checkbox-field-meta",children:[o&&h.jsx("span",{className:"dsn-checkbox-field-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-checkbox-field-meta-icon",children:o})}),h.jsx("p",{id:x,className:"dsn-checkbox-field-helper",children:S})]})]})}function dM(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.5L13.5 8L8 13.5L2.5 8L8 2.5Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}function fM({label:e,description:t,showDescription:n=!0,showIcon:r=!1,iconSlot:i,error:a=!1,labelWidth:s,children:o,className:l}){const u=_.useId(),c=`dsn-horizontal-input-label-${u}`,d=`dsn-horizontal-input-description-${u}`,f=n&&!!t,g=i??h.jsx(dM,{}),p={...s?{"--dsn-horizontal-input-label-width":s}:{}};return h.jsx("div",{className:["dsn-horizontal-input",l].filter(Boolean).join(" "),"data-error":a||void 0,"data-has-icon":r||void 0,style:p,children:h.jsxs("div",{className:"dsn-horizontal-input-row",children:[h.jsxs("div",{className:"dsn-horizontal-input-meta",children:[h.jsxs("div",{className:"dsn-horizontal-input-label-row",children:[r&&h.jsx("span",{className:"dsn-horizontal-input-icon","aria-hidden":"true",children:g}),h.jsx("span",{id:c,className:"dsn-horizontal-input-label",children:e})]}),f&&h.jsx("p",{id:d,className:"dsn-horizontal-input-description",children:t})]}),h.jsx("div",{className:"dsn-horizontal-input-content",role:"group","aria-labelledby":c,"aria-describedby":f?d:void 0,children:o})]})})}const hM=Array.from({length:6},(e,t)=>({id:`option-${t+1}`,label:"Label",checked:!1}));function pM({id:e,label:t="Label",options:n=hM,helperText:r="Help text",helperIcon:i,error:a=!1,errorMessage:s,required:o=!1,disabled:l=!1,className:u,onOptionChange:c,"aria-label":d}){const f=_.useId(),p=`${e??`dsn-multi-choice-${f}`}-helper`,m=a&&s?s:r;return h.jsxs("div",{className:["dsn-multi-choice",u].filter(Boolean).join(" "),"data-error":a||void 0,"data-disabled":l||void 0,children:[h.jsxs("fieldset",{className:"dsn-multi-choice-fieldset","aria-label":d,"aria-describedby":m?p:void 0,"aria-invalid":a||void 0,"aria-required":o||void 0,children:[h.jsxs("legend",{className:"dsn-multi-choice-label",children:[t,o&&h.jsxs("span",{className:"dsn-multi-choice-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsx("div",{className:"dsn-multi-choice-stack",children:n.map(v=>h.jsx(Xn,{className:"dsn-checkbox--full-width",label:v.label,checked:v.checked,disabled:l||v.disabled,showTrailingIcon:!1,showDescription:!!v.description,description:v.description,showDescriptionRight:!!v.descriptionRight,descriptionRight:v.descriptionRight,onCheckedChange:x=>c==null?void 0:c(v.id,x),...v.checkboxProps},v.id))})]}),m&&h.jsxs("div",{className:"dsn-multi-choice-meta",children:[i&&h.jsx("span",{className:"dsn-multi-choice-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-multi-choice-meta-icon",children:i})}),h.jsx("p",{id:p,className:"dsn-multi-choice-helper",children:m})]})]})}const gM=Array.from({length:6},(e,t)=>({id:`option-${t+1}`,label:"Label"}));function mM({id:e,label:t="Label",options:n=gM,value:r,defaultValue:i,helperText:a="Help text",helperIcon:s,error:o=!1,errorMessage:l,required:u=!1,disabled:c=!1,className:d,onValueChange:f,"aria-label":g}){const p=_.useId(),m=e??`dsn-single-choice-${p}`,v=`${m}-legend`,x=`${m}-helper`,y=o&&l?l:a,b=r!==void 0,[k,w]=_.useState(i??""),S=b?r:k;function N(E){b||w(E),f==null||f(E)}return h.jsxs("div",{className:["dsn-single-choice",d].filter(Boolean).join(" "),"data-error":o||void 0,"data-disabled":c||void 0,children:[h.jsxs("fieldset",{className:"dsn-single-choice-fieldset","aria-label":g,"aria-describedby":y?x:void 0,"aria-invalid":o||void 0,"aria-required":u||void 0,children:[h.jsxs("legend",{id:v,className:"dsn-single-choice-label",children:[t,u&&h.jsxs("span",{className:"dsn-single-choice-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsx("div",{className:"dsn-single-choice-stack",role:"radiogroup","aria-labelledby":v,children:n.map(E=>h.jsx(rf,{className:"dsn-radio--full-width",label:E.label,checked:S===E.id,disabled:c||E.disabled,showTrailingIcon:!1,showDescription:!!E.description,description:E.description,showDescriptionRight:!!E.descriptionRight,descriptionRight:E.descriptionRight,onCheckedChange:T=>{T&&N(E.id)},...E.radioProps},E.id))})]}),y&&h.jsxs("div",{className:"dsn-single-choice-meta",children:[s&&h.jsx("span",{className:"dsn-single-choice-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-single-choice-meta-icon",children:s})}),h.jsx("p",{id:x,className:"dsn-single-choice-helper",children:y})]})]})}function vM({selectedCount:e,onCountClick:t,onDismiss:n,actions:r,className:i}){const a=e===1?"item":"items";return h.jsx("div",{className:`dsn-bulk-action-bar${i?` ${i}`:""}`,role:"toolbar","aria-label":`${e} ${a} selected`,children:h.jsxs("div",{className:"dsn-bulk-action-bar-container",children:[h.jsxs("div",{className:"dsn-bulk-action-bar-selection",role:"group","aria-label":"Selection",children:[h.jsxs(be,{variant:"secondary",size:"md",showLabel:!0,showTrailingIcon:!0,trailingIcon:h.jsx(Fr,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),onClick:t,"aria-label":`${e} selected, click to view selection options`,children:[e," selected"]}),h.jsx(be,{variant:"secondary",size:"md",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),onClick:n,"aria-label":"Clear selection"})]}),h.jsx(ui,{size:"md",spaceBetween:!0,"aria-label":"Bulk actions",children:r.map((s,o)=>h.jsx(be,{variant:"secondary",size:"md",showLeadingIcon:s.icon!=null,leadingIcon:s.icon,showLabel:!0,showTrailingIcon:s.hasDropdown,trailingIcon:s.hasDropdown?h.jsx(Fr,{size:16,strokeWidth:1.5,"aria-hidden":"true"}):void 0,destructive:s.destructive,disabled:s.disabled,onClick:s.onClick,"aria-haspopup":s.hasDropdown?"menu":void 0,"aria-label":s["aria-label"],children:s.label},o))})]})})}const yM=Array.from({length:8},(e,t)=>({id:`option-${t+1}`,label:"Label"}));function xM({id:e,label:t="Label",options:n=yM,value:r,defaultValue:i=[],helperText:a="Help text",helperIcon:s,error:o=!1,errorMessage:l,required:u=!1,disabled:c=!1,size:d="md",className:f,onValueChange:g,"aria-label":p}){const m=_.useId(),x=`${e??`dsn-chip-field-${m}`}-helper`,y=o&&l?l:a,b=r!==void 0,[k,w]=_.useState(i),S=b?r:k,N=new Set(S);function E(T){const C=N.has(T)?S.filter(O=>O!==T):[...S,T];b||w(C),g==null||g(C)}return h.jsxs("div",{className:["dsn-chip-field",f].filter(Boolean).join(" "),"data-error":o||void 0,"data-disabled":c||void 0,children:[h.jsxs("fieldset",{className:"dsn-chip-fieldset","aria-label":p,"aria-describedby":y?x:void 0,"aria-invalid":o||void 0,"aria-required":u||void 0,children:[h.jsxs("legend",{className:"dsn-chip-field-label",children:[t,u&&h.jsxs("span",{className:"dsn-chip-field-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsx(Jl,{label:t,className:"dsn-chip-field-group",children:n.map(T=>h.jsx(Xs,{label:T.label,size:d,selected:N.has(T.id),disabled:c||T.disabled,onClick:()=>E(T.id),...T.chipProps},T.id))})]}),y&&h.jsxs("div",{className:"dsn-chip-field-meta",children:[s&&h.jsx("span",{className:"dsn-chip-field-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-chip-field-meta-icon",children:s})}),h.jsx("p",{id:x,className:"dsn-chip-field-helper",children:y})]})]})}function Zs(e,t,n){return Math.min(n,Math.max(t,e))}function Fa(e,t,n,r){if(r<=0)return Zs(e,t,n);const i=t+Math.round((e-t)/r)*r,a=Zs(i,t,n);return Number(a.toFixed(6))}function cf(e,t,n,r){const i=Fa(e[0],t,n,r),a=Fa(e[1],t,n,r);return[Math.min(i,a),Math.max(i,a)]}function df(e){const r=72+e.length*9;return Zs(r,104,184)}function bM({id:e,mode:t="single",stack:n="vertical",showInput:r=!1,value:i,defaultValue:a,rangeValue:s,defaultRangeValue:o,min:l=0,max:u=100,step:c=1,disabled:d=!1,showValue:f=!0,showMinMax:g=!1,minLabel:p,maxLabel:m,minInputLabel:v="Minimum",maxInputLabel:x="Maximum",className:y,onValueChange:b,onRangeChange:k,valueFormatter:w=O=>String(O),minHandleAriaLabel:S="Minimum value",maxHandleAriaLabel:N="Maximum value","aria-label":E,"aria-labelledby":T,"aria-valuetext":C}){const O=_.useId(),$=e??`dsn-slider-${O}`,j=Math.min(l,u),M=Math.max(l,u),A=c>0?c:1,z=t==="single",B=n==="vertical",R=i!==void 0,H=s!==void 0,[F,L]=_.useState(()=>Fa(a??j,j,M,A)),[U,K]=_.useState(()=>cf(o??[j,M],j,M,A)),[Y,G]=_.useState(!1),[Q,ne]=_.useState("single"),se=_.useRef(null),W=_.useRef(null),X=R?Fa(i,j,M,A):F,D=H?cf(s,j,M,A):U,P=_.useMemo(()=>M<=j?0:(X-j)/(M-j)*100,[X,j,M]),q=_.useMemo(()=>{if(M<=j)return{minPct:0,maxPct:0};const ye=(D[0]-j)/(M-j)*100,Ie=(D[1]-j)/(M-j)*100;return{minPct:ye,maxPct:Ie}},[D,j,M]);function ee(ye){const Ie=Fa(ye,j,M,A);R||L(Ie),b==null||b(Ie)}function he(ye){const Ie=cf(ye,j,M,A);H||K(Ie),k==null||k(Ie)}function re(ye,Ie){const Ct=Fa(Ie,j,M,A);if(ye==="min"){he([Math.min(Ct,D[1]),D[1]]);return}he([D[0],Math.max(Ct,D[0])])}function pe(ye,Ie,Ct){const _t=Ie.getBoundingClientRect(),ie=_t.width||1,xe=(ye-_t.left)/ie,ve=Zs(xe,0,1),Ne=j+ve*(M-j);if(z){ee(Ne);return}re(Ct??(Q==="max"?"max":"min"),Ne)}function ke(ye){if(d)return;const Ie=ye.currentTarget;if(z)ne("single");else{const Ct=Ie.getBoundingClientRect(),_t=Ct.width||1,ie=Zs((ye.clientX-Ct.left)/_t,0,1),xe=j+ie*(M-j),ve=Math.abs(xe-D[0]),Ne=Math.abs(xe-D[1]),gt=ve<=Ne?"min":"max";ne(gt),Ie.setPointerCapture(ye.pointerId),G(!0),pe(ye.clientX,Ie,gt);return}Ie.setPointerCapture(ye.pointerId),G(!0),pe(ye.clientX,Ie)}function Ue(ye){d||!Y||pe(ye.clientX,ye.currentTarget)}function Qe(ye){ye.currentTarget.hasPointerCapture(ye.pointerId)&&(ye.currentTarget.releasePointerCapture(ye.pointerId),G(!1))}function vt(ye){if(d)return;const Ie=A*10,_t=ye.currentTarget.getAttribute("data-handle")??"single",ie=_t==="min"?D[0]:_t==="max"?D[1]:X;function xe(ve){_t==="min"||_t==="max"?re(_t,ve):ee(ve)}switch(ye.key){case"ArrowRight":case"ArrowUp":ye.preventDefault(),xe(ie+A);break;case"ArrowLeft":case"ArrowDown":ye.preventDefault(),xe(ie-A);break;case"PageUp":ye.preventDefault(),xe(ie+Ie);break;case"PageDown":ye.preventDefault(),xe(ie-Ie);break;case"Home":ye.preventDefault(),xe(j);break;case"End":ye.preventDefault(),xe(M);break}}const Re=p??w(j),Ke=m??w(M),ft=C??w(X),ut=`${w(D[0])} - ${w(D[1])}`,yt=q.minPct,Le=q.maxPct-q.minPct,Et=f&&(z||!r),Tt=df(w(X)),at=df(w(D[0])),fr=df(w(D[1]));function jn(){var Ie;const ye=(Ie=W.current)==null?void 0:Ie.querySelector("input");ye instanceof HTMLInputElement&&(ye.focus(),ye.select())}function Ut(ye){ye.key==="Enter"&&(ye.preventDefault(),jn())}return h.jsxs("div",{className:["dsn-slider",y].filter(Boolean).join(" "),id:$,"data-disabled":d||void 0,"data-stack":n,children:[Et&&h.jsx("div",{className:"dsn-slider-value",children:z?w(X):ut}),r&&z&&B&&h.jsx(Hi,{value:X,min:j,max:M,step:A,disabled:d,onChange:ye=>{ye!==null&&ee(ye)},"aria-label":E??"Slider value"}),r&&!z&&B&&h.jsxs("div",{className:"dsn-slider-input-row",children:[h.jsx("div",{ref:se,onKeyDown:Ut,children:h.jsx(Hi,{label:v,value:D[0],min:j,max:D[1],step:A,disabled:d,onChange:ye=>{ye!==null&&re("min",ye)},"aria-label":S})}),h.jsx("div",{ref:W,children:h.jsx(Hi,{label:x,value:D[1],min:D[0],max:M,step:A,disabled:d,onChange:ye=>{ye!==null&&re("max",ye)},"aria-label":N})})]}),h.jsxs("div",{className:"dsn-slider-main-row",children:[r&&!z&&!B&&h.jsx("div",{ref:se,onKeyDown:Ut,style:{width:`${at}px`},children:h.jsx(Hi,{className:"dsn-slider-inline-input",value:D[0],min:j,max:D[1],step:A,disabled:d,onChange:ye=>{ye!==null&&re("min",ye)},"aria-label":S})}),h.jsxs("div",{className:"dsn-slider-track",onPointerDown:ke,onPointerMove:Ue,onPointerUp:Qe,onPointerCancel:Qe,onLostPointerCapture:()=>G(!1),children:[h.jsx("div",{className:"dsn-slider-bar"}),h.jsx("div",{className:"dsn-slider-range",style:z?{width:`${P}%`}:{left:`${yt}%`,width:`${Le}%`}}),h.jsx("div",{className:"dsn-slider-handle-wrap",style:{left:`${z?P:yt}%`},children:h.jsx("div",{role:"slider",tabIndex:d?-1:0,className:"dsn-slider-handle","data-handle":z?"single":"min","data-dragging":Y&&Q===(z?"single":"min")?!0:void 0,"aria-disabled":d||void 0,"aria-valuemin":j,"aria-valuemax":z?M:D[1],"aria-valuenow":z?X:D[0],"aria-valuetext":z?ft:w(D[0]),"aria-label":z?E??"Slider value":S,"aria-labelledby":z?T:void 0,onKeyDown:vt})}),!z&&h.jsx("div",{className:"dsn-slider-handle-wrap",style:{left:`${q.maxPct}%`},children:h.jsx("div",{role:"slider",tabIndex:d?-1:0,className:"dsn-slider-handle","data-handle":"max","data-dragging":Y&&Q==="max"?!0:void 0,"aria-disabled":d||void 0,"aria-valuemin":D[0],"aria-valuemax":M,"aria-valuenow":D[1],"aria-valuetext":w(D[1]),"aria-label":N,onKeyDown:vt})})]}),r&&z&&!B&&h.jsx("div",{style:{width:`${Tt}px`},children:h.jsx(Hi,{className:"dsn-slider-inline-input",value:X,min:j,max:M,step:A,disabled:d,onChange:ye=>{ye!==null&&ee(ye)},"aria-label":E??"Slider value"})}),r&&!z&&!B&&h.jsx("div",{ref:W,style:{width:`${fr}px`},children:h.jsx(Hi,{className:"dsn-slider-inline-input",value:D[1],min:D[0],max:M,step:A,disabled:d,onChange:ye=>{ye!==null&&re("max",ye)},"aria-label":N})})]}),g&&h.jsxs("div",{className:"dsn-slider-minmax","aria-hidden":"true",children:[h.jsx("span",{children:Re}),h.jsx("span",{children:Ke})]})]})}const _M=3e3,wM=200;function kM(e){switch(e){case"success":return h.jsx(Dy,{size:16,"aria-hidden":"true"});case"warning":return h.jsx(Ry,{size:16,"aria-hidden":"true"});case"error":return h.jsx(Gd,{size:16,"aria-hidden":"true"});case"default":default:return h.jsx(Jd,{size:16,"aria-hidden":"true"})}}function SM({variant:e="inline",severity:t="default",title:n,description:r,actionLabel:i,onAction:a,dismissible:s=!0,dismissLabel:o="Dismiss notification",onDismiss:l,icon:u,className:c}){const[d,f]=_.useState(!0),[g,p]=_.useState(!1),m=_.useRef(null),v=_.useRef(null),x=_.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),y=_.useCallback(()=>{x(),!g&&(m.current=setTimeout(()=>{p(!0)},_M))},[x,g]);_.useEffect(()=>(y(),()=>{x()}),[x,y]),_.useEffect(()=>{if(g)return x(),v.current=setTimeout(()=>{f(!1),l==null||l()},wM),()=>{v.current&&(clearTimeout(v.current),v.current=null)}},[x,g,l]);const b=t==="error"?"assertive":"polite",k=t==="error"?"alert":"status",w=e==="rich"&&!!r;return d?h.jsxs("div",{className:["dsn-toast",c].filter(Boolean).join(" "),"data-severity":t,"data-variant":e,"data-state":g?"exit":"enter",role:k,"aria-live":b,"aria-atomic":"true",onMouseEnter:x,onMouseLeave:y,children:[h.jsx("span",{className:"dsn-toast-icon","aria-hidden":"true",children:u??kM(t)}),h.jsxs("div",{className:"dsn-toast-content",children:[h.jsx("div",{className:"dsn-toast-title",children:n}),w?h.jsx("div",{className:"dsn-toast-description",children:r}):null]}),i?h.jsx(be,{className:"dsn-toast-action",variant:"secondary",size:"sm",onClick:a,children:i}):null,s?h.jsx(be,{className:"dsn-toast-dismiss",variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,"aria-hidden":"true"}),"aria-label":o,onClick:()=>p(!0)}):null]}):null}function NM(e){switch(e){case"success":return h.jsx(Dy,{size:16,"aria-hidden":"true"});case"warning":return h.jsx(Ry,{size:16,"aria-hidden":"true"});case"error":return h.jsx(Gd,{size:16,"aria-hidden":"true"});case"default":default:return h.jsx(Jd,{size:16,"aria-hidden":"true"})}}function EM({severity:e="default",title:t,description:n,icon:r,content:i,actions:a,supporting:s,dismissible:o=!0,dismissLabel:l="Dismiss callout",onDismiss:u,className:c}){const d=!!i,f=!!a||!!s,g=e==="error"?"alert":"status",p=e==="error"?"assertive":"polite";return h.jsxs("section",{className:["dsn-callout",c].filter(Boolean).join(" "),"data-severity":e,role:g,"aria-live":p,"aria-atomic":"true",children:[h.jsxs("div",{className:"dsn-callout-header",children:[h.jsx("span",{className:"dsn-callout-icon","aria-hidden":"true",children:r??NM(e)}),h.jsxs("div",{className:"dsn-callout-text",children:[h.jsx("p",{className:"dsn-callout-title",children:t}),n?h.jsx("p",{className:"dsn-callout-description",children:n}):null]}),o?h.jsx(be,{className:"dsn-callout-dismiss",variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,"aria-hidden":"true"}),"aria-label":l,onClick:u}):null]}),d?h.jsx("div",{className:"dsn-callout-content",children:i}):null,f?h.jsxs("div",{className:"dsn-callout-footer",children:[h.jsx("div",{className:"dsn-callout-supporting",children:s}),h.jsx("div",{className:"dsn-callout-actions",children:a})]}):null]})}function TM({title:e,description:t,disclosure:n="left",bordered:r=!1,expanded:i,defaultExpanded:a=!1,disabled:s=!1,children:o,className:l,contentClassName:u,onExpandedChange:c}){const d=_.useId(),f=`dsn-accordion-trigger-${d}`,g=`dsn-accordion-content-${d}`,p=i!==void 0,[m,v]=_.useState(a),x=p?i:m,y=["dsn-accordion",l].filter(Boolean).join(" "),b=["dsn-accordion-content-inner",u].filter(Boolean).join(" "),k=h.jsx(Fr,{size:16,"aria-hidden":"true"});function w(N){p||v(N),c==null||c(N)}function S(){return h.jsx("span",{className:"dsn-accordion-disclosure-icon",children:k})}return h.jsxs("div",{className:y,"data-bordered":r||void 0,"data-expanded":x||void 0,"data-disclosure":n,"data-disabled":s||void 0,children:[h.jsx("button",{id:f,type:"button",className:"dsn-accordion-trigger","aria-expanded":x,"aria-controls":g,disabled:s,onClick:()=>w(!x),children:h.jsx(vr,{title:e,description:t,size:"medium",leadingControl:n==="left"?S():void 0,trailingControl:n==="right"?S():void 0,className:"dsn-accordion-section-header"})}),x&&h.jsx("div",{id:g,role:"region","aria-labelledby":f,className:"dsn-accordion-content",children:h.jsx("div",{className:b,children:o})})]})}function n0({page:e,selected:t=!1,disabled:n=!1,onClick:r,className:i}){return h.jsx("button",{type:"button",className:`dsn-page-selector${i?` ${i}`:""}`,"data-selected":t||void 0,disabled:n,"aria-current":t?"page":void 0,onClick:n?void 0:r,children:h.jsx("span",{className:"dsn-page-selector-number",children:e})})}function CM(e,t){if(t<=0)return[];const n=new Set([1,t]);for(let s=Math.max(1,e-1);s<=Math.min(t,e+1);s++)n.add(s);const r=Array.from(n).sort((s,o)=>s-o),i=[];let a=0;for(let s=0;s<r.length;s++){if(s>0){const o=r[s]-r[s-1];o===2?i.push(r[s-1]+1):o>2&&(i.push(a===0?"ellipsis-start":"ellipsis-end"),a++)}i.push(r[s])}return i}function r0({page:e,totalPages:t,onPageChange:n,totalRecords:r,pageSize:i,rowsPerPage:a,rowsPerPageOptions:s=[10,25,50,100],onRowsPerPageChange:o,className:l}){const u=CM(e,t),[c,d]=_.useState(!1),f=_.useRef(null);_.useEffect(()=>{if(!c)return;const p=m=>{f.current&&!f.current.contains(m.target)&&d(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[c]);let g=null;if(r!==void 0&&i!==void 0){const p=(e-1)*i+1,m=Math.min(e*i,r);g=`${p}–${m} of ${r}`}return h.jsxs("nav",{className:`dsn-pagination${l?` ${l}`:""}`,"aria-label":"Pagination",children:[a!==void 0&&h.jsx("div",{className:"dsn-pagination-meta",children:h.jsxs("div",{className:"dsn-pagination-rows",children:[h.jsxs("div",{ref:f,className:"dsn-pagination-rows-trigger",children:[h.jsx(be,{variant:"ghost",size:"sm",showTrailingIcon:!0,trailingIcon:h.jsx(Fr,{size:16,strokeWidth:1.5}),"aria-label":"Rows per page","aria-haspopup":"menu","aria-expanded":c,onClick:()=>d(p=>!p),children:a}),c&&h.jsx(Rr,{role:"menu","aria-label":"Rows per page options",anchorRef:f,offset:4,viewportMargin:16,contentPadding:"small",content:h.jsx("div",{children:s.map(p=>h.jsx(Ui,{label:String(p),fullWidth:!0,showLeadingIcon:!1,showTrailingIcon:a===p,selected:a===p,"aria-label":String(p),onClick:()=>{o==null||o(p),d(!1)}},p))})})]}),h.jsx("span",{className:"dsn-pagination-rows-label",children:"Rows per page"})]})}),h.jsxs("div",{className:"dsn-pagination-controls",children:[g&&h.jsx("span",{className:"dsn-pagination-summary","aria-live":"polite","aria-atomic":"true",children:g}),h.jsx(be,{variant:"ghost",size:"md",showLeadingIcon:!0,leadingIcon:h.jsx(bC,{size:16,strokeWidth:1.5}),showLabel:!1,disabled:e<=1,"aria-label":"Go to previous page","aria-disabled":e<=1,onClick:()=>n(e-1)}),h.jsx("div",{className:"dsn-pagination-pages",role:"group","aria-label":"Pages",children:u.map(p=>p==="ellipsis-start"||p==="ellipsis-end"?h.jsx(be,{variant:"ghost",size:"md",showLeadingIcon:!0,leadingIcon:h.jsx(SC,{size:16,strokeWidth:1.5}),showLabel:!1,"aria-label":"More pages",className:"dsn-pagination-ellipsis"},p):h.jsx(n0,{page:p,selected:p===e,onClick:()=>n(p)},p))}),h.jsx(be,{variant:"ghost",size:"md",showLeadingIcon:!0,leadingIcon:h.jsx(Bi,{size:16,strokeWidth:1.5}),showLabel:!1,disabled:e>=t,"aria-label":"Go to next page","aria-disabled":e>=t,onClick:()=>n(e+1)})]})]})}function jM(e,t,n){return!n||t<3?!1:e>t}function MM({items:e,maxVisibleItems:t=4,showEllipsis:n=!0,ellipsisLabel:r="...",ellipsisAriaLabel:i="Show more breadcrumbs",separator:a,className:s,"aria-label":o="Breadcrumb",onItemClick:l}){const[u,c]=_.useState(!1),d="sm",f=a??h.jsx(Bi,{size:16,"aria-hidden":"true"}),g=["dsn-breadcrumbs",s].filter(Boolean).join(" "),p=_.useMemo(()=>{const v=e.map((w,S)=>({type:"item",item:w,index:S}));if(!jM(e.length,t,n)||u)return v;const y=v[0],b=Math.max(1,t-2),k=v.slice(-b);return[y,{type:"ellipsis"},...k]},[u,e,t,n]);function m(v,x,y){var b;(b=x.onClick)==null||b.call(x,v,x,y),l==null||l(v,x,y)}return h.jsx("nav",{className:g,"aria-label":o,children:h.jsx("ol",{className:"dsn-breadcrumbs-list",children:p.map((v,x)=>{const y=x===p.length-1;if(v.type==="ellipsis")return h.jsxs("li",{className:"dsn-breadcrumbs-item",children:[h.jsx(be,{variant:"plain",size:d,"aria-label":i,onClick:()=>c(!0),children:r}),y?null:h.jsx("span",{className:"dsn-breadcrumbs-separator","aria-hidden":"true",children:f})]},`ellipsis-${x}`);const{item:b,index:k}=v,w=k===e.length-1;return h.jsxs("li",{className:"dsn-breadcrumbs-item",children:[w?h.jsx("span",{className:"dsn-breadcrumbs-current","aria-current":"page",children:b.label}):b.href&&!b.disabled?h.jsx("a",{className:"dsn-breadcrumbs-link",href:b.href,"aria-label":b.ariaLabel,onClick:S=>m(S,b,k),children:b.label}):h.jsx(be,{variant:"plain",size:d,disabled:b.disabled,"aria-label":b.ariaLabel,onClick:S=>m(S,b,k),children:b.label}),y?null:h.jsx("span",{className:"dsn-breadcrumbs-separator","aria-hidden":"true",children:f})]},b.id??`${k}-${String(b.label)}`)})})})}function OM(e,t,n){return!n||t<3?!1:e>t}function $M(e,t,n){return e.variant?e.variant:t===n-1?"current":"previous"}function i0({items:e,maxVisibleItems:t=4,showEllipsis:n=!0,ellipsisLabel:r="...",ellipsisAriaLabel:i="Show more breadcrumbs",className:a,"aria-label":s="Breadcrumb",onItemClick:o}){const[l,u]=_.useState(!1),c=["dsn-breadcrumbs dsn-breadcrumbs-controller",a].filter(Boolean).join(" "),d=_.useMemo(()=>{const g=e.map((y,b)=>({type:"item",item:y,index:b}));if(!OM(e.length,t,n)||l)return g;const m=g[0],v=Math.max(1,t-2),x=g.slice(-v);return[m,{type:"ellipsis"},...x]},[l,e,t,n]);function f(g,p,m){var v;(v=p.onClick)==null||v.call(p,g,p,m),o==null||o(g,p,m)}return h.jsx("nav",{className:c,"aria-label":s,children:h.jsx("ol",{className:"dsn-breadcrumbs-list",children:d.map((g,p)=>{const m=p===d.length-1;if(g.type==="ellipsis")return h.jsxs("li",{className:"dsn-breadcrumbs-item",children:[h.jsx("button",{type:"button",className:"dsn-breadcrumbs-controller-trigger dsn-breadcrumbs-controller-trigger-ellipsis","aria-label":i,onClick:()=>u(!0),children:h.jsx("span",{className:"dsn-breadcrumbs-controller-label",children:r})}),m?null:h.jsx("span",{className:"dsn-breadcrumbs-separator","aria-hidden":"true",children:h.jsx(Bi,{size:16})})]},`ellipsis-${p}`);const{item:v,index:x}=g,y=$M(v,x,e.length),b=y==="ellipsis"?r:v.label,k=y==="current",w=v.showDisclosure??y!=="ellipsis";return h.jsxs("li",{className:"dsn-breadcrumbs-item",children:[k?h.jsxs("span",{className:"dsn-breadcrumbs-controller-current","aria-current":"page",children:[h.jsx("span",{className:"dsn-breadcrumbs-controller-label",children:b}),w?h.jsx("span",{className:"dsn-breadcrumbs-controller-disclosure","aria-hidden":"true",children:h.jsx(Fr,{size:16})}):null]}):h.jsxs("button",{type:"button",className:"dsn-breadcrumbs-controller-trigger",disabled:v.disabled,"aria-label":v.ariaLabel,onClick:S=>f(S,v,x),children:[h.jsx("span",{className:"dsn-breadcrumbs-controller-label",children:b}),w?h.jsx("span",{className:"dsn-breadcrumbs-controller-disclosure","aria-hidden":"true",children:h.jsx(Fr,{size:16})}):null]}),m?null:h.jsx("span",{className:"dsn-breadcrumbs-separator","aria-hidden":"true",children:h.jsx(Bi,{size:16})})]},v.id??`${x}-${String(b)}`)})})})}function tu({variant:e="full",label:t="Label",showIcon:n=!0,icon:r,showAvatar:i=!1,avatarProps:a,showBadge:s=!1,badgeCount:o=3,badgeVariant:l="highlight-strong",showDisclosure:u=!1,showRightButton:c=!1,rightButton:d,selected:f=!1,disabled:g=!1,onClick:p,className:m,"aria-label":v}){const x=e==="icon",y=["dsn-sidebar-selector",m].filter(Boolean).join(" "),b=v??(x?t:void 0);return h.jsxs("div",{className:y,"data-variant":e,"data-selected":f||void 0,"data-disabled":g||void 0,children:[h.jsxs("button",{type:"button",className:"dsn-sidebar-selector-container",disabled:g,"aria-label":b,onClick:p,children:[n&&!i&&h.jsx("span",{className:"dsn-sidebar-selector-icon-wrap","aria-hidden":"true",children:r??h.jsx(mr,{})}),i&&h.jsx("span",{className:"dsn-sidebar-selector-avatar-wrap",children:h.jsx(Wi,{size:"xs",variant:"organization",fill:"initials",initials:"AA",name:"Avatar",...a})}),!x&&h.jsx("span",{className:"dsn-sidebar-selector-label-wrap",children:h.jsx("span",{className:"dsn-sidebar-selector-label",children:t})}),!x&&s&&h.jsx("span",{className:"dsn-sidebar-selector-badge-wrap",children:h.jsx(Gs,{size:"sm",variant:l,count:o})}),!x&&u&&h.jsx("span",{className:"dsn-sidebar-selector-disclosure","aria-hidden":"true",children:h.jsx(_C,{size:16})}),!x&&c&&d&&h.jsx("span",{className:"dsn-sidebar-selector-action-wrap",onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),children:d})]}),f&&h.jsx("span",{className:"dsn-sidebar-selector-rail","aria-hidden":"true"})]})}function PM({size:e="default",className:t,hasPicture:n=!0,picture:r,hasTitle:i=!0,title:a="Title",hasSubtitle:s=!0,subtitle:o="Subtitle.",hasActions:l=!0,showMainCta:u=!0,mainCtaLabel:c="Button",onMainCtaClick:d,showSecondaryOption:f=!0,secondaryOptionLabel:g="Button",onSecondaryOptionClick:p,showTertiaryOption:m=!0,tertiaryOptionLabel:v="Button",onTertiaryOptionClick:x,showLink:y=!0,linkLabel:b="Button",onLinkClick:k,showHelpText:w=!0,helpText:S="Help text"}){const N=["dsn-empty-state",t].filter(Boolean).join(" "),E=e==="small"?"sm":"md",T=u||f||m||y||w;return h.jsx("div",{className:N,"data-size":e,children:h.jsxs("div",{className:"dsn-empty-state-content",children:[n?h.jsx("div",{className:"dsn-empty-state-picture","aria-hidden":"true",children:r}):null,(i||s)&&h.jsxs("div",{className:"dsn-empty-state-copy",children:[i?h.jsx("p",{className:"dsn-empty-state-title",children:a}):null,s?h.jsx("p",{className:"dsn-empty-state-subtitle",children:o}):null]}),l&&T?h.jsxs("div",{className:"dsn-empty-state-actions",children:[u?h.jsx(be,{variant:"primary",size:E,onClick:d,children:c}):null,f?h.jsx(be,{variant:"secondary",size:E,onClick:p,children:g}):null,m?h.jsx(be,{variant:"ghost",size:E,onClick:x,children:v}):null,y?h.jsx(be,{variant:"plain",size:"sm",onClick:k,children:b}):null,w?h.jsx("p",{className:"dsn-empty-state-help-text",children:S}):null]}):null]})})}function le(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function a0(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Jn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,AM=Jn&&"documentMode"in document?document.documentMode:null,Zn=Jn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),di=Jn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),nu=!(!Jn||!("InputEvent"in window)||AM)&&"getTargetRanges"in new window.InputEvent("input"),ru=Jn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Qs=Jn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,LM=Jn&&/Android/.test(navigator.userAgent),s0=Jn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ff=Jn&&LM&&s0,iu=Jn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Zn&&!s0,DM=0,IM=1,FM=2,o0=128,zM=1,RM=2,BM=3,WM=4,UM=5,HM=6,eo=ru||Qs||iu?" ":"",au=`
|
|
280
|
+
*/const gr=je("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function VC({size:e="md",variant:t="secondary",children:n,leadingIcon:r,disabled:i=!1,loading:a=!1,triggerIcon:s,onMainClick:o,onDropdownClick:l,dropdownAriaLabel:u="More options",className:c}){const d=s??h.jsx(Fr,{size:16,strokeWidth:1.5,"aria-hidden":"true"});return h.jsxs("div",{className:`dsn-split-button${c?` ${c}`:""}`,"data-size":e,role:"group",children:[h.jsx(be,{variant:t,size:e,showLeadingIcon:r!=null,leadingIcon:r,disabled:i,loading:a,onClick:o,children:n}),h.jsx(be,{variant:t,size:e,showLabel:!1,showLeadingIcon:!0,leadingIcon:d,disabled:i||a,"aria-label":u,"aria-haspopup":"true",onClick:l})]})}function Wi({size:e="md",variant:t="profile",fill:n="initials",src:r,initials:i,icon:a,name:s,alt:o,className:l,style:u}){const c=["dsn-avatar",l].filter(Boolean).join(" "),d=s??void 0,f=s?void 0:!0,g=i?i.trim().slice(0,2).toUpperCase():void 0;return h.jsxs("div",{className:c,"data-size":e,"data-variant":t,"data-fill":n,role:"img","aria-label":d,"aria-hidden":f,style:u,children:[n==="picture"&&r&&h.jsx("img",{className:"dsn-avatar-image",src:r,alt:o??s??""}),n==="initials"&&g,n==="icon"&&h.jsx("span",{className:"dsn-avatar-icon","aria-hidden":"true",children:(()=>{const p=a??(t==="organization"?xC:qC);return h.jsx(p,{"aria-hidden":"true"})})()})]})}function KC({size:e="sm",avatars:t,maxVisible:n=5,className:r,"aria-label":i}){const a=t.slice(0,n),s=t.length-a.length,o=i??(()=>{const u=t.map(d=>d.name);return u.length<=n?u.join(", "):`${u.slice(0,n).join(", ")}, and ${s} ${s===1?"other":"others"}`})(),l=["dsn-avatar-group",r].filter(Boolean).join(" ");return h.jsxs("div",{className:l,"data-size":e,role:"group","aria-label":o,children:[a.map((u,c)=>h.jsx(Wi,{size:e,variant:u.variant??"profile",fill:u.fill??(u.src?"picture":u.initials?"initials":"icon"),src:u.src,initials:u.initials,name:u.name,style:{zIndex:c+1}},c)),s>0&&h.jsxs("span",{className:"dsn-avatar-group-overflow","aria-hidden":"true",style:{zIndex:a.length+1},children:["+",s]})]})}function Gs({size:e="sm",variant:t="highlight-soft",count:n,className:r,"aria-label":i}){const a=e==="dot",s=a?void 0:n!==void 0?n>99?"99+":String(n):void 0,o=["dsn-badge",r].filter(Boolean).join(" ");return h.jsx("span",{className:o,"data-size":e,"data-variant":t,"aria-label":i,"aria-hidden":a&&!i?!0:void 0,children:s})}function YC({title:e,value:t,variant:n="default",className:r,"aria-label":i}){const a=["dsn-stat",r].filter(Boolean).join(" ");return h.jsxs("div",{className:a,"data-variant":n,"aria-label":i,children:[h.jsx("p",{className:"dsn-stat-title",children:e}),h.jsx("p",{className:"dsn-stat-value",children:t})]})}function zr({label:e,variant:t="neutral",iconLeft:n,iconRight:r,className:i,"aria-label":a}){const s=["dsn-tag",i].filter(Boolean).join(" ");return h.jsxs("span",{className:s,"data-variant":t,role:"status","aria-label":a,children:[n&&(()=>{const o=n;return h.jsx("span",{className:"dsn-tag-icon dsn-tag-icon-left","aria-hidden":"true",children:h.jsx(o,{size:12,"aria-hidden":"true"})})})(),h.jsx("span",{className:"dsn-tag-label",children:e}),r&&(()=>{const o=r;return h.jsx("span",{className:"dsn-tag-icon dsn-tag-icon-right","aria-hidden":"true",children:h.jsx(o,{size:12,"aria-hidden":"true"})})})()]})}function Xs({label:e,selected:t=!1,disabled:n=!1,size:r="md",leadingIcon:i,trailingIcon:a,showLeadingIcon:s=!0,showTrailingIcon:o=!0,onDismiss:l,onClick:u,className:c,"aria-label":d}){const f=["dsn-chip",c].filter(Boolean).join(" ");function g(p){(p.key===" "||p.key==="Enter")&&!n&&(p.preventDefault(),u==null||u())}return h.jsxs("div",{role:"checkbox","aria-checked":t,"aria-disabled":n?!0:void 0,tabIndex:n?-1:0,className:f,"data-size":r,"data-selected":t,onClick:n?void 0:u,onKeyDown:g,"aria-label":d,children:[s&&h.jsx("span",{className:"dsn-chip-leading","aria-hidden":"true","data-icon":i?"custom":void 0,children:i&&(()=>{const p=i;return h.jsx(p,{size:12,"aria-hidden":"true"})})()}),h.jsx("span",{className:"dsn-chip-label",children:e}),l?h.jsx("button",{type:"button",className:"dsn-chip-dismiss","aria-label":`Remove ${e}`,tabIndex:n?-1:0,onClick:p=>{p.stopPropagation(),n||l()},children:h.jsx(gr,{size:12,"aria-hidden":"true"})}):o?h.jsx("span",{className:"dsn-chip-trailing","aria-hidden":"true","data-icon":a?"custom":void 0,children:a&&(()=>{const p=a;return h.jsx(p,{size:12,"aria-hidden":"true"})})()}):null]})}function Jl({label:e,children:t,className:n}){const r=["dsn-chip-group",n].filter(Boolean).join(" ");return h.jsx("div",{role:"group","aria-label":e,className:r,children:t})}const GC="https://images.unsplash.com/photo-1541701494587-cb58502866ab?auto=format&fit=crop&w=512&q=80";function XC(e){switch(e){case"xxSmall":return 12;case"xSmall":case"small":case"medium":return 16;case"large":case"xLarge":return 24;case"xxLarge":return 48;default:return 16}}function Zd({variant:e="file",size:t="xxSmall",imageSrc:n,imageAlt:r="Image thumbnail",icon:i,className:a,"aria-label":s}){const o=["dsn-file-thumbnail",a].filter(Boolean).join(" "),l=XC(t),u=n??GC;return h.jsxs("span",{className:o,"data-variant":e,"data-size":t,role:"img","aria-label":s??(e==="image"?r:"File thumbnail"),children:[e==="image"?h.jsx("img",{src:u,alt:"",className:"dsn-file-thumbnail-image","aria-hidden":"true"}):null,e==="file"?h.jsx("span",{className:"dsn-file-thumbnail-icon","aria-hidden":"true",children:i??h.jsx(Fy,{size:l,strokeWidth:1.75,"aria-hidden":"true"})}):null]})}function Da({checked:e,onChange:t,disabled:n=!1,size:r="md",id:i,className:a,"aria-label":s,"aria-labelledby":o}){const l=["dsn-switcher",a].filter(Boolean).join(" ");function u(){t==null||t(!e)}return h.jsx("button",{type:"button",role:"switch",id:i,"aria-checked":e,"aria-disabled":n?!0:void 0,disabled:n,"aria-label":s,"aria-labelledby":o,className:l,"data-size":r,"data-checked":e,onClick:u,children:h.jsx("span",{className:"dsn-switcher-track","aria-hidden":"true",children:h.jsx("span",{className:"dsn-switcher-thumb"})})})}function mr({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M8 2 L14 8 L8 14 L2 8 Z",fill:"none",stroke:"currentColor",strokeOpacity:.85,strokeWidth:"1.5",strokeLinejoin:"round"})})}function JC(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ui=_.forwardRef(function({variant:t="default",destructive:n=!1,disabled:r=!1,selected:i=!1,fullWidth:a=!1,label:s="Label",description:o="Description",descriptionRight:l="Description",showLabel:u=!0,showDescription:c=!1,showDescriptionRight:d=!1,showLeadingIcon:f=!0,leadingIcon:g,showTrailingIcon:p=!0,trailingIcon:m,showAvatar:v=!1,avatarProps:x,shortcut:y=!1,shortcutLabel:b="⌘ ↵",shortcutAriaLabel:k="Command Enter",showBadge:w=!1,badgeCount:S=1,badgeSize:N="sm",badgeVariant:E="critical",showTag:T=!1,tagLabel:C="Label",tagVariant:O="highlight",showButtons:$=!1,actionAriaLabel:j="Open actions",onActionClick:M,switcherChecked:A,onSwitcherChange:z,onClick:B,onKeyDown:R,tabIndex:H,className:F,"aria-label":L},U){const K=["dsn-menu-cell",a&&"dsn-menu-cell--full-width",F].filter(Boolean).join(" "),Y=t==="switcher",G=A??i,ne=!($||Y),se=D=>{R==null||R(D),D.target===D.currentTarget&&(r||!B||(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),B(D)))},W={className:K,"data-variant":t,"data-destructive":n||void 0,"data-selected":i||void 0,"data-disabled":r||void 0,role:"menuitem","aria-label":L,"aria-disabled":r||void 0},X=h.jsxs(h.Fragment,{children:[v&&h.jsx("span",{className:"dsn-menu-cell-avatar-wrap",children:h.jsx(Wi,{size:"xs",variant:"profile",fill:"initials",initials:"AC",name:"Avatar",...x})}),!v&&f&&h.jsx("span",{className:"dsn-menu-cell-icon-wrap","aria-hidden":"true",children:g??h.jsx(mr,{})}),u&&h.jsxs("span",{className:"dsn-menu-cell-label-wrap",children:[h.jsx("span",{className:"dsn-menu-cell-label",children:s}),c&&h.jsx("span",{className:"dsn-menu-cell-description",children:o})]}),d&&h.jsx("span",{className:"dsn-menu-cell-description-right",children:l}),w&&h.jsx("span",{className:"dsn-menu-cell-badge-wrap",children:h.jsx(Gs,{size:N,variant:E,count:S})}),T&&h.jsx("span",{className:"dsn-menu-cell-tag-wrap",children:h.jsx(zr,{size:"sm",variant:O,label:C})}),p&&h.jsx("span",{className:"dsn-menu-cell-icon-wrap","aria-hidden":"true",children:i&&!Y?h.jsx(JC,{}):m??h.jsx(mr,{})}),y&&h.jsx("span",{className:"dsn-menu-cell-shortcut-wrap",children:h.jsx(Yd,{label:b,"aria-label":k})}),$&&h.jsx("span",{className:"dsn-menu-cell-action-wrap",onClick:D=>D.stopPropagation(),onKeyDown:D=>D.stopPropagation(),children:h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(mr,{}),"aria-label":j,onClick:D=>{D.stopPropagation(),M==null||M(D)}})}),Y&&h.jsx("span",{className:"dsn-menu-cell-switcher-wrap",onClick:D=>D.stopPropagation(),onKeyDown:D=>D.stopPropagation(),children:h.jsx(Da,{size:"sm",checked:G,disabled:r,"aria-label":"Toggle option",onChange:z})})]});return ne?h.jsx("button",{type:"button",...W,ref:U,disabled:r,onClick:B,onKeyDown:R,tabIndex:H,children:X}):h.jsx("div",{...W,ref:U,tabIndex:H??(r?-1:0),onClick:r?void 0:B,onKeyDown:se,children:X})});function By(e,t){if(typeof window>"u"||typeof document>"u")return t;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e).trim(),r=Number.parseFloat(n);return Number.isFinite(r)?r:t}function Rr({header:e,segment:t,search:n,content:r,bottomBar:i,role:a="menu",width:s,contentPadding:o="none",className:l,contentClassName:u,anchorRef:c,offset:d,viewportMargin:f,matchAnchorWidth:g=!1,minWidth:p,"aria-label":m="Popover"}){const v=_.useRef(null),[x,y]=_.useState(null),b=d??By("--space-tiny",4),k=f??By("--space-medium",16),w=p??192,S=_.useCallback(()=>{if(!(c!=null&&c.current)||!v.current)return;const C=c.current.getBoundingClientRect(),O=v.current.getBoundingClientRect(),$=O.height,j=Math.max(g?C.width:O.width,w),M=j,A=window.innerHeight-C.bottom-k,z=C.top-k,B=$+b>A&&z>=$+b,R=B?C.top-$-b:C.bottom+b,H=Math.max(k,window.innerHeight-$-k),F=Math.min(Math.max(R,k),H),L=C.left,U=Math.max(k,window.innerWidth-M-k),K=Math.min(Math.max(L,k),U);y({top:F,left:K,width:g?j:void 0,placement:B?"top":"bottom"})},[c,g,w,b,k]);_.useEffect(()=>{if(!(c!=null&&c.current))return;S();const C=()=>S(),O=()=>S();return window.addEventListener("resize",C),window.addEventListener("scroll",O,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",O,!0)}},[c,S]),_.useEffect(()=>{if(!(c!=null&&c.current)||!v.current||typeof ResizeObserver>"u")return;const C=new ResizeObserver(()=>S());return C.observe(c.current),C.observe(v.current),()=>C.disconnect()},[c,S]);const N=["dsn-popover-wrapper",l].filter(Boolean).join(" "),E=["dsn-popover-wrapper-content-slot",u].filter(Boolean).join(" "),T=_.useMemo(()=>{const C={};return s!==void 0&&(C.width=s),C.minWidth=w,c!=null&&c.current&&x&&(C.position="fixed",C.top=x.top,C.left=x.left,x.width!==void 0&&s===void 0&&(C.width=x.width),C.zIndex=1e3),Object.keys(C).length>0?C:void 0},[c,x,w,s]);return h.jsxs("div",{ref:v,className:N,role:a,"aria-label":m,"data-content-padding":o,"data-placement":x==null?void 0:x.placement,style:T,children:[e&&h.jsx("div",{className:"dsn-popover-wrapper-header",children:e}),t&&h.jsx("div",{className:"dsn-popover-wrapper-segment",children:t}),n&&h.jsx("div",{className:"dsn-popover-wrapper-search",children:n}),h.jsx("div",{className:"dsn-popover-wrapper-content",children:h.jsx("div",{className:E,children:r})}),i&&h.jsx("div",{className:"dsn-popover-wrapper-bottom-bar",children:i})]})}const ZC=[{id:"download",label:"Download",icon:h.jsx(Iy,{size:16,"aria-hidden":"true"})},{id:"rename",label:"Rename",icon:h.jsx(OC,{size:16,"aria-hidden":"true"})},{id:"details",label:"Details",icon:h.jsx(Jd,{size:16,"aria-hidden":"true"})}];function Qd({fileName:e,fileSize:t,previewVariant:n="file",previewSrc:r,size:i="md",disabled:a=!1,loading:s=!1,action:o="none",menuOptions:l=ZC,onMenuSelect:u,onRemove:c,className:d,"aria-label":f}){const p=`dsn-attachment-chip-menu-${_.useId()}`,m=_.useRef(null),v=_.useRef(null),[x,y]=_.useState(!1),b=o==="more"&&!a&&!s;return _.useEffect(()=>{if(!x)return;const k=S=>{var N;(N=m.current)!=null&&N.contains(S.target)||y(!1)},w=S=>{var N;S.key==="Escape"&&(y(!1),(N=v.current)==null||N.focus())};return document.addEventListener("mousedown",k),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",w)}},[x]),h.jsxs("div",{ref:m,className:["dsn-attachment-chip",d].filter(Boolean).join(" "),"data-size":i,"data-disabled":a||void 0,"data-loading":s||void 0,role:"group","aria-label":f??e,children:[h.jsxs("div",{className:"dsn-attachment-chip-content",children:[h.jsx("span",{className:"dsn-attachment-chip-preview","aria-hidden":"true",children:s?h.jsx(jC,{size:16,className:"dsn-attachment-chip-spinner"}):h.jsx(Zd,{variant:n,imageSrc:r,size:"xSmall","aria-label":`${n} preview`})}),h.jsxs("span",{className:"dsn-attachment-chip-label-wrap",children:[h.jsx("span",{className:"dsn-attachment-chip-label",children:e}),h.jsx("span",{className:"dsn-attachment-chip-meta",children:t})]})]}),o==="remove"&&h.jsx("button",{type:"button",disabled:a||s,"aria-label":`Remove ${e}`,className:"dsn-attachment-chip-action",onClick:c,children:h.jsx(gr,{size:16,"aria-hidden":"true"})}),o==="more"&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",disabled:a||s,"aria-label":`More options for ${e}`,"aria-haspopup":"menu","aria-controls":x?p:void 0,className:"dsn-attachment-chip-action",onClick:()=>{b&&y(k=>!k)},ref:v,children:h.jsx(Xd,{size:16,"aria-hidden":"true"})}),x&&b&&h.jsx(Rr,{role:"menu","aria-label":"Attachment options",contentPadding:"small",className:"dsn-attachment-chip-popover",contentClassName:"dsn-attachment-chip-menu",anchorRef:v,matchAnchorWidth:!0,content:h.jsx("div",{id:p,children:l.map(k=>h.jsx(Ui,{className:"dsn-attachment-chip-menu-item",label:k.label,showLeadingIcon:!!k.icon,leadingIcon:k.icon,showTrailingIcon:!1,disabled:k.disabled,onClick:()=>{var w;k.disabled||(u==null||u(k.id),y(!1),(w=v.current)==null||w.focus())}},k.id))})})]})]})}function QC(e){return e>=1024*1024*1024?`${Math.round(e/(1024*1024*1024)*10)/10} GB`:e>=1024*1024?`${Math.round(e/(1024*1024)*10)/10} MB`:e>=1024?`${Math.round(e/1024*10)/10} KB`:`${e} B`}function ej({id:e,label:t="Label",showLabel:n=!0,helperText:r="Help text",showHelpText:i=!0,error:a=!1,errorMessage:s="File extends size limit",disabled:o=!1,loading:l=!1,accept:u,uploadButtonLabel:c="Upload file",value:d,defaultValue:f=null,onChange:g,className:p,"aria-label":m}){const v=_.useId(),x=e??`dsn-attachment-field-${v}`,y=`${x}-helper`,b=_.useRef(null),k=d!==void 0,[w,S]=_.useState(f),N=k?d??null:w,[E,T]=_.useState(void 0);_.useEffect(()=>{if(!N||!N.type.startsWith("image/")){T(void 0);return}const j=URL.createObjectURL(N);return T(j),()=>URL.revokeObjectURL(j)},[N]);const C=a?s:r,O=_.useMemo(()=>N?QC(N.size):"",[N]);function $(j){k||S(j),g==null||g(j)}return h.jsxs("div",{className:["dsn-attachment-field",p].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-error":a||void 0,children:[n&&h.jsx("p",{className:"dsn-attachment-field-label",children:t}),h.jsxs("div",{className:"dsn-attachment-field-control",children:[N?h.jsx(Qd,{fileName:N.name,fileSize:O,previewVariant:N.type.startsWith("image/")?"image":"file",previewSrc:E,loading:l,disabled:o,action:"remove",onRemove:o||l?void 0:()=>{$(null),b.current&&(b.current.value="")},"aria-label":N.name}):h.jsx(be,{variant:"secondary",size:"md",disabled:o,showLeadingIcon:!0,leadingIcon:h.jsx(HC,{size:16,"aria-hidden":"true"}),onClick:()=>{var j;return(j=b.current)==null?void 0:j.click()},"aria-label":m??c,children:c}),h.jsx("input",{ref:b,id:x,className:"dsn-attachment-field-native",type:"file",disabled:o,accept:u,"aria-label":m??c,"aria-describedby":i&&C?y:void 0,onChange:j=>{var A;const M=((A=j.target.files)==null?void 0:A[0])??null;$(M)}})]}),i&&C&&h.jsx("p",{id:y,className:"dsn-attachment-field-helper",children:C})]})}const ef=15,Wy=2*Math.PI*ef,tj="70.7 23.6";function Uy({value:e,size:t="lg",label:n,className:r}){const i=e!==void 0,a=i?Math.min(100,Math.max(0,e)):void 0,s=i?Wy*(1-a/100):void 0,o=["dsn-progress-ring",r].filter(Boolean).join(" "),l=i?"progressbar":"status";return h.jsx("div",{role:l,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,"aria-label":n,"aria-live":"polite",className:o,"data-size":t,"data-mode":i?"determinate":"indeterminate",children:h.jsxs("svg",{viewBox:"0 0 36 36","aria-hidden":"true",focusable:"false",children:[i&&h.jsx("circle",{className:"dsn-progress-ring-track",cx:"18",cy:"18",r:ef,fill:"none",strokeWidth:"3"}),h.jsx("circle",{className:"dsn-progress-ring-fill",cx:"18",cy:"18",r:ef,fill:"none",strokeWidth:"3",strokeLinecap:"round",transform:"rotate(-90 18 18)",strokeDasharray:i?Wy:tj,strokeDashoffset:s})]})})}function nj({variant:e="file",descriptionPosition:t="outside",loading:n=!1,title:r="Title",metaData:i="Meta data",hasMetadata:a=!0,showDescription:s=!0,imageSrc:o,imageAlt:l="Attachment preview",action:u="remove",showActionOnHover:c=!1,onActionClick:d,className:f,"aria-label":g}){const p=["dsn-attachment-card",f].filter(Boolean).join(" "),m=u!=="none",v=u==="more"?`More options for ${r}`:`Remove ${r}`;return h.jsxs("article",{className:p,"data-variant":e,"data-description-position":t,"data-loading":n||void 0,"data-show-action-on-hover":c||void 0,"aria-label":g??r,children:[h.jsxs("div",{className:"dsn-attachment-card-thumbnail",children:[e==="picture"&&o?h.jsx("img",{src:o,alt:l,className:"dsn-attachment-card-image"}):null,e==="file"&&!n&&h.jsx("span",{className:"dsn-attachment-card-file-icon","aria-hidden":"true",children:h.jsx(Fy,{size:32,strokeWidth:1.75})}),n&&h.jsx("span",{className:"dsn-attachment-card-loading",children:h.jsx(Uy,{size:"lg",label:`Loading ${r}`})}),m&&h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:u==="more"?h.jsx(Xd,{size:16,"aria-hidden":"true"}):h.jsx(gr,{size:16,"aria-hidden":"true"}),className:"dsn-attachment-card-action",onClick:d,"aria-label":v,"aria-haspopup":u==="more"?"menu":void 0}),s&&t==="inside"&&h.jsxs("div",{className:"dsn-attachment-card-info dsn-attachment-card-info--inside",children:[h.jsx("p",{className:"dsn-attachment-card-title",children:r}),a&&h.jsx("p",{className:"dsn-attachment-card-meta",children:i})]})]}),s&&t==="outside"&&h.jsxs("div",{className:"dsn-attachment-card-info dsn-attachment-card-info--outside",children:[h.jsx("p",{className:"dsn-attachment-card-title",children:r}),a&&h.jsx("p",{className:"dsn-attachment-card-meta",children:i})]})]})}function Hy(e,t){if(typeof window>"u"||typeof document>"u")return t;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e).trim(),r=Number.parseFloat(n);return Number.isFinite(r)?r:t}function rj(e,t,n){return n?e:e?`${e} ${t}`:t}function tf({content:e,children:t,placement:n="top",delay:r=150,open:i,defaultOpen:a=!1,disabled:s=!1,className:o,id:l}){const u=_.useId(),c=l??`dsn-tooltip-${u}`,d=_.useRef(null),f=_.useRef(null),g=_.useRef(null),p=_.useRef(null),m=i!==void 0,[v,x]=_.useState(a),[y,b]=_.useState(null),k=s?!1:m?i:v,w=C=>{m||x(C)},S=()=>{p.current&&(clearTimeout(p.current),p.current=null)},N=()=>{s||(S(),p.current=setTimeout(()=>w(!0),r))},E=()=>{S(),w(!1)};_.useEffect(()=>()=>S(),[]),_.useEffect(()=>{if(!k)return;const C=O=>{O.key==="Escape"&&w(!1)};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[k]),_.useEffect(()=>{if(!k||!f.current||!g.current)return;const C=Hy("--space-small",8),O=Hy("--space-tiny",4),$=()=>{if(!f.current||!g.current)return;const A=f.current.getBoundingClientRect(),z=g.current.getBoundingClientRect(),B=z.width,R=z.height,H=A.left+A.width/2,F=A.top-R-O,L=F>=C,U=L?"top":"bottom",K=L?F:A.bottom+O,Y=Math.max(C,window.innerHeight-R-C),G=Math.min(Math.max(K,C),Y),Q=H-B/2,ne=Math.max(C,window.innerWidth-B-C),se=Math.min(Math.max(Q,C),ne);b({top:G,left:se,placement:U})};$();const j=window.requestAnimationFrame($),M=typeof ResizeObserver<"u"?new ResizeObserver(()=>$()):null;return M&&(M.observe(f.current),M.observe(g.current)),window.addEventListener("resize",$),window.addEventListener("scroll",$,!0),()=>{window.cancelAnimationFrame(j),M==null||M.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)}},[k]);const T=_.cloneElement(t,{"aria-describedby":rj(t.props["aria-describedby"],c,s)});return h.jsxs("span",{ref:d,className:["dsn-tooltip",o].filter(Boolean).join(" "),onMouseEnter:N,onMouseLeave:E,onFocus:N,onBlur:C=>{var $;const O=C.relatedTarget;O&&(($=d.current)!=null&&$.contains(O))||E()},children:[h.jsx("span",{ref:f,className:"dsn-tooltip-trigger",children:T}),h.jsx("span",{ref:g,id:c,role:"tooltip",className:"dsn-tooltip-bubble","data-placement":(y==null?void 0:y.placement)??n,hidden:!k,style:y?{top:y.top,left:y.left}:void 0,children:e})]})}function qy({value:e,label:t,className:n}){const r=Math.min(100,Math.max(0,e)),i=r===0?"0px":`calc(${r}% + 2px)`,a=["dsn-progress-bar",n].filter(Boolean).join(" ");return h.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r,"aria-label":t,className:a,children:h.jsx("div",{className:"dsn-progress-bar-track",children:h.jsx("div",{className:"dsn-progress-bar-fill",style:{width:i}})})})}function ij({fileName:e="File name",fileType:t="PDF",fileSize:n="10 Mb",previewVariant:r="image",previewSrc:i,state:a="default",uploadProgress:s=40,className:o,onCopyLink:l,onDownload:u,onCancelUpload:c,"aria-label":d}){const f=a==="uploading",g=["dsn-file-row",o].filter(Boolean).join(" ");return h.jsxs("article",{className:g,"data-state":a,"aria-label":d??e,children:[h.jsx("div",{className:"dsn-file-row-thumbnail",children:h.jsx(Zd,{variant:r,imageSrc:i,size:"large","aria-label":`${r} preview`})}),h.jsxs("div",{className:"dsn-file-row-content",children:[h.jsxs("div",{className:"dsn-file-row-title-wrap",children:[h.jsx("p",{className:"dsn-file-row-title",children:e}),f&&h.jsx(be,{variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,"aria-hidden":"true"}),className:"dsn-file-row-action-btn","aria-label":`Cancel upload for ${e}`,onClick:c})]}),!f&&h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"dsn-file-row-meta",children:[h.jsx("span",{children:t}),h.jsx("span",{"aria-hidden":"true",children:"•"}),h.jsx("span",{children:n})]}),h.jsxs(ui,{size:"sm",spaceBetween:!0,className:"dsn-file-row-actions","aria-label":`Actions for ${e}`,children:[h.jsx(tf,{content:"Copy link",children:h.jsx(be,{variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(zy,{size:16,"aria-hidden":"true"}),className:"dsn-file-row-action-btn","aria-label":`Copy link for ${e}`,onClick:l})}),h.jsx(tf,{content:"Download",children:h.jsx(be,{variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(Iy,{size:16,"aria-hidden":"true"}),className:"dsn-file-row-action-btn","aria-label":`Download ${e}`,onClick:u})})]})]}),f&&h.jsx("div",{className:"dsn-file-row-progress",children:h.jsx(qy,{value:s,label:`Uploading ${e}`})})]})]})}function nf({direction:e="horizontal",decorative:t=!1,className:n}){const r=["dsn-separator",n].filter(Boolean).join(" ");return e==="horizontal"?h.jsx("hr",{className:r,"data-direction":"horizontal","aria-hidden":t?!0:void 0}):h.jsx("div",{role:"separator","aria-orientation":"vertical",className:r,"data-direction":"vertical","aria-hidden":t?!0:void 0})}function aj({value:e,label:t,className:n}){const r=e!==void 0,i=r?Math.min(100,Math.max(0,e)):void 0,a=["dsn-loading-bar",n].filter(Boolean).join(" ");return h.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,"aria-label":t,"aria-live":"polite",className:a,"data-mode":r?"determinate":"indeterminate",children:h.jsx("div",{className:"dsn-loading-bar-fill",style:r?{width:`${i}%`}:void 0})})}function sj({type:e="avatar",className:t}){const n=["dsn-skeleton-loading",t].filter(Boolean).join(" ");return h.jsx("div",{className:n,"data-type":e,"aria-hidden":"true",children:h.jsx("div",{className:"dsn-skeleton-loading-glow"})})}function oj(){return h.jsx("svg",{width:"9",height:"7",viewBox:"0 0 9 7",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M0.625 3.125L3.125 5.625L8.125 0.625",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function lj(){return h.jsx("svg",{width:"8",height:"2",viewBox:"0 0 8 2",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M0.5 1H7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function Xn({size:e="md",checked:t=!1,indeterminate:n=!1,disabled:r=!1,label:i="Label",description:a="Description",descriptionRight:s="Assist label",showContent:o=!0,showLabel:l=!0,showDescription:u=!1,showDescriptionRight:c=!1,showAvatar:d=!1,avatarProps:f,showLeadingIcon:g=!1,leadingIcon:p,showTrailingIcon:m=!0,trailingIcon:v,showBadge:x=!1,badgeCount:y=1,badgeSize:b="sm",badgeVariant:k="critical",showTag:w=!1,tagLabel:S="Label",tagVariant:N="error",showButtons:E=!1,actionAriaLabel:T="Open actions",onActionClick:C,showSwitcherRight:O=!1,switcherChecked:$=!1,onSwitcherChange:j,onCheckedChange:M,className:A,"aria-label":z}){const B=["dsn-checkbox",A].filter(Boolean).join(" "),R=n?"mixed":t?"true":"false";function H(){r||M==null||M(!t)}function F(L){L.target===L.currentTarget&&L.key===" "&&(L.preventDefault(),H())}return h.jsxs("div",{className:B,"data-size":e,"data-has-content":o||void 0,"data-disabled":r||void 0,"data-checked":t||void 0,"data-indeterminate":n||void 0,role:"checkbox","aria-checked":R,"aria-disabled":r||void 0,"aria-label":z,tabIndex:r?-1:0,onClick:r?void 0:H,onKeyDown:F,children:[h.jsx("span",{className:"dsn-checkbox-indicator-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-checkbox-indicator",children:(t||n)&&h.jsx("span",{className:"dsn-checkbox-mark",children:n?h.jsx(lj,{}):h.jsx(oj,{})})})}),o&&h.jsxs("span",{className:"dsn-checkbox-content",children:[d&&h.jsx("span",{className:"dsn-checkbox-avatar-wrap",children:h.jsx(Wi,{size:"xs",variant:"profile",fill:"initials",initials:"AC",name:"Avatar",...f})}),g&&h.jsx("span",{className:"dsn-checkbox-icon-wrap","aria-hidden":"true",children:p??h.jsx(mr,{})}),l&&h.jsxs("span",{className:"dsn-checkbox-label-wrap",children:[h.jsx("span",{className:"dsn-checkbox-label",children:i}),u&&h.jsx("span",{className:"dsn-checkbox-description",children:a})]}),c&&h.jsx("span",{className:"dsn-checkbox-description-right",children:s}),x&&h.jsx("span",{className:"dsn-checkbox-badge-wrap",children:h.jsx(Gs,{size:b,variant:k,count:y})}),w&&h.jsx("span",{className:"dsn-checkbox-tag-wrap",children:h.jsx(zr,{size:"sm",variant:N,label:S})}),m&&h.jsx("span",{className:"dsn-checkbox-icon-wrap","aria-hidden":"true",children:v??h.jsx(mr,{})}),E&&h.jsx("span",{className:"dsn-checkbox-action-wrap",onClick:L=>L.stopPropagation(),onKeyDown:L=>L.stopPropagation(),children:h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(mr,{}),"aria-label":T,onClick:L=>{L.stopPropagation(),C==null||C(L)}})}),O&&h.jsx("span",{className:"dsn-checkbox-switcher-wrap",onClick:L=>L.stopPropagation(),onKeyDown:L=>L.stopPropagation(),children:h.jsx(Da,{size:"sm",checked:$,disabled:r,"aria-label":"Toggle option",onChange:j})})]})]})}function rf({size:e="md",checked:t=!1,disabled:n=!1,label:r="Label",description:i="Description",descriptionRight:a="Assist label",showContent:s=!0,showLabel:o=!0,showDescription:l=!1,showDescriptionRight:u=!1,showAvatar:c=!1,avatarProps:d,showLeadingIcon:f=!1,leadingIcon:g,showTrailingIcon:p=!0,trailingIcon:m,showBadge:v=!1,badgeCount:x=1,badgeSize:y="sm",badgeVariant:b="critical",showTag:k=!1,tagLabel:w="Label",tagVariant:S="error",showButtons:N=!1,actionAriaLabel:E="Open actions",onActionClick:T,showSwitcherRight:C=!1,switcherChecked:O=!1,onSwitcherChange:$,onCheckedChange:j,className:M,"aria-label":A}){const z=["dsn-radio",M].filter(Boolean).join(" ");function B(){n||t||j==null||j(!0)}function R(H){H.target===H.currentTarget&&H.key===" "&&(H.preventDefault(),B())}return h.jsxs("div",{className:z,"data-size":e,"data-has-content":s||void 0,"data-disabled":n||void 0,"data-checked":t||void 0,role:"radio","aria-checked":t?"true":"false","aria-disabled":n||void 0,"aria-label":A,tabIndex:n?-1:0,onClick:n?void 0:B,onKeyDown:R,children:[h.jsx("span",{className:"dsn-radio-indicator-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-radio-indicator",children:h.jsx("span",{className:"dsn-radio-dot"})})}),s&&h.jsxs("span",{className:"dsn-radio-content",children:[c&&h.jsx("span",{className:"dsn-radio-avatar-wrap",children:h.jsx(Wi,{size:"xs",variant:"profile",fill:"initials",initials:"AC",name:"Avatar",...d})}),f&&h.jsx("span",{className:"dsn-radio-icon-wrap","aria-hidden":"true",children:g??h.jsx(mr,{})}),o&&h.jsxs("span",{className:"dsn-radio-label-wrap",children:[h.jsx("span",{className:"dsn-radio-label",children:r}),l&&h.jsx("span",{className:"dsn-radio-description",children:i})]}),u&&h.jsx("span",{className:"dsn-radio-description-right",children:a}),v&&h.jsx("span",{className:"dsn-radio-badge-wrap",children:h.jsx(Gs,{size:y,variant:b,count:x})}),k&&h.jsx("span",{className:"dsn-radio-tag-wrap",children:h.jsx(zr,{size:"sm",variant:S,label:w})}),p&&h.jsx("span",{className:"dsn-radio-icon-wrap","aria-hidden":"true",children:m??h.jsx(mr,{})}),N&&h.jsx("span",{className:"dsn-radio-action-wrap",onClick:H=>H.stopPropagation(),onKeyDown:H=>H.stopPropagation(),children:h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(mr,{}),"aria-label":E,onClick:H=>{H.stopPropagation(),T==null||T(H)}})}),C&&h.jsx("span",{className:"dsn-radio-switcher-wrap",onClick:H=>H.stopPropagation(),onKeyDown:H=>H.stopPropagation(),children:h.jsx(Da,{size:"sm",checked:O,disabled:n,"aria-label":"Toggle option",onChange:$})})]})]})}function uj({id:e,label:t,placeholder:n,value:r,defaultValue:i,disabled:a=!1,error:s=!1,required:o=!1,helperText:l,errorMessage:u,maxLength:c,leadingIcon:d,trailingIcon:f,helperIcon:g,onChange:p,onBlur:m,onFocus:v,"aria-label":x,"aria-labelledby":y,autoComplete:b,name:k,className:w}){const S=_.useId(),N=e??`dsn-text-input-${S}`,E=`${N}-helper`,C=!!l||s&&!!u?E:void 0,[O,$]=_.useState(()=>(r??i??"").length),j=r!==void 0?r.length:O;function M(R){r===void 0&&$(R.target.value.length),p==null||p(R)}const A=!!l||s&&!!u||c!==void 0,z=f!=null&&c===void 0,B=s&&u?u:l;return h.jsxs("div",{className:`dsn-text-input${w?` ${w}`:""}`,"data-error":s||void 0,"data-disabled":a||void 0,children:[t&&h.jsxs("label",{className:"dsn-text-input-label",htmlFor:N,children:[t,o&&h.jsxs("span",{className:"dsn-text-input-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-text-input-control",children:[d&&h.jsx("span",{className:"dsn-text-input-icon","aria-hidden":"true",children:d}),h.jsx("input",{type:"text",id:N,className:"dsn-text-input-field",placeholder:n,value:r,defaultValue:i,disabled:a,maxLength:c,"aria-invalid":s||void 0,"aria-required":o||void 0,"aria-describedby":C,"aria-label":x,"aria-labelledby":y,autoComplete:b,name:k,onChange:M,onBlur:m,onFocus:v}),z&&h.jsx("span",{className:"dsn-text-input-icon","aria-hidden":"true",children:f})]}),A&&h.jsxs("div",{className:"dsn-text-input-meta",children:[h.jsxs("div",{className:"dsn-text-input-helper-inner",children:[g&&h.jsx("span",{className:"dsn-text-input-icon","aria-hidden":"true",children:g}),B!==void 0&&h.jsx("p",{id:E,className:"dsn-text-input-helper",children:B})]}),c!==void 0&&h.jsxs("span",{className:"dsn-text-input-count","aria-live":"polite","aria-atomic":"true",children:[j,"/",c]})]})]})}function cj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function dj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M8 3V13M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function af(e,t,n){let r=e;return t!==void 0&&(r=Math.max(t,r)),n!==void 0&&(r=Math.min(n,r)),r}function Hi({id:e,label:t,placeholder:n,value:r,defaultValue:i,min:a,max:s,step:o=1,disabled:l=!1,error:u=!1,required:c=!1,helperText:d,errorMessage:f,helperIcon:g,onChange:p,onBlur:m,onFocus:v,"aria-label":x,"aria-labelledby":y,name:b,className:k}){const w=_.useId(),S=e??`dsn-number-input-${w}`,N=`${S}-helper`,T=!!d||u&&!!f?N:void 0,[C,O]=_.useState(()=>i!==void 0?String(i):""),$=r!==void 0?String(r):C,j=r!==void 0?r:C!==""?parseFloat(C):NaN,M=l||a!==void 0&&!isNaN(j)&&j<=a,A=l||s!==void 0&&!isNaN(j)&&j>=s;function z(U){const K=U.target.value;if(r===void 0&&O(K),K===""||K==="-")p==null||p(null);else{const Y=parseFloat(K);isNaN(Y)||p==null||p(Y)}}function B(U){const K=parseFloat($);if(!isNaN(K)){const Y=af(K,a,s);if(Y!==K){const G=String(Y);r===void 0&&O(G),p==null||p(Y)}}m==null||m(U)}function R(){if(l||M)return;const U=isNaN(j)?a??0:j,K=af(U-o,a,s);r===void 0&&O(String(K)),p==null||p(K)}function H(){if(l||A)return;const U=isNaN(j)?a??0:j,K=af(U+o,a,s);r===void 0&&O(String(K)),p==null||p(K)}const F=!!d||u&&!!f,L=u&&f?f:d;return h.jsxs("div",{className:`dsn-number-input${k?` ${k}`:""}`,"data-error":u||void 0,"data-disabled":l||void 0,children:[t&&h.jsxs("label",{className:"dsn-number-input-label",htmlFor:S,children:[t,c&&h.jsxs("span",{className:"dsn-number-input-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-number-input-control",children:[h.jsx("input",{type:"text",inputMode:"numeric",id:S,className:"dsn-number-input-field",value:$,placeholder:n,disabled:l,name:b,"aria-invalid":u||void 0,"aria-required":c||void 0,"aria-describedby":T,"aria-label":x,"aria-labelledby":y,onChange:z,onBlur:B,onFocus:v}),h.jsxs("div",{className:"dsn-number-input-stepper",role:"group","aria-label":"Adjust value",children:[h.jsx("button",{type:"button",className:"dsn-number-input-btn","aria-label":"Decrease value",disabled:M,onClick:R,tabIndex:l?-1:void 0,children:h.jsx(cj,{})}),h.jsx("button",{type:"button",className:"dsn-number-input-btn","aria-label":"Increase value",disabled:A,onClick:H,tabIndex:l?-1:void 0,children:h.jsx(dj,{})})]})]}),F&&h.jsx("div",{className:"dsn-number-input-meta",children:h.jsxs("div",{className:"dsn-number-input-helper-inner",children:[g&&h.jsx("span",{className:"dsn-number-input-icon","aria-hidden":"true",children:g}),L!==void 0&&h.jsx("p",{id:N,className:"dsn-number-input-helper",children:L})]})})]})}function fj(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("rect",{x:"2.5",y:"7.5",width:"11",height:"7",rx:"1.5",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("path",{d:"M5.5 7.5V5.5a2.5 2.5 0 0 1 5 0v2",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function hj(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M1.5 8C2.5 5.5 5 3.5 8 3.5S13.5 5.5 14.5 8 12 12.5 8 12.5 2.5 10.5 1.5 8Z",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("circle",{cx:"8",cy:"8",r:"2",stroke:"currentColor",strokeWidth:"1.25"})]})}function pj(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M2 2.5L14 13.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M6.5 6.8A2 2 0 0 0 8 10a2 2 0 0 0 1.5-.7M4.2 4.7C2.7 5.8 1.5 8 1.5 8s2 4.5 6.5 4.5c1.2 0 2.2-.3 3-.8M8 3.5c4 0 6.5 4.5 6.5 4.5s-.5 1-1.5 2",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function gj({id:e,label:t,placeholder:n,value:r,defaultValue:i,disabled:a=!1,error:s=!1,required:o=!1,helperText:l,errorMessage:u,helperIcon:c,trailingIcon:d,labelAction:f,autoComplete:g="current-password",name:p,className:m,onChange:v,onBlur:x,onFocus:y,"aria-label":b,"aria-labelledby":k}){const w=_.useId(),S=e??`dsn-password-input-${w}`,N=`${S}-helper`,[E,T]=_.useState(!1),C=s&&u?u:l,O=!!l||s&&!!u,$=O?N:void 0,j=O;return h.jsxs("div",{className:`dsn-password-input${m?` ${m}`:""}`,"data-error":s||void 0,"data-disabled":a||void 0,children:[t&&h.jsxs("div",{className:"dsn-password-input-label-row",children:[h.jsxs("label",{className:"dsn-password-input-label",htmlFor:S,children:[t,o&&h.jsxs("span",{className:"dsn-password-input-required","aria-hidden":"true",children:[" ","*"]})]}),f&&h.jsx("span",{className:"dsn-password-input-label-action",children:f})]}),h.jsxs("div",{className:"dsn-password-input-control",children:[h.jsx("span",{className:"dsn-password-input-lock","aria-hidden":"true",children:h.jsx(fj,{})}),h.jsx("input",{type:E?"text":"password",id:S,className:"dsn-password-input-field",placeholder:n,value:r,defaultValue:i,disabled:a,"aria-invalid":s||void 0,"aria-required":o||void 0,"aria-describedby":$,"aria-label":b,"aria-labelledby":k,autoComplete:g,name:p,onChange:v,onBlur:x,onFocus:y}),d&&h.jsx("span",{className:"dsn-password-input-trailing","aria-hidden":"true",children:d}),h.jsx("button",{type:"button",className:"dsn-password-input-toggle","aria-label":E?"Hide password":"Show password","aria-pressed":E,onClick:()=>T(M=>!M),disabled:a,tabIndex:a?-1:void 0,children:E?h.jsx(pj,{}):h.jsx(hj,{})})]}),j&&h.jsx("div",{className:"dsn-password-input-meta",children:h.jsxs("div",{className:"dsn-password-input-helper-inner",children:[c&&h.jsx("span",{className:"dsn-password-input-icon","aria-hidden":"true",children:c}),h.jsx("p",{id:N,className:"dsn-password-input-helper",children:C})]})})]})}function mj(){return h.jsx("span",{className:"dsn-pw-req-radio","aria-hidden":"true"})}function vj(){return h.jsxs("svg",{className:"dsn-pw-req-check",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:"6.5",fill:"var(--surface-toggle-on)"}),h.jsx("path",{d:"M5.5 8.5l1.75 1.75L10.5 6.5",stroke:"white",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function yj({label:e,met:t,className:n}){return h.jsxs("div",{className:`dsn-pw-requirement${n?` ${n}`:""}`,"data-met":t||void 0,role:"status","aria-label":`${e}: ${t?"satisfied":"not satisfied"}`,children:[t?h.jsx(vj,{}):h.jsx(mj,{}),h.jsx("span",{className:"dsn-pw-requirement-label",children:e})]})}function xj({length:e=6,value:t,defaultValue:n,status:r="idle",disabled:i=!1,label:a,labelAction:s,helperText:o,helperIcon:l,errorMessage:u,onChange:c,onComplete:d,"aria-label":f,className:g}){const v=`${`dsn-otp-${_.useId()}`}-status`,[x,y]=_.useState(()=>{const j=(t??n??"").slice(0,e);return Array.from({length:e},(M,A)=>j[A]??"")});_.useEffect(()=>{t!==void 0&&y(Array.from({length:e},(j,M)=>t[M]??""))},[t,e]);const b=_.useRef([]),k=!i&&r!=="verifying"&&r!=="correct";function w(j){y(j);const M=j.join("");c==null||c(M),j.every(A=>A!=="")&&(d==null||d(M))}function S(j,M){var R;const z=M.target.value.replace(/[^0-9]/g,"").slice(-1),B=[...x];B[j]=z,w(B),z&&j<e-1&&((R=b.current[j+1])==null||R.focus())}function N(j,M){var A,z,B;if(M.key==="Backspace"){M.preventDefault();const R=[...x];R[j]?(R[j]="",w(R)):j>0&&(R[j-1]="",w(R),(A=b.current[j-1])==null||A.focus())}else M.key==="ArrowLeft"&&j>0?(M.preventDefault(),(z=b.current[j-1])==null||z.focus()):M.key==="ArrowRight"&&j<e-1&&(M.preventDefault(),(B=b.current[j+1])==null||B.focus())}function E(j){j.target.select()}function T(j){var H;j.preventDefault();const M=j.clipboardData.getData("text").replace(/[^0-9]/g,"").slice(0,e);if(!M)return;const A=[...x];for(let F=0;F<M.length;F++)A[F]=M[F];y(A);const z=A.join("");c==null||c(z);const B=A.findIndex(F=>F===""),R=B===-1?e-1:B;(H=b.current[R])==null||H.focus(),A.every(F=>F!=="")&&(d==null||d(z))}function C(){return r==="verifying"?"Verifying code…":r==="correct"?"Verification successful":r==="error"?u??"Verification failed":""}const O=r==="error"&&u?u:o,$=!!O;return h.jsxs("div",{className:`dsn-otp${g?` ${g}`:""}`,"data-status":r!=="idle"?r:void 0,"data-disabled":i||void 0,children:[(a||s)&&h.jsxs("div",{className:"dsn-otp-label-row",children:[a&&h.jsx("span",{className:"dsn-otp-label",children:a}),s&&h.jsx("span",{className:"dsn-otp-label-action",children:s})]}),h.jsx("div",{className:"dsn-otp-stack",role:"group","aria-label":f??`Enter ${e}-digit verification code`,"aria-describedby":r!=="idle"?v:void 0,children:x.map((j,M)=>h.jsx("input",{ref:A=>{b.current[M]=A},className:"dsn-otp-cell",type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:M===0?"one-time-code":"off",maxLength:1,value:j,disabled:!k,"aria-label":`Digit ${M+1} of ${e}`,onChange:A=>S(M,A),onKeyDown:A=>N(M,A),onFocus:E,onPaste:T},M))}),h.jsx("div",{id:v,role:"status","aria-live":"polite","aria-atomic":"true",className:"dsn-otp-sr-only",children:C()}),$&&h.jsxs("div",{className:"dsn-otp-helper-row",children:[l&&h.jsx("span",{className:"dsn-otp-helper-icon","aria-hidden":"true",children:l}),h.jsx("p",{className:"dsn-otp-helper",children:O})]})]})}const Vy=[{label:"United States (+1)",value:"+1"},{label:"Portugal (+351)",value:"+351"},{label:"United Kingdom (+44)",value:"+44"},{label:"Germany (+49)",value:"+49"}];function Zl(e){return e.replace(/\s+/g,"").replace(/^\+/,"")}function bj(e,t){const n=e.trim();if(!n.startsWith("+"))return null;const i=n.replace(/[^\d+]/g,"").slice(1);if(!i)return null;const s=[...t].sort((l,u)=>Zl(u.value).length-Zl(l.value).length).find(l=>i.startsWith(Zl(l.value)));if(!s)return null;const o=i.slice(Zl(s.value).length);return{countryCode:s.value,localNumber:o}}function _j({id:e,label:t,placeholder:n="1234567890",value:r,defaultValue:i,disabled:a=!1,error:s=!1,required:o=!1,helperText:l,errorMessage:u,helperIcon:c,countryCode:d,defaultCountryCode:f="+1",countryOptions:g=Vy,onChange:p,onCountryCodeChange:m,onBlur:v,onFocus:x,"aria-label":y,"aria-labelledby":b,countryCodeAriaLabel:k="Country code",autoComplete:w="tel",name:S,className:N}){const E=_.useId(),T=e??`dsn-phone-input-${E}`,C=`${T}-helper`,O=`${T}-country-menu`,[$,j]=_.useState(f),M=d??$,[A,z]=_.useState(i??""),B=r??A,[R,H]=_.useState(!1),F=_.useRef(null),L=_.useRef(null),U=_.useRef([]),[K,Y]=_.useState(-1),G=s&&u?u:l,ne=!!l||s&&!!u?C:void 0,se=_.useMemo(()=>g.length===0?Vy:g,[g]);function W(ee=!1){const he=se.findIndex(re=>re.value===M);return he>=0?he:se.length===0?-1:ee?se.length-1:0}function X(ee,he){return se.length===0?-1:(ee+he+se.length)%se.length}function D(ee){d===void 0&&j(ee),m==null||m(ee)}function P(ee){r===void 0&&z(ee.target.value),p==null||p(ee)}function q(ee){const he=bj(ee.clipboardData.getData("text"),se);he&&(ee.preventDefault(),D(he.countryCode??M),r===void 0&&z(he.localNumber))}return _.useEffect(()=>{const ee=he=>{!F.current||!R||F.current.contains(he.target)||H(!1)};return document.addEventListener("mousedown",ee),()=>document.removeEventListener("mousedown",ee)},[R]),_.useEffect(()=>{var he;if(!R||a){Y(-1);return}const ee=W();Y(ee),ee>=0&&((he=U.current[ee])==null||he.focus())},[M,a,R,se]),h.jsxs("div",{ref:F,className:`dsn-phone-input${N?` ${N}`:""}`,"data-error":s||void 0,"data-disabled":a||void 0,children:[t&&h.jsxs("label",{className:"dsn-phone-input-label",htmlFor:T,children:[t,o&&h.jsxs("span",{className:"dsn-phone-input-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-phone-input-control",role:"group","aria-label":"Phone number",children:[h.jsxs("span",{className:"dsn-phone-input-country-wrap",children:[h.jsxs("button",{ref:L,type:"button",className:"dsn-phone-input-country-visual",disabled:a,"aria-label":k,"aria-haspopup":"menu","aria-expanded":R,"aria-controls":R?O:void 0,onClick:()=>H(ee=>!ee),onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" "||ee.key==="ArrowDown")&&(ee.preventDefault(),H(!0)),ee.key==="ArrowUp"&&(ee.preventDefault(),Y(W(!0)),H(!0)),ee.key==="Escape"&&H(!1)},children:[h.jsx("span",{className:"dsn-phone-input-country-code",children:M}),h.jsx("span",{className:"dsn-phone-input-country-chevron","aria-hidden":"true",children:h.jsx(Fr,{size:16,strokeWidth:1.5,"aria-hidden":"true"})})]}),R&&!a&&h.jsx(Rr,{role:"menu","aria-label":`${k} options`,className:"dsn-phone-input-country-popover",contentClassName:"dsn-phone-input-country-popover-content",contentPadding:"small",anchorRef:L,offset:4,viewportMargin:16,matchAnchorWidth:!0,content:h.jsx("div",{id:O,children:se.map((ee,he)=>h.jsx(Ui,{ref:re=>{U.current[he]=re},tabIndex:K===he?0:-1,onKeyDown:re=>{var pe,ke,Ue,Qe,vt;if(re.key==="ArrowDown"){re.preventDefault();const Re=X(K>=0?K:W(),1);Y(Re),(pe=U.current[Re])==null||pe.focus();return}if(re.key==="ArrowUp"){re.preventDefault();const Re=X(K>=0?K:W(!0),-1);Y(Re),(ke=U.current[Re])==null||ke.focus();return}if(re.key==="Home"){re.preventDefault(),Y(0),(Ue=U.current[0])==null||Ue.focus();return}if(re.key==="End"){re.preventDefault();const Re=se.length-1;Y(Re),(Qe=U.current[Re])==null||Qe.focus();return}re.key==="Escape"&&(re.preventDefault(),H(!1),(vt=L.current)==null||vt.focus())},className:"dsn-phone-input-country-option",label:ee.label,showLeadingIcon:!1,showTrailingIcon:M===ee.value,selected:M===ee.value,"aria-label":ee.label,onClick:()=>{var re;D(ee.value),H(!1),(re=L.current)==null||re.focus()}},ee.value))})})]}),h.jsx("input",{type:"tel",id:T,className:"dsn-phone-input-field",placeholder:n,value:B,defaultValue:i,disabled:a,name:S,autoComplete:w,"aria-invalid":s||void 0,"aria-required":o||void 0,"aria-describedby":ne,"aria-label":y,"aria-labelledby":b,onChange:P,onPaste:q,onBlur:v,onFocus:x})]}),G&&h.jsx("div",{className:"dsn-phone-input-meta",children:h.jsxs("div",{className:"dsn-phone-input-helper-inner",children:[c&&h.jsx("span",{className:"dsn-phone-input-icon","aria-hidden":"true",children:c}),h.jsx("p",{id:C,className:"dsn-phone-input-helper",children:G})]})})]})}function wj({error:e=!1}){return e?h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 5V8M8 11H8.01M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}):h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.5L13.5 8L8 13.5L2.5 8L8 2.5Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}function kj({id:e,label:t,placeholder:n="Placeholder",value:r,defaultValue:i,disabled:a=!1,error:s=!1,required:o=!1,helperText:l,errorMessage:u,maxLength:c,minRows:d=3,helperIcon:f,leadingIcon:g,onChange:p,onBlur:m,onFocus:v,"aria-label":x,"aria-labelledby":y,autoComplete:b,name:k,className:w}){const S=_.useId(),N=e??`dsn-text-area-${S}`,E=`${N}-helper`,[T,C]=_.useState(()=>(r??i??"").length),O=r!==void 0?r.length:T,$=s&&u?u:l,j=!!l||s&&!!u,M=j||c!==void 0,A=j?E:void 0,z=f??(j?h.jsx(wj,{error:s}):null);function B(R){r===void 0&&C(R.target.value.length),p==null||p(R)}return h.jsxs("div",{className:`dsn-text-area${w?` ${w}`:""}`,"data-error":s||void 0,"data-disabled":a||void 0,children:[t&&h.jsxs("label",{className:"dsn-text-area-label",htmlFor:N,children:[t,o&&h.jsxs("span",{className:"dsn-text-area-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-text-area-control",children:[g&&h.jsx("span",{className:"dsn-text-area-leading-icon","aria-hidden":"true",children:g}),h.jsx("textarea",{id:N,className:"dsn-text-area-field",rows:d,placeholder:n,value:r,defaultValue:i,disabled:a,maxLength:c,"aria-invalid":s||void 0,"aria-required":o||void 0,"aria-describedby":A,"aria-label":x,"aria-labelledby":y,autoComplete:b,name:k,onChange:B,onBlur:m,onFocus:v})]}),M&&h.jsxs("div",{className:"dsn-text-area-meta",children:[h.jsxs("div",{className:"dsn-text-area-helper-inner",children:[z&&h.jsx("span",{className:"dsn-text-area-helper-icon","aria-hidden":"true",children:z}),$&&h.jsx("p",{id:E,className:"dsn-text-area-helper",children:$})]}),c!==void 0&&h.jsxs("span",{className:"dsn-text-area-count","aria-live":"polite","aria-atomic":"true",children:[O,"/",c]})]})]})}function Sj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M11.5 11.5L14 14M12.6667 7.33333C12.6667 10.2789 10.2789 12.6667 7.33333 12.6667C4.38781 12.6667 2 10.2789 2 7.33333C2 4.38781 4.38781 2 7.33333 2C10.2789 2 12.6667 4.38781 12.6667 7.33333Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M11.5 4.5L4.5 11.5M4.5 4.5L11.5 11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ky({id:e,variant:t="default",label:n="Label",placeholder:r="Search",value:i,defaultValue:a,disabled:s=!1,error:o=!1,helperText:l="Help text",errorMessage:u,maxLength:c,required:d=!1,helperIcon:f,onChange:g,onFocus:p,onBlur:m,onClear:v,className:x,name:y,autoComplete:b,"aria-label":k,"aria-labelledby":w}){const S=_.useId(),N=e??`dsn-search-bar-${S}`,E=`${N}-helper`,[T,C]=_.useState(()=>(i??a??"").length),O=i!==void 0,$=i??void 0,j=(i??"").length,M=O?j:T,A=O?j>0:T>0,B=t==="default"&&(!!l||o&&!!u||c!==void 0||o&&!!u),R=o&&u?u:l,H=["dsn-search-bar",x].filter(Boolean).join(" ");function F(U){O||C(U.target.value.length),g==null||g(U)}function L(){if(!O){C(0);const U=document.getElementById(N);U&&(U.value="",U.focus())}v==null||v()}return h.jsxs("div",{className:H,"data-variant":t,"data-error":o||void 0,"data-disabled":s||void 0,children:[t==="default"&&h.jsxs("label",{className:"dsn-search-bar-label",htmlFor:N,children:[n,d&&h.jsxs("span",{className:"dsn-search-bar-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{className:"dsn-search-bar-control",children:[h.jsx("span",{className:"dsn-search-bar-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-search-bar-icon",children:h.jsx(Sj,{})})}),h.jsx("span",{className:"dsn-search-bar-label-wrap",children:h.jsx("input",{id:N,type:"search",className:"dsn-search-bar-field",placeholder:r,value:$,defaultValue:a,disabled:s,maxLength:c,name:y,autoComplete:b,"aria-invalid":o||void 0,"aria-required":d||void 0,"aria-describedby":B?E:void 0,"aria-label":k,"aria-labelledby":w,onChange:F,onFocus:p,onBlur:m})}),A&&!s&&h.jsx("span",{className:"dsn-search-bar-icon-wrap dsn-search-bar-clear",children:h.jsx("button",{type:"button",className:"dsn-search-bar-clear-btn","aria-label":"Clear search",onClick:L,children:h.jsx("span",{className:"dsn-search-bar-icon","aria-hidden":"true",children:h.jsx(Nj,{})})})})]}),B&&h.jsxs("div",{className:"dsn-search-bar-meta",children:[h.jsxs("div",{className:"dsn-search-bar-helper-inner",children:[f&&h.jsx("span",{className:"dsn-search-bar-helper-icon","aria-hidden":"true",children:f}),R!==void 0&&h.jsx("p",{id:E,className:"dsn-search-bar-helper",children:R})]}),c!==void 0&&h.jsxs("span",{className:"dsn-search-bar-count","aria-live":"polite","aria-atomic":"true",children:[M,"/",c]})]})]})}const Ej=[{value:"placeholder-a",label:"Placeholder A"},{value:"placeholder-b",label:"Placeholder B"},{value:"placeholder-c",label:"Placeholder C"},{value:"placeholder-d",label:"Placeholder D"}];function Tj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Cj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.5L13.5 8L8 13.5L2.5 8L8 2.5Z",stroke:"currentColor",strokeWidth:"1.5"})})}function jj({id:e,label:t="Label",placeholder:n="Placeholder",options:r=Ej,value:i,defaultValue:a,open:s,defaultOpen:o=!1,disabled:l=!1,error:u=!1,helperText:c="Help text",errorMessage:d,required:f=!1,helperIcon:g,className:p,name:m,onChange:v,onOpenChange:x,"aria-label":y,"aria-labelledby":b}){const k=_.useId(),w=e??`dsn-select-${k}`,S=`${w}-menu`,N=`${w}-helper`,E=`${w}-label`,T=i!==void 0,[C,O]=_.useState(a??""),$=T?i:C,j=s!==void 0,[M,A]=_.useState(o),z=j?s:M,B=_.useRef(null),R=_.useRef(null),H=_.useRef(null),F=_.useRef([]),[L,U]=_.useState(-1),K=_.useMemo(()=>r.find(W=>W.value===$),[r,$]),Y=u&&d?d:c,G=_.useCallback((W,X)=>{var P;if(r.length===0)return-1;let D=W;for(let q=0;q<r.length;q+=1)if(D=(D+X+r.length)%r.length,!((P=r[D])!=null&&P.disabled))return D;return-1},[r]),Q=_.useCallback((W=!1)=>{var D;if(r.length===0)return-1;const X=r.findIndex(P=>P.value===$&&!P.disabled);if(X>=0)return X;if(W){for(let P=r.length-1;P>=0;P-=1)if(!((D=r[P])!=null&&D.disabled))return P;return-1}return r.findIndex(P=>!P.disabled)},[r,$]),ne=_.useCallback(W=>{j||A(W),x==null||x(W)},[j,x]);function se(W){var X;W.disabled||l||(T||O(W.value),v==null||v(W.value,W),ne(!1),(X=H.current)==null||X.focus())}return _.useEffect(()=>{function W(X){B.current&&(B.current.contains(X.target)||ne(!1))}return document.addEventListener("mousedown",W),()=>{document.removeEventListener("mousedown",W)}},[ne]),_.useEffect(()=>{var X;if(!z||l){U(-1);return}const W=Q();U(W),W>=0&&((X=F.current[W])==null||X.focus())},[l,Q,z]),h.jsxs("div",{ref:B,className:["dsn-select",p].filter(Boolean).join(" "),"data-disabled":l||void 0,"data-error":u||void 0,"data-open":z||void 0,children:[h.jsxs("label",{className:"dsn-select-label",id:E,htmlFor:w,children:[t,f&&h.jsxs("span",{className:"dsn-select-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{ref:R,className:"dsn-select-control-wrap",children:[h.jsxs("button",{ref:H,id:w,type:"button",className:"dsn-select-control",disabled:l,"aria-haspopup":"menu","aria-expanded":z,"aria-controls":z?S:void 0,"aria-label":y,"aria-labelledby":b??E,"aria-invalid":u||void 0,"aria-required":f||void 0,"aria-describedby":Y?N:void 0,onClick:()=>ne(!z),onKeyDown:W=>{(W.key==="ArrowDown"||W.key==="ArrowUp"||W.key==="Enter"||W.key===" ")&&(W.preventDefault(),W.key==="ArrowUp"&&U(Q(!0)),ne(!0)),W.key==="Escape"&&ne(!1)},children:[h.jsx("span",{className:"dsn-select-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-select-icon",children:h.jsx(Cj,{})})}),h.jsx("span",{className:"dsn-select-label-wrap",children:h.jsx("span",{className:"dsn-select-value","data-placeholder":!K||void 0,children:(K==null?void 0:K.label)??n})}),h.jsx("span",{className:"dsn-select-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-select-icon",children:h.jsx(Tj,{})})})]}),z&&!l&&h.jsx(Rr,{role:"menu","aria-label":`${t} options`,className:"dsn-select-popover",contentClassName:"dsn-select-popover-stack",contentPadding:"small",anchorRef:R,offset:4,viewportMargin:16,matchAnchorWidth:!0,content:h.jsx("div",{id:S,children:r.map((W,X)=>h.jsx(Ui,{tabIndex:L===X?0:-1,onKeyDown:D=>{var P,q,ee,he,re,pe;if(D.key==="ArrowDown"){D.preventDefault();const ke=G(L>=0?L:Q(),1);U(ke),ke>=0&&((P=F.current[ke])==null||P.focus());return}if(D.key==="ArrowUp"){D.preventDefault();const ke=G(L>=0?L:Q(!0),-1);U(ke),ke>=0&&((q=F.current[ke])==null||q.focus());return}if(D.key==="Home"){D.preventDefault();const ke=r.findIndex(Ue=>!Ue.disabled);U(ke),ke>=0&&((ee=F.current[ke])==null||ee.focus());return}if(D.key==="End"){D.preventDefault();let ke=-1;for(let Ue=r.length-1;Ue>=0;Ue-=1)if(!((he=r[Ue])!=null&&he.disabled)){ke=Ue;break}U(ke),ke>=0&&((re=F.current[ke])==null||re.focus());return}D.key==="Escape"&&(D.preventDefault(),ne(!1),(pe=H.current)==null||pe.focus())},ref:D=>{F.current[X]=D},className:"dsn-select-option",label:W.label,description:W.description,showDescription:!!W.description,showLeadingIcon:!0,showTrailingIcon:$===W.value,selected:$===W.value,disabled:W.disabled,onClick:()=>se(W),"aria-label":W.label},W.value))})})]}),m&&h.jsx("input",{type:"hidden",name:m,value:$??""}),Y&&h.jsxs("div",{className:"dsn-select-meta",children:[g&&h.jsx("span",{className:"dsn-select-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-select-meta-icon",children:g})}),h.jsx("p",{id:N,className:"dsn-select-helper",children:Y})]})]})}const Mj=[{value:"placeholder-a",label:"Label A"},{value:"placeholder-b",label:"Label B"},{value:"placeholder-c",label:"Label C"},{value:"placeholder-d",label:"Label D"}];function Yy({selectionMode:e="single",id:t,label:n="Label",showLabel:r=!0,placeholder:i="Placeholder",options:a=Mj,value:s,defaultValue:o,values:l,defaultValues:u=[],open:c,defaultOpen:d=!1,disabled:f=!1,error:g=!1,helperText:p="Help text",showHelper:m=!0,errorMessage:v,required:x=!1,helperIcon:y,className:b,name:k,onChange:w,onValuesChange:S,onOpenChange:N,onInputChange:E,confirmLabel:T="Confirm","aria-label":C,"aria-labelledby":O}){const $=e==="multi",j=_.useId(),M=t??`dsn-combobox-${j}`,A=`${M}-listbox`,z=`${M}-helper`,B=`${M}-label`,R=s!==void 0,[H,F]=_.useState(o??""),L=R?s:H,U=_.useMemo(()=>a.find(ie=>ie.value===L),[a,L]),K=l!==void 0,[Y,G]=_.useState(u),Q=_.useMemo(()=>(K?l??[]:Y).filter(ie=>a.some(xe=>xe.value===ie)),[Y,K,a,l]),ne=_.useMemo(()=>new Set(Q),[Q]),[se,W]=_.useState(Q),X=_.useMemo(()=>new Set(se),[se]),D=_.useMemo(()=>a.filter(ie=>ne.has(ie.value)),[ne,a]),[P,q]=_.useState($?"":(U==null?void 0:U.label)??"");_.useEffect(()=>{$||q((U==null?void 0:U.label)??"")},[$,U==null?void 0:U.label]),_.useEffect(()=>{if($&&!K){const ie=Y.filter(xe=>a.some(ve=>ve.value===xe));ie.length!==Y.length&&G(ie)}},[Y,$,K,a]);const ee=c!==void 0,[he,re]=_.useState(d),pe=ee?c:he,ke=_.useRef(null),Ue=_.useRef(null),Qe=_.useRef(null),vt=_.useRef(!1),Re=_.useRef([]),[Ke,ft]=_.useState(-1),ut=g&&v?v:p,yt=P.trim().toLowerCase(),Le=_.useMemo(()=>yt.length===0?a:a.filter(ie=>ie.label.toLowerCase().includes(yt)),[yt,a]),Et=_.useCallback((ie,xe)=>{var Ne;if(Le.length===0)return-1;let ve=ie;for(let gt=0;gt<Le.length;gt+=1)if(ve=(ve+xe+Le.length)%Le.length,!((Ne=Le[ve])!=null&&Ne.disabled))return ve;return-1},[Le]),Tt=_.useCallback((ie=!1)=>{var ve;if(Le.length===0)return-1;const xe=Le.findIndex(Ne=>Ne.value===L&&!Ne.disabled);if(xe>=0)return xe;if(ie){for(let Ne=Le.length-1;Ne>=0;Ne-=1)if(!((ve=Le[Ne])!=null&&ve.disabled))return Ne;return-1}return Le.findIndex(Ne=>!Ne.disabled)},[Le,L]),at=_.useCallback(ie=>{ee||re(ie),N==null||N(ie)},[ee,N]),fr=_.useCallback(ie=>{const xe=new Set(ie);return a.filter(ve=>xe.has(ve.value)).map(ve=>ve.value)},[a]),jn=_.useCallback(()=>{if(!$)return;const ie=fr(se);K||G(ie),S==null||S(ie,a.filter(xe=>ie.includes(xe.value)))},[$,K,fr,S,a,se]),Ut=_.useCallback(()=>{jn(),at(!1)},[jn,at]),ye=_.useCallback(ie=>{W(xe=>xe.includes(ie)?xe.filter(ve=>ve!==ie):[...xe,ie])},[]),Ie=_.useCallback(ie=>{const xe=Q.filter(ve=>ve!==ie);K||G(xe),S==null||S(xe,a.filter(ve=>xe.includes(ve.value))),pe&&W(ve=>ve.filter(Ne=>Ne!==ie))},[Q,pe,K,S,a]);function Ct(ie){var xe;ie.disabled||f||(R||F(ie.value),q(ie.label),E==null||E(ie.label),w==null||w(ie.value,ie),at(!1),vt.current=!0,(xe=Qe.current)==null||xe.focus())}function _t(){var ie,xe;if($){q(""),E==null||E(""),at(!0),(ie=Qe.current)==null||ie.focus();return}R||F(""),q(""),E==null||E(""),at(!0),(xe=Qe.current)==null||xe.focus()}return _.useEffect(()=>{function ie(xe){ke.current&&(ke.current.contains(xe.target)||at(!1))}return document.addEventListener("mousedown",ie),()=>{document.removeEventListener("mousedown",ie)}},[at]),_.useEffect(()=>{if(!pe||f){ft(-1);return}ft(Tt())},[f,Tt,pe]),_.useEffect(()=>{$&&pe&&W(Q)},[Q,$,pe]),h.jsxs("div",{ref:ke,className:["dsn-combobox",b].filter(Boolean).join(" "),"data-disabled":f||void 0,"data-error":g||void 0,"data-open":pe||void 0,"data-filled":($?D.length>0:!!U)||void 0,children:[r&&h.jsxs("label",{className:"dsn-combobox-label",id:B,htmlFor:M,children:[n,x&&h.jsxs("span",{className:"dsn-combobox-required","aria-hidden":"true",children:[" ","*"]})]}),$&&D.length>0&&h.jsx("div",{className:"dsn-combobox-chip-stack",children:D.map(ie=>h.jsx(Xs,{size:"md",label:ie.label,showLeadingIcon:!1,showTrailingIcon:!1,onDismiss:()=>Ie(ie.value)},ie.value))}),h.jsxs("div",{ref:Ue,className:"dsn-combobox-control-wrap",children:[h.jsx("div",{className:"dsn-combobox-control",children:h.jsxs("div",{className:"dsn-combobox-input-row",children:[h.jsx("span",{className:"dsn-combobox-value-wrap",children:h.jsx("input",{ref:Qe,id:M,className:"dsn-combobox-input",type:"text",role:"combobox",autoComplete:"off",disabled:f,value:P,placeholder:i,"aria-expanded":pe,"aria-controls":pe?A:void 0,"aria-haspopup":$?"dialog":"listbox","aria-autocomplete":"list","aria-label":C,"aria-labelledby":O??(r?B:void 0),"aria-invalid":g||void 0,"aria-required":x||void 0,"aria-describedby":ut?z:void 0,onFocus:()=>{if(vt.current){vt.current=!1;return}f||at(!0)},onBlur:ie=>{var xe;if($){const ve=ie.relatedTarget;if(ve&&((xe=ke.current)!=null&&xe.contains(ve)))return;Ut()}},onClick:()=>{f||at(!0)},onChange:ie=>{const xe=ie.target.value;q(xe),E==null||E(xe),pe||at(!0)},onKeyDown:ie=>{var xe,ve;if(ie.key==="ArrowDown"){if(ie.preventDefault(),!pe){at(!0);return}const Ne=Et(Ke>=0?Ke:Tt(),1);ft(Ne),Ne>=0&&((xe=Re.current[Ne])==null||xe.focus())}if(ie.key==="ArrowUp"){if(ie.preventDefault(),!pe){at(!0);return}const Ne=Et(Ke>=0?Ke:Tt(!0),-1);ft(Ne),Ne>=0&&((ve=Re.current[Ne])==null||ve.focus())}if(ie.key==="Enter"&&pe){if($)ie.preventDefault(),Ut();else if(Ke>=0){ie.preventDefault();const Ne=Le[Ke];Ne&&Ct(Ne)}}ie.key==="Escape"&&(ie.preventDefault(),$?Ut():at(!1))}})}),!!P&&!f&&h.jsx("button",{type:"button",className:"dsn-combobox-clear","aria-label":$?"Clear search":"Clear selection",onClick:_t,children:h.jsx(Gd,{size:16,"aria-hidden":"true"})}),h.jsx("span",{className:"dsn-combobox-chevron","aria-hidden":"true",children:h.jsx(Fr,{size:16})})]})}),pe&&!f&&h.jsx(Rr,{role:$?"dialog":"listbox","aria-label":`${n} options`,className:"dsn-combobox-popover",contentClassName:"dsn-combobox-popover-stack",contentPadding:"small",anchorRef:Ue,offset:4,viewportMargin:16,matchAnchorWidth:!0,content:h.jsx("div",{id:A,children:Le.length===0?h.jsx("div",{className:"dsn-combobox-empty",children:"No options"}):$?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"dsn-combobox-multi-options",onMouseDown:ie=>{ie.preventDefault()},children:Le.map((ie,xe)=>h.jsx("div",{ref:ve=>{Re.current[xe]=ve},className:"dsn-combobox-multi-option","aria-disabled":ie.disabled||void 0,tabIndex:Ke===xe?0:-1,onKeyDown:ve=>{var Ne,gt;if(ve.key==="ArrowDown"){ve.preventDefault();const jt=Et(Ke>=0?Ke:Tt(),1);ft(jt),jt>=0&&((Ne=Re.current[jt])==null||Ne.focus());return}if(ve.key==="ArrowUp"){ve.preventDefault();const jt=Et(Ke>=0?Ke:Tt(!0),-1);ft(jt),jt>=0&&((gt=Re.current[jt])==null||gt.focus());return}if(ve.key==="Enter"||ve.key===" "){ve.preventDefault(),ie.disabled||ye(ie.value);return}ve.key==="Escape"&&(ve.preventDefault(),Ut())},children:h.jsx(Xn,{size:"md",checked:X.has(ie.value),disabled:ie.disabled,label:ie.label,showLeadingIcon:!1,showTrailingIcon:!1,onCheckedChange:()=>{ie.disabled||ye(ie.value)}})},ie.value))}),h.jsx("div",{className:"dsn-combobox-multi-footer",children:h.jsx(be,{size:"md",variant:"primary",onClick:Ut,children:T})})]}):Le.map((ie,xe)=>h.jsx(Ui,{tabIndex:Ke===xe?0:-1,ref:ve=>{Re.current[xe]=ve},className:"dsn-combobox-option",label:ie.label,description:ie.description,showDescription:!!ie.description,showLeadingIcon:!1,showTrailingIcon:!1,selected:L===ie.value,disabled:ie.disabled,onClick:()=>Ct(ie),onKeyDown:ve=>{var Ne,gt,jt;if(ve.key==="ArrowDown"){ve.preventDefault();const un=Et(Ke>=0?Ke:Tt(),1);ft(un),un>=0&&((Ne=Re.current[un])==null||Ne.focus());return}if(ve.key==="ArrowUp"){ve.preventDefault();const un=Et(Ke>=0?Ke:Tt(!0),-1);ft(un),un>=0&&((gt=Re.current[un])==null||gt.focus());return}if(ve.key==="Enter"||ve.key===" "){ve.preventDefault(),Ct(ie);return}ve.key==="Escape"&&(ve.preventDefault(),at(!1),(jt=Qe.current)==null||jt.focus())}},ie.value))})})]}),k&&($?Q.map(ie=>h.jsx("input",{type:"hidden",name:k,value:ie},ie)):h.jsx("input",{type:"hidden",name:k,value:L??""})),m&&ut&&h.jsxs("div",{className:"dsn-combobox-meta",children:[y&&h.jsx("span",{className:"dsn-combobox-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-combobox-meta-icon",children:y})}),h.jsx("p",{id:z,className:"dsn-combobox-helper",children:ut})]})]})}function Oj({id:e,label:t,active:n,disabled:r,tabIndex:i,showLeadingIcon:a=!1,leadingIcon:s,showTrailingIcon:o=!1,trailingIcon:l,onSelect:u,onKeyDown:c,onFocus:d,buttonRef:f,ariaLabel:g}){return h.jsxs("button",{ref:f,id:e,type:"button",className:"dsn-segment-control-selector",role:"radio","aria-checked":n,"aria-disabled":r||void 0,"aria-label":g,"data-active":n||void 0,disabled:r,tabIndex:i,onClick:u,onKeyDown:c,onFocus:d,children:[a&&s&&h.jsx("span",{className:"dsn-segment-control-selector-icon","aria-hidden":"true",children:s}),h.jsx("span",{className:"dsn-segment-control-selector-label-wrap",children:h.jsx("span",{className:"dsn-segment-control-selector-label",children:t})}),o&&l&&h.jsx("span",{className:"dsn-segment-control-selector-icon","aria-hidden":"true",children:l})]})}function $j(e){var n;return((n=e.find(r=>!r.disabled)??e[0])==null?void 0:n.value)??""}function sf({options:e,value:t,defaultValue:n,onChange:r,fullWidth:i=!0,className:a,"aria-label":s="Segment control"}){const o=_.useMemo(()=>$j(e),[e]),l=t!==void 0,[u,c]=_.useState(n??o),d=l?t:u,[f,g]=_.useState(()=>{const y=e.findIndex(b=>b.value===d);return y>=0?y:0}),p=_.useRef([]);_.useEffect(()=>{!l&&e.every(y=>y.value!==u)&&c(o)},[o,u,l,e]),_.useEffect(()=>{const y=e.findIndex(b=>b.value===d);y>=0&&g(y)},[e,d]);const m=_.useCallback(y=>{const b=e.find(k=>k.value===y);!b||b.disabled||(l||c(y),y!==d&&(r==null||r(y)))},[l,r,e,d]),v=_.useCallback((y,b)=>{var w;if(e.length===0)return;let k=y;for(let S=0;S<e.length;S+=1)if(k=(k+b+e.length)%e.length,!e[k].disabled){const N=e[k];g(k),m(N.value),(w=p.current[k])==null||w.focus();return}},[e,m]),x=["dsn-segment-control",a].filter(Boolean).join(" ");return h.jsx("div",{className:x,role:"radiogroup","aria-label":s,"data-full-width":i,children:e.map((y,b)=>{const k=y.value===d,w=b===f?0:-1,S=`dsn-segment-control-${y.value}`;return h.jsx(Oj,{id:S,label:y.label,active:k,disabled:!!y.disabled,tabIndex:w,showLeadingIcon:y.showLeadingIcon,leadingIcon:y.leadingIcon,showTrailingIcon:y.showTrailingIcon,trailingIcon:y.trailingIcon,ariaLabel:y["aria-label"],buttonRef:N=>{p.current[b]=N},onSelect:()=>m(y.value),onFocus:()=>g(b),onKeyDown:N=>{if(N.key==="ArrowRight"||N.key==="ArrowDown"){N.preventDefault(),v(b,1);return}if(N.key==="ArrowLeft"||N.key==="ArrowUp"){N.preventDefault(),v(b,-1);return}(N.key===" "||N.key==="Enter")&&(N.preventDefault(),m(y.value))}},y.value)})})}function of(e,t){const n=t==="sm"?"sm":"md";return _.Children.map(e,r=>{if(!_.isValidElement(r))return r;const i=of(r.props.children,t);if(r.type===be){const a=r.props.variant,s=a==="plain"?"secondary":a??"primary";return _.cloneElement(r,{variant:s,size:n,children:i})}return _.cloneElement(r,{children:i})})}function Ia({size:e="lg",variant:t="default",leftActions:n,rightActions:r,className:i,"aria-label":a="Toolbar"}){const s=["dsn-toolbar",i].filter(Boolean).join(" "),o=of(n,e),l=of(r,e);return h.jsxs("div",{className:s,"data-size":e,"data-variant":t,role:"toolbar","aria-label":a,children:[h.jsx("div",{className:"dsn-toolbar-side dsn-toolbar-side-left",children:o}),h.jsx("div",{className:"dsn-toolbar-side dsn-toolbar-side-right",children:l})]})}const Pj=["S","M","T","W","T","F","S"],Aj=["07:00","08:00","09:00","10:00","11:00","12:00","01:00","02:00","03:00","04:00","05:00","06:00"];function Lj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M9.5 4.5L6 8L9.5 11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dj(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M6.5 4.5L10 8L6.5 11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function lf(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M5.33333 2V4M10.6667 2V4M2.66667 6H13.3333M4 3.33333H12C12.7364 3.33333 13.3333 3.93029 13.3333 4.66667V12C13.3333 12.7364 12.7364 13.3333 12 13.3333H4C3.26362 13.3333 2.66667 12.7364 2.66667 12V4.66667C2.66667 3.93029 3.26362 3.33333 4 3.33333Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ij(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M11.5 4.5L4.5 11.5M4.5 4.5L11.5 11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Br(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Js(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Gy(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function qi(e){const t=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),r=String(e.getFullYear());return`${t}-${n}-${r}`}function Fj(e,t,n){return`${qi(e)} ${t} ${n}`}function zj(e){return e.toLocaleDateString("en-US",{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function Rj(e){const r=(e.trim().split(/\s+/)[0]??"").match(/^(\d{1,2})[-/](\d{1,2})[-/](\d{4})$/);if(!r)return null;const i=Number(r[1]),a=Number(r[2]),s=Number(r[3]),o=new Date(s,i-1,a);return o.getFullYear()!==s||o.getMonth()!==i-1||o.getDate()!==a?null:Br(o)}function ci(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Ql(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function bn(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),Br(n)}function Bj(e){return e.toLocaleDateString("en-US",{month:"short"})}function Wj(e){const t=ci(e),n=t.getDay(),r=bn(t,-n);return Array.from({length:42},(i,a)=>bn(r,a))}function Uj(e){return!e||e instanceof Date?{start:null,end:null}:{start:e.start?Br(e.start):null,end:e.end?Br(e.end):null}}function Hj(e){return!e||!(e instanceof Date)?null:Br(e)}function qj(e,t,n){if(!t||!n)return!1;const r=e.getTime();return r>t.getTime()&&r<n.getTime()}function Vj({id:e,displayMode:t="popover",selectionMode:n="single",withTime:r=!1,label:i="Date and time",placeholder:a="MM-DD-YYY 00:00 AM",startPlaceholder:s="Start date",endPlaceholder:o="End date",value:l,defaultValue:u=null,open:c,defaultOpen:d=!1,disabled:f=!1,required:g=!1,error:p=!1,helperText:m="Help text",errorMessage:v,helperIcon:x,className:y,onChange:b,onOpenChange:k,presets:w,selectedPresetId:S,defaultSelectedPresetId:N=null,onPresetSelect:E,showActions:T=!0,cancelLabel:C="Cancel",confirmLabel:O="Confirm",onCancel:$,onConfirm:j,"aria-label":M,"aria-labelledby":A}){const z=_.useId(),B=e??`dsn-date-time-picker-${z}`,R=`${B}-label`,H=`${B}-helper`,F=`${B}-dialog`,L=n==="range",U=t==="popover",K=p&&v?v:m,Y=c!==void 0,[G,Q]=_.useState(d),ne=Y?c:G,se=l!==void 0,[W,X]=_.useState(u),D=se?l:W,P=Hj(D),q=Uj(D),ee=_.useMemo(()=>P?ci(P):q.start?ci(q.start):ci(new Date),[q.start,P]),[he,re]=_.useState(ee),pe=_.useMemo(()=>{const te=Br(new Date),Xe=bn(te,-1);if(L){const ot=bn(te,-4);return[{id:"today",label:"Today",value:{start:te,end:te}},{id:"yesterday",label:"Yesterday",value:{start:Xe,end:Xe}},{id:"last-week",label:"Last week",value:{start:ot,end:te}},{id:"last-month",label:"Last month",value:{start:bn(te,-30),end:te}},{id:"last-year",label:"Last year",value:{start:bn(te,-365),end:te}}]}return[{id:"today",label:"Today",value:te},{id:"yesterday",label:"Yesterday",value:Xe},{id:"last-friday",label:"Last Friday",value:bn(te,-2)}]},[L]),ke=w??pe,Ue=T,Qe=S!==void 0,[vt,Re]=_.useState(N),Ke=Qe?S??null:vt,[ft,ut]=_.useState(Br(new Date)),[yt,Le]=_.useState(null),[Et,Tt]=_.useState("07:00"),[at,fr]=_.useState("AM"),[jn,Ut]=_.useState(P?qi(P):""),[ye,Ie]=_.useState(q.start?qi(q.start):""),[Ct,_t]=_.useState(q.end?qi(q.end):""),ie=_.useRef(null),xe=_.useRef(null),ve=_.useRef(null),Ne=_.useRef({}),gt=L&&q.start?qi(q.start):"",jt=L&&q.end?qi(q.end):"",un=!L&&P?r?Fj(P,Et,at):qi(P):"",Pa=_.useMemo(()=>Wj(he),[he]),Mt=te=>{Y||Q(te),k==null||k(te)},st=te=>{se||X(te),b==null||b(te)},Jt=te=>{const Xe=Gy(te),ot=Ne.current[Xe];ot&&ot.focus()},Mn=(te,Xe)=>{const ot=Rj(te);if(!ot)return;if(Xe==="single"){st(ot),re(ci(ot)),ut(ot);return}const pr=Xe==="range-start"?ot:q.start,I=Xe==="range-end"?ot:q.end;if(pr&&I&&pr.getTime()>I.getTime()){st({start:I,end:pr}),re(ci(I)),ut(I);return}st({start:pr??null,end:I??null}),re(ci(ot)),ut(ot)},Yn=te=>{Qe||Re(te.id),E==null||E(te.id),st(te.value)},Ht=te=>{if(Le(null),!L){st(te),ut(te),!r&&!Ue&&U&&Mt(!1);return}const{start:Xe,end:ot}=q;if(!Xe||Xe&&ot){st({start:te,end:null}),ut(te);return}te.getTime()<Xe.getTime()?(st({start:te,end:Xe}),ut(te)):(st({start:Xe,end:te}),ut(te)),!r&&!Ue&&U&&Mt(!1)};_.useEffect(()=>{if(!ne)return;const te=L?q.start??ft:P??ft;Js(te,ft)||ut(te);const Xe=setTimeout(()=>Jt(te),0);return()=>clearTimeout(Xe)},[ft,ne,L,q.start,P]),_.useEffect(()=>{const te=Xe=>{!ie.current||!ne||ie.current.contains(Xe.target)||Mt(!1)};return document.addEventListener("mousedown",te),()=>document.removeEventListener("mousedown",te)},[ne]),_.useEffect(()=>{L||Ut(un)},[L,un]),_.useEffect(()=>{(!L||!ne||q.end)&&Le(null)},[ne,L,q.end]),_.useEffect(()=>{L&&(Ie(gt),_t(jt))},[jt,L,gt]);const hr=h.jsxs("div",{className:"dsn-date-time-picker-panel",children:[h.jsxs("div",{className:"dsn-date-time-picker-calendar-header",children:[h.jsx("button",{type:"button",className:"dsn-date-time-picker-nav-button","aria-label":"Previous month",onClick:()=>re(te=>Ql(te,-1)),children:h.jsx(Lj,{})}),h.jsxs("div",{className:"dsn-date-time-picker-calendar-title-wrap",children:[h.jsx("span",{className:"dsn-date-time-picker-calendar-title",children:Bj(he)}),h.jsx("span",{className:"dsn-date-time-picker-calendar-title",children:he.getFullYear()})]}),h.jsx("button",{type:"button",className:"dsn-date-time-picker-nav-button","aria-label":"Next month",onClick:()=>re(te=>Ql(te,1)),children:h.jsx(Dj,{})})]}),h.jsx("div",{className:"dsn-date-time-picker-weekday-row",children:Pj.map((te,Xe)=>h.jsx("span",{className:"dsn-date-time-picker-weekday",children:te},`${te}-${Xe}`))}),h.jsx("div",{className:"dsn-date-time-picker-days-grid",role:"grid","aria-label":"Calendar",onMouseLeave:()=>Le(null),children:Pa.map(te=>{const Xe=te.getMonth()===he.getMonth(),ot=L&&!!(q.start&&!q.end&&yt),pr=ot&&q.start&&yt?yt.getTime()<q.start.getTime()?yt:q.start:null,I=ot&&q.start&&yt?yt.getTime()<q.start.getTime()?q.start:yt:null,ce=L?q.end?q.start:pr??q.start:P,ge=L?q.end??I:null,Se=Js(te,ce),Fe=L&&Js(te,ge),Ye=Se||Fe,De=L&&qj(te,ce,ge),Ae=L&&!!(ce&&ge&&te.getTime()>=ce.getTime()&&te.getTime()<=ge.getTime()),qt=Js(te,Br(new Date)),ht=Js(te,ft),pt=Gy(te);return h.jsx("button",{ref:Je=>{Ne.current[pt]=Je},type:"button",role:"gridcell",className:"dsn-date-time-picker-day","data-selected":Ye||void 0,"data-in-range":De||void 0,"data-within-range":Ae||void 0,"data-range-start":L&&Se?!0:void 0,"data-range-end":L&&Fe?!0:void 0,"data-today":qt||void 0,"data-outside-month":!Xe||void 0,"aria-selected":Ye,"aria-label":zj(te),tabIndex:ht?0:-1,onClick:()=>Ht(te),onFocus:()=>ut(te),onMouseEnter:()=>{L&&q.start&&!q.end&&Le(te)},onKeyDown:Je=>{var Ir;let Vt=null;if(Je.key==="ArrowRight"&&(Vt=bn(te,1)),Je.key==="ArrowLeft"&&(Vt=bn(te,-1)),Je.key==="ArrowDown"&&(Vt=bn(te,7)),Je.key==="ArrowUp"&&(Vt=bn(te,-7)),Je.key==="Home"&&(Vt=bn(te,-te.getDay())),Je.key==="End"&&(Vt=bn(te,6-te.getDay())),Je.key==="PageUp"){const ct=Ql(te,-1);Vt=new Date(ct.getFullYear(),ct.getMonth(),te.getDate())}if(Je.key==="PageDown"){const ct=Ql(te,1);Vt=new Date(ct.getFullYear(),ct.getMonth(),te.getDate())}if(Vt){Je.preventDefault();const ct=Br(Vt);ut(ct),re(ci(ct)),setTimeout(()=>Jt(ct),0);return}if(Je.key==="Enter"||Je.key===" "){Je.preventDefault(),Ht(te);return}Je.key==="Escape"&&(Je.preventDefault(),Mt(!1),(Ir=xe.current)==null||Ir.focus())},children:h.jsx("span",{className:"dsn-date-time-picker-day-inner",children:te.getDate()})},pt)})}),r&&h.jsxs("div",{className:"dsn-date-time-picker-time-bar",children:[h.jsx("div",{className:"dsn-date-time-picker-time-hour",children:h.jsx(Yy,{label:"Hour",showLabel:!1,showHelper:!1,placeholder:"07:00",helperText:"",selectionMode:"single",defaultValue:Et,options:Aj.map(te=>({value:te,label:te})),onChange:te=>Tt(te),onInputChange:te=>Tt(te),"aria-label":"Select time"})}),h.jsx("div",{className:"dsn-date-time-picker-time-meridiem",children:h.jsx(sf,{fullWidth:!1,"aria-label":"Select meridiem",value:at,onChange:fr,options:[{value:"AM",label:"AM"},{value:"PM",label:"PM"}]})})]})]});return U?h.jsxs("div",{ref:ie,className:["dsn-date-time-picker",y].filter(Boolean).join(" "),"data-error":p||void 0,"data-disabled":f||void 0,"data-open":ne||void 0,children:[!L&&h.jsxs("label",{id:R,className:"dsn-date-time-picker-label",htmlFor:`${B}-single`,children:[i,g&&h.jsxs("span",{className:"dsn-date-time-picker-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsxs("div",{ref:ve,className:"dsn-date-time-picker-control-wrap",children:[!L&&h.jsxs("div",{className:"dsn-date-time-picker-control",children:[h.jsx("span",{className:"dsn-date-time-picker-leading-icon","aria-hidden":"true",children:h.jsx(lf,{})}),h.jsx("input",{ref:xe,id:`${B}-single`,className:"dsn-date-time-picker-control-input",placeholder:a,value:jn,onChange:te=>Ut(te.target.value),disabled:f,"aria-label":M,"aria-labelledby":A??R,"aria-required":g||void 0,"aria-invalid":p||void 0,"aria-describedby":K?H:void 0,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?F:void 0,onFocus:()=>{f||Mt(!0)},onClick:()=>{f||Mt(!0)},onKeyDown:te=>{(te.key==="ArrowDown"||te.key==="Enter")&&(te.preventDefault(),Mt(!0)),te.key==="Escape"&&Mt(!1)},onBlur:te=>Mn(te.target.value,"single")}),jn&&!f&&h.jsx("button",{type:"button",className:"dsn-date-time-picker-clear-button","aria-label":"Clear date value",onClick:()=>{var te;Ut(""),st(null),Mt(!1),(te=xe.current)==null||te.focus()},children:h.jsx(Ij,{})})]}),L&&h.jsxs("div",{className:"dsn-date-time-picker-range-fields",children:[h.jsxs("div",{className:"dsn-date-time-picker-range-field",children:[h.jsx("label",{className:"dsn-date-time-picker-range-field-label",htmlFor:`${B}-start`,children:"Start"}),h.jsxs("div",{className:"dsn-date-time-picker-control",children:[h.jsx("span",{className:"dsn-date-time-picker-leading-icon","aria-hidden":"true",children:h.jsx(lf,{})}),h.jsx("input",{ref:xe,id:`${B}-start`,className:"dsn-date-time-picker-control-input",placeholder:s,value:ye,onChange:te=>Ie(te.target.value),disabled:f,"aria-label":M??"Start date","aria-required":g||void 0,"aria-invalid":p||void 0,"aria-describedby":K?H:void 0,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?F:void 0,onFocus:()=>{f||Mt(!0)},onClick:()=>{f||Mt(!0)},onBlur:te=>Mn(te.target.value,"range-start")})]})]}),h.jsxs("div",{className:"dsn-date-time-picker-range-field",children:[h.jsx("label",{className:"dsn-date-time-picker-range-field-label",htmlFor:`${B}-end`,children:"End"}),h.jsxs("div",{className:"dsn-date-time-picker-control",children:[h.jsx("span",{className:"dsn-date-time-picker-leading-icon","aria-hidden":"true",children:h.jsx(lf,{})}),h.jsx("input",{id:`${B}-end`,className:"dsn-date-time-picker-control-input",placeholder:o,value:Ct,onChange:te=>_t(te.target.value),disabled:f,"aria-label":"End date","aria-required":g||void 0,"aria-invalid":p||void 0,"aria-describedby":K?H:void 0,onFocus:()=>{f||Mt(!0)},onClick:()=>{f||Mt(!0)},onBlur:te=>Mn(te.target.value,"range-end")})]})]})]}),ne&&!f&&h.jsx(Rr,{role:"dialog","aria-label":L?"Choose date range":"Choose date",className:"dsn-date-time-picker-popover",contentClassName:"dsn-date-time-picker-popover-content",contentPadding:"none",anchorRef:ve,width:320,matchAnchorWidth:!1,minWidth:192,segment:ke.length>0?h.jsx("div",{className:"dsn-date-time-picker-presets",children:h.jsx(Jl,{label:"Date shortcuts",children:ke.map(te=>h.jsx(Xs,{size:"md",label:te.label,showLeadingIcon:!1,showTrailingIcon:!1,selected:Ke===te.id,onClick:()=>Yn(te)},te.id))})}):void 0,content:h.jsx("div",{id:F,children:hr}),bottomBar:Ue?h.jsx(Ia,{size:"md",leftActions:null,rightActions:h.jsxs(ui,{size:"md",spaceBetween:!0,"aria-label":"Date picker actions",children:[h.jsx(be,{variant:"ghost",size:"md",onClick:()=>{$==null||$(),Mt(!1)},children:C}),h.jsx(be,{variant:"primary",size:"md",onClick:()=>{j==null||j(D??null),Mt(!1)},children:O})]})}):void 0})]}),K&&h.jsxs("div",{className:"dsn-date-time-picker-meta",children:[x&&h.jsx("span",{className:"dsn-date-time-picker-meta-icon",children:x}),h.jsx("p",{id:H,className:"dsn-date-time-picker-helper",children:K})]})]}):h.jsxs("div",{ref:ie,className:["dsn-date-time-picker",y].filter(Boolean).join(" "),"data-error":p||void 0,"data-disabled":f||void 0,children:[i&&h.jsx("p",{id:R,className:"dsn-date-time-picker-label",children:i}),ke.length>0&&h.jsx("div",{className:"dsn-date-time-picker-presets",children:h.jsx(Jl,{label:"Quick date presets",children:ke.map(te=>h.jsx(Xs,{size:"md",label:te.label,showLeadingIcon:!1,showTrailingIcon:!1,selected:Ke===te.id,onClick:()=>Yn(te)},te.id))})}),h.jsx("div",{role:"dialog","aria-label":L?"Choose date range":"Choose date",children:hr}),K&&h.jsxs("div",{className:"dsn-date-time-picker-meta",children:[x&&h.jsx("span",{className:"dsn-date-time-picker-meta-icon",children:x}),h.jsx("p",{id:H,className:"dsn-date-time-picker-helper",children:K})]})]})}function Kj(){return h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M16 16L12 12M12 12L8 16M12 12V20M20.39 18.39C21.3655 17.8573 22.1359 17.0176 22.5789 16.0004C23.0218 14.9833 23.1125 13.8474 22.836 12.7737C22.5595 11.7 21.9317 10.7502 21.051 10.0757C20.1703 9.40118 19.0898 9.0399 17.98 9.05H16.72C16.4176 7.88024 15.854 6.79419 15.0709 5.87368C14.2878 4.95316 13.3058 4.22212 12.1998 3.73454C11.0938 3.24696 9.89114 3.01595 8.68219 3.05892C7.47325 3.10189 6.29018 3.41772 5.22287 3.98282C4.15556 4.54793 3.23226 5.3472 2.52208 6.32053C1.81191 7.29386 1.33398 8.41797 1.12408 9.605C0.914179 10.792 0.977588 12.0116 1.30956 13.1704C1.64154 14.3292 2.23322 15.3974 3.03999 16.29",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Yj({id:e,label:t="Label",helperText:n="Help text",helperIcon:r,disabled:i=!1,accept:a,multiple:s=!1,maxSizeText:o="Up to 100Mb",dragText:l="Drag and drop or press to upload",dropText:u="Drop here",onFilesSelected:c,onFocus:d,onBlur:f,className:g,"aria-label":p}){const m=_.useId(),v=e??`dsn-upload-area-${m}`,x=`${v}-label`,y=`${v}-helper`,b=_.useRef(null),[k,w]=_.useState(!1);function S(){var E;i||(E=b.current)==null||E.click()}function N(E){!E||E.length===0||c==null||c(Array.from(E))}return h.jsxs("div",{className:["dsn-upload-area",g].filter(Boolean).join(" "),children:[t&&h.jsx("p",{className:"dsn-upload-area-label",id:x,children:t}),h.jsxs("button",{id:v,type:"button",className:"dsn-upload-area-zone","data-disabled":i||void 0,"data-dragging":k||void 0,disabled:i,"aria-label":p??"Upload files - click or drag and drop","aria-labelledby":t?x:void 0,"aria-describedby":n?y:void 0,onClick:S,onFocus:d,onBlur:f,onDragOver:E=>{E.preventDefault(),i||w(!0)},onDragLeave:E=>{E.preventDefault(),w(!1)},onDrop:E=>{E.preventDefault(),w(!1),i||N(E.dataTransfer.files)},children:[h.jsx("span",{className:"dsn-upload-area-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-upload-area-icon",children:h.jsx(Kj,{})})}),h.jsx("span",{className:"dsn-upload-area-label-wrap",children:h.jsx("span",{className:"dsn-upload-area-main-text",children:k&&!i?u:l})}),!k&&h.jsx("span",{className:"dsn-upload-area-size-text",children:o})]}),h.jsx("input",{ref:b,type:"file",className:"dsn-upload-area-native",accept:a,multiple:s,disabled:i,onChange:E=>N(E.target.files)}),n&&h.jsxs("div",{className:"dsn-upload-area-meta",children:[r&&h.jsx("span",{className:"dsn-upload-area-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-upload-area-meta-icon",children:r})}),h.jsx("p",{id:y,className:"dsn-upload-area-helper",children:n})]})]})}function uf(e){if(e==null||typeof e=="boolean")return null;if(typeof e=="string"||typeof e=="number")return e;if(Array.isArray(e)){const t=e.map(n=>uf(n)).filter(n=>n!==null);return t.length>0?t:null}return _.isValidElement(e)?e:null}function vr({title:e,description:t,size:n="medium",leadingControl:r,trailingControl:i,className:a}){const s=["dsn-section-header",a].filter(Boolean).join(" "),o=uf(r),l=uf(i);return h.jsxs("div",{className:s,"data-size":n,"data-has-description":!!t||void 0,"data-has-leading-control":!!o||void 0,"data-has-trailing-control":!!l||void 0,children:[o&&h.jsx("div",{className:"dsn-section-header-control",children:o}),h.jsx("div",{className:"dsn-section-header-title-wrapper",children:h.jsxs("div",{className:"dsn-section-header-text",children:[h.jsx("p",{className:"dsn-section-header-title",children:e}),t&&h.jsx("p",{className:"dsn-section-header-description",children:t})]})}),l&&h.jsx("div",{className:"dsn-section-header-control",children:l})]})}function Gj(e){var n;return((n=e.find(r=>!r.disabled)??e[0])==null?void 0:n.value)??""}function Xj({tabs:e,value:t,defaultValue:n,onChange:r,className:i,showPanels:a=!0,panelClassName:s,"aria-label":o="Tabs"}){const l=_.useMemo(()=>Gj(e),[e]),u=t!==void 0,[c,d]=_.useState(n??l),f=u?t:c,g=_.useRef([]);_.useEffect(()=>{!u&&e.every(b=>b.value!==c)&&d(l)},[l,c,u,e]);const p=_.useCallback(b=>{const k=e.find(w=>w.value===b);!k||k.disabled||(u||d(b),b!==f&&(r==null||r(b)))},[u,r,f,e]),m=_.useCallback((b,k)=>{if(e.length===0)return-1;let w=b;for(let S=0;S<e.length;S+=1)if(w=(w+k+e.length)%e.length,!e[w].disabled)return w;return-1},[e]),v=_.useCallback(b=>{var k;b<0||(k=g.current[b])==null||k.focus()},[]),x=["dsn-tab",i].filter(Boolean).join(" "),y=["dsn-tab-panel",s].filter(Boolean).join(" ");return h.jsxs("div",{className:x,children:[h.jsx("div",{className:"dsn-tab-list",role:"tablist","aria-label":o,children:e.map((b,k)=>{const w=b.value===f,S=!!b.disabled,N=`dsn-tab-${b.value}`,E=`dsn-tabpanel-${b.value}`,T=w?0:-1;return h.jsx("button",{ref:C=>{g.current[k]=C},className:"dsn-tab-trigger",type:"button",role:"tab",id:N,"aria-controls":E,"aria-selected":w,"aria-label":b["aria-label"],"aria-disabled":S||void 0,disabled:S,"data-selected":w||void 0,tabIndex:T,onClick:()=>p(b.value),onKeyDown:C=>{if(C.key==="ArrowRight"){C.preventDefault();const O=m(k,1);v(O);return}if(C.key==="ArrowLeft"){C.preventDefault();const O=m(k,-1);v(O);return}if(C.key==="Home"){C.preventDefault();const O=e.findIndex($=>!$.disabled);v(O);return}if(C.key==="End"){C.preventDefault();const O=[...e].reverse().findIndex(j=>!j.disabled),$=O<0?-1:e.length-1-O;v($);return}(C.key===" "||C.key==="Enter")&&(C.preventDefault(),p(b.value))},children:h.jsxs("span",{className:"dsn-tab-trigger-content",children:[b.showLeadingIcon&&h.jsx("span",{className:"dsn-tab-icon-wrap","aria-hidden":"true",children:b.leadingIcon}),h.jsx("span",{className:"dsn-tab-label-wrap",children:h.jsx("span",{className:"dsn-tab-label",children:b.label})}),b.showTrailingIcon&&h.jsx("span",{className:"dsn-tab-icon-wrap","aria-hidden":"true",children:b.trailingIcon})]})},b.value)})}),a&&e.map(b=>{const k=`dsn-tabpanel-${b.value}`,w=`dsn-tab-${b.value}`,S=b.value===f;return h.jsx("div",{className:y,role:"tabpanel",id:k,"aria-labelledby":w,hidden:!S,children:b.panel},b.value)})]})}function Jj(e){var n;return((n=e.find(r=>!r.disabled)??e[0])==null?void 0:n.value)??""}function Xy({tabs:e,value:t,defaultValue:n,onChange:r,onRemove:i,addActionLabel:a,addActionLeadingIcon:s,onAddAction:o,addActionAriaLabel:l,className:u,showPanels:c=!0,panelClassName:d,"aria-label":f="Custom views"}){const g=_.useMemo(()=>Jj(e),[e]),p=t!==void 0,[m,v]=_.useState(n??g),x=p?t:m,y=_.useRef([]);_.useEffect(()=>{!p&&e.every(E=>E.value!==m)&&v(g)},[g,m,p,e]);const b=_.useCallback(E=>{const T=e.find(C=>C.value===E);!T||T.disabled||(p||v(E),E!==x&&(r==null||r(E)))},[p,r,x,e]),k=_.useCallback((E,T)=>{if(e.length===0)return-1;let C=E;for(let O=0;O<e.length;O+=1)if(C=(C+T+e.length)%e.length,!e[C].disabled)return C;return-1},[e]),w=_.useCallback(E=>{var T;E<0||(T=y.current[E])==null||T.focus()},[]),S=["dsn-custom-view-tabs",u].filter(Boolean).join(" "),N=["dsn-custom-view-tabs-panel",d].filter(Boolean).join(" ");return h.jsxs("div",{className:S,children:[h.jsxs("div",{className:"dsn-custom-view-tabs-list",role:"tablist","aria-label":f,children:[e.map((E,T)=>{const C=E.value===x,O=!!E.disabled,$=E.removable!==!1,j=E.showLeadingIcon!==!1,M=`dsn-custom-tab-${E.value}`,A=`dsn-custom-tabpanel-${E.value}`,z=C?0:-1;return h.jsxs("div",{className:"dsn-custom-view-tabs-item",ref:B=>{y.current[T]=B},role:"tab",id:M,"aria-controls":A,"aria-selected":C,"aria-label":E["aria-label"],"aria-disabled":O||void 0,"data-selected":C||void 0,"data-disabled":O||void 0,tabIndex:O?-1:z,onClick:()=>{O||b(E.value)},onKeyDown:B=>{if(!O){if(B.key==="ArrowRight"){B.preventDefault();const R=k(T,1);w(R);return}if(B.key==="ArrowLeft"){B.preventDefault();const R=k(T,-1);w(R);return}if(B.key==="Home"){B.preventDefault();const R=e.findIndex(H=>!H.disabled);w(R);return}if(B.key==="End"){B.preventDefault();const R=[...e].reverse().findIndex(F=>!F.disabled),H=R<0?-1:e.length-1-R;w(H);return}(B.key===" "||B.key==="Enter")&&(B.preventDefault(),b(E.value))}},children:[j&&h.jsx("span",{className:"dsn-custom-view-tabs-icon","data-icon":E.leadingIcon?"custom":"default","aria-hidden":"true",children:E.leadingIcon}),h.jsx("span",{className:"dsn-custom-view-tabs-label-wrap",children:h.jsx("span",{className:"dsn-custom-view-tabs-label",children:E.label})}),$&&h.jsx(be,{className:"dsn-custom-view-tabs-remove",variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,"aria-hidden":"true"}),"aria-label":E.removeAriaLabel??`Remove ${E.label}`,disabled:O,onClick:B=>{B.stopPropagation(),B.preventDefault(),i==null||i(E.value)}})]},E.value)}),a&&h.jsx("span",{className:"dsn-custom-view-tabs-add-wrap",children:h.jsx(be,{className:"dsn-custom-view-tabs-add-button",variant:"ghost",size:"md",showLeadingIcon:!0,leadingIcon:s??h.jsx($C,{size:16,"aria-hidden":"true"}),"aria-label":l??a,onClick:o,children:a})})]}),c&&e.map(E=>{const T=`dsn-custom-tabpanel-${E.value}`,C=`dsn-custom-tab-${E.value}`,O=E.value===x;return h.jsx("div",{className:N,role:"tabpanel",id:T,"aria-labelledby":C,hidden:!O,children:E.panel},E.value)})]})}const Zj=Xy;function Qj(e){return e==="none"?"desc":e==="desc"?"asc":"desc"}function eM(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function Jy({variant:e="title",state:t="default",label:n="Label",width:r,sortable:i=!1,sortDirection:a="none",reorderable:s=!0,resizable:o=!0,checkboxChecked:l=!1,checkboxIndeterminate:u=!1,onCheckboxChange:c,onSortChange:d,onReorderCommand:f,onResizeCommand:g,onResizePointerDown:p,onMoreClick:m,onReorderDragStart:v,onReorderDragEnd:x,filterValue:y,onFilterChange:b,leadingAccessory:k,className:w,"aria-label":S}){const N=["dsn-data-table-header-cell",w].filter(Boolean).join(" "),E=e==="title",T=E&&i,C=()=>{T&&(d==null||d(Qj(a)))},O=j=>{T&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),C())},$=E&&typeof r=="number"?{width:`${r}px`}:void 0;return h.jsx("div",{className:N,"data-variant":e,"data-state":t,role:"columnheader","aria-sort":E&&i?eM(a):void 0,"aria-label":S,style:$,tabIndex:T||s?0:-1,draggable:s||void 0,onClick:C,onKeyDown:O,onDragStart:s?v:void 0,onDragEnd:s?x:void 0,children:E?h.jsxs(h.Fragment,{children:[s&&h.jsxs("div",{className:"dsn-data-table-header-drag-indicator","aria-hidden":"true",children:[h.jsx("span",{}),h.jsx("span",{}),h.jsx("span",{}),h.jsx("span",{})]}),h.jsxs("div",{className:"dsn-data-table-header-cell-main",children:[k&&h.jsx("span",{className:"dsn-data-table-header-cell-leading-accessory",onClick:j=>j.stopPropagation(),children:k}),h.jsxs("div",{className:"dsn-data-table-header-cell-title",children:[h.jsx("span",{className:"dsn-data-table-header-cell-label",children:n}),i&&h.jsx("span",{className:"dsn-data-table-header-cell-sort","data-direction":a,"aria-hidden":"true",children:a==="asc"?h.jsx(vC,{size:14,strokeWidth:1.5}):h.jsx(gC,{size:14,strokeWidth:1.5})})]})]}),h.jsx("div",{className:"dsn-data-table-header-cell-controls",children:h.jsx(be,{variant:"ghost",size:"sm",showLeadingIcon:!0,leadingIcon:h.jsx(Xd,{size:14,strokeWidth:1.5,"aria-hidden":"true"}),showLabel:!1,onClick:j=>{j.stopPropagation(),m==null||m(j)},"aria-label":"Column options"})}),o&&h.jsx("button",{type:"button",className:"dsn-data-table-header-resizer","aria-label":"Resize column",onClick:j=>j.stopPropagation(),onPointerDown:j=>{j.stopPropagation(),p==null||p(j)},onKeyDown:j=>{j.stopPropagation(),j.key==="ArrowLeft"?(j.preventDefault(),g==null||g("decrease")):j.key==="ArrowRight"&&(j.preventDefault(),g==null||g("increase"))}})]}):h.jsx("div",{className:"dsn-data-table-header-cell-checkbox-wrap",onClick:j=>j.stopPropagation(),children:h.jsx(Xn,{size:"sm",checked:l,indeterminate:u,showContent:!1,"aria-label":S??"Select all rows",onCheckedChange:c})})})}function tM({values:e}){const t=_.useRef(null),n=_.useRef(null),r=_.useRef(null),i=_.useRef(null),a=_.useRef(null),[s,o]=_.useState(e.length),[l,u]=_.useState(!1),c=Math.max(0,e.length-s),d=_.useCallback(()=>{const f=t.current,g=n.current,p=r.current;if(!f||!g)return;const m=f.clientWidth;if(m<=0)return;const x=Array.from(g.querySelectorAll("[data-measure-tag]")).map(S=>S.getBoundingClientRect().width),y=Number.parseFloat(window.getComputedStyle(f).columnGap||"0")||0,b=(p==null?void 0:p.getBoundingClientRect().width)??0;let k=0,w=0;for(let S=0;S<x.length;S+=1){const N=k+(w>0?y:0)+x[S],T=x.length-(S+1)>0?(w>=0?y:0)+b:0;if(N+T<=m)k=N,w+=1;else break}o(w)},[]);return _.useEffect(()=>{o(e.length)},[e]),_.useEffect(()=>{d()},[d,e]),_.useEffect(()=>{c===0&&l&&u(!1)},[l,c]),_.useEffect(()=>{const f=t.current;if(!f||typeof ResizeObserver>"u")return;const g=new ResizeObserver(()=>d());return g.observe(f),()=>g.disconnect()},[d]),_.useEffect(()=>{if(!l)return;const f=p=>{p.key==="Escape"&&u(!1)},g=p=>{const m=p.target,v=i.current,x=a.current;v!=null&&v.contains(m)||x!=null&&x.contains(m)||u(!1)};return window.addEventListener("keydown",f),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",f),window.removeEventListener("mousedown",g)}},[l]),h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"dsn-data-table-cell-tags",ref:t,children:[e.slice(0,s).map((f,g)=>h.jsx(zr,{size:"sm",variant:"highlight",label:f,showIcon:!1},`${f}-${g}`)),c>0&&h.jsx("button",{ref:i,type:"button",className:"dsn-data-table-cell-tags-overflow-trigger","aria-label":`Show ${c} more tags`,"aria-haspopup":"dialog","aria-expanded":l,onClick:f=>{f.stopPropagation(),u(g=>!g)},children:h.jsx(zr,{size:"sm",variant:"neutral",label:`+${c}`,showIcon:!1})})]}),h.jsxs("span",{className:"dsn-data-table-cell-tags-measure",ref:n,"aria-hidden":"true",children:[e.map((f,g)=>h.jsx("span",{"data-measure-tag":!0,children:h.jsx(zr,{size:"sm",variant:"highlight",label:f,showIcon:!1})},`${f}-${g}`)),h.jsx("span",{ref:r,children:h.jsx(zr,{size:"sm",variant:"neutral",label:`+${e.length}`,showIcon:!1})})]}),l&&c>0&&h.jsx("div",{className:"dsn-data-table-cell-tags-popover",ref:a,children:h.jsx(Rr,{anchorRef:i,role:"dialog","aria-label":"Hidden tags",width:280,contentPadding:"small",content:h.jsx("div",{className:"dsn-data-table-cell-tags-popover-content",children:e.map((f,g)=>h.jsx(zr,{size:"sm",variant:"highlight",label:f,showIcon:!1},`${f}-${g}`))})})})]})}function eu(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M6 6.5H3.5V12.5H9.5V10",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M6.5 3.5H12.5V9.5H6.5V3.5Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function nM(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M3 11.5L5 11L11.5 4.5L10 3L3.5 9.5L3 11.5Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function Zy(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M5.5 5.5V11",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M8 5.5V11",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M10.5 5.5V11",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M3.5 4H12.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M5 4V3.5C5 3.22 5.22 3 5.5 3H10.5C10.78 3 11 3.22 11 3.5V4",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M4.5 4L5 12.5H11L11.5 4",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function rM(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("rect",{x:"3",y:"4.5",width:"10",height:"8.5",rx:"1.5",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("path",{d:"M3 7H13",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M5.5 3V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),h.jsx("path",{d:"M10.5 3V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function iM(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M6.5 3.5H3.5V12.5H12.5V9.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M9.5 3.5H12.5M12.5 3.5V6.5M12.5 3.5L7.5 8.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function aM(e,t,n){switch(e){case"number":return h.jsx("span",{children:typeof t=="number"?t.toLocaleString():t??""});case"date":return h.jsx("span",{children:String(t??"")});case"tag":{const i=(Array.isArray(t)?t:t!=null?[t]:[]).map(a=>String(a));return h.jsx(tM,{values:i})}case"user":{const r=t??{name:""};return h.jsxs("span",{className:"dsn-data-table-cell-user",children:[h.jsx(Wi,{size:"xs",variant:"profile",fill:"initials",initials:r.initials??r.name.slice(0,2).toUpperCase(),name:r.name}),h.jsx("span",{children:r.name})]})}case"boolean":return h.jsx(Da,{size:"sm",checked:!!t,disabled:!0,"aria-label":t?"True value":"False value"});case"checkbox":return h.jsx(Xn,{size:"sm",checked:!!t,showContent:!1,"aria-label":t?"Selected row":"Unselected row",onCheckedChange:n});case"url":return h.jsx("a",{className:"dsn-data-table-cell-link",href:String(t??"#"),children:String(t??"")});case"empty":return h.jsx("span",{className:"dsn-data-table-cell-empty",children:String(t??"Add [field name]")});case"string":default:return h.jsx("span",{children:String(t??"")})}}function sM(e){return e==="string"?h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(eu,{}),"aria-label":"Copy cell value"}):e==="number"?h.jsxs(ui,{size:"sm",spaceBetween:!1,"aria-label":"Number cell actions",children:[h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(nM,{}),"aria-label":"Edit number value"}),h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(Zy,{}),"aria-label":"Delete number value"})]}):e==="date"?h.jsxs(ui,{size:"sm",spaceBetween:!1,"aria-label":"Date cell actions",children:[h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(rM,{}),"aria-label":"Open date picker"}),h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(Zy,{}),"aria-label":"Clear date value"})]}):e==="user"?h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(eu,{}),"aria-label":"Copy user name"}):e==="tag"?h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(eu,{}),"aria-label":"Copy tags"}):e==="url"?h.jsxs(ui,{size:"sm",spaceBetween:!1,"aria-label":"URL cell actions",children:[h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(eu,{}),"aria-label":"Copy URL"}),h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(iM,{}),"aria-label":"Open URL in new tab"})]}):null}function Qy({fieldType:e="string",state:t="default",loading:n=!1,value:r="Label",width:i,onCheckboxChange:a,leadingAccessory:s,align:o="left",className:l,"aria-label":u}){const c=["dsn-data-table-cell",l].filter(Boolean).join(" "),d=t==="hover"&&!n?sM(e):null,f=typeof i=="number"?{width:`${i}px`}:void 0;return h.jsx("div",{className:c,"data-field-type":e,"data-state":t,"data-loading":n||void 0,"data-align":o,"aria-label":u,style:f,children:n?h.jsx("span",{className:"dsn-data-table-cell-skeleton","aria-hidden":"true"}):h.jsxs(h.Fragment,{children:[s&&h.jsx("span",{className:"dsn-data-table-cell-leading-accessory",children:s}),h.jsx("span",{className:"dsn-data-table-cell-content",children:aM(e,r,a)}),d&&h.jsx("span",{className:"dsn-data-table-cell-actions",children:d})]})})}function e0(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.5L13.5 8L8 13.5L2.5 8L8 2.5Z",stroke:"currentColor",strokeWidth:"var(--border-width-medium)",strokeLinejoin:"round"})})}function oM(){return h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M6 6.5H3.5V12.5H9.5V10",stroke:"currentColor",strokeWidth:"var(--border-width-medium)",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M6.5 3.5H12.5V9.5H6.5V3.5Z",stroke:"currentColor",strokeWidth:"var(--border-width-medium)",strokeLinecap:"round",strokeLinejoin:"round"})]})}function lM({alignment:e="inline",variant:t="with-title",state:n="default",title:r="Title",description:i="Description",content:a,showIcon:s=!0,icon:o,showActions:l=!0,actionAriaLabel:u="Copy description",onActionClick:c,className:d,"aria-label":f}){const g=t==="with-title",p=a!=null,m=["dsn-data-list-cell",d].filter(Boolean).join(" "),v=p?h.jsx("span",{className:"dsn-data-list-cell-interactive-content",children:a}):h.jsx("p",{className:"dsn-data-list-cell-description",children:i});return h.jsxs("div",{className:m,"data-alignment":e,"data-variant":t,"data-state":n,role:"group","aria-label":f,children:[e==="inline"?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"dsn-data-list-cell-title-wrapper",children:[s&&h.jsx("span",{className:"dsn-data-list-cell-icon","aria-hidden":"true",children:o??h.jsx(e0,{})}),g&&h.jsx("p",{className:"dsn-data-list-cell-title",children:r})]}),h.jsx("div",{className:"dsn-data-list-cell-text-block",children:v})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"dsn-data-list-cell-title-description-wrapper",children:h.jsxs("div",{className:"dsn-data-list-cell-title-wrapper",children:[s&&h.jsx("span",{className:"dsn-data-list-cell-icon","aria-hidden":"true",children:o??h.jsx(e0,{})}),g&&h.jsx("p",{className:"dsn-data-list-cell-title",children:r})]})}),h.jsx("div",{className:"dsn-data-list-cell-text-block",children:v})]}),l&&h.jsx("span",{className:"dsn-data-list-cell-actions",children:h.jsx(be,{variant:"secondary",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(oM,{}),"aria-label":u,onClick:x=>{x.stopPropagation(),c==null||c(x)}})})]})}function uM(e){if(e.kind==="menu-cell"){const n=e.props??{};return h.jsx(Ui,{variant:e.variant??"default",label:"Label",showLeadingIcon:!0,...n})}if(e.kind==="checkbox-cell"){const n=e.props??{};return h.jsx(Xn,{label:"Label",showLeadingIcon:!0,...n})}const t=e.props??{};return h.jsx(rf,{label:"Label",showLeadingIcon:!0,...t})}function t0({title:e="Choice list",description:t,sections:n,showHeader:r=!0,showSectionHeaders:i=!0,className:a,sectionClassName:s,enableMenuKeyboardNavigation:o=!1,onMenuEscape:l}){const u=_.useRef(null),c=["dsn-choice-list",a].filter(Boolean).join(" "),d=["dsn-choice-list-section",s].filter(Boolean).join(" "),f=_.useCallback(()=>u.current?Array.from(u.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')):[],[]),g=_.useCallback(p=>{const m=f();if(m.length===0)return;const v=Math.min(Math.max(p,0),m.length-1);m.forEach((x,y)=>{x.tabIndex=y===v?0:-1})},[f]);return _.useEffect(()=>{o&&g(0)},[o,n,g]),h.jsxs("section",{ref:u,className:c,"aria-label":e,onKeyDown:p=>{var b,k,w,S;if(!o)return;const m=f();if(m.length===0)return;const v=document.activeElement,x=v?m.indexOf(v):-1,y=x>=0?x:0;if(p.key==="ArrowDown"){p.preventDefault();const N=(y+1)%m.length;g(N),(b=m[N])==null||b.focus();return}if(p.key==="ArrowUp"){p.preventDefault();const N=(y-1+m.length)%m.length;g(N),(k=m[N])==null||k.focus();return}if(p.key==="Home"){p.preventDefault(),g(0),(w=m[0])==null||w.focus();return}if(p.key==="End"){p.preventDefault();const N=m.length-1;g(N),(S=m[N])==null||S.focus();return}p.key==="Escape"&&(p.preventDefault(),l==null||l())},children:[r&&h.jsx("header",{className:"dsn-choice-list-header",children:h.jsx(vr,{title:e,description:t,size:"large"})}),h.jsx("div",{className:"dsn-choice-list-sections",children:n.map(p=>h.jsxs("section",{className:d,"aria-label":p.title,children:[i&&h.jsx(vr,{title:p.title,size:"small"}),h.jsx("div",{className:"dsn-choice-list-items",children:p.items.map(m=>h.jsx("div",{className:"dsn-choice-list-item",children:uM(m)},m.id))})]},p.id))})]})}function cM({id:e,label:t="Label",checkboxLabel:n="Label",checked:r,defaultChecked:i=!1,disabled:a=!1,helperText:s="Help text",helperIcon:o,error:l=!1,errorMessage:u,required:c=!1,className:d,checkboxProps:f,onCheckedChange:g,"aria-label":p}){const m=_.useId(),x=`${e??`dsn-checkbox-field-${m}`}-helper`,y=r!==void 0,[b,k]=_.useState(i),w=y?r:b,S=l&&u?u:s;function N(E){y||k(E),g==null||g(E)}return h.jsxs("div",{className:["dsn-checkbox-field",d].filter(Boolean).join(" "),"data-error":l||void 0,"data-disabled":a||void 0,children:[h.jsxs("fieldset",{className:"dsn-checkbox-fieldset","aria-label":p,"aria-describedby":S?x:void 0,"aria-invalid":l||void 0,"aria-required":c||void 0,children:[h.jsxs("legend",{className:"dsn-checkbox-field-label",children:[t,c&&h.jsxs("span",{className:"dsn-checkbox-field-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsx("div",{className:"dsn-checkbox-field-control",children:h.jsx(Xn,{className:"dsn-checkbox--full-width",label:n,checked:w,disabled:a,showTrailingIcon:!1,onCheckedChange:N,...f})})]}),S&&h.jsxs("div",{className:"dsn-checkbox-field-meta",children:[o&&h.jsx("span",{className:"dsn-checkbox-field-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-checkbox-field-meta-icon",children:o})}),h.jsx("p",{id:x,className:"dsn-checkbox-field-helper",children:S})]})]})}function dM(){return h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.5L13.5 8L8 13.5L2.5 8L8 2.5Z",stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}function fM({label:e,description:t,showDescription:n=!0,showIcon:r=!1,iconSlot:i,error:a=!1,labelWidth:s,children:o,className:l}){const u=_.useId(),c=`dsn-horizontal-input-label-${u}`,d=`dsn-horizontal-input-description-${u}`,f=n&&!!t,g=i??h.jsx(dM,{}),p={...s?{"--dsn-horizontal-input-label-width":s}:{}};return h.jsx("div",{className:["dsn-horizontal-input",l].filter(Boolean).join(" "),"data-error":a||void 0,"data-has-icon":r||void 0,style:p,children:h.jsxs("div",{className:"dsn-horizontal-input-row",children:[h.jsxs("div",{className:"dsn-horizontal-input-meta",children:[h.jsxs("div",{className:"dsn-horizontal-input-label-row",children:[r&&h.jsx("span",{className:"dsn-horizontal-input-icon","aria-hidden":"true",children:g}),h.jsx("span",{id:c,className:"dsn-horizontal-input-label",children:e})]}),f&&h.jsx("p",{id:d,className:"dsn-horizontal-input-description",children:t})]}),h.jsx("div",{className:"dsn-horizontal-input-content",role:"group","aria-labelledby":c,"aria-describedby":f?d:void 0,children:o})]})})}const hM=Array.from({length:6},(e,t)=>({id:`option-${t+1}`,label:"Label",checked:!1}));function pM({id:e,label:t="Label",options:n=hM,helperText:r="Help text",helperIcon:i,error:a=!1,errorMessage:s,required:o=!1,disabled:l=!1,className:u,onOptionChange:c,"aria-label":d}){const f=_.useId(),p=`${e??`dsn-multi-choice-${f}`}-helper`,m=a&&s?s:r;return h.jsxs("div",{className:["dsn-multi-choice",u].filter(Boolean).join(" "),"data-error":a||void 0,"data-disabled":l||void 0,children:[h.jsxs("fieldset",{className:"dsn-multi-choice-fieldset","aria-label":d,"aria-describedby":m?p:void 0,"aria-invalid":a||void 0,"aria-required":o||void 0,children:[h.jsxs("legend",{className:"dsn-multi-choice-label",children:[t,o&&h.jsxs("span",{className:"dsn-multi-choice-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsx("div",{className:"dsn-multi-choice-stack",children:n.map(v=>h.jsx(Xn,{className:"dsn-checkbox--full-width",label:v.label,checked:v.checked,disabled:l||v.disabled,showTrailingIcon:!1,showDescription:!!v.description,description:v.description,showDescriptionRight:!!v.descriptionRight,descriptionRight:v.descriptionRight,onCheckedChange:x=>c==null?void 0:c(v.id,x),...v.checkboxProps},v.id))})]}),m&&h.jsxs("div",{className:"dsn-multi-choice-meta",children:[i&&h.jsx("span",{className:"dsn-multi-choice-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-multi-choice-meta-icon",children:i})}),h.jsx("p",{id:p,className:"dsn-multi-choice-helper",children:m})]})]})}const gM=Array.from({length:6},(e,t)=>({id:`option-${t+1}`,label:"Label"}));function mM({id:e,label:t="Label",options:n=gM,value:r,defaultValue:i,helperText:a="Help text",helperIcon:s,error:o=!1,errorMessage:l,required:u=!1,disabled:c=!1,className:d,onValueChange:f,"aria-label":g}){const p=_.useId(),m=e??`dsn-single-choice-${p}`,v=`${m}-legend`,x=`${m}-helper`,y=o&&l?l:a,b=r!==void 0,[k,w]=_.useState(i??""),S=b?r:k;function N(E){b||w(E),f==null||f(E)}return h.jsxs("div",{className:["dsn-single-choice",d].filter(Boolean).join(" "),"data-error":o||void 0,"data-disabled":c||void 0,children:[h.jsxs("fieldset",{className:"dsn-single-choice-fieldset","aria-label":g,"aria-describedby":y?x:void 0,"aria-invalid":o||void 0,"aria-required":u||void 0,children:[h.jsxs("legend",{id:v,className:"dsn-single-choice-label",children:[t,u&&h.jsxs("span",{className:"dsn-single-choice-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsx("div",{className:"dsn-single-choice-stack",role:"radiogroup","aria-labelledby":v,children:n.map(E=>h.jsx(rf,{className:"dsn-radio--full-width",label:E.label,checked:S===E.id,disabled:c||E.disabled,showTrailingIcon:!1,showDescription:!!E.description,description:E.description,showDescriptionRight:!!E.descriptionRight,descriptionRight:E.descriptionRight,onCheckedChange:T=>{T&&N(E.id)},...E.radioProps},E.id))})]}),y&&h.jsxs("div",{className:"dsn-single-choice-meta",children:[s&&h.jsx("span",{className:"dsn-single-choice-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-single-choice-meta-icon",children:s})}),h.jsx("p",{id:x,className:"dsn-single-choice-helper",children:y})]})]})}function vM({selectedCount:e,onCountClick:t,onDismiss:n,actions:r,className:i}){const a=e===1?"item":"items";return h.jsx("div",{className:`dsn-bulk-action-bar${i?` ${i}`:""}`,role:"toolbar","aria-label":`${e} ${a} selected`,children:h.jsxs("div",{className:"dsn-bulk-action-bar-container",children:[h.jsxs("div",{className:"dsn-bulk-action-bar-selection",role:"group","aria-label":"Selection",children:[h.jsxs(be,{variant:"secondary",size:"md",showLabel:!0,showTrailingIcon:!0,trailingIcon:h.jsx(Fr,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),onClick:t,"aria-label":`${e} selected, click to view selection options`,children:[e," selected"]}),h.jsx(be,{variant:"secondary",size:"md",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),onClick:n,"aria-label":"Clear selection"})]}),h.jsx(ui,{size:"md",spaceBetween:!0,"aria-label":"Bulk actions",children:r.map((s,o)=>h.jsx(be,{variant:"secondary",size:"md",showLeadingIcon:s.icon!=null,leadingIcon:s.icon,showLabel:!0,showTrailingIcon:s.hasDropdown,trailingIcon:s.hasDropdown?h.jsx(Fr,{size:16,strokeWidth:1.5,"aria-hidden":"true"}):void 0,destructive:s.destructive,disabled:s.disabled,onClick:s.onClick,"aria-haspopup":s.hasDropdown?"menu":void 0,"aria-label":s["aria-label"],children:s.label},o))})]})})}const yM=Array.from({length:8},(e,t)=>({id:`option-${t+1}`,label:"Label"}));function xM({id:e,label:t="Label",options:n=yM,value:r,defaultValue:i=[],helperText:a="Help text",helperIcon:s,error:o=!1,errorMessage:l,required:u=!1,disabled:c=!1,size:d="md",className:f,onValueChange:g,"aria-label":p}){const m=_.useId(),x=`${e??`dsn-chip-field-${m}`}-helper`,y=o&&l?l:a,b=r!==void 0,[k,w]=_.useState(i),S=b?r:k,N=new Set(S);function E(T){const C=N.has(T)?S.filter(O=>O!==T):[...S,T];b||w(C),g==null||g(C)}return h.jsxs("div",{className:["dsn-chip-field",f].filter(Boolean).join(" "),"data-error":o||void 0,"data-disabled":c||void 0,children:[h.jsxs("fieldset",{className:"dsn-chip-fieldset","aria-label":p,"aria-describedby":y?x:void 0,"aria-invalid":o||void 0,"aria-required":u||void 0,children:[h.jsxs("legend",{className:"dsn-chip-field-label",children:[t,u&&h.jsxs("span",{className:"dsn-chip-field-required","aria-hidden":"true",children:[" ","*"]})]}),h.jsx(Jl,{label:t,className:"dsn-chip-field-group",children:n.map(T=>h.jsx(Xs,{label:T.label,size:d,selected:N.has(T.id),disabled:c||T.disabled,onClick:()=>E(T.id),...T.chipProps},T.id))})]}),y&&h.jsxs("div",{className:"dsn-chip-field-meta",children:[s&&h.jsx("span",{className:"dsn-chip-field-meta-icon-wrap","aria-hidden":"true",children:h.jsx("span",{className:"dsn-chip-field-meta-icon",children:s})}),h.jsx("p",{id:x,className:"dsn-chip-field-helper",children:y})]})]})}function Zs(e,t,n){return Math.min(n,Math.max(t,e))}function Fa(e,t,n,r){if(r<=0)return Zs(e,t,n);const i=t+Math.round((e-t)/r)*r,a=Zs(i,t,n);return Number(a.toFixed(6))}function cf(e,t,n,r){const i=Fa(e[0],t,n,r),a=Fa(e[1],t,n,r);return[Math.min(i,a),Math.max(i,a)]}function df(e){const r=72+e.length*9;return Zs(r,104,184)}function bM({id:e,mode:t="single",stack:n="vertical",showInput:r=!1,value:i,defaultValue:a,rangeValue:s,defaultRangeValue:o,min:l=0,max:u=100,step:c=1,disabled:d=!1,showValue:f=!0,showMinMax:g=!1,minLabel:p,maxLabel:m,minInputLabel:v="Minimum",maxInputLabel:x="Maximum",className:y,onValueChange:b,onRangeChange:k,valueFormatter:w=O=>String(O),minHandleAriaLabel:S="Minimum value",maxHandleAriaLabel:N="Maximum value","aria-label":E,"aria-labelledby":T,"aria-valuetext":C}){const O=_.useId(),$=e??`dsn-slider-${O}`,j=Math.min(l,u),M=Math.max(l,u),A=c>0?c:1,z=t==="single",B=n==="vertical",R=i!==void 0,H=s!==void 0,[F,L]=_.useState(()=>Fa(a??j,j,M,A)),[U,K]=_.useState(()=>cf(o??[j,M],j,M,A)),[Y,G]=_.useState(!1),[Q,ne]=_.useState("single"),se=_.useRef(null),W=_.useRef(null),X=R?Fa(i,j,M,A):F,D=H?cf(s,j,M,A):U,P=_.useMemo(()=>M<=j?0:(X-j)/(M-j)*100,[X,j,M]),q=_.useMemo(()=>{if(M<=j)return{minPct:0,maxPct:0};const ye=(D[0]-j)/(M-j)*100,Ie=(D[1]-j)/(M-j)*100;return{minPct:ye,maxPct:Ie}},[D,j,M]);function ee(ye){const Ie=Fa(ye,j,M,A);R||L(Ie),b==null||b(Ie)}function he(ye){const Ie=cf(ye,j,M,A);H||K(Ie),k==null||k(Ie)}function re(ye,Ie){const Ct=Fa(Ie,j,M,A);if(ye==="min"){he([Math.min(Ct,D[1]),D[1]]);return}he([D[0],Math.max(Ct,D[0])])}function pe(ye,Ie,Ct){const _t=Ie.getBoundingClientRect(),ie=_t.width||1,xe=(ye-_t.left)/ie,ve=Zs(xe,0,1),Ne=j+ve*(M-j);if(z){ee(Ne);return}re(Ct??(Q==="max"?"max":"min"),Ne)}function ke(ye){if(d)return;const Ie=ye.currentTarget;if(z)ne("single");else{const Ct=Ie.getBoundingClientRect(),_t=Ct.width||1,ie=Zs((ye.clientX-Ct.left)/_t,0,1),xe=j+ie*(M-j),ve=Math.abs(xe-D[0]),Ne=Math.abs(xe-D[1]),gt=ve<=Ne?"min":"max";ne(gt),Ie.setPointerCapture(ye.pointerId),G(!0),pe(ye.clientX,Ie,gt);return}Ie.setPointerCapture(ye.pointerId),G(!0),pe(ye.clientX,Ie)}function Ue(ye){d||!Y||pe(ye.clientX,ye.currentTarget)}function Qe(ye){ye.currentTarget.hasPointerCapture(ye.pointerId)&&(ye.currentTarget.releasePointerCapture(ye.pointerId),G(!1))}function vt(ye){if(d)return;const Ie=A*10,_t=ye.currentTarget.getAttribute("data-handle")??"single",ie=_t==="min"?D[0]:_t==="max"?D[1]:X;function xe(ve){_t==="min"||_t==="max"?re(_t,ve):ee(ve)}switch(ye.key){case"ArrowRight":case"ArrowUp":ye.preventDefault(),xe(ie+A);break;case"ArrowLeft":case"ArrowDown":ye.preventDefault(),xe(ie-A);break;case"PageUp":ye.preventDefault(),xe(ie+Ie);break;case"PageDown":ye.preventDefault(),xe(ie-Ie);break;case"Home":ye.preventDefault(),xe(j);break;case"End":ye.preventDefault(),xe(M);break}}const Re=p??w(j),Ke=m??w(M),ft=C??w(X),ut=`${w(D[0])} - ${w(D[1])}`,yt=q.minPct,Le=q.maxPct-q.minPct,Et=f&&(z||!r),Tt=df(w(X)),at=df(w(D[0])),fr=df(w(D[1]));function jn(){var Ie;const ye=(Ie=W.current)==null?void 0:Ie.querySelector("input");ye instanceof HTMLInputElement&&(ye.focus(),ye.select())}function Ut(ye){ye.key==="Enter"&&(ye.preventDefault(),jn())}return h.jsxs("div",{className:["dsn-slider",y].filter(Boolean).join(" "),id:$,"data-disabled":d||void 0,"data-stack":n,children:[Et&&h.jsx("div",{className:"dsn-slider-value",children:z?w(X):ut}),r&&z&&B&&h.jsx(Hi,{value:X,min:j,max:M,step:A,disabled:d,onChange:ye=>{ye!==null&&ee(ye)},"aria-label":E??"Slider value"}),r&&!z&&B&&h.jsxs("div",{className:"dsn-slider-input-row",children:[h.jsx("div",{ref:se,onKeyDown:Ut,children:h.jsx(Hi,{label:v,value:D[0],min:j,max:D[1],step:A,disabled:d,onChange:ye=>{ye!==null&&re("min",ye)},"aria-label":S})}),h.jsx("div",{ref:W,children:h.jsx(Hi,{label:x,value:D[1],min:D[0],max:M,step:A,disabled:d,onChange:ye=>{ye!==null&&re("max",ye)},"aria-label":N})})]}),h.jsxs("div",{className:"dsn-slider-main-row",children:[r&&!z&&!B&&h.jsx("div",{ref:se,onKeyDown:Ut,style:{width:`${at}px`},children:h.jsx(Hi,{className:"dsn-slider-inline-input",value:D[0],min:j,max:D[1],step:A,disabled:d,onChange:ye=>{ye!==null&&re("min",ye)},"aria-label":S})}),h.jsxs("div",{className:"dsn-slider-track",onPointerDown:ke,onPointerMove:Ue,onPointerUp:Qe,onPointerCancel:Qe,onLostPointerCapture:()=>G(!1),children:[h.jsx("div",{className:"dsn-slider-bar"}),h.jsx("div",{className:"dsn-slider-range",style:z?{width:`${P}%`}:{left:`${yt}%`,width:`${Le}%`}}),h.jsx("div",{className:"dsn-slider-handle-wrap",style:{left:`${z?P:yt}%`},children:h.jsx("div",{role:"slider",tabIndex:d?-1:0,className:"dsn-slider-handle","data-handle":z?"single":"min","data-dragging":Y&&Q===(z?"single":"min")?!0:void 0,"aria-disabled":d||void 0,"aria-valuemin":j,"aria-valuemax":z?M:D[1],"aria-valuenow":z?X:D[0],"aria-valuetext":z?ft:w(D[0]),"aria-label":z?E??"Slider value":S,"aria-labelledby":z?T:void 0,onKeyDown:vt})}),!z&&h.jsx("div",{className:"dsn-slider-handle-wrap",style:{left:`${q.maxPct}%`},children:h.jsx("div",{role:"slider",tabIndex:d?-1:0,className:"dsn-slider-handle","data-handle":"max","data-dragging":Y&&Q==="max"?!0:void 0,"aria-disabled":d||void 0,"aria-valuemin":D[0],"aria-valuemax":M,"aria-valuenow":D[1],"aria-valuetext":w(D[1]),"aria-label":N,onKeyDown:vt})})]}),r&&z&&!B&&h.jsx("div",{style:{width:`${Tt}px`},children:h.jsx(Hi,{className:"dsn-slider-inline-input",value:X,min:j,max:M,step:A,disabled:d,onChange:ye=>{ye!==null&&ee(ye)},"aria-label":E??"Slider value"})}),r&&!z&&!B&&h.jsx("div",{ref:W,style:{width:`${fr}px`},children:h.jsx(Hi,{className:"dsn-slider-inline-input",value:D[1],min:D[0],max:M,step:A,disabled:d,onChange:ye=>{ye!==null&&re("max",ye)},"aria-label":N})})]}),g&&h.jsxs("div",{className:"dsn-slider-minmax","aria-hidden":"true",children:[h.jsx("span",{children:Re}),h.jsx("span",{children:Ke})]})]})}const _M=3e3,wM=200;function kM(e){switch(e){case"success":return h.jsx(Dy,{size:16,"aria-hidden":"true"});case"warning":return h.jsx(Ry,{size:16,"aria-hidden":"true"});case"error":return h.jsx(Gd,{size:16,"aria-hidden":"true"});case"default":default:return h.jsx(Jd,{size:16,"aria-hidden":"true"})}}function SM({variant:e="inline",severity:t="default",title:n,description:r,actionLabel:i,onAction:a,dismissible:s=!0,dismissLabel:o="Dismiss notification",onDismiss:l,icon:u,className:c}){const[d,f]=_.useState(!0),[g,p]=_.useState(!1),m=_.useRef(null),v=_.useRef(null),x=_.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),y=_.useCallback(()=>{x(),!g&&(m.current=setTimeout(()=>{p(!0)},_M))},[x,g]);_.useEffect(()=>(y(),()=>{x()}),[x,y]),_.useEffect(()=>{if(g)return x(),v.current=setTimeout(()=>{f(!1),l==null||l()},wM),()=>{v.current&&(clearTimeout(v.current),v.current=null)}},[x,g,l]);const b=t==="error"?"assertive":"polite",k=t==="error"?"alert":"status",w=e==="rich"&&!!r;return d?h.jsxs("div",{className:["dsn-toast",c].filter(Boolean).join(" "),"data-severity":t,"data-variant":e,"data-state":g?"exit":"enter",role:k,"aria-live":b,"aria-atomic":"true",onMouseEnter:x,onMouseLeave:y,children:[h.jsx("span",{className:"dsn-toast-icon","aria-hidden":"true",children:u??kM(t)}),h.jsxs("div",{className:"dsn-toast-content",children:[h.jsx("div",{className:"dsn-toast-title",children:n}),w?h.jsx("div",{className:"dsn-toast-description",children:r}):null]}),i?h.jsx(be,{className:"dsn-toast-action",variant:"secondary",size:"sm",onClick:a,children:i}):null,s?h.jsx(be,{className:"dsn-toast-dismiss",variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,"aria-hidden":"true"}),"aria-label":o,onClick:()=>p(!0)}):null]}):null}function NM(e){switch(e){case"success":return h.jsx(Dy,{size:16,"aria-hidden":"true"});case"warning":return h.jsx(Ry,{size:16,"aria-hidden":"true"});case"error":return h.jsx(Gd,{size:16,"aria-hidden":"true"});case"default":default:return h.jsx(Jd,{size:16,"aria-hidden":"true"})}}function EM({severity:e="default",title:t,description:n,icon:r,content:i,actions:a,supporting:s,dismissible:o=!0,dismissLabel:l="Dismiss callout",onDismiss:u,className:c}){const d=!!i,f=!!a||!!s,g=e==="error"?"alert":"status",p=e==="error"?"assertive":"polite";return h.jsxs("section",{className:["dsn-callout",c].filter(Boolean).join(" "),"data-severity":e,role:g,"aria-live":p,"aria-atomic":"true",children:[h.jsxs("div",{className:"dsn-callout-header",children:[h.jsx("span",{className:"dsn-callout-icon","aria-hidden":"true",children:r??NM(e)}),h.jsxs("div",{className:"dsn-callout-text",children:[h.jsx("p",{className:"dsn-callout-title",children:t}),n?h.jsx("p",{className:"dsn-callout-description",children:n}):null]}),o?h.jsx(be,{className:"dsn-callout-dismiss",variant:"ghost",size:"sm",showLabel:!1,showLeadingIcon:!0,leadingIcon:h.jsx(gr,{size:16,"aria-hidden":"true"}),"aria-label":l,onClick:u}):null]}),d?h.jsx("div",{className:"dsn-callout-content",children:i}):null,f?h.jsxs("div",{className:"dsn-callout-footer",children:[h.jsx("div",{className:"dsn-callout-supporting",children:s}),h.jsx("div",{className:"dsn-callout-actions",children:a})]}):null]})}function TM({title:e,description:t,disclosure:n="left",bordered:r=!1,expanded:i,defaultExpanded:a=!1,disabled:s=!1,children:o,className:l,contentClassName:u,onExpandedChange:c}){const d=_.useId(),f=`dsn-accordion-trigger-${d}`,g=`dsn-accordion-content-${d}`,p=i!==void 0,[m,v]=_.useState(a),x=p?i:m,y=["dsn-accordion",l].filter(Boolean).join(" "),b=["dsn-accordion-content-inner",u].filter(Boolean).join(" "),k=h.jsx(Fr,{size:16,"aria-hidden":"true"});function w(N){p||v(N),c==null||c(N)}function S(){return h.jsx("span",{className:"dsn-accordion-disclosure-icon",children:k})}return h.jsxs("div",{className:y,"data-bordered":r||void 0,"data-expanded":x||void 0,"data-disclosure":n,"data-disabled":s||void 0,children:[h.jsx("button",{id:f,type:"button",className:"dsn-accordion-trigger","aria-expanded":x,"aria-controls":g,disabled:s,onClick:()=>w(!x),children:h.jsx(vr,{title:e,description:t,size:"medium",leadingControl:n==="left"?S():void 0,trailingControl:n==="right"?S():void 0,className:"dsn-accordion-section-header"})}),x&&h.jsx("div",{id:g,role:"region","aria-labelledby":f,className:"dsn-accordion-content",children:h.jsx("div",{className:b,children:o})})]})}function n0({page:e,selected:t=!1,disabled:n=!1,onClick:r,className:i}){return h.jsx("button",{type:"button",className:`dsn-page-selector${i?` ${i}`:""}`,"data-selected":t||void 0,disabled:n,"aria-current":t?"page":void 0,onClick:n?void 0:r,children:h.jsx("span",{className:"dsn-page-selector-number",children:e})})}function CM(e,t){if(t<=0)return[];const n=new Set([1,t]);for(let s=Math.max(1,e-1);s<=Math.min(t,e+1);s++)n.add(s);const r=Array.from(n).sort((s,o)=>s-o),i=[];let a=0;for(let s=0;s<r.length;s++){if(s>0){const o=r[s]-r[s-1];o===2?i.push(r[s-1]+1):o>2&&(i.push(a===0?"ellipsis-start":"ellipsis-end"),a++)}i.push(r[s])}return i}function r0({page:e,totalPages:t,onPageChange:n,totalRecords:r,pageSize:i,rowsPerPage:a,rowsPerPageOptions:s=[10,25,50,100],onRowsPerPageChange:o,className:l}){const u=CM(e,t),[c,d]=_.useState(!1),f=_.useRef(null);_.useEffect(()=>{if(!c)return;const p=m=>{f.current&&!f.current.contains(m.target)&&d(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[c]);let g=null;if(r!==void 0&&i!==void 0){const p=(e-1)*i+1,m=Math.min(e*i,r);g=`${p}–${m} of ${r}`}return h.jsxs("nav",{className:`dsn-pagination${l?` ${l}`:""}`,"aria-label":"Pagination",children:[a!==void 0&&h.jsx("div",{className:"dsn-pagination-meta",children:h.jsxs("div",{className:"dsn-pagination-rows",children:[h.jsxs("div",{ref:f,className:"dsn-pagination-rows-trigger",children:[h.jsx(be,{variant:"ghost",size:"sm",showTrailingIcon:!0,trailingIcon:h.jsx(Fr,{size:16,strokeWidth:1.5}),"aria-label":"Rows per page","aria-haspopup":"menu","aria-expanded":c,onClick:()=>d(p=>!p),children:a}),c&&h.jsx(Rr,{role:"menu","aria-label":"Rows per page options",anchorRef:f,offset:4,viewportMargin:16,contentPadding:"small",content:h.jsx("div",{children:s.map(p=>h.jsx(Ui,{label:String(p),fullWidth:!0,showLeadingIcon:!1,showTrailingIcon:a===p,selected:a===p,"aria-label":String(p),onClick:()=>{o==null||o(p),d(!1)}},p))})})]}),h.jsx("span",{className:"dsn-pagination-rows-label",children:"Rows per page"})]})}),h.jsxs("div",{className:"dsn-pagination-controls",children:[g&&h.jsx("span",{className:"dsn-pagination-summary","aria-live":"polite","aria-atomic":"true",children:g}),h.jsx(be,{variant:"ghost",size:"md",showLeadingIcon:!0,leadingIcon:h.jsx(bC,{size:16,strokeWidth:1.5}),showLabel:!1,disabled:e<=1,"aria-label":"Go to previous page","aria-disabled":e<=1,onClick:()=>n(e-1)}),h.jsx("div",{className:"dsn-pagination-pages",role:"group","aria-label":"Pages",children:u.map(p=>p==="ellipsis-start"||p==="ellipsis-end"?h.jsx(be,{variant:"ghost",size:"md",showLeadingIcon:!0,leadingIcon:h.jsx(SC,{size:16,strokeWidth:1.5}),showLabel:!1,"aria-label":"More pages",className:"dsn-pagination-ellipsis"},p):h.jsx(n0,{page:p,selected:p===e,onClick:()=>n(p)},p))}),h.jsx(be,{variant:"ghost",size:"md",showLeadingIcon:!0,leadingIcon:h.jsx(Bi,{size:16,strokeWidth:1.5}),showLabel:!1,disabled:e>=t,"aria-label":"Go to next page","aria-disabled":e>=t,onClick:()=>n(e+1)})]})]})}function jM(e,t,n){return!n||t<3?!1:e>t}function MM({items:e,maxVisibleItems:t=4,showEllipsis:n=!0,ellipsisLabel:r="...",ellipsisAriaLabel:i="Show more breadcrumbs",separator:a,className:s,"aria-label":o="Breadcrumb",onItemClick:l}){const[u,c]=_.useState(!1),d="sm",f=a??h.jsx(Bi,{size:16,"aria-hidden":"true"}),g=["dsn-breadcrumbs",s].filter(Boolean).join(" "),p=_.useMemo(()=>{const v=e.map((w,S)=>({type:"item",item:w,index:S}));if(!jM(e.length,t,n)||u)return v;const y=v[0],b=Math.max(1,t-2),k=v.slice(-b);return[y,{type:"ellipsis"},...k]},[u,e,t,n]);function m(v,x,y){var b;(b=x.onClick)==null||b.call(x,v,x,y),l==null||l(v,x,y)}return h.jsx("nav",{className:g,"aria-label":o,children:h.jsx("ol",{className:"dsn-breadcrumbs-list",children:p.map((v,x)=>{const y=x===p.length-1;if(v.type==="ellipsis")return h.jsxs("li",{className:"dsn-breadcrumbs-item",children:[h.jsx(be,{variant:"plain",size:d,"aria-label":i,onClick:()=>c(!0),children:r}),y?null:h.jsx("span",{className:"dsn-breadcrumbs-separator","aria-hidden":"true",children:f})]},`ellipsis-${x}`);const{item:b,index:k}=v,w=k===e.length-1;return h.jsxs("li",{className:"dsn-breadcrumbs-item",children:[w?h.jsx("span",{className:"dsn-breadcrumbs-current","aria-current":"page",children:b.label}):b.href&&!b.disabled?h.jsx("a",{className:"dsn-breadcrumbs-link",href:b.href,"aria-label":b.ariaLabel,onClick:S=>m(S,b,k),children:b.label}):h.jsx(be,{variant:"plain",size:d,disabled:b.disabled,"aria-label":b.ariaLabel,onClick:S=>m(S,b,k),children:b.label}),y?null:h.jsx("span",{className:"dsn-breadcrumbs-separator","aria-hidden":"true",children:f})]},b.id??`${k}-${String(b.label)}`)})})})}function OM(e,t,n){return!n||t<3?!1:e>t}function $M(e,t,n){return e.variant?e.variant:t===n-1?"current":"previous"}function i0({items:e,maxVisibleItems:t=4,showEllipsis:n=!0,ellipsisLabel:r="...",ellipsisAriaLabel:i="Show more breadcrumbs",className:a,"aria-label":s="Breadcrumb",onItemClick:o}){const[l,u]=_.useState(!1),c=["dsn-breadcrumbs dsn-breadcrumbs-controller",a].filter(Boolean).join(" "),d=_.useMemo(()=>{const g=e.map((y,b)=>({type:"item",item:y,index:b}));if(!OM(e.length,t,n)||l)return g;const m=g[0],v=Math.max(1,t-2),x=g.slice(-v);return[m,{type:"ellipsis"},...x]},[l,e,t,n]);function f(g,p,m){var v;(v=p.onClick)==null||v.call(p,g,p,m),o==null||o(g,p,m)}return h.jsx("nav",{className:c,"aria-label":s,children:h.jsx("ol",{className:"dsn-breadcrumbs-list",children:d.map((g,p)=>{const m=p===d.length-1;if(g.type==="ellipsis")return h.jsxs("li",{className:"dsn-breadcrumbs-item",children:[h.jsx("button",{type:"button",className:"dsn-breadcrumbs-controller-trigger dsn-breadcrumbs-controller-trigger-ellipsis","aria-label":i,onClick:()=>u(!0),children:h.jsx("span",{className:"dsn-breadcrumbs-controller-label",children:r})}),m?null:h.jsx("span",{className:"dsn-breadcrumbs-separator","aria-hidden":"true",children:h.jsx(Bi,{size:16})})]},`ellipsis-${p}`);const{item:v,index:x}=g,y=$M(v,x,e.length),b=y==="ellipsis"?r:v.label,k=y==="current",w=v.showDisclosure??y!=="ellipsis";return h.jsxs("li",{className:"dsn-breadcrumbs-item",children:[k?h.jsxs("span",{className:"dsn-breadcrumbs-controller-current","aria-current":"page",children:[h.jsx("span",{className:"dsn-breadcrumbs-controller-label",children:b}),w?h.jsx("span",{className:"dsn-breadcrumbs-controller-disclosure","aria-hidden":"true",children:h.jsx(Fr,{size:16})}):null]}):h.jsxs("button",{type:"button",className:"dsn-breadcrumbs-controller-trigger",disabled:v.disabled,"aria-label":v.ariaLabel,onClick:S=>f(S,v,x),children:[h.jsx("span",{className:"dsn-breadcrumbs-controller-label",children:b}),w?h.jsx("span",{className:"dsn-breadcrumbs-controller-disclosure","aria-hidden":"true",children:h.jsx(Fr,{size:16})}):null]}),m?null:h.jsx("span",{className:"dsn-breadcrumbs-separator","aria-hidden":"true",children:h.jsx(Bi,{size:16})})]},v.id??`${x}-${String(b)}`)})})})}function tu({variant:e="full",label:t="Label",showIcon:n=!0,icon:r,showAvatar:i=!1,avatarProps:a,showBadge:s=!1,badgeCount:o=3,badgeVariant:l="highlight-strong",showDisclosure:u=!1,showRightButton:c=!1,rightButton:d,selected:f=!1,disabled:g=!1,onClick:p,className:m,"aria-label":v}){const x=e==="icon",y=["dsn-sidebar-selector",m].filter(Boolean).join(" "),b=v??(x?t:void 0);return h.jsxs("div",{className:y,"data-variant":e,"data-selected":f||void 0,"data-disabled":g||void 0,children:[h.jsxs("button",{type:"button",className:"dsn-sidebar-selector-container",disabled:g,"aria-label":b,onClick:p,children:[n&&!i&&h.jsx("span",{className:"dsn-sidebar-selector-icon-wrap","aria-hidden":"true",children:r??h.jsx(mr,{})}),i&&h.jsx("span",{className:"dsn-sidebar-selector-avatar-wrap",children:h.jsx(Wi,{size:"xs",variant:"organization",fill:"initials",initials:"AA",name:"Avatar",...a})}),!x&&h.jsx("span",{className:"dsn-sidebar-selector-label-wrap",children:h.jsx("span",{className:"dsn-sidebar-selector-label",children:t})}),!x&&s&&h.jsx("span",{className:"dsn-sidebar-selector-badge-wrap",children:h.jsx(Gs,{size:"sm",variant:l,count:o})}),!x&&u&&h.jsx("span",{className:"dsn-sidebar-selector-disclosure","aria-hidden":"true",children:h.jsx(_C,{size:16})}),!x&&c&&d&&h.jsx("span",{className:"dsn-sidebar-selector-action-wrap",onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),children:d})]}),f&&h.jsx("span",{className:"dsn-sidebar-selector-rail","aria-hidden":"true"})]})}function PM({size:e="default",className:t,hasPicture:n=!0,picture:r,hasTitle:i=!0,title:a="Title",hasSubtitle:s=!0,subtitle:o="Subtitle.",hasActions:l=!0,showMainCta:u=!0,mainCtaLabel:c="Button",onMainCtaClick:d,showSecondaryOption:f=!0,secondaryOptionLabel:g="Button",onSecondaryOptionClick:p,showTertiaryOption:m=!0,tertiaryOptionLabel:v="Button",onTertiaryOptionClick:x,showLink:y=!0,linkLabel:b="Button",onLinkClick:k,showHelpText:w=!0,helpText:S="Help text"}){const N=["dsn-empty-state",t].filter(Boolean).join(" "),E=e==="small"?"sm":"md",T=u||f||m||y||w;return h.jsx("div",{className:N,"data-size":e,children:h.jsxs("div",{className:"dsn-empty-state-content",children:[n?h.jsx("div",{className:"dsn-empty-state-picture","aria-hidden":"true",children:r}):null,(i||s)&&h.jsxs("div",{className:"dsn-empty-state-copy",children:[i?h.jsx("p",{className:"dsn-empty-state-title",children:a}):null,s?h.jsx("p",{className:"dsn-empty-state-subtitle",children:o}):null]}),l&&T?h.jsxs("div",{className:"dsn-empty-state-actions",children:[u?h.jsx(be,{variant:"primary",size:E,onClick:d,children:c}):null,f?h.jsx(be,{variant:"secondary",size:E,onClick:p,children:g}):null,m?h.jsx(be,{variant:"ghost",size:E,onClick:x,children:v}):null,y?h.jsx(be,{variant:"plain",size:"sm",onClick:k,children:b}):null,w?h.jsx("p",{className:"dsn-empty-state-help-text",children:S}):null]}):null]})})}function le(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function a0(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Jn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,AM=Jn&&"documentMode"in document?document.documentMode:null,Zn=Jn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),di=Jn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),nu=!(!Jn||!("InputEvent"in window)||AM)&&"getTargetRanges"in new window.InputEvent("input"),ru=Jn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Qs=Jn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,LM=Jn&&/Android/.test(navigator.userAgent),s0=Jn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ff=Jn&&LM&&s0,iu=Jn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Zn&&!s0,DM=0,IM=1,FM=2,o0=128,zM=1,RM=2,BM=3,WM=4,UM=5,HM=6,eo=ru||Qs||iu?" ":"",au=`
|
|
281
281
|
|
|
282
282
|
`,hf=di?" ":eo,Vi={bold:1,capitalize:1024,code:16,highlight:o0,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},qM={directionless:1,unmergeable:2},pf={center:2,end:6,justify:4,left:1,right:3,start:5},VM={[RM]:"center",[HM]:"end",[WM]:"justify",[zM]:"left",[BM]:"right",[UM]:"start"},KM={normal:0,segmented:2,token:1},YM={[DM]:"normal",[FM]:"segmented",[IM]:"token"},l0="$config";function u0(e,t,n,r,i,a){let s=e.getFirstChild();for(;s!==null;){const o=s.__key;s.__parent===t&&(J(s)&&u0(s,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),s=s.getNextSibling()}}let gf=!1,mf=0;function GM(e){mf=e.timeStamp}function vf(e,t,n){const r=e.nodeName==="BR",i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Au(e,n)!==void 0}function XM(e,t,n){const r=On(kn(n));let i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);const s=e.nodeValue;s!==null&&rh(t,s,i,a,!1)}function JM(e,t,n){if(ae(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return Yr(t)&&n.isAttached()}function ZM(e,t,n,r){for(let i=e;i&&!r$(i);i=vo(i)){const a=Au(i,t);if(a!==void 0){const s=St(a,n);if(s)return Be(s)||!xt(i)?void 0:[i,s]}else if(i===r)return[r,Qx(n)]}}function c0(e,t,n){gf=!0;const r=performance.now()-mf>100;try{br(e,()=>{const i=fe()||function(f){return f.getEditorState().read(()=>{const g=fe();return g!==null?g.clone():null})}(e),a=new Map,s=e.getRootElement(),o=e._editorState,l=e._blockCursorElement;let u=!1,c="";for(let f=0;f<t.length;f++){const g=t[f],p=g.type,m=g.target,v=ZM(m,e,o,s);if(!v)continue;const[x,y]=v;if(p==="characterData")r&&de(y)&&Yr(m)&&JM(i,m,y)&&XM(m,y,e);else if(p==="childList"){u=!0;const b=g.addedNodes;for(let S=0;S<b.length;S++){const N=b[S],E=Xx(N),T=N.parentNode;if(T!=null&&N!==l&&E===null&&!vf(N,T,e)){if(di){const C=(xt(N)?N.innerText:null)||N.nodeValue;C&&(c+=C)}T.removeChild(N)}}const k=g.removedNodes,w=k.length;if(w>0){let S=0;for(let N=0;N<w;N++){const E=k[N];(vf(E,m,e)||l===E)&&(m.appendChild(E),S++)}w!==S&&a.set(x,y)}}}if(a.size>0)for(const[f,g]of a)g.reconcileObservedMutation(f,e);const d=n.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const g=d[f],p=g.addedNodes,m=g.target;for(let v=0;v<p.length;v++){const x=p[v],y=x.parentNode;y==null||x.nodeName!=="BR"||vf(x,m,e)||y.removeChild(x)}}n.takeRecords()}i!==null&&(u&&Yt(i),di&&lb(e)&&i.insertRawText(c))})}finally{gf=!1}}function d0(e){const t=e._observer;t!==null&&c0(e,t.takeRecords(),t)}function f0(e){(function(t){mf===0&&kn(t).addEventListener("textInput",GM,!0)})(e),e._observer=new MutationObserver((t,n)=>{c0(e,t,n)})}let QM=class{constructor(t,n){Z(this,"key");Z(this,"parse");Z(this,"unparse");Z(this,"isEqual");Z(this,"defaultValue");this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||iO).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function eO(e,t){return new QM(e,t)}function tO(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:i}=Fu(r);if(i&&i.stateConfigs)for(const a of i.stateConfigs){let s;"stateConfig"in a?(s=a.stateConfig,a.flat&&n.add(s.key)):s=a,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let nO=class nC{constructor(t,n,r=void 0,i=new Map,a=void 0){Z(this,"node");Z(this,"knownState");Z(this,"unknownState");Z(this,"sharedNodeState");Z(this,"size");this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=i;const{sharedConfigMap:s}=this.sharedNodeState,o=a!==void 0?a:function(l,u,c){let d=c.size;if(u)for(const f in u){const g=l.get(f);g&&c.has(g)||d++}return d}(s,r,i);this.size=o}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const i=this.unknownState[t.key];i!==void 0&&(r=t.parse(i)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return p0(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new nC(t,n,function(a,s,o){let l;if(o)for(const[u,c]of Object.entries(o)){const d=a.get(u);d?s.has(d)||s.set(d,d.parse(c)):(l=l||{},l[u]=c)}return l}(n.sharedConfigMap,i,r),i,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:i,unknownState:a}=this;i.has(t)||a&&r in a||(a&&(delete a[r],this.unknownState=p0(a)),this.size++),i.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,i]of Object.entries(t))this.updateFromUnknown(r,i)}};function rO(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new nO(t,h0(t));return t.__state=n,n}function h0(e){return e.__state?e.__state.sharedNodeState:Hx(Iu(),e.getType()).sharedNodeState}function p0(e){if(e)for(const t in e)return e}function iO(e){return e}function g0(e,t,n){for(const[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const a=n?n.getValue(r):r.defaultValue;if(a!==i&&!r.isEqual(a,i))return!0}return!1}function m0(e,t,n){const{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(const[a,s]of Object.entries(r))if(!e.has(a)&&(e.add(a),s!==(i?i[a]:void 0)))return!0}return!1}function v0(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function y0(e,t){const n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,s=t.__format,o=t.__style,l=e.__state,u=t.__state;return(n===null||n===a)&&(r===null||r===s)&&(i===null||i===o)&&(e.__state===null||l===u||function(c,d){if(c===d)return!0;if(c&&d&&c.size!==d.size)return!1;const f=new Set;return!(c&&g0(f,c,d)||d&&g0(f,d,c)||c&&m0(f,c,d)||d&&m0(f,d,c))}(l,u))}function x0(e,t){const n=e.mergeWithSibling(t),r=et()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function b0(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&de(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(y0(t,r)){r=x0(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&de(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(y0(r,n)){r=x0(r,n);break}break}n.remove()}}else r.remove()}function Ki(e){return _0(e.anchor),_0(e.focus),e}function _0(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),de(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!J(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let Yi,It,to,su,yf,xf,Gi,Qn,bf,no,wt="",yr=null,Xi=null,za=!1,ou=!1;function lu(e,t){const n=Gi.get(e);if(t!==null){const r=Nf(e);r.parentNode===t&&t.removeChild(r)}if(Qn.has(e)||It._keyToDOMMap.delete(e),J(n)){const r=cu(n,Gi);_f(r,0,r.length-1,null)}n!==void 0&&ih(no,to,su,n,"destroyed")}function _f(e,t,n,r){for(let i=t;i<=n;++i){const a=e[i];a!==void 0&&lu(a,r)}}function Ji(e,t){e.setProperty("text-align",t)}const aO="40px";function w0(e,t){const n=Yi.theme.indent;if(typeof n=="string"){const i=e.classList.contains(n);t>0&&!i?e.classList.add(n):t<1&&i&&e.classList.remove(n)}if(t===0)return void e.style.setProperty("padding-inline-start","");const r=getComputedStyle(It._rootElement||e).getPropertyValue("--lexical-indent-base-value")||aO;e.style.setProperty("padding-inline-start",`calc(${t} * ${r})`)}function k0(e,t){const n=e.style;t===0?Ji(n,""):t===1?Ji(n,"left"):t===2?Ji(n,"center"):t===3?Ji(n,"right"):t===4?Ji(n,"justify"):t===5?Ji(n,"start"):t===6&&Ji(n,"end")}function wf(e,t){const n=function(r){const i=r.__dir;if(i!==null)return i;if(kt(r))return null;const a=r.getParentOrThrow();return kt(a)&&a.__dir===null?"auto":null}(t);n!==null?e.dir=n:e.removeAttribute("dir")}function uu(e,t){const n=Qn.get(e);n===void 0&&le(60);const r=n.createDOM(Yi,It);if(function(i,a,s){const o=s._keyToDOMMap;(function(l,u,c){const d=`__lexicalKey_${u._key}`;l[d]=c})(a,s,i),o.set(i,a)}(e,r,It),de(n)?r.setAttribute("data-lexical-text","true"):Be(n)&&r.setAttribute("data-lexical-decorator","true"),J(n)){const i=n.__indent,a=n.__size;if(wf(r,n),i!==0&&w0(r,i),a!==0){const o=a-1;kf(cu(n,Qn),n,0,o,n.getDOMSlot(r))}const s=n.__format;s!==0&&k0(r,s),n.isInline()||N0(null,n,r)}else{const i=n.getTextContent();if(Be(n)){const a=n.decorate(It,Yi);a!==null&&E0(e,a),r.contentEditable="false"}wt+=i}return t!==null&&t.insertChild(r),ih(no,to,su,n,"created"),r}function kf(e,t,n,r,i){const a=wt;wt="";let s=n;for(;s<=r;++s){uu(e[s],i);const o=Qn.get(e[s]);o!==null&&de(o)?yr===null&&(yr=o.getFormat(),Xi=o.getStyle()):J(o)&&s<r&&!o.isInline()&&(wt+=au)}i.element.__lexicalTextContent=wt,wt=a+wt}function S0(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return Va(r)?"line-break":Be(r)&&r.isInline()?"decorator":null}return"empty"}return null}function N0(e,t,n){const r=S0(e,Gi),i=S0(t,Qn);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function sO(e,t,n){var r;yr=null,Xi=null,function(i,a,s){const o=wt,l=i.__size,u=a.__size;wt="";const c=s.element;if(l===1&&u===1){const d=i.__first,f=a.__first;if(d===f)du(d,c);else{const p=Nf(d),m=uu(f,null);try{c.replaceChild(m,p)}catch(v){if(typeof v=="object"&&v!=null){const x=`${v.toString()} Parent: ${c.tagName}, new child: {tag: ${m.tagName} key: ${f}}, old child: {tag: ${p.tagName}, key: ${d}}.`;throw new Error(x)}throw v}lu(d,null)}const g=Qn.get(f);de(g)&&yr===null&&(yr=g.getFormat(),Xi=g.getStyle())}else{const d=cu(i,Gi),f=cu(a,Qn);if(d.length!==l&&le(227),f.length!==u&&le(228),l===0)u!==0&&kf(f,0,0,u-1,s);else if(u===0){if(l!==0){const g=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;_f(d,0,l-1,g?null:c),g&&(c.textContent="")}}else(function(g,p,m,v,x,y){const b=v-1,k=x-1;let w,S,N=y.getFirstChild(),E=0,T=0;for(;E<=b&&T<=k;){const $=p[E],j=m[T];if($===j)N=Sf(du(j,y.element)),E++,T++;else{if(S===void 0&&(S=T0(m,T)),w===void 0)w=T0(p,E);else if(!w.has($)){E++;continue}if(!S.has($)){N=Sf(Nf($)),lu($,y.element),E++,w.delete($);continue}if(w.has(j)){const A=ns(It,j);A!==N&&y.withBefore(N).insertChild(A),N=Sf(du(j,y.element)),E++,T++}else uu(j,y.withBefore(N)),T++}const M=Qn.get(j);M!==null&&de(M)?yr===null&&(yr=M.getFormat(),Xi=M.getStyle()):J(M)&&T<=k&&!M.isInline()&&(wt+=au)}const C=E>b,O=T>k;if(C&&!O){const $=m[k+1],j=$===void 0?null:It.getElementByKey($);kf(m,0,T,k,y.withBefore(j))}else O&&!C&&_f(p,E,b,y.element)})(0,d,f,l,u,s)}c.__lexicalTextContent=wt,wt=o+wt}(e,t,t.getDOMSlot(n)),r=t,yr==null||yr===r.__textFormat||ou||r.setTextFormat(yr),function(i){Xi==null||Xi===i.__textStyle||ou||i.setTextStyle(Xi)}(t)}function cu(e,t){const n=[];let r=e.__first;for(;r!==null;){const i=t.get(r);i===void 0&&le(101),n.push(r),r=i.__next}return n}function du(e,t){const n=Gi.get(e);let r=Qn.get(e);n!==void 0&&r!==void 0||le(61);const i=za||xf.has(e)||yf.has(e),a=ns(It,e);if(n===r&&!i){let s;if(J(n)){const o=a.__lexicalTextContent;typeof o=="string"?s=o:(s=n.getTextContent(),a.__lexicalTextContent=s)}else s=n.getTextContent();return wt+=s,a}if(n!==r&&i&&ih(no,to,su,r,"updated"),r.updateDOM(n,a,Yi)){const s=uu(e,null);return t===null&&le(62),t.replaceChild(s,a),lu(e,null),s}if(J(n)){J(r)||le(334,e);const s=r.__indent;(za||s!==n.__indent)&&w0(a,s);const o=r.__format;if((za||o!==n.__format)&&k0(a,o),i)sO(n,r,a),kt(r)||r.isInline()||N0(n,r,a);else{const l=a.__lexicalTextContent;let u;typeof l=="string"?u=l:(u=n.getTextContent(),a.__lexicalTextContent=u),wt+=u}if((za||r.__dir!==n.__dir)&&(wf(a,r),kt(r)&&!za))for(const l of r.getChildren())J(l)&&wf(ns(It,l.getKey()),l)}else{const s=r.getTextContent();if(Be(r)){const o=r.decorate(It,Yi);o!==null&&E0(e,o)}wt+=s}if(!ou&&kt(r)&&r.__cachedText!==wt){const s=r.getWritable();s.__cachedText=wt,r=s}return a}function E0(e,t){let n=It._pendingDecorators;const r=It._decorators;if(n===null){if(r[e]===t)return;n=Jx(It)}n[e]=t}function Sf(e){let t=e.nextSibling;return t!==null&&t===It._blockCursorElement&&(t=t.nextSibling),t}function T0(e,t){const n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function oO(e,t,n,r,i,a){wt="",za=r===2,It=n,Yi=n._config,to=n._nodes,su=It._listeners.mutation,yf=i,xf=a,Gi=e._nodeMap,Qn=t._nodeMap,ou=t._readOnly,bf=new Map(n._keyToDOMMap);const s=new Map;return no=s,du("root",null),It=void 0,to=void 0,yf=void 0,xf=void 0,Gi=void 0,Qn=void 0,Yi=void 0,bf=void 0,no=void 0,s}function Nf(e){const t=bf.get(e);return t===void 0&&le(75,e),t}function _e(e){return{type:e}}const Ef=_e("SELECTION_CHANGE_COMMAND"),lO=_e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),C0=_e("CLICK_COMMAND"),j0=_e("BEFORE_INPUT_COMMAND"),M0=_e("INPUT_COMMAND"),O0=_e("COMPOSITION_START_COMMAND"),$0=_e("COMPOSITION_END_COMMAND"),Zi=_e("DELETE_CHARACTER_COMMAND"),Ra=_e("INSERT_LINE_BREAK_COMMAND"),ro=_e("INSERT_PARAGRAPH_COMMAND"),Ba=_e("CONTROLLED_TEXT_INSERTION_COMMAND"),fu=_e("PASTE_COMMAND"),Tf=_e("REMOVE_TEXT_COMMAND"),io=_e("DELETE_WORD_COMMAND"),ao=_e("DELETE_LINE_COMMAND"),_n=_e("FORMAT_TEXT_COMMAND"),hu=_e("UNDO_COMMAND"),pu=_e("REDO_COMMAND"),P0=_e("KEYDOWN_COMMAND"),A0=_e("KEY_ARROW_RIGHT_COMMAND"),uO=_e("MOVE_TO_END"),L0=_e("KEY_ARROW_LEFT_COMMAND"),cO=_e("MOVE_TO_START"),D0=_e("KEY_ARROW_UP_COMMAND"),I0=_e("KEY_ARROW_DOWN_COMMAND"),gu=_e("KEY_ENTER_COMMAND"),F0=_e("KEY_SPACE_COMMAND"),z0=_e("KEY_BACKSPACE_COMMAND"),R0=_e("KEY_ESCAPE_COMMAND"),B0=_e("KEY_DELETE_COMMAND"),W0=_e("KEY_TAB_COMMAND"),dO=_e("INSERT_TAB_COMMAND"),fO=_e("INDENT_CONTENT_COMMAND"),U0=_e("OUTDENT_CONTENT_COMMAND"),H0=_e("DROP_COMMAND"),Wa=_e("FORMAT_ELEMENT_COMMAND"),q0=_e("DRAGSTART_COMMAND"),V0=_e("DRAGOVER_COMMAND"),hO=_e("DRAGEND_COMMAND"),mu=_e("COPY_COMMAND"),Cf=_e("CUT_COMMAND"),jf=_e("SELECT_ALL_COMMAND"),pO=_e("CLEAR_EDITOR_COMMAND"),gO=_e("CLEAR_HISTORY_COMMAND"),so=_e("CAN_REDO_COMMAND"),oo=_e("CAN_UNDO_COMMAND"),mO=_e("FOCUS_COMMAND"),vO=_e("BLUR_COMMAND"),yO=_e("KEY_MODIFIER_COMMAND"),Wr=Object.freeze({}),Mf=[["keydown",function(e,t){lo=e.timeStamp,K0=e.key,!t.isComposing()&&me(t,P0,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;rs(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&br(t,()=>{qx(n)||(Pf=!0)})}],["compositionstart",function(e,t){me(t,O0,e)}],["compositionend",function(e,t){di?co=!0:Qs||!ru&&!iu?me(t,$0,e):(yu=!0,xu=e.data)}],["input",function(e,t){e.stopPropagation(),br(t,()=>{t.dispatchCommand(M0,e)},{event:e}),Ua=null}],["click",function(e,t){br(t,()=>{const n=fe(),r=On(kn(t)),i=Ga();if(r){if(ae(n)){const a=n.anchor,s=a.getNode();if(a.type==="element"&&a.offset===0&&n.isCollapsed()&&!kt(s)&<().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const o=Rt(s,l=>J(l)&&!l.isInline());J(o)&&o.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const a=r.anchorNode;(xt(a)||Yr(a))&&Yt(Uf(i,r,t,e))}}me(t,C0,e)})}],["cut",Wr],["copy",Wr],["dragstart",Wr],["dragover",Wr],["dragend",Wr],["paste",Wr],["focus",Wr],["blur",Wr],["drop",Wr]];nu&&Mf.push(["beforeinput",(e,t)=>function(n,r){const i=n.inputType;i==="deleteCompositionText"||di&&lb(r)||i!=="insertCompositionText"&&me(r,j0,n)}(e,t)]);let lo=0,K0=null,Y0=0,Ua=null;const Of=new WeakMap,vu=new WeakMap;let $f=!1,Pf=!1,uo=!1,co=!1,yu=!1,xu="",Qi=null,G0=[0,"",0,"root",0];function X0(e,t,n,r,i){const a=e.anchor,s=e.focus,o=a.getNode(),l=et(),u=On(kn(l)),c=u!==null?u.anchorNode:null,d=a.key,f=l.getElementByKey(d),g=n.length;return d!==s.key||!de(o)||(!i&&(!nu||Y0<r+50)||o.isDirty()&&g<2||eb(n))&&a.offset!==s.offset&&!o.isComposing()||Kr(o)||o.isDirty()&&g>1||(i||!nu)&&f!==null&&!o.isComposing()&&c!==Za(f)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!o.isComposing()&&(o.getFormat()!==e.format||o.getStyle()!==e.style)||function(p,m){if(m.isSegmented())return!0;if(!p.isCollapsed())return!1;const v=p.anchor.offset,x=m.getParentOrThrow(),y=ra(m);return v===0?!m.canInsertTextBefore()||!x.canInsertTextBefore()&&!m.isComposing()||y||function(b){const k=b.getPreviousSibling();return(de(k)||J(k)&&k.isInline())&&!k.canInsertTextAfter()}(m):v===m.getTextContentSize()&&(!m.canInsertTextAfter()||!x.canInsertTextAfter()&&!m.isComposing()||y)}(e,o)}function J0(e,t){return Yr(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Z0(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:s}=e;$f&&($f=!1,J0(r,i)&&J0(a,s)&&!Qi)||br(t,()=>{if(!n)return void Yt(null);if(!mo(t,r,a))return;let o=fe();if(Qi&&ae(o)&&o.isCollapsed()){const l=o.anchor,u=Qi.anchor;(l.key===u.key&&l.offset===u.offset+1||l.offset===1&&u.getNode().is(l.getNode().getPreviousSibling()))&&(o=Qi.clone(),Yt(o))}if(Qi=null,ae(o)){const l=o.anchor,u=l.getNode();if(o.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(o.dirty=!0);const c=kn(t).event,d=c?c.timeStamp:performance.now(),[f,g,p,m,v]=G0,x=lt(),y=t.isComposing()===!1&&x.getTextContent()==="";if(d<v+200&&l.offset===p&&l.key===m)bu(o,f,g);else if(l.type==="text")de(u)||le(141),Q0(o,u);else if(l.type==="element"&&!y){J(u)||le(259);const b=l.getNode();b.isEmpty()?function(k,w){const S=w.getTextFormat(),N=w.getTextStyle();bu(k,S,N)}(o,b):bu(o,0,"")}}else{const c=l.key,d=o.focus.key,f=o.getNodes(),g=f.length,p=o.isBackward(),m=p?s:i,v=p?i:s,x=p?d:c,y=p?c:d;let b=2047,k=!1;for(let w=0;w<g;w++){const S=f[w],N=S.getTextContentSize();if(de(S)&&N!==0&&!(w===0&&S.__key===x&&m===N||w===g-1&&S.__key===y&&v===0)&&(k=!0,b&=S.getFormat(),b===0))break}o.format=k?b:0}}me(t,Ef,void 0)})}function bu(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Q0(e,t){bu(e,t.getFormat(),t.getStyle())}function ex(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function xO(e){const t=e.inputType,n=ex(e),r=et(),i=fe();if(t==="deleteContentBackward"){if(i===null){const d=Ga();if(!ae(d))return!0;Yt(d.clone())}if(ae(i)){const d=i.anchor.key===i.focus.key;if(a=e.timeStamp,K0==="MediaLast"&&a<lo+30&&r.isComposing()&&d){if(zt(null),lo=0,setTimeout(()=>{br(r,()=>{zt(null)})},30),ae(i)){const f=i.anchor.getNode();f.markDirty(),de(f)||le(142),Q0(i,f)}}else{zt(null),e.preventDefault();const f=i.anchor.getNode(),g=f.getTextContent(),p=f.canInsertTextAfter(),m=i.anchor.offset===0&&i.focus.offset===g.length;let v=ff&&d&&!m&&p;if(v&&i.isCollapsed()&&(v=!Be(ah(i.anchor,!0))),!v){me(r,Zi,!0);const x=fe();ff&&ae(x)&&x.isCollapsed()&&(Qi=x,setTimeout(()=>Qi=null))}}return!0}}var a;if(!ae(i))return!0;const s=e.data;Ua!==null&&nh(!1,r,Ua),i.dirty&&Ua===null||!i.isCollapsed()||kt(i.anchor.getNode())||n===null||i.applyDOMRange(n),Ua=null;const o=i.anchor,l=i.focus,u=o.getNode(),c=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
|
|
283
283
|
`)e.preventDefault(),me(r,Ra,!1);else if(s===au)e.preventDefault(),me(r,ro,void 0);else if(s==null&&e.dataTransfer){const d=e.dataTransfer.getData("text/plain");e.preventDefault(),i.insertRawText(d)}else s!=null&&X0(i,n,s,e.timeStamp,!0)?(e.preventDefault(),me(r,Ba,s)):Ua=s;return Y0=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":me(r,Ba,e);break;case"insertFromComposition":zt(null),me(r,Ba,e);break;case"insertLineBreak":zt(null),me(r,Ra,!1);break;case"insertParagraph":zt(null),uo&&!Qs?(uo=!1,me(r,Ra,!1)):me(r,ro,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":me(r,fu,e);break;case"deleteByComposition":(function(d,f){return d!==f||J(d)||J(f)||!ra(d)||!ra(f)})(u,c)&&me(r,Tf,e);break;case"deleteByDrag":case"deleteByCut":me(r,Tf,e);break;case"deleteContent":me(r,Zi,!1);break;case"deleteWordBackward":me(r,io,!0);break;case"deleteWordForward":me(r,io,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":me(r,ao,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":me(r,ao,!1);break;case"formatStrikeThrough":me(r,_n,"strikethrough");break;case"formatBold":me(r,_n,"bold");break;case"formatItalic":me(r,_n,"italic");break;case"formatUnderline":me(r,_n,"underline");break;case"historyUndo":me(r,hu,void 0);break;case"historyRedo":me(r,pu,void 0)}return!0}function bO(e){if(xt(e.target)&&qx(e.target))return!0;const t=et(),n=fe(),r=e.data,i=ex(e);if(r!=null&&ae(n)&&X0(n,i,r,e.timeStamp,!1)){co&&(_u(t,r),co=!1);const a=n.anchor.getNode(),s=On(kn(t));if(s===null)return!0;const o=n.isBackward(),l=o?n.anchor.offset:n.focus.offset,u=o?n.focus.offset:n.anchor.offset;nu&&!n.isCollapsed()&&de(a)&&s.anchorNode!==null&&a.getTextContent().slice(0,l)+r+a.getTextContent().slice(l+u)===nb(s.anchorNode)||me(t,Ba,r);const c=r.length;di&&c>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=c),ff&&t.isComposing()&&(lo=0,zt(null))}else nh(!1,t,r!==null?r:void 0),co&&(_u(t,r||void 0),co=!1);return function(){Ft();const a=et();d0(a)}(),!0}function _O(e){const t=et(),n=fe();if(ae(n)&&!t.isComposing()){const r=n.anchor,i=n.anchor.getNode();zt(r.key),sh(ox),(e.timeStamp<lo+30||r.type==="element"||!n.isCollapsed()||i.getFormat()!==n.format||de(i)&&i.getStyle()!==n.style)&&me(t,Ba,hf)}return!0}function wO(e){return _u(et(),e.data),sh(lx),!0}function _u(e,t){const n=e._compositionKey;if(zt(null),n!==null&&t!=null){if(t===""){const r=St(n),i=Za(e.getElementByKey(n));if(i!==null&&i.nodeValue!==null&&de(r)){const a=On(kn(e));let s=null,o=null;a!==null&&a.anchorNode===i&&(s=a.anchorOffset,o=a.focusOffset),rh(r,i.nodeValue,s,o,!0)}return}if(t[t.length-1]===`
|