@agentatom/design-system 1.4.86 → 1.4.87
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 +41 -0
- package/dist/index.es.js +1107 -1017
- 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.87` — dual-brand publish from one monorepo commit. Package contents = applicable surface for this brand only.
|
package/dist/index.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ce;function ct(){if(Ce)return ve;Ce=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function n(a,
|
|
9
|
+
*/var Ce;function ct(){if(Ce)return ve;Ce=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function n(r,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var l in a)l!=="key"&&(o[l]=a[l])}else o=a;return a=o.ref,{$$typeof:t,type:r,key:i,ref:a!==void 0?a:null,props:o}}return ve.Fragment=s,ve.jsx=n,ve.jsxs=n,ve}var be={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Me;function dt(){return Me||(Me=1,process.env.NODE_ENV!=="production"&&function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===
|
|
17
|
+
*/var Me;function dt(){return Me||(Me=1,process.env.NODE_ENV!=="production"&&function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===P?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case g:return"Fragment";case k:return"Profiler";case y:return"StrictMode";case A:return"Suspense";case I:return"SuspenseList";case E: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 N:return"Portal";case w:return p.displayName||"Context";case R:return(p._context.displayName||"Context")+".Consumer";case j:var v=p.render;return p=p.displayName,p||(p=v.displayName||v.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case L:return v=p.displayName||null,v!==null?v:t(p.type)||"Memo";case z:v=p._payload,p=p._init;try{return t(p(v))}catch{}}return null}function s(p){return""+p}function n(p){try{s(p);var v=!1}catch{v=!0}if(v){v=console;var D=v.error,O=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return D.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",O),s(p)}}function r(p){if(p===g)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===z)return"<...>";try{var v=t(p);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function a(){var p=W.A;return p===null?null:p.getOwner()}function o(){return Error("react-stack-top-frame")}function i(p){if(F.call(p,"key")){var v=Object.getOwnPropertyDescriptor(p,"key").get;if(v&&v.isReactWarning)return!1}return p.key!==void 0}function l(p,v){function D(){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)",v))}D.isReactWarning=!0,Object.defineProperty(p,"key",{get:D,configurable:!0})}function d(){var p=t(this.type);return $[p]||($[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,v,D,O,Z,re){var Y=D.ref;return p={$$typeof:b,type:p,key:v,props:D,_owner:O},(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,v,D,O,Z,re){var Y=v.children;if(Y!==void 0)if(O)if(C(Y)){for(O=0;O<Y.length;O++)h(Y[O]);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(F.call(v,"key")){Y=t(p);var K=Object.keys(v).filter(function(he){return he!=="key"});O=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",X[Y+O]||(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} />`,W,Y,K,Y),X[Y+W]=!0)}if(Y=null,D!==void 0&&(n(D),Y=""+D),i(v)&&(n(v.key),Y=""+v.key),"key"in v){D={};for(var ie in v)ie!=="key"&&(D[ie]=v[ie])}else D=v;return Y&&l(D,typeof p=="function"?p.displayName||p.name||"Unknown":p),m(p,Y,D,r(),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 f=c,b=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),N=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),O=f.__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};f={react_stack_bottom_frame:function(p){return p()}};var T,$={},U=f.react_stack_bottom_frame.bind(f,o)(),H=_(a(o)),X={};be.Fragment=w,be.jsx=function(p,v,D){var W=1e4>O.recentlyCreatedOwnerStacks++;return u(p,v,D,!1,W?Error("react-stack-top-frame"):U,W?_(a(p)):H)},be.jsxs=function(p,v,D){var W=1e4>O.recentlyCreatedOwnerStacks++;return u(p,v,D,!0,W?Error("react-stack-top-frame"):U,W?_(a(p)):H)}}()),be}process.env.NODE_ENV==="production"?Te.exports=ct():Te.exports=dt();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"};function Ie(t,s={}){return typeof t=="function"?t(s):typeof t!="string"?"":t.replace(/\{(\w+)\}/g,(n,a)=>s[a]!==void 0&&s[a]!==null?String(s[a]):"")}const Be=c.createContext({strings:_e,t:(t,s)=>Ie(_e[t]??t,s)});function ut({strings:t,children:s}){const n=c.useMemo(()=>{const a={..._e,...t};return{strings:a,t:(r,o)=>Ie(a[r]??_e[r]??r,o)}},[t]);return e.jsx(Be.Provider,{value:n,children:s})}function me(){return c.useContext(Be)}function q(){return c.useContext(Be).strings}function Ge({size:t="m",color:s="default",className:n="","aria-label":a,...r}){const o=q();return e.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${s}`,n].filter(Boolean).join(" "),role:"status","aria-label":a??o.loading,...r})}const ft={xs:12,s:14,m:16,l:20};function ne({children:t,variant:s="primary",size:n="m",fullWidth:a=!1,icon:r,disabled:o=!1,state:i="idle",active:l=!1,pressed:d=!1,onClick:m,type:u="button",href:h,"aria-label":x,"aria-pressed":f,className:b="",...g}){const w=r&&!t,y=i==="loading",k=i==="success",R=i==="error",N=y||k||R,j=!!(l||d),A=n==="xs"?"s":"m",I=s==="danger"?"on-accent":"default",P=ft[n]??16,z=y?e.jsx(Ge,{size:A,color:I}):k?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.Check,{size:P,strokeWidth:2.5})}):R?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.X,{size:P,strokeWidth:2.5})}):null,E=["ds-button",`ds-button--${s}`,`ds-button--${n}`,a&&"ds-button--full",w&&"ds-button--icon-only",b].filter(Boolean).join(" "),L=i!=="idle"?i:void 0,O=f!==void 0?f:j?!0:void 0,F=e.jsxs(e.Fragment,{children:[N?z:r&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:r}),t]});if(h){const C=_=>{if(o||y){_.preventDefault();return}_.metaKey||_.ctrlKey||_.button===1||(_.preventDefault(),m==null||m(_))};return e.jsx("a",{className:E,href:o||y?void 0:h,onClick:C,"aria-label":x,"aria-disabled":o||y?"true":void 0,"aria-busy":y?"true":void 0,"aria-pressed":O,"data-state":L,"data-active":j?"true":void 0,...g,children:F})}return e.jsx("button",{type:u,className:E,disabled:o,onClick:y?void 0:m,"aria-label":x,"aria-busy":y?"true":void 0,"aria-pressed":O,"data-state":L,"data-active":j?"true":void 0,...g,children:F})}function mt({label:t,error:s,hint:n,fullWidth:a=!0,icon:r,iconRight:o,onIconRightClick:i,size:l="m",disabled:d,id:m,iconRightLabel:u,...h}){const x=q(),f=m||`input-${c.useId()}`,b=n?`${f}-hint`:void 0,g=s?`${f}-error`:void 0,w=g||b;return e.jsxs("div",{className:`ds-input-wrapper ${a?"ds-input-wrapper--full":""} ${d?"ds-input-wrapper--disabled":""} ${s?"ds-input-wrapper--error":""}`,children:[t&&e.jsx("label",{className:"ds-input-label",htmlFor:f,children:t}),e.jsxs("div",{className:"ds-input-container",children:[r&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:r}),e.jsx("input",{id:f,className:`ds-input ds-input--${l} ${r?"ds-input--with-icon":""} ${o?"ds-input--with-icon-right":""} ${s?"ds-input--error":""}`,disabled:d,"aria-invalid":s?"true":"false","aria-describedby":w,...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:g,className:"ds-input-error",role:"alert",children:s})})})]})}function pt({label:t,error:s,hint:n,fullWidth:a=!0,size:r="m",disabled:o,id:i,resize:l=!0,rows:d=3,...m}){const u=i||`textarea-${c.useId()}`,h=n?`${u}-hint`:void 0,x=s?`${u}-error`:void 0,f=x||h;return e.jsxs("div",{className:`ds-textarea-wrapper ${a?"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--${r} ${s?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:o,"aria-invalid":s?"true":"false","aria-describedby":f,rows:d,...m}),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 ht({label:t,value:s,onChange:n,options:a=[],placeholder:r,error:o,fullWidth:i=!0,size:l="m",disabled:d=!1,id:m,...u}){const h=q(),x=r??h.selectOption,[f,b]=c.useState(!1),[g,w]=c.useState(!1),[y,k]=c.useState({}),[R,N]=c.useState("down"),[j,A]=c.useState(-1),I=c.useRef(null),P=c.useRef(null),z=c.useRef(null),E=c.useRef(null),L=m||`select-${c.useId()}`,O=`${L}-label`,F=o?`${L}-error`:void 0,C=150,_=(v=!1)=>{g||(w(!0),A(-1),E.current=setTimeout(()=>{var D;b(!1),w(!1),v&&((D=z.current)==null||D.focus())},C))},T=v=>{clearTimeout(E.current),w(!1);const D=v!==void 0?v:Math.max(a.findIndex(W=>W.value===s),0);A(D),b(!0)};c.useEffect(()=>()=>clearTimeout(E.current),[]);const $=()=>{var K;const v=(K=I.current)==null?void 0:K.getBoundingClientRect();if(!v)return;const D=window.innerHeight,W=D-v.bottom,Z=v.top,Y=W<300&&Z>W;N(Y?"up":"down"),k(Y?{bottom:D-v.top+4,left:v.left,width:v.width}:{top:v.bottom+4,left:v.left,width:v.width})};c.useEffect(()=>{if(f)return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[f]),c.useEffect(()=>{const v=D=>{I.current&&!I.current.contains(D.target)&&P.current&&!P.current.contains(D.target)&&_()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[g]),c.useEffect(()=>{var D;if(!f||j<0||!P.current)return;(D=P.current.querySelectorAll(".ds-select-option")[j])==null||D.scrollIntoView({block:"nearest"})},[j,f]);const U=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),f?A(D=>Math.min(D+1,a.length-1)):T();break;case"ArrowUp":v.preventDefault(),f?A(D=>Math.max(D-1,0)):T(a.length-1);break;case"Home":f&&(v.preventDefault(),A(0));break;case"End":f&&(v.preventDefault(),A(a.length-1));break;case"Enter":case" ":v.preventDefault(),f?j>=0&&(n==null||n(a[j].value),_(!0)):T();break;case"Escape":f&&(v.preventDefault(),_(!0));break;case"Tab":f&&_(!1);break}},H=a.find(v=>v.value===s),X=l==="xs"?V[1]:l==="small"?V[2]:V[3],p=f&&e.jsx("div",{ref:P,"data-ds-portal":"",role:"listbox","aria-labelledby":t?O:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${R}`,g&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:y,children:a.map((v,D)=>e.jsx("button",{id:`${L}-opt-${D}`,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",D===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:O,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:I,children:e.jsxs("button",{ref:z,type:"button",id:L,role:"combobox","aria-haspopup":"listbox","aria-expanded":f,"aria-activedescendant":f&&j>=0?`${L}-opt-${j}`:void 0,"aria-labelledby":t?O: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||(f?_():T())},onKeyDown:U,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 ${f&&R==="down"?"ds-select-icon--open":""} ${f&&R==="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 xt({label:t,value:s=0,onChange:n,min:a=0,max:r=100,step:o=1,size:i="m",disabled:l=!1,hint:d,error:m,decreaseLabel:u,increaseLabel:h,...x}){const f=q(),b=()=>{if(l)return;const N=Math.min(Number(s)+o,r);n==null||n(N)},g=()=>{if(l)return;const N=Math.max(Number(s)-o,a);n==null||n(N)},w=N=>{if(l)return;const j=N.target.value;if(j===""){n==null||n(a);return}const A=Number(j);if(!isNaN(A)){const I=Math.min(Math.max(A,a),r);n==null||n(I)}},y=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",m&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),k=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),R=i==="xs"?V[1]:i==="small"?V[2]:V[3];return e.jsxs("div",{className:y,children:[t&&e.jsx("label",{className:"ds-stepper-label",children:t}),e.jsxs("div",{className:k,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:g,disabled:l||s<=a,"aria-label":u??f.decrease,children:e.jsx(B.Minus,{size:R,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:w,min:a,max:r,step:o,disabled:l,...x}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:b,disabled:l||s>=r,"aria-label":h??f.increase,children:e.jsx(B.Plus,{size:R,strokeWidth:1.5})})]}),d&&!m&&e.jsx("div",{className:"ds-stepper-hint",children:d}),m&&e.jsx("div",{className:"ds-stepper-error",children:m})]})}function vt({children:t,padding:s="m",variant:n="default",hover:a=!1,onClick:r,href:o,disabled:i=!1,className:l="",...d}){const u=(a?"interactive":n)==="interactive"||r||o,h=["ds-card",`ds-card--${s}`,u&&"ds-card--interactive",l].filter(Boolean).join(" ");if(o){const b=g=>{if(i){g.preventDefault();return}g.metaKey||g.ctrlKey||g.button===1||(g.preventDefault(),r==null||r(g))};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&&r?"button":"div",f=u&&r?{type:"button",onClick:r,disabled:i}:{};return e.jsx(x,{className:h,role:u&&!r?"article":void 0,...f,...d,children:t})}function bt({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function _t({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function jt({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 Nt({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function Ke({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:a,...r}){const o=["ds-badge",`ds-badge--${s}`,`ds-badge--${n}`].filter(Boolean).join(" "),i=a||(["info","success","warning","error"].includes(s)?"status":void 0);return e.jsx("span",{className:o,role:i,...r,children:t})}const wt={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle},yt=c.forwardRef(function({children:s,variant:n="info",title:a,onClose:r,role:o,closeLabel:i,...l},d){const m=q(),u=wt[n],h=o||(n==="error"?"alert":"status");return e.jsxs("div",{ref:d,className:`ds-alert ds-alert--${n} ${a?"":"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:[a&&e.jsx("div",{className:"ds-alert__title",children:a}),s&&e.jsx("div",{className:"ds-alert__message",children:s})]}),r&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:r,"aria-label":i??m.closeAlert,children:e.jsx(B.X,{size:V[3],strokeWidth:1.5})})]})}),kt=200;function Et({children:t,title:s,onClose:n,size:a="m",scrollable:r=!1,subHeader:o,closeLabel:i,...l}){const d=q(),m=c.useRef(null),u=c.useId(),[h,x]=c.useState(!1),f=()=>{!n||h||(x(!0),setTimeout(()=>{x(!1),n()},kt))};c.useEffect(()=>{const k=N=>{N.key==="Escape"&&f()},R=N=>{var A,I,P;const j=((I=(A=N.composedPath)==null?void 0:A.call(N))==null?void 0:I[0])??N.target;m.current&&!m.current.contains(j)&&!((P=j.closest)!=null&&P.call(j,"[data-ds-portal]"))&&f()};return document.addEventListener("keydown",k),document.addEventListener("mousedown",R),()=>{document.removeEventListener("keydown",k),document.removeEventListener("mousedown",R)}},[n,h]);const b=c.Children.toArray(t),g=b.find(k=>(k==null?void 0:k.type)===de),w=b.filter(k=>(k==null?void 0:k.type)!==de),y=e.jsx("div",{className:["ds-modal-overlay",h&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...l,children:e.jsxs("div",{className:[`ds-modal ds-modal--${a}`,r&&"ds-modal--scrollable"].filter(Boolean).join(" "),ref:m,role:"dialog","aria-modal":"true","aria-labelledby":s?u:void 0,children:[n&&e.jsx(ne,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:V[2],strokeWidth:1.5}),onClick:f,"aria-label":i??d.closeModal}),(s||o)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:u,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:w}),g]})});return typeof document>"u"?y:ee.createPortal(y,document.body)}function de({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const Rt=320;function St({children:t,title:s,onClose:n,subHeader:a,closeLabel:r,...o}){const i=q(),l=c.useRef(null),d=c.useId(),[m,u]=c.useState(!1),h=()=>{!n||m||(u(!0),setTimeout(()=>{u(!1),n()},Rt))};c.useEffect(()=>{const w=k=>{k.key==="Escape"&&h()},y=k=>{var N,j,A;const R=((j=(N=k.composedPath)==null?void 0:N.call(k))==null?void 0:j[0])??k.target;l.current&&!l.current.contains(R)&&!((A=R.closest)!=null&&A.call(R,"[data-ds-portal]"))&&h()};return document.addEventListener("keydown",w),document.addEventListener("mousedown",y),()=>{document.removeEventListener("keydown",w),document.removeEventListener("mousedown",y)}},[n,m]);const x=c.Children.toArray(t),f=x.find(w=>(w==null?void 0:w.type)===de),b=x.filter(w=>(w==null?void 0:w.type)!==de),g=e.jsx("div",{className:["ds-bottom-sheet-overlay",m&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...o,children:e.jsxs("div",{ref:l,className:["ds-bottom-sheet",m&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-labelledby":s?d: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:V[2],strokeWidth:1.5}),onClick:h,"aria-label":r??i.close}),(s||a)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[s&&e.jsx("h3",{id:d,className:"ds-bottom-sheet__title",children:s}),a&&e.jsx("div",{className:"ds-bottom-sheet__subheader",children:a})]}),e.jsx("div",{className:"ds-bottom-sheet__body ds-scrollable",children:b}),f]})});return typeof document>"u"?g:ee.createPortal(g,document.body)}function Je({children:t,title:s,defaultExpanded:n=!1,expanded:a,onToggle:r,padding:o="s",className:i="",...l}){const d=q(),m=s??d.code,[u,h]=c.useState(n),x=a!==void 0,f=x?a:u,b=()=>{x?r==null||r(!a):h(w=>!w)},g=["ds-code-accordion",`ds-code-accordion--${o}`,f&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:g,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:b,"aria-expanded":f,children:[e.jsx("span",{className:"ds-code-accordion__title",children:m}),e.jsx(B.ChevronDown,{size:V[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${f?"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 Tt({children:t,block:s=!1,collapsible:n=!1,title:a,defaultExpanded:r=!1,...o}){const i=q(),l=a??i.code;return s?n?e.jsx(Je,{title:l,defaultExpanded:r,...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 $t({href:t,children:s,onClick:n,target:a,rel:r,...o}){const l=a==="_blank"?r?`${r} noopener noreferrer`:"noopener noreferrer":r;return e.jsx("a",{href:t,className:"ds-link",onClick:n,target:a,rel:l,...o,children:s})}function At({children:t,size:s="m",variant:n="ghost",...a}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...a,children:c.Children.map(t,r=>c.isValidElement(r)?c.cloneElement(r,{size:s,variant:n}):r)})}function It({children:t,selected:s=!1,onClick:n,size:a="m",variant:r="ghost",disabled:o=!1,icon:i,href:l,...d}){const m=i&&!t,u=["ds-tab",`ds-tab--${a}`,`ds-tab--${r}`,s&&"ds-tab--selected",m&&"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=f=>{if(o){f.preventDefault();return}f.metaKey||f.ctrlKey||f.button===1||(f.preventDefault(),n==null||n(f))};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 Bt({options:t,value:s,onChange:n,size:a="m",disabled:r=!1}){const o=c.useRef(null),i=c.useRef(null),[l,d]=c.useState(!1),m=c.useRef(!1),u=c.useRef(null),h=c.useRef(null),x=()=>{if(!o.current)return;const f=o.current.querySelector(`[data-value="${s}"]`);if(!f)return;const b=o.current.getBoundingClientRect(),g=f.getBoundingClientRect(),w=g.left-b.left,y=g.width;i.current?(i.current.style.transition=m.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=w+"px",i.current.style.width=y+"px",m.current=!1):(d(!0),requestAnimationFrame(()=>{if(!i.current||!o.current)return;const k=o.current.querySelector(`[data-value="${s}"]`);if(!k)return;const R=o.current.getBoundingClientRect(),N=k.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=N.left-R.left+"px",i.current.style.width=N.width+"px"}))};return h.current=x,c.useLayoutEffect(()=>{const f=u.current!==s;u.current=s,m.current=l&&f,x()}),c.useEffect(()=>{if(!o.current)return;const f=new ResizeObserver(()=>{m.current=!1,h.current()});return f.observe(o.current),()=>f.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${a}`,r&&"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(f=>e.jsxs("button",{type:"button","data-value":f.value,className:["ds-seg__btn",s===f.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!r&&n(f.value),"aria-pressed":s===f.value,disabled:r,children:[f.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:f.icon}),f.label]},f.value))]})}function we({children:t,title:s,defaultExpanded:n=!1,expanded:a,onToggle:r,padding:o="m",...i}){const[l,d]=c.useState(n),m=a!==void 0,u=m?a:l,h=()=>{m?r==null||r(!a):d(f=>!f)},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: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,ue=8;function Dt(t,s,n){const a=window.innerWidth;let r,o;switch(t){case"top":r=s.top-n.height-ae,o=s.left+s.width/2-n.width/2;break;case"bottom":r=s.bottom+ae,o=s.left+s.width/2-n.width/2;break;case"left":r=s.top+s.height/2-n.height/2,o=s.left-n.width-ae;break;case"right":r=s.top+s.height/2-n.height/2,o=s.right+ae;break;default:r=s.bottom+ae,o=s.left}const i=Math.max(ue,Math.min(a-n.width-ue,o)),l=o-i;return{top:r,left:i,arrowOffset:l}}function Pt(t,s,n){const a=window.innerWidth,r=window.innerHeight;if(t.top>=s+ae+ue)return"top";if(r-t.bottom>=s+ae+ue)return"bottom";if(a-t.right>=n+ae+ue)return"right";if(t.left>=n+ae+ue)return"left";const o=Math.max(t.top,r-t.bottom,t.left,a-t.right);return o===t.top?"top":o===r-t.bottom?"bottom":o===a-t.right?"right":"left"}function ye({children:t,content:s,position:n,...a}){const[r,o]=c.useState(!1),[i,l]=c.useState({visibility:"hidden"}),[d,m]=c.useState(n||"top"),u=c.useRef(null),h=c.useRef(null),x=c.useRef(!1),f=()=>{if(!u.current||!h.current)return;const g=u.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),y=n||Pt(g,w.height,w.width),{top:k,left:R,arrowOffset:N}=Dt(y,g,w);m(y),l({position:"fixed",top:k,left:R,visibility:"visible","--arrow-offset":`${N}px`})};if(c.useEffect(()=>{if(!r)return;l({position:"fixed",visibility:"hidden"});const g=requestAnimationFrame(f);return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{cancelAnimationFrame(g),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[r,n]),c.useEffect(()=>{if(!r)return;const g=w=>{u.current&&!u.current.contains(w.target)&&o(!1)};return document.addEventListener("touchstart",g),()=>document.removeEventListener("touchstart",g)},[r]),!s)return t;const b=r&&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(g=>!g)},...a,children:[t,typeof document<"u"&&ee.createPortal(b,document.body)]})}const Fe=8,ge=8,Lt=140;function ze(t){const s=String(t??"").replace(/^@/,"").trim();return s?`@${s}`:""}function Ct({label:t,children:s,mode:n="click",avatar:a,name:r,handle:o,description:i,actions:l,className:d="",popoverClassName:m="",...u}){const h=c.useId(),x=c.useRef(null),f=c.useRef(null),b=c.useRef(null),[g,w]=c.useState(!1),[y,k]=c.useState(null),R=s!=null,N=r||t||"",j=ze(t||r),A=ze(o),I=c.useCallback(()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null)},[]),P=c.useCallback(()=>{I(),w(!0)},[I]),z=c.useCallback(()=>{I(),b.current=window.setTimeout(()=>w(!1),Lt)},[I]),E=c.useCallback(()=>{const F=x.current,C=f.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+Fe;U+T>window.innerHeight-ge&&(U=Math.max(ge,_.top-T-Fe));const H=Math.max(ge,Math.min(_.left,window.innerWidth-$-ge));k({top:U,left:H})},[]);c.useLayoutEffect(()=>{g&&E()},[g,E]),c.useEffect(()=>{if(!g)return;const F=()=>E(),C=T=>{T.key==="Escape"&&w(!1)},_=T=>{var U,H;if(n==="hover")return;const $=T.target;(U=f.current)!=null&&U.contains($)||(H=x.current)!=null&&H.contains($)||w(!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",_)}},[g,E,n]),c.useEffect(()=>()=>I(),[I]);const L=n==="hover"?{onMouseEnter:P,onMouseLeave:z}:{},O=g?ee.createPortal(e.jsxs("div",{ref:f,id:h,role:"dialog","aria-label":N||j||"Mention","data-ds-portal":"",className:["ds-mention__popover",m].filter(Boolean).join(" "),style:y?{top:y.top,left:y.left}:{top:-9999,left:-9999,visibility:"hidden"},...L,children:[(a||N||A)&&e.jsxs("div",{className:"ds-mention__head",children:[a,(N||A)&&e.jsxs("div",{className:"ds-mention__meta",children:[N?e.jsx("span",{className:"ds-mention__name",children:N}):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:()=>w(!1),children:l}):null]}),document.body):null;return e.jsxs(e.Fragment,{children:[e.jsx("button",{...u,ref:x,type:"button",className:["ds-mention",R&&"ds-mention--custom",d].filter(Boolean).join(" "),"aria-expanded":g,"aria-haspopup":"dialog","aria-label":R&&(j||N)||void 0,"aria-controls":g?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"){P();return}w(_=>!_)}},...L,children:R?s:j}),typeof document<"u"?O:null]})}function Mt({checked:t=!1,onChange:s,size:n="m",disabled:a=!1,label:r,id:o,...i}){const l=o||`toggle-${c.useId()}`,d=["ds-toggle",`ds-toggle--${n}`,a&&"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:m=>s==null?void 0:s(m.target.checked),disabled:a,...i}),e.jsx("span",{className:"ds-toggle__track",children:e.jsx("span",{className:"ds-toggle__thumb"})}),r&&e.jsx("span",{className:"ds-toggle__label",children:r})]})}function Ft({checked:t=!1,onChange:s,size:n="m",disabled:a=!1,label:r,id:o,...i}){const l=o||`checkbox-${c.useId()}`,d=["ds-checkbox",`ds-checkbox--${n}`,a&&"ds-checkbox--disabled"].filter(Boolean).join(" "),m=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:a,...i}),e.jsx("span",{className:"ds-checkbox__box",children:t&&e.jsx(B.Check,{size:m,strokeWidth:2.5,className:"ds-checkbox__icon"})}),r&&e.jsx("span",{className:"ds-checkbox__label",children:r})]})}function zt({checked:t=!1,onChange:s,size:n="m",disabled:a=!1,label:r,name:o,value:i,id:l,...d}){const m=l||`radio-${c.useId()}`,u=["ds-radio",`ds-radio--${n}`,a&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:u,htmlFor:m,children:[e.jsx("input",{type:"radio",id:m,className:"ds-radio__input",checked:t,onChange:h=>s==null?void 0:s(h.target.checked),disabled:a,name:o,value:i,...d}),e.jsx("span",{className:"ds-radio__circle",children:e.jsx("span",{className:"ds-radio__dot"})}),r&&e.jsx("span",{className:"ds-radio__label",children:r})]})}function Ze({width:t,height:s,shape:n="rect",aspectRatio:a,className:r="",style:o={},...i}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${n}`,r].filter(Boolean).join(" "),style:{width:t,height:s,aspectRatio:a,...o},"aria-hidden":"true",...i})}function Ot({lines:t=1,lastLineWidth:s="70%",gap:n,className:a="",style:r={},...o}){return e.jsx("span",{className:["ds-skeleton-text",a].filter(Boolean).join(" "),style:{gap:n,...r},"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))})}Ze.Text=Ot;function Wt(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 Ht(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 Ut({seed:t,icon:s,src:n,size:a=32,className:r="",style:o={},...i}){const l=Wt(t??""),[d,m]=c.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:Ht(t)});return e.jsx("div",{className:["ds-avatar",r].filter(Boolean).join(" "),style:{width:a,height:a,"--ds-avatar-h":l,...o},"aria-hidden":"true",...i,children:n&&!d?e.jsx("img",{src:n,alt:"",onError:()=>m(!0)}):u})}function Vt({children:t,size:s="compact",stickyTop:n,maxHeight:a,className:r="",style:o={},...i}){const l={...a?{maxHeight:a}:{},...n!==void 0?{"--ds-table-sticky-top":typeof n=="number"?`${n}px`:n}:{},...o};return e.jsx("div",{className:["ds-table-wrap","ds-scrollable",a?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:e.jsx("table",{className:["ds-table",`ds-table--${s}`,r].filter(Boolean).join(" "),...i,children:t})})}function Xt({children:t,...s}){return e.jsx("thead",{...s,children:t})}function Yt({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function qt({children:t,interactive:s,selected:n,subheader:a,exiting:r,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":"",a?"ds-table-row--subheader":"",r?"ds-table-row--exiting":"",o?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:l,...d,children:t})}function Gt({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 Kt({children:t,align:s="left",sortDir:n,onSort:a,width:r,className:o="",style:i={},...l}){const d=!!a||n!==void 0,m=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:a,style:{width:r,...i},...l,children:d?e.jsxs("span",{className:"ds-th__inner",children:[t,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(m,{size:11,strokeWidth:2.5})})]}):t})}function Jt({children:t,align:s="left",secondary:n,muted:a,truncate:r,nowrap:o,className:i="",...l}){return e.jsx("td",{className:["ds-td",s!=="left"?`ds-table-cell--${s}`:"",n?"ds-table-cell--secondary":"",a?"ds-table-cell--muted":"",r?"ds-table-cell--truncate":"",o?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:t})}function Zt({icon:t,title:s,description:n,action:a,size:r="m",className:o="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${r}`,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}),a&&e.jsx("div",{className:"ds-empty-state__action",children:a})]})}function Qt({label:t,hint:s,error:n,required:a=!1,disabled:r=!1,htmlFor:o,children:i,className:l="",style:d,...m}){const u=c.useId(),h=o??u,x=`${h}-hint`,f=`${h}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"data-state":n?"error":void 0,"data-required":a?"":void 0,"data-disabled":r?"":void 0,style:d,...m,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:f,role:"alert",children:n})]})}function es({label:t,value:s,delta:n,size:a="m",inline:r=!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--${a}`,r&&"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 ts({children:t,separator:s="/","aria-label":n,className:a="",style:r,...o}){const i=q(),l=c.Children.toArray(t).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${a?` ${a}`:""}`,"aria-label":n??i.breadcrumb,style:r,...o,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:l.map((d,m)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[d,m<l.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:s})]},m))})})}function ss({page:t,total:s,onChange:n,siblings:a=1,"aria-label":r,previousLabel:o,nextLabel:i,className:l="",style:d,...m}){const u=q(),{t:h}=me(),x=ns(t,s,a);return e.jsxs("nav",{className:`ds-pagination${l?` ${l}`:""}`,"aria-label":r??u.pagination,style:d,...m,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((f,b)=>f==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${b}`):e.jsx("button",{className:`ds-pagination-page${f===t?" ds-pagination-page--current":""}`,onClick:()=>f!==t&&(n==null?void 0:n(f)),"aria-current":f===t?"page":void 0,"aria-label":h("pageN",{n:f}),children:f},f)),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 ns(t,s,n){if(s<=7)return Array.from({length:s},(i,l)=>l+1);const a=Math.max(2,t-n),r=Math.min(s-1,t+n),o=[1];a>2&&o.push("…");for(let i=a;i<=r;i++)o.push(i);return r<s-1&&o.push("…"),o.push(s),o}const rs=300;function as({children:t,title:s,onClose:n,subHeader:a,side:r="right",size:o="wide",offsetLeft:i=0,offsetRight:l=0,keepOpenRef:d,closeLabel:m,...u}){const h=q(),x=c.useRef(null),f=c.useId(),[b,g]=c.useState(!1),w=()=>{!n||b||(g(!0),setTimeout(()=>{g(!1),n()},rs))};c.useEffect(()=>{const j=I=>{I.key==="Escape"&&w()},A=I=>{var z,E,L,O;const P=((E=(z=I.composedPath)==null?void 0:z.call(I))==null?void 0:E[0])??I.target;(L=d==null?void 0:d.current)!=null&&L.contains(P)||x.current&&!x.current.contains(P)&&!((O=P.closest)!=null&&O.call(P,"[data-ds-portal]"))&&w()};return document.addEventListener("keydown",j),document.addEventListener("mousedown",A),()=>{document.removeEventListener("keydown",j),document.removeEventListener("mousedown",A)}},[n,b,d]);const y=c.Children.toArray(t),k=y.find(j=>(j==null?void 0:j.type)===$e||(j==null?void 0:j.type)===de),R=y.filter(j=>(j==null?void 0:j.type)!==$e&&(j==null?void 0:j.type)!==de),N=e.jsx("div",{className:["ds-side-page-overlay",b&&"ds-side-page-overlay--closing"].filter(Boolean).join(" "),"data-side":r,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-side":r,"data-size":o,role:"dialog","aria-modal":"true","aria-labelledby":s?f:void 0,children:[n&&e.jsx(ne,{className:"ds-side-page__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:V[2],strokeWidth:1.5}),onClick:w,"aria-label":m??h.close}),(s||a)&&e.jsxs("div",{className:"ds-side-page__header",children:[s&&e.jsx("h3",{id:f,className:"ds-side-page__title",children:s}),a&&e.jsx("div",{className:"ds-side-page__subheader",children:a})]}),e.jsx("div",{className:"ds-side-page__body ds-scrollable",children:R}),k]})});return typeof document>"u"?N:ee.createPortal(N,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),os=c.forwardRef(function({children:s,collapsed:n=!1,side:a="left",onExpand:r,onCollapse:o,className:i="",...l},d){const m=["ds-nav-rail",n&&"ds-nav-rail--collapsed",`ds-nav-rail--${a}`,i].filter(Boolean).join(" "),u=c.useCallback(h=>{if(!h.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')){if(n&&r){r();return}!n&&o&&o()}},[n,r,o]);return e.jsx(pe.Provider,{value:{collapsed:n,side:a},children:e.jsx("nav",{ref:d,className:m,onClick:u,"data-expandable":n&&r?"":void 0,"data-collapsible":!n&&o?"":void 0,...l,children:s})})});function is({icon:t,label:s,selected:n=!1,disabled:a=!1,href:r,onClick:o,count:i,updated:l=!1,open:d=!1,onboarding:m=!1,className:u="",...h}){const{collapsed:x,side:f}=c.useContext(pe),b=c.useContext(ke),y={className:["ds-nav-rail__item",u].filter(Boolean).join(" "),onClick:a?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":a?"true":void 0,"aria-label":x?s:void 0,tabIndex:a?-1:void 0,...{"data-selected":n||void 0,"data-disabled":a||void 0,"data-open":d||void 0,"data-onboarding":m||void 0},...h},k=i!=null,R=f==="left"?"right":"left",N=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&&k&&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&&(!k||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),x&&k&&i!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":l||void 0,children:i>99?"99+":i}),x&&l&&(!k||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),j=r?e.jsx("a",{href:a?void 0:r,...y,children:N}):e.jsx("button",{type:"button",...y,children:N});return x&&!b?e.jsx(ye,{content:s,position:R,children:j}):j}function ls({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function cs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function ds({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function us({className:t="",...s}){return e.jsx("hr",{className:["ds-nav-rail__divider",t].filter(Boolean).join(" "),...s})}function fs({children:t,label:s,defaultOpen:n=!0,className:a="",...r}){const{collapsed:o}=c.useContext(pe),i=q(),l=s??i.recents,[d,m]=c.useState(n);return e.jsxs("div",{className:["ds-nav-rail__recents",a].filter(Boolean).join(" "),...r,children:[!o&&e.jsxs("button",{type:"button",className:["ds-nav-rail__recents-toggle",!d&&"ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),onClick:()=>m(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 ms=c.forwardRef(function({as:s="button",avatar:n,label:a,className:r="",...o},i){const{collapsed:l,side:d}=c.useContext(pe),m=c.useContext(ke),u=d==="left"?"right":"left",h=["ds-nav-rail__item","ds-nav-rail__agent",r].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:a})]}),f=e.jsx(s,{ref:i,className:h,"aria-label":l?a:void 0,...s==="button"?{type:"button"}:{},...o,children:x});return l&&!m?e.jsx(ye,{content:a,position:u,children:f}):f});function ps({avatar:t,label:s,selected:n=!1,disabled:a=!1,href:r,onClick:o,className:i="",...l}){const{collapsed:d,side:m}=c.useContext(pe),u=c.useContext(ke),f={className:["ds-nav-rail__item","ds-nav-rail__agent",i].filter(Boolean).join(" "),onClick:a?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":a?"true":void 0,tabIndex:a?-1:void 0,...{"data-selected":n||void 0,"data-disabled":a||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})]}),g=m==="left"?"right":"left",w=r?e.jsx("a",{href:a?void 0:r,...f,children:b}):e.jsx("button",{type:"button",...f,children:b});return d&&!u?e.jsx(ye,{content:s,position:g,children:w}):w}const Oe=240,We=6,He=8;function hs({trigger:t,title:s,children:n,open:a,onOpenChange:r,defaultOpen:o=!1,closeLabel:i}){const l=q(),{side:d}=c.useContext(pe),[m,u]=c.useState(o),h=a!==void 0,x=h?a:m,[f,b]=c.useState(!1),g=c.useRef(null),w=c.useRef(null),[y,k]=c.useState({}),R=c.useCallback(()=>{h?r==null||r(!0):u(!0)},[h,r]),N=c.useCallback(()=>{h?r==null||r(!1):u(!1)},[h,r]),j=c.useCallback(()=>x?N():R(),[x,R,N]),A=c.useCallback(()=>{var F;const P=g.current;if(!P)return;const z=P.getBoundingClientRect(),E=window.innerHeight,L=((F=w.current)==null?void 0:F.offsetHeight)??300,O=Math.max(He,Math.min(E-L-He,z.top));k(d==="right"?{position:"fixed",top:O,right:window.innerWidth-z.left+We,width:Oe}:{position:"fixed",top:O,left:z.right+We,width:Oe})},[d]);c.useEffect(()=>{if(!x){b(!1);return}return A(),requestAnimationFrame(()=>b(!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 P=E=>{var L,O;!((L=w.current)!=null&&L.contains(E.target))&&!((O=g.current)!=null&&O.contains(E.target))&&N()},z=E=>{E.key==="Escape"&&N()};return document.addEventListener("mousedown",P),document.addEventListener("keydown",z),()=>{document.removeEventListener("mousedown",P),document.removeEventListener("keydown",z)}},[x,N]);const I=x&&e.jsxs("div",{ref:w,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,f&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:y,"data-ds-portal":"",role:"dialog","aria-modal":"false",children:[s!=null&&e.jsxs("div",{className:"ds-nav-rail-flyout__header",children:[e.jsx("span",{className:"ds-nav-rail-flyout__title",children:s}),e.jsx("button",{type:"button",className:"ds-nav-rail-flyout__close",onClick:N,"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:g,onClick:j,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&ee.createPortal(I,document.body)]})}const xs={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};function vs({children:t,variant:s="info",action:n,onAction:a,onDismiss:r,role:o,dismissLabel:i,...l}){const d=q(),m=xs[s],u=o||(s==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${s}`,role:u,...l,children:[m&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(m,{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:a,children:n}),r&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:r,"aria-label":i??d.dismiss,children:e.jsx(B.X,{size:V[2],strokeWidth:1.5})})]})}function bs({trigger:t,items:s=[],open:n,onOpenChange:a,align:r="left",fullWidth:o=!1,className:i="",style:l,...d}){const[m,u]=c.useState(!1),[h,x]=c.useState(!1),f=n!==void 0,b=f?n:m,g=c.useRef(null),w=c.useRef(null),y=c.useRef(null),k=c.useRef(null),[R,N]=c.useState({}),j=c.useRef(null),A=150,I=()=>{if(f)a==null||a(!1);else{if(h)return;x(!0),j.current=setTimeout(()=>{u(!1),x(!1)},A)}},P=()=>{const _=!b;f?a==null||a(_):_?(clearTimeout(j.current),x(!1),u(!0)):I()},z=()=>{b||(f?a==null||a(!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=g.current)==null?void 0:X.getBoundingClientRect();if(!$)return;const U=window.innerHeight-$.bottom,H=U<_+8&&$.top>U;N(r==="right"?H?{bottom:window.innerHeight-$.top+4,top:"auto",right:window.innerWidth-$.right}:{top:$.bottom+4,bottom:"auto",right:window.innerWidth-$.right}:H?{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,r]);const E=()=>{var T;const _=(T=y.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,H;!((U=g.current)!=null&&U.contains($.target))&&!((H=w.current)!=null&&H.contains($.target))&&I()},T=$=>{$.key==="Escape"&&(I(),E())};return document.addEventListener("mousedown",_),document.addEventListener("keydown",T),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",T)}},[b]),c.useEffect(()=>{if(!b||!k.current||!w.current)return;const _=L(),T=k.current==="last"?_[_.length-1]:_[0];T==null||T.focus(),k.current=null},[b]);const L=()=>w.current?[...w.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],O=_=>{var T,$;if(_.key==="ArrowDown")_.preventDefault(),b?(T=L()[0])==null||T.focus():(k.current="first",z());else if(_.key==="ArrowUp")if(_.preventDefault(),!b)k.current="last",z();else{const U=L();($=U[U.length-1])==null||$.focus()}},F=_=>{var U,H,X,p;const T=L(),$=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():(H=T[$-1])==null||H.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":I();break}},C=b&&e.jsx("div",{ref:w,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${r}`,h&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:R,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",H=$?{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(" "),...H,onClick:()=>{var X;(X=_.onClick)==null||X.call(_),I()},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:g,className:["ds-dropdown",o&&"ds-dropdown--full-width",i].filter(Boolean).join(" "),style:l,...d,children:[e.jsx("div",{ref:y,className:"ds-dropdown__trigger",onClick:P,onKeyDown:O,children:t}),typeof document<"u"&&ee.createPortal(C,document.body)]})}function _s({value:t=0,size:s="m",variant:n="default",showValue:a=!1,min:r=2,animate:o=!0}){const i=Math.min(100,Math.max(0,t)),l=Math.max(r,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}%`}})}),a&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const js=t=>1-Math.pow(1-t,3),gs=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Qe(t,{duration:s=600}={}){const[n,a]=c.useState(t),r=c.useRef(t),o=c.useRef(null);return c.useEffect(()=>{if(gs()){a(t),r.current=t;return}const i=r.current,l=t-i;if(l===0)return;let d=null;const m=u=>{d||(d=u);const h=Math.min((u-d)/s,1);a(i+l*js(h)),h<1?o.current=requestAnimationFrame(m):r.current=t};return o.current=requestAnimationFrame(m),()=>cancelAnimationFrame(o.current)},[t,s]),n}function Ns({value:t,duration:s=600,decimals:n=0,prefix:a="",suffix:r=""}){const i=Qe(t,{duration:s}).toFixed(n);return`${a}${i}${r}`}function et({threshold:t=.1,rootMargin:s="0px",once:n=!1}={}){const a=c.useRef(null),[r,o]=c.useState(!1);return c.useEffect(()=>{const i=a.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:a,inView:r}}function ws({children:t,as:s="div",once:n=!1,threshold:a=.1,rootMargin:r="0px",onEnter:o,onLeave:i,...l}){const{ref:d,inView:m}=et({threshold:a,rootMargin:r,once:n}),u=c.useRef(!1);return c.useEffect(()=>{m&&!u.current&&(o==null||o()),!m&&u.current&&(i==null||i()),u.current=m},[m]),e.jsx(s,{ref:d,...l,children:typeof t=="function"?t(m):t})}const Ue={default:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};let fe=[];const Ae=new Set;function tt(){Ae.forEach(t=>t([...fe]))}function ys(t){fe=[...fe,t],tt()}function ks(t){fe=fe.filter(s=>s.id!==t),tt()}function Es(){const t=(s,n={})=>{ys({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 Rs({data:t,onDismiss:s}){const n=q(),[a,r]=c.useState(!1),o=c.useRef(null);c.useEffect(()=>(requestAnimationFrame(()=>r(!0)),t.duration>0&&(o.current=setTimeout(()=>i(),t.duration)),()=>clearTimeout(o.current)),[]);function i(){r(!1),setTimeout(()=>s(t.id),250)}const l=Ue[t.type]??Ue.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,a&&"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(B.X,{size:V[3],strokeWidth:1.5})})]})}function Ss({position:t="bottom-right"}){const[s,n]=c.useState(()=>[...fe]);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(a=>e.jsx(Rs,{data:a,onDismiss:ks},a.id))}),document.body)}const Ts={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 st({label:t,status:s="idle",icon:n,badge:a,defaultExpanded:r=!1,expanded:o,onToggle:i,children:l,className:d="",...m}){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}),Ts[s],a]});return l?e.jsx("div",{className:["ds-tool-card",u&&"ds-tool-card--running",d].filter(Boolean).join(" "),...m,children:e.jsx(we,{title:h,padding:"s",defaultExpanded:r,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(" "),...m,children:h})}function nt({text:t,size:s="xs",timeout:n=800,"aria-label":a,...r}){const o=q(),[i,l]=c.useState(!1),d=m=>{m.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:V[1],strokeWidth:1.5}),"aria-label":a??o.copyToClipboard,onClick:d,...r})}function $s({content:t,streaming:s=!1,...n}){const[a,r]=c.useState(s);return c.useEffect(()=>{r(!!s)},[s]),e.jsx(we,{expanded:a,onToggle:r,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(B.Brain,{size:V[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ke,{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 As({count:t,current:s=0,done:n=[],onChange:a,showCounter:r=!0,className:o="","aria-label":i,...l}){const d=q(),{t:m}=me();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,f=n.includes(h)&&!x,b=a&&(h<=s||n.includes(h)),g=["ds-step-indicator__dot",x&&"ds-step-indicator__dot--active",f&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:g,role:"tab","aria-selected":x,"aria-label":m("stepN",{n:h+1}),disabled:!b||h===s,onClick:()=>a==null?void 0:a(h),children:f?e.jsx(B.Check,{size:8,strokeWidth:3}):null},h)})}),r&&e.jsxs(De,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function Is({content:t,isStreaming:s=!1,cursor:n="line",onChunk:a,className:r="",...o}){const i=c.useRef(t);return c.useEffect(()=>{t!==i.current&&(a==null||a(t),i.current=t)},[t,a]),e.jsxs("span",{className:["ds-streaming-text",r].filter(Boolean).join(" "),...o,children:[t,s&&n!=="none"&&e.jsx("span",{className:`ds-cursor ds-cursor--${n}`,"aria-hidden":"true"})]})}function Bs({role:t="assistant",header:s,footer:n,attachments:a,isStreaming:r=!1,children:o,className:i="",...l}){const d=["ds-chat-message",`ds-chat-message--${t}`,r&&"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:[a&&e.jsx("div",{className:"ds-chat-message__attachments",children:a}),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}),a&&e.jsx("div",{className:"ds-chat-message__attachments",children:a}),e.jsx("div",{className:"ds-chat-message__body",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]})}function Ds(t,{containerRef:s,smartPause:n=!0}={}){const a=c.useRef(!1),r=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<r.current&&(a.current=!0),l&&(a.current=!1),r.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&&a.current||(o.scrollTop=o.scrollHeight))},t)}function rt({prompts:t,enabled:s,typingSpeed:n=38,erasingSpeed:a=18,holdTime:r=2200,betweenTime:o=380,manualPauseMs:i=5e3}){const[l,d]=c.useState(0),[m,u]=c.useState(""),h=c.useRef("typing"),x=c.useRef(0),f=c.useRef(0),b=c.useRef(null),g=c.useRef(0);c.useEffect(()=>{f.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 N=()=>{const j=Date.now();if(g.current>j){b.current=setTimeout(N,g.current-j);return}const A=t[f.current%t.length]??"";h.current==="typing"?(x.current+=1,u(A.slice(0,x.current)),x.current>=A.length?(h.current="holding",b.current=setTimeout(N,r)):b.current=setTimeout(N,n+Math.random()*28)):h.current==="holding"?(h.current="erasing",b.current=setTimeout(N,a)):(x.current=Math.max(0,x.current-1),u(A.slice(0,x.current)),x.current<=0?(h.current="typing",f.current=(f.current+1)%t.length,d(f.current),b.current=setTimeout(N,o)):b.current=setTimeout(N,a))};return b.current=setTimeout(N,260),()=>{b.current&&clearTimeout(b.current)}},[s,t,n,a,r,o]);const w=N=>{if(t.length===0)return;const j=(N%t.length+t.length)%t.length,A=t[j];f.current=j,x.current=A.length,h.current="holding",g.current=Date.now()+i,d(j),u(A)},y=()=>w(f.current+1),k=()=>w(f.current-1),R=t[l%t.length]??"";return{displayed:m,currentPrompt:R,index:l,next:y,prev:k}}let Ps=0;function Ls({value:t="",onChange:s,onSubmit:n,onStop:a,onKeyDown:r,loading:o=!1,disabled:i=!1,placeholder:l,animatedPlaceholders:d,attachments:m,images:u,onAttachFiles:h,onAttachImages:x,onRemoveAttachment:f,onRemoveImage:b,acceptImage:g,acceptFile:w,maxImages:y,maxImageSize:k,leftSlot:R,rightSlot:N,className:j="",...A}){const I=q(),{t:P}=me(),z=c.useRef(null),E=c.useRef(null),L=c.useRef(0),[O,F]=c.useState(!1),[C,_]=c.useState([]),T=l??I.promptPlaceholder,$=S=>{const M=++Ps;_(G=>[...G,{id:M,msg:S}]),setTimeout(()=>_(G=>G.filter(J=>J.id!==M)),6e3)},U=S=>_(M=>M.filter(G=>G.id!==S)),H=S=>S.type.startsWith("image/"),X=()=>!0,p=g??H,v=w??X,D=S=>{const M=[],G=[],J=[],Q=[];let te=0,le=y!=null?y-((u==null?void 0:u.length)??0):1/0;for(const se of S)p(se)?k&&se.size>k?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}},W=S=>{const M=k?P("fileTooLargeMaxHint",{maxMb:k/1024/1024}):"";$(P("fileTooLarge",{maxHint:M,names:S.join(", ")}))},Z=S=>{const{imageFiles:M,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:te}=D(S);J.length&&W(J),Q.length&&$(P("filesSkipped",{names:Q.join(", ")})),te&&$(P("maxImages",{n:y})),x&&M.length&&x(M);const le=G.concat(x?[]:M);h&&le.length&&h(le)};c.useEffect(()=>{const S=E.current;S&&(S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,200)}px`)},[t]),c.useEffect(()=>{const S=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",S),()=>document.removeEventListener("keydown",S)},[o,i]);const re=S=>{S.preventDefault(),L.current++,S.dataTransfer.types.includes("Files")&&F(!0)},Y=S=>{S.preventDefault(),L.current--,L.current===0&&F(!1)},K=S=>S.preventDefault(),ie=S=>{S.preventDefault(),L.current=0,F(!1);const M=Array.from(S.dataTransfer.files);M.length&&Z(M)},he=S=>{const M=Array.from(S.target.files||[]);z.current&&(z.current.value=""),M.length&&Z(M)},Ee=S=>{var se;if(!x)return;const M=(se=S.clipboardData)==null?void 0:se.items;if(!M)return;const G=[];for(const lt of M){const Le=lt.getAsFile();Le&&G.push(Le)}if(G.length===0)return;const{imageFiles:J,tooLarge:Q,skipped:te,limitExceeded:le}=D(G);Q.length&&W(Q),te.length&&$(P("filesSkipped",{names:te.join(", ")})),le&&$(P("maxImages",{n:y})),J.length&&(S.preventDefault(),x(J))},xe=!o&&!i&&!!(d!=null&&d.length)&&t.length===0,je=rt({prompts:d??[],enabled:xe}),ot=S=>{if(xe){if(S.key==="ArrowDown"||S.key==="ArrowRight"){S.preventDefault(),je.next();return}if(S.key==="ArrowUp"||S.key==="ArrowLeft"){S.preventDefault(),je.prev();return}if(S.key==="Tab"&&!S.shiftKey){S.preventDefault(),s==null||s(je.currentPrompt);return}}r==null||r(S)},it=(t.trim()||(u==null?void 0:u.length)>0||(m==null?void 0:m.length)>0)&&!i,Pe=h||x;return e.jsxs("div",{className:["ds-prompt-input",j].filter(Boolean).join(" "),...A,children:[Pe&&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",O&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:re,onDragLeave:Y,onDragOver:K,onDrop:ie,children:[O&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:I.dropFilesHere}),e.jsx("textarea",{ref:E,value:t,onChange:S=>s==null?void 0:s(S.target.value),onKeyDown:ot,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((S,M)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:S.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>b==null?void 0:b(M),"aria-label":I.removeImage,type:"button",children:e.jsx(B.X,{size:12,strokeWidth:2})})]},M))}),C.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:C.map(S=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:S.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>U(S.id),"aria-label":I.dismiss,children:e.jsx(B.X,{size:V[1],strokeWidth:1.5})})]},S.id))}),m&&m.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:m.map((S,M)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[S.uploading?e.jsx(B.Loader,{size:V[1],strokeWidth:1.5,className:"spin"}):e.jsx(B.Paperclip,{size:V[1],strokeWidth:1.5}),S.filename,S.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:I.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>f==null?void 0:f(M),"aria-label":I.removeAttachment,children:e.jsx(B.X,{size:V[1],strokeWidth:1.5})})]})},M))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[Pe&&e.jsx(ne,{variant:"ghost",size:"xs",icon:e.jsx(B.Paperclip,{size:V[2],strokeWidth:1.5}),"aria-label":I.attachFiles,onClick:()=>{var S;return(S=z.current)==null?void 0:S.click()}}),R,N,e.jsx("div",{className:"ds-prompt-input__spacer"}),o?e.jsx(ne,{variant:"primary",size:"xs",icon:e.jsx(B.Square,{size:V[2],strokeWidth:1.5}),onClick:a,"aria-label":I.stop}):e.jsx(ne,{variant:"primary",size:"xs",icon:e.jsx(B.ArrowUp,{size:V[2],strokeWidth:1.5}),onClick:n,disabled:!it,"aria-label":I.send})]})]})]})}const Ve={fast:0,standard:1,premium:2},Xe={fast:"data-5",standard:"data-3",premium:"data-6"};function Cs({models:t=[],value:s,onChange:n,size:a="xs",minTier:r,showAutoOption:o=!1,groupByTier:i=!0,className:l="",...d}){const[m,u]=c.useState(!1),h=c.useRef(null),x=c.useRef(null),f=c.useRef(null),[b,g]=c.useState({}),w=t.filter(E=>!r||E.name==="auto"?!0:(Ve[E.tier]??1)>=(Ve[r]??1)),y=w.find(E=>E.name==="auto"),k=w.filter(E=>E.name!=="auto"),R=t.find(E=>E.name===s),j=new Set(k.map(E=>E.tier).filter(Boolean)).size>1;c.useEffect(()=>{if(!m)return;const E=320,L=()=>{var $;const C=($=x.current)==null?void 0:$.getBoundingClientRect();if(!C)return;const _=window.innerHeight-C.bottom,T=_<E+8&&C.top>_;g({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"}})};L(),window.addEventListener("scroll",L,!0),window.addEventListener("resize",L);const O=C=>{var _,T;!((_=h.current)!=null&&_.contains(C.target))&&!((T=f.current)!=null&&T.contains(C.target))&&u(!1)},F=C=>{C.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",O),document.addEventListener("keydown",F),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L),document.removeEventListener("mousedown",O),document.removeEventListener("keydown",F)}},[m]);const A=E=>{n==null||n(E),u(!1)},I=E=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",E.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>A(E.name),children:[E.icon?e.jsx("span",{className:"ds-model-picker__item-icon",children:E.icon}):e.jsx(B.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:Xe[E.tier]||"default",children:E.tier})]},E.name),P=()=>!i||!j?k.map(I):["fast","standard","premium"].flatMap(E=>{const L=k.filter(O=>O.tier===E);return L.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":E,children:E.charAt(0).toUpperCase()+E.slice(1)},`lbl-${E}`),...L.map(I)]:[]}),z=m&&e.jsxs("div",{ref:f,className:"ds-model-picker__menu ds-scrollable","data-ds-portal":"",style:b,children:[o&&y&&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:()=>A("auto"),children:[e.jsx(B.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)"})]}),k.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),P()]});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":m,children:[R!=null&&R.icon?e.jsx("span",{children:R.icon}):e.jsx(B.Cpu,{size:12,strokeWidth:1.5}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(R==null?void 0:R.displayName)||(R==null?void 0:R.name)||s}),j&&(R==null?void 0:R.tier)&&e.jsx(ce,{size:"xs",variant:Xe[R.tier]||"default",children:R.tier})]}),typeof document<"u"&&ee.createPortal(z,document.body)]})}const Ms=({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 Fs(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 zs({sources:t=[],layout:s="list",title:n,maxVisible:a=5,onSourceClick:r}){const o=q(),{t:i}=me(),l=n??o.sources,[d,m]=c.useState(!1),u=Fs(t),h=u.length>a,x=d?u:u.slice(0,a),f=t.some(y=>y.snippet),b=y=>y!=null&&y.length?i("pageAbbrev",{pages:y.join(", ")}):null,g=i("moreSources",{n:u.length-a}),w=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:w,children:[x.map(y=>{const k=y.items.map(j=>j.page).filter(Boolean),R=b(k),N=!!r;return e.jsxs("div",{className:`ds-sources-panel__compact-row${N?" ds-sources-panel__compact-row--clickable":""}`,onClick:N?()=>r(y.items[0]):void 0,children:[e.jsx(B.FileText,{size:V[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),R&&e.jsx("span",{className:"ds-sources-panel__pages",children:R})]},y.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>m(!0),children:g})]}):e.jsxs("div",{className:w,children:[l&&e.jsx("div",{className:"ds-sources-panel__title",children:l}),x.map(y=>{const k=y.items.map(j=>j.page).filter(Boolean),R=b(k),N=!!r;return f?e.jsx(we,{title:e.jsx(Ms,{filename:y.filename,pagesLabel:R}),padding:"s",children:y.items.map((j,A)=>e.jsx("div",{className:`ds-sources-panel__snippet${N?" ds-sources-panel__snippet--clickable":""}`,onClick:N?()=>r(j):void 0,children:j.snippet??i("pageAbbrev",{pages:j.page})},A))},y.filename):e.jsxs("div",{className:`ds-sources-panel__row${N?" ds-sources-panel__row--clickable":""}`,onClick:N?()=>r(y.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),R&&e.jsx("span",{className:"ds-sources-panel__pages",children:R})]},y.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>m(!0),children:g})]})}function Ye(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function Os({used:t,limit:s,size:n="s",showCount:a=!0,showPercent:r=!1,warningThreshold:o=.8,errorThreshold:i=1}){const l=s>0?t/s:0,d=Math.min(l*100,100),m=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--${m}`,style:{width:`${d}%`}})}),(a||r)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${m}`,children:[a&&e.jsxs("span",{children:[Ye(t)," / ",Ye(s)]}),r&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(l*100),"%"]})]})]})}const qe=5;function Ws(t){return t<.34?"low":t<.67?"medium":"high"}function Hs({value:t=0,size:s="xs",showLabel:n="none",layout:a="inline"}){const r=Math.max(0,Math.min(1,t)),o=Math.round(r*qe),i=Ws(r);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${s}`,`ds-confidence-bar--${i}`,a==="block"&&"ds-confidence-bar--block"].filter(Boolean).join(" "),children:[e.jsx("div",{className:"ds-confidence-bar__segments","aria-hidden":"true",children:Array.from({length:qe},(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 Us={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:Us[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function Vs({lines:t=[],layout:s="inline",wordWrap:n=!1,lineNumbers:a=!0,maxHeight:r,title:o}){const i=["ds-diff-view",`ds-diff-view--${s}`,n&&"ds-diff-view--wrap"].filter(Boolean).join(" "),l=r?{maxHeight:r,overflowY:"auto"}:void 0;if(s==="split"){const d=t.filter(u=>u.type==="remove"||u.type==="context"),m=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:a},h))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:m.map((u,h)=>e.jsx(Re,{line:u,lineNumbers:a},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,m)=>e.jsx(Re,{line:d,lineNumbers:a},m))})]})}function at({value:t="idle",onLike:s,onDislike:n,className:a="",likeLabel:r,dislikeLabel:o,...i}){const l=q(),d=t!=="idle";return e.jsxs("div",{className:["ds-message-feedback",d&&"ds-message-feedback--voted",a].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":r??l.like,"aria-pressed":t==="liked",children:e.jsx(B.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(B.ThumbsDown,{size:V[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function Xs(t){const s=t instanceof Date?t:new Date(t);if(isNaN(s))return null;const n=new Date,a=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(r-864e5);if(s>=r)return a;if(s>=o)return`Yesterday ${a}`;const i=s.getDate(),l=s.toLocaleString([],{month:"short"});return`${i} ${l} ${a}`}function Ys({role:t="assistant",text:s,timestamp:n,feedbackValue:a="idle",onLike:r,onDislike:o,className:i="",...l}){const d=t==="assistant"&&(r||o),m=!!s,u=n?Xs(n):null;return!d&&!m&&!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(at,{className:"ds-message-action",value:a,onLike:r,onDislike:o}),m&&e.jsx(nt,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function qs({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 Gs({variant:t="light",glow:s,mask:n=!0,style:a,...r}){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%)"},...a},...r,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 Ks({children:t,axis:s="y",style:n,className:a="",...r}){const o=s==="x"?{overflowX:"auto",overflowY:"hidden"}:s==="both"?{overflow:"auto"}:{overflowY:"auto",overflowX:"hidden"};return e.jsx("div",{className:`ds-scrollable ${a}`,style:{...o,...n},...r,children:t})}const Se=280,Js=22,Zs=14,oe=8,Ne=6,Qs=200;function en(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function tn(t,s,n,a){const r=window.innerWidth,o=window.innerHeight;if(o-t.bottom>=s+a+oe)return"bottom";if(t.top>=s+a+oe)return"top";if(r-t.right>=n+a+oe)return"right";if(t.left>=n+a+oe)return"left";const i=Math.max(t.top,o-t.bottom,r-t.right,t.left);return i===o-t.bottom?"bottom":i===t.top?"top":i===r-t.right?"right":"left"}function sn(t,s,n,a,r){const o=window.innerWidth,i=window.innerHeight;let l,d;switch(t){case"top":l=s.top-n-r,d=s.left+s.width/2-a/2;break;case"bottom":l=s.bottom+r,d=s.left+s.width/2-a/2;break;case"left":l=s.top+s.height/2-n/2,d=s.left-a-r;break;default:l=s.top+s.height/2-n/2,d=s.right+r}const m=Math.max(oe,Math.min(o-a-oe,d)),u=Math.max(oe,Math.min(i-n-oe,l));return{top:u,left:m,arrowOffset:d-m,arrowOffsetY:l-u}}function nn({steps:t,currentStep:s,onNext:n,onBack:a,onSkip:r,onFinish:o,overlay:i=!0,ring:l=!0,labelNext:d,labelBack:m,labelSkip:u,labelFinish:h,statePrimary:x="idle",stateBack:f="idle"}){const b=q(),{t:g}=me(),w=d??b.next,y=m??b.back,k=u??b.skipTour,R=h??b.done,N=c.useRef(null),j=c.useRef(t),A=c.useRef(s),I=c.useRef(l);j.current=t,A.current=s,I.current=l;const[P,z]=c.useState(!1),[E,L]=c.useState({position:"fixed",visibility:"hidden",width:Se}),[O,F]=c.useState("bottom"),[C,_]=c.useState(null),T=c.useRef(!1),$=t[s],U=s===t.length-1,H=c.useCallback(()=>{const X=j.current[A.current];if(!X||!N.current)return;const p=en(X.target);if(!p)return;const v=p.getBoundingClientRect(),W=N.current.getBoundingClientRect().height||160,Z=Se,re=I.current?Js:Zs,Y=X.position||tn(v,W,Z,re),{top:K,left:ie,arrowOffset:he,arrowOffsetY:Ee}=sn(Y,v,W,Z,re);F(Y),L({position:"fixed",top:K,left:ie,width:Se,visibility:"visible","--arrow-offset":`${he}px`,"--arrow-offset-y":`${Ee}px`}),_({top:v.top-Ne,left:v.left-Ne,width:v.width+Ne*2,height:v.height+Ne*2})},[]);return c.useEffect(()=>{window.addEventListener("scroll",H,!0),window.addEventListener("resize",H);const X=requestAnimationFrame(()=>{H(),z(!0),T.current=!0});return()=>{cancelAnimationFrame(X),window.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}},[]),c.useEffect(()=>{if(!T.current)return;z(!1);const X=setTimeout(()=>{L(p=>({...p,visibility:"hidden"})),requestAnimationFrame(()=>{H(),z(!0)})},Qs+20);return()=>clearTimeout(X)},[s]),c.useEffect(()=>{P&&N.current&&N.current.focus({preventScroll:!0})},[P]),c.useEffect(()=>{const X=p=>{p.key==="Escape"&&r()};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[r]),c.useEffect(()=>{if(!P)return;const X=p=>{if(p.key!=="Tab"||!N.current)return;const v=Array.from(N.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!v.length)return;const D=v[0],W=v[v.length-1];p.shiftKey&&document.activeElement===D?(p.preventDefault(),W.focus()):!p.shiftKey&&document.activeElement===W&&(p.preventDefault(),D.focus())};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[P]),!$||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",P&&"ds-coachmark__spotlight--visible"].filter(Boolean).join(" "),style:C,"aria-hidden":"true"}),e.jsxs("div",{ref:N,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":$.title??g("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${O}`,P&&"ds-coachmark__bubble--visible"].filter(Boolean).join(" "),style:E,tabIndex:-1,children:[e.jsx("button",{type:"button",className:"ds-coachmark__close",onClick:r,"aria-label":k,children:e.jsx(B.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:f,onClick:a,children:y}),e.jsx(ne,{variant:"primary",size:"s",state:x,onClick:U?o:n,children:U?R:w})]})]})]})]}),document.body)}function rn(t,s={}){const{storageKey:n}=s,[a,r]=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:a,isActive:o,start:()=>{l()||(r(0),i(!0))},next:()=>r(m=>Math.min(m+1,t.length-1)),back:()=>r(m=>Math.max(m-1,0)),skip:d,finish:d}}function an(){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 a=()=>{n.classList.remove("ds-shake"),n.removeEventListener("animationend",a)};n.addEventListener("animationend",a)},[]);return{ref:t,shake:s}}exports.Accordion=we;exports.Alert=yt;exports.AnimatedNumber=Ns;exports.Avatar=Ut;exports.Badge=ce;exports.Banner=vs;exports.BottomSheet=St;exports.Breadcrumb=ts;exports.Button=ne;exports.Card=vt;exports.ChatMessage=Bs;exports.Checkbox=Ft;exports.Coachmark=nn;exports.Code=Tt;exports.CodeAccordion=Je;exports.ConfidenceBar=Hs;exports.CopyButton=nt;exports.DiffView=Vs;exports.Dropdown=bs;exports.EmptyState=Zt;exports.EngineerGrid=Gs;exports.FormField=Qt;exports.H1=bt;exports.H2=_t;exports.H3=jt;exports.H4=gt;exports.InView=ws;exports.Input=mt;exports.Link=$t;exports.LocaleProvider=ut;exports.Mention=Ct;exports.MessageFeedback=at;exports.MessageFooter=Ys;exports.Modal=Et;exports.ModalFooter=de;exports.ModelPicker=Cs;exports.NavRail=os;exports.NavRailAgent=ps;exports.NavRailBody=ls;exports.NavRailCustomItem=ms;exports.NavRailDivider=us;exports.NavRailFlyout=hs;exports.NavRailFooter=ds;exports.NavRailHeader=cs;exports.NavRailItem=is;exports.NavRailRecents=fs;exports.P1=Nt;exports.P2=Ke;exports.P3=De;exports.Pagination=ss;exports.ProgressBar=_s;exports.PromptInput=Ls;exports.Radio=zt;exports.ReasoningBlock=$s;exports.Scrollable=Ks;exports.SegmentedControl=Bt;exports.Select=ht;exports.SidePage=as;exports.SidePageFooter=$e;exports.Skeleton=Ze;exports.SourcesPanel=zs;exports.Spinner=Ge;exports.Stat=es;exports.StepIndicator=As;exports.Stepper=xt;exports.StreamingText=Is;exports.Tab=It;exports.Table=Vt;exports.TableBody=Yt;exports.TableHead=Xt;exports.TableRow=qt;exports.TableSubheaderRow=Gt;exports.Tabs=At;exports.Td=Jt;exports.Textarea=pt;exports.Th=Kt;exports.ThinkingDot=qs;exports.ToastContainer=Ss;exports.Toggle=Mt;exports.TokenCounter=Os;exports.ToolCallBubble=st;exports.ToolCallCard=st;exports.Tooltip=ye;exports.defaultStrings=_e;exports.formatString=Ie;exports.iconSizes=V;exports.useAnimatedNumber=Qe;exports.useAnimatedPlaceholder=rt;exports.useCoachmark=rn;exports.useInView=et;exports.useLocale=me;exports.useShake=an;exports.useStreamScroll=Ds;exports.useStrings=q;exports.useToast=Es;
|
|
22
|
+
<%s key={someKey} {...props} />`,O,Y,K,Y),X[Y+O]=!0)}if(Y=null,D!==void 0&&(n(D),Y=""+D),i(v)&&(n(v.key),Y=""+v.key),"key"in v){D={};for(var ie in v)ie!=="key"&&(D[ie]=v[ie])}else D=v;return Y&&l(D,typeof p=="function"?p.displayName||p.name||"Unknown":p),f(p,Y,D,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"),N=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),w=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),I=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"),W=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)(),H=_(r(o)),X={};be.Fragment=g,be.jsx=function(p,v,D){var O=1e4>W.recentlyCreatedOwnerStacks++;return u(p,v,D,!1,O?Error("react-stack-top-frame"):U,O?_(r(p)):H)},be.jsxs=function(p,v,D){var O=1e4>W.recentlyCreatedOwnerStacks++;return u(p,v,D,!0,O?Error("react-stack-top-frame"):U,O?_(r(p)):H)}}()),be}process.env.NODE_ENV==="production"?Te.exports=ct():Te.exports=dt();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 ut({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 Ge({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 ft={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="",...N}){const g=a&&!t,y=i==="loading",k=i==="success",R=i==="error",w=y||k||R,j=!!(l||d),A=n==="xs"?"s":"m",I=s==="danger"?"on-accent":"default",L=ft[n]??16,z=y?e.jsx(Ge,{size:A,color:I}):k?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.Check,{size:L,strokeWidth:2.5})}):R?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.X,{size:L,strokeWidth:2.5})}):null,E=["ds-button",`ds-button--${s}`,`ds-button--${n}`,r&&"ds-button--full",g&&"ds-button--icon-only",b].filter(Boolean).join(" "),P=i!=="idle"?i:void 0,W=m!==void 0?m:j?!0:void 0,F=e.jsxs(e.Fragment,{children:[w?z:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),t]});if(h){const C=_=>{if(o||y){_.preventDefault();return}_.metaKey||_.ctrlKey||_.button===1||(_.preventDefault(),f==null||f(_))};return e.jsx("a",{className:E,href:o||y?void 0:h,onClick:C,"aria-label":x,"aria-disabled":o||y?"true":void 0,"aria-busy":y?"true":void 0,"aria-pressed":W,"data-state":P,"data-active":j?"true":void 0,...N,children:F})}return e.jsx("button",{type:u,className:E,disabled:o,onClick:y?void 0:f,"aria-label":x,"aria-busy":y?"true":void 0,"aria-pressed":W,"data-state":P,"data-active":j?"true":void 0,...N,children:F})}function mt({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,N=s?`${m}-error`:void 0,g=N||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":g,...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:N,className:"ds-input-error",role:"alert",children:s})})})]})}function pt({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 ht({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),[N,g]=c.useState(!1),[y,k]=c.useState({}),[R,w]=c.useState("down"),[j,A]=c.useState(-1),I=c.useRef(null),L=c.useRef(null),z=c.useRef(null),E=c.useRef(null),P=f||`select-${c.useId()}`,W=`${P}-label`,F=o?`${P}-error`:void 0,C=150,_=(v=!1)=>{N||(g(!0),A(-1),E.current=setTimeout(()=>{var D;b(!1),g(!1),v&&((D=z.current)==null||D.focus())},C))},T=v=>{clearTimeout(E.current),g(!1);const D=v!==void 0?v:Math.max(r.findIndex(O=>O.value===s),0);A(D),b(!0)};c.useEffect(()=>()=>clearTimeout(E.current),[]);const $=()=>{var K;const v=(K=I.current)==null?void 0:K.getBoundingClientRect();if(!v)return;const D=window.innerHeight,O=D-v.bottom,Z=v.top,Y=O<300&&Z>O;w(Y?"up":"down"),k(Y?{bottom:D-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=D=>{I.current&&!I.current.contains(D.target)&&L.current&&!L.current.contains(D.target)&&_()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[N]),c.useEffect(()=>{var D;if(!m||j<0||!L.current)return;(D=L.current.querySelectorAll(".ds-select-option")[j])==null||D.scrollIntoView({block:"nearest"})},[j,m]);const U=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),m?A(D=>Math.min(D+1,r.length-1)):T();break;case"ArrowUp":v.preventDefault(),m?A(D=>Math.max(D-1,0)):T(r.length-1);break;case"Home":m&&(v.preventDefault(),A(0));break;case"End":m&&(v.preventDefault(),A(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}},H=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?W:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${R}`,N&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:y,children:r.map((v,D)=>e.jsx("button",{id:`${P}-opt-${D}`,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",D===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:W,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:I,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?W: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: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&&R==="down"?"ds-select-icon--open":""} ${m&&R==="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 xt({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 w=Math.min(Number(s)+o,a);n==null||n(w)},N=()=>{if(l)return;const w=Math.max(Number(s)-o,r);n==null||n(w)},g=w=>{if(l)return;const j=w.target.value;if(j===""){n==null||n(r);return}const A=Number(j);if(!isNaN(A)){const I=Math.min(Math.max(A,r),a);n==null||n(I)}},y=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),k=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),R=i==="xs"?V[1]:i==="small"?V[2]:V[3];return e.jsxs("div",{className:y,children:[t&&e.jsx("label",{className:"ds-stepper-label",children:t}),e.jsxs("div",{className:k,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:N,disabled:l||s<=r,"aria-label":u??m.decrease,children:e.jsx(B.Minus,{size:R,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:g,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(B.Plus,{size:R,strokeWidth:1.5})})]}),d&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:d}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function vt({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=N=>{if(i){N.preventDefault();return}N.metaKey||N.ctrlKey||N.button===1||(N.preventDefault(),a==null||a(N))};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 bt({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function _t({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function jt({children:t,...s}){return e.jsx("h3",{className:"ds-h3",...s,children:t})}function Nt({children:t,...s}){return e.jsx("h4",{className:"ds-h4",...s,children:t})}function wt({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function Ke({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 gt={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle},yt=c.forwardRef(function({children:s,variant:n="info",title:r,onClose:a,role:o,closeLabel:i,...l},d){const f=q(),u=gt[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(B.X,{size:V[3],strokeWidth:1.5})})]})}),kt=200;function Et({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.useId(),[h,x]=c.useState(!1),m=()=>{!n||h||(x(!0),setTimeout(()=>{x(!1),n()},kt))};c.useEffect(()=>{const k=w=>{w.key==="Escape"&&m()},R=w=>{var A,I,L;const j=((I=(A=w.composedPath)==null?void 0:A.call(w))==null?void 0:I[0])??w.target;f.current&&!f.current.contains(j)&&!((L=j.closest)!=null&&L.call(j,"[data-ds-portal]"))&&m()};return document.addEventListener("keydown",k),document.addEventListener("mousedown",R),()=>{document.removeEventListener("keydown",k),document.removeEventListener("mousedown",R)}},[n,h]);const b=c.Children.toArray(t),N=b.find(k=>(k==null?void 0:k.type)===de),g=b.filter(k=>(k==null?void 0:k.type)!==de),y=e.jsx("div",{className:["ds-modal-overlay",h&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...l,children:e.jsxs("div",{className:[`ds-modal ds-modal--${r}`,a&&"ds-modal--scrollable"].filter(Boolean).join(" "),ref:f,role:"dialog","aria-modal":"true","aria-labelledby":s?u:void 0,children:[n&&e.jsx(ne,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:V[2],strokeWidth:1.5}),onClick:m,"aria-label":i??d.closeModal}),(s||o)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:u,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:g}),N]})});return typeof document>"u"?y:ee.createPortal(y,document.body)}function de({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const Rt=320;function St({children:t,title:s,onClose:n,subHeader:r,closeLabel:a,...o}){const i=q(),l=c.useRef(null),d=c.useId(),[f,u]=c.useState(!1),h=()=>{!n||f||(u(!0),setTimeout(()=>{u(!1),n()},Rt))};c.useEffect(()=>{const g=k=>{k.key==="Escape"&&h()},y=k=>{var w,j,A;const R=((j=(w=k.composedPath)==null?void 0:w.call(k))==null?void 0:j[0])??k.target;l.current&&!l.current.contains(R)&&!((A=R.closest)!=null&&A.call(R,"[data-ds-portal]"))&&h()};return document.addEventListener("keydown",g),document.addEventListener("mousedown",y),()=>{document.removeEventListener("keydown",g),document.removeEventListener("mousedown",y)}},[n,f]);const x=c.Children.toArray(t),m=x.find(g=>(g==null?void 0:g.type)===de),b=x.filter(g=>(g==null?void 0:g.type)!==de),N=e.jsx("div",{className:["ds-bottom-sheet-overlay",f&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...o,children:e.jsxs("div",{ref:l,className:["ds-bottom-sheet",f&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-labelledby":s?d: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:V[2],strokeWidth:1.5}),onClick:h,"aria-label":a??i.close}),(s||r)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[s&&e.jsx("h3",{id:d,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:b}),m]})});return typeof document>"u"?N:ee.createPortal(N,document.body)}function Je({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(g=>!g)},N=["ds-code-accordion",`ds-code-accordion--${o}`,m&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:N,...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(B.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 Tt({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(Je,{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 $t({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 At({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 Bt({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 It({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-browser-pane",s].filter(Boolean).join(" "),...n,children:t})}function Dt({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 Lt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-list",s].filter(Boolean).join(" "),role:"list",...n,children:t})}function Pt({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 Ct({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(),N=m.getBoundingClientRect(),g=N.left-b.left,y=N.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=g+"px",i.current.style.width=y+"px",f.current=!1):(d(!0),requestAnimationFrame(()=>{if(!i.current||!o.current)return;const k=o.current.querySelector(`[data-value="${s}"]`);if(!k)return;const R=o.current.getBoundingClientRect(),w=k.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=w.left-R.left+"px",i.current.style.width=w.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: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 Mt(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 Ft(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 N=u.current.getBoundingClientRect(),g=h.current.getBoundingClientRect(),y=n||Ft(N,g.height,g.width),{top:k,left:R,arrowOffset:w}=Mt(y,N,g);f(y),l({position:"fixed",top:k,left:R,visibility:"visible","--arrow-offset":`${w}px`})};if(c.useEffect(()=>{if(!a)return;l({position:"fixed",visibility:"hidden"});const N=requestAnimationFrame(m);return window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{cancelAnimationFrame(N),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[a,n]),c.useEffect(()=>{if(!a)return;const N=g=>{u.current&&!u.current.contains(g.target)&&o(!1)};return document.addEventListener("touchstart",N),()=>document.removeEventListener("touchstart",N)},[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(N=>!N)},...r,children:[t,typeof document<"u"&&ee.createPortal(b,document.body)]})}const Fe=8,Ne=8,zt=140;function ze(t){const s=String(t??"").replace(/^@/,"").trim();return s?`@${s}`:""}function Wt({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),[N,g]=c.useState(!1),[y,k]=c.useState(null),R=s!=null,w=a||t||"",j=ze(t||a),A=ze(o),I=c.useCallback(()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null)},[]),L=c.useCallback(()=>{I(),g(!0)},[I]),z=c.useCallback(()=>{I(),b.current=window.setTimeout(()=>g(!1),zt)},[I]),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+Fe;U+T>window.innerHeight-Ne&&(U=Math.max(Ne,_.top-T-Fe));const H=Math.max(Ne,Math.min(_.left,window.innerWidth-$-Ne));k({top:U,left:H})},[]);c.useLayoutEffect(()=>{N&&E()},[N,E]),c.useEffect(()=>{if(!N)return;const F=()=>E(),C=T=>{T.key==="Escape"&&g(!1)},_=T=>{var U,H;if(n==="hover")return;const $=T.target;(U=m.current)!=null&&U.contains($)||(H=x.current)!=null&&H.contains($)||g(!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",_)}},[N,E,n]),c.useEffect(()=>()=>I(),[I]);const P=n==="hover"?{onMouseEnter:L,onMouseLeave:z}:{},W=N?ee.createPortal(e.jsxs("div",{ref:m,id:h,role:"dialog","aria-label":w||j||"Mention","data-ds-portal":"",className:["ds-mention__popover",f].filter(Boolean).join(" "),style:y?{top:y.top,left:y.left}:{top:-9999,left:-9999,visibility:"hidden"},...P,children:[(r||w||A)&&e.jsxs("div",{className:"ds-mention__head",children:[r,(w||A)&&e.jsxs("div",{className:"ds-mention__meta",children:[w?e.jsx("span",{className:"ds-mention__name",children:w}):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:()=>g(!1),children:l}):null]}),document.body):null;return e.jsxs(e.Fragment,{children:[e.jsx("button",{...u,ref:x,type:"button",className:["ds-mention",R&&"ds-mention--custom",d].filter(Boolean).join(" "),"aria-expanded":N,"aria-haspopup":"dialog","aria-label":R&&(j||w)||void 0,"aria-controls":N?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}g(_=>!_)}},...P,children:R?s:j}),typeof document<"u"?W:null]})}function Ot({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 Ht({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 Ut({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 Ze({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 Vt({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))})}Ze.Text=Vt;function Xt(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 Yt(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 qt({seed:t,icon:s,src:n,size:r=32,className:a="",style:o={},...i}){const l=Xt(t??""),[d,f]=c.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:Yt(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 Gt({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 Kt({children:t,...s}){return e.jsx("thead",{...s,children:t})}function Jt({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function Zt({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 Qt({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 es({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 ts({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 ss({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 ns({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 rs({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 as({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 os({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=is(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,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(B.ChevronRight,{size:16})})]})}function is(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 ls=300;function cs({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,N]=c.useState(!1),g=()=>{!n||b||(N(!0),setTimeout(()=>{N(!1),n()},ls))};c.useEffect(()=>{const j=I=>{I.key==="Escape"&&g()},A=I=>{var z,E,P,W;const L=((E=(z=I.composedPath)==null?void 0:z.call(I))==null?void 0:E[0])??I.target;(P=d==null?void 0:d.current)!=null&&P.contains(L)||x.current&&!x.current.contains(L)&&!((W=L.closest)!=null&&W.call(L,"[data-ds-portal]"))&&g()};return document.addEventListener("keydown",j),document.addEventListener("mousedown",A),()=>{document.removeEventListener("keydown",j),document.removeEventListener("mousedown",A)}},[n,b,d]);const y=c.Children.toArray(t),k=y.find(j=>(j==null?void 0:j.type)===$e||(j==null?void 0:j.type)===de),R=y.filter(j=>(j==null?void 0:j.type)!==$e&&(j==null?void 0:j.type)!==de),w=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-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:V[2],strokeWidth:1.5}),onClick:g,"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:R}),k]})});return typeof document>"u"?w:ee.createPortal(w,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),ds=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 us({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),y={className:["ds-nav-rail__item",u].filter(Boolean).join(" "),onClick:r?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":r?"true":void 0,"aria-label":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},k=i!=null,R=m==="left"?"right":"left",w=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&&k&&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&&(!k||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),x&&k&&i!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":l||void 0,children:i>99?"99+":i}),x&&l&&(!k||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),j=a?e.jsx("a",{href:r?void 0:a,...y,children:w}):e.jsx("button",{type:"button",...y,children:w});return x&&!b?e.jsx(ye,{content:s,position:R,children:j}):j}function fs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function ms({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function ps({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function hs({className:t="",...s}){return e.jsx("hr",{className:["ds-nav-rail__divider",t].filter(Boolean).join(" "),...s})}function xs({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 vs=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 bs({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})]}),N=f==="left"?"right":"left",g=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:N,children:g}):g}const We=240,Oe=6,He=8;function _s({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),N=c.useRef(null),g=c.useRef(null),[y,k]=c.useState({}),R=c.useCallback(()=>{h?a==null||a(!0):u(!0)},[h,a]),w=c.useCallback(()=>{h?a==null||a(!1):u(!1)},[h,a]),j=c.useCallback(()=>x?w():R(),[x,R,w]),A=c.useCallback(()=>{var F;const L=N.current;if(!L)return;const z=L.getBoundingClientRect(),E=window.innerHeight,P=((F=g.current)==null?void 0:F.offsetHeight)??300,W=Math.max(He,Math.min(E-P-He,z.top));k(d==="right"?{position:"fixed",top:W,right:window.innerWidth-z.left+Oe,width:We}:{position:"fixed",top:W,left:z.right+Oe,width:We})},[d]);c.useEffect(()=>{if(!x){b(!1);return}return A(),requestAnimationFrame(()=>b(!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=E=>{var P,W;!((P=g.current)!=null&&P.contains(E.target))&&!((W=N.current)!=null&&W.contains(E.target))&&w()},z=E=>{E.key==="Escape"&&w()};return document.addEventListener("mousedown",L),document.addEventListener("keydown",z),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",z)}},[x,w]);const I=x&&e.jsxs("div",{ref:g,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,m&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:y,"data-ds-portal":"",role:"dialog","aria-modal":"false",children:[s!=null&&e.jsxs("div",{className:"ds-nav-rail-flyout__header",children:[e.jsx("span",{className:"ds-nav-rail-flyout__title",children:s}),e.jsx("button",{type:"button",className:"ds-nav-rail-flyout__close",onClick:w,"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:N,onClick:j,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&ee.createPortal(I,document.body)]})}const js={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};function Ns({children:t,variant:s="info",action:n,onAction:r,onDismiss:a,role:o,dismissLabel:i,...l}){const d=q(),f=js[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(B.X,{size:V[2],strokeWidth:1.5})})]})}function ws({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,N=c.useRef(null),g=c.useRef(null),y=c.useRef(null),k=c.useRef(null),[R,w]=c.useState({}),j=c.useRef(null),A=150,I=()=>{if(m)r==null||r(!1);else{if(h)return;x(!0),j.current=setTimeout(()=>{u(!1),x(!1)},A)}},L=()=>{const _=!b;m?r==null||r(_):_?(clearTimeout(j.current),x(!1),u(!0)):I()},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=N.current)==null?void 0:X.getBoundingClientRect();if(!$)return;const U=window.innerHeight-$.bottom,H=U<_+8&&$.top>U;w(a==="right"?H?{bottom:window.innerHeight-$.top+4,top:"auto",right:window.innerWidth-$.right}:{top:$.bottom+4,bottom:"auto",right:window.innerWidth-$.right}:H?{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=y.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,H;!((U=N.current)!=null&&U.contains($.target))&&!((H=g.current)!=null&&H.contains($.target))&&I()},T=$=>{$.key==="Escape"&&(I(),E())};return document.addEventListener("mousedown",_),document.addEventListener("keydown",T),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",T)}},[b]),c.useEffect(()=>{if(!b||!k.current||!g.current)return;const _=P(),T=k.current==="last"?_[_.length-1]:_[0];T==null||T.focus(),k.current=null},[b]);const P=()=>g.current?[...g.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],W=_=>{var T,$;if(_.key==="ArrowDown")_.preventDefault(),b?(T=P()[0])==null||T.focus():(k.current="first",z());else if(_.key==="ArrowUp")if(_.preventDefault(),!b)k.current="last",z();else{const U=P();($=U[U.length-1])==null||$.focus()}},F=_=>{var U,H,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():(H=T[$-1])==null||H.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":I();break}},C=b&&e.jsx("div",{ref:g,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,h&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:R,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",H=$?{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(" "),...H,onClick:()=>{var X;(X=_.onClick)==null||X.call(_),I()},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:N,className:["ds-dropdown",o&&"ds-dropdown--full-width",i].filter(Boolean).join(" "),style:l,...d,children:[e.jsx("div",{ref:y,className:"ds-dropdown__trigger",onClick:L,onKeyDown:W,children:t}),typeof document<"u"&&ee.createPortal(C,document.body)]})}function gs({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 ys=t=>1-Math.pow(1-t,3),ks=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Qe(t,{duration:s=600}={}){const[n,r]=c.useState(t),a=c.useRef(t),o=c.useRef(null);return c.useEffect(()=>{if(ks()){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*ys(h)),h<1?o.current=requestAnimationFrame(f):a.current=t};return o.current=requestAnimationFrame(f),()=>cancelAnimationFrame(o.current)},[t,s]),n}function Es({value:t,duration:s=600,decimals:n=0,prefix:r="",suffix:a=""}){const i=Qe(t,{duration:s}).toFixed(n);return`${r}${i}${a}`}function et({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 Rs({children:t,as:s="div",once:n=!1,threshold:r=.1,rootMargin:a="0px",onEnter:o,onLeave:i,...l}){const{ref:d,inView:f}=et({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 Ue={default:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};let me=[];const Ae=new Set;function tt(){Ae.forEach(t=>t([...me]))}function Ss(t){me=[...me,t],tt()}function Ts(t){me=me.filter(s=>s.id!==t),tt()}function $s(){const t=(s,n={})=>{Ss({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 As({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=Ue[t.type]??Ue.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(B.X,{size:V[3],strokeWidth:1.5})})]})}function Bs({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(As,{data:r,onDismiss:Ts},r.id))}),document.body)}const Is={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 st({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}),Is[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 nt({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:V[1],strokeWidth:1.5}),"aria-label":r??o.copyToClipboard,onClick:d,...a})}function Ds({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:V[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ke,{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 Ls({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)),N=["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:N,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(B.Check,{size:8,strokeWidth:3}):null},h)})}),a&&e.jsxs(De,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function Ps({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 Cs({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 Ms(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 rt({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),N=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 w=()=>{const j=Date.now();if(N.current>j){b.current=setTimeout(w,N.current-j);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",b.current=setTimeout(w,a)):b.current=setTimeout(w,n+Math.random()*28)):h.current==="holding"?(h.current="erasing",b.current=setTimeout(w,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),b.current=setTimeout(w,o)):b.current=setTimeout(w,r))};return b.current=setTimeout(w,260),()=>{b.current&&clearTimeout(b.current)}},[s,t,n,r,a,o]);const g=w=>{if(t.length===0)return;const j=(w%t.length+t.length)%t.length,A=t[j];m.current=j,x.current=A.length,h.current="holding",N.current=Date.now()+i,d(j),u(A)},y=()=>g(m.current+1),k=()=>g(m.current-1),R=t[l%t.length]??"";return{displayed:f,currentPrompt:R,index:l,next:y,prev:k}}let Fs=0;function zs({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:N,acceptFile:g,maxImages:y,maxImageSize:k,leftSlot:R,rightSlot:w,className:j="",...A}){const I=q(),{t:L}=ue(),z=c.useRef(null),E=c.useRef(null),P=c.useRef(0),[W,F]=c.useState(!1),[C,_]=c.useState([]),T=l??I.promptPlaceholder,$=S=>{const M=++Fs;_(G=>[...G,{id:M,msg:S}]),setTimeout(()=>_(G=>G.filter(J=>J.id!==M)),6e3)},U=S=>_(M=>M.filter(G=>G.id!==S)),H=S=>S.type.startsWith("image/"),X=()=>!0,p=N??H,v=g??X,D=S=>{const M=[],G=[],J=[],Q=[];let te=0,le=y!=null?y-((u==null?void 0:u.length)??0):1/0;for(const se of S)p(se)?k&&se.size>k?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=S=>{const M=k?L("fileTooLargeMaxHint",{maxMb:k/1024/1024}):"";$(L("fileTooLarge",{maxHint:M,names:S.join(", ")}))},Z=S=>{const{imageFiles:M,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:te}=D(S);J.length&&O(J),Q.length&&$(L("filesSkipped",{names:Q.join(", ")})),te&&$(L("maxImages",{n:y})),x&&M.length&&x(M);const le=G.concat(x?[]:M);h&&le.length&&h(le)};c.useEffect(()=>{const S=E.current;S&&(S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,200)}px`)},[t]),c.useEffect(()=>{const S=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",S),()=>document.removeEventListener("keydown",S)},[o,i]);const re=S=>{S.preventDefault(),P.current++,S.dataTransfer.types.includes("Files")&&F(!0)},Y=S=>{S.preventDefault(),P.current--,P.current===0&&F(!1)},K=S=>S.preventDefault(),ie=S=>{S.preventDefault(),P.current=0,F(!1);const M=Array.from(S.dataTransfer.files);M.length&&Z(M)},he=S=>{const M=Array.from(S.target.files||[]);z.current&&(z.current.value=""),M.length&&Z(M)},Ee=S=>{var se;if(!x)return;const M=(se=S.clipboardData)==null?void 0:se.items;if(!M)return;const G=[];for(const lt of M){const Pe=lt.getAsFile();Pe&&G.push(Pe)}if(G.length===0)return;const{imageFiles:J,tooLarge:Q,skipped:te,limitExceeded:le}=D(G);Q.length&&O(Q),te.length&&$(L("filesSkipped",{names:te.join(", ")})),le&&$(L("maxImages",{n:y})),J.length&&(S.preventDefault(),x(J))},xe=!o&&!i&&!!(d!=null&&d.length)&&t.length===0,je=rt({prompts:d??[],enabled:xe}),ot=S=>{if(xe){if(S.key==="ArrowDown"||S.key==="ArrowRight"){S.preventDefault(),je.next();return}if(S.key==="ArrowUp"||S.key==="ArrowLeft"){S.preventDefault(),je.prev();return}if(S.key==="Tab"&&!S.shiftKey){S.preventDefault(),s==null||s(je.currentPrompt);return}}a==null||a(S)},it=(t.trim()||(u==null?void 0:u.length)>0||(f==null?void 0:f.length)>0)&&!i,Le=h||x;return e.jsxs("div",{className:["ds-prompt-input",j].filter(Boolean).join(" "),...A,children:[Le&&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",W&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:re,onDragLeave:Y,onDragOver:K,onDrop:ie,children:[W&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:I.dropFilesHere}),e.jsx("textarea",{ref:E,value:t,onChange:S=>s==null?void 0:s(S.target.value),onKeyDown:ot,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((S,M)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:S.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>b==null?void 0:b(M),"aria-label":I.removeImage,type:"button",children:e.jsx(B.X,{size:12,strokeWidth:2})})]},M))}),C.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:C.map(S=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:S.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>U(S.id),"aria-label":I.dismiss,children:e.jsx(B.X,{size:V[1],strokeWidth:1.5})})]},S.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((S,M)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[S.uploading?e.jsx(B.Loader,{size:V[1],strokeWidth:1.5,className:"spin"}):e.jsx(B.Paperclip,{size:V[1],strokeWidth:1.5}),S.filename,S.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:I.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>m==null?void 0:m(M),"aria-label":I.removeAttachment,children:e.jsx(B.X,{size:V[1],strokeWidth:1.5})})]})},M))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[Le&&e.jsx(ne,{variant:"ghost",size:"xs",icon:e.jsx(B.Paperclip,{size:V[2],strokeWidth:1.5}),"aria-label":I.attachFiles,onClick:()=>{var S;return(S=z.current)==null?void 0:S.click()}}),R,w,e.jsx("div",{className:"ds-prompt-input__spacer"}),o?e.jsx(ne,{variant:"primary",size:"xs",icon:e.jsx(B.Square,{size:V[2],strokeWidth:1.5}),onClick:r,"aria-label":I.stop}):e.jsx(ne,{variant:"primary",size:"xs",icon:e.jsx(B.ArrowUp,{size:V[2],strokeWidth:1.5}),onClick:n,disabled:!it,"aria-label":I.send})]})]})]})}const Ve={fast:0,standard:1,premium:2},Xe={fast:"data-5",standard:"data-3",premium:"data-6"};function Ws({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,N]=c.useState({}),g=t.filter(E=>!a||E.name==="auto"?!0:(Ve[E.tier]??1)>=(Ve[a]??1)),y=g.find(E=>E.name==="auto"),k=g.filter(E=>E.name!=="auto"),R=t.find(E=>E.name===s),j=new Set(k.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>_;N({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 W=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",W),document.addEventListener("keydown",F),()=>{window.removeEventListener("scroll",P,!0),window.removeEventListener("resize",P),document.removeEventListener("mousedown",W),document.removeEventListener("keydown",F)}},[f]);const A=E=>{n==null||n(E),u(!1)},I=E=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",E.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>A(E.name),children:[E.icon?e.jsx("span",{className:"ds-model-picker__item-icon",children:E.icon}):e.jsx(B.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:Xe[E.tier]||"default",children:E.tier})]},E.name),L=()=>!i||!j?k.map(I):["fast","standard","premium"].flatMap(E=>{const P=k.filter(W=>W.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(I)]:[]}),z=f&&e.jsxs("div",{ref:m,className:"ds-model-picker__menu ds-scrollable","data-ds-portal":"",style:b,children:[o&&y&&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:()=>A("auto"),children:[e.jsx(B.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)"})]}),k.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:[R!=null&&R.icon?e.jsx("span",{children:R.icon}):e.jsx(B.Cpu,{size:12,strokeWidth:1.5}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(R==null?void 0:R.displayName)||(R==null?void 0:R.name)||s}),j&&(R==null?void 0:R.tier)&&e.jsx(ce,{size:"xs",variant:Xe[R.tier]||"default",children:R.tier})]}),typeof document<"u"&&ee.createPortal(z,document.body)]})}const Os=({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 Hs(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 Us({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=Hs(t),h=u.length>r,x=d?u:u.slice(0,r),m=t.some(y=>y.snippet),b=y=>y!=null&&y.length?i("pageAbbrev",{pages:y.join(", ")}):null,N=i("moreSources",{n:u.length-r}),g=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:g,children:[x.map(y=>{const k=y.items.map(j=>j.page).filter(Boolean),R=b(k),w=!!a;return e.jsxs("div",{className:`ds-sources-panel__compact-row${w?" ds-sources-panel__compact-row--clickable":""}`,onClick:w?()=>a(y.items[0]):void 0,children:[e.jsx(B.FileText,{size:V[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),R&&e.jsx("span",{className:"ds-sources-panel__pages",children:R})]},y.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:N})]}):e.jsxs("div",{className:g,children:[l&&e.jsx("div",{className:"ds-sources-panel__title",children:l}),x.map(y=>{const k=y.items.map(j=>j.page).filter(Boolean),R=b(k),w=!!a;return m?e.jsx(ge,{title:e.jsx(Os,{filename:y.filename,pagesLabel:R}),padding:"s",children:y.items.map((j,A)=>e.jsx("div",{className:`ds-sources-panel__snippet${w?" ds-sources-panel__snippet--clickable":""}`,onClick:w?()=>a(j):void 0,children:j.snippet??i("pageAbbrev",{pages:j.page})},A))},y.filename):e.jsxs("div",{className:`ds-sources-panel__row${w?" ds-sources-panel__row--clickable":""}`,onClick:w?()=>a(y.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),R&&e.jsx("span",{className:"ds-sources-panel__pages",children:R})]},y.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:N})]})}function Ye(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function Vs({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:[Ye(t)," / ",Ye(s)]}),a&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(l*100),"%"]})]})]})}const qe=5;function Xs(t){return t<.34?"low":t<.67?"medium":"high"}function Ys({value:t=0,size:s="xs",showLabel:n="none",layout:r="inline"}){const a=Math.max(0,Math.min(1,t)),o=Math.round(a*qe),i=Xs(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:qe},(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 qs={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:qs[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function Gs({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 at({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: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(B.ThumbsDown,{size:V[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function Ks(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 Js({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?Ks(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(at,{className:"ds-message-action",value:r,onLike:a,onDislike:o}),f&&e.jsx(nt,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function Zs({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 Qs({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 en({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,tn=22,sn=14,oe=8,we=6,nn=200;function rn(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function an(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 on(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 ln({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:N}=ue(),g=d??b.next,y=f??b.back,k=u??b.skipTour,R=h??b.done,w=c.useRef(null),j=c.useRef(t),A=c.useRef(s),I=c.useRef(l);j.current=t,A.current=s,I.current=l;const[L,z]=c.useState(!1),[E,P]=c.useState({position:"fixed",visibility:"hidden",width:Se}),[W,F]=c.useState("bottom"),[C,_]=c.useState(null),T=c.useRef(!1),$=t[s],U=s===t.length-1,H=c.useCallback(()=>{const X=j.current[A.current];if(!X||!w.current)return;const p=rn(X.target);if(!p)return;const v=p.getBoundingClientRect(),O=w.current.getBoundingClientRect().height||160,Z=Se,re=I.current?tn:sn,Y=X.position||an(v,O,Z,re),{top:K,left:ie,arrowOffset:he,arrowOffsetY:Ee}=on(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",H,!0),window.addEventListener("resize",H);const X=requestAnimationFrame(()=>{H(),z(!0),T.current=!0});return()=>{cancelAnimationFrame(X),window.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}},[]),c.useEffect(()=>{if(!T.current)return;z(!1);const X=setTimeout(()=>{P(p=>({...p,visibility:"hidden"})),requestAnimationFrame(()=>{H(),z(!0)})},nn+20);return()=>clearTimeout(X)},[s]),c.useEffect(()=>{L&&w.current&&w.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"||!w.current)return;const v=Array.from(w.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!v.length)return;const D=v[0],O=v[v.length-1];p.shiftKey&&document.activeElement===D?(p.preventDefault(),O.focus()):!p.shiftKey&&document.activeElement===O&&(p.preventDefault(),D.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:w,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":$.title??N("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${W}`,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":k,children:e.jsx(B.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:y}),e.jsx(ne,{variant:"primary",size:"s",state:x,onClick:U?o:n,children:U?R:g})]})]})]})]}),document.body)}function cn(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 dn(){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=yt;exports.AnimatedNumber=Es;exports.Avatar=qt;exports.Badge=ce;exports.Banner=Ns;exports.BottomSheet=St;exports.Breadcrumb=as;exports.BrowserPane=It;exports.BrowserTabs=Dt;exports.Button=ne;exports.Card=vt;exports.ChatMessage=Cs;exports.Checkbox=Ht;exports.Coachmark=ln;exports.Code=Tt;exports.CodeAccordion=Je;exports.ConfidenceBar=Ys;exports.CopyButton=nt;exports.DiffView=Gs;exports.Dropdown=ws;exports.EmptyState=ss;exports.EngineerGrid=Qs;exports.FormField=ns;exports.H1=bt;exports.H2=_t;exports.H3=jt;exports.H4=Nt;exports.InView=Rs;exports.Input=mt;exports.Link=$t;exports.List=Lt;exports.ListRow=Pt;exports.LocaleProvider=ut;exports.Mention=Wt;exports.MessageFeedback=at;exports.MessageFooter=Js;exports.Modal=Et;exports.ModalFooter=de;exports.ModelPicker=Ws;exports.NavRail=ds;exports.NavRailAgent=bs;exports.NavRailBody=fs;exports.NavRailCustomItem=vs;exports.NavRailDivider=hs;exports.NavRailFlyout=_s;exports.NavRailFooter=ps;exports.NavRailHeader=ms;exports.NavRailItem=us;exports.NavRailRecents=xs;exports.P1=wt;exports.P2=Ke;exports.P3=De;exports.Pagination=os;exports.ProgressBar=gs;exports.PromptInput=zs;exports.Radio=Ut;exports.ReasoningBlock=Ds;exports.Scrollable=en;exports.SegmentedControl=Ct;exports.Select=ht;exports.SidePage=cs;exports.SidePageFooter=$e;exports.Skeleton=Ze;exports.SourcesPanel=Us;exports.Spinner=Ge;exports.Stat=rs;exports.StepIndicator=Ls;exports.Stepper=xt;exports.StreamingText=Ps;exports.Tab=Bt;exports.Table=Gt;exports.TableBody=Jt;exports.TableHead=Kt;exports.TableRow=Zt;exports.TableSubheaderRow=Qt;exports.Tabs=At;exports.Td=ts;exports.Textarea=pt;exports.Th=es;exports.ThinkingDot=Zs;exports.ToastContainer=Bs;exports.Toggle=Ot;exports.TokenCounter=Vs;exports.ToolCallBubble=st;exports.ToolCallCard=st;exports.Tooltip=ye;exports.defaultStrings=_e;exports.formatString=Be;exports.iconSizes=V;exports.useAnimatedNumber=Qe;exports.useAnimatedPlaceholder=rt;exports.useCoachmark=cn;exports.useInView=et;exports.useLocale=ue;exports.useShake=dn;exports.useStreamScroll=Ms;exports.useStrings=q;exports.useToast=$s;
|
package/dist/index.d.ts
CHANGED
|
@@ -93,6 +93,46 @@ export interface TabProps extends Omit<HTMLAttributes<HTMLElement>, 'onClick'> {
|
|
|
93
93
|
|
|
94
94
|
export declare function Tab(props: TabProps): JSX.Element;
|
|
95
95
|
|
|
96
|
+
// ─── Browser tabs / canvas pane ───────────────────────────────────────────
|
|
97
|
+
|
|
98
|
+
export interface BrowserTabItem {
|
|
99
|
+
id: string;
|
|
100
|
+
label: string;
|
|
101
|
+
icon?: ReactNode;
|
|
102
|
+
closable?: boolean;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface BrowserPaneProps extends HTMLAttributes<HTMLDivElement> {
|
|
106
|
+
children?: ReactNode;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare function BrowserPane(props: BrowserPaneProps): JSX.Element;
|
|
110
|
+
|
|
111
|
+
export interface BrowserTabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
112
|
+
tabs: BrowserTabItem[];
|
|
113
|
+
active: string;
|
|
114
|
+
onChange?: (id: string) => void;
|
|
115
|
+
onClose?: (id: string) => void;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export declare function BrowserTabs(props: BrowserTabsProps): JSX.Element;
|
|
119
|
+
|
|
120
|
+
export interface ListProps extends HTMLAttributes<HTMLDivElement> {
|
|
121
|
+
children?: ReactNode;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export declare function List(props: ListProps): JSX.Element;
|
|
125
|
+
|
|
126
|
+
export interface ListRowProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {
|
|
127
|
+
icon?: ReactNode;
|
|
128
|
+
title: ReactNode;
|
|
129
|
+
subtitle?: ReactNode;
|
|
130
|
+
meta?: ReactNode | ReactNode[];
|
|
131
|
+
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export declare function ListRow(props: ListRowProps): JSX.Element;
|
|
135
|
+
|
|
96
136
|
// ─── Input ────────────────────────────────────────────────────────────────
|
|
97
137
|
|
|
98
138
|
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
@@ -1134,6 +1174,7 @@ export interface DesignSystemStrings {
|
|
|
1134
1174
|
maxImages: string;
|
|
1135
1175
|
uploading: string;
|
|
1136
1176
|
removeAttachment: string;
|
|
1177
|
+
closeTab: string;
|
|
1137
1178
|
}
|
|
1138
1179
|
|
|
1139
1180
|
export declare const defaultStrings: DesignSystemStrings;
|