@agentatom/design-system 1.4.101 → 1.4.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +1481 -1400
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,4 +63,4 @@ import appearance from '@agentatom/design-system/appearance.json';
|
|
|
63
63
|
|
|
64
64
|
## Version
|
|
65
65
|
|
|
66
|
-
`1.4.
|
|
66
|
+
`1.4.102` — dual-brand publish from one monorepo commit. Package contents = applicable surface for this brand only.
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),C=require("lucide-react"),te=require("react-dom"),q={1:16,2:20,3:24,4:28,5:48};var $e={exports:{}},ve={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ze;function ht(){if(ze)return ve;ze=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function n(r,a
|
|
9
|
+
*/var ze;function ht(){if(ze)return ve;ze=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function n(r,o,a){var i=null;if(a!==void 0&&(i=""+a),o.key!==void 0&&(i=""+o.key),"key"in o){a={};for(var c in o)c!=="key"&&(a[c]=o[c])}else a=o;return o=a.ref,{$$typeof:t,type:r,key:i,ref:o!==void 0?o:null,props:a}}return ve.Fragment=s,ve.jsx=n,ve.jsxs=n,ve}var be={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var We;function xt(){return We||(We=1,process.env.NODE_ENV!=="production"&&function(){function t(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===A?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case S:return"Fragment";case T:return"Profiler";case y:return"StrictMode";case k:return"Suspense";case L:return"SuspenseList";case O:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case x:return"Portal";case h:return m.displayName||"Context";case R:return(m._context.displayName||"Context")+".Consumer";case E:var g=m.render;return m=m.displayName,m||(m=g.displayName||g.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case I:return g=m.displayName||null,g!==null?g:t(m.type)||"Memo";case M:g=m._payload,m=m._init;try{return t(m(g))}catch{}}return null}function s(m){return""+m}function n(m){try{s(m);var g=!1}catch{g=!0}if(g){g=console;var D=g.error,V=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return D.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",V),s(m)}}function r(m){if(m===S)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===M)return"<...>";try{var g=t(m);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function o(){var m=U.A;return m===null?null:m.getOwner()}function a(){return Error("react-stack-top-frame")}function i(m){if(z.call(m,"key")){var g=Object.getOwnPropertyDescriptor(m,"key").get;if(g&&g.isReactWarning)return!1}return m.key!==void 0}function c(m,g){function D(){N||(N=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",g))}D.isReactWarning=!0,Object.defineProperty(m,"key",{get:D,configurable:!0})}function d(){var m=t(this.type);return $[m]||($[m]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),m=this.props.ref,m!==void 0?m:null}function f(m,g,D,V,X,K){var Y=D.ref;return m={$$typeof:w,type:m,key:g,props:D,_owner:V},(Y!==void 0?Y:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:d}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function u(m,g,D,V,X,K){var Y=g.children;if(Y!==void 0)if(V)if(j(Y)){for(V=0;V<Y.length;V++)b(Y[V]);Object.freeze&&Object.freeze(Y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else b(Y);if(z.call(g,"key")){Y=t(m);var Q=Object.keys(g).filter(function(he){return he!=="key"});V=0<Q.length?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}",W[Y+V]||(Q=0<Q.length?"{"+Q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,V,Y,Q,Y),O[Y+V]=!0)}if(Y=null,D!==void 0&&(n(D),Y=""+D),c(j)&&(n(j.key),Y=""+j.key),"key"in j){D={};for(var ie in j)ie!=="key"&&(D[ie]=j[ie])}else D=j;return Y&&i(D,typeof m=="function"?m.displayName||m.name||"Unknown":m),f(m,Y,D,a(),X,G)}function x(m){v(m)?m._store&&(m._store.validated=1):typeof m=="object"&&m!==null&&m.$$typeof===F&&(m._payload.status==="fulfilled"?v(m._payload.value)&&m._payload.value._store&&(m._payload.value._store.validated=1):m._store&&(m._store.validated=1))}function v(m){return typeof m=="object"&&m!==null&&m.$$typeof===w}var p=l,w=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),b=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),S=Symbol.for("react.client.reference"),U=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,_=Array.isArray,h=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(m){return m()}};var g,k={},L=p.react_stack_bottom_frame.bind(p,o)(),M=h(r(o)),O={};be.Fragment=T,be.jsx=function(m,j,D){var V=1e4>U.recentlyCreatedOwnerStacks++;return u(m,j,D,!1,V?Error("react-stack-top-frame"):L,V?h(r(m)):M)},be.jsxs=function(m,j,D){var V=1e4>U.recentlyCreatedOwnerStacks++;return u(m,j,D,!0,V?Error("react-stack-top-frame"):L,V?h(r(m)):M)}}()),be}process.env.NODE_ENV==="production"?$e.exports=ht():$e.exports=xt();var e=$e.exports;const _e={close:"Close",closeModal:"Close modal",closeAlert:"Close alert",dismiss:"Dismiss",loading:"Loading",next:"Next",back:"Back",skipTour:"Skip tour",done:"Done",previousPage:"Previous page",nextPage:"Next page",pagination:"Pagination",pageN:"Page {n}",breadcrumb:"Breadcrumb",recents:"Recents",steps:"Steps",stepN:"Step {n}",stepOf:"Step {current} of {total}",copyToClipboard:"Copy to clipboard",selectOption:"Select option",like:"Like",dislike:"Dislike",removeImage:"Remove image",attachFiles:"Attach files",stop:"Stop",send:"Send",toggleVisibility:"Toggle visibility",decrease:"Decrease",increase:"Increase",sources:"Sources",moreSources:"+{n} more sources",pageAbbrev:"p. {pages}",code:"Code",promptPlaceholder:"Let's get things done...",dropFilesHere:"Drop files here",fileTooLarge:"File(s) too large{maxHint}: {names}",fileTooLargeMaxHint:" (max {maxMb}MB)",filesSkipped:"Skipped unsupported file(s): {names}",maxImages:"Max {n} images per message",uploading:"Uploading...",removeAttachment:"Remove attachment",closeTab:"Close {label}"};function De(t,s={}){return typeof t=="function"?t(s):typeof t!="string"?"":t.replace(/\{(\w+)\}/g,(n,r)=>s[r]!==void 0&&s[r]!==null?String(s[r]):"")}const Ie=l.createContext({strings:_e,t:(t,s)=>De(_e[t]??t,s)});function vt({strings:t,children:s}){const n=l.useMemo(()=>{const r={..._e,...t};return{strings:r,t:(a,o)=>De(r[a]??_e[a]??a,o)}},[t]);return e.jsx(Ie.Provider,{value:n,children:s})}function ue(){return l.useContext(Ie)}function K(){return l.useContext(Ie).strings}function et({size:t="m",color:s="default",className:n="","aria-label":r,...a}){const o=K();return e.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${s}`,n].filter(Boolean).join(" "),role:"status","aria-label":r??o.loading,...a})}const bt={xs:12,s:14,m:16,l:20};function re({children:t,variant:s="primary",size:n="m",fullWidth:r=!1,icon:a,disabled:o=!1,state:c="idle",active:i=!1,pressed:d=!1,onClick:f,type:u="button",href:x,"aria-label":v,"aria-pressed":p,className:w="",...N}){const T=a&&!t,y=c==="loading",$=c==="success",A=c==="error",b=y||$||A,R=!!(i||d),E=n==="xs"?"s":"m",I=s==="danger"?"on-accent":"default",C=bt[n]??16,F=y?e.jsx(et,{size:E,color:I}):$?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(P.Check,{size:C,strokeWidth:2.5})}):A?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(P.X,{size:C,strokeWidth:2.5})}):null,H=["ds-button",`ds-button--${s}`,`ds-button--${n}`,r&&"ds-button--full",T&&"ds-button--icon-only",w].filter(Boolean).join(" "),S=c!=="idle"?c:void 0,U=p!==void 0?p:R?!0:void 0,z=e.jsxs(e.Fragment,{children:[b?F:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),t]});if(x){const _=h=>{if(o||y){h.preventDefault();return}h.metaKey||h.ctrlKey||h.button===1||(h.preventDefault(),f==null||f(h))};return e.jsx("a",{className:H,href:o||y?void 0:x,onClick:_,"aria-label":v,"aria-disabled":o||y?"true":void 0,"aria-busy":y?"true":void 0,"aria-pressed":U,"data-state":S,"data-active":R?"true":void 0,...N,children:z})}return e.jsx("button",{type:u,className:H,disabled:o,onClick:y?void 0:f,"aria-label":v,"aria-busy":y?"true":void 0,"aria-pressed":U,"data-state":S,"data-active":R?"true":void 0,...N,children:z})}function _t({label:t,error:s,hint:n,fullWidth:r=!0,icon:a,iconRight:o,onIconRightClick:c,size:i="m",disabled:d,id:f,iconRightLabel:u,...x}){const v=K(),p=f||`input-${l.useId()}`,w=n?`${p}-hint`:void 0,N=s?`${p}-error`:void 0,T=N||w;return e.jsxs("div",{className:`ds-input-wrapper ${r?"ds-input-wrapper--full":""} ${d?"ds-input-wrapper--disabled":""} ${s?"ds-input-wrapper--error":""}`,children:[t&&e.jsx("label",{className:"ds-input-label",htmlFor:p,children:t}),e.jsxs("div",{className:"ds-input-container",children:[a&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${i}`,"aria-hidden":"true",children:a}),e.jsx("input",{id:p,className:`ds-input ds-input--${i} ${a?"ds-input--with-icon":""} ${o?"ds-input--with-icon-right":""} ${s?"ds-input--error":""}`,disabled:d,"aria-invalid":s?"true":"false","aria-describedby":T,...x}),o&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${i}`,onClick:c,tabIndex:-1,"aria-label":u??v.toggleVisibility,children:o})]}),n&&!s&&e.jsx("span",{id:w,className:"ds-input-hint",children:n}),e.jsx("div",{className:"ds-input-error-wrap",children:e.jsx("div",{className:"ds-input-error-inner",children:s&&e.jsx("span",{id:N,className:"ds-input-error",role:"alert",children:s})})})]})}function jt({label:t,error:s,hint:n,fullWidth:r=!0,size:a="m",disabled:o,id:c,resize:i=!0,rows:d=3,...f}){const u=c||`textarea-${l.useId()}`,x=n?`${u}-hint`:void 0,v=s?`${u}-error`:void 0,p=v||x;return e.jsxs("div",{className:`ds-textarea-wrapper ${r?"ds-textarea-wrapper--full":""} ${o?"ds-textarea-wrapper--disabled":""}`,children:[t&&e.jsx("label",{className:"ds-textarea-label",htmlFor:u,children:t}),e.jsx("textarea",{id:u,className:`ds-textarea ds-textarea--${a} ${s?"ds-textarea--error":""} ${i?"":"ds-textarea--no-resize"}`,disabled:o,"aria-invalid":s?"true":"false","aria-describedby":p,rows:d,...f}),n&&!s&&e.jsx("span",{id:x,className:"ds-textarea-hint",children:n}),s&&e.jsx("span",{id:v,className:"ds-textarea-error",role:"alert",children:s})]})}function gt({label:t,value:s,onChange:n,options:r=[],placeholder:a,error:o,fullWidth:c=!0,size:i="m",disabled:d=!1,id:f,...u}){const x=K(),v=a??x.selectOption,[p,w]=l.useState(!1),[N,T]=l.useState(!1),[y,$]=l.useState({}),[A,b]=l.useState("down"),[R,E]=l.useState(-1),I=l.useRef(null),C=l.useRef(null),F=l.useRef(null),H=l.useRef(null),S=f||`select-${l.useId()}`,U=`${S}-label`,z=o?`${S}-error`:void 0,_=150,h=(j=!1)=>{N||(T(!0),E(-1),H.current=setTimeout(()=>{var D;w(!1),T(!1),j&&((D=F.current)==null||D.focus())},_))},g=j=>{clearTimeout(H.current),T(!1);const D=j!==void 0?j:Math.max(r.findIndex(V=>V.value===s),0);E(D),w(!0)};l.useEffect(()=>()=>clearTimeout(H.current),[]);const k=()=>{var Q;const j=(Q=I.current)==null?void 0:Q.getBoundingClientRect();if(!j)return;const D=window.innerHeight,V=D-j.bottom,X=j.top,Y=V<300&&X>V;b(Y?"up":"down"),$(Y?{bottom:D-j.top+4,left:j.left,width:j.width}:{top:j.bottom+4,left:j.left,width:j.width})};l.useEffect(()=>{if(p)return k(),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[p]),l.useEffect(()=>{const j=D=>{I.current&&!I.current.contains(D.target)&&C.current&&!C.current.contains(D.target)&&h()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[N]),l.useEffect(()=>{var D;if(!p||R<0||!C.current)return;(D=C.current.querySelectorAll(".ds-select-option")[R])==null||D.scrollIntoView({block:"nearest"})},[R,p]);const L=j=>{switch(j.key){case"ArrowDown":j.preventDefault(),p?E(D=>Math.min(D+1,r.length-1)):g();break;case"ArrowUp":j.preventDefault(),p?E(D=>Math.max(D-1,0)):g(r.length-1);break;case"Home":p&&(j.preventDefault(),E(0));break;case"End":p&&(j.preventDefault(),E(r.length-1));break;case"Enter":case" ":j.preventDefault(),p?R>=0&&(n==null||n(r[R].value),h(!0)):g();break;case"Escape":p&&(j.preventDefault(),h(!0));break;case"Tab":p&&h(!1);break}},M=r.find(j=>j.value===s),O=i==="xs"?q[1]:i==="small"?q[2]:q[3],m=p&&e.jsx("div",{ref:C,"data-ds-portal":"",role:"listbox","aria-labelledby":t?U:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${i}`,`ds-select-dropdown--${A}`,N&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:y,children:r.map((j,D)=>e.jsx("button",{id:`${S}-opt-${D}`,type:"button",role:"option",tabIndex:-1,"aria-selected":s===j.value,className:["ds-select-option",`ds-select-option--${i}`,s===j.value&&"ds-select-option--selected",D===R&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{n==null||n(j.value),h(!0)},children:j.label},j.value))});return e.jsxs("div",{className:`ds-select-wrapper ${c?"ds-select-wrapper--full":""} ${d?"ds-select-wrapper--disabled":""}`,children:[t&&e.jsx("label",{id:U,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:I,children:e.jsxs("button",{ref:F,type:"button",id:S,role:"combobox","aria-haspopup":"listbox","aria-expanded":p,"aria-activedescendant":p&&R>=0?`${S}-opt-${R}`:void 0,"aria-labelledby":t?U:void 0,"aria-invalid":o?"true":"false","aria-describedby":z,className:`ds-select-trigger ds-select-trigger--${i} ${o?"ds-select-trigger--error":""}`,onClick:()=>{d||(p?h():g())},onKeyDown:L,disabled:d,...u,children:[e.jsx("span",{className:M?"":"ds-select-placeholder",children:(M==null?void 0:M.label)||v}),e.jsx(P.ChevronDown,{size:O,strokeWidth:1.5,className:`ds-select-icon ${p&&A==="down"?"ds-select-icon--open":""} ${p&&A==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),o&&e.jsx("span",{id:z,className:"ds-select-error",role:"alert",children:o}),typeof document<"u"&&te.createPortal(m,document.body)]})}function wt({label:t,value:s=0,onChange:n,min:r=0,max:a=100,step:o=1,size:c="m",disabled:i=!1,hint:d,error:f,decreaseLabel:u,increaseLabel:x,...v}){const p=K(),w=()=>{if(i)return;const b=Math.min(Number(s)+o,a);n==null||n(b)},N=()=>{if(i)return;const b=Math.max(Number(s)-o,r);n==null||n(b)},T=b=>{if(i)return;const R=b.target.value;if(R===""){n==null||n(r);return}const E=Number(R);if(!isNaN(E)){const I=Math.min(Math.max(E,r),a);n==null||n(I)}},y=["ds-stepper-wrapper",i&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),$=["ds-stepper",`ds-stepper--${c}`,i&&"ds-stepper--disabled"].filter(Boolean).join(" "),A=c==="xs"?q[1]:c==="small"?q[2]:q[3];return e.jsxs("div",{className:y,children:[t&&e.jsx("label",{className:"ds-stepper-label",children:t}),e.jsxs("div",{className:$,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:N,disabled:i||s<=r,"aria-label":u??p.decrease,children:e.jsx(P.Minus,{size:A,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:T,min:r,max:a,step:o,disabled:i,...v}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:w,disabled:i||s>=a,"aria-label":x??p.increase,children:e.jsx(P.Plus,{size:A,strokeWidth:1.5})})]}),d&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:d}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function Nt({children:t,padding:s="m",variant:n="default",hover:r=!1,onClick:a,href:o,disabled:c=!1,className:i="",...d}){const u=(r?"interactive":n)==="interactive"||a||o,x=["ds-card",`ds-card--${s}`,u&&"ds-card--interactive",i].filter(Boolean).join(" ");if(o){const w=N=>{if(c){N.preventDefault();return}N.metaKey||N.ctrlKey||N.button===1||(N.preventDefault(),a==null||a(N))};return e.jsx("a",{className:x,href:c?void 0:o,onClick:w,"aria-disabled":c?"true":void 0,...d,children:t})}const v=u&&a?"button":"div",p=u&&a?{type:"button",onClick:a,disabled:c}:{};return e.jsx(v,{className:x,role:u&&!a?"article":void 0,...p,...d,children:t})}function yt({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function kt({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function Et({children:t,...s}){return e.jsx("h3",{className:"ds-h3",...s,children:t})}function Rt({children:t,...s}){return e.jsx("h4",{className:"ds-h4",...s,children:t})}function St({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function tt({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p2 ${s?"ds-p2--secondary":""}`,...n,children:t})}function Le({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p3 ${s?"ds-p3--secondary":""}`,...n,children:t})}function ce({children:t,variant:s="default",size:n="m",role:r,...a}){const o=["ds-badge",`ds-badge--${s}`,`ds-badge--${n}`].filter(Boolean).join(" "),c=r||(["info","success","warning","error"].includes(s)?"status":void 0);return e.jsx("span",{className:o,role:c,...a,children:t})}const Tt={info:P.Info,success:P.CheckCircle,warning:P.AlertTriangle,error:P.XCircle},$t=l.forwardRef(function({children:s,variant:n="info",title:r,onClose:a,role:o,closeLabel:c,...i},d){const f=K(),u=Tt[n],x=o||(n==="error"?"alert":"status");return e.jsxs("div",{ref:d,className:`ds-alert ds-alert--${n} ${r?"":"ds-alert--no-title"}`,role:x,...i,children:[u&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(u,{size:q[3],strokeWidth:1.5})}),e.jsxs("div",{className:"ds-alert__content",children:[r&&e.jsx("div",{className:"ds-alert__title",children:r}),s&&e.jsx("div",{className:"ds-alert__message",children:s})]}),a&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:a,"aria-label":c??f.closeAlert,children:e.jsx(P.X,{size:q[3],strokeWidth:1.5})})]})}),At="data-ds-portal";function Pe(t){var n;const s=((n=t.composedPath)==null?void 0:n.call(t)[0])??t.target;return s instanceof Element?s:s instanceof Node?s.parentElement:null}function Ce(t,s){var r;const n=(r=t==null?void 0:t.closest)==null?void 0:r.call(t,`[${At}]`);return!!(n&&n!==s)}const Bt=200;function Dt({children:t,title:s,onClose:n,size:r="m",scrollable:a=!1,subHeader:o,closeLabel:c,...i}){const d=K(),f=l.useRef(null),u=l.useRef(null),x=l.useId(),[v,p]=l.useState(!1),w=l.useRef(null),N=()=>{!n||v||(p(!0),w.current=setTimeout(()=>{p(!1),n()},Bt))};l.useEffect(()=>()=>clearTimeout(w.current),[]),l.useEffect(()=>{const b=E=>{E.key==="Escape"&&N()},R=E=>{var C;const I=Pe(E);I&&((C=u.current)!=null&&C.contains(I)||Ce(I,f.current)||N())};return document.addEventListener("keydown",b),document.addEventListener("mousedown",R),()=>{document.removeEventListener("keydown",b),document.removeEventListener("mousedown",R)}},[n,v]);const T=l.Children.toArray(t),y=T.find(b=>(b==null?void 0:b.type)===de),$=T.filter(b=>(b==null?void 0:b.type)!==de),A=e.jsx("div",{className:["ds-modal-overlay",v&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...i,ref:f,"data-ds-portal":"",children:e.jsxs("div",{className:[`ds-modal ds-modal--${r}`,a&&"ds-modal--scrollable"].filter(Boolean).join(" "),"data-surface":"2",ref:u,role:"dialog","aria-modal":"true","aria-labelledby":s?x:void 0,children:[n&&e.jsx(re,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(P.X,{size:q[2],strokeWidth:1.5}),onClick:N,"aria-label":c??d.closeModal}),(s||o)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:x,className:"ds-modal__title",children:s}),o&&e.jsx("div",{className:"ds-modal__subheader",children:o})]}),e.jsx("div",{className:"ds-modal__body ds-scrollable",children:$}),y]})});return typeof document>"u"?A:te.createPortal(A,document.body)}function de({children:t}){return!t||l.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const It=320;function Lt({children:t,title:s,onClose:n,subHeader:r,closeLabel:a,...o}){const c=K(),i=l.useRef(null),d=l.useRef(null),f=l.useId(),[u,x]=l.useState(!1),v=l.useRef(null),p=()=>{!n||u||(x(!0),v.current=setTimeout(()=>{x(!1),n()},It))};l.useEffect(()=>()=>clearTimeout(v.current),[]),l.useEffect(()=>{const $=b=>{b.key==="Escape"&&p()},A=b=>{var E;const R=Pe(b);R&&((E=d.current)!=null&&E.contains(R)||Ce(R,i.current)||p())};return document.addEventListener("keydown",$),document.addEventListener("mousedown",A),()=>{document.removeEventListener("keydown",$),document.removeEventListener("mousedown",A)}},[n,u]);const w=l.Children.toArray(t),N=w.find($=>($==null?void 0:$.type)===de),T=w.filter($=>($==null?void 0:$.type)!==de),y=e.jsx("div",{className:["ds-bottom-sheet-overlay",u&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...o,ref:i,"data-ds-portal":"",children:e.jsxs("div",{ref:d,className:["ds-bottom-sheet",u&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),"data-surface":"2",role:"dialog","aria-modal":"true","aria-labelledby":s?f:void 0,children:[e.jsx("div",{className:"ds-bottom-sheet__handle","aria-hidden":"true"}),n&&e.jsx(re,{className:"ds-bottom-sheet__close",variant:"ghost",size:"small",icon:e.jsx(P.X,{size:q[2],strokeWidth:1.5}),onClick:p,"aria-label":a??c.close}),(s||r)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[s&&e.jsx("h3",{id:f,className:"ds-bottom-sheet__title",children:s}),r&&e.jsx("div",{className:"ds-bottom-sheet__subheader",children:r})]}),e.jsx("div",{className:"ds-bottom-sheet__body ds-scrollable",children:T}),N]})});return typeof document>"u"?y:te.createPortal(y,document.body)}function st({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="s",className:c="",...i}){const d=K(),f=s??d.code,[u,x]=l.useState(n),v=r!==void 0,p=v?r:u,w=()=>{v?a==null||a(!r):x(T=>!T)},N=["ds-code-accordion",`ds-code-accordion--${o}`,p&&"ds-code-accordion--expanded",c].filter(Boolean).join(" ");return e.jsxs("div",{className:N,...i,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:w,"aria-expanded":p,children:[e.jsx("span",{className:"ds-code-accordion__title",children:f}),e.jsx(P.ChevronDown,{size:q[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${p?"ds-code-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-code-accordion__content",children:e.jsx("div",{className:"ds-code-accordion__inner",children:e.jsx("pre",{className:"ds-code-accordion__pre ds-scrollable",children:e.jsx("code",{children:t})})})})]})}function Pt({children:t,block:s=!1,collapsible:n=!1,title:r,defaultExpanded:a=!1,...o}){const c=K(),i=r??c.code;return s?n?e.jsx(st,{title:i,defaultExpanded:a,...o,children:t}):e.jsx("pre",{className:"ds-code-block ds-scrollable",...o,children:e.jsx("code",{children:t})}):e.jsx("code",{className:"ds-code-inline",...o,children:t})}function Ct({href:t,children:s,onClick:n,target:r,rel:a,...o}){const i=r==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:t,className:"ds-link",onClick:n,target:r,rel:i,...o,children:s})}function Mt({children:t,size:s="m",variant:n="ghost",...r}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...r,children:l.Children.map(t,a=>l.isValidElement(a)?l.cloneElement(a,{size:s,variant:n}):a)})}function Ft({children:t,selected:s=!1,onClick:n,size:r="m",variant:a="ghost",disabled:o=!1,icon:c,href:i,...d}){const f=c&&!t,u=["ds-tab",`ds-tab--${r}`,`ds-tab--${a}`,s&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),x=e.jsxs(e.Fragment,{children:[c&&e.jsx("span",{className:"ds-tab-icon",children:c}),t]});if(i){const v=p=>{if(o){p.preventDefault();return}p.metaKey||p.ctrlKey||p.button===1||(p.preventDefault(),n==null||n(p))};return e.jsx("a",{role:"tab","aria-current":s?"page":void 0,"aria-disabled":o?"true":void 0,className:u,href:o?void 0:i,onClick:v,...d,children:x})}return e.jsx("button",{role:"tab","aria-selected":s,className:u,onClick:n,disabled:o,...d,children:x})}function zt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-browser-pane",s].filter(Boolean).join(" "),...n,children:t})}function Ot({tabs:t,active:s,onChange:n,onClose:r,className:a="",...o}){const{t:c}=ue();return e.jsx("div",{className:["ds-browser-tabs",a].filter(Boolean).join(" "),role:"tablist",...o,children:t.map(i=>{const d=i.id===s,f=!!i.closable;return e.jsxs("div",{className:["ds-browser-tab",d&&"ds-browser-tab--active",f&&"ds-browser-tab--closable"].filter(Boolean).join(" "),title:i.label,children:[e.jsxs("button",{type:"button",role:"tab","aria-selected":d,className:"ds-browser-tab__hit",onClick:()=>n==null?void 0:n(i.id),children:[i.icon?e.jsx("span",{className:"ds-browser-tab__icon","aria-hidden":!0,children:i.icon}):null,e.jsx("span",{className:"ds-browser-tab__label",children:i.label})]}),f?e.jsx("button",{type:"button",className:"ds-browser-tab__close","aria-label":c("closeTab",{label:i.label}),onClick:u=>{u.stopPropagation(),r==null||r(i.id)},children:e.jsx(P.X,{size:12,strokeWidth:2})}):null]},i.id)})})}function Wt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-list",s].filter(Boolean).join(" "),role:"list",...n,children:t})}function Ht({icon:t,title:s,subtitle:n,meta:r,onClick:a,className:o="",...c}){const i=r==null?[]:Array.isArray(r)?r:[r],d=["ds-list-row",!t&&"ds-list-row--no-icon",a&&"ds-list-row--interactive",o].filter(Boolean).join(" "),f=e.jsxs(e.Fragment,{children:[t?e.jsx("span",{className:"ds-list-row__icon","aria-hidden":!0,children:t}):null,e.jsxs("span",{className:"ds-list-row__name",children:[e.jsx("span",{className:"ds-list-row__title",children:s}),n?e.jsx("span",{className:"ds-list-row__subtitle",children:n}):null]}),i.map((u,x)=>e.jsx("span",{className:"ds-list-row__meta",children:u},x))]});return a?e.jsx("button",{type:"button",role:"listitem",className:d,onClick:a,...c,children:f}):e.jsx("div",{role:"listitem",className:d,...c,children:f})}const We=.5,Ut={s:12,m:14,sm:14,l:16};function Vt(t){const s=getComputedStyle(t);return t.clientWidth-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)}function ge({icon:t}){return t?e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:t}):null}function qt({options:t,value:s,onChange:n,size:r="m",disabled:a=!1,overflow:o="menu"}){const c=l.useRef(null),i=l.useRef(null),d=l.useRef(null),f=l.useRef(null),u=l.useRef(null),[x,v]=l.useState(!1),[p,w]=l.useState(!1),[N,T]=l.useState(!1),y=l.useRef(!1),$=l.useRef(null),A=l.useRef(null),b=l.useRef(!1),R=l.useId(),E=p&&o==="stack",I=p&&o!=="stack",C=t.find(_=>_.value===s)||t[0],F=()=>{const _=c.current,h=i.current;if(!_||!h)return;const g=Vt(_),k=[...h.querySelectorAll(".ds-seg__btn")].reduce((X,G)=>X+G.getBoundingClientRect().width,0);if(g>0&&k>0){const X=b.current,G=X?!(g>k+We):k>g+We;if(G!==X){b.current=G,w(G),G||T(!1);return}}if(b.current&&o!=="stack")return;const L=_.querySelector(`:scope > button[data-value="${CSS.escape(String(s))}"]`);if(!L)return;const M=_.getBoundingClientRect(),O=L.getBoundingClientRect(),m=O.left-M.left-_.clientLeft,j=O.top-M.top-_.clientTop,D=b.current&&o==="stack",V=X=>{const G=window.matchMedia("(prefers-reduced-motion: reduce)").matches;X.style.transition=y.current&&!G?"left var(--transition-normal), width var(--transition-normal), top var(--transition-normal), height var(--transition-normal)":"none",X.style.left=`${m}px`,X.style.width=`${O.width}px`,D?(X.style.top=`${j}px`,X.style.height=`${O.height}px`,X.style.bottom="auto"):(X.style.top="",X.style.height="",X.style.bottom=""),y.current=!1};d.current?V(d.current):v(!0)};A.current=F,l.useLayoutEffect(()=>{const _=$.current!==s;$.current=s,y.current=x&&_,F()}),l.useEffect(()=>{const _=c.current;if(!_)return;const h=new ResizeObserver(()=>{var k;y.current=!1,(k=A.current)==null||k.call(A)});h.observe(_),_.parentElement&&h.observe(_.parentElement);let g=!1;return document.fonts&&document.fonts.status!=="loaded"&&document.fonts.ready.then(()=>{var k;g||(y.current=!1,(k=A.current)==null||k.call(A))}),()=>{g=!0,h.disconnect()}},[]),l.useLayoutEffect(()=>{var k;if(!N)return;const _=u.current,h=f.current;if(!_||!h)return;const g=()=>{const L=h.getBoundingClientRect(),M=Math.max(L.width,_.scrollWidth),O=window.innerWidth-M-8,m=Math.max(8,Math.min(L.left,O));_.style.width=`${M}px`,_.style.left=`${m}px`;const j=_.offsetHeight,D=window.innerHeight-L.bottom;D<j+8&&L.top>D?(_.style.top="auto",_.style.bottom=`${window.innerHeight-L.top+4}px`):(_.style.bottom="auto",_.style.top=`${L.bottom+4}px`)};return g(),(k=_.querySelector('[aria-selected="true"]'))==null||k.focus(),window.addEventListener("resize",g),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0)}},[N,s,t]),l.useEffect(()=>{if(!N)return;const _=g=>{var k,L;(k=c.current)!=null&&k.contains(g.target)||(L=u.current)!=null&&L.contains(g.target)||T(!1)},h=g=>{var k;g.key==="Escape"&&(T(!1),(k=f.current)==null||k.focus())};return document.addEventListener("mousedown",_),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",h)}},[N]);const H=_=>{var h;a||n(_),T(!1),(h=f.current)==null||h.focus()},S=(_,h)=>{var k,L,M,O,m,j,D;const g=(k=u.current)==null?void 0:k.querySelectorAll(".ds-seg__option");g!=null&&g.length&&(_.key==="ArrowDown"?(_.preventDefault(),(L=g[Math.min(h+1,g.length-1)])==null||L.focus()):_.key==="ArrowUp"?(_.preventDefault(),h===0?(M=f.current)==null||M.focus():(O=g[h-1])==null||O.focus()):_.key==="Home"?(_.preventDefault(),(m=g[0])==null||m.focus()):_.key==="End"?(_.preventDefault(),(j=g[g.length-1])==null||j.focus()):_.key==="Escape"&&(_.preventDefault(),T(!1),(D=f.current)==null||D.focus()))},U=e.jsx("div",{className:"ds-seg__measure",ref:i,"aria-hidden":"true",children:t.map(_=>e.jsxs("button",{type:"button",tabIndex:-1,className:"ds-seg__btn","data-value":_.value,children:[e.jsx(ge,{icon:_.icon}),_.label]},_.value))}),z=I&&N&&typeof document<"u"&&te.createPortal(e.jsx("div",{ref:u,id:R,className:["ds-seg__menu",`ds-seg--${r}`].join(" "),role:"listbox","aria-activedescendant":void 0,children:t.map((_,h)=>e.jsxs("button",{type:"button",role:"option",className:["ds-seg__option",_.value===s&&"ds-seg__option--selected"].filter(Boolean).join(" "),"aria-selected":_.value===s,onClick:()=>H(_.value),onKeyDown:g=>S(g,h),children:[e.jsx(ge,{icon:_.icon}),_.label]},_.value))}),document.body);return e.jsxs("div",{className:["ds-seg",`ds-seg--${r}`,E&&"ds-seg--stack",I&&"ds-seg--menu",a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:c,role:I?void 0:"group","data-seg-mode":I?"menu":E?"stack":"row",children:[U,I?e.jsxs("button",{ref:f,type:"button",className:"ds-seg__btn ds-seg__trigger","aria-haspopup":"listbox","aria-expanded":N,"aria-controls":R,disabled:a,onClick:()=>!a&&T(_=>!_),onKeyDown:_=>{_.key==="ArrowDown"||_.key==="ArrowUp"?(_.preventDefault(),T(!0)):_.key==="Escape"&&T(!1)},children:[e.jsxs("span",{className:"ds-seg__trigger-label",children:[e.jsx(ge,{icon:C==null?void 0:C.icon}),C==null?void 0:C.label]}),e.jsx(P.ChevronDown,{size:Ut[r]||14,strokeWidth:1.5,className:N?"ds-seg__chevron ds-seg__chevron--open":"ds-seg__chevron","aria-hidden":"true"})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{ref:d,className:"ds-seg__pill","aria-hidden":"true"}),t.map(_=>e.jsxs("button",{type:"button","data-value":_.value,className:["ds-seg__btn",s===_.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&n(_.value),"aria-pressed":s===_.value,disabled:a,children:[e.jsx(ge,{icon:_.icon}),_.label]},_.value))]}),z]})}function ye({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="m",...c}){const[i,d]=l.useState(n),f=r!==void 0,u=f?r:i,x=()=>{f?a==null||a(!r):d(p=>!p)},v=["ds-accordion",`ds-accordion--${o}`,u&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:v,...c,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:x,"aria-expanded":u,children:[e.jsx("span",{className:"ds-accordion__title",children:s}),e.jsx(P.ChevronDown,{size:q[2],strokeWidth:1.5,className:`ds-accordion__icon ${u?"ds-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-accordion__content",children:e.jsx("div",{className:"ds-accordion__content-inner",children:e.jsx("div",{className:"ds-accordion__content-body",children:t})})})]})}const ae=8,fe=8;function Xt(t,s,n){const r=window.innerWidth;let a,o;switch(t){case"top":a=s.top-n.height-ae,o=s.left+s.width/2-n.width/2;break;case"bottom":a=s.bottom+ae,o=s.left+s.width/2-n.width/2;break;case"left":a=s.top+s.height/2-n.height/2,o=s.left-n.width-ae;break;case"right":a=s.top+s.height/2-n.height/2,o=s.right+ae;break;default:a=s.bottom+ae,o=s.left}const c=Math.max(fe,Math.min(r-n.width-fe,o)),i=o-c;return{top:a,left:c,arrowOffset:i}}function Yt(t,s,n){const r=window.innerWidth,a=window.innerHeight;if(t.top>=s+ae+fe)return"top";if(a-t.bottom>=s+ae+fe)return"bottom";if(r-t.right>=n+ae+fe)return"right";if(t.left>=n+ae+fe)return"left";const o=Math.max(t.top,a-t.bottom,t.left,r-t.right);return o===t.top?"top":o===a-t.bottom?"bottom":o===r-t.right?"right":"left"}function He(){return window.matchMedia("(hover: hover) and (pointer: fine)").matches}function Kt(t){return t?t.matches(":focus-visible")||!!t.querySelector(":focus-visible"):!1}function ke({children:t,content:s,position:n,...r}){const[a,o]=l.useState(!1),[c,i]=l.useState({visibility:"hidden"}),[d,f]=l.useState(n||"top"),u=l.useRef(null),x=l.useRef(null),v=()=>{if(!u.current||!x.current)return;const $=u.current.getBoundingClientRect(),A=x.current.getBoundingClientRect(),b=n||Yt($,A.height,A.width),{top:R,left:E,arrowOffset:I}=Xt(b,$,A);f(b),i({position:"fixed",top:R,left:E,visibility:"visible","--arrow-offset":`${I}px`})};l.useEffect(()=>{if(!a)return;i({position:"fixed",visibility:"hidden"});const $=requestAnimationFrame(v);return window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{cancelAnimationFrame($),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[a,n]);const p=()=>{He()&&o(!0)},w=()=>{Kt(u.current)||o(!1)},N=$=>{const A=$.target;A instanceof Element&&A.matches(":focus-visible")&&o(!0)},T=$=>{var b,R;const A=$.relatedTarget;A instanceof Node&&((b=u.current)!=null&&b.contains(A))||He()&&((R=u.current)!=null&&R.matches(":hover"))||o(!1)};if(!s)return t;const y=a&&e.jsx("div",{ref:x,"data-ds-portal":"",className:`ds-tooltip ds-tooltip--${d}`,role:"tooltip",style:c,children:s});return e.jsxs("div",{ref:u,className:"ds-tooltip-wrapper",onMouseEnter:p,onMouseLeave:w,onFocus:N,onBlur:T,...r,children:[t,typeof document<"u"&&te.createPortal(y,document.body)]})}const Ue=8,we=8,Gt=140;function Ve(t){const s=String(t??"").replace(/^@/,"").trim();return s?`@${s}`:""}function Jt({label:t,children:s,mode:n="click",avatar:r,name:a,handle:o,description:c,actions:i,className:d="",popoverClassName:f="",...u}){const x=l.useId(),v=l.useRef(null),p=l.useRef(null),w=l.useRef(null),[N,T]=l.useState(!1),[y,$]=l.useState(null),A=s!=null,b=a||t||"",R=Ve(t||a),E=Ve(o),I=l.useCallback(()=>{w.current!=null&&(window.clearTimeout(w.current),w.current=null)},[]),C=l.useCallback(()=>{I(),T(!0)},[I]),F=l.useCallback(()=>{I(),w.current=window.setTimeout(()=>T(!1),Gt)},[I]),H=l.useCallback(()=>{const z=v.current,_=p.current;if(!z)return;const h=z.getBoundingClientRect(),g=(_==null?void 0:_.offsetHeight)??160,k=(_==null?void 0:_.offsetWidth)??260;let L=h.bottom+Ue;L+g>window.innerHeight-we&&(L=Math.max(we,h.top-g-Ue));const M=Math.max(we,Math.min(h.left,window.innerWidth-k-we));$({top:L,left:M})},[]);l.useLayoutEffect(()=>{N&&H()},[N,H]),l.useEffect(()=>{if(!N)return;const z=()=>H(),_=g=>{g.key==="Escape"&&T(!1)},h=g=>{var L,M;if(n==="hover")return;const k=g.target;(L=p.current)!=null&&L.contains(k)||(M=v.current)!=null&&M.contains(k)||T(!1)};return window.addEventListener("scroll",z,!0),window.addEventListener("resize",z),document.addEventListener("keydown",_),document.addEventListener("mousedown",h),()=>{window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z),document.removeEventListener("keydown",_),document.removeEventListener("mousedown",h)}},[N,H,n]),l.useEffect(()=>()=>I(),[I]);const S=n==="hover"?{onMouseEnter:C,onMouseLeave:F}:{},U=N?te.createPortal(e.jsxs("div",{ref:p,id:x,role:"dialog","aria-label":b||R||"Mention","data-ds-portal":"",className:["ds-mention__popover",f].filter(Boolean).join(" "),style:y?{top:y.top,left:y.left}:{top:-9999,left:-9999,visibility:"hidden"},...S,children:[(r||b||E)&&e.jsxs("div",{className:"ds-mention__head",children:[r,(b||E)&&e.jsxs("div",{className:"ds-mention__meta",children:[b?e.jsx("span",{className:"ds-mention__name",children:b}):null,E?e.jsx("span",{className:"ds-mention__handle",children:E}):null]})]}),c?e.jsx("p",{className:"ds-mention__desc",children:c}):null,i?e.jsx("div",{className:"ds-mention__actions",onClick:()=>T(!1),children:i}):null]}),document.body):null;return e.jsxs(e.Fragment,{children:[e.jsx("button",{...u,ref:v,type:"button",className:["ds-mention",A&&"ds-mention--custom",d].filter(Boolean).join(" "),"aria-expanded":N,"aria-haspopup":"dialog","aria-label":A&&(R||b)||void 0,"aria-controls":N?x:void 0,onClick:z=>{var _;if((_=u.onClick)==null||_.call(u,z),!z.defaultPrevented){if(z.preventDefault(),z.stopPropagation(),n==="hover"){C();return}T(h=>!h)}},...S,children:A?s:R}),typeof document<"u"?U:null]})}function Zt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...c}){const i=o||`toggle-${l.useId()}`,d=["ds-toggle",`ds-toggle--${n}`,r&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:d,htmlFor:i,children:[e.jsx("input",{type:"checkbox",id:i,className:"ds-toggle__input",checked:t,onChange:f=>s==null?void 0:s(f.target.checked),disabled:r,...c}),e.jsx("span",{className:"ds-toggle__track",children:e.jsx("span",{className:"ds-toggle__thumb"})}),a&&e.jsx("span",{className:"ds-toggle__label",children:a})]})}function Qt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...c}){const i=o||`checkbox-${l.useId()}`,d=["ds-checkbox",`ds-checkbox--${n}`,r&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=n==="xs"?10:n==="small"?14:n==="large"?20:16;return e.jsxs("label",{className:d,htmlFor:i,children:[e.jsx("input",{type:"checkbox",id:i,className:"ds-checkbox__input",checked:t,onChange:u=>s==null?void 0:s(u.target.checked),disabled:r,...c}),e.jsx("span",{className:"ds-checkbox__box",children:t&&e.jsx(P.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function es({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,name:o,value:c,id:i,...d}){const f=i||`radio-${l.useId()}`,u=["ds-radio",`ds-radio--${n}`,r&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:u,htmlFor:f,children:[e.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:t,onChange:x=>s==null?void 0:s(x.target.checked),disabled:r,name:o,value:c,...d}),e.jsx("span",{className:"ds-radio__circle",children:e.jsx("span",{className:"ds-radio__dot"})}),a&&e.jsx("span",{className:"ds-radio__label",children:a})]})}function nt({width:t,height:s,shape:n="rect",aspectRatio:r,className:a="",style:o={},...c}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${n}`,a].filter(Boolean).join(" "),style:{width:t,height:s,aspectRatio:r,...o},"aria-hidden":"true",...c})}function ts({lines:t=1,lastLineWidth:s="70%",gap:n,className:r="",style:a={},...o}){return e.jsx("span",{className:["ds-skeleton-text",r].filter(Boolean).join(" "),style:{gap:n,...a},"aria-hidden":"true",...o,children:Array.from({length:t},(c,i)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:i===t-1&&t>1?{width:s}:void 0},i))})}nt.Text=ts;function ss(t){let s=2166136261;for(let n=0;n<t.length;n++)s^=t.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s%360}function ns(t){if(!t)return"";const s=t.trim().split(/\s+/);return s.length>=2?(s[0][0]+s[1][0]).toUpperCase():t[0].toUpperCase()}function rs({seed:t,icon:s,src:n,size:r=32,className:a="",style:o={},...c}){const i=ss(t??""),[d,f]=l.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:ns(t)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:r,height:r,"--ds-avatar-h":i,...o},"aria-hidden":"true",...c,children:n&&!d?e.jsx("img",{src:n,alt:"",onError:()=>f(!0)}):u})}function as({children:t,size:s="compact",stickyTop:n,maxHeight:r,className:a="",style:o={},...c}){const i={...r?{maxHeight:r}:{},...n!==void 0?{"--ds-table-sticky-top":typeof n=="number"?`${n}px`:n}:{},...o};return e.jsx("div",{className:["ds-table-wrap","ds-scrollable",r?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:i,children:e.jsx("table",{className:["ds-table",`ds-table--${s}`,a].filter(Boolean).join(" "),...c,children:t})})}function os({children:t,...s}){return e.jsx("thead",{...s,children:t})}function is({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function ls({children:t,interactive:s,selected:n,subheader:r,exiting:a,updated:o,className:c="",onClick:i,...d}){return e.jsx("tr",{className:["ds-table-row",s||i?"ds-table-row--interactive":"",n?"ds-table-row--selected":"",r?"ds-table-row--subheader":"",a?"ds-table-row--exiting":"",o?"ds-table-row--updated":"",c].filter(Boolean).join(" "),onClick:i,...d,children:t})}function cs({children:t,colSpan:s=999,...n}){return e.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...n,children:e.jsx("td",{colSpan:s,children:t})})}function ds({children:t,align:s="left",sortDir:n,onSort:r,width:a,className:o="",style:c={},...i}){const d=!!r||n!==void 0,f=n==="asc"?P.ChevronUp:n==="desc"?P.ChevronDown:P.ChevronsUpDown;return e.jsx("th",{className:["ds-th",d?"ds-th--sortable":"",n?"ds-th--sorted":"",s!=="left"?`ds-table-cell--${s}`:"",o].filter(Boolean).join(" "),onClick:r,style:{width:a,...c},...i,children:d?e.jsxs("span",{className:"ds-th__inner",children:[t,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function us({children:t,align:s="left",secondary:n,muted:r,truncate:a,nowrap:o,className:c="",...i}){return e.jsx("td",{className:["ds-td",s!=="left"?`ds-table-cell--${s}`:"",n?"ds-table-cell--secondary":"",r?"ds-table-cell--muted":"",a?"ds-table-cell--truncate":"",o?"ds-table-cell--nowrap":"",c].filter(Boolean).join(" "),...i,children:t})}function fs({icon:t,title:s,description:n,action:r,size:a="m",className:o="",...c}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,o].filter(Boolean).join(" "),...c,children:[t&&e.jsx("div",{className:"ds-empty-state__icon",children:t}),e.jsx("div",{className:"ds-empty-state__title",children:s}),n&&e.jsx("div",{className:"ds-empty-state__description",children:n}),r&&e.jsx("div",{className:"ds-empty-state__action",children:r})]})}function ms({label:t,hint:s,error:n,required:r=!1,disabled:a=!1,htmlFor:o,children:c,className:i="",style:d,...f}){const u=l.useId(),x=o??u,v=`${x}-hint`,p=`${x}-error`;return e.jsxs("div",{className:`ds-field${i?` ${i}`:""}`,"data-state":n?"error":void 0,"data-required":r?"":void 0,"data-disabled":a?"":void 0,style:d,...f,children:[t&&e.jsx("label",{className:"ds-field-label",htmlFor:x,children:t}),e.jsx("div",{className:"ds-field-control",children:c}),s&&!n&&e.jsx("p",{className:"ds-field-hint",id:v,children:s}),n&&e.jsx("p",{className:"ds-field-error",id:p,role:"alert",children:n})]})}function ps({label:t,value:s,delta:n,size:r="m",inline:a=!1,className:o="",style:c,...i}){const d=n!=null&&n.startsWith("+")?"up":n!=null&&n.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${r}`,a&&"ds-stat--inline",o].filter(Boolean).join(" "),style:c,...i,children:[t&&e.jsx("span",{className:"ds-stat-label",children:t}),s!=null&&e.jsx("span",{className:"ds-stat-value",children:s}),n!=null&&e.jsx("span",{className:`ds-stat-delta ds-stat-delta--${d}`,children:n})]})}function hs({children:t,separator:s="/","aria-label":n,className:r="",style:a,...o}){const c=K(),i=l.Children.toArray(t).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${r?` ${r}`:""}`,"aria-label":n??c.breadcrumb,style:a,...o,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:i.map((d,f)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[d,f<i.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:s})]},f))})})}function xs({page:t,total:s,onChange:n,siblings:r=1,"aria-label":a,previousLabel:o,nextLabel:c,className:i="",style:d,...f}){const u=K(),{t:x}=ue(),v=vs(t,s,r);return e.jsxs("nav",{className:`ds-pagination${i?` ${i}`:""}`,"aria-label":a??u.pagination,style:d,...f,children:[e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t-1),disabled:t<=1,"aria-label":o??u.previousPage,children:e.jsx(P.ChevronLeft,{size:16})}),v.map((p,w)=>p==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${w}`):e.jsx("button",{className:`ds-pagination-page${p===t?" ds-pagination-page--current":""}`,onClick:()=>p!==t&&(n==null?void 0:n(p)),"aria-current":p===t?"page":void 0,"aria-label":x("pageN",{n:p}),children:p},p)),e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t+1),disabled:t>=s,"aria-label":c??u.nextPage,children:e.jsx(P.ChevronRight,{size:16})})]})}function vs(t,s,n){if(s<=7)return Array.from({length:s},(c,i)=>i+1);const r=Math.max(2,t-n),a=Math.min(s-1,t+n),o=[1];r>2&&o.push("…");for(let c=r;c<=a;c++)o.push(c);return a<s-1&&o.push("…"),o.push(s),o}const bs=300;function _s({children:t,title:s,onClose:n,subHeader:r,side:a="right",size:o="wide",offsetLeft:c=0,offsetRight:i=0,keepOpenRef:d,closeLabel:f,...u}){const x=K(),v=l.useRef(null),p=l.useId(),[w,N]=l.useState(!1),T=l.useRef(null),y=()=>{!n||w||(N(!0),T.current=setTimeout(()=>{N(!1),n()},bs))};l.useEffect(()=>()=>clearTimeout(T.current),[]),l.useEffect(()=>{const E=C=>{C.key==="Escape"&&y()},I=C=>{var H,S;const F=Pe(C);F&&((H=d==null?void 0:d.current)!=null&&H.contains(F)||(S=v.current)!=null&&S.contains(F)||Ce(F,null)||y())};return document.addEventListener("keydown",E),document.addEventListener("mousedown",I),()=>{document.removeEventListener("keydown",E),document.removeEventListener("mousedown",I)}},[n,w,d]);const $=l.Children.toArray(t),A=$.find(E=>(E==null?void 0:E.type)===Ae||(E==null?void 0:E.type)===de),b=$.filter(E=>(E==null?void 0:E.type)!==Ae&&(E==null?void 0:E.type)!==de),R=e.jsx("div",{className:["ds-side-page-overlay",w&&"ds-side-page-overlay--closing"].filter(Boolean).join(" "),"data-side":a,style:{"--ds-side-page-offset-left":`${c}px`,"--ds-side-page-offset-right":`${i}px`},...u,children:e.jsxs("div",{ref:v,className:["ds-side-page",w&&"ds-side-page--closing"].filter(Boolean).join(" "),"data-surface":"2","data-side":a,"data-size":o,role:"dialog","aria-modal":"true","aria-labelledby":s?p:void 0,children:[n&&e.jsx(re,{className:"ds-side-page__close",variant:"ghost",size:"small",icon:e.jsx(P.X,{size:q[2],strokeWidth:1.5}),onClick:y,"aria-label":f??x.close}),(s||r)&&e.jsxs("div",{className:"ds-side-page__header",children:[s&&e.jsx("h3",{id:p,className:"ds-side-page__title",children:s}),r&&e.jsx("div",{className:"ds-side-page__subheader",children:r})]}),e.jsx("div",{className:"ds-side-page__body ds-scrollable",children:b}),A]})});return typeof document>"u"?R:te.createPortal(R,document.body)}function Ae({children:t}){return!t||l.Children.count(t)===0?null:e.jsx("div",{className:"ds-side-page__footer",children:t})}const pe=l.createContext({collapsed:!1,side:"left"}),Ee=l.createContext(!1),js=l.forwardRef(function({children:s,collapsed:n=!1,side:r="left",onExpand:a,onCollapse:o,className:c="",...i},d){const f=["ds-nav-rail",n&&"ds-nav-rail--collapsed",`ds-nav-rail--${r}`,c].filter(Boolean).join(" "),u=l.useCallback(x=>{if(!x.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')){if(n&&a){a();return}!n&&o&&o()}},[n,a,o]);return e.jsx(pe.Provider,{value:{collapsed:n,side:r},children:e.jsx("nav",{ref:d,className:f,onClick:u,"data-expandable":n&&a?"":void 0,"data-collapsible":!n&&o?"":void 0,...i,children:s})})});function gs({icon:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,count:c,updated:i=!1,open:d=!1,onboarding:f=!1,className:u="",...x}){const{collapsed:v,side:p}=l.useContext(pe),w=l.useContext(Ee),y={className:["ds-nav-rail__item",u].filter(Boolean).join(" "),onClick:r?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":r?"true":void 0,"aria-label":v?s:void 0,tabIndex:r?-1:void 0,...{"data-selected":n||void 0,"data-disabled":r||void 0,"data-open":d||void 0,"data-onboarding":f||void 0},...x},$=c!=null,A=p==="left"?"right":"left",b=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!v&&e.jsx("span",{className:"ds-nav-rail__label",children:s}),!v&&$&&e.jsx("span",{className:["ds-nav-rail__count",c===0&&"ds-nav-rail__count--zero"].filter(Boolean).join(" "),"data-updated":i&&c!==0||void 0,children:c}),!v&&i&&(!$||c===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),v&&$&&c!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":i||void 0,children:c>99?"99+":c}),v&&i&&(!$||c===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),R=a?e.jsx("a",{href:r?void 0:a,...y,children:b}):e.jsx("button",{type:"button",...y,children:b});return v&&!w?e.jsx(ke,{content:s,position:A,children:R}):R}function ws({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function Ns({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function ys({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function ks({className:t="",...s}){return e.jsx("hr",{className:["ds-nav-rail__divider",t].filter(Boolean).join(" "),...s})}function Es({children:t,label:s,defaultOpen:n=!0,className:r="",...a}){const{collapsed:o}=l.useContext(pe),c=K(),i=s??c.recents,[d,f]=l.useState(n);return e.jsxs("div",{className:["ds-nav-rail__recents",r].filter(Boolean).join(" "),...a,children:[!o&&e.jsxs("button",{type:"button",className:["ds-nav-rail__recents-toggle",!d&&"ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),onClick:()=>f(u=>!u),"aria-expanded":d,children:[e.jsx("span",{className:"ds-nav-rail__recents-label",children:i}),e.jsx(P.ChevronDown,{size:12,strokeWidth:2,className:"ds-nav-rail__recents-chevron","aria-hidden":"true"})]}),(d||o)&&e.jsx("div",{className:"ds-nav-rail__recents-body",children:t})]})}const Rs=l.forwardRef(function({as:s="button",avatar:n,label:r,className:a="",...o},c){const{collapsed:i,side:d}=l.useContext(pe),f=l.useContext(Ee),u=d==="left"?"right":"left",x=["ds-nav-rail__item","ds-nav-rail__agent",a].filter(Boolean).join(" "),v=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:n}),!i&&e.jsx("span",{className:"ds-nav-rail__label",children:r})]}),p=e.jsx(s,{ref:c,className:x,"aria-label":i?r:void 0,...s==="button"?{type:"button"}:{},...o,children:v});return i&&!f?e.jsx(ke,{content:r,position:u,children:p}):p});function Ss({avatar:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,className:c="",...i}){const{collapsed:d,side:f}=l.useContext(pe),u=l.useContext(Ee),p={className:["ds-nav-rail__item","ds-nav-rail__agent",c].filter(Boolean).join(" "),onClick:r?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":r?"true":void 0,tabIndex:r?-1:void 0,...{"data-selected":n||void 0,"data-disabled":r||void 0},...i},w=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!d&&e.jsx("span",{className:"ds-nav-rail__label",children:s})]}),N=f==="left"?"right":"left",T=a?e.jsx("a",{href:r?void 0:a,...p,children:w}):e.jsx("button",{type:"button",...p,children:w});return d&&!u?e.jsx(ke,{content:s,position:N,children:T}):T}const qe=240,Xe=6,Ye=8;function Ts({trigger:t,title:s,children:n,open:r,onOpenChange:a,defaultOpen:o=!1,closeLabel:c}){const i=K(),{side:d}=l.useContext(pe),[f,u]=l.useState(o),x=r!==void 0,v=x?r:f,[p,w]=l.useState(!1),N=l.useRef(null),T=l.useRef(null),[y,$]=l.useState({}),A=l.useCallback(()=>{x?a==null||a(!0):u(!0)},[x,a]),b=l.useCallback(()=>{x?a==null||a(!1):u(!1)},[x,a]),R=l.useCallback(()=>v?b():A(),[v,A,b]),E=l.useCallback(()=>{var z;const C=N.current;if(!C)return;const F=C.getBoundingClientRect(),H=window.innerHeight,S=((z=T.current)==null?void 0:z.offsetHeight)??300,U=Math.max(Ye,Math.min(H-S-Ye,F.top));$(d==="right"?{position:"fixed",top:U,right:window.innerWidth-F.left+Xe,width:qe}:{position:"fixed",top:U,left:F.right+Xe,width:qe})},[d]);l.useEffect(()=>{if(!v){w(!1);return}return E(),requestAnimationFrame(()=>w(!0)),window.addEventListener("scroll",E,!0),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E,!0),window.removeEventListener("resize",E)}},[v,E]),l.useEffect(()=>{if(!v)return;const C=H=>{var S,U;!((S=T.current)!=null&&S.contains(H.target))&&!((U=N.current)!=null&&U.contains(H.target))&&b()},F=H=>{H.key==="Escape"&&b()};return document.addEventListener("mousedown",C),document.addEventListener("keydown",F),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",F)}},[v,b]);const I=v&&e.jsxs("div",{ref:T,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,p&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:y,"data-ds-portal":"",role:"dialog","aria-modal":"false",children:[s!=null&&e.jsxs("div",{className:"ds-nav-rail-flyout__header",children:[e.jsx("span",{className:"ds-nav-rail-flyout__title",children:s}),e.jsx("button",{type:"button",className:"ds-nav-rail-flyout__close",onClick:b,"aria-label":c??i.close,children:e.jsx(P.X,{size:16,strokeWidth:2})})]}),e.jsx("div",{className:"ds-nav-rail-flyout__body",children:n})]});return e.jsxs(e.Fragment,{children:[e.jsx(Ee.Provider,{value:v,children:e.jsx("div",{ref:N,onClick:R,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&te.createPortal(I,document.body)]})}const $s={info:P.Info,success:P.CheckCircle,warning:P.AlertTriangle,error:P.XCircle};function As({children:t,variant:s="info",action:n,onAction:r,onDismiss:a,role:o,dismissLabel:c,...i}){const d=K(),f=$s[s],u=o||(s==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${s}`,role:u,...i,children:[f&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(f,{size:q[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:t}),n&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:r,children:n}),a&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:a,"aria-label":c??d.dismiss,children:e.jsx(P.X,{size:q[2],strokeWidth:1.5})})]})}function Bs({trigger:t,items:s=[],open:n,onOpenChange:r,align:a="left",fullWidth:o=!1,className:c="",style:i,...d}){const[f,u]=l.useState(!1),[x,v]=l.useState(!1),p=n!==void 0,w=p?n:f,N=l.useRef(null),T=l.useRef(null),y=l.useRef(null),$=l.useRef(null),[A,b]=l.useState({}),R=l.useRef(null),E=150,I=()=>{if(p)r==null||r(!1);else{if(x)return;v(!0),R.current=setTimeout(()=>{u(!1),v(!1)},E)}},C=()=>{const h=!w;p?r==null||r(h):h?(clearTimeout(R.current),v(!1),u(!0)):I()},F=()=>{w||(p?r==null||r(!0):(clearTimeout(R.current),v(!1),u(!0)))};l.useEffect(()=>()=>clearTimeout(R.current),[]),l.useEffect(()=>{if(!w)return;const h=300,g=()=>{var O;const k=(O=N.current)==null?void 0:O.getBoundingClientRect();if(!k)return;const L=window.innerHeight-k.bottom,M=L<h+8&&k.top>L;b(a==="right"?M?{bottom:window.innerHeight-k.top+4,top:"auto",right:window.innerWidth-k.right}:{top:k.bottom+4,bottom:"auto",right:window.innerWidth-k.right}:M?{bottom:window.innerHeight-k.top+4,top:"auto",left:k.left}:{top:k.bottom+4,bottom:"auto",left:k.left})};return g(),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),()=>{window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}},[w,a]);const H=()=>{var g;const h=(g=y.current)==null?void 0:g.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');h==null||h.focus()};l.useEffect(()=>{if(!w)return;const h=k=>{var L,M;!((L=N.current)!=null&&L.contains(k.target))&&!((M=T.current)!=null&&M.contains(k.target))&&I()},g=k=>{k.key==="Escape"&&(I(),H())};return document.addEventListener("mousedown",h),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",g)}},[w]),l.useEffect(()=>{if(!w||!$.current||!T.current)return;const h=S(),g=$.current==="last"?h[h.length-1]:h[0];g==null||g.focus(),$.current=null},[w]);const S=()=>T.current?[...T.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],U=h=>{var g,k;if(h.key==="ArrowDown")h.preventDefault(),w?(g=S()[0])==null||g.focus():($.current="first",F());else if(h.key==="ArrowUp")if(h.preventDefault(),!w)$.current="last",F();else{const L=S();(k=L[L.length-1])==null||k.focus()}},z=h=>{var L,M,O,m;const g=S(),k=g.findIndex(j=>j===document.activeElement);switch(h.key){case"ArrowDown":h.preventDefault(),(L=g[Math.min(k+1,g.length-1)])==null||L.focus();break;case"ArrowUp":h.preventDefault(),k<=0?H():(M=g[k-1])==null||M.focus();break;case"Home":h.preventDefault(),(O=g[0])==null||O.focus();break;case"End":h.preventDefault(),(m=g[g.length-1])==null||m.focus();break;case"Tab":I();break}},_=w&&e.jsx("div",{ref:T,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,x&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:A,onKeyDown:z,children:s.map((h,g)=>{if(h.separator)return e.jsx("div",{className:"ds-dropdown__separator"},g);if(h.type==="section")return e.jsxs("div",{className:"ds-dropdown__section",children:[h.label&&e.jsx("div",{className:"ds-dropdown__section-label",children:h.label}),e.jsx("div",{className:"ds-dropdown__section-content",children:h.content})]},g);const k=!!h.href,L=k?"a":"button",M=k?{href:h.disabled?void 0:h.href,"aria-disabled":h.disabled?"true":void 0}:{type:"button",disabled:h.disabled};return e.jsxs(L,{role:"menuitem",className:["ds-dropdown__item",h.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...M,onClick:()=>{var O;(O=h.onClick)==null||O.call(h),I()},children:[h.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:h.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:h.label}),h.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:h.shortcut})]},g)})});return e.jsxs("div",{ref:N,className:["ds-dropdown",o&&"ds-dropdown--full-width",c].filter(Boolean).join(" "),style:i,...d,children:[e.jsx("div",{ref:y,className:"ds-dropdown__trigger",onClick:C,onKeyDown:U,children:t}),typeof document<"u"&&te.createPortal(_,document.body)]})}function Ds({value:t=0,size:s="m",variant:n="default",showValue:r=!1,min:a=2,animate:o=!0}){const c=Math.min(100,Math.max(0,t)),i=Math.max(a,c),d=n==="auto"?c>=70?"success":c>=50?"warning":"danger":n;return e.jsxs("div",{className:["ds-progress",`ds-progress--${s}`,!o&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,children:[e.jsx("div",{className:"ds-progress__track",children:e.jsx("div",{className:`ds-progress__fill ds-progress__fill--${d}`,style:{width:`${i}%`}})}),r&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(c),"%"]})]})}const Is=t=>1-Math.pow(1-t,3),Ls=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function rt(t,{duration:s=600}={}){const[n,r]=l.useState(t),a=l.useRef(t),o=l.useRef(null);return l.useEffect(()=>{if(Ls()){r(t),a.current=t;return}const c=a.current,i=t-c;if(i===0)return;let d=null;const f=u=>{d||(d=u);const x=Math.min((u-d)/s,1);r(c+i*Is(x)),x<1?o.current=requestAnimationFrame(f):a.current=t};return o.current=requestAnimationFrame(f),()=>cancelAnimationFrame(o.current)},[t,s]),n}function Ps({value:t,duration:s=600,decimals:n=0,prefix:r="",suffix:a=""}){const c=rt(t,{duration:s}).toFixed(n);return`${r}${c}${a}`}function at({threshold:t=.1,rootMargin:s="0px",once:n=!1}={}){const r=l.useRef(null),[a,o]=l.useState(!1);return l.useEffect(()=>{const c=r.current;if(!c)return;const i=new IntersectionObserver(([d])=>{d.isIntersecting?(o(!0),n&&i.disconnect()):n||o(!1)},{threshold:t,rootMargin:s});return i.observe(c),()=>i.disconnect()},[t,s,n]),{ref:r,inView:a}}function Cs({children:t,as:s="div",once:n=!1,threshold:r=.1,rootMargin:a="0px",onEnter:o,onLeave:c,...i}){const{ref:d,inView:f}=at({threshold:r,rootMargin:a,once:n}),u=l.useRef(!1);return l.useEffect(()=>{f&&!u.current&&(o==null||o()),!f&&u.current&&(c==null||c()),u.current=f},[f]),e.jsx(s,{ref:d,...i,children:typeof t=="function"?t(f):t})}const Ke={default:P.Info,success:P.CheckCircle,warning:P.AlertTriangle,error:P.XCircle};let me=[];const Be=new Set;function ot(){Be.forEach(t=>t([...me]))}function Ms(t){me=[...me,t],ot()}function Fs(t){me=me.filter(s=>s.id!==t),ot()}function zs(){const t=(s,n={})=>{Ms({id:`${Date.now()}-${Math.random()}`,message:s,type:"default",duration:4e3,...n})};return t.success=(s,n)=>t(s,{...n,type:"success"}),t.error=(s,n)=>t(s,{...n,type:"error"}),t.warning=(s,n)=>t(s,{...n,type:"warning"}),{toast:t}}function Os({data:t,onDismiss:s}){const n=K(),[r,a]=l.useState(!1),o=l.useRef(null),c=l.useRef(null);l.useEffect(()=>(requestAnimationFrame(()=>a(!0)),t.duration>0&&(o.current=setTimeout(()=>i(),t.duration)),()=>{clearTimeout(o.current),clearTimeout(c.current)}),[]);function i(){a(!1),c.current=setTimeout(()=>s(t.id),250)}const d=Ke[t.type]??Ke.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[e.jsx("div",{className:"ds-toast__icon",children:e.jsx(d,{size:q[3],strokeWidth:1.5})}),e.jsx("span",{className:"ds-toast__message",children:t.message}),e.jsx("button",{className:"ds-toast__close",onClick:i,"aria-label":n.close,children:e.jsx(P.X,{size:q[3],strokeWidth:1.5})})]})}function Ws({position:t="bottom-right"}){const[s,n]=l.useState(()=>[...me]);return l.useEffect(()=>(Be.add(n),()=>Be.delete(n)),[]),!s.length||typeof document>"u"?null:te.createPortal(e.jsx("div",{"data-ds-portal":"",className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:s.map(r=>e.jsx(Os,{data:r,onDismiss:Fs},r.id))}),document.body)}const Hs={running:e.jsx(ce,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(ce,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(ce,{size:"xs",variant:"error",children:"Error"})};function it({label:t,status:s="idle",icon:n,badge:r,defaultExpanded:a=!1,expanded:o,onToggle:c,children:i,className:d="",...f}){const u=s==="running",x=e.jsxs("span",{className:"ds-tool-card__title-row",children:[n&&e.jsx("span",{className:"ds-tool-card__icon",children:n}),e.jsx("span",{className:"ds-tool-card__label",children:t}),Hs[s],r]});return i?e.jsx("div",{className:["ds-tool-card",u&&"ds-tool-card--running",d].filter(Boolean).join(" "),...f,children:e.jsx(ye,{title:x,padding:"s",defaultExpanded:a,expanded:u?!1:o,onToggle:u?void 0:c,children:e.jsx("div",{className:"ds-tool-card__body",children:i})})}):e.jsx("div",{className:["ds-tool-card","ds-tool-card--bubble",d].filter(Boolean).join(" "),...f,children:x})}function lt({text:t,size:s="xs",timeout:n=800,"aria-label":r,...a}){const o=K(),[c,i]=l.useState(!1),d=l.useRef(null),f=u=>{u.currentTarget.blur(),navigator.clipboard.writeText(t).then(()=>{i(!0),clearTimeout(d.current),d.current=setTimeout(()=>i(!1),n)})};return l.useEffect(()=>()=>clearTimeout(d.current),[]),e.jsx(re,{variant:"ghost",size:s,state:c?"success":"idle",icon:e.jsx(P.Copy,{size:q[1],strokeWidth:1.5}),"aria-label":r??o.copyToClipboard,onClick:f,...a})}function Us({content:t,streaming:s=!1,...n}){const[r,a]=l.useState(s);return l.useEffect(()=>{a(!!s)},[s]),e.jsx(ye,{expanded:r,onToggle:a,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(P.Brain,{size:q[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(tt,{secondary:!0,children:"Thinking"})]}),...n,children:e.jsxs(Le,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[t,s&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Vs({count:t,current:s=0,done:n=[],onChange:r,showCounter:a=!0,className:o="","aria-label":c,...i}){const d=K(),{t:f}=ue();return e.jsxs("div",{className:["ds-step-indicator",o].filter(Boolean).join(" "),...i,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":c??d.steps,children:Array.from({length:t},(u,x)=>{const v=x===s,p=n.includes(x)&&!v,w=r&&(x<=s||n.includes(x)),N=["ds-step-indicator__dot",v&&"ds-step-indicator__dot--active",p&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:N,role:"tab","aria-selected":v,"aria-label":f("stepN",{n:x+1}),disabled:!w||x===s,onClick:()=>r==null?void 0:r(x),children:p?e.jsx(P.Check,{size:8,strokeWidth:3}):null},x)})}),a&&e.jsxs(Le,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function qs({content:t,isStreaming:s=!1,cursor:n="line",onChunk:r,className:a="",...o}){const c=l.useRef(t);return l.useEffect(()=>{t!==c.current&&(r==null||r(t),c.current=t)},[t,r]),e.jsxs("span",{className:["ds-streaming-text",a].filter(Boolean).join(" "),...o,children:[t,s&&n!=="none"&&e.jsx("span",{className:`ds-cursor ds-cursor--${n}`,"aria-hidden":"true"})]})}function Xs({role:t="assistant",header:s,footer:n,attachments:r,isStreaming:a=!1,children:o,className:c="",...i}){const d=["ds-chat-message",`ds-chat-message--${t}`,a&&"ds-chat-message--streaming",c].filter(Boolean).join(" ");return t==="system"?e.jsx("div",{className:d,...i,children:e.jsx("span",{className:"ds-chat-message__system-label",children:o})}):t==="user"?e.jsxs("div",{className:d,...i,children:[r&&e.jsx("div",{className:"ds-chat-message__attachments",children:r}),e.jsx("div",{className:"ds-chat-message__bubble",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]}):e.jsxs("div",{className:d,...i,children:[s&&e.jsx("div",{className:"ds-chat-message__header",children:s}),r&&e.jsx("div",{className:"ds-chat-message__attachments",children:r}),e.jsx("div",{className:"ds-chat-message__body",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]})}function Ys(t,{containerRef:s,smartPause:n=!0}={}){const r=l.useRef(!1),a=l.useRef(0);l.useEffect(()=>{const o=s==null?void 0:s.current;if(!o)return;const c=()=>{const i=o.scrollHeight-o.scrollTop-o.clientHeight<64;!i&&o.scrollTop<a.current&&(r.current=!0),i&&(r.current=!1),a.current=o.scrollTop};return o.addEventListener("scroll",c,{passive:!0}),()=>o.removeEventListener("scroll",c)},[s]),l.useEffect(()=>{const o=s==null?void 0:s.current;o&&(n&&r.current||(o.scrollTop=o.scrollHeight))},t)}function ct({prompts:t,enabled:s,typingSpeed:n=38,erasingSpeed:r=18,holdTime:a=2200,betweenTime:o=380,manualPauseMs:c=5e3}){const[i,d]=l.useState(0),[f,u]=l.useState(""),x=l.useRef("typing"),v=l.useRef(0),p=l.useRef(0),w=l.useRef(null),N=l.useRef(0);l.useEffect(()=>{p.current=i},[i]),l.useEffect(()=>{if(w.current&&(clearTimeout(w.current),w.current=null),!s||t.length===0){u(""),v.current=0,x.current="typing";return}const b=()=>{const R=Date.now();if(N.current>R){w.current=setTimeout(b,N.current-R);return}const E=t[p.current%t.length]??"";x.current==="typing"?(v.current+=1,u(E.slice(0,v.current)),v.current>=E.length?(x.current="holding",w.current=setTimeout(b,a)):w.current=setTimeout(b,n+Math.random()*28)):x.current==="holding"?(x.current="erasing",w.current=setTimeout(b,r)):(v.current=Math.max(0,v.current-1),u(E.slice(0,v.current)),v.current<=0?(x.current="typing",p.current=(p.current+1)%t.length,d(p.current),w.current=setTimeout(b,o)):w.current=setTimeout(b,r))};return w.current=setTimeout(b,260),()=>{w.current&&clearTimeout(w.current)}},[s,t,n,r,a,o]);const T=b=>{if(t.length===0)return;const R=(b%t.length+t.length)%t.length,E=t[R];p.current=R,v.current=E.length,x.current="holding",N.current=Date.now()+c,d(R),u(E)},y=()=>T(p.current+1),$=()=>T(p.current-1),A=t[i%t.length]??"";return{displayed:f,currentPrompt:A,index:i,next:y,prev:$}}let Ks=0;function Gs({value:t="",onChange:s,onSubmit:n,onStop:r,onKeyDown:a,loading:o=!1,disabled:c=!1,placeholder:i,animatedPlaceholders:d,attachments:f,images:u,onAttachFiles:x,onAttachImages:v,onRemoveAttachment:p,onRemoveImage:w,acceptImage:N,acceptFile:T,maxImages:y,maxImageSize:$,leftSlot:A,rightSlot:b,className:R="",...E}){const I=K(),{t:C}=ue(),F=l.useRef(null),H=l.useRef(null),S=l.useRef(0),[U,z]=l.useState(!1),[_,h]=l.useState([]),g=l.useRef(new Set),k=i??I.promptPlaceholder,L=B=>{const W=++Ks;h(Z=>[...Z,{id:W,msg:B}]);const J=setTimeout(()=>{g.current.delete(J),h(Z=>Z.filter(ee=>ee.id!==W))},6e3);g.current.add(J)};l.useEffect(()=>{const B=g.current;return()=>B.forEach(clearTimeout)},[]);const M=B=>h(W=>W.filter(J=>J.id!==B)),O=B=>B.type.startsWith("image/"),m=()=>!0,j=N??O,D=T??m,V=B=>{const W=[],J=[],Z=[],ee=[];let se=0,le=y!=null?y-((u==null?void 0:u.length)??0):1/0;for(const ne of B)j(ne)?$&&ne.size>$?Z.push(ne.name):le>0?(W.push(ne),le--):se++:D(ne)?J.push(ne):ee.push(ne.name);return{imageFiles:W,docFiles:J,tooLarge:Z,skipped:ee,limitExceeded:se}},X=B=>{const W=$?C("fileTooLargeMaxHint",{maxMb:$/1024/1024}):"";L(C("fileTooLarge",{maxHint:W,names:B.join(", ")}))},G=B=>{const{imageFiles:W,docFiles:J,tooLarge:Z,skipped:ee,limitExceeded:se}=V(B);Z.length&&X(Z),ee.length&&L(C("filesSkipped",{names:ee.join(", ")})),se&&L(C("maxImages",{n:y})),v&&W.length&&v(W);const le=J.concat(v?[]:W);x&&le.length&&x(le)};l.useEffect(()=>{const B=H.current;B&&(B.style.height="auto",B.style.height=`${Math.min(B.scrollHeight,200)}px`)},[t]),l.useEffect(()=>{const B=W=>{var Z,ee,se;if(o||c)return;const J=(Z=W.target)==null?void 0:Z.tagName;J==="INPUT"||J==="TEXTAREA"||J==="SELECT"||(ee=W.target)!=null&&ee.isContentEditable||W.ctrlKey||W.metaKey||W.altKey||W.key.length!==1&&W.key!=="Backspace"&&W.key!=="Delete"||(se=H.current)==null||se.focus()};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[o,c]);const Y=B=>{B.preventDefault(),S.current++,B.dataTransfer.types.includes("Files")&&z(!0)},Q=B=>{B.preventDefault(),S.current--,S.current===0&&z(!1)},ie=B=>B.preventDefault(),he=B=>{B.preventDefault(),S.current=0,z(!1);const W=Array.from(B.dataTransfer.files);W.length&&G(W)},Re=B=>{const W=Array.from(B.target.files||[]);F.current&&(F.current.value=""),W.length&&G(W)},ut=B=>{var ne;if(!v)return;const W=(ne=B.clipboardData)==null?void 0:ne.items;if(!W)return;const J=[];for(const pt of W){const Fe=pt.getAsFile();Fe&&J.push(Fe)}if(J.length===0)return;const{imageFiles:Z,tooLarge:ee,skipped:se,limitExceeded:le}=V(J);ee.length&&X(ee),se.length&&L(C("filesSkipped",{names:se.join(", ")})),le&&L(C("maxImages",{n:y})),Z.length&&(B.preventDefault(),v(Z))},xe=!o&&!c&&!!(d!=null&&d.length)&&t.length===0,je=ct({prompts:d??[],enabled:xe}),ft=B=>{if(xe){if(B.key==="ArrowDown"||B.key==="ArrowRight"){B.preventDefault(),je.next();return}if(B.key==="ArrowUp"||B.key==="ArrowLeft"){B.preventDefault(),je.prev();return}if(B.key==="Tab"&&!B.shiftKey){B.preventDefault(),s==null||s(je.currentPrompt);return}}a==null||a(B)},mt=(t.trim()||(u==null?void 0:u.length)>0||(f==null?void 0:f.length)>0)&&!c,Me=x||v;return e.jsxs("div",{className:["ds-prompt-input",R].filter(Boolean).join(" "),...E,children:[Me&&e.jsx("input",{ref:F,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:Re}),e.jsxs("div",{className:["ds-prompt-input__box",U&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:Y,onDragLeave:Q,onDragOver:ie,onDrop:he,children:[U&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:I.dropFilesHere}),e.jsx("textarea",{ref:H,value:t,onChange:B=>s==null?void 0:s(B.target.value),onKeyDown:ft,onPaste:ut,placeholder:xe?"":k,disabled:o||c,rows:1,className:["ds-prompt-input__textarea",xe&&"ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")}),xe&&e.jsxs("div",{className:"ds-prompt-input__anim","aria-hidden":"true",children:[e.jsx("span",{className:"ds-prompt-input__anim-text",children:je.displayed}),e.jsx("span",{className:"ds-prompt-input__anim-cursor"})]}),u&&u.length>0&&e.jsx("div",{className:"ds-prompt-input__images",children:u.map((B,W)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:B.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>w==null?void 0:w(W),"aria-label":I.removeImage,type:"button",children:e.jsx(P.X,{size:12,strokeWidth:2})})]},W))}),_.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:_.map(B=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:B.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>M(B.id),"aria-label":I.dismiss,children:e.jsx(P.X,{size:q[1],strokeWidth:1.5})})]},B.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((B,W)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[B.uploading?e.jsx(P.Loader,{size:q[1],strokeWidth:1.5,className:"spin"}):e.jsx(P.Paperclip,{size:q[1],strokeWidth:1.5}),B.filename,B.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:I.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>p==null?void 0:p(W),"aria-label":I.removeAttachment,children:e.jsx(P.X,{size:q[1],strokeWidth:1.5})})]})},W))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[Me&&e.jsx(re,{variant:"ghost",size:"xs",icon:e.jsx(P.Paperclip,{size:q[2],strokeWidth:1.5}),"aria-label":I.attachFiles,onClick:()=>{var B;return(B=F.current)==null?void 0:B.click()}}),A,b,e.jsx("div",{className:"ds-prompt-input__spacer"}),o?e.jsx(re,{variant:"primary",size:"xs",icon:e.jsx(P.Square,{size:q[2],strokeWidth:1.5}),onClick:r,"aria-label":I.stop}):e.jsx(re,{variant:"primary",size:"xs",icon:e.jsx(P.ArrowUp,{size:q[2],strokeWidth:1.5}),onClick:n,disabled:!mt,"aria-label":I.send})]})]})]})}const Ge={fast:0,standard:1,premium:2},Je={fast:"data-5",standard:"data-3",premium:"data-6"};function Js({models:t=[],value:s,onChange:n,size:r="xs",minTier:a,showAutoOption:o=!1,groupByTier:c=!0,className:i="",...d}){const[f,u]=l.useState(!1),x=l.useRef(null),v=l.useRef(null),p=l.useRef(null),[w,N]=l.useState({}),T=r==="s"?"s":"xs",y=t.filter(S=>!a||S.name==="auto"?!0:(Ge[S.tier]??1)>=(Ge[a]??1)),$=y.find(S=>S.name==="auto"),A=y.filter(S=>S.name!=="auto"),b=t.find(S=>S.name===s),E=new Set(A.map(S=>S.tier).filter(Boolean)).size>1;l.useEffect(()=>{if(!f)return;const S=320,U=()=>{var L;const h=(L=v.current)==null?void 0:L.getBoundingClientRect();if(!h)return;const g=window.innerHeight-h.bottom,k=g<S+8&&h.top>g;N({position:"fixed",zIndex:"var(--z-dropdown, 500)",left:h.left,...k?{bottom:window.innerHeight-h.top+4,top:"auto"}:{top:h.bottom+4,bottom:"auto"}})};U(),window.addEventListener("scroll",U,!0),window.addEventListener("resize",U);const z=h=>{var g,k;!((g=x.current)!=null&&g.contains(h.target))&&!((k=p.current)!=null&&k.contains(h.target))&&u(!1)},_=h=>{h.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",z),document.addEventListener("keydown",_),()=>{window.removeEventListener("scroll",U,!0),window.removeEventListener("resize",U),document.removeEventListener("mousedown",z),document.removeEventListener("keydown",_)}},[f]);const I=S=>{n==null||n(S),u(!1)},C=S=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",S.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I(S.name),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:S.icon||e.jsx(P.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:S.displayName||S.name}),E&&S.tier&&e.jsx(ce,{size:"xs",variant:Je[S.tier]||"default",children:S.tier})]},S.name),F=()=>!c||!E?A.map(C):["fast","standard","premium"].flatMap(S=>{const U=A.filter(z=>z.tier===S);return U.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":S,children:S.charAt(0).toUpperCase()+S.slice(1)},`lbl-${S}`),...U.map(C)]:[]}),H=f&&e.jsxs("div",{ref:p,className:`ds-model-picker__menu ds-model-picker__menu--${T} ds-scrollable`,"data-ds-portal":"",style:w,children:[o&&$&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:["ds-model-picker__item","ds-model-picker__item--auto",s==="auto"&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I("auto"),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:e.jsx(P.Zap,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),A.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),F()]});return e.jsxs("div",{ref:x,className:["ds-model-picker",i].filter(Boolean).join(" "),...d,children:[e.jsxs("button",{ref:v,type:"button",className:`ds-model-picker__trigger ds-model-picker__trigger--${T}`,onClick:()=>u(S=>!S),"aria-haspopup":"listbox","aria-expanded":f,children:[e.jsx("span",{className:"ds-model-picker__icon",children:(b==null?void 0:b.icon)||e.jsx(P.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(b==null?void 0:b.displayName)||(b==null?void 0:b.name)||s}),E&&(b==null?void 0:b.tier)&&e.jsx(ce,{size:"xs",variant:Je[b.tier]||"default",children:b.tier})]}),typeof document<"u"&&te.createPortal(H,document.body)]})}const Zs=({filename:t,pagesLabel:s})=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0},children:[e.jsx("span",{className:"ds-sources-panel__filename",children:t}),s&&e.jsx("span",{className:"ds-sources-panel__pages",children:s})]});function Qs(t){const s=new Map;for(const n of t)s.has(n.filename)||s.set(n.filename,{filename:n.filename,url:n.url,items:[]}),s.get(n.filename).items.push(n);return[...s.values()]}function en({sources:t=[],layout:s="list",title:n,maxVisible:r=5,onSourceClick:a}){const o=K(),{t:c}=ue(),i=n??o.sources,[d,f]=l.useState(!1),u=Qs(t),x=u.length>r,v=d?u:u.slice(0,r),p=t.some(y=>y.snippet),w=y=>y!=null&&y.length?c("pageAbbrev",{pages:y.join(", ")}):null,N=c("moreSources",{n:u.length-r}),T=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:T,children:[v.map(y=>{const $=y.items.map(R=>R.page).filter(Boolean),A=w($),b=!!a;return e.jsxs("div",{className:`ds-sources-panel__compact-row${b?" ds-sources-panel__compact-row--clickable":""}`,onClick:b?()=>a(y.items[0]):void 0,children:[e.jsx(P.FileText,{size:q[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),A&&e.jsx("span",{className:"ds-sources-panel__pages",children:A})]},y.filename)}),x&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:N})]}):e.jsxs("div",{className:T,children:[i&&e.jsx("div",{className:"ds-sources-panel__title",children:i}),v.map(y=>{const $=y.items.map(R=>R.page).filter(Boolean),A=w($),b=!!a;return p?e.jsx(ye,{title:e.jsx(Zs,{filename:y.filename,pagesLabel:A}),padding:"s",children:y.items.map((R,E)=>e.jsx("div",{className:`ds-sources-panel__snippet${b?" ds-sources-panel__snippet--clickable":""}`,onClick:b?()=>a(R):void 0,children:R.snippet??c("pageAbbrev",{pages:R.page})},E))},y.filename):e.jsxs("div",{className:`ds-sources-panel__row${b?" ds-sources-panel__row--clickable":""}`,onClick:b?()=>a(y.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),A&&e.jsx("span",{className:"ds-sources-panel__pages",children:A})]},y.filename)}),x&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:N})]})}function Ze(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function tn({used:t,limit:s,size:n="s",showCount:r=!0,showPercent:a=!1,warningThreshold:o=.8,errorThreshold:c=1}){const i=s>0?t/s:0,d=Math.min(i*100,100),f=i>=c?"error":i>=o?"warning":"normal";return e.jsxs("div",{className:`ds-token-counter ds-token-counter--${n}`,role:"meter","aria-valuenow":t,"aria-valuemax":s,children:[e.jsx("div",{className:"ds-token-counter__track",children:e.jsx("div",{className:`ds-token-counter__fill ds-token-counter__fill--${f}`,style:{width:`${d}%`}})}),(r||a)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${f}`,children:[r&&e.jsxs("span",{children:[Ze(t)," / ",Ze(s)]}),a&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(i*100),"%"]})]})]})}const Qe=5;function sn(t){return t<.34?"low":t<.67?"medium":"high"}function nn({value:t=0,size:s="xs",showLabel:n="none",layout:r="inline"}){const a=Math.max(0,Math.min(1,t)),o=Math.round(a*Qe),c=sn(a);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${s}`,`ds-confidence-bar--${c}`,r==="block"&&"ds-confidence-bar--block"].filter(Boolean).join(" "),children:[e.jsx("div",{className:"ds-confidence-bar__segments","aria-hidden":"true",children:Array.from({length:Qe},(i,d)=>e.jsx("div",{className:`ds-confidence-bar__seg${d<o?" ds-confidence-bar__seg--filled":""}`},d))}),n==="text"&&e.jsx("span",{className:"ds-confidence-bar__label",children:c})]})}const rn={add:"+",remove:"-",context:" "};function Se({line:t,lineNumbers:s}){return e.jsxs("div",{className:`ds-diff-view__line ds-diff-view__line--${t.type}`,children:[s&&t.lineNo!=null&&e.jsx("span",{className:"ds-diff-view__lineno",children:t.lineNo}),e.jsx("span",{className:"ds-diff-view__prefix",children:rn[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function an({lines:t=[],layout:s="inline",wordWrap:n=!1,lineNumbers:r=!0,maxHeight:a,title:o}){const c=["ds-diff-view",`ds-diff-view--${s}`,n&&"ds-diff-view--wrap"].filter(Boolean).join(" "),i=a?{maxHeight:a,overflowY:"auto"}:void 0;if(s==="split"){const d=t.filter(u=>u.type==="remove"||u.type==="context"),f=t.filter(u=>u.type==="add"||u.type==="context");return e.jsxs("div",{className:c,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsxs("div",{className:"ds-diff-view__body ds-scrollable",style:i,children:[e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((u,x)=>e.jsx(Se,{line:u,lineNumbers:r},x))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:f.map((u,x)=>e.jsx(Se,{line:u,lineNumbers:r},x))})]})]})}return e.jsxs("div",{className:c,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:i,children:t.map((d,f)=>e.jsx(Se,{line:d,lineNumbers:r},f))})]})}function dt({value:t="idle",onLike:s,onDislike:n,className:r="",likeLabel:a,dislikeLabel:o,...c}){const i=K(),d=t!=="idle";return e.jsxs("div",{className:["ds-message-feedback",d&&"ds-message-feedback--voted",r].filter(Boolean).join(" "),...c,children:[(!d||t==="liked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="liked"&&"ds-message-feedback__btn--liked"].filter(Boolean).join(" "),onClick:s,disabled:d,"aria-label":a??i.like,"aria-pressed":t==="liked",children:e.jsx(P.ThumbsUp,{size:q[1],strokeWidth:1.5,fill:t==="liked"?"currentColor":"none"})}),(!d||t==="disliked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="disliked"&&"ds-message-feedback__btn--disliked"].filter(Boolean).join(" "),onClick:n,disabled:d,"aria-label":o??i.dislike,"aria-pressed":t==="disliked",children:e.jsx(P.ThumbsDown,{size:q[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function on(t){const s=t instanceof Date?t:new Date(t);if(isNaN(s))return null;const n=new Date,r=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(a-864e5);if(s>=a)return r;if(s>=o)return`Yesterday ${r}`;const c=s.getDate(),i=s.toLocaleString([],{month:"short"});return`${c} ${i} ${r}`}function ln({role:t="assistant",text:s,timestamp:n,feedbackValue:r="idle",onLike:a,onDislike:o,className:c="",...i}){const d=t==="assistant"&&(a||o),f=!!s,u=n?on(n):null;return!d&&!f&&!u?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${t}`,c].filter(Boolean).join(" "),...i,children:[t==="user"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u}),d&&e.jsx(dt,{className:"ds-message-action",value:r,onLike:a,onDislike:o}),f&&e.jsx(lt,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function cn({label:t,className:s="",...n}){return e.jsxs("span",{className:["ds-thinking-dot",s].filter(Boolean).join(" "),...n,children:[e.jsx("span",{className:"ds-thinking-dot__pulse"}),t&&e.jsx("span",{className:"ds-thinking-dot__label",children:t})]})}function dn({variant:t="light",glow:s,mask:n=!0,style:r,...a}){const o=t==="dark",c=s??o,i=o?"rgba(255,250,250,0.05)":"var(--color-border-light)",d=o?"rgba(255,250,250,0.025)":"color-mix(in srgb, var(--color-border-light) 50%, transparent)";return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden",zIndex:0,...c&&{background:"radial-gradient(ellipse 1000px 500px at 50% 30%, rgba(234,100,100,0.18), transparent 70%)"},...r},...a,children:e.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:[`linear-gradient(${i} 1px, transparent 1px)`,`linear-gradient(90deg, ${i} 1px, transparent 1px)`,`linear-gradient(${d} 1px, transparent 1px)`,`linear-gradient(90deg, ${d} 1px, transparent 1px)`].join(", "),backgroundSize:"80px 80px, 80px 80px, 16px 16px, 16px 16px",backgroundPosition:"-1px -1px, -1px -1px, -1px -1px, -1px -1px",...n&&{WebkitMaskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)",maskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)"}}})})}function un({children:t,axis:s="y",style:n,className:r="",...a}){const o=s==="x"?{overflowX:"auto",overflowY:"hidden"}:s==="both"?{overflow:"auto"}:{overflowY:"auto",overflowX:"hidden"};return e.jsx("div",{className:`ds-scrollable ${r}`,style:{...o,...n},...a,children:t})}const Te=280,fn=22,mn=14,oe=8,Ne=6,pn=200;function hn(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function xn(t,s,n,r){const a=window.innerWidth,o=window.innerHeight;if(o-t.bottom>=s+r+oe)return"bottom";if(t.top>=s+r+oe)return"top";if(a-t.right>=n+r+oe)return"right";if(t.left>=n+r+oe)return"left";const c=Math.max(t.top,o-t.bottom,a-t.right,t.left);return c===o-t.bottom?"bottom":c===t.top?"top":c===a-t.right?"right":"left"}function vn(t,s,n,r,a){const o=window.innerWidth,c=window.innerHeight;let i,d;switch(t){case"top":i=s.top-n-a,d=s.left+s.width/2-r/2;break;case"bottom":i=s.bottom+a,d=s.left+s.width/2-r/2;break;case"left":i=s.top+s.height/2-n/2,d=s.left-r-a;break;default:i=s.top+s.height/2-n/2,d=s.right+a}const f=Math.max(oe,Math.min(o-r-oe,d)),u=Math.max(oe,Math.min(c-n-oe,i));return{top:u,left:f,arrowOffset:d-f,arrowOffsetY:i-u}}function bn({steps:t,currentStep:s,onNext:n,onBack:r,onSkip:a,onFinish:o,overlay:c=!0,ring:i=!0,labelNext:d,labelBack:f,labelSkip:u,labelFinish:x,statePrimary:v="idle",stateBack:p="idle"}){const w=K(),{t:N}=ue(),T=d??w.next,y=f??w.back,$=u??w.skipTour,A=x??w.done,b=l.useRef(null),R=l.useRef(t),E=l.useRef(s),I=l.useRef(i);R.current=t,E.current=s,I.current=i;const[C,F]=l.useState(!1),[H,S]=l.useState({position:"fixed",visibility:"hidden",width:Te}),[U,z]=l.useState("bottom"),[_,h]=l.useState(null),g=l.useRef(!1),k=t[s],L=s===t.length-1,M=l.useCallback(()=>{const O=R.current[E.current];if(!O||!b.current)return;const m=hn(O.target);if(!m)return;const j=m.getBoundingClientRect(),V=b.current.getBoundingClientRect().height||160,X=Te,G=I.current?fn:mn,Y=O.position||xn(j,V,X,G),{top:Q,left:ie,arrowOffset:he,arrowOffsetY:Re}=vn(Y,j,V,X,G);z(Y),S({position:"fixed",top:Q,left:ie,width:Te,visibility:"visible","--arrow-offset":`${he}px`,"--arrow-offset-y":`${Re}px`}),h({top:j.top-Ne,left:j.left-Ne,width:j.width+Ne*2,height:j.height+Ne*2})},[]);return l.useEffect(()=>{window.addEventListener("scroll",M,!0),window.addEventListener("resize",M);const O=requestAnimationFrame(()=>{M(),F(!0),g.current=!0});return()=>{cancelAnimationFrame(O),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[]),l.useEffect(()=>{if(!g.current)return;F(!1);const O=setTimeout(()=>{S(m=>({...m,visibility:"hidden"})),requestAnimationFrame(()=>{M(),F(!0)})},pn+20);return()=>clearTimeout(O)},[s]),l.useEffect(()=>{C&&b.current&&b.current.focus({preventScroll:!0})},[C]),l.useEffect(()=>{const O=m=>{m.key==="Escape"&&a()};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[a]),l.useEffect(()=>{if(!C)return;const O=m=>{if(m.key!=="Tab"||!b.current)return;const j=Array.from(b.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!j.length)return;const D=j[0],V=j[j.length-1];m.shiftKey&&document.activeElement===D?(m.preventDefault(),V.focus()):!m.shiftKey&&document.activeElement===V&&(m.preventDefault(),D.focus())};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[C]),!k||typeof document>"u"?null:te.createPortal(e.jsxs(e.Fragment,{children:[_&&e.jsx("div",{className:["ds-coachmark__spotlight",c&&"ds-coachmark__spotlight--overlay",!i&&"ds-coachmark__spotlight--no-ring",C&&"ds-coachmark__spotlight--visible"].filter(Boolean).join(" "),style:_,"aria-hidden":"true"}),e.jsxs("div",{ref:b,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":k.title??N("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${U}`,C&&"ds-coachmark__bubble--visible"].filter(Boolean).join(" "),style:H,tabIndex:-1,children:[e.jsx("button",{type:"button",className:"ds-coachmark__close",onClick:a,"aria-label":$,children:e.jsx(P.X,{size:16,strokeWidth:2})}),k.title&&e.jsx("div",{className:"ds-coachmark__title",children:k.title}),e.jsx("div",{className:"ds-coachmark__body",children:k.content}),e.jsxs("div",{className:"ds-coachmark__footer",children:[t.length>1&&e.jsxs("span",{className:"ds-coachmark__counter",children:[s+1," / ",t.length]}),e.jsxs("div",{className:"ds-coachmark__footer-nav",children:[s>0&&e.jsx(re,{variant:"secondary",size:"s",state:p,onClick:r,children:y}),e.jsx(re,{variant:"primary",size:"s",state:v,onClick:L?o:n,children:L?A:T})]})]})]})]}),document.body)}function _n(t,s={}){const{storageKey:n}=s,[r,a]=l.useState(0),[o,c]=l.useState(!1),i=()=>n&&typeof localStorage<"u"&&localStorage.getItem(n)==="done",d=l.useCallback(()=>{c(!1),n&&typeof localStorage<"u"&&localStorage.setItem(n,"done")},[n]);return{currentStep:r,isActive:o,start:()=>{i()||(a(0),c(!0))},next:()=>a(f=>Math.min(f+1,t.length-1)),back:()=>a(f=>Math.max(f-1,0)),skip:d,finish:d}}function jn(){const t=l.useRef(null),s=l.useCallback(()=>{const n=t.current;if(!n)return;n.classList.remove("ds-shake"),n.offsetWidth,n.classList.add("ds-shake");const r=()=>{n.classList.remove("ds-shake"),n.removeEventListener("animationend",r)};n.addEventListener("animationend",r)},[]);return{ref:t,shake:s}}exports.Accordion=ye;exports.Alert=$t;exports.AnimatedNumber=Ps;exports.Avatar=rs;exports.Badge=ce;exports.Banner=As;exports.BottomSheet=Lt;exports.Breadcrumb=hs;exports.BrowserPane=zt;exports.BrowserTabs=Ot;exports.Button=re;exports.Card=Nt;exports.ChatMessage=Xs;exports.Checkbox=Qt;exports.Coachmark=bn;exports.Code=Pt;exports.CodeAccordion=st;exports.ConfidenceBar=nn;exports.CopyButton=lt;exports.DiffView=an;exports.Dropdown=Bs;exports.EmptyState=fs;exports.EngineerGrid=dn;exports.FormField=ms;exports.H1=yt;exports.H2=kt;exports.H3=Et;exports.H4=Rt;exports.InView=Cs;exports.Input=_t;exports.Link=Ct;exports.List=Wt;exports.ListRow=Ht;exports.LocaleProvider=vt;exports.Mention=Jt;exports.MessageFeedback=dt;exports.MessageFooter=ln;exports.Modal=Dt;exports.ModalFooter=de;exports.ModelPicker=Js;exports.NavRail=js;exports.NavRailAgent=Ss;exports.NavRailBody=ws;exports.NavRailCustomItem=Rs;exports.NavRailDivider=ks;exports.NavRailFlyout=Ts;exports.NavRailFooter=ys;exports.NavRailHeader=Ns;exports.NavRailItem=gs;exports.NavRailRecents=Es;exports.P1=St;exports.P2=tt;exports.P3=Le;exports.Pagination=xs;exports.ProgressBar=Ds;exports.PromptInput=Gs;exports.Radio=es;exports.ReasoningBlock=Us;exports.Scrollable=un;exports.SegmentedControl=qt;exports.Select=gt;exports.SidePage=_s;exports.SidePageFooter=Ae;exports.Skeleton=nt;exports.SourcesPanel=en;exports.Spinner=et;exports.Stat=ps;exports.StepIndicator=Vs;exports.Stepper=wt;exports.StreamingText=qs;exports.Tab=Ft;exports.Table=as;exports.TableBody=is;exports.TableHead=os;exports.TableRow=ls;exports.TableSubheaderRow=cs;exports.Tabs=Mt;exports.Td=us;exports.Textarea=jt;exports.Th=ds;exports.ThinkingDot=cn;exports.ToastContainer=Ws;exports.Toggle=Zt;exports.TokenCounter=tn;exports.ToolCallBubble=it;exports.ToolCallCard=it;exports.Tooltip=ke;exports.defaultStrings=_e;exports.formatString=De;exports.iconSizes=q;exports.useAnimatedNumber=rt;exports.useAnimatedPlaceholder=ct;exports.useCoachmark=_n;exports.useInView=at;exports.useLocale=ue;exports.useShake=jn;exports.useStreamScroll=Ys;exports.useStrings=K;exports.useToast=zs;
|
|
22
|
+
<%s key={someKey} {...props} />`,V,Y,Q,Y),W[Y+V]=!0)}if(Y=null,D!==void 0&&(n(D),Y=""+D),i(g)&&(n(g.key),Y=""+g.key),"key"in g){D={};for(var ie in g)ie!=="key"&&(D[ie]=g[ie])}else D=g;return Y&&c(D,typeof m=="function"?m.displayName||m.name||"Unknown":m),f(m,Y,D,o(),X,K)}function b(m){_(m)?m._store&&(m._store.validated=1):typeof m=="object"&&m!==null&&m.$$typeof===M&&(m._payload.status==="fulfilled"?_(m._payload.value)&&m._payload.value._store&&(m._payload.value._store.validated=1):m._store&&(m._store.validated=1))}function _(m){return typeof m=="object"&&m!==null&&m.$$typeof===w}var p=l,w=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),h=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),U=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,j=Array.isArray,v=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(m){return m()}};var N,$={},P=p.react_stack_bottom_frame.bind(p,a)(),F=v(r(a)),W={};be.Fragment=S,be.jsx=function(m,g,D){var V=1e4>U.recentlyCreatedOwnerStacks++;return u(m,g,D,!1,V?Error("react-stack-top-frame"):P,V?v(r(m)):F)},be.jsxs=function(m,g,D){var V=1e4>U.recentlyCreatedOwnerStacks++;return u(m,g,D,!0,V?Error("react-stack-top-frame"):P,V?v(r(m)):F)}}()),be}process.env.NODE_ENV==="production"?$e.exports=ht():$e.exports=xt();var e=$e.exports;const _e={close:"Close",closeModal:"Close modal",closeAlert:"Close alert",dismiss:"Dismiss",loading:"Loading",next:"Next",back:"Back",skipTour:"Skip tour",done:"Done",previousPage:"Previous page",nextPage:"Next page",pagination:"Pagination",pageN:"Page {n}",breadcrumb:"Breadcrumb",recents:"Recents",steps:"Steps",stepN:"Step {n}",stepOf:"Step {current} of {total}",copyToClipboard:"Copy to clipboard",selectOption:"Select option",like:"Like",dislike:"Dislike",removeImage:"Remove image",attachFiles:"Attach files",stop:"Stop",send:"Send",toggleVisibility:"Toggle visibility",decrease:"Decrease",increase:"Increase",sources:"Sources",moreSources:"+{n} more sources",pageAbbrev:"p. {pages}",code:"Code",promptPlaceholder:"Let's get things done...",dropFilesHere:"Drop files here",fileTooLarge:"File(s) too large{maxHint}: {names}",fileTooLargeMaxHint:" (max {maxMb}MB)",filesSkipped:"Skipped unsupported file(s): {names}",maxImages:"Max {n} images per message",uploading:"Uploading...",removeAttachment:"Remove attachment",closeTab:"Close {label}"};function Be(t,s={}){return typeof t=="function"?t(s):typeof t!="string"?"":t.replace(/\{(\w+)\}/g,(n,r)=>s[r]!==void 0&&s[r]!==null?String(s[r]):"")}const Ie=l.createContext({strings:_e,t:(t,s)=>Be(_e[t]??t,s)});function vt({strings:t,children:s}){const n=l.useMemo(()=>{const r={..._e,...t};return{strings:r,t:(o,a)=>Be(r[o]??_e[o]??o,a)}},[t]);return e.jsx(Ie.Provider,{value:n,children:s})}function ue(){return l.useContext(Ie)}function G(){return l.useContext(Ie).strings}function et({size:t="m",color:s="default",className:n="","aria-label":r,...o}){const a=G();return e.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${s}`,n].filter(Boolean).join(" "),role:"status","aria-label":r??a.loading,...o})}const bt={xs:12,s:14,m:16,l:20};function re({children:t,variant:s="primary",size:n="m",fullWidth:r=!1,icon:o,disabled:a=!1,state:i="idle",active:c=!1,pressed:d=!1,onClick:f,type:u="button",href:b,"aria-label":_,"aria-pressed":p,className:w="",...x}){const S=o&&!t,y=i==="loading",T=i==="success",R=i==="error",h=y||T||R,E=!!(c||d),k=n==="xs"?"s":"m",L=s==="danger"?"on-accent":"default",I=bt[n]??16,M=y?e.jsx(et,{size:k,color:L}):T?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(C.Check,{size:I,strokeWidth:2.5})}):R?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(C.X,{size:I,strokeWidth:2.5})}):null,O=["ds-button",`ds-button--${s}`,`ds-button--${n}`,r&&"ds-button--full",S&&"ds-button--icon-only",w].filter(Boolean).join(" "),A=i!=="idle"?i:void 0,U=p!==void 0?p:E?!0:void 0,z=e.jsxs(e.Fragment,{children:[h?M:o&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:o}),t]});if(b){const j=v=>{if(a||y){v.preventDefault();return}v.metaKey||v.ctrlKey||v.button===1||(v.preventDefault(),f==null||f(v))};return e.jsx("a",{className:O,href:a||y?void 0:b,onClick:j,"aria-label":_,"aria-disabled":a||y?"true":void 0,"aria-busy":y?"true":void 0,"aria-pressed":U,"data-state":A,"data-active":E?"true":void 0,...x,children:z})}return e.jsx("button",{type:u,className:O,disabled:a,onClick:y?void 0:f,"aria-label":_,"aria-busy":y?"true":void 0,"aria-pressed":U,"data-state":A,"data-active":E?"true":void 0,...x,children:z})}function _t({label:t,error:s,hint:n,fullWidth:r=!0,icon:o,iconRight:a,onIconRightClick:i,size:c="m",disabled:d,id:f,iconRightLabel:u,...b}){const _=G(),p=f||`input-${l.useId()}`,w=n?`${p}-hint`:void 0,x=s?`${p}-error`:void 0,S=x||w;return e.jsxs("div",{className:`ds-input-wrapper ${r?"ds-input-wrapper--full":""} ${d?"ds-input-wrapper--disabled":""} ${s?"ds-input-wrapper--error":""}`,children:[t&&e.jsx("label",{className:"ds-input-label",htmlFor:p,children:t}),e.jsxs("div",{className:"ds-input-container",children:[o&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${c}`,"aria-hidden":"true",children:o}),e.jsx("input",{id:p,className:`ds-input ds-input--${c} ${o?"ds-input--with-icon":""} ${a?"ds-input--with-icon-right":""} ${s?"ds-input--error":""}`,disabled:d,"aria-invalid":s?"true":"false","aria-describedby":S,...b}),a&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${c}`,onClick:i,tabIndex:-1,"aria-label":u??_.toggleVisibility,children:a})]}),n&&!s&&e.jsx("span",{id:w,className:"ds-input-hint",children:n}),e.jsx("div",{className:"ds-input-error-wrap",children:e.jsx("div",{className:"ds-input-error-inner",children:s&&e.jsx("span",{id:x,className:"ds-input-error",role:"alert",children:s})})})]})}function jt({label:t,error:s,hint:n,fullWidth:r=!0,size:o="m",disabled:a,id:i,resize:c=!0,rows:d=3,...f}){const u=i||`textarea-${l.useId()}`,b=n?`${u}-hint`:void 0,_=s?`${u}-error`:void 0,p=_||b;return e.jsxs("div",{className:`ds-textarea-wrapper ${r?"ds-textarea-wrapper--full":""} ${a?"ds-textarea-wrapper--disabled":""}`,children:[t&&e.jsx("label",{className:"ds-textarea-label",htmlFor:u,children:t}),e.jsx("textarea",{id:u,className:`ds-textarea ds-textarea--${o} ${s?"ds-textarea--error":""} ${c?"":"ds-textarea--no-resize"}`,disabled:a,"aria-invalid":s?"true":"false","aria-describedby":p,rows:d,...f}),n&&!s&&e.jsx("span",{id:b,className:"ds-textarea-hint",children:n}),s&&e.jsx("span",{id:_,className:"ds-textarea-error",role:"alert",children:s})]})}function gt({label:t,value:s,onChange:n,options:r=[],placeholder:o,error:a,fullWidth:i=!0,size:c="m",disabled:d=!1,id:f,...u}){const b=G(),_=o??b.selectOption,[p,w]=l.useState(!1),[x,S]=l.useState(!1),[y,T]=l.useState({}),[R,h]=l.useState("down"),[E,k]=l.useState(-1),L=l.useRef(null),I=l.useRef(null),M=l.useRef(null),O=l.useRef(null),A=f||`select-${l.useId()}`,U=`${A}-label`,z=a?`${A}-error`:void 0,j=150,v=(g=!1)=>{x||(S(!0),k(-1),O.current=setTimeout(()=>{var D;w(!1),S(!1),g&&((D=M.current)==null||D.focus())},j))},N=g=>{clearTimeout(O.current),S(!1);const D=g!==void 0?g:Math.max(r.findIndex(V=>V.value===s),0);k(D),w(!0)};l.useEffect(()=>()=>clearTimeout(O.current),[]);const $=()=>{var Q;const g=(Q=L.current)==null?void 0:Q.getBoundingClientRect();if(!g)return;const D=window.innerHeight,V=D-g.bottom,X=g.top,Y=V<300&&X>V;h(Y?"up":"down"),T(Y?{bottom:D-g.top+4,left:g.left,width:g.width}:{top:g.bottom+4,left:g.left,width:g.width})};l.useEffect(()=>{if(p)return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[p]),l.useEffect(()=>{const g=D=>{L.current&&!L.current.contains(D.target)&&I.current&&!I.current.contains(D.target)&&v()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[x]),l.useEffect(()=>{var D;if(!p||E<0||!I.current)return;(D=I.current.querySelectorAll(".ds-select-option")[E])==null||D.scrollIntoView({block:"nearest"})},[E,p]);const P=g=>{switch(g.key){case"ArrowDown":g.preventDefault(),p?k(D=>Math.min(D+1,r.length-1)):N();break;case"ArrowUp":g.preventDefault(),p?k(D=>Math.max(D-1,0)):N(r.length-1);break;case"Home":p&&(g.preventDefault(),k(0));break;case"End":p&&(g.preventDefault(),k(r.length-1));break;case"Enter":case" ":g.preventDefault(),p?E>=0&&(n==null||n(r[E].value),v(!0)):N();break;case"Escape":p&&(g.preventDefault(),v(!0));break;case"Tab":p&&v(!1);break}},F=r.find(g=>g.value===s),W=c==="xs"?q[1]:c==="small"?q[2]:q[3],m=p&&e.jsx("div",{ref:I,"data-ds-portal":"",role:"listbox","aria-labelledby":t?U:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${c}`,`ds-select-dropdown--${R}`,x&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:y,children:r.map((g,D)=>e.jsx("button",{id:`${A}-opt-${D}`,type:"button",role:"option",tabIndex:-1,"aria-selected":s===g.value,className:["ds-select-option",`ds-select-option--${c}`,s===g.value&&"ds-select-option--selected",D===E&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{n==null||n(g.value),v(!0)},children:g.label},g.value))});return e.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${d?"ds-select-wrapper--disabled":""}`,children:[t&&e.jsx("label",{id:U,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:L,children:e.jsxs("button",{ref:M,type:"button",id:A,role:"combobox","aria-haspopup":"listbox","aria-expanded":p,"aria-activedescendant":p&&E>=0?`${A}-opt-${E}`:void 0,"aria-labelledby":t?U:void 0,"aria-invalid":a?"true":"false","aria-describedby":z,className:`ds-select-trigger ds-select-trigger--${c} ${a?"ds-select-trigger--error":""}`,onClick:()=>{d||(p?v():N())},onKeyDown:P,disabled:d,...u,children:[e.jsx("span",{className:F?"":"ds-select-placeholder",children:(F==null?void 0:F.label)||_}),e.jsx(C.ChevronDown,{size:W,strokeWidth:1.5,className:`ds-select-icon ${p&&R==="down"?"ds-select-icon--open":""} ${p&&R==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),a&&e.jsx("span",{id:z,className:"ds-select-error",role:"alert",children:a}),typeof document<"u"&&te.createPortal(m,document.body)]})}function wt({label:t,value:s=0,onChange:n,min:r=0,max:o=100,step:a=1,size:i="m",disabled:c=!1,hint:d,error:f,decreaseLabel:u,increaseLabel:b,..._}){const p=G(),w=()=>{if(c)return;const h=Math.min(Number(s)+a,o);n==null||n(h)},x=()=>{if(c)return;const h=Math.max(Number(s)-a,r);n==null||n(h)},S=h=>{if(c)return;const E=h.target.value;if(E===""){n==null||n(r);return}const k=Number(E);if(!isNaN(k)){const L=Math.min(Math.max(k,r),o);n==null||n(L)}},y=["ds-stepper-wrapper",c&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),T=["ds-stepper",`ds-stepper--${i}`,c&&"ds-stepper--disabled"].filter(Boolean).join(" "),R=i==="xs"?q[1]:i==="small"?q[2]:q[3];return e.jsxs("div",{className:y,children:[t&&e.jsx("label",{className:"ds-stepper-label",children:t}),e.jsxs("div",{className:T,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:x,disabled:c||s<=r,"aria-label":u??p.decrease,children:e.jsx(C.Minus,{size:R,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:S,min:r,max:o,step:a,disabled:c,..._}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:w,disabled:c||s>=o,"aria-label":b??p.increase,children:e.jsx(C.Plus,{size:R,strokeWidth:1.5})})]}),d&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:d}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function Nt({children:t,padding:s="m",variant:n="default",hover:r=!1,onClick:o,href:a,disabled:i=!1,className:c="",...d}){const u=(r?"interactive":n)==="interactive"||o||a,b=["ds-card",`ds-card--${s}`,u&&"ds-card--interactive",c].filter(Boolean).join(" ");if(a){const w=x=>{if(i){x.preventDefault();return}x.metaKey||x.ctrlKey||x.button===1||(x.preventDefault(),o==null||o(x))};return e.jsx("a",{className:b,href:i?void 0:a,onClick:w,"aria-disabled":i?"true":void 0,...d,children:t})}const _=u&&o?"button":"div",p=u&&o?{type:"button",onClick:o,disabled:i}:{};return e.jsx(_,{className:b,role:u&&!o?"article":void 0,...p,...d,children:t})}function yt({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function kt({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function Et({children:t,...s}){return e.jsx("h3",{className:"ds-h3",...s,children:t})}function Rt({children:t,...s}){return e.jsx("h4",{className:"ds-h4",...s,children:t})}function St({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function tt({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p2 ${s?"ds-p2--secondary":""}`,...n,children:t})}function De({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p3 ${s?"ds-p3--secondary":""}`,...n,children:t})}function ce({children:t,variant:s="default",size:n="m",role:r,...o}){const a=["ds-badge",`ds-badge--${s}`,`ds-badge--${n}`].filter(Boolean).join(" "),i=r||(["info","success","warning","error"].includes(s)?"status":void 0);return e.jsx("span",{className:a,role:i,...o,children:t})}const Tt={info:C.Info,success:C.CheckCircle,warning:C.AlertTriangle,error:C.XCircle},$t=l.forwardRef(function({children:s,variant:n="info",title:r,onClose:o,role:a,closeLabel:i,...c},d){const f=G(),u=Tt[n],b=a||(n==="error"?"alert":"status");return e.jsxs("div",{ref:d,className:`ds-alert ds-alert--${n} ${r?"":"ds-alert--no-title"}`,role:b,...c,children:[u&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(u,{size:q[3],strokeWidth:1.5})}),e.jsxs("div",{className:"ds-alert__content",children:[r&&e.jsx("div",{className:"ds-alert__title",children:r}),s&&e.jsx("div",{className:"ds-alert__message",children:s})]}),o&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:o,"aria-label":i??f.closeAlert,children:e.jsx(C.X,{size:q[3],strokeWidth:1.5})})]})}),At="data-ds-portal";function Pe(t){var n;const s=((n=t.composedPath)==null?void 0:n.call(t)[0])??t.target;return s instanceof Element?s:s instanceof Node?s.parentElement:null}function Ce(t,s){var r;const n=(r=t==null?void 0:t.closest)==null?void 0:r.call(t,`[${At}]`);return!!(n&&n!==s)}const Lt=200;function Bt({children:t,title:s,onClose:n,size:r="m",scrollable:o=!1,subHeader:a,closeLabel:i,...c}){const d=G(),f=l.useRef(null),u=l.useRef(null),b=l.useId(),[_,p]=l.useState(!1),w=l.useRef(null),x=()=>{!n||_||(p(!0),w.current=setTimeout(()=>{p(!1),n()},Lt))};l.useEffect(()=>()=>clearTimeout(w.current),[]),l.useEffect(()=>{const h=k=>{k.key==="Escape"&&x()},E=k=>{var I;const L=Pe(k);L&&((I=u.current)!=null&&I.contains(L)||Ce(L,f.current)||x())};return document.addEventListener("keydown",h),document.addEventListener("mousedown",E),()=>{document.removeEventListener("keydown",h),document.removeEventListener("mousedown",E)}},[n,_]);const S=l.Children.toArray(t),y=S.find(h=>(h==null?void 0:h.type)===de),T=S.filter(h=>(h==null?void 0:h.type)!==de),R=e.jsx("div",{className:["ds-modal-overlay",_&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...c,ref:f,"data-ds-portal":"",children:e.jsxs("div",{className:[`ds-modal ds-modal--${r}`,o&&"ds-modal--scrollable"].filter(Boolean).join(" "),"data-surface":"2",ref:u,role:"dialog","aria-modal":"true","aria-labelledby":s?b:void 0,children:[n&&e.jsx(re,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(C.X,{size:q[2],strokeWidth:1.5}),onClick:x,"aria-label":i??d.closeModal}),(s||a)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:b,className:"ds-modal__title",children:s}),a&&e.jsx("div",{className:"ds-modal__subheader",children:a})]}),e.jsx("div",{className:"ds-modal__body ds-scrollable",children:T}),y]})});return typeof document>"u"?R:te.createPortal(R,document.body)}function de({children:t}){return!t||l.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const It=320;function Dt({children:t,title:s,onClose:n,subHeader:r,closeLabel:o,...a}){const i=G(),c=l.useRef(null),d=l.useRef(null),f=l.useId(),[u,b]=l.useState(!1),_=l.useRef(null),p=()=>{!n||u||(b(!0),_.current=setTimeout(()=>{b(!1),n()},It))};l.useEffect(()=>()=>clearTimeout(_.current),[]),l.useEffect(()=>{const T=h=>{h.key==="Escape"&&p()},R=h=>{var k;const E=Pe(h);E&&((k=d.current)!=null&&k.contains(E)||Ce(E,c.current)||p())};return document.addEventListener("keydown",T),document.addEventListener("mousedown",R),()=>{document.removeEventListener("keydown",T),document.removeEventListener("mousedown",R)}},[n,u]);const w=l.Children.toArray(t),x=w.find(T=>(T==null?void 0:T.type)===de),S=w.filter(T=>(T==null?void 0:T.type)!==de),y=e.jsx("div",{className:["ds-bottom-sheet-overlay",u&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...a,ref:c,"data-ds-portal":"",children:e.jsxs("div",{ref:d,className:["ds-bottom-sheet",u&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),"data-surface":"2",role:"dialog","aria-modal":"true","aria-labelledby":s?f:void 0,children:[e.jsx("div",{className:"ds-bottom-sheet__handle","aria-hidden":"true"}),n&&e.jsx(re,{className:"ds-bottom-sheet__close",variant:"ghost",size:"small",icon:e.jsx(C.X,{size:q[2],strokeWidth:1.5}),onClick:p,"aria-label":o??i.close}),(s||r)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[s&&e.jsx("h3",{id:f,className:"ds-bottom-sheet__title",children:s}),r&&e.jsx("div",{className:"ds-bottom-sheet__subheader",children:r})]}),e.jsx("div",{className:"ds-bottom-sheet__body ds-scrollable",children:S}),x]})});return typeof document>"u"?y:te.createPortal(y,document.body)}function st({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:o,padding:a="s",className:i="",...c}){const d=G(),f=s??d.code,[u,b]=l.useState(n),_=r!==void 0,p=_?r:u,w=()=>{_?o==null||o(!r):b(S=>!S)},x=["ds-code-accordion",`ds-code-accordion--${a}`,p&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...c,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:w,"aria-expanded":p,children:[e.jsx("span",{className:"ds-code-accordion__title",children:f}),e.jsx(C.ChevronDown,{size:q[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${p?"ds-code-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-code-accordion__content",children:e.jsx("div",{className:"ds-code-accordion__inner",children:e.jsx("pre",{className:"ds-code-accordion__pre ds-scrollable",children:e.jsx("code",{children:t})})})})]})}function Pt({children:t,block:s=!1,collapsible:n=!1,title:r,defaultExpanded:o=!1,...a}){const i=G(),c=r??i.code;return s?n?e.jsx(st,{title:c,defaultExpanded:o,...a,children:t}):e.jsx("pre",{className:"ds-code-block ds-scrollable",...a,children:e.jsx("code",{children:t})}):e.jsx("code",{className:"ds-code-inline",...a,children:t})}function Ct({href:t,children:s,onClick:n,target:r,rel:o,...a}){const c=r==="_blank"?o?`${o} noopener noreferrer`:"noopener noreferrer":o;return e.jsx("a",{href:t,className:"ds-link",onClick:n,target:r,rel:c,...a,children:s})}function Mt(t){return l.Children.toArray(t).filter(l.isValidElement)}function Ft(t){return t.disabled||t["aria-disabled"]===!0||t["aria-disabled"]==="true"}function zt(t){return!!(t.selected||t["aria-current"]==="page")}function Wt(t,s){const r=s.offsetLeft,o=r+s.offsetWidth,a=t.scrollLeft+20,i=t.scrollLeft+t.clientWidth-20;r<a?t.scrollLeft=Math.max(0,r-20):o>i&&(t.scrollLeft=o-t.clientWidth+20)}function Ot({children:t,size:s="m",variant:n="ghost",onKeyDown:r,onFocus:o,...a}){const i=l.useRef(null),c=Mt(t),d=c.findIndex(x=>zt(x.props)),[f,u]=l.useState(d>=0?d:0),[b,_]=l.useState({start:!1,end:!1});l.useLayoutEffect(()=>{const x=i.current;!x||x.contains(document.activeElement)||u(d>=0?d:0)},[d]),l.useEffect(()=>{const x=i.current;if(!x)return;const S=()=>{const h=x.scrollWidth-x.clientWidth,k=getComputedStyle(x).direction==="rtl"?Math.abs(x.scrollLeft):x.scrollLeft,L=k>1,I=h-k>1;_(M=>M.start===L&&M.end===I?M:{start:L,end:I})},y=()=>{S();const h=x.querySelectorAll(':scope > [role="tab"]'),E=document.activeElement,k=E&&x.contains(E)&&E.matches('[role="tab"]')?E:h[f];k&&Wt(x,k)};y(),x.addEventListener("scroll",S,{passive:!0});const T=new ResizeObserver(y);T.observe(x),x.parentElement&&T.observe(x.parentElement),x.querySelectorAll(':scope > [role="tab"]').forEach(h=>T.observe(h));let R=!1;return document.fonts&&document.fonts.status!=="loaded"&&document.fonts.ready.then(()=>{R||y()}),()=>{R=!0,x.removeEventListener("scroll",S),T.disconnect()}},[t,s,n,f]);const p=x=>{if((x.key==="ArrowRight"||x.key==="ArrowLeft"||x.key==="Home"||x.key==="End")&&i.current){const y=i.current,T=[...y.querySelectorAll(':scope > [role="tab"]')],R=T.map((h,E)=>({el:h,index:E})).filter(({el:h})=>!h.disabled&&h.getAttribute("aria-disabled")!=="true");if(R.length){const h=R.findIndex(({el:M})=>M===document.activeElement),E=getComputedStyle(y).direction==="rtl",k=h>=0?h:0;let L=k;x.key==="Home"?L=0:x.key==="End"?L=R.length-1:x.key==="ArrowRight"?L=(k+(E?-1:1)+R.length)%R.length:L=(k+(E?1:-1)+R.length)%R.length,x.preventDefault();const I=R[L].index;T.forEach((M,O)=>{M.tabIndex=!M.disabled&&M.getAttribute("aria-disabled")!=="true"&&O===I?0:-1}),u(I),R[L].el.focus()}}r==null||r(x)},w=x=>{const S=i.current;if(S){const T=[...S.querySelectorAll(':scope > [role="tab"]')].indexOf(x.target);T>=0&&u(T)}o==null||o(x)};return e.jsx("div",{...a,ref:i,className:["ds-tabs",a.className].filter(Boolean).join(" "),role:"tablist","data-fade-start":b.start?"":void 0,"data-fade-end":b.end?"":void 0,onKeyDown:p,onFocus:w,children:c.map((x,S)=>{const y=Ft(x.props);return l.cloneElement(x,{size:x.props.size||s,variant:x.props.variant||n,tabIndex:y||S!==f?-1:0})})})}function Ht({children:t,selected:s=!1,onClick:n,size:r="m",variant:o="ghost",disabled:a=!1,icon:i,href:c,...d}){const f=i&&!t,u=["ds-tab",`ds-tab--${r}`,`ds-tab--${o}`,s&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),b=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),t]});if(c){const _=p=>{if(a){p.preventDefault();return}p.metaKey||p.ctrlKey||p.button===1||(p.preventDefault(),n==null||n(p))};return e.jsx("a",{role:"tab","aria-current":s?"page":void 0,"aria-disabled":a?"true":void 0,className:u,href:a?void 0:c,onClick:_,...d,children:b})}return e.jsx("button",{type:"button",role:"tab","aria-selected":s,className:u,onClick:n,disabled:a,...d,children:b})}function Ut({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-browser-pane",s].filter(Boolean).join(" "),...n,children:t})}function Vt({tabs:t,active:s,onChange:n,onClose:r,className:o="",...a}){const{t:i}=ue();return e.jsx("div",{className:["ds-browser-tabs",o].filter(Boolean).join(" "),role:"tablist",...a,children:t.map(c=>{const d=c.id===s,f=!!c.closable;return e.jsxs("div",{className:["ds-browser-tab",d&&"ds-browser-tab--active",f&&"ds-browser-tab--closable"].filter(Boolean).join(" "),title:c.label,children:[e.jsxs("button",{type:"button",role:"tab","aria-selected":d,className:"ds-browser-tab__hit",onClick:()=>n==null?void 0:n(c.id),children:[c.icon?e.jsx("span",{className:"ds-browser-tab__icon","aria-hidden":!0,children:c.icon}):null,e.jsx("span",{className:"ds-browser-tab__label",children:c.label})]}),f?e.jsx("button",{type:"button",className:"ds-browser-tab__close","aria-label":i("closeTab",{label:c.label}),onClick:u=>{u.stopPropagation(),r==null||r(c.id)},children:e.jsx(C.X,{size:12,strokeWidth:2})}):null]},c.id)})})}function qt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-list",s].filter(Boolean).join(" "),role:"list",...n,children:t})}function Xt({icon:t,title:s,subtitle:n,meta:r,onClick:o,className:a="",...i}){const c=r==null?[]:Array.isArray(r)?r:[r],d=["ds-list-row",!t&&"ds-list-row--no-icon",o&&"ds-list-row--interactive",a].filter(Boolean).join(" "),f=e.jsxs(e.Fragment,{children:[t?e.jsx("span",{className:"ds-list-row__icon","aria-hidden":!0,children:t}):null,e.jsxs("span",{className:"ds-list-row__name",children:[e.jsx("span",{className:"ds-list-row__title",children:s}),n?e.jsx("span",{className:"ds-list-row__subtitle",children:n}):null]}),c.map((u,b)=>e.jsx("span",{className:"ds-list-row__meta",children:u},b))]});return o?e.jsx("button",{type:"button",role:"listitem",className:d,onClick:o,...i,children:f}):e.jsx("div",{role:"listitem",className:d,...i,children:f})}const Oe=.5,Yt={s:12,m:14,sm:14,l:16};function Gt(t){const s=getComputedStyle(t);return t.clientWidth-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)}function ge({icon:t}){return t?e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:t}):null}function Kt({options:t,value:s,onChange:n,size:r="m",disabled:o=!1,overflow:a="menu"}){const i=l.useRef(null),c=l.useRef(null),d=l.useRef(null),f=l.useRef(null),u=l.useRef(null),[b,_]=l.useState(!1),[p,w]=l.useState(!1),[x,S]=l.useState(!1),y=l.useRef(!1),T=l.useRef(null),R=l.useRef(null),h=l.useRef(!1),E=l.useId(),k=p&&a==="stack",L=p&&a!=="stack",I=t.find(j=>j.value===s)||t[0],M=()=>{const j=i.current,v=c.current;if(!j||!v)return;const N=Gt(j),$=[...v.querySelectorAll(".ds-seg__btn")].reduce((X,K)=>X+K.getBoundingClientRect().width,0);if(N>0&&$>0){const X=h.current,K=X?!(N>$+Oe):$>N+Oe;if(K!==X){h.current=K,w(K),K||S(!1);return}}if(h.current&&a!=="stack")return;const P=j.querySelector(`:scope > button[data-value="${CSS.escape(String(s))}"]`);if(!P)return;const F=j.getBoundingClientRect(),W=P.getBoundingClientRect(),m=W.left-F.left-j.clientLeft,g=W.top-F.top-j.clientTop,D=h.current&&a==="stack",V=X=>{const K=window.matchMedia("(prefers-reduced-motion: reduce)").matches;X.style.transition=y.current&&!K?"left var(--transition-normal), width var(--transition-normal), top var(--transition-normal), height var(--transition-normal)":"none",X.style.left=`${m}px`,X.style.width=`${W.width}px`,D?(X.style.top=`${g}px`,X.style.height=`${W.height}px`,X.style.bottom="auto"):(X.style.top="",X.style.height="",X.style.bottom=""),y.current=!1};d.current?V(d.current):_(!0)};R.current=M,l.useLayoutEffect(()=>{const j=T.current!==s;T.current=s,y.current=b&&j,M()}),l.useEffect(()=>{const j=i.current;if(!j)return;const v=new ResizeObserver(()=>{var $;y.current=!1,($=R.current)==null||$.call(R)});v.observe(j),j.parentElement&&v.observe(j.parentElement);let N=!1;return document.fonts&&document.fonts.status!=="loaded"&&document.fonts.ready.then(()=>{var $;N||(y.current=!1,($=R.current)==null||$.call(R))}),()=>{N=!0,v.disconnect()}},[]),l.useLayoutEffect(()=>{var $;if(!x)return;const j=u.current,v=f.current;if(!j||!v)return;const N=()=>{const P=v.getBoundingClientRect(),F=Math.max(P.width,j.scrollWidth),W=window.innerWidth-F-8,m=Math.max(8,Math.min(P.left,W));j.style.width=`${F}px`,j.style.left=`${m}px`;const g=j.offsetHeight,D=window.innerHeight-P.bottom;D<g+8&&P.top>D?(j.style.top="auto",j.style.bottom=`${window.innerHeight-P.top+4}px`):(j.style.bottom="auto",j.style.top=`${P.bottom+4}px`)};return N(),($=j.querySelector('[aria-selected="true"]'))==null||$.focus(),window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[x,s,t]),l.useEffect(()=>{if(!x)return;const j=N=>{var $,P;($=i.current)!=null&&$.contains(N.target)||(P=u.current)!=null&&P.contains(N.target)||S(!1)},v=N=>{var $;N.key==="Escape"&&(S(!1),($=f.current)==null||$.focus())};return document.addEventListener("mousedown",j),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",v)}},[x]);const O=j=>{var v;o||n(j),S(!1),(v=f.current)==null||v.focus()},A=(j,v)=>{var $,P,F,W,m,g,D;const N=($=u.current)==null?void 0:$.querySelectorAll(".ds-seg__option");N!=null&&N.length&&(j.key==="ArrowDown"?(j.preventDefault(),(P=N[Math.min(v+1,N.length-1)])==null||P.focus()):j.key==="ArrowUp"?(j.preventDefault(),v===0?(F=f.current)==null||F.focus():(W=N[v-1])==null||W.focus()):j.key==="Home"?(j.preventDefault(),(m=N[0])==null||m.focus()):j.key==="End"?(j.preventDefault(),(g=N[N.length-1])==null||g.focus()):j.key==="Escape"&&(j.preventDefault(),S(!1),(D=f.current)==null||D.focus()))},U=e.jsx("div",{className:"ds-seg__measure",ref:c,"aria-hidden":"true",children:t.map(j=>e.jsxs("button",{type:"button",tabIndex:-1,className:"ds-seg__btn","data-value":j.value,children:[e.jsx(ge,{icon:j.icon}),j.label]},j.value))}),z=L&&x&&typeof document<"u"&&te.createPortal(e.jsx("div",{ref:u,id:E,className:["ds-seg__menu",`ds-seg--${r}`].join(" "),role:"listbox","aria-activedescendant":void 0,children:t.map((j,v)=>e.jsxs("button",{type:"button",role:"option",className:["ds-seg__option",j.value===s&&"ds-seg__option--selected"].filter(Boolean).join(" "),"aria-selected":j.value===s,onClick:()=>O(j.value),onKeyDown:N=>A(N,v),children:[e.jsx(ge,{icon:j.icon}),j.label]},j.value))}),document.body);return e.jsxs("div",{className:["ds-seg",`ds-seg--${r}`,k&&"ds-seg--stack",L&&"ds-seg--menu",o&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:i,role:L?void 0:"group","data-seg-mode":L?"menu":k?"stack":"row",children:[U,L?e.jsxs("button",{ref:f,type:"button",className:"ds-seg__btn ds-seg__trigger","aria-haspopup":"listbox","aria-expanded":x,"aria-controls":E,disabled:o,onClick:()=>!o&&S(j=>!j),onKeyDown:j=>{j.key==="ArrowDown"||j.key==="ArrowUp"?(j.preventDefault(),S(!0)):j.key==="Escape"&&S(!1)},children:[e.jsxs("span",{className:"ds-seg__trigger-label",children:[e.jsx(ge,{icon:I==null?void 0:I.icon}),I==null?void 0:I.label]}),e.jsx(C.ChevronDown,{size:Yt[r]||14,strokeWidth:1.5,className:x?"ds-seg__chevron ds-seg__chevron--open":"ds-seg__chevron","aria-hidden":"true"})]}):e.jsxs(e.Fragment,{children:[b&&e.jsx("div",{ref:d,className:"ds-seg__pill","aria-hidden":"true"}),t.map(j=>e.jsxs("button",{type:"button","data-value":j.value,className:["ds-seg__btn",s===j.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!o&&n(j.value),"aria-pressed":s===j.value,disabled:o,children:[e.jsx(ge,{icon:j.icon}),j.label]},j.value))]}),z]})}function ye({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:o,padding:a="m",...i}){const[c,d]=l.useState(n),f=r!==void 0,u=f?r:c,b=()=>{f?o==null||o(!r):d(p=>!p)},_=["ds-accordion",`ds-accordion--${a}`,u&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:_,...i,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:b,"aria-expanded":u,children:[e.jsx("span",{className:"ds-accordion__title",children:s}),e.jsx(C.ChevronDown,{size:q[2],strokeWidth:1.5,className:`ds-accordion__icon ${u?"ds-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-accordion__content",children:e.jsx("div",{className:"ds-accordion__content-inner",children:e.jsx("div",{className:"ds-accordion__content-body",children:t})})})]})}const oe=8,fe=8;function Jt(t,s,n){const r=window.innerWidth;let o,a;switch(t){case"top":o=s.top-n.height-oe,a=s.left+s.width/2-n.width/2;break;case"bottom":o=s.bottom+oe,a=s.left+s.width/2-n.width/2;break;case"left":o=s.top+s.height/2-n.height/2,a=s.left-n.width-oe;break;case"right":o=s.top+s.height/2-n.height/2,a=s.right+oe;break;default:o=s.bottom+oe,a=s.left}const i=Math.max(fe,Math.min(r-n.width-fe,a)),c=a-i;return{top:o,left:i,arrowOffset:c}}function Zt(t,s,n){const r=window.innerWidth,o=window.innerHeight;if(t.top>=s+oe+fe)return"top";if(o-t.bottom>=s+oe+fe)return"bottom";if(r-t.right>=n+oe+fe)return"right";if(t.left>=n+oe+fe)return"left";const a=Math.max(t.top,o-t.bottom,t.left,r-t.right);return a===t.top?"top":a===o-t.bottom?"bottom":a===r-t.right?"right":"left"}function He(){return window.matchMedia("(hover: hover) and (pointer: fine)").matches}function Qt(t){return t?t.matches(":focus-visible")||!!t.querySelector(":focus-visible"):!1}function ke({children:t,content:s,position:n,...r}){const[o,a]=l.useState(!1),[i,c]=l.useState({visibility:"hidden"}),[d,f]=l.useState(n||"top"),u=l.useRef(null),b=l.useRef(null),_=()=>{if(!u.current||!b.current)return;const T=u.current.getBoundingClientRect(),R=b.current.getBoundingClientRect(),h=n||Zt(T,R.height,R.width),{top:E,left:k,arrowOffset:L}=Jt(h,T,R);f(h),c({position:"fixed",top:E,left:k,visibility:"visible","--arrow-offset":`${L}px`})};l.useEffect(()=>{if(!o)return;c({position:"fixed",visibility:"hidden"});const T=requestAnimationFrame(_);return window.addEventListener("scroll",_,!0),window.addEventListener("resize",_),()=>{cancelAnimationFrame(T),window.removeEventListener("scroll",_,!0),window.removeEventListener("resize",_)}},[o,n]);const p=()=>{He()&&a(!0)},w=()=>{Qt(u.current)||a(!1)},x=T=>{const R=T.target;R instanceof Element&&R.matches(":focus-visible")&&a(!0)},S=T=>{var h,E;const R=T.relatedTarget;R instanceof Node&&((h=u.current)!=null&&h.contains(R))||He()&&((E=u.current)!=null&&E.matches(":hover"))||a(!1)};if(!s)return t;const y=o&&e.jsx("div",{ref:b,"data-ds-portal":"",className:`ds-tooltip ds-tooltip--${d}`,role:"tooltip",style:i,children:s});return e.jsxs("div",{ref:u,className:"ds-tooltip-wrapper",onMouseEnter:p,onMouseLeave:w,onFocus:x,onBlur:S,...r,children:[t,typeof document<"u"&&te.createPortal(y,document.body)]})}const Ue=8,we=8,es=140;function Ve(t){const s=String(t??"").replace(/^@/,"").trim();return s?`@${s}`:""}function ts({label:t,children:s,mode:n="click",avatar:r,name:o,handle:a,description:i,actions:c,className:d="",popoverClassName:f="",...u}){const b=l.useId(),_=l.useRef(null),p=l.useRef(null),w=l.useRef(null),[x,S]=l.useState(!1),[y,T]=l.useState(null),R=s!=null,h=o||t||"",E=Ve(t||o),k=Ve(a),L=l.useCallback(()=>{w.current!=null&&(window.clearTimeout(w.current),w.current=null)},[]),I=l.useCallback(()=>{L(),S(!0)},[L]),M=l.useCallback(()=>{L(),w.current=window.setTimeout(()=>S(!1),es)},[L]),O=l.useCallback(()=>{const z=_.current,j=p.current;if(!z)return;const v=z.getBoundingClientRect(),N=(j==null?void 0:j.offsetHeight)??160,$=(j==null?void 0:j.offsetWidth)??260;let P=v.bottom+Ue;P+N>window.innerHeight-we&&(P=Math.max(we,v.top-N-Ue));const F=Math.max(we,Math.min(v.left,window.innerWidth-$-we));T({top:P,left:F})},[]);l.useLayoutEffect(()=>{x&&O()},[x,O]),l.useEffect(()=>{if(!x)return;const z=()=>O(),j=N=>{N.key==="Escape"&&S(!1)},v=N=>{var P,F;if(n==="hover")return;const $=N.target;(P=p.current)!=null&&P.contains($)||(F=_.current)!=null&&F.contains($)||S(!1)};return window.addEventListener("scroll",z,!0),window.addEventListener("resize",z),document.addEventListener("keydown",j),document.addEventListener("mousedown",v),()=>{window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z),document.removeEventListener("keydown",j),document.removeEventListener("mousedown",v)}},[x,O,n]),l.useEffect(()=>()=>L(),[L]);const A=n==="hover"?{onMouseEnter:I,onMouseLeave:M}:{},U=x?te.createPortal(e.jsxs("div",{ref:p,id:b,role:"dialog","aria-label":h||E||"Mention","data-ds-portal":"",className:["ds-mention__popover",f].filter(Boolean).join(" "),style:y?{top:y.top,left:y.left}:{top:-9999,left:-9999,visibility:"hidden"},...A,children:[(r||h||k)&&e.jsxs("div",{className:"ds-mention__head",children:[r,(h||k)&&e.jsxs("div",{className:"ds-mention__meta",children:[h?e.jsx("span",{className:"ds-mention__name",children:h}):null,k?e.jsx("span",{className:"ds-mention__handle",children:k}):null]})]}),i?e.jsx("p",{className:"ds-mention__desc",children:i}):null,c?e.jsx("div",{className:"ds-mention__actions",onClick:()=>S(!1),children:c}):null]}),document.body):null;return e.jsxs(e.Fragment,{children:[e.jsx("button",{...u,ref:_,type:"button",className:["ds-mention",R&&"ds-mention--custom",d].filter(Boolean).join(" "),"aria-expanded":x,"aria-haspopup":"dialog","aria-label":R&&(E||h)||void 0,"aria-controls":x?b:void 0,onClick:z=>{var j;if((j=u.onClick)==null||j.call(u,z),!z.defaultPrevented){if(z.preventDefault(),z.stopPropagation(),n==="hover"){I();return}S(v=>!v)}},...A,children:R?s:E}),typeof document<"u"?U:null]})}function ss({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:o,id:a,...i}){const c=a||`toggle-${l.useId()}`,d=["ds-toggle",`ds-toggle--${n}`,r&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:d,htmlFor:c,children:[e.jsx("input",{type:"checkbox",id:c,className:"ds-toggle__input",checked:t,onChange:f=>s==null?void 0:s(f.target.checked),disabled:r,...i}),e.jsx("span",{className:"ds-toggle__track",children:e.jsx("span",{className:"ds-toggle__thumb"})}),o&&e.jsx("span",{className:"ds-toggle__label",children:o})]})}function ns({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:o,id:a,...i}){const c=a||`checkbox-${l.useId()}`,d=["ds-checkbox",`ds-checkbox--${n}`,r&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=n==="xs"?10:n==="small"?14:n==="large"?20:16;return e.jsxs("label",{className:d,htmlFor:c,children:[e.jsx("input",{type:"checkbox",id:c,className:"ds-checkbox__input",checked:t,onChange:u=>s==null?void 0:s(u.target.checked),disabled:r,...i}),e.jsx("span",{className:"ds-checkbox__box",children:t&&e.jsx(C.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),o&&e.jsx("span",{className:"ds-checkbox__label",children:o})]})}function rs({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:o,name:a,value:i,id:c,...d}){const f=c||`radio-${l.useId()}`,u=["ds-radio",`ds-radio--${n}`,r&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:u,htmlFor:f,children:[e.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:t,onChange:b=>s==null?void 0:s(b.target.checked),disabled:r,name:a,value:i,...d}),e.jsx("span",{className:"ds-radio__circle",children:e.jsx("span",{className:"ds-radio__dot"})}),o&&e.jsx("span",{className:"ds-radio__label",children:o})]})}function nt({width:t,height:s,shape:n="rect",aspectRatio:r,className:o="",style:a={},...i}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${n}`,o].filter(Boolean).join(" "),style:{width:t,height:s,aspectRatio:r,...a},"aria-hidden":"true",...i})}function os({lines:t=1,lastLineWidth:s="70%",gap:n,className:r="",style:o={},...a}){return e.jsx("span",{className:["ds-skeleton-text",r].filter(Boolean).join(" "),style:{gap:n,...o},"aria-hidden":"true",...a,children:Array.from({length:t},(i,c)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:c===t-1&&t>1?{width:s}:void 0},c))})}nt.Text=os;function as(t){let s=2166136261;for(let n=0;n<t.length;n++)s^=t.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s%360}function is(t){if(!t)return"";const s=t.trim().split(/\s+/);return s.length>=2?(s[0][0]+s[1][0]).toUpperCase():t[0].toUpperCase()}function ls({seed:t,icon:s,src:n,size:r=32,className:o="",style:a={},...i}){const c=as(t??""),[d,f]=l.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:is(t)});return e.jsx("div",{className:["ds-avatar",o].filter(Boolean).join(" "),style:{width:r,height:r,"--ds-avatar-h":c,...a},"aria-hidden":"true",...i,children:n&&!d?e.jsx("img",{src:n,alt:"",onError:()=>f(!0)}):u})}function cs({children:t,size:s="compact",stickyTop:n,maxHeight:r,className:o="",style:a={},...i}){const c={...r?{maxHeight:r}:{},...n!==void 0?{"--ds-table-sticky-top":typeof n=="number"?`${n}px`:n}:{},...a};return e.jsx("div",{className:["ds-table-wrap","ds-scrollable",r?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:c,children:e.jsx("table",{className:["ds-table",`ds-table--${s}`,o].filter(Boolean).join(" "),...i,children:t})})}function ds({children:t,...s}){return e.jsx("thead",{...s,children:t})}function us({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function fs({children:t,interactive:s,selected:n,subheader:r,exiting:o,updated:a,className:i="",onClick:c,...d}){return e.jsx("tr",{className:["ds-table-row",s||c?"ds-table-row--interactive":"",n?"ds-table-row--selected":"",r?"ds-table-row--subheader":"",o?"ds-table-row--exiting":"",a?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:c,...d,children:t})}function ms({children:t,colSpan:s=999,...n}){return e.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...n,children:e.jsx("td",{colSpan:s,children:t})})}function ps({children:t,align:s="left",sortDir:n,onSort:r,width:o,className:a="",style:i={},...c}){const d=!!r||n!==void 0,f=n==="asc"?C.ChevronUp:n==="desc"?C.ChevronDown:C.ChevronsUpDown;return e.jsx("th",{className:["ds-th",d?"ds-th--sortable":"",n?"ds-th--sorted":"",s!=="left"?`ds-table-cell--${s}`:"",a].filter(Boolean).join(" "),onClick:r,style:{width:o,...i},...c,children:d?e.jsxs("span",{className:"ds-th__inner",children:[t,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function hs({children:t,align:s="left",secondary:n,muted:r,truncate:o,nowrap:a,className:i="",...c}){return e.jsx("td",{className:["ds-td",s!=="left"?`ds-table-cell--${s}`:"",n?"ds-table-cell--secondary":"",r?"ds-table-cell--muted":"",o?"ds-table-cell--truncate":"",a?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...c,children:t})}function xs({icon:t,title:s,description:n,action:r,size:o="m",className:a="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${o}`,a].filter(Boolean).join(" "),...i,children:[t&&e.jsx("div",{className:"ds-empty-state__icon",children:t}),e.jsx("div",{className:"ds-empty-state__title",children:s}),n&&e.jsx("div",{className:"ds-empty-state__description",children:n}),r&&e.jsx("div",{className:"ds-empty-state__action",children:r})]})}function vs({label:t,hint:s,error:n,required:r=!1,disabled:o=!1,htmlFor:a,children:i,className:c="",style:d,...f}){const u=l.useId(),b=a??u,_=`${b}-hint`,p=`${b}-error`;return e.jsxs("div",{className:`ds-field${c?` ${c}`:""}`,"data-state":n?"error":void 0,"data-required":r?"":void 0,"data-disabled":o?"":void 0,style:d,...f,children:[t&&e.jsx("label",{className:"ds-field-label",htmlFor:b,children:t}),e.jsx("div",{className:"ds-field-control",children:i}),s&&!n&&e.jsx("p",{className:"ds-field-hint",id:_,children:s}),n&&e.jsx("p",{className:"ds-field-error",id:p,role:"alert",children:n})]})}function bs({label:t,value:s,delta:n,size:r="m",inline:o=!1,className:a="",style:i,...c}){const d=n!=null&&n.startsWith("+")?"up":n!=null&&n.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${r}`,o&&"ds-stat--inline",a].filter(Boolean).join(" "),style:i,...c,children:[t&&e.jsx("span",{className:"ds-stat-label",children:t}),s!=null&&e.jsx("span",{className:"ds-stat-value",children:s}),n!=null&&e.jsx("span",{className:`ds-stat-delta ds-stat-delta--${d}`,children:n})]})}function _s({children:t,separator:s="/","aria-label":n,className:r="",style:o,...a}){const i=G(),c=l.Children.toArray(t).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${r?` ${r}`:""}`,"aria-label":n??i.breadcrumb,style:o,...a,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:c.map((d,f)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[d,f<c.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:s})]},f))})})}function js({page:t,total:s,onChange:n,siblings:r=1,"aria-label":o,previousLabel:a,nextLabel:i,className:c="",style:d,...f}){const u=G(),{t:b}=ue(),_=gs(t,s,r);return e.jsxs("nav",{className:`ds-pagination${c?` ${c}`:""}`,"aria-label":o??u.pagination,style:d,...f,children:[e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t-1),disabled:t<=1,"aria-label":a??u.previousPage,children:e.jsx(C.ChevronLeft,{size:16})}),_.map((p,w)=>p==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${w}`):e.jsx("button",{className:`ds-pagination-page${p===t?" ds-pagination-page--current":""}`,onClick:()=>p!==t&&(n==null?void 0:n(p)),"aria-current":p===t?"page":void 0,"aria-label":b("pageN",{n:p}),children:p},p)),e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t+1),disabled:t>=s,"aria-label":i??u.nextPage,children:e.jsx(C.ChevronRight,{size:16})})]})}function gs(t,s,n){if(s<=7)return Array.from({length:s},(i,c)=>c+1);const r=Math.max(2,t-n),o=Math.min(s-1,t+n),a=[1];r>2&&a.push("…");for(let i=r;i<=o;i++)a.push(i);return o<s-1&&a.push("…"),a.push(s),a}const ws=300;function Ns({children:t,title:s,onClose:n,subHeader:r,side:o="right",size:a="wide",offsetLeft:i=0,offsetRight:c=0,keepOpenRef:d,closeLabel:f,...u}){const b=G(),_=l.useRef(null),p=l.useId(),[w,x]=l.useState(!1),S=l.useRef(null),y=()=>{!n||w||(x(!0),S.current=setTimeout(()=>{x(!1),n()},ws))};l.useEffect(()=>()=>clearTimeout(S.current),[]),l.useEffect(()=>{const k=I=>{I.key==="Escape"&&y()},L=I=>{var O,A;const M=Pe(I);M&&((O=d==null?void 0:d.current)!=null&&O.contains(M)||(A=_.current)!=null&&A.contains(M)||Ce(M,null)||y())};return document.addEventListener("keydown",k),document.addEventListener("mousedown",L),()=>{document.removeEventListener("keydown",k),document.removeEventListener("mousedown",L)}},[n,w,d]);const T=l.Children.toArray(t),R=T.find(k=>(k==null?void 0:k.type)===Ae||(k==null?void 0:k.type)===de),h=T.filter(k=>(k==null?void 0:k.type)!==Ae&&(k==null?void 0:k.type)!==de),E=e.jsx("div",{className:["ds-side-page-overlay",w&&"ds-side-page-overlay--closing"].filter(Boolean).join(" "),"data-side":o,style:{"--ds-side-page-offset-left":`${i}px`,"--ds-side-page-offset-right":`${c}px`},...u,children:e.jsxs("div",{ref:_,className:["ds-side-page",w&&"ds-side-page--closing"].filter(Boolean).join(" "),"data-surface":"2","data-side":o,"data-size":a,role:"dialog","aria-modal":"true","aria-labelledby":s?p:void 0,children:[n&&e.jsx(re,{className:"ds-side-page__close",variant:"ghost",size:"small",icon:e.jsx(C.X,{size:q[2],strokeWidth:1.5}),onClick:y,"aria-label":f??b.close}),(s||r)&&e.jsxs("div",{className:"ds-side-page__header",children:[s&&e.jsx("h3",{id:p,className:"ds-side-page__title",children:s}),r&&e.jsx("div",{className:"ds-side-page__subheader",children:r})]}),e.jsx("div",{className:"ds-side-page__body ds-scrollable",children:h}),R]})});return typeof document>"u"?E:te.createPortal(E,document.body)}function Ae({children:t}){return!t||l.Children.count(t)===0?null:e.jsx("div",{className:"ds-side-page__footer",children:t})}const pe=l.createContext({collapsed:!1,side:"left"}),Ee=l.createContext(!1),ys=l.forwardRef(function({children:s,collapsed:n=!1,side:r="left",onExpand:o,onCollapse:a,className:i="",...c},d){const f=["ds-nav-rail",n&&"ds-nav-rail--collapsed",`ds-nav-rail--${r}`,i].filter(Boolean).join(" "),u=l.useCallback(b=>{if(!b.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')){if(n&&o){o();return}!n&&a&&a()}},[n,o,a]);return e.jsx(pe.Provider,{value:{collapsed:n,side:r},children:e.jsx("nav",{ref:d,className:f,onClick:u,"data-expandable":n&&o?"":void 0,"data-collapsible":!n&&a?"":void 0,...c,children:s})})});function ks({icon:t,label:s,selected:n=!1,disabled:r=!1,href:o,onClick:a,count:i,updated:c=!1,open:d=!1,onboarding:f=!1,className:u="",...b}){const{collapsed:_,side:p}=l.useContext(pe),w=l.useContext(Ee),y={className:["ds-nav-rail__item",u].filter(Boolean).join(" "),onClick:r?void 0:a,"aria-current":n?"page":void 0,"aria-disabled":r?"true":void 0,"aria-label":_?s:void 0,tabIndex:r?-1:void 0,...{"data-selected":n||void 0,"data-disabled":r||void 0,"data-open":d||void 0,"data-onboarding":f||void 0},...b},T=i!=null,R=p==="left"?"right":"left",h=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!_&&e.jsx("span",{className:"ds-nav-rail__label",children:s}),!_&&T&&e.jsx("span",{className:["ds-nav-rail__count",i===0&&"ds-nav-rail__count--zero"].filter(Boolean).join(" "),"data-updated":c&&i!==0||void 0,children:i}),!_&&c&&(!T||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),_&&T&&i!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":c||void 0,children:i>99?"99+":i}),_&&c&&(!T||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),E=o?e.jsx("a",{href:r?void 0:o,...y,children:h}):e.jsx("button",{type:"button",...y,children:h});return _&&!w?e.jsx(ke,{content:s,position:R,children:E}):E}function Es({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function Rs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function Ss({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function Ts({className:t="",...s}){return e.jsx("hr",{className:["ds-nav-rail__divider",t].filter(Boolean).join(" "),...s})}function $s({children:t,label:s,defaultOpen:n=!0,className:r="",...o}){const{collapsed:a}=l.useContext(pe),i=G(),c=s??i.recents,[d,f]=l.useState(n);return e.jsxs("div",{className:["ds-nav-rail__recents",r].filter(Boolean).join(" "),...o,children:[!a&&e.jsxs("button",{type:"button",className:["ds-nav-rail__recents-toggle",!d&&"ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),onClick:()=>f(u=>!u),"aria-expanded":d,children:[e.jsx("span",{className:"ds-nav-rail__recents-label",children:c}),e.jsx(C.ChevronDown,{size:12,strokeWidth:2,className:"ds-nav-rail__recents-chevron","aria-hidden":"true"})]}),(d||a)&&e.jsx("div",{className:"ds-nav-rail__recents-body",children:t})]})}const As=l.forwardRef(function({as:s="button",avatar:n,label:r,className:o="",...a},i){const{collapsed:c,side:d}=l.useContext(pe),f=l.useContext(Ee),u=d==="left"?"right":"left",b=["ds-nav-rail__item","ds-nav-rail__agent",o].filter(Boolean).join(" "),_=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:n}),!c&&e.jsx("span",{className:"ds-nav-rail__label",children:r})]}),p=e.jsx(s,{ref:i,className:b,"aria-label":c?r:void 0,...s==="button"?{type:"button"}:{},...a,children:_});return c&&!f?e.jsx(ke,{content:r,position:u,children:p}):p});function Ls({avatar:t,label:s,selected:n=!1,disabled:r=!1,href:o,onClick:a,className:i="",...c}){const{collapsed:d,side:f}=l.useContext(pe),u=l.useContext(Ee),p={className:["ds-nav-rail__item","ds-nav-rail__agent",i].filter(Boolean).join(" "),onClick:r?void 0:a,"aria-current":n?"page":void 0,"aria-disabled":r?"true":void 0,tabIndex:r?-1:void 0,...{"data-selected":n||void 0,"data-disabled":r||void 0},...c},w=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!d&&e.jsx("span",{className:"ds-nav-rail__label",children:s})]}),x=f==="left"?"right":"left",S=o?e.jsx("a",{href:r?void 0:o,...p,children:w}):e.jsx("button",{type:"button",...p,children:w});return d&&!u?e.jsx(ke,{content:s,position:x,children:S}):S}const qe=240,Xe=6,Ye=8;function Bs({trigger:t,title:s,children:n,open:r,onOpenChange:o,defaultOpen:a=!1,closeLabel:i}){const c=G(),{side:d}=l.useContext(pe),[f,u]=l.useState(a),b=r!==void 0,_=b?r:f,[p,w]=l.useState(!1),x=l.useRef(null),S=l.useRef(null),[y,T]=l.useState({}),R=l.useCallback(()=>{b?o==null||o(!0):u(!0)},[b,o]),h=l.useCallback(()=>{b?o==null||o(!1):u(!1)},[b,o]),E=l.useCallback(()=>_?h():R(),[_,R,h]),k=l.useCallback(()=>{var z;const I=x.current;if(!I)return;const M=I.getBoundingClientRect(),O=window.innerHeight,A=((z=S.current)==null?void 0:z.offsetHeight)??300,U=Math.max(Ye,Math.min(O-A-Ye,M.top));T(d==="right"?{position:"fixed",top:U,right:window.innerWidth-M.left+Xe,width:qe}:{position:"fixed",top:U,left:M.right+Xe,width:qe})},[d]);l.useEffect(()=>{if(!_){w(!1);return}return k(),requestAnimationFrame(()=>w(!0)),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[_,k]),l.useEffect(()=>{if(!_)return;const I=O=>{var A,U;!((A=S.current)!=null&&A.contains(O.target))&&!((U=x.current)!=null&&U.contains(O.target))&&h()},M=O=>{O.key==="Escape"&&h()};return document.addEventListener("mousedown",I),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",M)}},[_,h]);const L=_&&e.jsxs("div",{ref:S,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,p&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:y,"data-ds-portal":"",role:"dialog","aria-modal":"false",children:[s!=null&&e.jsxs("div",{className:"ds-nav-rail-flyout__header",children:[e.jsx("span",{className:"ds-nav-rail-flyout__title",children:s}),e.jsx("button",{type:"button",className:"ds-nav-rail-flyout__close",onClick:h,"aria-label":i??c.close,children:e.jsx(C.X,{size:16,strokeWidth:2})})]}),e.jsx("div",{className:"ds-nav-rail-flyout__body",children:n})]});return e.jsxs(e.Fragment,{children:[e.jsx(Ee.Provider,{value:_,children:e.jsx("div",{ref:x,onClick:E,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&te.createPortal(L,document.body)]})}const Is={info:C.Info,success:C.CheckCircle,warning:C.AlertTriangle,error:C.XCircle};function Ds({children:t,variant:s="info",action:n,onAction:r,onDismiss:o,role:a,dismissLabel:i,...c}){const d=G(),f=Is[s],u=a||(s==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${s}`,role:u,...c,children:[f&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(f,{size:q[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:t}),n&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:r,children:n}),o&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:o,"aria-label":i??d.dismiss,children:e.jsx(C.X,{size:q[2],strokeWidth:1.5})})]})}function Ps({trigger:t,items:s=[],open:n,onOpenChange:r,align:o="left",fullWidth:a=!1,className:i="",style:c,...d}){const[f,u]=l.useState(!1),[b,_]=l.useState(!1),p=n!==void 0,w=p?n:f,x=l.useRef(null),S=l.useRef(null),y=l.useRef(null),T=l.useRef(null),[R,h]=l.useState({}),E=l.useRef(null),k=150,L=()=>{if(p)r==null||r(!1);else{if(b)return;_(!0),E.current=setTimeout(()=>{u(!1),_(!1)},k)}},I=()=>{const v=!w;p?r==null||r(v):v?(clearTimeout(E.current),_(!1),u(!0)):L()},M=()=>{w||(p?r==null||r(!0):(clearTimeout(E.current),_(!1),u(!0)))};l.useEffect(()=>()=>clearTimeout(E.current),[]),l.useEffect(()=>{if(!w)return;const v=300,N=()=>{var W;const $=(W=x.current)==null?void 0:W.getBoundingClientRect();if(!$)return;const P=window.innerHeight-$.bottom,F=P<v+8&&$.top>P;h(o==="right"?F?{bottom:window.innerHeight-$.top+4,top:"auto",right:window.innerWidth-$.right}:{top:$.bottom+4,bottom:"auto",right:window.innerWidth-$.right}:F?{bottom:window.innerHeight-$.top+4,top:"auto",left:$.left}:{top:$.bottom+4,bottom:"auto",left:$.left})};return N(),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[w,o]);const O=()=>{var N;const v=(N=y.current)==null?void 0:N.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');v==null||v.focus()};l.useEffect(()=>{if(!w)return;const v=$=>{var P,F;!((P=x.current)!=null&&P.contains($.target))&&!((F=S.current)!=null&&F.contains($.target))&&L()},N=$=>{$.key==="Escape"&&(L(),O())};return document.addEventListener("mousedown",v),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",N)}},[w]),l.useEffect(()=>{if(!w||!T.current||!S.current)return;const v=A(),N=T.current==="last"?v[v.length-1]:v[0];N==null||N.focus(),T.current=null},[w]);const A=()=>S.current?[...S.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],U=v=>{var N,$;if(v.key==="ArrowDown")v.preventDefault(),w?(N=A()[0])==null||N.focus():(T.current="first",M());else if(v.key==="ArrowUp")if(v.preventDefault(),!w)T.current="last",M();else{const P=A();($=P[P.length-1])==null||$.focus()}},z=v=>{var P,F,W,m;const N=A(),$=N.findIndex(g=>g===document.activeElement);switch(v.key){case"ArrowDown":v.preventDefault(),(P=N[Math.min($+1,N.length-1)])==null||P.focus();break;case"ArrowUp":v.preventDefault(),$<=0?O():(F=N[$-1])==null||F.focus();break;case"Home":v.preventDefault(),(W=N[0])==null||W.focus();break;case"End":v.preventDefault(),(m=N[N.length-1])==null||m.focus();break;case"Tab":L();break}},j=w&&e.jsx("div",{ref:S,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${o}`,b&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:R,onKeyDown:z,children:s.map((v,N)=>{if(v.separator)return e.jsx("div",{className:"ds-dropdown__separator"},N);if(v.type==="section")return e.jsxs("div",{className:"ds-dropdown__section",children:[v.label&&e.jsx("div",{className:"ds-dropdown__section-label",children:v.label}),e.jsx("div",{className:"ds-dropdown__section-content",children:v.content})]},N);const $=!!v.href,P=$?"a":"button",F=$?{href:v.disabled?void 0:v.href,"aria-disabled":v.disabled?"true":void 0}:{type:"button",disabled:v.disabled};return e.jsxs(P,{role:"menuitem",className:["ds-dropdown__item",v.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...F,onClick:()=>{var W;(W=v.onClick)==null||W.call(v),L()},children:[v.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:v.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:v.label}),v.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:v.shortcut})]},N)})});return e.jsxs("div",{ref:x,className:["ds-dropdown",a&&"ds-dropdown--full-width",i].filter(Boolean).join(" "),style:c,...d,children:[e.jsx("div",{ref:y,className:"ds-dropdown__trigger",onClick:I,onKeyDown:U,children:t}),typeof document<"u"&&te.createPortal(j,document.body)]})}function Cs({value:t=0,size:s="m",variant:n="default",showValue:r=!1,min:o=2,animate:a=!0}){const i=Math.min(100,Math.max(0,t)),c=Math.max(o,i),d=n==="auto"?i>=70?"success":i>=50?"warning":"danger":n;return e.jsxs("div",{className:["ds-progress",`ds-progress--${s}`,!a&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[e.jsx("div",{className:"ds-progress__track",children:e.jsx("div",{className:`ds-progress__fill ds-progress__fill--${d}`,style:{width:`${c}%`}})}),r&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const Ms=t=>1-Math.pow(1-t,3),Fs=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function rt(t,{duration:s=600}={}){const[n,r]=l.useState(t),o=l.useRef(t),a=l.useRef(null);return l.useEffect(()=>{if(Fs()){r(t),o.current=t;return}const i=o.current,c=t-i;if(c===0)return;let d=null;const f=u=>{d||(d=u);const b=Math.min((u-d)/s,1);r(i+c*Ms(b)),b<1?a.current=requestAnimationFrame(f):o.current=t};return a.current=requestAnimationFrame(f),()=>cancelAnimationFrame(a.current)},[t,s]),n}function zs({value:t,duration:s=600,decimals:n=0,prefix:r="",suffix:o=""}){const i=rt(t,{duration:s}).toFixed(n);return`${r}${i}${o}`}function ot({threshold:t=.1,rootMargin:s="0px",once:n=!1}={}){const r=l.useRef(null),[o,a]=l.useState(!1);return l.useEffect(()=>{const i=r.current;if(!i)return;const c=new IntersectionObserver(([d])=>{d.isIntersecting?(a(!0),n&&c.disconnect()):n||a(!1)},{threshold:t,rootMargin:s});return c.observe(i),()=>c.disconnect()},[t,s,n]),{ref:r,inView:o}}function Ws({children:t,as:s="div",once:n=!1,threshold:r=.1,rootMargin:o="0px",onEnter:a,onLeave:i,...c}){const{ref:d,inView:f}=ot({threshold:r,rootMargin:o,once:n}),u=l.useRef(!1);return l.useEffect(()=>{f&&!u.current&&(a==null||a()),!f&&u.current&&(i==null||i()),u.current=f},[f]),e.jsx(s,{ref:d,...c,children:typeof t=="function"?t(f):t})}const Ge={default:C.Info,success:C.CheckCircle,warning:C.AlertTriangle,error:C.XCircle};let me=[];const Le=new Set;function at(){Le.forEach(t=>t([...me]))}function Os(t){me=[...me,t],at()}function Hs(t){me=me.filter(s=>s.id!==t),at()}function Us(){const t=(s,n={})=>{Os({id:`${Date.now()}-${Math.random()}`,message:s,type:"default",duration:4e3,...n})};return t.success=(s,n)=>t(s,{...n,type:"success"}),t.error=(s,n)=>t(s,{...n,type:"error"}),t.warning=(s,n)=>t(s,{...n,type:"warning"}),{toast:t}}function Vs({data:t,onDismiss:s}){const n=G(),[r,o]=l.useState(!1),a=l.useRef(null),i=l.useRef(null);l.useEffect(()=>(requestAnimationFrame(()=>o(!0)),t.duration>0&&(a.current=setTimeout(()=>c(),t.duration)),()=>{clearTimeout(a.current),clearTimeout(i.current)}),[]);function c(){o(!1),i.current=setTimeout(()=>s(t.id),250)}const d=Ge[t.type]??Ge.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[e.jsx("div",{className:"ds-toast__icon",children:e.jsx(d,{size:q[3],strokeWidth:1.5})}),e.jsx("span",{className:"ds-toast__message",children:t.message}),e.jsx("button",{className:"ds-toast__close",onClick:c,"aria-label":n.close,children:e.jsx(C.X,{size:q[3],strokeWidth:1.5})})]})}function qs({position:t="bottom-right"}){const[s,n]=l.useState(()=>[...me]);return l.useEffect(()=>(Le.add(n),()=>Le.delete(n)),[]),!s.length||typeof document>"u"?null:te.createPortal(e.jsx("div",{"data-ds-portal":"",className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:s.map(r=>e.jsx(Vs,{data:r,onDismiss:Hs},r.id))}),document.body)}const Xs={running:e.jsx(ce,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(ce,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(ce,{size:"xs",variant:"error",children:"Error"})};function it({label:t,status:s="idle",icon:n,badge:r,defaultExpanded:o=!1,expanded:a,onToggle:i,children:c,className:d="",...f}){const u=s==="running",b=e.jsxs("span",{className:"ds-tool-card__title-row",children:[n&&e.jsx("span",{className:"ds-tool-card__icon",children:n}),e.jsx("span",{className:"ds-tool-card__label",children:t}),Xs[s],r]});return c?e.jsx("div",{className:["ds-tool-card",u&&"ds-tool-card--running",d].filter(Boolean).join(" "),...f,children:e.jsx(ye,{title:b,padding:"s",defaultExpanded:o,expanded:u?!1:a,onToggle:u?void 0:i,children:e.jsx("div",{className:"ds-tool-card__body",children:c})})}):e.jsx("div",{className:["ds-tool-card","ds-tool-card--bubble",d].filter(Boolean).join(" "),...f,children:b})}function lt({text:t,size:s="xs",timeout:n=800,"aria-label":r,...o}){const a=G(),[i,c]=l.useState(!1),d=l.useRef(null),f=u=>{u.currentTarget.blur(),navigator.clipboard.writeText(t).then(()=>{c(!0),clearTimeout(d.current),d.current=setTimeout(()=>c(!1),n)})};return l.useEffect(()=>()=>clearTimeout(d.current),[]),e.jsx(re,{variant:"ghost",size:s,state:i?"success":"idle",icon:e.jsx(C.Copy,{size:q[1],strokeWidth:1.5}),"aria-label":r??a.copyToClipboard,onClick:f,...o})}function Ys({content:t,streaming:s=!1,...n}){const[r,o]=l.useState(s);return l.useEffect(()=>{o(!!s)},[s]),e.jsx(ye,{expanded:r,onToggle:o,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(C.Brain,{size:q[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(tt,{secondary:!0,children:"Thinking"})]}),...n,children:e.jsxs(De,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[t,s&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Gs({count:t,current:s=0,done:n=[],onChange:r,showCounter:o=!0,className:a="","aria-label":i,...c}){const d=G(),{t:f}=ue();return e.jsxs("div",{className:["ds-step-indicator",a].filter(Boolean).join(" "),...c,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i??d.steps,children:Array.from({length:t},(u,b)=>{const _=b===s,p=n.includes(b)&&!_,w=r&&(b<=s||n.includes(b)),x=["ds-step-indicator__dot",_&&"ds-step-indicator__dot--active",p&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:x,role:"tab","aria-selected":_,"aria-label":f("stepN",{n:b+1}),disabled:!w||b===s,onClick:()=>r==null?void 0:r(b),children:p?e.jsx(C.Check,{size:8,strokeWidth:3}):null},b)})}),o&&e.jsxs(De,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function Ks({content:t,isStreaming:s=!1,cursor:n="line",onChunk:r,className:o="",...a}){const i=l.useRef(t);return l.useEffect(()=>{t!==i.current&&(r==null||r(t),i.current=t)},[t,r]),e.jsxs("span",{className:["ds-streaming-text",o].filter(Boolean).join(" "),...a,children:[t,s&&n!=="none"&&e.jsx("span",{className:`ds-cursor ds-cursor--${n}`,"aria-hidden":"true"})]})}function Js({role:t="assistant",header:s,footer:n,attachments:r,isStreaming:o=!1,children:a,className:i="",...c}){const d=["ds-chat-message",`ds-chat-message--${t}`,o&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return t==="system"?e.jsx("div",{className:d,...c,children:e.jsx("span",{className:"ds-chat-message__system-label",children:a})}):t==="user"?e.jsxs("div",{className:d,...c,children:[r&&e.jsx("div",{className:"ds-chat-message__attachments",children:r}),e.jsx("div",{className:"ds-chat-message__bubble",children:a}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]}):e.jsxs("div",{className:d,...c,children:[s&&e.jsx("div",{className:"ds-chat-message__header",children:s}),r&&e.jsx("div",{className:"ds-chat-message__attachments",children:r}),e.jsx("div",{className:"ds-chat-message__body",children:a}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]})}function Zs(t,{containerRef:s,smartPause:n=!0}={}){const r=l.useRef(!1),o=l.useRef(0);l.useEffect(()=>{const a=s==null?void 0:s.current;if(!a)return;const i=()=>{const c=a.scrollHeight-a.scrollTop-a.clientHeight<64;!c&&a.scrollTop<o.current&&(r.current=!0),c&&(r.current=!1),o.current=a.scrollTop};return a.addEventListener("scroll",i,{passive:!0}),()=>a.removeEventListener("scroll",i)},[s]),l.useEffect(()=>{const a=s==null?void 0:s.current;a&&(n&&r.current||(a.scrollTop=a.scrollHeight))},t)}function ct({prompts:t,enabled:s,typingSpeed:n=38,erasingSpeed:r=18,holdTime:o=2200,betweenTime:a=380,manualPauseMs:i=5e3}){const[c,d]=l.useState(0),[f,u]=l.useState(""),b=l.useRef("typing"),_=l.useRef(0),p=l.useRef(0),w=l.useRef(null),x=l.useRef(0);l.useEffect(()=>{p.current=c},[c]),l.useEffect(()=>{if(w.current&&(clearTimeout(w.current),w.current=null),!s||t.length===0){u(""),_.current=0,b.current="typing";return}const h=()=>{const E=Date.now();if(x.current>E){w.current=setTimeout(h,x.current-E);return}const k=t[p.current%t.length]??"";b.current==="typing"?(_.current+=1,u(k.slice(0,_.current)),_.current>=k.length?(b.current="holding",w.current=setTimeout(h,o)):w.current=setTimeout(h,n+Math.random()*28)):b.current==="holding"?(b.current="erasing",w.current=setTimeout(h,r)):(_.current=Math.max(0,_.current-1),u(k.slice(0,_.current)),_.current<=0?(b.current="typing",p.current=(p.current+1)%t.length,d(p.current),w.current=setTimeout(h,a)):w.current=setTimeout(h,r))};return w.current=setTimeout(h,260),()=>{w.current&&clearTimeout(w.current)}},[s,t,n,r,o,a]);const S=h=>{if(t.length===0)return;const E=(h%t.length+t.length)%t.length,k=t[E];p.current=E,_.current=k.length,b.current="holding",x.current=Date.now()+i,d(E),u(k)},y=()=>S(p.current+1),T=()=>S(p.current-1),R=t[c%t.length]??"";return{displayed:f,currentPrompt:R,index:c,next:y,prev:T}}let Qs=0;function en({value:t="",onChange:s,onSubmit:n,onStop:r,onKeyDown:o,loading:a=!1,disabled:i=!1,placeholder:c,animatedPlaceholders:d,attachments:f,images:u,onAttachFiles:b,onAttachImages:_,onRemoveAttachment:p,onRemoveImage:w,acceptImage:x,acceptFile:S,maxImages:y,maxImageSize:T,leftSlot:R,rightSlot:h,className:E="",...k}){const L=G(),{t:I}=ue(),M=l.useRef(null),O=l.useRef(null),A=l.useRef(0),[U,z]=l.useState(!1),[j,v]=l.useState([]),N=l.useRef(new Set),$=c??L.promptPlaceholder,P=B=>{const H=++Qs;v(Z=>[...Z,{id:H,msg:B}]);const J=setTimeout(()=>{N.current.delete(J),v(Z=>Z.filter(ee=>ee.id!==H))},6e3);N.current.add(J)};l.useEffect(()=>{const B=N.current;return()=>B.forEach(clearTimeout)},[]);const F=B=>v(H=>H.filter(J=>J.id!==B)),W=B=>B.type.startsWith("image/"),m=()=>!0,g=x??W,D=S??m,V=B=>{const H=[],J=[],Z=[],ee=[];let se=0,le=y!=null?y-((u==null?void 0:u.length)??0):1/0;for(const ne of B)g(ne)?T&&ne.size>T?Z.push(ne.name):le>0?(H.push(ne),le--):se++:D(ne)?J.push(ne):ee.push(ne.name);return{imageFiles:H,docFiles:J,tooLarge:Z,skipped:ee,limitExceeded:se}},X=B=>{const H=T?I("fileTooLargeMaxHint",{maxMb:T/1024/1024}):"";P(I("fileTooLarge",{maxHint:H,names:B.join(", ")}))},K=B=>{const{imageFiles:H,docFiles:J,tooLarge:Z,skipped:ee,limitExceeded:se}=V(B);Z.length&&X(Z),ee.length&&P(I("filesSkipped",{names:ee.join(", ")})),se&&P(I("maxImages",{n:y})),_&&H.length&&_(H);const le=J.concat(_?[]:H);b&&le.length&&b(le)};l.useEffect(()=>{const B=O.current;B&&(B.style.height="auto",B.style.height=`${Math.min(B.scrollHeight,200)}px`)},[t]),l.useEffect(()=>{const B=H=>{var Z,ee,se;if(a||i)return;const J=(Z=H.target)==null?void 0:Z.tagName;J==="INPUT"||J==="TEXTAREA"||J==="SELECT"||(ee=H.target)!=null&&ee.isContentEditable||H.ctrlKey||H.metaKey||H.altKey||H.key.length!==1&&H.key!=="Backspace"&&H.key!=="Delete"||(se=O.current)==null||se.focus()};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[a,i]);const Y=B=>{B.preventDefault(),A.current++,B.dataTransfer.types.includes("Files")&&z(!0)},Q=B=>{B.preventDefault(),A.current--,A.current===0&&z(!1)},ie=B=>B.preventDefault(),he=B=>{B.preventDefault(),A.current=0,z(!1);const H=Array.from(B.dataTransfer.files);H.length&&K(H)},Re=B=>{const H=Array.from(B.target.files||[]);M.current&&(M.current.value=""),H.length&&K(H)},ut=B=>{var ne;if(!_)return;const H=(ne=B.clipboardData)==null?void 0:ne.items;if(!H)return;const J=[];for(const pt of H){const Fe=pt.getAsFile();Fe&&J.push(Fe)}if(J.length===0)return;const{imageFiles:Z,tooLarge:ee,skipped:se,limitExceeded:le}=V(J);ee.length&&X(ee),se.length&&P(I("filesSkipped",{names:se.join(", ")})),le&&P(I("maxImages",{n:y})),Z.length&&(B.preventDefault(),_(Z))},xe=!a&&!i&&!!(d!=null&&d.length)&&t.length===0,je=ct({prompts:d??[],enabled:xe}),ft=B=>{if(xe){if(B.key==="ArrowDown"||B.key==="ArrowRight"){B.preventDefault(),je.next();return}if(B.key==="ArrowUp"||B.key==="ArrowLeft"){B.preventDefault(),je.prev();return}if(B.key==="Tab"&&!B.shiftKey){B.preventDefault(),s==null||s(je.currentPrompt);return}}o==null||o(B)},mt=(t.trim()||(u==null?void 0:u.length)>0||(f==null?void 0:f.length)>0)&&!i,Me=b||_;return e.jsxs("div",{className:["ds-prompt-input",E].filter(Boolean).join(" "),...k,children:[Me&&e.jsx("input",{ref:M,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:Re}),e.jsxs("div",{className:["ds-prompt-input__box",U&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:Y,onDragLeave:Q,onDragOver:ie,onDrop:he,children:[U&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:L.dropFilesHere}),e.jsx("textarea",{ref:O,value:t,onChange:B=>s==null?void 0:s(B.target.value),onKeyDown:ft,onPaste:ut,placeholder:xe?"":$,disabled:a||i,rows:1,className:["ds-prompt-input__textarea",xe&&"ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")}),xe&&e.jsxs("div",{className:"ds-prompt-input__anim","aria-hidden":"true",children:[e.jsx("span",{className:"ds-prompt-input__anim-text",children:je.displayed}),e.jsx("span",{className:"ds-prompt-input__anim-cursor"})]}),u&&u.length>0&&e.jsx("div",{className:"ds-prompt-input__images",children:u.map((B,H)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:B.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>w==null?void 0:w(H),"aria-label":L.removeImage,type:"button",children:e.jsx(C.X,{size:12,strokeWidth:2})})]},H))}),j.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:j.map(B=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:B.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>F(B.id),"aria-label":L.dismiss,children:e.jsx(C.X,{size:q[1],strokeWidth:1.5})})]},B.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((B,H)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[B.uploading?e.jsx(C.Loader,{size:q[1],strokeWidth:1.5,className:"spin"}):e.jsx(C.Paperclip,{size:q[1],strokeWidth:1.5}),B.filename,B.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:L.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>p==null?void 0:p(H),"aria-label":L.removeAttachment,children:e.jsx(C.X,{size:q[1],strokeWidth:1.5})})]})},H))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[Me&&e.jsx(re,{variant:"ghost",size:"xs",icon:e.jsx(C.Paperclip,{size:q[2],strokeWidth:1.5}),"aria-label":L.attachFiles,onClick:()=>{var B;return(B=M.current)==null?void 0:B.click()}}),R,h,e.jsx("div",{className:"ds-prompt-input__spacer"}),a?e.jsx(re,{variant:"primary",size:"xs",icon:e.jsx(C.Square,{size:q[2],strokeWidth:1.5}),onClick:r,"aria-label":L.stop}):e.jsx(re,{variant:"primary",size:"xs",icon:e.jsx(C.ArrowUp,{size:q[2],strokeWidth:1.5}),onClick:n,disabled:!mt,"aria-label":L.send})]})]})]})}const Ke={fast:0,standard:1,premium:2},Je={fast:"data-5",standard:"data-3",premium:"data-6"};function tn({models:t=[],value:s,onChange:n,size:r="xs",minTier:o,showAutoOption:a=!1,groupByTier:i=!0,className:c="",...d}){const[f,u]=l.useState(!1),b=l.useRef(null),_=l.useRef(null),p=l.useRef(null),[w,x]=l.useState({}),S=r==="s"?"s":"xs",y=t.filter(A=>!o||A.name==="auto"?!0:(Ke[A.tier]??1)>=(Ke[o]??1)),T=y.find(A=>A.name==="auto"),R=y.filter(A=>A.name!=="auto"),h=t.find(A=>A.name===s),k=new Set(R.map(A=>A.tier).filter(Boolean)).size>1;l.useEffect(()=>{if(!f)return;const A=320,U=()=>{var P;const v=(P=_.current)==null?void 0:P.getBoundingClientRect();if(!v)return;const N=window.innerHeight-v.bottom,$=N<A+8&&v.top>N;x({position:"fixed",zIndex:"var(--z-dropdown, 500)",left:v.left,...$?{bottom:window.innerHeight-v.top+4,top:"auto"}:{top:v.bottom+4,bottom:"auto"}})};U(),window.addEventListener("scroll",U,!0),window.addEventListener("resize",U);const z=v=>{var N,$;!((N=b.current)!=null&&N.contains(v.target))&&!(($=p.current)!=null&&$.contains(v.target))&&u(!1)},j=v=>{v.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",z),document.addEventListener("keydown",j),()=>{window.removeEventListener("scroll",U,!0),window.removeEventListener("resize",U),document.removeEventListener("mousedown",z),document.removeEventListener("keydown",j)}},[f]);const L=A=>{n==null||n(A),u(!1)},I=A=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",A.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>L(A.name),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:A.icon||e.jsx(C.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:A.displayName||A.name}),k&&A.tier&&e.jsx(ce,{size:"xs",variant:Je[A.tier]||"default",children:A.tier})]},A.name),M=()=>!i||!k?R.map(I):["fast","standard","premium"].flatMap(A=>{const U=R.filter(z=>z.tier===A);return U.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":A,children:A.charAt(0).toUpperCase()+A.slice(1)},`lbl-${A}`),...U.map(I)]:[]}),O=f&&e.jsxs("div",{ref:p,className:`ds-model-picker__menu ds-model-picker__menu--${S} ds-scrollable`,"data-ds-portal":"",style:w,children:[a&&T&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:["ds-model-picker__item","ds-model-picker__item--auto",s==="auto"&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>L("auto"),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:e.jsx(C.Zap,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),R.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),M()]});return e.jsxs("div",{ref:b,className:["ds-model-picker",c].filter(Boolean).join(" "),...d,children:[e.jsxs("button",{ref:_,type:"button",className:`ds-model-picker__trigger ds-model-picker__trigger--${S}`,onClick:()=>u(A=>!A),"aria-haspopup":"listbox","aria-expanded":f,children:[e.jsx("span",{className:"ds-model-picker__icon",children:(h==null?void 0:h.icon)||e.jsx(C.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(h==null?void 0:h.displayName)||(h==null?void 0:h.name)||s}),k&&(h==null?void 0:h.tier)&&e.jsx(ce,{size:"xs",variant:Je[h.tier]||"default",children:h.tier})]}),typeof document<"u"&&te.createPortal(O,document.body)]})}const sn=({filename:t,pagesLabel:s})=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0},children:[e.jsx("span",{className:"ds-sources-panel__filename",children:t}),s&&e.jsx("span",{className:"ds-sources-panel__pages",children:s})]});function nn(t){const s=new Map;for(const n of t)s.has(n.filename)||s.set(n.filename,{filename:n.filename,url:n.url,items:[]}),s.get(n.filename).items.push(n);return[...s.values()]}function rn({sources:t=[],layout:s="list",title:n,maxVisible:r=5,onSourceClick:o}){const a=G(),{t:i}=ue(),c=n??a.sources,[d,f]=l.useState(!1),u=nn(t),b=u.length>r,_=d?u:u.slice(0,r),p=t.some(y=>y.snippet),w=y=>y!=null&&y.length?i("pageAbbrev",{pages:y.join(", ")}):null,x=i("moreSources",{n:u.length-r}),S=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:S,children:[_.map(y=>{const T=y.items.map(E=>E.page).filter(Boolean),R=w(T),h=!!o;return e.jsxs("div",{className:`ds-sources-panel__compact-row${h?" ds-sources-panel__compact-row--clickable":""}`,onClick:h?()=>o(y.items[0]):void 0,children:[e.jsx(C.FileText,{size:q[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),R&&e.jsx("span",{className:"ds-sources-panel__pages",children:R})]},y.filename)}),b&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:x})]}):e.jsxs("div",{className:S,children:[c&&e.jsx("div",{className:"ds-sources-panel__title",children:c}),_.map(y=>{const T=y.items.map(E=>E.page).filter(Boolean),R=w(T),h=!!o;return p?e.jsx(ye,{title:e.jsx(sn,{filename:y.filename,pagesLabel:R}),padding:"s",children:y.items.map((E,k)=>e.jsx("div",{className:`ds-sources-panel__snippet${h?" ds-sources-panel__snippet--clickable":""}`,onClick:h?()=>o(E):void 0,children:E.snippet??i("pageAbbrev",{pages:E.page})},k))},y.filename):e.jsxs("div",{className:`ds-sources-panel__row${h?" ds-sources-panel__row--clickable":""}`,onClick:h?()=>o(y.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),R&&e.jsx("span",{className:"ds-sources-panel__pages",children:R})]},y.filename)}),b&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:x})]})}function Ze(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function on({used:t,limit:s,size:n="s",showCount:r=!0,showPercent:o=!1,warningThreshold:a=.8,errorThreshold:i=1}){const c=s>0?t/s:0,d=Math.min(c*100,100),f=c>=i?"error":c>=a?"warning":"normal";return e.jsxs("div",{className:`ds-token-counter ds-token-counter--${n}`,role:"meter","aria-valuenow":t,"aria-valuemax":s,children:[e.jsx("div",{className:"ds-token-counter__track",children:e.jsx("div",{className:`ds-token-counter__fill ds-token-counter__fill--${f}`,style:{width:`${d}%`}})}),(r||o)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${f}`,children:[r&&e.jsxs("span",{children:[Ze(t)," / ",Ze(s)]}),o&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(c*100),"%"]})]})]})}const Qe=5;function an(t){return t<.34?"low":t<.67?"medium":"high"}function ln({value:t=0,size:s="xs",showLabel:n="none",layout:r="inline"}){const o=Math.max(0,Math.min(1,t)),a=Math.round(o*Qe),i=an(o);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${s}`,`ds-confidence-bar--${i}`,r==="block"&&"ds-confidence-bar--block"].filter(Boolean).join(" "),children:[e.jsx("div",{className:"ds-confidence-bar__segments","aria-hidden":"true",children:Array.from({length:Qe},(c,d)=>e.jsx("div",{className:`ds-confidence-bar__seg${d<a?" ds-confidence-bar__seg--filled":""}`},d))}),n==="text"&&e.jsx("span",{className:"ds-confidence-bar__label",children:i})]})}const cn={add:"+",remove:"-",context:" "};function Se({line:t,lineNumbers:s}){return e.jsxs("div",{className:`ds-diff-view__line ds-diff-view__line--${t.type}`,children:[s&&t.lineNo!=null&&e.jsx("span",{className:"ds-diff-view__lineno",children:t.lineNo}),e.jsx("span",{className:"ds-diff-view__prefix",children:cn[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function dn({lines:t=[],layout:s="inline",wordWrap:n=!1,lineNumbers:r=!0,maxHeight:o,title:a}){const i=["ds-diff-view",`ds-diff-view--${s}`,n&&"ds-diff-view--wrap"].filter(Boolean).join(" "),c=o?{maxHeight:o,overflowY:"auto"}:void 0;if(s==="split"){const d=t.filter(u=>u.type==="remove"||u.type==="context"),f=t.filter(u=>u.type==="add"||u.type==="context");return e.jsxs("div",{className:i,children:[a&&e.jsx("div",{className:"ds-diff-view__title",children:a}),e.jsxs("div",{className:"ds-diff-view__body ds-scrollable",style:c,children:[e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((u,b)=>e.jsx(Se,{line:u,lineNumbers:r},b))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:f.map((u,b)=>e.jsx(Se,{line:u,lineNumbers:r},b))})]})]})}return e.jsxs("div",{className:i,children:[a&&e.jsx("div",{className:"ds-diff-view__title",children:a}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:c,children:t.map((d,f)=>e.jsx(Se,{line:d,lineNumbers:r},f))})]})}function dt({value:t="idle",onLike:s,onDislike:n,className:r="",likeLabel:o,dislikeLabel:a,...i}){const c=G(),d=t!=="idle";return e.jsxs("div",{className:["ds-message-feedback",d&&"ds-message-feedback--voted",r].filter(Boolean).join(" "),...i,children:[(!d||t==="liked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="liked"&&"ds-message-feedback__btn--liked"].filter(Boolean).join(" "),onClick:s,disabled:d,"aria-label":o??c.like,"aria-pressed":t==="liked",children:e.jsx(C.ThumbsUp,{size:q[1],strokeWidth:1.5,fill:t==="liked"?"currentColor":"none"})}),(!d||t==="disliked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="disliked"&&"ds-message-feedback__btn--disliked"].filter(Boolean).join(" "),onClick:n,disabled:d,"aria-label":a??c.dislike,"aria-pressed":t==="disliked",children:e.jsx(C.ThumbsDown,{size:q[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function un(t){const s=t instanceof Date?t:new Date(t);if(isNaN(s))return null;const n=new Date,r=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),o=new Date(n.getFullYear(),n.getMonth(),n.getDate()),a=new Date(o-864e5);if(s>=o)return r;if(s>=a)return`Yesterday ${r}`;const i=s.getDate(),c=s.toLocaleString([],{month:"short"});return`${i} ${c} ${r}`}function fn({role:t="assistant",text:s,timestamp:n,feedbackValue:r="idle",onLike:o,onDislike:a,className:i="",...c}){const d=t==="assistant"&&(o||a),f=!!s,u=n?un(n):null;return!d&&!f&&!u?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${t}`,i].filter(Boolean).join(" "),...c,children:[t==="user"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u}),d&&e.jsx(dt,{className:"ds-message-action",value:r,onLike:o,onDislike:a}),f&&e.jsx(lt,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function mn({label:t,className:s="",...n}){return e.jsxs("span",{className:["ds-thinking-dot",s].filter(Boolean).join(" "),...n,children:[e.jsx("span",{className:"ds-thinking-dot__pulse"}),t&&e.jsx("span",{className:"ds-thinking-dot__label",children:t})]})}function pn({variant:t="light",glow:s,mask:n=!0,style:r,...o}){const a=t==="dark",i=s??a,c=a?"rgba(255,250,250,0.05)":"var(--color-border-light)",d=a?"rgba(255,250,250,0.025)":"color-mix(in srgb, var(--color-border-light) 50%, transparent)";return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden",zIndex:0,...i&&{background:"radial-gradient(ellipse 1000px 500px at 50% 30%, rgba(234,100,100,0.18), transparent 70%)"},...r},...o,children:e.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:[`linear-gradient(${c} 1px, transparent 1px)`,`linear-gradient(90deg, ${c} 1px, transparent 1px)`,`linear-gradient(${d} 1px, transparent 1px)`,`linear-gradient(90deg, ${d} 1px, transparent 1px)`].join(", "),backgroundSize:"80px 80px, 80px 80px, 16px 16px, 16px 16px",backgroundPosition:"-1px -1px, -1px -1px, -1px -1px, -1px -1px",...n&&{WebkitMaskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)",maskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)"}}})})}function hn({children:t,axis:s="y",style:n,className:r="",...o}){const a=s==="x"?{overflowX:"auto",overflowY:"hidden"}:s==="both"?{overflow:"auto"}:{overflowY:"auto",overflowX:"hidden"};return e.jsx("div",{className:`ds-scrollable ${r}`,style:{...a,...n},...o,children:t})}const Te=280,xn=22,vn=14,ae=8,Ne=6,bn=200;function _n(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function jn(t,s,n,r){const o=window.innerWidth,a=window.innerHeight;if(a-t.bottom>=s+r+ae)return"bottom";if(t.top>=s+r+ae)return"top";if(o-t.right>=n+r+ae)return"right";if(t.left>=n+r+ae)return"left";const i=Math.max(t.top,a-t.bottom,o-t.right,t.left);return i===a-t.bottom?"bottom":i===t.top?"top":i===o-t.right?"right":"left"}function gn(t,s,n,r,o){const a=window.innerWidth,i=window.innerHeight;let c,d;switch(t){case"top":c=s.top-n-o,d=s.left+s.width/2-r/2;break;case"bottom":c=s.bottom+o,d=s.left+s.width/2-r/2;break;case"left":c=s.top+s.height/2-n/2,d=s.left-r-o;break;default:c=s.top+s.height/2-n/2,d=s.right+o}const f=Math.max(ae,Math.min(a-r-ae,d)),u=Math.max(ae,Math.min(i-n-ae,c));return{top:u,left:f,arrowOffset:d-f,arrowOffsetY:c-u}}function wn({steps:t,currentStep:s,onNext:n,onBack:r,onSkip:o,onFinish:a,overlay:i=!0,ring:c=!0,labelNext:d,labelBack:f,labelSkip:u,labelFinish:b,statePrimary:_="idle",stateBack:p="idle"}){const w=G(),{t:x}=ue(),S=d??w.next,y=f??w.back,T=u??w.skipTour,R=b??w.done,h=l.useRef(null),E=l.useRef(t),k=l.useRef(s),L=l.useRef(c);E.current=t,k.current=s,L.current=c;const[I,M]=l.useState(!1),[O,A]=l.useState({position:"fixed",visibility:"hidden",width:Te}),[U,z]=l.useState("bottom"),[j,v]=l.useState(null),N=l.useRef(!1),$=t[s],P=s===t.length-1,F=l.useCallback(()=>{const W=E.current[k.current];if(!W||!h.current)return;const m=_n(W.target);if(!m)return;const g=m.getBoundingClientRect(),V=h.current.getBoundingClientRect().height||160,X=Te,K=L.current?xn:vn,Y=W.position||jn(g,V,X,K),{top:Q,left:ie,arrowOffset:he,arrowOffsetY:Re}=gn(Y,g,V,X,K);z(Y),A({position:"fixed",top:Q,left:ie,width:Te,visibility:"visible","--arrow-offset":`${he}px`,"--arrow-offset-y":`${Re}px`}),v({top:g.top-Ne,left:g.left-Ne,width:g.width+Ne*2,height:g.height+Ne*2})},[]);return l.useEffect(()=>{window.addEventListener("scroll",F,!0),window.addEventListener("resize",F);const W=requestAnimationFrame(()=>{F(),M(!0),N.current=!0});return()=>{cancelAnimationFrame(W),window.removeEventListener("scroll",F,!0),window.removeEventListener("resize",F)}},[]),l.useEffect(()=>{if(!N.current)return;M(!1);const W=setTimeout(()=>{A(m=>({...m,visibility:"hidden"})),requestAnimationFrame(()=>{F(),M(!0)})},bn+20);return()=>clearTimeout(W)},[s]),l.useEffect(()=>{I&&h.current&&h.current.focus({preventScroll:!0})},[I]),l.useEffect(()=>{const W=m=>{m.key==="Escape"&&o()};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[o]),l.useEffect(()=>{if(!I)return;const W=m=>{if(m.key!=="Tab"||!h.current)return;const g=Array.from(h.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!g.length)return;const D=g[0],V=g[g.length-1];m.shiftKey&&document.activeElement===D?(m.preventDefault(),V.focus()):!m.shiftKey&&document.activeElement===V&&(m.preventDefault(),D.focus())};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[I]),!$||typeof document>"u"?null:te.createPortal(e.jsxs(e.Fragment,{children:[j&&e.jsx("div",{className:["ds-coachmark__spotlight",i&&"ds-coachmark__spotlight--overlay",!c&&"ds-coachmark__spotlight--no-ring",I&&"ds-coachmark__spotlight--visible"].filter(Boolean).join(" "),style:j,"aria-hidden":"true"}),e.jsxs("div",{ref:h,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":$.title??x("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${U}`,I&&"ds-coachmark__bubble--visible"].filter(Boolean).join(" "),style:O,tabIndex:-1,children:[e.jsx("button",{type:"button",className:"ds-coachmark__close",onClick:o,"aria-label":T,children:e.jsx(C.X,{size:16,strokeWidth:2})}),$.title&&e.jsx("div",{className:"ds-coachmark__title",children:$.title}),e.jsx("div",{className:"ds-coachmark__body",children:$.content}),e.jsxs("div",{className:"ds-coachmark__footer",children:[t.length>1&&e.jsxs("span",{className:"ds-coachmark__counter",children:[s+1," / ",t.length]}),e.jsxs("div",{className:"ds-coachmark__footer-nav",children:[s>0&&e.jsx(re,{variant:"secondary",size:"s",state:p,onClick:r,children:y}),e.jsx(re,{variant:"primary",size:"s",state:_,onClick:P?a:n,children:P?R:S})]})]})]})]}),document.body)}function Nn(t,s={}){const{storageKey:n}=s,[r,o]=l.useState(0),[a,i]=l.useState(!1),c=()=>n&&typeof localStorage<"u"&&localStorage.getItem(n)==="done",d=l.useCallback(()=>{i(!1),n&&typeof localStorage<"u"&&localStorage.setItem(n,"done")},[n]);return{currentStep:r,isActive:a,start:()=>{c()||(o(0),i(!0))},next:()=>o(f=>Math.min(f+1,t.length-1)),back:()=>o(f=>Math.max(f-1,0)),skip:d,finish:d}}function yn(){const t=l.useRef(null),s=l.useCallback(()=>{const n=t.current;if(!n)return;n.classList.remove("ds-shake"),n.offsetWidth,n.classList.add("ds-shake");const r=()=>{n.classList.remove("ds-shake"),n.removeEventListener("animationend",r)};n.addEventListener("animationend",r)},[]);return{ref:t,shake:s}}exports.Accordion=ye;exports.Alert=$t;exports.AnimatedNumber=zs;exports.Avatar=ls;exports.Badge=ce;exports.Banner=Ds;exports.BottomSheet=Dt;exports.Breadcrumb=_s;exports.BrowserPane=Ut;exports.BrowserTabs=Vt;exports.Button=re;exports.Card=Nt;exports.ChatMessage=Js;exports.Checkbox=ns;exports.Coachmark=wn;exports.Code=Pt;exports.CodeAccordion=st;exports.ConfidenceBar=ln;exports.CopyButton=lt;exports.DiffView=dn;exports.Dropdown=Ps;exports.EmptyState=xs;exports.EngineerGrid=pn;exports.FormField=vs;exports.H1=yt;exports.H2=kt;exports.H3=Et;exports.H4=Rt;exports.InView=Ws;exports.Input=_t;exports.Link=Ct;exports.List=qt;exports.ListRow=Xt;exports.LocaleProvider=vt;exports.Mention=ts;exports.MessageFeedback=dt;exports.MessageFooter=fn;exports.Modal=Bt;exports.ModalFooter=de;exports.ModelPicker=tn;exports.NavRail=ys;exports.NavRailAgent=Ls;exports.NavRailBody=Es;exports.NavRailCustomItem=As;exports.NavRailDivider=Ts;exports.NavRailFlyout=Bs;exports.NavRailFooter=Ss;exports.NavRailHeader=Rs;exports.NavRailItem=ks;exports.NavRailRecents=$s;exports.P1=St;exports.P2=tt;exports.P3=De;exports.Pagination=js;exports.ProgressBar=Cs;exports.PromptInput=en;exports.Radio=rs;exports.ReasoningBlock=Ys;exports.Scrollable=hn;exports.SegmentedControl=Kt;exports.Select=gt;exports.SidePage=Ns;exports.SidePageFooter=Ae;exports.Skeleton=nt;exports.SourcesPanel=rn;exports.Spinner=et;exports.Stat=bs;exports.StepIndicator=Gs;exports.Stepper=wt;exports.StreamingText=Ks;exports.Tab=Ht;exports.Table=cs;exports.TableBody=us;exports.TableHead=ds;exports.TableRow=fs;exports.TableSubheaderRow=ms;exports.Tabs=Ot;exports.Td=hs;exports.Textarea=jt;exports.Th=ps;exports.ThinkingDot=mn;exports.ToastContainer=qs;exports.Toggle=ss;exports.TokenCounter=on;exports.ToolCallBubble=it;exports.ToolCallCard=it;exports.Tooltip=ke;exports.defaultStrings=_e;exports.formatString=Be;exports.iconSizes=q;exports.useAnimatedNumber=rt;exports.useAnimatedPlaceholder=ct;exports.useCoachmark=Nn;exports.useInView=ot;exports.useLocale=ue;exports.useShake=yn;exports.useStreamScroll=Zs;exports.useStrings=G;exports.useToast=Us;
|