@agentatom/design-system 1.4.93 → 1.4.94
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 +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +591 -591
- 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.94` — 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 c=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),B=require("lucide-react"),ee=require("react-dom"),U={1:16,2:20,3:24,4:28,5:48};var Te={exports:{}},ve={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -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 ze;function ft(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===
|
|
17
|
+
*/var ze;function ft(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===k?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case y:return"Fragment";case $:return"Profiler";case N:return"StrictMode";case A:return"Suspense";case D:return"SuspenseList";case F:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case w:return"Portal";case _:return p.displayName||"Context";case E:return(p._context.displayName||"Context")+".Consumer";case g:var b=p.render;return p=p.displayName,p||(p=b.displayName||b.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case L:return b=p.displayName||null,b!==null?b:t(p.type)||"Memo";case M:b=p._payload,p=p._init;try{return t(p(b))}catch{}}return null}function s(p){return""+p}function n(p){try{s(p);var b=!1}catch{b=!0}if(b){b=console;var I=b.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return I.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",W),s(p)}}function r(p){if(p===y)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===M)return"<...>";try{var b=t(p);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function a(){var p=z.A;return p===null?null:p.getOwner()}function o(){return Error("react-stack-top-frame")}function i(p){if(P.call(p,"key")){var b=Object.getOwnPropertyDescriptor(p,"key").get;if(b&&b.isReactWarning)return!1}return p.key!==void 0}function l(p,b){function I(){T||(T=!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)",b))}I.isReactWarning=!0,Object.defineProperty(p,"key",{get:I,configurable:!0})}function d(){var p=t(this.type);return S[p]||(S[p]=!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.")),p=this.props.ref,p!==void 0?p:null}function f(p,b,I,W,Z,re){var Y=I.ref;return p={$$typeof:j,type:p,key:b,props:I,_owner:W},(Y!==void 0?Y:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:d}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function u(p,b,I,W,Z,re){var Y=b.children;if(Y!==void 0)if(W)if(V(Y)){for(W=0;W<Y.length;W++)h(Y[W]);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 h(Y);if(P.call(b,"key")){Y=t(p);var K=Object.keys(b).filter(function(he){return he!=="key"});W=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",X[Y+W]||(K=0<K.length?"{"+K.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} />`,O,Y,K,Y),X[Y+O]=!0)}if(Y=null,I!==void 0&&(n(I),Y=""+I),i(v)&&(n(v.key),Y=""+v.key),"key"in v){I={};for(var ie in v)ie!=="key"&&(I[ie]=v[ie])}else I=v;return Y&&l(I,typeof p=="function"?p.displayName||p.name||"Unknown":p),f(p,Y,I,a(),Z,re)}function h(p){x(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===z&&(p._payload.status==="fulfilled"?x(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function x(p){return typeof p=="object"&&p!==null&&p.$$typeof===b}var m=c,b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),g=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),H=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,C=Array.isArray,_=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(p){return p()}};var T,$={},U=m.react_stack_bottom_frame.bind(m,o)(),W=_(r(o)),X={};be.Fragment=k,be.jsx=function(p,v,I){var O=1e4>H.recentlyCreatedOwnerStacks++;return u(p,v,I,!1,O?Error("react-stack-top-frame"):U,O?_(r(p)):W)},be.jsxs=function(p,v,I){var O=1e4>H.recentlyCreatedOwnerStacks++;return u(p,v,I,!0,O?Error("react-stack-top-frame"):U,O?_(r(p)):W)}}()),be}process.env.NODE_ENV==="production"?Te.exports=ut():Te.exports=ft();var e=Te.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=c.createContext({strings:_e,t:(t,s)=>Be(_e[t]??t,s)});function mt({strings:t,children:s}){const n=c.useMemo(()=>{const r={..._e,...t};return{strings:r,t:(a,o)=>Be(r[a]??_e[a]??a,o)}},[t]);return e.jsx(Ie.Provider,{value:n,children:s})}function ue(){return c.useContext(Ie)}function q(){return c.useContext(Ie).strings}function Je({size:t="m",color:s="default",className:n="","aria-label":r,...a}){const o=q();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 pt={xs:12,s:14,m:16,l:20};function ne({children:t,variant:s="primary",size:n="m",fullWidth:r=!1,icon:a,disabled:o=!1,state:i="idle",active:l=!1,pressed:d=!1,onClick:f,type:u="button",href:h,"aria-label":x,"aria-pressed":m,className:b="",...w}){const k=a&&!t,N=i==="loading",S=i==="success",y=i==="error",g=N||S||y,j=!!(l||d),B=n==="xs"?"s":"m",D=s==="danger"?"on-accent":"default",L=pt[n]??16,z=N?e.jsx(Je,{size:B,color:D}):S?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(A.Check,{size:L,strokeWidth:2.5})}):y?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(A.X,{size:L,strokeWidth:2.5})}):null,E=["ds-button",`ds-button--${s}`,`ds-button--${n}`,r&&"ds-button--full",k&&"ds-button--icon-only",b].filter(Boolean).join(" "),P=i!=="idle"?i:void 0,H=m!==void 0?m:j?!0:void 0,F=e.jsxs(e.Fragment,{children:[g?z:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),t]});if(h){const C=_=>{if(o||N){_.preventDefault();return}_.metaKey||_.ctrlKey||_.button===1||(_.preventDefault(),f==null||f(_))};return e.jsx("a",{className:E,href:o||N?void 0:h,onClick:C,"aria-label":x,"aria-disabled":o||N?"true":void 0,"aria-busy":N?"true":void 0,"aria-pressed":H,"data-state":P,"data-active":j?"true":void 0,...w,children:F})}return e.jsx("button",{type:u,className:E,disabled:o,onClick:N?void 0:f,"aria-label":x,"aria-busy":N?"true":void 0,"aria-pressed":H,"data-state":P,"data-active":j?"true":void 0,...w,children:F})}function ht({label:t,error:s,hint:n,fullWidth:r=!0,icon:a,iconRight:o,onIconRightClick:i,size:l="m",disabled:d,id:f,iconRightLabel:u,...h}){const x=q(),m=f||`input-${c.useId()}`,b=n?`${m}-hint`:void 0,w=s?`${m}-error`:void 0,k=w||b;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:m,children:t}),e.jsxs("div",{className:"ds-input-container",children:[a&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:a}),e.jsx("input",{id:m,className:`ds-input ds-input--${l} ${a?"ds-input--with-icon":""} ${o?"ds-input--with-icon-right":""} ${s?"ds-input--error":""}`,disabled:d,"aria-invalid":s?"true":"false","aria-describedby":k,...h}),o&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":u??x.toggleVisibility,children:o})]}),n&&!s&&e.jsx("span",{id:b,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:w,className:"ds-input-error",role:"alert",children:s})})})]})}function xt({label:t,error:s,hint:n,fullWidth:r=!0,size:a="m",disabled:o,id:i,resize:l=!0,rows:d=3,...f}){const u=i||`textarea-${c.useId()}`,h=n?`${u}-hint`:void 0,x=s?`${u}-error`:void 0,m=x||h;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":""} ${l?"":"ds-textarea--no-resize"}`,disabled:o,"aria-invalid":s?"true":"false","aria-describedby":m,rows:d,...f}),n&&!s&&e.jsx("span",{id:h,className:"ds-textarea-hint",children:n}),s&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:s})]})}function vt({label:t,value:s,onChange:n,options:r=[],placeholder:a,error:o,fullWidth:i=!0,size:l="m",disabled:d=!1,id:f,...u}){const h=q(),x=a??h.selectOption,[m,b]=c.useState(!1),[w,k]=c.useState(!1),[N,S]=c.useState({}),[y,g]=c.useState("down"),[j,B]=c.useState(-1),D=c.useRef(null),L=c.useRef(null),z=c.useRef(null),E=c.useRef(null),P=f||`select-${c.useId()}`,H=`${P}-label`,F=o?`${P}-error`:void 0,C=150,_=(v=!1)=>{w||(k(!0),B(-1),E.current=setTimeout(()=>{var I;b(!1),k(!1),v&&((I=z.current)==null||I.focus())},C))},T=v=>{clearTimeout(E.current),k(!1);const I=v!==void 0?v:Math.max(r.findIndex(O=>O.value===s),0);B(I),b(!0)};c.useEffect(()=>()=>clearTimeout(E.current),[]);const $=()=>{var K;const v=(K=D.current)==null?void 0:K.getBoundingClientRect();if(!v)return;const I=window.innerHeight,O=I-v.bottom,Z=v.top,Y=O<300&&Z>O;g(Y?"up":"down"),S(Y?{bottom:I-v.top+4,left:v.left,width:v.width}:{top:v.bottom+4,left:v.left,width:v.width})};c.useEffect(()=>{if(m)return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[m]),c.useEffect(()=>{const v=I=>{D.current&&!D.current.contains(I.target)&&L.current&&!L.current.contains(I.target)&&_()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[w]),c.useEffect(()=>{var I;if(!m||j<0||!L.current)return;(I=L.current.querySelectorAll(".ds-select-option")[j])==null||I.scrollIntoView({block:"nearest"})},[j,m]);const U=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),m?B(I=>Math.min(I+1,r.length-1)):T();break;case"ArrowUp":v.preventDefault(),m?B(I=>Math.max(I-1,0)):T(r.length-1);break;case"Home":m&&(v.preventDefault(),B(0));break;case"End":m&&(v.preventDefault(),B(r.length-1));break;case"Enter":case" ":v.preventDefault(),m?j>=0&&(n==null||n(r[j].value),_(!0)):T();break;case"Escape":m&&(v.preventDefault(),_(!0));break;case"Tab":m&&_(!1);break}},W=r.find(v=>v.value===s),X=l==="xs"?V[1]:l==="small"?V[2]:V[3],p=m&&e.jsx("div",{ref:L,"data-ds-portal":"",role:"listbox","aria-labelledby":t?H:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${y}`,w&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:N,children:r.map((v,I)=>e.jsx("button",{id:`${P}-opt-${I}`,type:"button",role:"option",tabIndex:-1,"aria-selected":s===v.value,className:["ds-select-option",`ds-select-option--${l}`,s===v.value&&"ds-select-option--selected",I===j&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{n==null||n(v.value),_(!0)},children:v.label},v.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:H,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:D,children:e.jsxs("button",{ref:z,type:"button",id:P,role:"combobox","aria-haspopup":"listbox","aria-expanded":m,"aria-activedescendant":m&&j>=0?`${P}-opt-${j}`:void 0,"aria-labelledby":t?H:void 0,"aria-invalid":o?"true":"false","aria-describedby":F,className:`ds-select-trigger ds-select-trigger--${l} ${o?"ds-select-trigger--error":""}`,onClick:()=>{d||(m?_():T())},onKeyDown:U,disabled:d,...u,children:[e.jsx("span",{className:W?"":"ds-select-placeholder",children:(W==null?void 0:W.label)||x}),e.jsx(A.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${m&&y==="down"?"ds-select-icon--open":""} ${m&&y==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),o&&e.jsx("span",{id:F,className:"ds-select-error",role:"alert",children:o}),typeof document<"u"&&ee.createPortal(p,document.body)]})}function bt({label:t,value:s=0,onChange:n,min:r=0,max:a=100,step:o=1,size:i="m",disabled:l=!1,hint:d,error:f,decreaseLabel:u,increaseLabel:h,...x}){const m=q(),b=()=>{if(l)return;const g=Math.min(Number(s)+o,a);n==null||n(g)},w=()=>{if(l)return;const g=Math.max(Number(s)-o,r);n==null||n(g)},k=g=>{if(l)return;const j=g.target.value;if(j===""){n==null||n(r);return}const B=Number(j);if(!isNaN(B)){const D=Math.min(Math.max(B,r),a);n==null||n(D)}},N=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),S=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),y=i==="xs"?V[1]:i==="small"?V[2]:V[3];return e.jsxs("div",{className:N,children:[t&&e.jsx("label",{className:"ds-stepper-label",children:t}),e.jsxs("div",{className:S,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:w,disabled:l||s<=r,"aria-label":u??m.decrease,children:e.jsx(A.Minus,{size:y,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:k,min:r,max:a,step:o,disabled:l,...x}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:b,disabled:l||s>=a,"aria-label":h??m.increase,children:e.jsx(A.Plus,{size:y,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 _t({children:t,padding:s="m",variant:n="default",hover:r=!1,onClick:a,href:o,disabled:i=!1,className:l="",...d}){const u=(r?"interactive":n)==="interactive"||a||o,h=["ds-card",`ds-card--${s}`,u&&"ds-card--interactive",l].filter(Boolean).join(" ");if(o){const b=w=>{if(i){w.preventDefault();return}w.metaKey||w.ctrlKey||w.button===1||(w.preventDefault(),a==null||a(w))};return e.jsx("a",{className:h,href:i?void 0:o,onClick:b,"aria-disabled":i?"true":void 0,...d,children:t})}const x=u&&a?"button":"div",m=u&&a?{type:"button",onClick:a,disabled:i}:{};return e.jsx(x,{className:h,role:u&&!a?"article":void 0,...m,...d,children:t})}function jt({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function Nt({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function wt({children:t,...s}){return e.jsx("h3",{className:"ds-h3",...s,children:t})}function gt({children:t,...s}){return e.jsx("h4",{className:"ds-h4",...s,children:t})}function yt({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function Ze({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,...a}){const o=["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:o,role:i,...a,children:t})}const kt={info:A.Info,success:A.CheckCircle,warning:A.AlertTriangle,error:A.XCircle},Et=c.forwardRef(function({children:s,variant:n="info",title:r,onClose:a,role:o,closeLabel:i,...l},d){const f=q(),u=kt[n],h=o||(n==="error"?"alert":"status");return e.jsxs("div",{ref:d,className:`ds-alert ds-alert--${n} ${r?"":"ds-alert--no-title"}`,role:h,...l,children:[u&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(u,{size:V[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":i??f.closeAlert,children:e.jsx(A.X,{size:V[3],strokeWidth:1.5})})]})}),Rt="data-ds-portal";function Le(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 Pe(t,s){var r;const n=(r=t==null?void 0:t.closest)==null?void 0:r.call(t,`[${Rt}]`);return!!(n&&n!==s)}const St=200;function Tt({children:t,title:s,onClose:n,size:r="m",scrollable:a=!1,subHeader:o,closeLabel:i,...l}){const d=q(),f=c.useRef(null),u=c.useRef(null),h=c.useId(),[x,m]=c.useState(!1),b=()=>{!n||x||(m(!0),setTimeout(()=>{m(!1),n()},St))};c.useEffect(()=>{const y=j=>{j.key==="Escape"&&b()},g=j=>{var D;const B=Le(j);B&&((D=u.current)!=null&&D.contains(B)||Pe(B,f.current)||b())};return document.addEventListener("keydown",y),document.addEventListener("mousedown",g),()=>{document.removeEventListener("keydown",y),document.removeEventListener("mousedown",g)}},[n,x]);const w=c.Children.toArray(t),k=w.find(y=>(y==null?void 0:y.type)===de),N=w.filter(y=>(y==null?void 0:y.type)!==de),S=e.jsx("div",{className:["ds-modal-overlay",x&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...l,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?h:void 0,children:[n&&e.jsx(ne,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(A.X,{size:V[2],strokeWidth:1.5}),onClick:b,"aria-label":i??d.closeModal}),(s||o)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:h,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:N}),k]})});return typeof document>"u"?S:ee.createPortal(S,document.body)}function de({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const $t=320;function At({children:t,title:s,onClose:n,subHeader:r,closeLabel:a,...o}){const i=q(),l=c.useRef(null),d=c.useRef(null),f=c.useId(),[u,h]=c.useState(!1),x=()=>{!n||u||(h(!0),setTimeout(()=>{h(!1),n()},$t))};c.useEffect(()=>{const N=y=>{y.key==="Escape"&&x()},S=y=>{var j;const g=Le(y);g&&((j=d.current)!=null&&j.contains(g)||Pe(g,l.current)||x())};return document.addEventListener("keydown",N),document.addEventListener("mousedown",S),()=>{document.removeEventListener("keydown",N),document.removeEventListener("mousedown",S)}},[n,u]);const m=c.Children.toArray(t),b=m.find(N=>(N==null?void 0:N.type)===de),w=m.filter(N=>(N==null?void 0:N.type)!==de),k=e.jsx("div",{className:["ds-bottom-sheet-overlay",u&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...o,ref:l,"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(ne,{className:"ds-bottom-sheet__close",variant:"ghost",size:"small",icon:e.jsx(A.X,{size:V[2],strokeWidth:1.5}),onClick:x,"aria-label":a??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:w}),b]})});return typeof document>"u"?k:ee.createPortal(k,document.body)}function Qe({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="s",className:i="",...l}){const d=q(),f=s??d.code,[u,h]=c.useState(n),x=r!==void 0,m=x?r:u,b=()=>{x?a==null||a(!r):h(k=>!k)},w=["ds-code-accordion",`ds-code-accordion--${o}`,m&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:w,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:b,"aria-expanded":m,children:[e.jsx("span",{className:"ds-code-accordion__title",children:f}),e.jsx(A.ChevronDown,{size:V[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${m?"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 Bt({children:t,block:s=!1,collapsible:n=!1,title:r,defaultExpanded:a=!1,...o}){const i=q(),l=r??i.code;return s?n?e.jsx(Qe,{title:l,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 It({href:t,children:s,onClick:n,target:r,rel:a,...o}){const l=r==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:t,className:"ds-link",onClick:n,target:r,rel:l,...o,children:s})}function Dt({children:t,size:s="m",variant:n="ghost",...r}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...r,children:c.Children.map(t,a=>c.isValidElement(a)?c.cloneElement(a,{size:s,variant:n}):a)})}function Lt({children:t,selected:s=!1,onClick:n,size:r="m",variant:a="ghost",disabled:o=!1,icon:i,href:l,...d}){const f=i&&!t,u=["ds-tab",`ds-tab--${r}`,`ds-tab--${a}`,s&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),h=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),t]});if(l){const x=m=>{if(o){m.preventDefault();return}m.metaKey||m.ctrlKey||m.button===1||(m.preventDefault(),n==null||n(m))};return e.jsx("a",{role:"tab","aria-current":s?"page":void 0,"aria-disabled":o?"true":void 0,className:u,href:o?void 0:l,onClick:x,...d,children:h})}return e.jsx("button",{role:"tab","aria-selected":s,className:u,onClick:n,disabled:o,...d,children:h})}function Pt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-browser-pane",s].filter(Boolean).join(" "),...n,children:t})}function Ct({tabs:t,active:s,onChange:n,onClose:r,className:a="",...o}){const{t:i}=ue();return e.jsx("div",{className:["ds-browser-tabs",a].filter(Boolean).join(" "),role:"tablist",...o,children:t.map(l=>{const d=l.id===s,f=!!l.closable;return e.jsxs("div",{className:["ds-browser-tab",d&&"ds-browser-tab--active",f&&"ds-browser-tab--closable"].filter(Boolean).join(" "),title:l.label,children:[e.jsxs("button",{type:"button",role:"tab","aria-selected":d,className:"ds-browser-tab__hit",onClick:()=>n==null?void 0:n(l.id),children:[l.icon?e.jsx("span",{className:"ds-browser-tab__icon","aria-hidden":!0,children:l.icon}):null,e.jsx("span",{className:"ds-browser-tab__label",children:l.label})]}),f?e.jsx("button",{type:"button",className:"ds-browser-tab__close","aria-label":i("closeTab",{label:l.label}),onClick:u=>{u.stopPropagation(),r==null||r(l.id)},children:e.jsx(A.X,{size:12,strokeWidth:2})}):null]},l.id)})})}function Mt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-list",s].filter(Boolean).join(" "),role:"list",...n,children:t})}function Ft({icon:t,title:s,subtitle:n,meta:r,onClick:a,className:o="",...i}){const l=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]}),l.map((u,h)=>e.jsx("span",{className:"ds-list-row__meta",children:u},h))]});return a?e.jsx("button",{type:"button",role:"listitem",className:d,onClick:a,...i,children:f}):e.jsx("div",{role:"listitem",className:d,...i,children:f})}function zt({options:t,value:s,onChange:n,size:r="m",disabled:a=!1}){const o=c.useRef(null),i=c.useRef(null),[l,d]=c.useState(!1),f=c.useRef(!1),u=c.useRef(null),h=c.useRef(null),x=()=>{if(!o.current)return;const m=o.current.querySelector(`[data-value="${s}"]`);if(!m)return;const b=o.current.getBoundingClientRect(),w=m.getBoundingClientRect(),k=w.left-b.left,N=w.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=k+"px",i.current.style.width=N+"px",f.current=!1):(d(!0),requestAnimationFrame(()=>{if(!i.current||!o.current)return;const S=o.current.querySelector(`[data-value="${s}"]`);if(!S)return;const y=o.current.getBoundingClientRect(),g=S.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=g.left-y.left+"px",i.current.style.width=g.width+"px"}))};return h.current=x,c.useLayoutEffect(()=>{const m=u.current!==s;u.current=s,f.current=l&&m,x()}),c.useEffect(()=>{if(!o.current)return;const m=new ResizeObserver(()=>{f.current=!1,h.current()});return m.observe(o.current),()=>m.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${r}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:o,role:"group",children:[l&&e.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),t.map(m=>e.jsxs("button",{type:"button","data-value":m.value,className:["ds-seg__btn",s===m.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&n(m.value),"aria-pressed":s===m.value,disabled:a,children:[m.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:m.icon}),m.label]},m.value))]})}function ge({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="m",...i}){const[l,d]=c.useState(n),f=r!==void 0,u=f?r:l,h=()=>{f?a==null||a(!r):d(m=>!m)},x=["ds-accordion",`ds-accordion--${o}`,u&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...i,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:h,"aria-expanded":u,children:[e.jsx("span",{className:"ds-accordion__title",children:s}),e.jsx(A.ChevronDown,{size:V[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 Ot(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 i=Math.max(fe,Math.min(r-n.width-fe,o)),l=o-i;return{top:a,left:i,arrowOffset:l}}function Wt(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 ye({children:t,content:s,position:n,...r}){const[a,o]=c.useState(!1),[i,l]=c.useState({visibility:"hidden"}),[d,f]=c.useState(n||"top"),u=c.useRef(null),h=c.useRef(null),x=c.useRef(!1),m=()=>{if(!u.current||!h.current)return;const w=u.current.getBoundingClientRect(),k=h.current.getBoundingClientRect(),N=n||Wt(w,k.height,k.width),{top:S,left:y,arrowOffset:g}=Ot(N,w,k);f(N),l({position:"fixed",top:S,left:y,visibility:"visible","--arrow-offset":`${g}px`})};if(c.useEffect(()=>{if(!a)return;l({position:"fixed",visibility:"hidden"});const w=requestAnimationFrame(m);return window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{cancelAnimationFrame(w),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[a,n]),c.useEffect(()=>{if(!a)return;const w=k=>{u.current&&!u.current.contains(k.target)&&o(!1)};return document.addEventListener("touchstart",w),()=>document.removeEventListener("touchstart",w)},[a]),!s)return t;const b=a&&e.jsx("div",{ref:h,"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:()=>{x.current||o(!0)},onMouseLeave:()=>{x.current||o(!1)},onTouchStart:()=>{x.current=!0,o(w=>!w)},...r,children:[t,typeof document<"u"&&ee.createPortal(b,document.body)]})}const Oe=8,Ne=8,Ht=140;function We(t){const s=String(t??"").replace(/^@/,"").trim();return s?`@${s}`:""}function Ut({label:t,children:s,mode:n="click",avatar:r,name:a,handle:o,description:i,actions:l,className:d="",popoverClassName:f="",...u}){const h=c.useId(),x=c.useRef(null),m=c.useRef(null),b=c.useRef(null),[w,k]=c.useState(!1),[N,S]=c.useState(null),y=s!=null,g=a||t||"",j=We(t||a),B=We(o),D=c.useCallback(()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null)},[]),L=c.useCallback(()=>{D(),k(!0)},[D]),z=c.useCallback(()=>{D(),b.current=window.setTimeout(()=>k(!1),Ht)},[D]),E=c.useCallback(()=>{const F=x.current,C=m.current;if(!F)return;const _=F.getBoundingClientRect(),T=(C==null?void 0:C.offsetHeight)??160,$=(C==null?void 0:C.offsetWidth)??260;let U=_.bottom+Oe;U+T>window.innerHeight-Ne&&(U=Math.max(Ne,_.top-T-Oe));const W=Math.max(Ne,Math.min(_.left,window.innerWidth-$-Ne));S({top:U,left:W})},[]);c.useLayoutEffect(()=>{w&&E()},[w,E]),c.useEffect(()=>{if(!w)return;const F=()=>E(),C=T=>{T.key==="Escape"&&k(!1)},_=T=>{var U,W;if(n==="hover")return;const $=T.target;(U=m.current)!=null&&U.contains($)||(W=x.current)!=null&&W.contains($)||k(!1)};return window.addEventListener("scroll",F,!0),window.addEventListener("resize",F),document.addEventListener("keydown",C),document.addEventListener("mousedown",_),()=>{window.removeEventListener("scroll",F,!0),window.removeEventListener("resize",F),document.removeEventListener("keydown",C),document.removeEventListener("mousedown",_)}},[w,E,n]),c.useEffect(()=>()=>D(),[D]);const P=n==="hover"?{onMouseEnter:L,onMouseLeave:z}:{},H=w?ee.createPortal(e.jsxs("div",{ref:m,id:h,role:"dialog","aria-label":g||j||"Mention","data-ds-portal":"",className:["ds-mention__popover",f].filter(Boolean).join(" "),style:N?{top:N.top,left:N.left}:{top:-9999,left:-9999,visibility:"hidden"},...P,children:[(r||g||B)&&e.jsxs("div",{className:"ds-mention__head",children:[r,(g||B)&&e.jsxs("div",{className:"ds-mention__meta",children:[g?e.jsx("span",{className:"ds-mention__name",children:g}):null,B?e.jsx("span",{className:"ds-mention__handle",children:B}):null]})]}),i?e.jsx("p",{className:"ds-mention__desc",children:i}):null,l?e.jsx("div",{className:"ds-mention__actions",onClick:()=>k(!1),children:l}):null]}),document.body):null;return e.jsxs(e.Fragment,{children:[e.jsx("button",{...u,ref:x,type:"button",className:["ds-mention",y&&"ds-mention--custom",d].filter(Boolean).join(" "),"aria-expanded":w,"aria-haspopup":"dialog","aria-label":y&&(j||g)||void 0,"aria-controls":w?h:void 0,onClick:F=>{var C;if((C=u.onClick)==null||C.call(u,F),!F.defaultPrevented){if(F.preventDefault(),F.stopPropagation(),n==="hover"){L();return}k(_=>!_)}},...P,children:y?s:j}),typeof document<"u"?H:null]})}function Vt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...i}){const l=o||`toggle-${c.useId()}`,d=["ds-toggle",`ds-toggle--${n}`,r&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,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"})}),a&&e.jsx("span",{className:"ds-toggle__label",children:a})]})}function Xt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...i}){const l=o||`checkbox-${c.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:l,children:[e.jsx("input",{type:"checkbox",id:l,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(A.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function Yt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,name:o,value:i,id:l,...d}){const f=l||`radio-${c.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:h=>s==null?void 0:s(h.target.checked),disabled:r,name:o,value:i,...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 et({width:t,height:s,shape:n="rect",aspectRatio:r,className:a="",style:o={},...i}){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",...i})}function qt({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},(i,l)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:l===t-1&&t>1?{width:s}:void 0},l))})}et.Text=qt;function Gt(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 Kt(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 Jt({seed:t,icon:s,src:n,size:r=32,className:a="",style:o={},...i}){const l=Gt(t??""),[d,f]=c.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:Kt(t)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:r,height:r,"--ds-avatar-h":l,...o},"aria-hidden":"true",...i,children:n&&!d?e.jsx("img",{src:n,alt:"",onError:()=>f(!0)}):u})}function Zt({children:t,size:s="compact",stickyTop:n,maxHeight:r,className:a="",style:o={},...i}){const l={...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:l,children:e.jsx("table",{className:["ds-table",`ds-table--${s}`,a].filter(Boolean).join(" "),...i,children:t})})}function Qt({children:t,...s}){return e.jsx("thead",{...s,children:t})}function es({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function ts({children:t,interactive:s,selected:n,subheader:r,exiting:a,updated:o,className:i="",onClick:l,...d}){return e.jsx("tr",{className:["ds-table-row",s||l?"ds-table-row--interactive":"",n?"ds-table-row--selected":"",r?"ds-table-row--subheader":"",a?"ds-table-row--exiting":"",o?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:l,...d,children:t})}function ss({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 ns({children:t,align:s="left",sortDir:n,onSort:r,width:a,className:o="",style:i={},...l}){const d=!!r||n!==void 0,f=n==="asc"?A.ChevronUp:n==="desc"?A.ChevronDown:A.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,...i},...l,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 rs({children:t,align:s="left",secondary:n,muted:r,truncate:a,nowrap:o,className:i="",...l}){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":"",i].filter(Boolean).join(" "),...l,children:t})}function as({icon:t,title:s,description:n,action:r,size:a="m",className:o="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,o].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 os({label:t,hint:s,error:n,required:r=!1,disabled:a=!1,htmlFor:o,children:i,className:l="",style:d,...f}){const u=c.useId(),h=o??u,x=`${h}-hint`,m=`${h}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"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:h,children:t}),e.jsx("div",{className:"ds-field-control",children:i}),s&&!n&&e.jsx("p",{className:"ds-field-hint",id:x,children:s}),n&&e.jsx("p",{className:"ds-field-error",id:m,role:"alert",children:n})]})}function is({label:t,value:s,delta:n,size:r="m",inline:a=!1,className:o="",style:i,...l}){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:i,...l,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 ls({children:t,separator:s="/","aria-label":n,className:r="",style:a,...o}){const i=q(),l=c.Children.toArray(t).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${r?` ${r}`:""}`,"aria-label":n??i.breadcrumb,style:a,...o,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:l.map((d,f)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[d,f<l.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:s})]},f))})})}function cs({page:t,total:s,onChange:n,siblings:r=1,"aria-label":a,previousLabel:o,nextLabel:i,className:l="",style:d,...f}){const u=q(),{t:h}=ue(),x=ds(t,s,r);return e.jsxs("nav",{className:`ds-pagination${l?` ${l}`:""}`,"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(A.ChevronLeft,{size:16})}),x.map((m,b)=>m==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${b}`):e.jsx("button",{className:`ds-pagination-page${m===t?" ds-pagination-page--current":""}`,onClick:()=>m!==t&&(n==null?void 0:n(m)),"aria-current":m===t?"page":void 0,"aria-label":h("pageN",{n:m}),children:m},m)),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(A.ChevronRight,{size:16})})]})}function ds(t,s,n){if(s<=7)return Array.from({length:s},(i,l)=>l+1);const r=Math.max(2,t-n),a=Math.min(s-1,t+n),o=[1];r>2&&o.push("…");for(let i=r;i<=a;i++)o.push(i);return a<s-1&&o.push("…"),o.push(s),o}const us=300;function fs({children:t,title:s,onClose:n,subHeader:r,side:a="right",size:o="wide",offsetLeft:i=0,offsetRight:l=0,keepOpenRef:d,closeLabel:f,...u}){const h=q(),x=c.useRef(null),m=c.useId(),[b,w]=c.useState(!1),k=()=>{!n||b||(w(!0),setTimeout(()=>{w(!1),n()},us))};c.useEffect(()=>{const j=D=>{D.key==="Escape"&&k()},B=D=>{var z,E;const L=Le(D);L&&((z=d==null?void 0:d.current)!=null&&z.contains(L)||(E=x.current)!=null&&E.contains(L)||Pe(L,null)||k())};return document.addEventListener("keydown",j),document.addEventListener("mousedown",B),()=>{document.removeEventListener("keydown",j),document.removeEventListener("mousedown",B)}},[n,b,d]);const N=c.Children.toArray(t),S=N.find(j=>(j==null?void 0:j.type)===$e||(j==null?void 0:j.type)===de),y=N.filter(j=>(j==null?void 0:j.type)!==$e&&(j==null?void 0:j.type)!==de),g=e.jsx("div",{className:["ds-side-page-overlay",b&&"ds-side-page-overlay--closing"].filter(Boolean).join(" "),"data-side":a,style:{"--ds-side-page-offset-left":`${i}px`,"--ds-side-page-offset-right":`${l}px`},...u,children:e.jsxs("div",{ref:x,className:["ds-side-page",b&&"ds-side-page--closing"].filter(Boolean).join(" "),"data-surface":"2","data-side":a,"data-size":o,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,children:[n&&e.jsx(ne,{className:"ds-side-page__close",variant:"ghost",size:"small",icon:e.jsx(A.X,{size:V[2],strokeWidth:1.5}),onClick:k,"aria-label":f??h.close}),(s||r)&&e.jsxs("div",{className:"ds-side-page__header",children:[s&&e.jsx("h3",{id:m,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:y}),S]})});return typeof document>"u"?g:ee.createPortal(g,document.body)}function $e({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-side-page__footer",children:t})}const pe=c.createContext({collapsed:!1,side:"left"}),ke=c.createContext(!1),ms=c.forwardRef(function({children:s,collapsed:n=!1,side:r="left",onExpand:a,onCollapse:o,className:i="",...l},d){const f=["ds-nav-rail",n&&"ds-nav-rail--collapsed",`ds-nav-rail--${r}`,i].filter(Boolean).join(" "),u=c.useCallback(h=>{if(!h.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,...l,children:s})})});function ps({icon:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,count:i,updated:l=!1,open:d=!1,onboarding:f=!1,className:u="",...h}){const{collapsed:x,side:m}=c.useContext(pe),b=c.useContext(ke),N={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":x?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},...h},S=i!=null,y=m==="left"?"right":"left",g=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!x&&e.jsx("span",{className:"ds-nav-rail__label",children:s}),!x&&S&&e.jsx("span",{className:["ds-nav-rail__count",i===0&&"ds-nav-rail__count--zero"].filter(Boolean).join(" "),"data-updated":l&&i!==0||void 0,children:i}),!x&&l&&(!S||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),x&&S&&i!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":l||void 0,children:i>99?"99+":i}),x&&l&&(!S||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),j=a?e.jsx("a",{href:r?void 0:a,...N,children:g}):e.jsx("button",{type:"button",...N,children:g});return x&&!b?e.jsx(ye,{content:s,position:y,children:j}):j}function hs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function xs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function vs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function bs({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="",...a}){const{collapsed:o}=c.useContext(pe),i=q(),l=s??i.recents,[d,f]=c.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:l}),e.jsx(A.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 js=c.forwardRef(function({as:s="button",avatar:n,label:r,className:a="",...o},i){const{collapsed:l,side:d}=c.useContext(pe),f=c.useContext(ke),u=d==="left"?"right":"left",h=["ds-nav-rail__item","ds-nav-rail__agent",a].filter(Boolean).join(" "),x=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:n}),!l&&e.jsx("span",{className:"ds-nav-rail__label",children:r})]}),m=e.jsx(s,{ref:i,className:h,"aria-label":l?r:void 0,...s==="button"?{type:"button"}:{},...o,children:x});return l&&!f?e.jsx(ye,{content:r,position:u,children:m}):m});function Ns({avatar:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,className:i="",...l}){const{collapsed:d,side:f}=c.useContext(pe),u=c.useContext(ke),m={className:["ds-nav-rail__item","ds-nav-rail__agent",i].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},...l},b=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})]}),w=f==="left"?"right":"left",k=a?e.jsx("a",{href:r?void 0:a,...m,children:b}):e.jsx("button",{type:"button",...m,children:b});return d&&!u?e.jsx(ye,{content:s,position:w,children:k}):k}const He=240,Ue=6,Ve=8;function ws({trigger:t,title:s,children:n,open:r,onOpenChange:a,defaultOpen:o=!1,closeLabel:i}){const l=q(),{side:d}=c.useContext(pe),[f,u]=c.useState(o),h=r!==void 0,x=h?r:f,[m,b]=c.useState(!1),w=c.useRef(null),k=c.useRef(null),[N,S]=c.useState({}),y=c.useCallback(()=>{h?a==null||a(!0):u(!0)},[h,a]),g=c.useCallback(()=>{h?a==null||a(!1):u(!1)},[h,a]),j=c.useCallback(()=>x?g():y(),[x,y,g]),B=c.useCallback(()=>{var F;const L=w.current;if(!L)return;const z=L.getBoundingClientRect(),E=window.innerHeight,P=((F=k.current)==null?void 0:F.offsetHeight)??300,H=Math.max(Ve,Math.min(E-P-Ve,z.top));S(d==="right"?{position:"fixed",top:H,right:window.innerWidth-z.left+Ue,width:He}:{position:"fixed",top:H,left:z.right+Ue,width:He})},[d]);c.useEffect(()=>{if(!x){b(!1);return}return B(),requestAnimationFrame(()=>b(!0)),window.addEventListener("scroll",B,!0),window.addEventListener("resize",B),()=>{window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",B)}},[x,B]),c.useEffect(()=>{if(!x)return;const L=E=>{var P,H;!((P=k.current)!=null&&P.contains(E.target))&&!((H=w.current)!=null&&H.contains(E.target))&&g()},z=E=>{E.key==="Escape"&&g()};return document.addEventListener("mousedown",L),document.addEventListener("keydown",z),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",z)}},[x,g]);const D=x&&e.jsxs("div",{ref:k,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,m&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:N,"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:g,"aria-label":i??l.close,children:e.jsx(A.X,{size:16,strokeWidth:2})})]}),e.jsx("div",{className:"ds-nav-rail-flyout__body",children:n})]});return e.jsxs(e.Fragment,{children:[e.jsx(ke.Provider,{value:x,children:e.jsx("div",{ref:w,onClick:j,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&ee.createPortal(D,document.body)]})}const gs={info:A.Info,success:A.CheckCircle,warning:A.AlertTriangle,error:A.XCircle};function ys({children:t,variant:s="info",action:n,onAction:r,onDismiss:a,role:o,dismissLabel:i,...l}){const d=q(),f=gs[s],u=o||(s==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${s}`,role:u,...l,children:[f&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(f,{size:V[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":i??d.dismiss,children:e.jsx(A.X,{size:V[2],strokeWidth:1.5})})]})}function ks({trigger:t,items:s=[],open:n,onOpenChange:r,align:a="left",fullWidth:o=!1,className:i="",style:l,...d}){const[f,u]=c.useState(!1),[h,x]=c.useState(!1),m=n!==void 0,b=m?n:f,w=c.useRef(null),k=c.useRef(null),N=c.useRef(null),S=c.useRef(null),[y,g]=c.useState({}),j=c.useRef(null),B=150,D=()=>{if(m)r==null||r(!1);else{if(h)return;x(!0),j.current=setTimeout(()=>{u(!1),x(!1)},B)}},L=()=>{const _=!b;m?r==null||r(_):_?(clearTimeout(j.current),x(!1),u(!0)):D()},z=()=>{b||(m?r==null||r(!0):(clearTimeout(j.current),x(!1),u(!0)))};c.useEffect(()=>()=>clearTimeout(j.current),[]),c.useEffect(()=>{if(!b)return;const _=300,T=()=>{var X;const $=(X=w.current)==null?void 0:X.getBoundingClientRect();if(!$)return;const U=window.innerHeight-$.bottom,W=U<_+8&&$.top>U;g(a==="right"?W?{bottom:window.innerHeight-$.top+4,top:"auto",right:window.innerWidth-$.right}:{top:$.bottom+4,bottom:"auto",right:window.innerWidth-$.right}:W?{bottom:window.innerHeight-$.top+4,top:"auto",left:$.left}:{top:$.bottom+4,bottom:"auto",left:$.left})};return T(),window.addEventListener("scroll",T,!0),window.addEventListener("resize",T),()=>{window.removeEventListener("scroll",T,!0),window.removeEventListener("resize",T)}},[b,a]);const E=()=>{var T;const _=(T=N.current)==null?void 0:T.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');_==null||_.focus()};c.useEffect(()=>{if(!b)return;const _=$=>{var U,W;!((U=w.current)!=null&&U.contains($.target))&&!((W=k.current)!=null&&W.contains($.target))&&D()},T=$=>{$.key==="Escape"&&(D(),E())};return document.addEventListener("mousedown",_),document.addEventListener("keydown",T),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",T)}},[b]),c.useEffect(()=>{if(!b||!S.current||!k.current)return;const _=P(),T=S.current==="last"?_[_.length-1]:_[0];T==null||T.focus(),S.current=null},[b]);const P=()=>k.current?[...k.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],H=_=>{var T,$;if(_.key==="ArrowDown")_.preventDefault(),b?(T=P()[0])==null||T.focus():(S.current="first",z());else if(_.key==="ArrowUp")if(_.preventDefault(),!b)S.current="last",z();else{const U=P();($=U[U.length-1])==null||$.focus()}},F=_=>{var U,W,X,p;const T=P(),$=T.findIndex(v=>v===document.activeElement);switch(_.key){case"ArrowDown":_.preventDefault(),(U=T[Math.min($+1,T.length-1)])==null||U.focus();break;case"ArrowUp":_.preventDefault(),$<=0?E():(W=T[$-1])==null||W.focus();break;case"Home":_.preventDefault(),(X=T[0])==null||X.focus();break;case"End":_.preventDefault(),(p=T[T.length-1])==null||p.focus();break;case"Tab":D();break}},C=b&&e.jsx("div",{ref:k,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,h&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:y,onKeyDown:F,children:s.map((_,T)=>{if(_.separator)return e.jsx("div",{className:"ds-dropdown__separator"},T);if(_.type==="section")return e.jsxs("div",{className:"ds-dropdown__section",children:[_.label&&e.jsx("div",{className:"ds-dropdown__section-label",children:_.label}),e.jsx("div",{className:"ds-dropdown__section-content",children:_.content})]},T);const $=!!_.href,U=$?"a":"button",W=$?{href:_.disabled?void 0:_.href,"aria-disabled":_.disabled?"true":void 0}:{type:"button",disabled:_.disabled};return e.jsxs(U,{role:"menuitem",className:["ds-dropdown__item",_.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...W,onClick:()=>{var X;(X=_.onClick)==null||X.call(_),D()},children:[_.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:_.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:_.label}),_.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:_.shortcut})]},T)})});return e.jsxs("div",{ref:w,className:["ds-dropdown",o&&"ds-dropdown--full-width",i].filter(Boolean).join(" "),style:l,...d,children:[e.jsx("div",{ref:N,className:"ds-dropdown__trigger",onClick:L,onKeyDown:H,children:t}),typeof document<"u"&&ee.createPortal(C,document.body)]})}function Es({value:t=0,size:s="m",variant:n="default",showValue:r=!1,min:a=2,animate:o=!0}){const i=Math.min(100,Math.max(0,t)),l=Math.max(a,i),d=n==="auto"?i>=70?"success":i>=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":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:`${l}%`}})}),r&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const Rs=t=>1-Math.pow(1-t,3),Ss=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function tt(t,{duration:s=600}={}){const[n,r]=c.useState(t),a=c.useRef(t),o=c.useRef(null);return c.useEffect(()=>{if(Ss()){r(t),a.current=t;return}const i=a.current,l=t-i;if(l===0)return;let d=null;const f=u=>{d||(d=u);const h=Math.min((u-d)/s,1);r(i+l*Rs(h)),h<1?o.current=requestAnimationFrame(f):a.current=t};return o.current=requestAnimationFrame(f),()=>cancelAnimationFrame(o.current)},[t,s]),n}function Ts({value:t,duration:s=600,decimals:n=0,prefix:r="",suffix:a=""}){const i=tt(t,{duration:s}).toFixed(n);return`${r}${i}${a}`}function st({threshold:t=.1,rootMargin:s="0px",once:n=!1}={}){const r=c.useRef(null),[a,o]=c.useState(!1);return c.useEffect(()=>{const i=r.current;if(!i)return;const l=new IntersectionObserver(([d])=>{d.isIntersecting?(o(!0),n&&l.disconnect()):n||o(!1)},{threshold:t,rootMargin:s});return l.observe(i),()=>l.disconnect()},[t,s,n]),{ref:r,inView:a}}function $s({children:t,as:s="div",once:n=!1,threshold:r=.1,rootMargin:a="0px",onEnter:o,onLeave:i,...l}){const{ref:d,inView:f}=st({threshold:r,rootMargin:a,once:n}),u=c.useRef(!1);return c.useEffect(()=>{f&&!u.current&&(o==null||o()),!f&&u.current&&(i==null||i()),u.current=f},[f]),e.jsx(s,{ref:d,...l,children:typeof t=="function"?t(f):t})}const Xe={default:A.Info,success:A.CheckCircle,warning:A.AlertTriangle,error:A.XCircle};let me=[];const Ae=new Set;function nt(){Ae.forEach(t=>t([...me]))}function As(t){me=[...me,t],nt()}function Bs(t){me=me.filter(s=>s.id!==t),nt()}function Is(){const t=(s,n={})=>{As({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 Ds({data:t,onDismiss:s}){const n=q(),[r,a]=c.useState(!1),o=c.useRef(null);c.useEffect(()=>(requestAnimationFrame(()=>a(!0)),t.duration>0&&(o.current=setTimeout(()=>i(),t.duration)),()=>clearTimeout(o.current)),[]);function i(){a(!1),setTimeout(()=>s(t.id),250)}const l=Xe[t.type]??Xe.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(l,{size:V[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(A.X,{size:V[3],strokeWidth:1.5})})]})}function Ls({position:t="bottom-right"}){const[s,n]=c.useState(()=>[...me]);return c.useEffect(()=>(Ae.add(n),()=>Ae.delete(n)),[]),!s.length||typeof document>"u"?null:ee.createPortal(e.jsx("div",{"data-ds-portal":"",className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:s.map(r=>e.jsx(Ds,{data:r,onDismiss:Bs},r.id))}),document.body)}const Ps={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 rt({label:t,status:s="idle",icon:n,badge:r,defaultExpanded:a=!1,expanded:o,onToggle:i,children:l,className:d="",...f}){const u=s==="running",h=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}),Ps[s],r]});return l?e.jsx("div",{className:["ds-tool-card",u&&"ds-tool-card--running",d].filter(Boolean).join(" "),...f,children:e.jsx(ge,{title:h,padding:"s",defaultExpanded:a,expanded:u?!1:o,onToggle:u?void 0:i,children:e.jsx("div",{className:"ds-tool-card__body",children:l})})}):e.jsx("div",{className:["ds-tool-card","ds-tool-card--bubble",d].filter(Boolean).join(" "),...f,children:h})}function at({text:t,size:s="xs",timeout:n=800,"aria-label":r,...a}){const o=q(),[i,l]=c.useState(!1),d=f=>{f.currentTarget.blur(),navigator.clipboard.writeText(t).then(()=>{l(!0),setTimeout(()=>l(!1),n)})};return e.jsx(ne,{variant:"ghost",size:s,state:i?"success":"idle",icon:e.jsx(A.Copy,{size:V[1],strokeWidth:1.5}),"aria-label":r??o.copyToClipboard,onClick:d,...a})}function Cs({content:t,streaming:s=!1,...n}){const[r,a]=c.useState(s);return c.useEffect(()=>{a(!!s)},[s]),e.jsx(ge,{expanded:r,onToggle:a,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(A.Brain,{size:V[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ze,{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 Ms({count:t,current:s=0,done:n=[],onChange:r,showCounter:a=!0,className:o="","aria-label":i,...l}){const d=q(),{t:f}=ue();return e.jsxs("div",{className:["ds-step-indicator",o].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i??d.steps,children:Array.from({length:t},(u,h)=>{const x=h===s,m=n.includes(h)&&!x,b=r&&(h<=s||n.includes(h)),w=["ds-step-indicator__dot",x&&"ds-step-indicator__dot--active",m&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:w,role:"tab","aria-selected":x,"aria-label":f("stepN",{n:h+1}),disabled:!b||h===s,onClick:()=>r==null?void 0:r(h),children:m?e.jsx(A.Check,{size:8,strokeWidth:3}):null},h)})}),a&&e.jsxs(De,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function Fs({content:t,isStreaming:s=!1,cursor:n="line",onChunk:r,className:a="",...o}){const i=c.useRef(t);return c.useEffect(()=>{t!==i.current&&(r==null||r(t),i.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 zs({role:t="assistant",header:s,footer:n,attachments:r,isStreaming:a=!1,children:o,className:i="",...l}){const d=["ds-chat-message",`ds-chat-message--${t}`,a&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return t==="system"?e.jsx("div",{className:d,...l,children:e.jsx("span",{className:"ds-chat-message__system-label",children:o})}):t==="user"?e.jsxs("div",{className:d,...l,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,...l,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 Os(t,{containerRef:s,smartPause:n=!0}={}){const r=c.useRef(!1),a=c.useRef(0);c.useEffect(()=>{const o=s==null?void 0:s.current;if(!o)return;const i=()=>{const l=o.scrollHeight-o.scrollTop-o.clientHeight<64;!l&&o.scrollTop<a.current&&(r.current=!0),l&&(r.current=!1),a.current=o.scrollTop};return o.addEventListener("scroll",i,{passive:!0}),()=>o.removeEventListener("scroll",i)},[s]),c.useEffect(()=>{const o=s==null?void 0:s.current;o&&(n&&r.current||(o.scrollTop=o.scrollHeight))},t)}function ot({prompts:t,enabled:s,typingSpeed:n=38,erasingSpeed:r=18,holdTime:a=2200,betweenTime:o=380,manualPauseMs:i=5e3}){const[l,d]=c.useState(0),[f,u]=c.useState(""),h=c.useRef("typing"),x=c.useRef(0),m=c.useRef(0),b=c.useRef(null),w=c.useRef(0);c.useEffect(()=>{m.current=l},[l]),c.useEffect(()=>{if(b.current&&(clearTimeout(b.current),b.current=null),!s||t.length===0){u(""),x.current=0,h.current="typing";return}const g=()=>{const j=Date.now();if(w.current>j){b.current=setTimeout(g,w.current-j);return}const B=t[m.current%t.length]??"";h.current==="typing"?(x.current+=1,u(B.slice(0,x.current)),x.current>=B.length?(h.current="holding",b.current=setTimeout(g,a)):b.current=setTimeout(g,n+Math.random()*28)):h.current==="holding"?(h.current="erasing",b.current=setTimeout(g,r)):(x.current=Math.max(0,x.current-1),u(B.slice(0,x.current)),x.current<=0?(h.current="typing",m.current=(m.current+1)%t.length,d(m.current),b.current=setTimeout(g,o)):b.current=setTimeout(g,r))};return b.current=setTimeout(g,260),()=>{b.current&&clearTimeout(b.current)}},[s,t,n,r,a,o]);const k=g=>{if(t.length===0)return;const j=(g%t.length+t.length)%t.length,B=t[j];m.current=j,x.current=B.length,h.current="holding",w.current=Date.now()+i,d(j),u(B)},N=()=>k(m.current+1),S=()=>k(m.current-1),y=t[l%t.length]??"";return{displayed:f,currentPrompt:y,index:l,next:N,prev:S}}let Ws=0;function Hs({value:t="",onChange:s,onSubmit:n,onStop:r,onKeyDown:a,loading:o=!1,disabled:i=!1,placeholder:l,animatedPlaceholders:d,attachments:f,images:u,onAttachFiles:h,onAttachImages:x,onRemoveAttachment:m,onRemoveImage:b,acceptImage:w,acceptFile:k,maxImages:N,maxImageSize:S,leftSlot:y,rightSlot:g,className:j="",...B}){const D=q(),{t:L}=ue(),z=c.useRef(null),E=c.useRef(null),P=c.useRef(0),[H,F]=c.useState(!1),[C,_]=c.useState([]),T=l??D.promptPlaceholder,$=R=>{const M=++Ws;_(G=>[...G,{id:M,msg:R}]),setTimeout(()=>_(G=>G.filter(J=>J.id!==M)),6e3)},U=R=>_(M=>M.filter(G=>G.id!==R)),W=R=>R.type.startsWith("image/"),X=()=>!0,p=w??W,v=k??X,I=R=>{const M=[],G=[],J=[],Q=[];let te=0,le=N!=null?N-((u==null?void 0:u.length)??0):1/0;for(const se of R)p(se)?S&&se.size>S?J.push(se.name):le>0?(M.push(se),le--):te++:v(se)?G.push(se):Q.push(se.name);return{imageFiles:M,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:te}},O=R=>{const M=S?L("fileTooLargeMaxHint",{maxMb:S/1024/1024}):"";$(L("fileTooLarge",{maxHint:M,names:R.join(", ")}))},Z=R=>{const{imageFiles:M,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:te}=I(R);J.length&&O(J),Q.length&&$(L("filesSkipped",{names:Q.join(", ")})),te&&$(L("maxImages",{n:N})),x&&M.length&&x(M);const le=G.concat(x?[]:M);h&&le.length&&h(le)};c.useEffect(()=>{const R=E.current;R&&(R.style.height="auto",R.style.height=`${Math.min(R.scrollHeight,200)}px`)},[t]),c.useEffect(()=>{const R=M=>{var J,Q,te;if(o||i)return;const G=(J=M.target)==null?void 0:J.tagName;G==="INPUT"||G==="TEXTAREA"||G==="SELECT"||(Q=M.target)!=null&&Q.isContentEditable||M.ctrlKey||M.metaKey||M.altKey||M.key.length!==1&&M.key!=="Backspace"&&M.key!=="Delete"||(te=E.current)==null||te.focus()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o,i]);const re=R=>{R.preventDefault(),P.current++,R.dataTransfer.types.includes("Files")&&F(!0)},Y=R=>{R.preventDefault(),P.current--,P.current===0&&F(!1)},K=R=>R.preventDefault(),ie=R=>{R.preventDefault(),P.current=0,F(!1);const M=Array.from(R.dataTransfer.files);M.length&&Z(M)},he=R=>{const M=Array.from(R.target.files||[]);z.current&&(z.current.value=""),M.length&&Z(M)},Ee=R=>{var se;if(!x)return;const M=(se=R.clipboardData)==null?void 0:se.items;if(!M)return;const G=[];for(const dt of M){const Me=dt.getAsFile();Me&&G.push(Me)}if(G.length===0)return;const{imageFiles:J,tooLarge:Q,skipped:te,limitExceeded:le}=I(G);Q.length&&O(Q),te.length&&$(L("filesSkipped",{names:te.join(", ")})),le&&$(L("maxImages",{n:N})),J.length&&(R.preventDefault(),x(J))},xe=!o&&!i&&!!(d!=null&&d.length)&&t.length===0,je=ot({prompts:d??[],enabled:xe}),lt=R=>{if(xe){if(R.key==="ArrowDown"||R.key==="ArrowRight"){R.preventDefault(),je.next();return}if(R.key==="ArrowUp"||R.key==="ArrowLeft"){R.preventDefault(),je.prev();return}if(R.key==="Tab"&&!R.shiftKey){R.preventDefault(),s==null||s(je.currentPrompt);return}}a==null||a(R)},ct=(t.trim()||(u==null?void 0:u.length)>0||(f==null?void 0:f.length)>0)&&!i,Ce=h||x;return e.jsxs("div",{className:["ds-prompt-input",j].filter(Boolean).join(" "),...B,children:[Ce&&e.jsx("input",{ref:z,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:he}),e.jsxs("div",{className:["ds-prompt-input__box",H&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:re,onDragLeave:Y,onDragOver:K,onDrop:ie,children:[H&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:D.dropFilesHere}),e.jsx("textarea",{ref:E,value:t,onChange:R=>s==null?void 0:s(R.target.value),onKeyDown:lt,onPaste:Ee,placeholder:xe?"":T,disabled:o||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((R,M)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:R.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>b==null?void 0:b(M),"aria-label":D.removeImage,type:"button",children:e.jsx(A.X,{size:12,strokeWidth:2})})]},M))}),C.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:C.map(R=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:R.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>U(R.id),"aria-label":D.dismiss,children:e.jsx(A.X,{size:V[1],strokeWidth:1.5})})]},R.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((R,M)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[R.uploading?e.jsx(A.Loader,{size:V[1],strokeWidth:1.5,className:"spin"}):e.jsx(A.Paperclip,{size:V[1],strokeWidth:1.5}),R.filename,R.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:D.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>m==null?void 0:m(M),"aria-label":D.removeAttachment,children:e.jsx(A.X,{size:V[1],strokeWidth:1.5})})]})},M))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[Ce&&e.jsx(ne,{variant:"ghost",size:"xs",icon:e.jsx(A.Paperclip,{size:V[2],strokeWidth:1.5}),"aria-label":D.attachFiles,onClick:()=>{var R;return(R=z.current)==null?void 0:R.click()}}),y,g,e.jsx("div",{className:"ds-prompt-input__spacer"}),o?e.jsx(ne,{variant:"primary",size:"xs",icon:e.jsx(A.Square,{size:V[2],strokeWidth:1.5}),onClick:r,"aria-label":D.stop}):e.jsx(ne,{variant:"primary",size:"xs",icon:e.jsx(A.ArrowUp,{size:V[2],strokeWidth:1.5}),onClick:n,disabled:!ct,"aria-label":D.send})]})]})]})}const Ye={fast:0,standard:1,premium:2},qe={fast:"data-5",standard:"data-3",premium:"data-6"};function Us({models:t=[],value:s,onChange:n,size:r="xs",minTier:a,showAutoOption:o=!1,groupByTier:i=!0,className:l="",...d}){const[f,u]=c.useState(!1),h=c.useRef(null),x=c.useRef(null),m=c.useRef(null),[b,w]=c.useState({}),k=t.filter(E=>!a||E.name==="auto"?!0:(Ye[E.tier]??1)>=(Ye[a]??1)),N=k.find(E=>E.name==="auto"),S=k.filter(E=>E.name!=="auto"),y=t.find(E=>E.name===s),j=new Set(S.map(E=>E.tier).filter(Boolean)).size>1;c.useEffect(()=>{if(!f)return;const E=320,P=()=>{var $;const C=($=x.current)==null?void 0:$.getBoundingClientRect();if(!C)return;const _=window.innerHeight-C.bottom,T=_<E+8&&C.top>_;w({position:"fixed",zIndex:"var(--z-dropdown, 500)",left:C.left,...T?{bottom:window.innerHeight-C.top+4,top:"auto"}:{top:C.bottom+4,bottom:"auto"}})};P(),window.addEventListener("scroll",P,!0),window.addEventListener("resize",P);const H=C=>{var _,T;!((_=h.current)!=null&&_.contains(C.target))&&!((T=m.current)!=null&&T.contains(C.target))&&u(!1)},F=C=>{C.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",H),document.addEventListener("keydown",F),()=>{window.removeEventListener("scroll",P,!0),window.removeEventListener("resize",P),document.removeEventListener("mousedown",H),document.removeEventListener("keydown",F)}},[f]);const B=E=>{n==null||n(E),u(!1)},D=E=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",E.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>B(E.name),children:[E.icon?e.jsx("span",{className:"ds-model-picker__item-icon",children:E.icon}):e.jsx(A.Cpu,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:E.displayName||E.name}),j&&E.tier&&e.jsx(ce,{size:"xs",variant:qe[E.tier]||"default",children:E.tier})]},E.name),L=()=>!i||!j?S.map(D):["fast","standard","premium"].flatMap(E=>{const P=S.filter(H=>H.tier===E);return P.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":E,children:E.charAt(0).toUpperCase()+E.slice(1)},`lbl-${E}`),...P.map(D)]:[]}),z=f&&e.jsxs("div",{ref:m,className:"ds-model-picker__menu ds-scrollable","data-ds-portal":"",style:b,children:[o&&N&&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:()=>B("auto"),children:[e.jsx(A.Zap,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),S.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),L()]});return e.jsxs("div",{ref:h,className:["ds-model-picker",l].filter(Boolean).join(" "),...d,children:[e.jsxs("button",{ref:x,type:"button",className:"ds-model-picker__trigger",onClick:()=>u(E=>!E),"aria-haspopup":"listbox","aria-expanded":f,children:[y!=null&&y.icon?e.jsx("span",{children:y.icon}):e.jsx(A.Cpu,{size:12,strokeWidth:1.5}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(y==null?void 0:y.displayName)||(y==null?void 0:y.name)||s}),j&&(y==null?void 0:y.tier)&&e.jsx(ce,{size:"xs",variant:qe[y.tier]||"default",children:y.tier})]}),typeof document<"u"&&ee.createPortal(z,document.body)]})}const Vs=({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 Xs(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 Ys({sources:t=[],layout:s="list",title:n,maxVisible:r=5,onSourceClick:a}){const o=q(),{t:i}=ue(),l=n??o.sources,[d,f]=c.useState(!1),u=Xs(t),h=u.length>r,x=d?u:u.slice(0,r),m=t.some(N=>N.snippet),b=N=>N!=null&&N.length?i("pageAbbrev",{pages:N.join(", ")}):null,w=i("moreSources",{n:u.length-r}),k=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:k,children:[x.map(N=>{const S=N.items.map(j=>j.page).filter(Boolean),y=b(S),g=!!a;return e.jsxs("div",{className:`ds-sources-panel__compact-row${g?" ds-sources-panel__compact-row--clickable":""}`,onClick:g?()=>a(N.items[0]):void 0,children:[e.jsx(A.FileText,{size:V[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:N.filename}),y&&e.jsx("span",{className:"ds-sources-panel__pages",children:y})]},N.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:w})]}):e.jsxs("div",{className:k,children:[l&&e.jsx("div",{className:"ds-sources-panel__title",children:l}),x.map(N=>{const S=N.items.map(j=>j.page).filter(Boolean),y=b(S),g=!!a;return m?e.jsx(ge,{title:e.jsx(Vs,{filename:N.filename,pagesLabel:y}),padding:"s",children:N.items.map((j,B)=>e.jsx("div",{className:`ds-sources-panel__snippet${g?" ds-sources-panel__snippet--clickable":""}`,onClick:g?()=>a(j):void 0,children:j.snippet??i("pageAbbrev",{pages:j.page})},B))},N.filename):e.jsxs("div",{className:`ds-sources-panel__row${g?" ds-sources-panel__row--clickable":""}`,onClick:g?()=>a(N.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:N.filename}),y&&e.jsx("span",{className:"ds-sources-panel__pages",children:y})]},N.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:w})]})}function Ge(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function qs({used:t,limit:s,size:n="s",showCount:r=!0,showPercent:a=!1,warningThreshold:o=.8,errorThreshold:i=1}){const l=s>0?t/s:0,d=Math.min(l*100,100),f=l>=i?"error":l>=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:[Ge(t)," / ",Ge(s)]}),a&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(l*100),"%"]})]})]})}const Ke=5;function Gs(t){return t<.34?"low":t<.67?"medium":"high"}function Ks({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*Ke),i=Gs(a);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:Ke},(l,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:i})]})}const Js={add:"+",remove:"-",context:" "};function Re({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:Js[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function Zs({lines:t=[],layout:s="inline",wordWrap:n=!1,lineNumbers:r=!0,maxHeight:a,title:o}){const i=["ds-diff-view",`ds-diff-view--${s}`,n&&"ds-diff-view--wrap"].filter(Boolean).join(" "),l=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:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsxs("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:[e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((u,h)=>e.jsx(Re,{line:u,lineNumbers:r},h))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:f.map((u,h)=>e.jsx(Re,{line:u,lineNumbers:r},h))})]})]})}return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:t.map((d,f)=>e.jsx(Re,{line:d,lineNumbers:r},f))})]})}function it({value:t="idle",onLike:s,onDislike:n,className:r="",likeLabel:a,dislikeLabel:o,...i}){const l=q(),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":a??l.like,"aria-pressed":t==="liked",children:e.jsx(A.ThumbsUp,{size:V[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??l.dislike,"aria-pressed":t==="disliked",children:e.jsx(A.ThumbsDown,{size:V[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function Qs(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 i=s.getDate(),l=s.toLocaleString([],{month:"short"});return`${i} ${l} ${r}`}function en({role:t="assistant",text:s,timestamp:n,feedbackValue:r="idle",onLike:a,onDislike:o,className:i="",...l}){const d=t==="assistant"&&(a||o),f=!!s,u=n?Qs(n):null;return!d&&!f&&!u?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${t}`,i].filter(Boolean).join(" "),...l,children:[t==="user"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u}),d&&e.jsx(it,{className:"ds-message-action",value:r,onLike:a,onDislike:o}),f&&e.jsx(at,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function tn({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 sn({variant:t="light",glow:s,mask:n=!0,style:r,...a}){const o=t==="dark",i=s??o,l=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,...i&&{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(${l} 1px, transparent 1px)`,`linear-gradient(90deg, ${l} 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 nn({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 Se=280,rn=22,an=14,oe=8,we=6,on=200;function ln(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function cn(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 i=Math.max(t.top,o-t.bottom,a-t.right,t.left);return i===o-t.bottom?"bottom":i===t.top?"top":i===a-t.right?"right":"left"}function dn(t,s,n,r,a){const o=window.innerWidth,i=window.innerHeight;let l,d;switch(t){case"top":l=s.top-n-a,d=s.left+s.width/2-r/2;break;case"bottom":l=s.bottom+a,d=s.left+s.width/2-r/2;break;case"left":l=s.top+s.height/2-n/2,d=s.left-r-a;break;default:l=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(i-n-oe,l));return{top:u,left:f,arrowOffset:d-f,arrowOffsetY:l-u}}function un({steps:t,currentStep:s,onNext:n,onBack:r,onSkip:a,onFinish:o,overlay:i=!0,ring:l=!0,labelNext:d,labelBack:f,labelSkip:u,labelFinish:h,statePrimary:x="idle",stateBack:m="idle"}){const b=q(),{t:w}=ue(),k=d??b.next,N=f??b.back,S=u??b.skipTour,y=h??b.done,g=c.useRef(null),j=c.useRef(t),B=c.useRef(s),D=c.useRef(l);j.current=t,B.current=s,D.current=l;const[L,z]=c.useState(!1),[E,P]=c.useState({position:"fixed",visibility:"hidden",width:Se}),[H,F]=c.useState("bottom"),[C,_]=c.useState(null),T=c.useRef(!1),$=t[s],U=s===t.length-1,W=c.useCallback(()=>{const X=j.current[B.current];if(!X||!g.current)return;const p=ln(X.target);if(!p)return;const v=p.getBoundingClientRect(),O=g.current.getBoundingClientRect().height||160,Z=Se,re=D.current?rn:an,Y=X.position||cn(v,O,Z,re),{top:K,left:ie,arrowOffset:he,arrowOffsetY:Ee}=dn(Y,v,O,Z,re);F(Y),P({position:"fixed",top:K,left:ie,width:Se,visibility:"visible","--arrow-offset":`${he}px`,"--arrow-offset-y":`${Ee}px`}),_({top:v.top-we,left:v.left-we,width:v.width+we*2,height:v.height+we*2})},[]);return c.useEffect(()=>{window.addEventListener("scroll",W,!0),window.addEventListener("resize",W);const X=requestAnimationFrame(()=>{W(),z(!0),T.current=!0});return()=>{cancelAnimationFrame(X),window.removeEventListener("scroll",W,!0),window.removeEventListener("resize",W)}},[]),c.useEffect(()=>{if(!T.current)return;z(!1);const X=setTimeout(()=>{P(p=>({...p,visibility:"hidden"})),requestAnimationFrame(()=>{W(),z(!0)})},on+20);return()=>clearTimeout(X)},[s]),c.useEffect(()=>{L&&g.current&&g.current.focus({preventScroll:!0})},[L]),c.useEffect(()=>{const X=p=>{p.key==="Escape"&&a()};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[a]),c.useEffect(()=>{if(!L)return;const X=p=>{if(p.key!=="Tab"||!g.current)return;const v=Array.from(g.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!v.length)return;const I=v[0],O=v[v.length-1];p.shiftKey&&document.activeElement===I?(p.preventDefault(),O.focus()):!p.shiftKey&&document.activeElement===O&&(p.preventDefault(),I.focus())};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[L]),!$||typeof document>"u"?null:ee.createPortal(e.jsxs(e.Fragment,{children:[C&&e.jsx("div",{className:["ds-coachmark__spotlight",i&&"ds-coachmark__spotlight--overlay",!l&&"ds-coachmark__spotlight--no-ring",L&&"ds-coachmark__spotlight--visible"].filter(Boolean).join(" "),style:C,"aria-hidden":"true"}),e.jsxs("div",{ref:g,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":$.title??w("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${H}`,L&&"ds-coachmark__bubble--visible"].filter(Boolean).join(" "),style:E,tabIndex:-1,children:[e.jsx("button",{type:"button",className:"ds-coachmark__close",onClick:a,"aria-label":S,children:e.jsx(A.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(ne,{variant:"secondary",size:"s",state:m,onClick:r,children:N}),e.jsx(ne,{variant:"primary",size:"s",state:x,onClick:U?o:n,children:U?y:k})]})]})]})]}),document.body)}function fn(t,s={}){const{storageKey:n}=s,[r,a]=c.useState(0),[o,i]=c.useState(!1),l=()=>n&&typeof localStorage<"u"&&localStorage.getItem(n)==="done",d=c.useCallback(()=>{i(!1),n&&typeof localStorage<"u"&&localStorage.setItem(n,"done")},[n]);return{currentStep:r,isActive:o,start:()=>{l()||(a(0),i(!0))},next:()=>a(f=>Math.min(f+1,t.length-1)),back:()=>a(f=>Math.max(f-1,0)),skip:d,finish:d}}function mn(){const t=c.useRef(null),s=c.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=ge;exports.Alert=Et;exports.AnimatedNumber=Ts;exports.Avatar=Jt;exports.Badge=ce;exports.Banner=ys;exports.BottomSheet=At;exports.Breadcrumb=ls;exports.BrowserPane=Pt;exports.BrowserTabs=Ct;exports.Button=ne;exports.Card=_t;exports.ChatMessage=zs;exports.Checkbox=Xt;exports.Coachmark=un;exports.Code=Bt;exports.CodeAccordion=Qe;exports.ConfidenceBar=Ks;exports.CopyButton=at;exports.DiffView=Zs;exports.Dropdown=ks;exports.EmptyState=as;exports.EngineerGrid=sn;exports.FormField=os;exports.H1=jt;exports.H2=Nt;exports.H3=wt;exports.H4=gt;exports.InView=$s;exports.Input=ht;exports.Link=It;exports.List=Mt;exports.ListRow=Ft;exports.LocaleProvider=mt;exports.Mention=Ut;exports.MessageFeedback=it;exports.MessageFooter=en;exports.Modal=Tt;exports.ModalFooter=de;exports.ModelPicker=Us;exports.NavRail=ms;exports.NavRailAgent=Ns;exports.NavRailBody=hs;exports.NavRailCustomItem=js;exports.NavRailDivider=bs;exports.NavRailFlyout=ws;exports.NavRailFooter=vs;exports.NavRailHeader=xs;exports.NavRailItem=ps;exports.NavRailRecents=_s;exports.P1=yt;exports.P2=Ze;exports.P3=De;exports.Pagination=cs;exports.ProgressBar=Es;exports.PromptInput=Hs;exports.Radio=Yt;exports.ReasoningBlock=Cs;exports.Scrollable=nn;exports.SegmentedControl=zt;exports.Select=vt;exports.SidePage=fs;exports.SidePageFooter=$e;exports.Skeleton=et;exports.SourcesPanel=Ys;exports.Spinner=Je;exports.Stat=is;exports.StepIndicator=Ms;exports.Stepper=bt;exports.StreamingText=Fs;exports.Tab=Lt;exports.Table=Zt;exports.TableBody=es;exports.TableHead=Qt;exports.TableRow=ts;exports.TableSubheaderRow=ss;exports.Tabs=Dt;exports.Td=rs;exports.Textarea=xt;exports.Th=ns;exports.ThinkingDot=tn;exports.ToastContainer=Ls;exports.Toggle=Vt;exports.TokenCounter=qs;exports.ToolCallBubble=rt;exports.ToolCallCard=rt;exports.Tooltip=ye;exports.defaultStrings=_e;exports.formatString=Be;exports.iconSizes=V;exports.useAnimatedNumber=tt;exports.useAnimatedPlaceholder=ot;exports.useCoachmark=fn;exports.useInView=st;exports.useLocale=ue;exports.useShake=mn;exports.useStreamScroll=Os;exports.useStrings=q;exports.useToast=Is;
|
|
22
|
+
<%s key={someKey} {...props} />`,W,Y,K,Y),X[Y+W]=!0)}if(Y=null,I!==void 0&&(n(I),Y=""+I),i(b)&&(n(b.key),Y=""+b.key),"key"in b){I={};for(var ie in b)ie!=="key"&&(I[ie]=b[ie])}else I=b;return Y&&l(I,typeof p=="function"?p.displayName||p.name||"Unknown":p),f(p,Y,I,a(),Z,re)}function h(p){x(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===M&&(p._payload.status==="fulfilled"?x(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function x(p){return typeof p=="object"&&p!==null&&p.$$typeof===j}var m=c,j=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),_=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),z=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,V=Array.isArray,v=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(p){return p()}};var T,S={},O=m.react_stack_bottom_frame.bind(m,o)(),H=v(r(o)),X={};be.Fragment=y,be.jsx=function(p,b,I){var W=1e4>z.recentlyCreatedOwnerStacks++;return u(p,b,I,!1,W?Error("react-stack-top-frame"):O,W?v(r(p)):H)},be.jsxs=function(p,b,I){var W=1e4>z.recentlyCreatedOwnerStacks++;return u(p,b,I,!0,W?Error("react-stack-top-frame"):O,W?v(r(p)):H)}}()),be}process.env.NODE_ENV==="production"?Te.exports=ut():Te.exports=ft();var e=Te.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=c.createContext({strings:_e,t:(t,s)=>Be(_e[t]??t,s)});function mt({strings:t,children:s}){const n=c.useMemo(()=>{const r={..._e,...t};return{strings:r,t:(a,o)=>Be(r[a]??_e[a]??a,o)}},[t]);return e.jsx(Ie.Provider,{value:n,children:s})}function ue(){return c.useContext(Ie)}function q(){return c.useContext(Ie).strings}function Je({size:t="m",color:s="default",className:n="","aria-label":r,...a}){const o=q();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 pt={xs:12,s:14,m:16,l:20};function ne({children:t,variant:s="primary",size:n="m",fullWidth:r=!1,icon:a,disabled:o=!1,state:i="idle",active:l=!1,pressed:d=!1,onClick:f,type:u="button",href:h,"aria-label":x,"aria-pressed":m,className:j="",...w}){const y=a&&!t,N=i==="loading",$=i==="success",E=i==="error",_=N||$||E,g=!!(l||d),A=n==="xs"?"s":"m",D=s==="danger"?"on-accent":"default",L=pt[n]??16,M=N?e.jsx(Je,{size:A,color:D}):$?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.Check,{size:L,strokeWidth:2.5})}):E?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.X,{size:L,strokeWidth:2.5})}):null,F=["ds-button",`ds-button--${s}`,`ds-button--${n}`,r&&"ds-button--full",y&&"ds-button--icon-only",j].filter(Boolean).join(" "),k=i!=="idle"?i:void 0,z=m!==void 0?m:g?!0:void 0,P=e.jsxs(e.Fragment,{children:[_?M:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),t]});if(h){const V=v=>{if(o||N){v.preventDefault();return}v.metaKey||v.ctrlKey||v.button===1||(v.preventDefault(),f==null||f(v))};return e.jsx("a",{className:F,href:o||N?void 0:h,onClick:V,"aria-label":x,"aria-disabled":o||N?"true":void 0,"aria-busy":N?"true":void 0,"aria-pressed":z,"data-state":k,"data-active":g?"true":void 0,...w,children:P})}return e.jsx("button",{type:u,className:F,disabled:o,onClick:N?void 0:f,"aria-label":x,"aria-busy":N?"true":void 0,"aria-pressed":z,"data-state":k,"data-active":g?"true":void 0,...w,children:P})}function ht({label:t,error:s,hint:n,fullWidth:r=!0,icon:a,iconRight:o,onIconRightClick:i,size:l="m",disabled:d,id:f,iconRightLabel:u,...h}){const x=q(),m=f||`input-${c.useId()}`,j=n?`${m}-hint`:void 0,w=s?`${m}-error`:void 0,y=w||j;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:m,children:t}),e.jsxs("div",{className:"ds-input-container",children:[a&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:a}),e.jsx("input",{id:m,className:`ds-input ds-input--${l} ${a?"ds-input--with-icon":""} ${o?"ds-input--with-icon-right":""} ${s?"ds-input--error":""}`,disabled:d,"aria-invalid":s?"true":"false","aria-describedby":y,...h}),o&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":u??x.toggleVisibility,children:o})]}),n&&!s&&e.jsx("span",{id:j,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:w,className:"ds-input-error",role:"alert",children:s})})})]})}function xt({label:t,error:s,hint:n,fullWidth:r=!0,size:a="m",disabled:o,id:i,resize:l=!0,rows:d=3,...f}){const u=i||`textarea-${c.useId()}`,h=n?`${u}-hint`:void 0,x=s?`${u}-error`:void 0,m=x||h;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":""} ${l?"":"ds-textarea--no-resize"}`,disabled:o,"aria-invalid":s?"true":"false","aria-describedby":m,rows:d,...f}),n&&!s&&e.jsx("span",{id:h,className:"ds-textarea-hint",children:n}),s&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:s})]})}function vt({label:t,value:s,onChange:n,options:r=[],placeholder:a,error:o,fullWidth:i=!0,size:l="m",disabled:d=!1,id:f,...u}){const h=q(),x=a??h.selectOption,[m,j]=c.useState(!1),[w,y]=c.useState(!1),[N,$]=c.useState({}),[E,_]=c.useState("down"),[g,A]=c.useState(-1),D=c.useRef(null),L=c.useRef(null),M=c.useRef(null),F=c.useRef(null),k=f||`select-${c.useId()}`,z=`${k}-label`,P=o?`${k}-error`:void 0,V=150,v=(b=!1)=>{w||(y(!0),A(-1),F.current=setTimeout(()=>{var I;j(!1),y(!1),b&&((I=M.current)==null||I.focus())},V))},T=b=>{clearTimeout(F.current),y(!1);const I=b!==void 0?b:Math.max(r.findIndex(W=>W.value===s),0);A(I),j(!0)};c.useEffect(()=>()=>clearTimeout(F.current),[]);const S=()=>{var K;const b=(K=D.current)==null?void 0:K.getBoundingClientRect();if(!b)return;const I=window.innerHeight,W=I-b.bottom,Z=b.top,Y=W<300&&Z>W;_(Y?"up":"down"),$(Y?{bottom:I-b.top+4,left:b.left,width:b.width}:{top:b.bottom+4,left:b.left,width:b.width})};c.useEffect(()=>{if(m)return S(),window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[m]),c.useEffect(()=>{const b=I=>{D.current&&!D.current.contains(I.target)&&L.current&&!L.current.contains(I.target)&&v()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[w]),c.useEffect(()=>{var I;if(!m||g<0||!L.current)return;(I=L.current.querySelectorAll(".ds-select-option")[g])==null||I.scrollIntoView({block:"nearest"})},[g,m]);const O=b=>{switch(b.key){case"ArrowDown":b.preventDefault(),m?A(I=>Math.min(I+1,r.length-1)):T();break;case"ArrowUp":b.preventDefault(),m?A(I=>Math.max(I-1,0)):T(r.length-1);break;case"Home":m&&(b.preventDefault(),A(0));break;case"End":m&&(b.preventDefault(),A(r.length-1));break;case"Enter":case" ":b.preventDefault(),m?g>=0&&(n==null||n(r[g].value),v(!0)):T();break;case"Escape":m&&(b.preventDefault(),v(!0));break;case"Tab":m&&v(!1);break}},H=r.find(b=>b.value===s),X=l==="xs"?U[1]:l==="small"?U[2]:U[3],p=m&&e.jsx("div",{ref:L,"data-ds-portal":"",role:"listbox","aria-labelledby":t?z:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${E}`,w&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:N,children:r.map((b,I)=>e.jsx("button",{id:`${k}-opt-${I}`,type:"button",role:"option",tabIndex:-1,"aria-selected":s===b.value,className:["ds-select-option",`ds-select-option--${l}`,s===b.value&&"ds-select-option--selected",I===g&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{n==null||n(b.value),v(!0)},children:b.label},b.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:z,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:D,children:e.jsxs("button",{ref:M,type:"button",id:k,role:"combobox","aria-haspopup":"listbox","aria-expanded":m,"aria-activedescendant":m&&g>=0?`${k}-opt-${g}`:void 0,"aria-labelledby":t?z:void 0,"aria-invalid":o?"true":"false","aria-describedby":P,className:`ds-select-trigger ds-select-trigger--${l} ${o?"ds-select-trigger--error":""}`,onClick:()=>{d||(m?v():T())},onKeyDown:O,disabled:d,...u,children:[e.jsx("span",{className:H?"":"ds-select-placeholder",children:(H==null?void 0:H.label)||x}),e.jsx(B.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${m&&E==="down"?"ds-select-icon--open":""} ${m&&E==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),o&&e.jsx("span",{id:P,className:"ds-select-error",role:"alert",children:o}),typeof document<"u"&&ee.createPortal(p,document.body)]})}function bt({label:t,value:s=0,onChange:n,min:r=0,max:a=100,step:o=1,size:i="m",disabled:l=!1,hint:d,error:f,decreaseLabel:u,increaseLabel:h,...x}){const m=q(),j=()=>{if(l)return;const _=Math.min(Number(s)+o,a);n==null||n(_)},w=()=>{if(l)return;const _=Math.max(Number(s)-o,r);n==null||n(_)},y=_=>{if(l)return;const g=_.target.value;if(g===""){n==null||n(r);return}const A=Number(g);if(!isNaN(A)){const D=Math.min(Math.max(A,r),a);n==null||n(D)}},N=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),$=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),E=i==="xs"?U[1]:i==="small"?U[2]:U[3];return e.jsxs("div",{className:N,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:w,disabled:l||s<=r,"aria-label":u??m.decrease,children:e.jsx(B.Minus,{size:E,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:y,min:r,max:a,step:o,disabled:l,...x}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:j,disabled:l||s>=a,"aria-label":h??m.increase,children:e.jsx(B.Plus,{size:E,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 _t({children:t,padding:s="m",variant:n="default",hover:r=!1,onClick:a,href:o,disabled:i=!1,className:l="",...d}){const u=(r?"interactive":n)==="interactive"||a||o,h=["ds-card",`ds-card--${s}`,u&&"ds-card--interactive",l].filter(Boolean).join(" ");if(o){const j=w=>{if(i){w.preventDefault();return}w.metaKey||w.ctrlKey||w.button===1||(w.preventDefault(),a==null||a(w))};return e.jsx("a",{className:h,href:i?void 0:o,onClick:j,"aria-disabled":i?"true":void 0,...d,children:t})}const x=u&&a?"button":"div",m=u&&a?{type:"button",onClick:a,disabled:i}:{};return e.jsx(x,{className:h,role:u&&!a?"article":void 0,...m,...d,children:t})}function jt({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function Nt({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function wt({children:t,...s}){return e.jsx("h3",{className:"ds-h3",...s,children:t})}function gt({children:t,...s}){return e.jsx("h4",{className:"ds-h4",...s,children:t})}function yt({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function Ze({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,...a}){const o=["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:o,role:i,...a,children:t})}const kt={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle},Et=c.forwardRef(function({children:s,variant:n="info",title:r,onClose:a,role:o,closeLabel:i,...l},d){const f=q(),u=kt[n],h=o||(n==="error"?"alert":"status");return e.jsxs("div",{ref:d,className:`ds-alert ds-alert--${n} ${r?"":"ds-alert--no-title"}`,role:h,...l,children:[u&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(u,{size:U[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":i??f.closeAlert,children:e.jsx(B.X,{size:U[3],strokeWidth:1.5})})]})}),Rt="data-ds-portal";function Le(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 Pe(t,s){var r;const n=(r=t==null?void 0:t.closest)==null?void 0:r.call(t,`[${Rt}]`);return!!(n&&n!==s)}const St=200;function Tt({children:t,title:s,onClose:n,size:r="m",scrollable:a=!1,subHeader:o,closeLabel:i,...l}){const d=q(),f=c.useRef(null),u=c.useRef(null),h=c.useId(),[x,m]=c.useState(!1),j=()=>{!n||x||(m(!0),setTimeout(()=>{m(!1),n()},St))};c.useEffect(()=>{const E=g=>{g.key==="Escape"&&j()},_=g=>{var D;const A=Le(g);A&&((D=u.current)!=null&&D.contains(A)||Pe(A,f.current)||j())};return document.addEventListener("keydown",E),document.addEventListener("mousedown",_),()=>{document.removeEventListener("keydown",E),document.removeEventListener("mousedown",_)}},[n,x]);const w=c.Children.toArray(t),y=w.find(E=>(E==null?void 0:E.type)===de),N=w.filter(E=>(E==null?void 0:E.type)!==de),$=e.jsx("div",{className:["ds-modal-overlay",x&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...l,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?h:void 0,children:[n&&e.jsx(ne,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:U[2],strokeWidth:1.5}),onClick:j,"aria-label":i??d.closeModal}),(s||o)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:h,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:N}),y]})});return typeof document>"u"?$:ee.createPortal($,document.body)}function de({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const $t=320;function At({children:t,title:s,onClose:n,subHeader:r,closeLabel:a,...o}){const i=q(),l=c.useRef(null),d=c.useRef(null),f=c.useId(),[u,h]=c.useState(!1),x=()=>{!n||u||(h(!0),setTimeout(()=>{h(!1),n()},$t))};c.useEffect(()=>{const N=E=>{E.key==="Escape"&&x()},$=E=>{var g;const _=Le(E);_&&((g=d.current)!=null&&g.contains(_)||Pe(_,l.current)||x())};return document.addEventListener("keydown",N),document.addEventListener("mousedown",$),()=>{document.removeEventListener("keydown",N),document.removeEventListener("mousedown",$)}},[n,u]);const m=c.Children.toArray(t),j=m.find(N=>(N==null?void 0:N.type)===de),w=m.filter(N=>(N==null?void 0:N.type)!==de),y=e.jsx("div",{className:["ds-bottom-sheet-overlay",u&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...o,ref:l,"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(ne,{className:"ds-bottom-sheet__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:U[2],strokeWidth:1.5}),onClick:x,"aria-label":a??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:w}),j]})});return typeof document>"u"?y:ee.createPortal(y,document.body)}function Qe({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="s",className:i="",...l}){const d=q(),f=s??d.code,[u,h]=c.useState(n),x=r!==void 0,m=x?r:u,j=()=>{x?a==null||a(!r):h(y=>!y)},w=["ds-code-accordion",`ds-code-accordion--${o}`,m&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:w,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:j,"aria-expanded":m,children:[e.jsx("span",{className:"ds-code-accordion__title",children:f}),e.jsx(B.ChevronDown,{size:U[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${m?"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 Bt({children:t,block:s=!1,collapsible:n=!1,title:r,defaultExpanded:a=!1,...o}){const i=q(),l=r??i.code;return s?n?e.jsx(Qe,{title:l,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 It({href:t,children:s,onClick:n,target:r,rel:a,...o}){const l=r==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:t,className:"ds-link",onClick:n,target:r,rel:l,...o,children:s})}function Dt({children:t,size:s="m",variant:n="ghost",...r}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...r,children:c.Children.map(t,a=>c.isValidElement(a)?c.cloneElement(a,{size:s,variant:n}):a)})}function Lt({children:t,selected:s=!1,onClick:n,size:r="m",variant:a="ghost",disabled:o=!1,icon:i,href:l,...d}){const f=i&&!t,u=["ds-tab",`ds-tab--${r}`,`ds-tab--${a}`,s&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),h=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),t]});if(l){const x=m=>{if(o){m.preventDefault();return}m.metaKey||m.ctrlKey||m.button===1||(m.preventDefault(),n==null||n(m))};return e.jsx("a",{role:"tab","aria-current":s?"page":void 0,"aria-disabled":o?"true":void 0,className:u,href:o?void 0:l,onClick:x,...d,children:h})}return e.jsx("button",{role:"tab","aria-selected":s,className:u,onClick:n,disabled:o,...d,children:h})}function Pt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-browser-pane",s].filter(Boolean).join(" "),...n,children:t})}function Ct({tabs:t,active:s,onChange:n,onClose:r,className:a="",...o}){const{t:i}=ue();return e.jsx("div",{className:["ds-browser-tabs",a].filter(Boolean).join(" "),role:"tablist",...o,children:t.map(l=>{const d=l.id===s,f=!!l.closable;return e.jsxs("div",{className:["ds-browser-tab",d&&"ds-browser-tab--active",f&&"ds-browser-tab--closable"].filter(Boolean).join(" "),title:l.label,children:[e.jsxs("button",{type:"button",role:"tab","aria-selected":d,className:"ds-browser-tab__hit",onClick:()=>n==null?void 0:n(l.id),children:[l.icon?e.jsx("span",{className:"ds-browser-tab__icon","aria-hidden":!0,children:l.icon}):null,e.jsx("span",{className:"ds-browser-tab__label",children:l.label})]}),f?e.jsx("button",{type:"button",className:"ds-browser-tab__close","aria-label":i("closeTab",{label:l.label}),onClick:u=>{u.stopPropagation(),r==null||r(l.id)},children:e.jsx(B.X,{size:12,strokeWidth:2})}):null]},l.id)})})}function Mt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-list",s].filter(Boolean).join(" "),role:"list",...n,children:t})}function Ft({icon:t,title:s,subtitle:n,meta:r,onClick:a,className:o="",...i}){const l=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]}),l.map((u,h)=>e.jsx("span",{className:"ds-list-row__meta",children:u},h))]});return a?e.jsx("button",{type:"button",role:"listitem",className:d,onClick:a,...i,children:f}):e.jsx("div",{role:"listitem",className:d,...i,children:f})}function zt({options:t,value:s,onChange:n,size:r="m",disabled:a=!1}){const o=c.useRef(null),i=c.useRef(null),[l,d]=c.useState(!1),f=c.useRef(!1),u=c.useRef(null),h=c.useRef(null),x=()=>{if(!o.current)return;const m=o.current.querySelector(`[data-value="${s}"]`);if(!m)return;const j=o.current.getBoundingClientRect(),w=m.getBoundingClientRect(),y=w.left-j.left,N=w.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=y+"px",i.current.style.width=N+"px",f.current=!1):(d(!0),requestAnimationFrame(()=>{if(!i.current||!o.current)return;const $=o.current.querySelector(`[data-value="${s}"]`);if(!$)return;const E=o.current.getBoundingClientRect(),_=$.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=_.left-E.left+"px",i.current.style.width=_.width+"px"}))};return h.current=x,c.useLayoutEffect(()=>{const m=u.current!==s;u.current=s,f.current=l&&m,x()}),c.useEffect(()=>{if(!o.current)return;const m=new ResizeObserver(()=>{f.current=!1,h.current()});return m.observe(o.current),()=>m.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${r}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:o,role:"group",children:[l&&e.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),t.map(m=>e.jsxs("button",{type:"button","data-value":m.value,className:["ds-seg__btn",s===m.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&n(m.value),"aria-pressed":s===m.value,disabled:a,children:[m.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:m.icon}),m.label]},m.value))]})}function ge({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="m",...i}){const[l,d]=c.useState(n),f=r!==void 0,u=f?r:l,h=()=>{f?a==null||a(!r):d(m=>!m)},x=["ds-accordion",`ds-accordion--${o}`,u&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...i,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:h,"aria-expanded":u,children:[e.jsx("span",{className:"ds-accordion__title",children:s}),e.jsx(B.ChevronDown,{size:U[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 Ot(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 i=Math.max(fe,Math.min(r-n.width-fe,o)),l=o-i;return{top:a,left:i,arrowOffset:l}}function Wt(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 ye({children:t,content:s,position:n,...r}){const[a,o]=c.useState(!1),[i,l]=c.useState({visibility:"hidden"}),[d,f]=c.useState(n||"top"),u=c.useRef(null),h=c.useRef(null),x=c.useRef(!1),m=()=>{if(!u.current||!h.current)return;const w=u.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),N=n||Wt(w,y.height,y.width),{top:$,left:E,arrowOffset:_}=Ot(N,w,y);f(N),l({position:"fixed",top:$,left:E,visibility:"visible","--arrow-offset":`${_}px`})};if(c.useEffect(()=>{if(!a)return;l({position:"fixed",visibility:"hidden"});const w=requestAnimationFrame(m);return window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{cancelAnimationFrame(w),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[a,n]),c.useEffect(()=>{if(!a)return;const w=y=>{u.current&&!u.current.contains(y.target)&&o(!1)};return document.addEventListener("touchstart",w),()=>document.removeEventListener("touchstart",w)},[a]),!s)return t;const j=a&&e.jsx("div",{ref:h,"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:()=>{x.current||o(!0)},onMouseLeave:()=>{x.current||o(!1)},onTouchStart:()=>{x.current=!0,o(w=>!w)},...r,children:[t,typeof document<"u"&&ee.createPortal(j,document.body)]})}const Oe=8,Ne=8,Ht=140;function We(t){const s=String(t??"").replace(/^@/,"").trim();return s?`@${s}`:""}function Ut({label:t,children:s,mode:n="click",avatar:r,name:a,handle:o,description:i,actions:l,className:d="",popoverClassName:f="",...u}){const h=c.useId(),x=c.useRef(null),m=c.useRef(null),j=c.useRef(null),[w,y]=c.useState(!1),[N,$]=c.useState(null),E=s!=null,_=a||t||"",g=We(t||a),A=We(o),D=c.useCallback(()=>{j.current!=null&&(window.clearTimeout(j.current),j.current=null)},[]),L=c.useCallback(()=>{D(),y(!0)},[D]),M=c.useCallback(()=>{D(),j.current=window.setTimeout(()=>y(!1),Ht)},[D]),F=c.useCallback(()=>{const P=x.current,V=m.current;if(!P)return;const v=P.getBoundingClientRect(),T=(V==null?void 0:V.offsetHeight)??160,S=(V==null?void 0:V.offsetWidth)??260;let O=v.bottom+Oe;O+T>window.innerHeight-Ne&&(O=Math.max(Ne,v.top-T-Oe));const H=Math.max(Ne,Math.min(v.left,window.innerWidth-S-Ne));$({top:O,left:H})},[]);c.useLayoutEffect(()=>{w&&F()},[w,F]),c.useEffect(()=>{if(!w)return;const P=()=>F(),V=T=>{T.key==="Escape"&&y(!1)},v=T=>{var O,H;if(n==="hover")return;const S=T.target;(O=m.current)!=null&&O.contains(S)||(H=x.current)!=null&&H.contains(S)||y(!1)};return window.addEventListener("scroll",P,!0),window.addEventListener("resize",P),document.addEventListener("keydown",V),document.addEventListener("mousedown",v),()=>{window.removeEventListener("scroll",P,!0),window.removeEventListener("resize",P),document.removeEventListener("keydown",V),document.removeEventListener("mousedown",v)}},[w,F,n]),c.useEffect(()=>()=>D(),[D]);const k=n==="hover"?{onMouseEnter:L,onMouseLeave:M}:{},z=w?ee.createPortal(e.jsxs("div",{ref:m,id:h,role:"dialog","aria-label":_||g||"Mention","data-ds-portal":"",className:["ds-mention__popover",f].filter(Boolean).join(" "),style:N?{top:N.top,left:N.left}:{top:-9999,left:-9999,visibility:"hidden"},...k,children:[(r||_||A)&&e.jsxs("div",{className:"ds-mention__head",children:[r,(_||A)&&e.jsxs("div",{className:"ds-mention__meta",children:[_?e.jsx("span",{className:"ds-mention__name",children:_}):null,A?e.jsx("span",{className:"ds-mention__handle",children:A}):null]})]}),i?e.jsx("p",{className:"ds-mention__desc",children:i}):null,l?e.jsx("div",{className:"ds-mention__actions",onClick:()=>y(!1),children:l}):null]}),document.body):null;return e.jsxs(e.Fragment,{children:[e.jsx("button",{...u,ref:x,type:"button",className:["ds-mention",E&&"ds-mention--custom",d].filter(Boolean).join(" "),"aria-expanded":w,"aria-haspopup":"dialog","aria-label":E&&(g||_)||void 0,"aria-controls":w?h:void 0,onClick:P=>{var V;if((V=u.onClick)==null||V.call(u,P),!P.defaultPrevented){if(P.preventDefault(),P.stopPropagation(),n==="hover"){L();return}y(v=>!v)}},...k,children:E?s:g}),typeof document<"u"?z:null]})}function Vt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...i}){const l=o||`toggle-${c.useId()}`,d=["ds-toggle",`ds-toggle--${n}`,r&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,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"})}),a&&e.jsx("span",{className:"ds-toggle__label",children:a})]})}function Xt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...i}){const l=o||`checkbox-${c.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:l,children:[e.jsx("input",{type:"checkbox",id:l,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(B.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function Yt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,name:o,value:i,id:l,...d}){const f=l||`radio-${c.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:h=>s==null?void 0:s(h.target.checked),disabled:r,name:o,value:i,...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 et({width:t,height:s,shape:n="rect",aspectRatio:r,className:a="",style:o={},...i}){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",...i})}function qt({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},(i,l)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:l===t-1&&t>1?{width:s}:void 0},l))})}et.Text=qt;function Gt(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 Kt(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 Jt({seed:t,icon:s,src:n,size:r=32,className:a="",style:o={},...i}){const l=Gt(t??""),[d,f]=c.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:Kt(t)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:r,height:r,"--ds-avatar-h":l,...o},"aria-hidden":"true",...i,children:n&&!d?e.jsx("img",{src:n,alt:"",onError:()=>f(!0)}):u})}function Zt({children:t,size:s="compact",stickyTop:n,maxHeight:r,className:a="",style:o={},...i}){const l={...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:l,children:e.jsx("table",{className:["ds-table",`ds-table--${s}`,a].filter(Boolean).join(" "),...i,children:t})})}function Qt({children:t,...s}){return e.jsx("thead",{...s,children:t})}function es({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function ts({children:t,interactive:s,selected:n,subheader:r,exiting:a,updated:o,className:i="",onClick:l,...d}){return e.jsx("tr",{className:["ds-table-row",s||l?"ds-table-row--interactive":"",n?"ds-table-row--selected":"",r?"ds-table-row--subheader":"",a?"ds-table-row--exiting":"",o?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:l,...d,children:t})}function ss({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 ns({children:t,align:s="left",sortDir:n,onSort:r,width:a,className:o="",style:i={},...l}){const d=!!r||n!==void 0,f=n==="asc"?B.ChevronUp:n==="desc"?B.ChevronDown:B.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,...i},...l,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 rs({children:t,align:s="left",secondary:n,muted:r,truncate:a,nowrap:o,className:i="",...l}){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":"",i].filter(Boolean).join(" "),...l,children:t})}function as({icon:t,title:s,description:n,action:r,size:a="m",className:o="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,o].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 os({label:t,hint:s,error:n,required:r=!1,disabled:a=!1,htmlFor:o,children:i,className:l="",style:d,...f}){const u=c.useId(),h=o??u,x=`${h}-hint`,m=`${h}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"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:h,children:t}),e.jsx("div",{className:"ds-field-control",children:i}),s&&!n&&e.jsx("p",{className:"ds-field-hint",id:x,children:s}),n&&e.jsx("p",{className:"ds-field-error",id:m,role:"alert",children:n})]})}function is({label:t,value:s,delta:n,size:r="m",inline:a=!1,className:o="",style:i,...l}){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:i,...l,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 ls({children:t,separator:s="/","aria-label":n,className:r="",style:a,...o}){const i=q(),l=c.Children.toArray(t).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${r?` ${r}`:""}`,"aria-label":n??i.breadcrumb,style:a,...o,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:l.map((d,f)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[d,f<l.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:s})]},f))})})}function cs({page:t,total:s,onChange:n,siblings:r=1,"aria-label":a,previousLabel:o,nextLabel:i,className:l="",style:d,...f}){const u=q(),{t:h}=ue(),x=ds(t,s,r);return e.jsxs("nav",{className:`ds-pagination${l?` ${l}`:""}`,"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(B.ChevronLeft,{size:16})}),x.map((m,j)=>m==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${j}`):e.jsx("button",{className:`ds-pagination-page${m===t?" ds-pagination-page--current":""}`,onClick:()=>m!==t&&(n==null?void 0:n(m)),"aria-current":m===t?"page":void 0,"aria-label":h("pageN",{n:m}),children:m},m)),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(B.ChevronRight,{size:16})})]})}function ds(t,s,n){if(s<=7)return Array.from({length:s},(i,l)=>l+1);const r=Math.max(2,t-n),a=Math.min(s-1,t+n),o=[1];r>2&&o.push("…");for(let i=r;i<=a;i++)o.push(i);return a<s-1&&o.push("…"),o.push(s),o}const us=300;function fs({children:t,title:s,onClose:n,subHeader:r,side:a="right",size:o="wide",offsetLeft:i=0,offsetRight:l=0,keepOpenRef:d,closeLabel:f,...u}){const h=q(),x=c.useRef(null),m=c.useId(),[j,w]=c.useState(!1),y=()=>{!n||j||(w(!0),setTimeout(()=>{w(!1),n()},us))};c.useEffect(()=>{const g=D=>{D.key==="Escape"&&y()},A=D=>{var M,F;const L=Le(D);L&&((M=d==null?void 0:d.current)!=null&&M.contains(L)||(F=x.current)!=null&&F.contains(L)||Pe(L,null)||y())};return document.addEventListener("keydown",g),document.addEventListener("mousedown",A),()=>{document.removeEventListener("keydown",g),document.removeEventListener("mousedown",A)}},[n,j,d]);const N=c.Children.toArray(t),$=N.find(g=>(g==null?void 0:g.type)===$e||(g==null?void 0:g.type)===de),E=N.filter(g=>(g==null?void 0:g.type)!==$e&&(g==null?void 0:g.type)!==de),_=e.jsx("div",{className:["ds-side-page-overlay",j&&"ds-side-page-overlay--closing"].filter(Boolean).join(" "),"data-side":a,style:{"--ds-side-page-offset-left":`${i}px`,"--ds-side-page-offset-right":`${l}px`},...u,children:e.jsxs("div",{ref:x,className:["ds-side-page",j&&"ds-side-page--closing"].filter(Boolean).join(" "),"data-surface":"2","data-side":a,"data-size":o,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,children:[n&&e.jsx(ne,{className:"ds-side-page__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:U[2],strokeWidth:1.5}),onClick:y,"aria-label":f??h.close}),(s||r)&&e.jsxs("div",{className:"ds-side-page__header",children:[s&&e.jsx("h3",{id:m,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:E}),$]})});return typeof document>"u"?_:ee.createPortal(_,document.body)}function $e({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-side-page__footer",children:t})}const pe=c.createContext({collapsed:!1,side:"left"}),ke=c.createContext(!1),ms=c.forwardRef(function({children:s,collapsed:n=!1,side:r="left",onExpand:a,onCollapse:o,className:i="",...l},d){const f=["ds-nav-rail",n&&"ds-nav-rail--collapsed",`ds-nav-rail--${r}`,i].filter(Boolean).join(" "),u=c.useCallback(h=>{if(!h.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,...l,children:s})})});function ps({icon:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,count:i,updated:l=!1,open:d=!1,onboarding:f=!1,className:u="",...h}){const{collapsed:x,side:m}=c.useContext(pe),j=c.useContext(ke),N={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":x?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},...h},$=i!=null,E=m==="left"?"right":"left",_=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!x&&e.jsx("span",{className:"ds-nav-rail__label",children:s}),!x&&$&&e.jsx("span",{className:["ds-nav-rail__count",i===0&&"ds-nav-rail__count--zero"].filter(Boolean).join(" "),"data-updated":l&&i!==0||void 0,children:i}),!x&&l&&(!$||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),x&&$&&i!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":l||void 0,children:i>99?"99+":i}),x&&l&&(!$||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),g=a?e.jsx("a",{href:r?void 0:a,...N,children:_}):e.jsx("button",{type:"button",...N,children:_});return x&&!j?e.jsx(ye,{content:s,position:E,children:g}):g}function hs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function xs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function vs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function bs({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="",...a}){const{collapsed:o}=c.useContext(pe),i=q(),l=s??i.recents,[d,f]=c.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:l}),e.jsx(B.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 js=c.forwardRef(function({as:s="button",avatar:n,label:r,className:a="",...o},i){const{collapsed:l,side:d}=c.useContext(pe),f=c.useContext(ke),u=d==="left"?"right":"left",h=["ds-nav-rail__item","ds-nav-rail__agent",a].filter(Boolean).join(" "),x=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:n}),!l&&e.jsx("span",{className:"ds-nav-rail__label",children:r})]}),m=e.jsx(s,{ref:i,className:h,"aria-label":l?r:void 0,...s==="button"?{type:"button"}:{},...o,children:x});return l&&!f?e.jsx(ye,{content:r,position:u,children:m}):m});function Ns({avatar:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,className:i="",...l}){const{collapsed:d,side:f}=c.useContext(pe),u=c.useContext(ke),m={className:["ds-nav-rail__item","ds-nav-rail__agent",i].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},...l},j=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})]}),w=f==="left"?"right":"left",y=a?e.jsx("a",{href:r?void 0:a,...m,children:j}):e.jsx("button",{type:"button",...m,children:j});return d&&!u?e.jsx(ye,{content:s,position:w,children:y}):y}const He=240,Ue=6,Ve=8;function ws({trigger:t,title:s,children:n,open:r,onOpenChange:a,defaultOpen:o=!1,closeLabel:i}){const l=q(),{side:d}=c.useContext(pe),[f,u]=c.useState(o),h=r!==void 0,x=h?r:f,[m,j]=c.useState(!1),w=c.useRef(null),y=c.useRef(null),[N,$]=c.useState({}),E=c.useCallback(()=>{h?a==null||a(!0):u(!0)},[h,a]),_=c.useCallback(()=>{h?a==null||a(!1):u(!1)},[h,a]),g=c.useCallback(()=>x?_():E(),[x,E,_]),A=c.useCallback(()=>{var P;const L=w.current;if(!L)return;const M=L.getBoundingClientRect(),F=window.innerHeight,k=((P=y.current)==null?void 0:P.offsetHeight)??300,z=Math.max(Ve,Math.min(F-k-Ve,M.top));$(d==="right"?{position:"fixed",top:z,right:window.innerWidth-M.left+Ue,width:He}:{position:"fixed",top:z,left:M.right+Ue,width:He})},[d]);c.useEffect(()=>{if(!x){j(!1);return}return A(),requestAnimationFrame(()=>j(!0)),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),()=>{window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A)}},[x,A]),c.useEffect(()=>{if(!x)return;const L=F=>{var k,z;!((k=y.current)!=null&&k.contains(F.target))&&!((z=w.current)!=null&&z.contains(F.target))&&_()},M=F=>{F.key==="Escape"&&_()};return document.addEventListener("mousedown",L),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",M)}},[x,_]);const D=x&&e.jsxs("div",{ref:y,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,m&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:N,"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:_,"aria-label":i??l.close,children:e.jsx(B.X,{size:16,strokeWidth:2})})]}),e.jsx("div",{className:"ds-nav-rail-flyout__body",children:n})]});return e.jsxs(e.Fragment,{children:[e.jsx(ke.Provider,{value:x,children:e.jsx("div",{ref:w,onClick:g,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&ee.createPortal(D,document.body)]})}const gs={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};function ys({children:t,variant:s="info",action:n,onAction:r,onDismiss:a,role:o,dismissLabel:i,...l}){const d=q(),f=gs[s],u=o||(s==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${s}`,role:u,...l,children:[f&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(f,{size:U[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":i??d.dismiss,children:e.jsx(B.X,{size:U[2],strokeWidth:1.5})})]})}function ks({trigger:t,items:s=[],open:n,onOpenChange:r,align:a="left",fullWidth:o=!1,className:i="",style:l,...d}){const[f,u]=c.useState(!1),[h,x]=c.useState(!1),m=n!==void 0,j=m?n:f,w=c.useRef(null),y=c.useRef(null),N=c.useRef(null),$=c.useRef(null),[E,_]=c.useState({}),g=c.useRef(null),A=150,D=()=>{if(m)r==null||r(!1);else{if(h)return;x(!0),g.current=setTimeout(()=>{u(!1),x(!1)},A)}},L=()=>{const v=!j;m?r==null||r(v):v?(clearTimeout(g.current),x(!1),u(!0)):D()},M=()=>{j||(m?r==null||r(!0):(clearTimeout(g.current),x(!1),u(!0)))};c.useEffect(()=>()=>clearTimeout(g.current),[]),c.useEffect(()=>{if(!j)return;const v=300,T=()=>{var X;const S=(X=w.current)==null?void 0:X.getBoundingClientRect();if(!S)return;const O=window.innerHeight-S.bottom,H=O<v+8&&S.top>O;_(a==="right"?H?{bottom:window.innerHeight-S.top+4,top:"auto",right:window.innerWidth-S.right}:{top:S.bottom+4,bottom:"auto",right:window.innerWidth-S.right}:H?{bottom:window.innerHeight-S.top+4,top:"auto",left:S.left}:{top:S.bottom+4,bottom:"auto",left:S.left})};return T(),window.addEventListener("scroll",T,!0),window.addEventListener("resize",T),()=>{window.removeEventListener("scroll",T,!0),window.removeEventListener("resize",T)}},[j,a]);const F=()=>{var T;const v=(T=N.current)==null?void 0:T.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');v==null||v.focus()};c.useEffect(()=>{if(!j)return;const v=S=>{var O,H;!((O=w.current)!=null&&O.contains(S.target))&&!((H=y.current)!=null&&H.contains(S.target))&&D()},T=S=>{S.key==="Escape"&&(D(),F())};return document.addEventListener("mousedown",v),document.addEventListener("keydown",T),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",T)}},[j]),c.useEffect(()=>{if(!j||!$.current||!y.current)return;const v=k(),T=$.current==="last"?v[v.length-1]:v[0];T==null||T.focus(),$.current=null},[j]);const k=()=>y.current?[...y.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],z=v=>{var T,S;if(v.key==="ArrowDown")v.preventDefault(),j?(T=k()[0])==null||T.focus():($.current="first",M());else if(v.key==="ArrowUp")if(v.preventDefault(),!j)$.current="last",M();else{const O=k();(S=O[O.length-1])==null||S.focus()}},P=v=>{var O,H,X,p;const T=k(),S=T.findIndex(b=>b===document.activeElement);switch(v.key){case"ArrowDown":v.preventDefault(),(O=T[Math.min(S+1,T.length-1)])==null||O.focus();break;case"ArrowUp":v.preventDefault(),S<=0?F():(H=T[S-1])==null||H.focus();break;case"Home":v.preventDefault(),(X=T[0])==null||X.focus();break;case"End":v.preventDefault(),(p=T[T.length-1])==null||p.focus();break;case"Tab":D();break}},V=j&&e.jsx("div",{ref:y,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,h&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:E,onKeyDown:P,children:s.map((v,T)=>{if(v.separator)return e.jsx("div",{className:"ds-dropdown__separator"},T);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})]},T);const S=!!v.href,O=S?"a":"button",H=S?{href:v.disabled?void 0:v.href,"aria-disabled":v.disabled?"true":void 0}:{type:"button",disabled:v.disabled};return e.jsxs(O,{role:"menuitem",className:["ds-dropdown__item",v.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...H,onClick:()=>{var X;(X=v.onClick)==null||X.call(v),D()},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})]},T)})});return e.jsxs("div",{ref:w,className:["ds-dropdown",o&&"ds-dropdown--full-width",i].filter(Boolean).join(" "),style:l,...d,children:[e.jsx("div",{ref:N,className:"ds-dropdown__trigger",onClick:L,onKeyDown:z,children:t}),typeof document<"u"&&ee.createPortal(V,document.body)]})}function Es({value:t=0,size:s="m",variant:n="default",showValue:r=!1,min:a=2,animate:o=!0}){const i=Math.min(100,Math.max(0,t)),l=Math.max(a,i),d=n==="auto"?i>=70?"success":i>=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":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:`${l}%`}})}),r&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const Rs=t=>1-Math.pow(1-t,3),Ss=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function tt(t,{duration:s=600}={}){const[n,r]=c.useState(t),a=c.useRef(t),o=c.useRef(null);return c.useEffect(()=>{if(Ss()){r(t),a.current=t;return}const i=a.current,l=t-i;if(l===0)return;let d=null;const f=u=>{d||(d=u);const h=Math.min((u-d)/s,1);r(i+l*Rs(h)),h<1?o.current=requestAnimationFrame(f):a.current=t};return o.current=requestAnimationFrame(f),()=>cancelAnimationFrame(o.current)},[t,s]),n}function Ts({value:t,duration:s=600,decimals:n=0,prefix:r="",suffix:a=""}){const i=tt(t,{duration:s}).toFixed(n);return`${r}${i}${a}`}function st({threshold:t=.1,rootMargin:s="0px",once:n=!1}={}){const r=c.useRef(null),[a,o]=c.useState(!1);return c.useEffect(()=>{const i=r.current;if(!i)return;const l=new IntersectionObserver(([d])=>{d.isIntersecting?(o(!0),n&&l.disconnect()):n||o(!1)},{threshold:t,rootMargin:s});return l.observe(i),()=>l.disconnect()},[t,s,n]),{ref:r,inView:a}}function $s({children:t,as:s="div",once:n=!1,threshold:r=.1,rootMargin:a="0px",onEnter:o,onLeave:i,...l}){const{ref:d,inView:f}=st({threshold:r,rootMargin:a,once:n}),u=c.useRef(!1);return c.useEffect(()=>{f&&!u.current&&(o==null||o()),!f&&u.current&&(i==null||i()),u.current=f},[f]),e.jsx(s,{ref:d,...l,children:typeof t=="function"?t(f):t})}const Xe={default:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};let me=[];const Ae=new Set;function nt(){Ae.forEach(t=>t([...me]))}function As(t){me=[...me,t],nt()}function Bs(t){me=me.filter(s=>s.id!==t),nt()}function Is(){const t=(s,n={})=>{As({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 Ds({data:t,onDismiss:s}){const n=q(),[r,a]=c.useState(!1),o=c.useRef(null);c.useEffect(()=>(requestAnimationFrame(()=>a(!0)),t.duration>0&&(o.current=setTimeout(()=>i(),t.duration)),()=>clearTimeout(o.current)),[]);function i(){a(!1),setTimeout(()=>s(t.id),250)}const l=Xe[t.type]??Xe.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(l,{size:U[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(B.X,{size:U[3],strokeWidth:1.5})})]})}function Ls({position:t="bottom-right"}){const[s,n]=c.useState(()=>[...me]);return c.useEffect(()=>(Ae.add(n),()=>Ae.delete(n)),[]),!s.length||typeof document>"u"?null:ee.createPortal(e.jsx("div",{"data-ds-portal":"",className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:s.map(r=>e.jsx(Ds,{data:r,onDismiss:Bs},r.id))}),document.body)}const Ps={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 rt({label:t,status:s="idle",icon:n,badge:r,defaultExpanded:a=!1,expanded:o,onToggle:i,children:l,className:d="",...f}){const u=s==="running",h=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}),Ps[s],r]});return l?e.jsx("div",{className:["ds-tool-card",u&&"ds-tool-card--running",d].filter(Boolean).join(" "),...f,children:e.jsx(ge,{title:h,padding:"s",defaultExpanded:a,expanded:u?!1:o,onToggle:u?void 0:i,children:e.jsx("div",{className:"ds-tool-card__body",children:l})})}):e.jsx("div",{className:["ds-tool-card","ds-tool-card--bubble",d].filter(Boolean).join(" "),...f,children:h})}function at({text:t,size:s="xs",timeout:n=800,"aria-label":r,...a}){const o=q(),[i,l]=c.useState(!1),d=f=>{f.currentTarget.blur(),navigator.clipboard.writeText(t).then(()=>{l(!0),setTimeout(()=>l(!1),n)})};return e.jsx(ne,{variant:"ghost",size:s,state:i?"success":"idle",icon:e.jsx(B.Copy,{size:U[1],strokeWidth:1.5}),"aria-label":r??o.copyToClipboard,onClick:d,...a})}function Cs({content:t,streaming:s=!1,...n}){const[r,a]=c.useState(s);return c.useEffect(()=>{a(!!s)},[s]),e.jsx(ge,{expanded:r,onToggle:a,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(B.Brain,{size:U[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ze,{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 Ms({count:t,current:s=0,done:n=[],onChange:r,showCounter:a=!0,className:o="","aria-label":i,...l}){const d=q(),{t:f}=ue();return e.jsxs("div",{className:["ds-step-indicator",o].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i??d.steps,children:Array.from({length:t},(u,h)=>{const x=h===s,m=n.includes(h)&&!x,j=r&&(h<=s||n.includes(h)),w=["ds-step-indicator__dot",x&&"ds-step-indicator__dot--active",m&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:w,role:"tab","aria-selected":x,"aria-label":f("stepN",{n:h+1}),disabled:!j||h===s,onClick:()=>r==null?void 0:r(h),children:m?e.jsx(B.Check,{size:8,strokeWidth:3}):null},h)})}),a&&e.jsxs(De,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function Fs({content:t,isStreaming:s=!1,cursor:n="line",onChunk:r,className:a="",...o}){const i=c.useRef(t);return c.useEffect(()=>{t!==i.current&&(r==null||r(t),i.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 zs({role:t="assistant",header:s,footer:n,attachments:r,isStreaming:a=!1,children:o,className:i="",...l}){const d=["ds-chat-message",`ds-chat-message--${t}`,a&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return t==="system"?e.jsx("div",{className:d,...l,children:e.jsx("span",{className:"ds-chat-message__system-label",children:o})}):t==="user"?e.jsxs("div",{className:d,...l,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,...l,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 Os(t,{containerRef:s,smartPause:n=!0}={}){const r=c.useRef(!1),a=c.useRef(0);c.useEffect(()=>{const o=s==null?void 0:s.current;if(!o)return;const i=()=>{const l=o.scrollHeight-o.scrollTop-o.clientHeight<64;!l&&o.scrollTop<a.current&&(r.current=!0),l&&(r.current=!1),a.current=o.scrollTop};return o.addEventListener("scroll",i,{passive:!0}),()=>o.removeEventListener("scroll",i)},[s]),c.useEffect(()=>{const o=s==null?void 0:s.current;o&&(n&&r.current||(o.scrollTop=o.scrollHeight))},t)}function ot({prompts:t,enabled:s,typingSpeed:n=38,erasingSpeed:r=18,holdTime:a=2200,betweenTime:o=380,manualPauseMs:i=5e3}){const[l,d]=c.useState(0),[f,u]=c.useState(""),h=c.useRef("typing"),x=c.useRef(0),m=c.useRef(0),j=c.useRef(null),w=c.useRef(0);c.useEffect(()=>{m.current=l},[l]),c.useEffect(()=>{if(j.current&&(clearTimeout(j.current),j.current=null),!s||t.length===0){u(""),x.current=0,h.current="typing";return}const _=()=>{const g=Date.now();if(w.current>g){j.current=setTimeout(_,w.current-g);return}const A=t[m.current%t.length]??"";h.current==="typing"?(x.current+=1,u(A.slice(0,x.current)),x.current>=A.length?(h.current="holding",j.current=setTimeout(_,a)):j.current=setTimeout(_,n+Math.random()*28)):h.current==="holding"?(h.current="erasing",j.current=setTimeout(_,r)):(x.current=Math.max(0,x.current-1),u(A.slice(0,x.current)),x.current<=0?(h.current="typing",m.current=(m.current+1)%t.length,d(m.current),j.current=setTimeout(_,o)):j.current=setTimeout(_,r))};return j.current=setTimeout(_,260),()=>{j.current&&clearTimeout(j.current)}},[s,t,n,r,a,o]);const y=_=>{if(t.length===0)return;const g=(_%t.length+t.length)%t.length,A=t[g];m.current=g,x.current=A.length,h.current="holding",w.current=Date.now()+i,d(g),u(A)},N=()=>y(m.current+1),$=()=>y(m.current-1),E=t[l%t.length]??"";return{displayed:f,currentPrompt:E,index:l,next:N,prev:$}}let Ws=0;function Hs({value:t="",onChange:s,onSubmit:n,onStop:r,onKeyDown:a,loading:o=!1,disabled:i=!1,placeholder:l,animatedPlaceholders:d,attachments:f,images:u,onAttachFiles:h,onAttachImages:x,onRemoveAttachment:m,onRemoveImage:j,acceptImage:w,acceptFile:y,maxImages:N,maxImageSize:$,leftSlot:E,rightSlot:_,className:g="",...A}){const D=q(),{t:L}=ue(),M=c.useRef(null),F=c.useRef(null),k=c.useRef(0),[z,P]=c.useState(!1),[V,v]=c.useState([]),T=l??D.promptPlaceholder,S=R=>{const C=++Ws;v(G=>[...G,{id:C,msg:R}]),setTimeout(()=>v(G=>G.filter(J=>J.id!==C)),6e3)},O=R=>v(C=>C.filter(G=>G.id!==R)),H=R=>R.type.startsWith("image/"),X=()=>!0,p=w??H,b=y??X,I=R=>{const C=[],G=[],J=[],Q=[];let te=0,le=N!=null?N-((u==null?void 0:u.length)??0):1/0;for(const se of R)p(se)?$&&se.size>$?J.push(se.name):le>0?(C.push(se),le--):te++:b(se)?G.push(se):Q.push(se.name);return{imageFiles:C,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:te}},W=R=>{const C=$?L("fileTooLargeMaxHint",{maxMb:$/1024/1024}):"";S(L("fileTooLarge",{maxHint:C,names:R.join(", ")}))},Z=R=>{const{imageFiles:C,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:te}=I(R);J.length&&W(J),Q.length&&S(L("filesSkipped",{names:Q.join(", ")})),te&&S(L("maxImages",{n:N})),x&&C.length&&x(C);const le=G.concat(x?[]:C);h&&le.length&&h(le)};c.useEffect(()=>{const R=F.current;R&&(R.style.height="auto",R.style.height=`${Math.min(R.scrollHeight,200)}px`)},[t]),c.useEffect(()=>{const R=C=>{var J,Q,te;if(o||i)return;const G=(J=C.target)==null?void 0:J.tagName;G==="INPUT"||G==="TEXTAREA"||G==="SELECT"||(Q=C.target)!=null&&Q.isContentEditable||C.ctrlKey||C.metaKey||C.altKey||C.key.length!==1&&C.key!=="Backspace"&&C.key!=="Delete"||(te=F.current)==null||te.focus()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o,i]);const re=R=>{R.preventDefault(),k.current++,R.dataTransfer.types.includes("Files")&&P(!0)},Y=R=>{R.preventDefault(),k.current--,k.current===0&&P(!1)},K=R=>R.preventDefault(),ie=R=>{R.preventDefault(),k.current=0,P(!1);const C=Array.from(R.dataTransfer.files);C.length&&Z(C)},he=R=>{const C=Array.from(R.target.files||[]);M.current&&(M.current.value=""),C.length&&Z(C)},Ee=R=>{var se;if(!x)return;const C=(se=R.clipboardData)==null?void 0:se.items;if(!C)return;const G=[];for(const dt of C){const Me=dt.getAsFile();Me&&G.push(Me)}if(G.length===0)return;const{imageFiles:J,tooLarge:Q,skipped:te,limitExceeded:le}=I(G);Q.length&&W(Q),te.length&&S(L("filesSkipped",{names:te.join(", ")})),le&&S(L("maxImages",{n:N})),J.length&&(R.preventDefault(),x(J))},xe=!o&&!i&&!!(d!=null&&d.length)&&t.length===0,je=ot({prompts:d??[],enabled:xe}),lt=R=>{if(xe){if(R.key==="ArrowDown"||R.key==="ArrowRight"){R.preventDefault(),je.next();return}if(R.key==="ArrowUp"||R.key==="ArrowLeft"){R.preventDefault(),je.prev();return}if(R.key==="Tab"&&!R.shiftKey){R.preventDefault(),s==null||s(je.currentPrompt);return}}a==null||a(R)},ct=(t.trim()||(u==null?void 0:u.length)>0||(f==null?void 0:f.length)>0)&&!i,Ce=h||x;return e.jsxs("div",{className:["ds-prompt-input",g].filter(Boolean).join(" "),...A,children:[Ce&&e.jsx("input",{ref:M,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:he}),e.jsxs("div",{className:["ds-prompt-input__box",z&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:re,onDragLeave:Y,onDragOver:K,onDrop:ie,children:[z&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:D.dropFilesHere}),e.jsx("textarea",{ref:F,value:t,onChange:R=>s==null?void 0:s(R.target.value),onKeyDown:lt,onPaste:Ee,placeholder:xe?"":T,disabled:o||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((R,C)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:R.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>j==null?void 0:j(C),"aria-label":D.removeImage,type:"button",children:e.jsx(B.X,{size:12,strokeWidth:2})})]},C))}),V.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:V.map(R=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:R.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>O(R.id),"aria-label":D.dismiss,children:e.jsx(B.X,{size:U[1],strokeWidth:1.5})})]},R.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((R,C)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[R.uploading?e.jsx(B.Loader,{size:U[1],strokeWidth:1.5,className:"spin"}):e.jsx(B.Paperclip,{size:U[1],strokeWidth:1.5}),R.filename,R.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:D.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>m==null?void 0:m(C),"aria-label":D.removeAttachment,children:e.jsx(B.X,{size:U[1],strokeWidth:1.5})})]})},C))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[Ce&&e.jsx(ne,{variant:"ghost",size:"xs",icon:e.jsx(B.Paperclip,{size:U[2],strokeWidth:1.5}),"aria-label":D.attachFiles,onClick:()=>{var R;return(R=M.current)==null?void 0:R.click()}}),E,_,e.jsx("div",{className:"ds-prompt-input__spacer"}),o?e.jsx(ne,{variant:"primary",size:"xs",icon:e.jsx(B.Square,{size:U[2],strokeWidth:1.5}),onClick:r,"aria-label":D.stop}):e.jsx(ne,{variant:"primary",size:"xs",icon:e.jsx(B.ArrowUp,{size:U[2],strokeWidth:1.5}),onClick:n,disabled:!ct,"aria-label":D.send})]})]})]})}const Ye={fast:0,standard:1,premium:2},qe={fast:"data-5",standard:"data-3",premium:"data-6"};function Us({models:t=[],value:s,onChange:n,size:r="xs",minTier:a,showAutoOption:o=!1,groupByTier:i=!0,className:l="",...d}){const[f,u]=c.useState(!1),h=c.useRef(null),x=c.useRef(null),m=c.useRef(null),[j,w]=c.useState({}),y=r==="s"?"s":"xs",N=t.filter(k=>!a||k.name==="auto"?!0:(Ye[k.tier]??1)>=(Ye[a]??1)),$=N.find(k=>k.name==="auto"),E=N.filter(k=>k.name!=="auto"),_=t.find(k=>k.name===s),A=new Set(E.map(k=>k.tier).filter(Boolean)).size>1;c.useEffect(()=>{if(!f)return;const k=320,z=()=>{var O;const v=(O=x.current)==null?void 0:O.getBoundingClientRect();if(!v)return;const T=window.innerHeight-v.bottom,S=T<k+8&&v.top>T;w({position:"fixed",zIndex:"var(--z-dropdown, 500)",left:v.left,...S?{bottom:window.innerHeight-v.top+4,top:"auto"}:{top:v.bottom+4,bottom:"auto"}})};z(),window.addEventListener("scroll",z,!0),window.addEventListener("resize",z);const P=v=>{var T,S;!((T=h.current)!=null&&T.contains(v.target))&&!((S=m.current)!=null&&S.contains(v.target))&&u(!1)},V=v=>{v.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",P),document.addEventListener("keydown",V),()=>{window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z),document.removeEventListener("mousedown",P),document.removeEventListener("keydown",V)}},[f]);const D=k=>{n==null||n(k),u(!1)},L=k=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",k.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>D(k.name),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:k.icon||e.jsx(B.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:k.displayName||k.name}),A&&k.tier&&e.jsx(ce,{size:"xs",variant:qe[k.tier]||"default",children:k.tier})]},k.name),M=()=>!i||!A?E.map(L):["fast","standard","premium"].flatMap(k=>{const z=E.filter(P=>P.tier===k);return z.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":k,children:k.charAt(0).toUpperCase()+k.slice(1)},`lbl-${k}`),...z.map(L)]:[]}),F=f&&e.jsxs("div",{ref:m,className:`ds-model-picker__menu ds-model-picker__menu--${y} ds-scrollable`,"data-ds-portal":"",style:j,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:()=>D("auto"),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:e.jsx(B.Zap,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),E.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),M()]});return e.jsxs("div",{ref:h,className:["ds-model-picker",l].filter(Boolean).join(" "),...d,children:[e.jsxs("button",{ref:x,type:"button",className:`ds-model-picker__trigger ds-model-picker__trigger--${y}`,onClick:()=>u(k=>!k),"aria-haspopup":"listbox","aria-expanded":f,children:[e.jsx("span",{className:"ds-model-picker__icon",children:(_==null?void 0:_.icon)||e.jsx(B.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(_==null?void 0:_.displayName)||(_==null?void 0:_.name)||s}),A&&(_==null?void 0:_.tier)&&e.jsx(ce,{size:"xs",variant:qe[_.tier]||"default",children:_.tier})]}),typeof document<"u"&&ee.createPortal(F,document.body)]})}const Vs=({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 Xs(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 Ys({sources:t=[],layout:s="list",title:n,maxVisible:r=5,onSourceClick:a}){const o=q(),{t:i}=ue(),l=n??o.sources,[d,f]=c.useState(!1),u=Xs(t),h=u.length>r,x=d?u:u.slice(0,r),m=t.some(N=>N.snippet),j=N=>N!=null&&N.length?i("pageAbbrev",{pages:N.join(", ")}):null,w=i("moreSources",{n:u.length-r}),y=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:y,children:[x.map(N=>{const $=N.items.map(g=>g.page).filter(Boolean),E=j($),_=!!a;return e.jsxs("div",{className:`ds-sources-panel__compact-row${_?" ds-sources-panel__compact-row--clickable":""}`,onClick:_?()=>a(N.items[0]):void 0,children:[e.jsx(B.FileText,{size:U[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:N.filename}),E&&e.jsx("span",{className:"ds-sources-panel__pages",children:E})]},N.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:w})]}):e.jsxs("div",{className:y,children:[l&&e.jsx("div",{className:"ds-sources-panel__title",children:l}),x.map(N=>{const $=N.items.map(g=>g.page).filter(Boolean),E=j($),_=!!a;return m?e.jsx(ge,{title:e.jsx(Vs,{filename:N.filename,pagesLabel:E}),padding:"s",children:N.items.map((g,A)=>e.jsx("div",{className:`ds-sources-panel__snippet${_?" ds-sources-panel__snippet--clickable":""}`,onClick:_?()=>a(g):void 0,children:g.snippet??i("pageAbbrev",{pages:g.page})},A))},N.filename):e.jsxs("div",{className:`ds-sources-panel__row${_?" ds-sources-panel__row--clickable":""}`,onClick:_?()=>a(N.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:N.filename}),E&&e.jsx("span",{className:"ds-sources-panel__pages",children:E})]},N.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:w})]})}function Ge(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function qs({used:t,limit:s,size:n="s",showCount:r=!0,showPercent:a=!1,warningThreshold:o=.8,errorThreshold:i=1}){const l=s>0?t/s:0,d=Math.min(l*100,100),f=l>=i?"error":l>=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:[Ge(t)," / ",Ge(s)]}),a&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(l*100),"%"]})]})]})}const Ke=5;function Gs(t){return t<.34?"low":t<.67?"medium":"high"}function Ks({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*Ke),i=Gs(a);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:Ke},(l,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:i})]})}const Js={add:"+",remove:"-",context:" "};function Re({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:Js[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function Zs({lines:t=[],layout:s="inline",wordWrap:n=!1,lineNumbers:r=!0,maxHeight:a,title:o}){const i=["ds-diff-view",`ds-diff-view--${s}`,n&&"ds-diff-view--wrap"].filter(Boolean).join(" "),l=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:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsxs("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:[e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((u,h)=>e.jsx(Re,{line:u,lineNumbers:r},h))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:f.map((u,h)=>e.jsx(Re,{line:u,lineNumbers:r},h))})]})]})}return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:t.map((d,f)=>e.jsx(Re,{line:d,lineNumbers:r},f))})]})}function it({value:t="idle",onLike:s,onDislike:n,className:r="",likeLabel:a,dislikeLabel:o,...i}){const l=q(),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":a??l.like,"aria-pressed":t==="liked",children:e.jsx(B.ThumbsUp,{size:U[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??l.dislike,"aria-pressed":t==="disliked",children:e.jsx(B.ThumbsDown,{size:U[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function Qs(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 i=s.getDate(),l=s.toLocaleString([],{month:"short"});return`${i} ${l} ${r}`}function en({role:t="assistant",text:s,timestamp:n,feedbackValue:r="idle",onLike:a,onDislike:o,className:i="",...l}){const d=t==="assistant"&&(a||o),f=!!s,u=n?Qs(n):null;return!d&&!f&&!u?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${t}`,i].filter(Boolean).join(" "),...l,children:[t==="user"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u}),d&&e.jsx(it,{className:"ds-message-action",value:r,onLike:a,onDislike:o}),f&&e.jsx(at,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function tn({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 sn({variant:t="light",glow:s,mask:n=!0,style:r,...a}){const o=t==="dark",i=s??o,l=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,...i&&{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(${l} 1px, transparent 1px)`,`linear-gradient(90deg, ${l} 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 nn({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 Se=280,rn=22,an=14,oe=8,we=6,on=200;function ln(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function cn(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 i=Math.max(t.top,o-t.bottom,a-t.right,t.left);return i===o-t.bottom?"bottom":i===t.top?"top":i===a-t.right?"right":"left"}function dn(t,s,n,r,a){const o=window.innerWidth,i=window.innerHeight;let l,d;switch(t){case"top":l=s.top-n-a,d=s.left+s.width/2-r/2;break;case"bottom":l=s.bottom+a,d=s.left+s.width/2-r/2;break;case"left":l=s.top+s.height/2-n/2,d=s.left-r-a;break;default:l=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(i-n-oe,l));return{top:u,left:f,arrowOffset:d-f,arrowOffsetY:l-u}}function un({steps:t,currentStep:s,onNext:n,onBack:r,onSkip:a,onFinish:o,overlay:i=!0,ring:l=!0,labelNext:d,labelBack:f,labelSkip:u,labelFinish:h,statePrimary:x="idle",stateBack:m="idle"}){const j=q(),{t:w}=ue(),y=d??j.next,N=f??j.back,$=u??j.skipTour,E=h??j.done,_=c.useRef(null),g=c.useRef(t),A=c.useRef(s),D=c.useRef(l);g.current=t,A.current=s,D.current=l;const[L,M]=c.useState(!1),[F,k]=c.useState({position:"fixed",visibility:"hidden",width:Se}),[z,P]=c.useState("bottom"),[V,v]=c.useState(null),T=c.useRef(!1),S=t[s],O=s===t.length-1,H=c.useCallback(()=>{const X=g.current[A.current];if(!X||!_.current)return;const p=ln(X.target);if(!p)return;const b=p.getBoundingClientRect(),W=_.current.getBoundingClientRect().height||160,Z=Se,re=D.current?rn:an,Y=X.position||cn(b,W,Z,re),{top:K,left:ie,arrowOffset:he,arrowOffsetY:Ee}=dn(Y,b,W,Z,re);P(Y),k({position:"fixed",top:K,left:ie,width:Se,visibility:"visible","--arrow-offset":`${he}px`,"--arrow-offset-y":`${Ee}px`}),v({top:b.top-we,left:b.left-we,width:b.width+we*2,height:b.height+we*2})},[]);return c.useEffect(()=>{window.addEventListener("scroll",H,!0),window.addEventListener("resize",H);const X=requestAnimationFrame(()=>{H(),M(!0),T.current=!0});return()=>{cancelAnimationFrame(X),window.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}},[]),c.useEffect(()=>{if(!T.current)return;M(!1);const X=setTimeout(()=>{k(p=>({...p,visibility:"hidden"})),requestAnimationFrame(()=>{H(),M(!0)})},on+20);return()=>clearTimeout(X)},[s]),c.useEffect(()=>{L&&_.current&&_.current.focus({preventScroll:!0})},[L]),c.useEffect(()=>{const X=p=>{p.key==="Escape"&&a()};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[a]),c.useEffect(()=>{if(!L)return;const X=p=>{if(p.key!=="Tab"||!_.current)return;const b=Array.from(_.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!b.length)return;const I=b[0],W=b[b.length-1];p.shiftKey&&document.activeElement===I?(p.preventDefault(),W.focus()):!p.shiftKey&&document.activeElement===W&&(p.preventDefault(),I.focus())};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[L]),!S||typeof document>"u"?null:ee.createPortal(e.jsxs(e.Fragment,{children:[V&&e.jsx("div",{className:["ds-coachmark__spotlight",i&&"ds-coachmark__spotlight--overlay",!l&&"ds-coachmark__spotlight--no-ring",L&&"ds-coachmark__spotlight--visible"].filter(Boolean).join(" "),style:V,"aria-hidden":"true"}),e.jsxs("div",{ref:_,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":S.title??w("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${z}`,L&&"ds-coachmark__bubble--visible"].filter(Boolean).join(" "),style:F,tabIndex:-1,children:[e.jsx("button",{type:"button",className:"ds-coachmark__close",onClick:a,"aria-label":$,children:e.jsx(B.X,{size:16,strokeWidth:2})}),S.title&&e.jsx("div",{className:"ds-coachmark__title",children:S.title}),e.jsx("div",{className:"ds-coachmark__body",children:S.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(ne,{variant:"secondary",size:"s",state:m,onClick:r,children:N}),e.jsx(ne,{variant:"primary",size:"s",state:x,onClick:O?o:n,children:O?E:y})]})]})]})]}),document.body)}function fn(t,s={}){const{storageKey:n}=s,[r,a]=c.useState(0),[o,i]=c.useState(!1),l=()=>n&&typeof localStorage<"u"&&localStorage.getItem(n)==="done",d=c.useCallback(()=>{i(!1),n&&typeof localStorage<"u"&&localStorage.setItem(n,"done")},[n]);return{currentStep:r,isActive:o,start:()=>{l()||(a(0),i(!0))},next:()=>a(f=>Math.min(f+1,t.length-1)),back:()=>a(f=>Math.max(f-1,0)),skip:d,finish:d}}function mn(){const t=c.useRef(null),s=c.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=ge;exports.Alert=Et;exports.AnimatedNumber=Ts;exports.Avatar=Jt;exports.Badge=ce;exports.Banner=ys;exports.BottomSheet=At;exports.Breadcrumb=ls;exports.BrowserPane=Pt;exports.BrowserTabs=Ct;exports.Button=ne;exports.Card=_t;exports.ChatMessage=zs;exports.Checkbox=Xt;exports.Coachmark=un;exports.Code=Bt;exports.CodeAccordion=Qe;exports.ConfidenceBar=Ks;exports.CopyButton=at;exports.DiffView=Zs;exports.Dropdown=ks;exports.EmptyState=as;exports.EngineerGrid=sn;exports.FormField=os;exports.H1=jt;exports.H2=Nt;exports.H3=wt;exports.H4=gt;exports.InView=$s;exports.Input=ht;exports.Link=It;exports.List=Mt;exports.ListRow=Ft;exports.LocaleProvider=mt;exports.Mention=Ut;exports.MessageFeedback=it;exports.MessageFooter=en;exports.Modal=Tt;exports.ModalFooter=de;exports.ModelPicker=Us;exports.NavRail=ms;exports.NavRailAgent=Ns;exports.NavRailBody=hs;exports.NavRailCustomItem=js;exports.NavRailDivider=bs;exports.NavRailFlyout=ws;exports.NavRailFooter=vs;exports.NavRailHeader=xs;exports.NavRailItem=ps;exports.NavRailRecents=_s;exports.P1=yt;exports.P2=Ze;exports.P3=De;exports.Pagination=cs;exports.ProgressBar=Es;exports.PromptInput=Hs;exports.Radio=Yt;exports.ReasoningBlock=Cs;exports.Scrollable=nn;exports.SegmentedControl=zt;exports.Select=vt;exports.SidePage=fs;exports.SidePageFooter=$e;exports.Skeleton=et;exports.SourcesPanel=Ys;exports.Spinner=Je;exports.Stat=is;exports.StepIndicator=Ms;exports.Stepper=bt;exports.StreamingText=Fs;exports.Tab=Lt;exports.Table=Zt;exports.TableBody=es;exports.TableHead=Qt;exports.TableRow=ts;exports.TableSubheaderRow=ss;exports.Tabs=Dt;exports.Td=rs;exports.Textarea=xt;exports.Th=ns;exports.ThinkingDot=tn;exports.ToastContainer=Ls;exports.Toggle=Vt;exports.TokenCounter=qs;exports.ToolCallBubble=rt;exports.ToolCallCard=rt;exports.Tooltip=ye;exports.defaultStrings=_e;exports.formatString=Be;exports.iconSizes=U;exports.useAnimatedNumber=tt;exports.useAnimatedPlaceholder=ot;exports.useCoachmark=fn;exports.useInView=st;exports.useLocale=ue;exports.useShake=mn;exports.useStreamScroll=Os;exports.useStrings=q;exports.useToast=Is;
|
package/dist/index.d.ts
CHANGED
|
@@ -839,7 +839,7 @@ export interface ModelPickerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
839
839
|
models: PickerModel[];
|
|
840
840
|
value: string;
|
|
841
841
|
onChange?: (name: string) => void;
|
|
842
|
-
size?: 'xs' | 's'
|
|
842
|
+
size?: 'xs' | 's';
|
|
843
843
|
minTier?: 'fast' | 'standard' | 'premium';
|
|
844
844
|
showAutoOption?: boolean;
|
|
845
845
|
groupByTier?: boolean;
|