@cotal-ai/web 0.138.2 → 0.139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/assets/AgentPage-CpDkKMSj.js +1 -0
- package/dist/web/assets/FailedTip-DfF85PmB.js +1 -0
- package/dist/web/assets/bash-CLZ0U2zV.js +1 -0
- package/dist/web/assets/characters-BsW4RWhl.js +9 -0
- package/dist/web/assets/controller-D_lQfVDy.js +70 -0
- package/dist/web/assets/core-Bfff_dYO.js +12 -0
- package/dist/web/assets/diff-woXpYk--.js +1 -0
- package/dist/web/assets/dist-BB9Crw5c.js +1 -0
- package/dist/web/assets/dist-DktEa9vr.js +1 -0
- package/dist/web/assets/engine-javascript-C30F4iNc.js +141 -0
- package/dist/web/assets/index-DQdr6c2w.css +1 -0
- package/dist/web/assets/index-Dfeh4Ewy.js +13 -0
- package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/web/assets/javascript-BgS3c2Ky.js +1 -0
- package/dist/web/assets/json-qhed-kSA.js +1 -0
- package/dist/web/assets/markdown-BYOwaDjH.js +1 -0
- package/dist/web/assets/python-gzcpVVnB.js +1 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/typescript-bsJCZSQ-.js +1 -0
- package/dist/web/assets/yaml-rwi0_p6S.js +1 -0
- package/dist/web/bundle-licenses.json +389 -0
- package/dist/web/index.html +9 -513
- package/dist/web/theme-boot.js +8 -0
- package/dist/web.d.ts +312 -21
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +647 -121
- package/dist/web.js.map +1 -1
- package/package.json +30 -6
- package/dist/web/agui-frame.js +0 -210
- package/dist/web/app.js +0 -1428
- package/dist/web/event-order.js +0 -283
- package/dist/web/graph.html +0 -225
- package/dist/web/graph.js +0 -868
- package/dist/web/harness.js +0 -46
- package/dist/web/md.js +0 -31
- package/dist/web/parts.js +0 -114
- package/dist/web/presence-ages.js +0 -33
- package/dist/web/presence.js +0 -17
- package/dist/web/snapshot.js +0 -99
- package/dist/web/vendor/marked.umd.js +0 -79
- package/dist/web/vendor/purify.min.js +0 -3
- package/dist/web/vendor/vendor-manifest.json +0 -18
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{At as t,Dt as n,F as r,Ft as i,Gt as a,H as o,Ht as s,J as c,K as l,M as u,Nt as d,O as f,P as p,Q as m,St as h,W as g,_,a as v,at as y,b,c as x,ct as S,d as ee,et as te,f as C,ft as w,g as T,gt as E,h as D,ht as O,i as k,it as A,j,jt as M,k as N,lt as P,m as ne,nt as re,o as ie,p as F,r as ae,s as I,tt as oe,v as se,w as L,x as R,xt as ce,y as z}from"./controller-D_lQfVDy.js";import{_ as B,a as V,f as H,h as U,i as W,l as le,n as ue,o as G,p as K,r as q,s as J,t as Y,u as X}from"./dist-BB9Crw5c.js";import{t as de}from"./dist-DktEa9vr.js";var fe=[[`path`,{d:`M12 18.502V5.00195`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 13.002C18 13.002 13.5811 19.0019 12 19.002C10.4188 19.002 6 13.002 6 13.002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],pe=[[`path`,{d:`M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],me=[[`path`,{d:`M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11.5 12.5H15.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],he=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.38886 15.1629C9.89331 15.5 10.5955 15.5 12 15.5C13.4045 15.5 14.1067 15.5 14.6111 15.1629C14.8295 15.017 15.017 14.8295 15.1629 14.6111C15.5 14.1067 15.5 13.4045 15.5 12C15.5 10.5955 15.5 9.89331 15.1629 9.38886C15.017 9.17048 14.8295 8.98298 14.6111 8.83706C14.1067 8.5 13.4045 8.5 12 8.5C10.5955 8.5 9.89331 8.5 9.38886 8.83706C9.17048 8.98298 8.98298 9.17048 8.83706 9.38886C8.5 9.89331 8.5 10.5955 8.5 12C8.5 13.4045 8.5 14.1067 8.83706 14.6111C8.98298 14.8295 9.17048 15.017 9.38886 15.1629Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Z=e(B(),1),Q=U(),ge=Object.defineProperty,$=(e,t)=>ge(e,`name`,{value:t,configurable:!0});function _e(e){let t=e+`CollectionProvider`,[n,r]=G(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=$(e=>{let{scope:t,children:n}=e,r=Z.useRef(null),a=Z.useRef(new Map).current;return(0,Q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=X(s),l=Z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=H(t,i.collectionRef);return(0,Q.jsx)(c,{ref:o,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=X(u),p=Z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=Z.useRef(null),s=H(t,o),c=a(u,n);return Z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,Q.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return Z.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return $(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}$(_e,`createCollection`);var ve=new WeakMap,ye=class e extends Map{static{$(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ve.set(this,!0)}set(e,t){return ve.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=Se(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=be(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=be(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return be(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function be(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=xe(e,t);return n===-1?void 0:e[n]}$(be,`at`);function xe(e,t){let n=e.length,r=Se(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}$(xe,`toSafeIndex`);function Se(e){return e!==e||e===0?0:Math.trunc(e)}$(Se,`toSafeInteger`);function Ce(e){let t=e+`CollectionProvider`,[n,r]=G(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=$(({state:e,...t})=>e?(0,Q.jsx)(u,{...t,state:e}):(0,Q.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=$(e=>{let t=_();return(0,Q.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=$(e=>{let{scope:t,children:n,state:r}=e,a=Z.useRef(null),[s,c]=Z.useState(null),l=H(a,c),[u,d]=r,f=Z.useRef(new ye),p=Z.useCallback(()=>{let e=f.current;return Ee(e)||e.sort(De),e},[]);return Z.useEffect(()=>{if(!s)return;let e=Oe(()=>{d(e=>{let t=e.toSorted(De);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,Q.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,Q.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=X(d),p=Z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(d,n),o=H(t,i.collectionElementRef);return(0,Q.jsx)(f,{ref:o,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=X(m),g=Z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=Z.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=Z.useRef(i);we(l.current,i)||(l.current=i);let u=l.current,d=Z.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),f=H(t,d,o);V(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let p=Z.useRef(null);return Z.useEffect(()=>{let e=o.current,t=p.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(p.current=e?{element:e,itemData:u}:null,s(n=>{let r=new ye(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(De)}))}),Z.useEffect(()=>()=>{let e=p.current;p.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new ye(t);return n.delete(e.element),n})},[s]),(0,Q.jsx)(h,{"data-radix-collection-item":``,ref:f,children:r})});g.displayName=m;function _(){return Z.useState(new ye)}$(_,`useInitCollection`);function v(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}$(v,`useCollection`);function y(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return $(y,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:v,useGetCollection:y,useInitCollection:_}]}$(Ce,`createCollection`);function we(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}$(we,`shallowEqual`);function Te(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}$(Te,`isElementPreceding`);function Ee(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}$(Ee,`isInDocumentOrder`);function De(e,t){return!e[1].element||!t[1].element?0:Te(e[1].element,t[1].element)?-1:1}$(De,`sortByDocumentPosition`);function Oe(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}$(Oe,`getChildListObserver`);var ke=Object.defineProperty,Ae=(e,t)=>ke(e,`name`,{value:t,configurable:!0}),je={LTR:`ltr`,RTL:`rtl`},Me=Z.createContext(void 0);function Ne(e){let t=Z.useContext(Me);return e||t||je.LTR}Ae(Ne,`useDirection`);var Pe=Object.defineProperty,Fe=(e,t)=>Pe(e,`name`,{value:t,configurable:!0}),Ie=!1;function Le(){let[e,t]=Z.useState(Ie);return Z.useEffect(()=>{Ie||(Ie=!0,t(!0))},[]),e}Fe(Le,`useIsHydrated`);var Re=Z.useSyncExternalStore;function ze(){return()=>{}}Fe(ze,`subscribe`);function Be(){return Re(ze,()=>!0,()=>!1)}Fe(Be,`useIsHydratedModern`);var Ve=typeof Re==`function`?Be:Le,He=Object.defineProperty,Ue=(e,t)=>He(e,`name`,{value:t,configurable:!0}),We=`rovingFocusGroup.onEntryFocus`,Ge={bubbles:!1,cancelable:!0},Ke=`RovingFocusGroup`,[qe,Je,Ye]=_e(Ke),[Xe,Ze]=G(Ke,[Ye]),Qe={Vertical:`vertical`,Horizontal:`horizontal`},$e={LTR:`ltr`,RTL:`rtl`},[et,tt]=Xe(Ke),nt=Z.forwardRef(Ue(function(e,t){return(0,Q.jsx)(qe.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,Q.jsx)(qe.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,Q.jsx)(rt,{...e,ref:t})})})},`RovingFocusGroup`)),rt=Z.forwardRef(Ue(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=Z.useRef(null),p=H(t,f),m=Ne(a),[h,g]=q({prop:o,defaultProp:s??null,onChange:c,caller:Ke}),[_,v]=Z.useState(!1),y=de(l),b=Je(n),x=Z.useRef(!1),[S,ee]=Z.useState(0);return Z.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(We,y),()=>e.removeEventListener(We,y)},[y]),(0,Q.jsx)(et,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:Z.useCallback(e=>g(e),[g]),onItemShiftTab:Z.useCallback(()=>v(!0),[]),onFocusableItemAdd:Z.useCallback(()=>ee(e=>e+1),[]),onFocusableItemRemove:Z.useCallback(()=>ee(e=>e-1),[]),children:(0,Q.jsx)(J.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:W(e.onMouseDown,()=>{x.current=!0}),onFocus:W(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(We,Ge);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);lt([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:W(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),it=`RovingFocusGroupItem`,at=Z.forwardRef(Ue(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Y(),l=a||c,u=tt(it,n),d=u.currentTabStopId===l,f=Je(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Ve();return V(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),Z.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,Q.jsx)(qe.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,Q.jsx)(J.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:W(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:W(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:W(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ct(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?ut(n,r+1):n.slice(r+1)}setTimeout(()=>lt(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),ot={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function st(e,t){return t===$e.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Ue(st,`getDirectionAwareKey`);function ct(e,t,n){let r=st(e.key,n);if(!(t===Qe.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Qe.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return ot[r]}Ue(ct,`getFocusIntent`);function lt(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Ue(lt,`focusFirst`);function ut(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ue(ut,`wrapArray`);var dt=Object.defineProperty,ft=(e,t)=>dt(e,`name`,{value:t,configurable:!0}),pt={Automatic:`automatic`,Manual:`manual`},mt=`Tabs`,[ht,gt]=G(mt,[Ze]),_t=Ze(),[vt,yt]=ht(mt),bt=Z.forwardRef(ft(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=pt.Automatic,...l}=e,u=Ne(s),[d,f]=q({prop:r,onChange:i,defaultProp:a??``,caller:mt});return(0,Q.jsx)(vt,{scope:n,baseId:Y(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,Q.jsx)(J.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),xt=`TabsList`,St=Z.forwardRef(ft(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=yt(xt,n),o=_t(n);return(0,Q.jsx)(nt,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,Q.jsx)(J.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Ct=`TabsTrigger`,wt=Z.forwardRef(ft(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=yt(Ct,n),s=_t(n),c=Dt(o.baseId,r),l=Ot(o.baseId,r),u=r===o.value;return(0,Q.jsx)(at,{asChild:!0,...s,focusable:!i,active:u,children:(0,Q.jsx)(J.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:W(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:W(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:W(e.onFocus,()=>{let e=o.activationMode!==pt.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Tt=`TabsContent`,Et=Z.forwardRef(ft(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=yt(Tt,n),c=Dt(s.baseId,r),l=Ot(s.baseId,r),u=r===s.value,d=Z.useRef(u);return Z.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,Q.jsx)(ue,{present:i||u,children:({present:n})=>(0,Q.jsx)(J.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Dt(e,t){return`${e}-trigger-${t}`}ft(Dt,`makeTriggerId`);function Ot(e,t){return`${e}-content-${t}`}ft(Ot,`makeContentId`);function kt({icon:e,title:t,children:n}){return(0,Q.jsxs)(`div`,{className:`ui-sess-empty`,children:[(0,Q.jsx)(c,{icon:e,size:22,className:`ui-ic`}),(0,Q.jsx)(`b`,{children:t}),n]})}var At=e=>Number.isFinite(e.ts)?e.ts:-1/0;function jt(e){let t=new Map;for(let{msg:n}of e){let e=typeof n.channel==`string`?n.channel:void 0,r=e===void 0&&typeof n.to==`string`?n.to:void 0;if(e===void 0&&r===void 0)continue;let i=e===void 0?`dm:${r}`:`channel:${e}`,a=t.get(i);a||t.set(i,a={key:i,...e===void 0?{to:r}:{channel:e},rows:[]}),a.rows.push(n)}let n=[...t.values()];for(let e of n)e.rows.sort((e,t)=>At(t)-At(e));return n.sort((e,t)=>At(t.rows[0])-At(e.rows[0]))}function Mt({msg:e,row:t,place:n,href:r,label:a}){let o=f();return(0,Q.jsxs)(`div`,{className:`ui-msg ox-msg`,"data-post":e.id,children:[(0,Q.jsx)(`div`,{className:`ui-gut`,children:(0,Q.jsx)(N,{vendor:t.harness,status:t.status,size:34,dot:!1,badge:o(t.id)})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`ui-mh`,children:[(0,Q.jsx)(`b`,{children:t.name}),(0,Q.jsx)(`span`,{className:`ui-role`,children:n}),(0,Q.jsx)(v,{ts:e.ts}),(0,Q.jsx)(`span`,{className:`ui-sp`}),(0,Q.jsxs)(`a`,{className:`ox-act`,href:r,children:[a,(0,Q.jsx)(c,{icon:P,size:16})]})]}),(0,Q.jsx)(ie,{className:`ui-tx`,src:i(e.parts)})]})]})}function Nt({groups:e,row:t,nameOf:r}){return(0,Q.jsxs)(`div`,{className:`ox-msgs`,children:[e.length===0&&(0,Q.jsx)(kt,{icon:S,title:`No messages from ${t.name} on this page yet`}),e.map(e=>{let i=e.rows.length;if(e.channel!==void 0){let r=e.channel,a=n({view:`channel`,channel:r});return(0,Q.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,Q.jsxs)(T,{className:`ox-marker`,children:[(0,Q.jsx)(se,{children:(0,Q.jsx)(c,{icon:y,size:16})}),(0,Q.jsxs)(_,{children:[(0,Q.jsx)(`b`,{children:`#${r}`}),` · ${i===1?`1 post`:`${i} posts`}`]})]}),e.rows.map(e=>(0,Q.jsx)(Mt,{msg:e,row:t,place:`in #${r}`,href:a,label:`Open in #${r}`},e.id))]},e.key)}let a=e.to??``,o=r(a),s=n({view:`dm`,peer:t.id,with:a});return(0,Q.jsxs)(`section`,{className:`ox-msg-group`,children:[(0,Q.jsxs)(T,{className:`ox-marker`,children:[(0,Q.jsx)(se,{children:(0,Q.jsx)(c,{icon:S,size:16})}),(0,Q.jsxs)(_,{children:[(0,Q.jsx)(`b`,{children:`Direct messages`}),` · ${i} with ${o}`]})]}),e.rows.map(e=>(0,Q.jsx)(Mt,{msg:e,row:t,place:`to ${o}`,href:s,label:`Open conversation`},e.id))]},e.key)}),(0,Q.jsx)(`p`,{className:`ox-msgs-more`,children:`Older messages are in each channel's history.`})]})}var Pt=1e3,Ft={on:`Published. Tool names, status and times only.`,off:`Not published`};function It({store:e,id:t,clock:n=Date.now}){let i=w(e,e=>e.roster),o=w(e,e=>e.channels),s=w(e,e=>e.membership),c=w(e,e=>e.activity),[,p]=(0,Z.useReducer)(e=>e+1,0);(0,Z.useEffect)(()=>{let e=setInterval(p,Pt);return()=>clearInterval(e)},[]);let m=f(),h=i.find(e=>e.card.id===t),g=(0,Z.useMemo)(()=>h?r(t,s,o.map(e=>e.channel),c,h.channelModes):{channels:[],wide:!1},[h,t,s,o,c]);if(!h)return(0,Q.jsx)(`p`,{className:`ui-nr`,children:`Not on the roster`});let _=O([h],{includeOffline:!0})[0],v=typeof _.statusSince==`number`&&Number.isFinite(_.statusSince)?`Reported ${d(new Date(_.statusSince))}`:void 0,y=(h.card.skills??[]).map(e=>e.name).filter(e=>typeof e==`string`&&e!==``);return(0,Q.jsxs)(`div`,{className:`ox-profile`,children:[(0,Q.jsx)(`div`,{className:`ui-big`,children:(0,Q.jsx)(N,{vendor:_.harness,status:_.status,size:88,dot:!1,badge:m(_.id)})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`ui-sline`,children:[(0,Q.jsx)(u,{row:_}),(0,Q.jsx)(`span`,{style:{color:`var(--ink)`},children:_.activity||`No current activity`}),v&&(0,Q.jsx)(`small`,{children:v}),b(_,n())&&(0,Q.jsx)(`small`,{className:`ui-facts`,children:b(_,n())})]}),(0,Q.jsxs)(`div`,{className:`ui-actions`,children:[(0,Q.jsx)(l,{icon:me,command:`cotal attach --name ${a(_.name)}`}),(0,Q.jsx)(l,{icon:he,command:`cotal stop --name ${a(_.name)}`})]}),(0,Q.jsxs)(`dl`,{className:`ui-kv`,children:[_.harness&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`dt`,{children:`Harness`}),(0,Q.jsx)(`dd`,{children:L(_.harness)})]}),(0,Q.jsx)(`dt`,{children:`Model`}),_.model?(0,Q.jsx)(`dd`,{className:`ui-mono`,style:{fontSize:12.5},children:_.model}):(0,Q.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),_.host&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`dt`,{children:`Host`}),(0,Q.jsx)(`dd`,{children:_.host})]}),(_.attention===`dnd`||_.attention===`focus`)&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`dt`,{children:`Attention`}),(0,Q.jsx)(`dd`,{children:(0,Q.jsx)(D,{attention:_.attention})})]}),(0,Q.jsx)(`dt`,{children:`Heartbeat`}),Number.isFinite(_.ts)?(0,Q.jsxs)(`dd`,{className:`ui-num`,children:[R(n()-_.ts),` ago`]}):(0,Q.jsx)(`dd`,{className:`ui-nr`,children:`not reported`}),(0,Q.jsx)(`dt`,{children:`Work events`}),_.events?(0,Q.jsx)(`dd`,{children:Ft[_.events]}):(0,Q.jsx)(`dd`,{className:`ui-nr`,children:`not reported`})]}),(g.wide||g.channels.length>0)&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`h5`,{children:`Channels`}),g.wide&&(0,Q.jsxs)(`div`,{className:`ui-chrow`,children:[(0,Q.jsx)(`span`,{children:`Reads every channel`}),(0,Q.jsx)(`span`,{})]}),g.channels.map(e=>(0,Q.jsxs)(`div`,{className:`ui-chrow`,children:[(0,Q.jsx)(`span`,{children:`#${e.channel}`}),(0,Q.jsx)(`span`,{children:e.mode??``})]},e.channel))]}),y.length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`h5`,{style:{marginTop:10},children:`Skills`}),(0,Q.jsx)(`div`,{className:`ui-tags`,children:y.map(e=>(0,Q.jsx)(`span`,{className:`ui-chip`,children:e},e))})]})]})]})}var Lt=z(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-2xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Rt({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?le:`span`;return(0,Q.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:K(Lt({variant:t}),e),...r})}function zt({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=Bt(Vt(r,i),t);if(!n)return Z.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!Z.isValidElement(n))return null;let o=n.props,s={...Bt(a,o),ref:Wt(a.ref,o.ref)};return Z.cloneElement(n,s)}function Bt(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];t[n]=n===`className`?[i,r].filter(Boolean).join(` `):n===`style`?{...i,...r}:n===`ref`?Wt(i,r):Ut(n)&&typeof i==`function`&&typeof r==`function`?Ht(r,i):r}}return t}function Vt(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function Ht(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function Ut(e){return/^on[A-Z]/.test(e)}function Wt(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var Gt=8,Kt=64,qt=0,Jt=.5,Yt=180,Xt=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),Zt={start:!1,end:!1},Qt={currentAnchorId:null,visibleMessageIds:[]};function $t({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return Zt;let i=fn({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function en({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Qt;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of tn(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+Jt&&(u=e)}return l.length===0&&u===null?Qt:{currentAnchorId:u,visibleMessageIds:l}}function tn(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function nn(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function rn(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function an(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function on(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function sn({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of tn(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function cn({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=ln(t,i),o=t.getBoundingClientRect().height,s=hn(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function ln(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function un(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function dn({content:e,scrollTop:t,spacer:n,viewport:r}){let i=fn({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function fn({content:e,spacer:t,viewport:n}){let r=tn(e,t),i=mn(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function pn(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function mn(e){let t=window.getComputedStyle(e);return{end:_n(t.paddingBlockEnd||t.paddingBottom),start:_n(t.paddingBlockStart||t.paddingTop)}}function hn(e){let t=e?.parentElement;return t?mn(t):{end:0,start:0}}function gn(e){if(!e)return 0;let t=window.getComputedStyle(e);return _n(t.rowGap===`normal`?t.gap:t.rowGap)}function _n(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function vn(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function yn(e,t){return vn(e,t)}function bn(){return vn(Qt,Sn)}function xn(e,t){return e.start===t.start&&e.end===t.end}function Sn(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function Cn({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:r,scrollPreviousItemPeek:i}){let a=Z.useRef(e),o=Z.useRef(!1),s=Z.useRef(null),c=Z.useRef(!1),l=Z.useRef(n),u=Z.useRef(0),d=Z.useRef(null),f=Z.useRef(0),p=Z.useRef(e?`following-bottom`:`free-scrolling`),m=Z.useRef(new Map),h=Z.useRef(null),g=Z.useRef(null),_=Z.useRef(null),v=Z.useRef(i),y=Z.useRef(!0),b=Z.useRef(null),x=Z.useRef(r),S=Z.useRef(null),ee=Z.useRef(0),te=Z.useRef(0),C=Z.useRef(null),w=Z.useRef(null),T=Z.useRef(null),E=Z.useRef(null),D=Z.useRef(null),O=Z.useRef(null),k=Z.useRef(null),A=Z.useRef(null),j=Z.useRef(null),M=Z.useRef(new Set),N=Z.useRef(new WeakSet);return T.current===null&&(T.current=yn(t===`end`||t===`last-anchor`,(e,t)=>e===t)),E.current===null&&(E.current=yn(Zt,xn)),j.current===null&&(j.current=bn()),a.current=e,l.current=n,x.current=r,v.current=i,{autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:D,streamingTurnRef:_,contentRef:s,defaultScrollPositionAppliedRef:c,firstItemRef:d,itemCountRef:u,lastScrollTopRef:f,messageElementsRef:m,modeRef:p,pendingScrollFrameRef:S,pendingScrollToMessageRef:h,prependRestoreRef:g,preserveScrollOnPrependRef:y,pendingDefaultScrollStore:T.current,rootRef:b,scrollEdgeThresholdRef:l,scrollMarginRef:x,scrollPreviousItemPeekRef:v,spacerGapRef:ee,spacerHeightRef:te,spacerRef:C,stateFrameRef:w,stateStore:E.current,viewportRef:O,visibilityFrameRef:k,visibilityObserverRef:A,visibilityStore:j.current,visibleMessageIdsRef:M,handledScrollAnchorsRef:N}}function wn(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function Tn(e){e.defaultScrollPositionAppliedRef.current=!0,wn(e)}function En({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,itemCountRef:l,messageElementsRef:u,modeRef:d,pendingScrollToMessageRef:f,prependRestoreRef:p,scrollMarginRef:m,scrollPreviousItemPeekRef:h,spacerGapRef:g,spacerHeightRef:_,spacerRef:v,viewportRef:y}=e,b=Z.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},Yt))},[t]),x=Z.useCallback(e=>{let t=v.current;if(!t)return;let n=Math.max(0,Math.ceil(e));_.current!==n&&(_.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-g.current}px`:``)},[]),S=Z.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=y.current;if(!a)return;let o=Math.max(0,e);Math.abs(a.scrollTop-o)<=Jt?(a.scrollTop=o,t()):(i&&b(!0),a.scrollTo({top:o,behavior:r}),n())},[t,n,b]),ee=Z.useCallback(({behavior:e=`auto`}={})=>y.current?(x(0),i.current=null,d.current=`free-scrolling`,S(0,{behavior:e}),r(),!0):!1,[r,S,x]),te=Z.useCallback(({behavior:e=`auto`}={})=>{let t=y.current;return t?(x(0),i.current=null,d.current=a.current?`following-bottom`:`free-scrolling`,S(pn(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,S,x]),C=Z.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=m.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=y.current;if(!s||!l||!s.contains(e))return!1;let u=cn({align:t,element:e,scrollMargin:o?a+h.current:a,spacer:v.current,viewport:l}),f=dn({content:s,scrollTop:u,spacer:v.current,viewport:l});return x(f),p.current={element:e,viewportTop:un(e,l)},d.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,S(u,{behavior:n}),r(),!0},[r,S,x]),w=Z.useCallback(()=>{let e=i.current;return!e||!e.isConnected||d.current!==`anchored-to-message`?!1:C(e,{align:`start`},{keepPreviousPeek:!0})},[C]),T=Z.useCallback((t,n)=>{let r=u.current.get(t);return r?(Tn(e),C(r,n)?(f.current=null,!0):(f.current={messageId:t,options:n},!0)):l.current===0&&(f.current={messageId:t,options:n},Tn(e),!0)},[C]);return{flushPendingScrollToMessage:Z.useCallback(()=>{let t=f.current;if(!t)return!1;let n=u.current.get(t.messageId);return!n||!C(n,t.options)?!1:(f.current=null,Tn(e),!0)},[C]),reanchorToAnchoredMessage:w,scrollToElement:C,scrollToEnd:te,scrollToMessage:T,scrollToStart:ee}}function Dn(e,t){return Z.useCallback(n=>{e.current=n,n&&t()},[e,t])}function On({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=Gt,scrollPreviousItemPeek:r=Kt,scrollMargin:i=qt}){let a=Cn({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:v,prependRestoreRef:y,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:x,rootRef:S,scrollEdgeThresholdRef:ee,scrollMarginRef:te,scrollPreviousItemPeekRef:C,spacerGapRef:w,spacerHeightRef:T,spacerRef:E,stateFrameRef:D,stateStore:O,viewportRef:k,visibilityFrameRef:A,visibilityObserverRef:j,visibilityStore:M,visibleMessageIdsRef:N,handledScrollAnchorsRef:P}=a,ne=Z.useRef(t);ne.current!==t&&(ne.current=t,d.current=!1);let re=Z.useCallback(e=>{let t=S.current,n=k.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),ie=Z.useCallback(e=>{let t=k.current?.scrollTop??0,n=t<m.current-Jt;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),F=Z.useCallback(()=>{let e=$t({content:u.current,scrollEdgeThreshold:ee.current,spacer:E.current,viewport:k.current});ie(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;re(t),O.setSnapshot(t)},[ie,O,re]),ae=Z.useCallback(()=>{D.current===null&&(D.current=window.requestAnimationFrame(()=>{D.current=null,F()}))},[F]),I=Z.useCallback(()=>{M.hasListeners()&&A.current===null&&(A.current=window.requestAnimationFrame(()=>{A.current=null,M.hasListeners()&&M.setSnapshot(en({content:u.current,scrollMargin:te.current,scrollPreviousItemPeek:C.current,spacer:E.current,viewport:k.current,visibleMessageIds:N.current}))}))},[M]),{flushPendingScrollToMessage:oe,reanchorToAnchoredMessage:se,scrollToElement:L,scrollToEnd:R,scrollToMessage:ce,scrollToStart:z}=En({refs:a,commitScrollState:F,scheduleStateCommit:ae,scheduleVisibilitySync:I}),B=Z.useCallback(()=>{let e=y.current,t=k.current;if(!e||!t||!e.element.isConnected)return!1;let n=un(e.element,t)-e.viewportTop;return Math.abs(n)<=Jt?!1:(t.scrollTop+=n,e.viewportTop=un(e.element,t),ae(),I(),!0)},[ae,I]),V=Z.useCallback(()=>{let e=u.current,t=k.current;if(!e||!t){y.current=null;return}let n=sn({content:e,spacer:E.current,viewport:t});y.current=n?{element:n,viewportTop:un(n,t)}:null},[]),H=Z.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,oe()&&V()}))},[V,oe]),U=Z.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=k.current,r=t&&n?on(tn(t,E.current)):null;if(!t||!n||!r)e=R({behavior:`auto`});else{let i=ln(r,n);e=fn({content:t,spacer:E.current,viewport:n})-i<=n.clientHeight?R({behavior:`auto`}):L(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?R({behavior:`auto`}):z({behavior:`auto`});return e?(Tn(a),!0):!1},[t,L,R,z]),W=Z.useCallback(()=>{let e=u.current;if(!e)return;let t=tn(e,E.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(oe())return;if(n===0){if(U()||t.length>0&&s.current&&R({behavior:`auto`}))return;F(),I();return}let e=r?t.indexOf(r):-1;if(b.current&&e>0)B();else{if(t.length>n){let e=nn(t,n);if(e){if(s.current&&g.current===`following-bottom`&&an(t,n)){R({behavior:`auto`});return}L(e,{align:`start`},{keepPreviousPeek:!0}),P.current.add(e);return}}if(t.length===n){let e=rn(t,P.current);if(e){L(e,{align:`start`},{keepPreviousPeek:!0}),P.current.add(e);return}}g.current===`following-bottom`&&s.current?R({behavior:`auto`}):(F(),I())}})(),V()},[U,V,F,oe,B,I,L,R]),le=Z.useCallback(()=>{if(g.current===`following-bottom`&&s.current){R({behavior:`auto`});return}let e=T.current;se()?s.current&&e>0&&T.current===0&&R({behavior:`auto`}):(ae(),I())},[se,ae,I,R]),ue=Z.useCallback(()=>{let e=k.current;if(e&&M.hasListeners()){if(typeof IntersectionObserver>`u`){I();return}j.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?N.current.add(e):N.current.delete(e))}I()},{root:e,rootMargin:`${-(te.current+C.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{j.current?.observe(e)}),I()}},[I,M]),G=Z.useCallback(()=>{A.current!==null&&(window.cancelAnimationFrame(A.current),A.current=null),j.current?.disconnect(),j.current=null,N.current.clear(),M.setSnapshot(Qt)},[M]),K=Z.useCallback((e,t,n)=>{t?(h.current.set(e,t),j.current?.observe(t),I(),v.current?.messageId===e&&H()):n&&h.current.get(e)===n&&(h.current.delete(e),N.current.delete(e),j.current?.unobserve(n),I())},[H,I]),q=Z.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),J=Z.useCallback(()=>re(O.getSnapshot()),[O,re]),Y=Dn(S,J),X=Dn(k,J),de=Z.useCallback(e=>{u.current=e},[]),fe=Z.useCallback(e=>{E.current=e,w.current=gn(e?.parentElement??null)},[]),pe=Z.useCallback(()=>{F(),I(),V()},[V,F,I]),me=Z.useMemo(()=>({handleContentChange:W,handleResize:le,observeVisibility:ue,pendingDefaultScrollStore:x,preserveScrollOnPrependRef:b,scrollToEnd:R,scrollToMessage:ce,scrollToStart:z,setContentElement:de,setRootElement:Y,setSpacerElement:fe,setViewportElement:X,stateStore:O,syncAfterScroll:pe,unobserveVisibility:G,userScrollIntent:q,viewportRef:k,visibilityStore:M}),[W,le,ue,x,R,ce,z,de,Y,fe,X,O,pe,G,q,M]);return Z.useLayoutEffect(()=>{U()||p.current===0&&wn(a)},[U]),Z.useEffect(()=>()=>{D.current!==null&&(window.cancelAnimationFrame(D.current),D.current=null),A.current!==null&&(window.cancelAnimationFrame(A.current),A.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),j.current?.disconnect(),j.current=null},[]),Z.useLayoutEffect(()=>{e&&g.current===`following-bottom`&&p.current>0?R({behavior:`auto`}):F()},[e,F,R]),{context:me,registerMessage:K}}function kn(e){let t=Z.useRef(e);return t.current=e,t}var An=Z.createContext(null),jn=Z.createContext(null);function Mn(){let e=Z.useContext(An);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function Nn(){let e=Z.useContext(jn);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function Pn(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=Mn();return Z.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function Fn(){let{stateStore:e}=Mn();return Z.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function In({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=On({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,Q.jsx)(An.Provider,{value:o,children:(0,Q.jsx)(jn.Provider,{value:s,children:t})})}function Ln(){let{pendingDefaultScrollStore:e}=Mn();return Z.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Rn({children:e,...t}){let{setRootElement:n}=Mn(),r=Ln();return(0,Q.jsx)(`div`,{ref:n,...t,...r?{"data-pending-scroll":``}:null,children:e})}function zn({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=Mn(),_=Ln();f.current=o;let v=Z.useCallback(e=>{p(e),Wt(s)?.(e)},[s,p]);function y(e){m(),r?.(e)}function b(e){h(),a?.(e)}function x(e){h(),i?.(e)}function S(e){Xt.has(e.key)&&h(),n?.(e)}return Z.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,Q.jsx)(`div`,{ref:v,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:S,onScroll:y,onTouchMove:x,onWheel:b,...u,..._?{"data-pending-scroll":``}:null,children:t})}function Bn({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=Mn(),u=Z.useRef(null),d=Z.useCallback(e=>{u.current=e,c(e),Wt(n)?.(e)},[n,c]);return Z.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),Z.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,Q.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,Q.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function Vn({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=Nn(),a=Z.useRef(null),o=Z.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),Wt(t)?.(n)},[e,t,i]);return(0,Q.jsx)(`div`,{ref:o,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function Hn({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=Mn(),d=kn(r),f=Z.useCallback(e=>u.subscribe(e),[u]),p=Z.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=Z.useSyncExternalStore(f,p,p),h=Z.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return zt({defaultTagName:`button`,props:Bt({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,Q.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var Un={Provider:In,Root:Rn,Viewport:zn,Content:Bn,Item:Vn,Button:Hn};function Wn(e){return(0,Q.jsx)(Un.Provider,{...e})}function Gn({className:e,...t}){return(0,Q.jsx)(Un.Root,{"data-slot":`message-scroller`,className:K(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function Kn({className:e,...t}){return(0,Q.jsx)(Un.Viewport,{"data-slot":`message-scroller-viewport`,className:K(`size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible`,e),...t})}function qn({className:e,...t}){return(0,Q.jsx)(Un.Content,{"data-slot":`message-scroller-content`,className:K(`flex h-max min-h-full flex-col gap-8`,e),...t})}function Jn({className:e,orientation:t=`horizontal`,...n}){return(0,Q.jsx)(bt,{"data-slot":`tabs`,"data-orientation":t,className:K(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Yn=z(`group/tabs-list inline-flex w-fit items-center justify-center rounded-2xl p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col group-data-vertical/tabs:p-1 data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Xn({className:e,variant:t=`default`,...n}){return(0,Q.jsx)(St,{"data-slot":`tabs-list`,"data-variant":t,className:K(Yn({variant:t}),e),...n})}function Zn({className:e,...t}){return(0,Q.jsx)(wt,{"data-slot":`tabs-trigger`,className:K(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-2xl border border-transparent! px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:px-3 group-data-vertical/tabs:py-0.5 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function Qn({className:e,...t}){return(0,Q.jsx)(Et,{"data-slot":`tabs-content`,className:K(`flex-1 text-sm outline-none`,e),...t})}var $n=24,er=[];function tr(e){return e.items.flatMap(e=>e.kind===`turn`?[e,...e.steps]:[e]).flatMap(e=>[{key:e.key,live:e.live,...e.kind===`post`?{post:e.msg.id}:{}},...e.kind===`tools`?e.calls.slice(1).map(e=>({key:e.key,live:e.live})):[]])}function nr({row:e}){let t=Object.hasOwn(j,e.status)?j[e.status]:void 0;return(0,Q.jsxs)(Rt,{variant:`secondary`,className:`ox-badge ox-badge-${e.status}`,children:[(0,Q.jsx)(`span`,{className:`ox-badge-i`,children:e.status===`working`?(0,Q.jsx)(ee,{}):t&&(0,Q.jsx)(c,{icon:t,size:16})}),p(E(e))]})}function rr(){let e=e=>(0,Q.jsx)(`span`,{className:`ui-skel`,style:{width:e}});return(0,Q.jsx)(`div`,{className:`ox-col ox-skel`,"aria-busy":`true`,children:(0,Q.jsxs)(`div`,{"aria-hidden":`true`,children:[e(`36%`),e(`88%`),e(`64%`),e(`42%`),e(`30%`),e(`76%`)]})})}function ir({steps:e,away:t}){let{end:n}=Fn(),{scrollToEnd:r}=Pn(),[i,a]=(0,Z.useState)(null),o=n||t;o&&i===null&&a(new Set(e.map(e=>e.key))),!o&&i!==null&&a(null);let s=i?e.filter(e=>e.live&&!i.has(e.key)).length:0;return s===0?null:(0,Q.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,className:`ox-newsteps`,"data-active":`true`,onClick:()=>r({behavior:ar()?`auto`:`smooth`}),children:[(0,Q.jsx)(c,{icon:fe,size:16}),s===1?`1 new step`:`${s} new steps`]})}var ar=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0;function or({store:e,controller:r,id:i,tab:a,at:u,back:d,phone:p=!1,panelOpen:_=!1,onTogglePanel:v}){ne(r,i);let y=(0,Z.useContext)(ae),b=w(e,e=>e.roster),S=w(e,e=>e.operatorId),ee=w(e,e=>e.post),T=w(e,e=>e.sessions[i]),E=(0,Z.useMemo)(()=>h(b),[b]),D=b.find(e=>e.card.id===i),j=(0,Z.useMemo)(()=>D?O([D],{includeOffline:!0})[0]:void 0,[D]),P=j?.name??ce(i,E,S),ie=j??{id:i,name:P,status:`offline`,ts:NaN},se=(0,Z.useMemo)(()=>C(D),[D]),R=f(),z=T?.frames??er,B=F(e,i),V=(0,Z.useMemo)(()=>M(z,B),[z,B]),H=(0,Z.useMemo)(()=>tr(V),[V]),U=(0,Z.useMemo)(()=>jt(B),[B]),W=U.reduce((e,t)=>e+t.rows.length,0),le=(0,Z.useMemo)(()=>e=>ce(e,E,S),[E,S]),ue=(0,Z.useMemo)(()=>({kind:`dm`,to:i}),[i]),G=[j?.role,j?.harness&&L(j.harness)].filter(Boolean).join(` · `),K=j?.events,q=T?.load??`loading`,[J,Y]=(0,Z.useState)(!0);a!==`work`&&!J&&Y(!0);let X=(0,Z.useRef)(null),de=()=>X.current,fe=()=>{let e=de();!J&&e&&e.scrollHeight-e.scrollTop-e.clientHeight<=$n&&Y(!0)},me=(0,Z.useRef)(void 0),he=u!==void 0&&H.some(e=>e.post===u);(0,Z.useLayoutEffect)(()=>{if(!he||u===void 0||me.current===u||q===`loading`)return;let e=de();if(!e)return;let t=Array.from(e.querySelectorAll(`[data-post]`)).find(e=>e.getAttribute(`data-post`)===u);t&&(me.current=u,Y(!1),t.scrollIntoView?.({block:`center`}))});let ge=t(z)>=2e3||(T?.limit??0)>=2e3,$=T?.more===!0&&K!==`off`,_e=_?`Close panel`:`Open panel`,ve=`Back to ${d.label}`,ye=n(s(i,S)),be=()=>g(ue),xe=(0,Q.jsx)(k,{work:V,row:ie,condition:se,highlight:u,nameOf:le}),Se;return Se=q===`loading`&&H.length===0?(0,Q.jsx)(rr,{}):q===`refused`?(0,Q.jsxs)(`div`,{className:`ox-col`,children:[(0,Q.jsxs)(kt,{icon:te,title:`This dashboard can't read ${P}'s work`,children:[(0,Q.jsx)(`p`,{children:`The broker refused it: ${T?.reason??``}.`}),T?.grant&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{children:`The mesh owner can grant a read on that channel:`}),(0,Q.jsx)(l,{command:T.grant})]})]}),H.length>0&&xe]}):q===`failed`&&H.length===0?(0,Q.jsx)(`div`,{className:`ox-col`,children:(0,Q.jsxs)(kt,{icon:A,title:`${P}'s work didn't load`,children:[(0,Q.jsx)(`p`,{children:T?.reason??``}),(0,Q.jsx)(`button`,{type:`button`,className:`ui-btn ui-btn-sm`,onClick:()=>void r?.reloadSession(i),children:`Try again`})]})}):K===`off`&&q!==`failed`?(0,Q.jsxs)(`div`,{className:`ox-col`,children:[(0,Q.jsxs)(I,{children:[`${P} publishes no work events, so Work shows only what ${P} posted. Agents started with `,(0,Q.jsx)(`code`,{children:`cotal spawn`}),` publish them unless started with `,(0,Q.jsx)(`code`,{children:`--no-events`}),`.`]}),xe]}):H.length===0&&K===`on`?(0,Q.jsx)(`div`,{className:`ox-col`,children:(0,Q.jsx)(kt,{icon:m,title:`${P} hasn't started a turn yet`,children:(0,Q.jsx)(`p`,{children:`Its first turn shows here as soon as it starts.`})})}):H.length===0?(0,Q.jsx)(`div`,{className:`ox-col`,children:(0,Q.jsx)(kt,{icon:A,title:`Nothing has arrived from ${P} yet`,children:(0,Q.jsxs)(`p`,{children:[`Agents started with `,(0,Q.jsx)(`code`,{children:`cotal spawn`}),` publish one unless started with `,(0,Q.jsx)(`code`,{children:`--no-events`}),`. An agent you started yourself may not publish one at all.`]})})}):(0,Q.jsxs)(`div`,{className:`ox-col`,children:[q===`failed`&&(0,Q.jsxs)(I,{children:[`${P}'s work didn't load. ${T?.reason??``} `,(0,Q.jsx)(`button`,{type:`button`,className:`ui-btn ui-btn-sm`,onClick:()=>void r?.reloadSession(i),children:`Try again`})]}),$&&!ge&&(0,Q.jsx)(`div`,{className:`ui-cutoff`,children:(0,Q.jsx)(`button`,{type:`button`,className:`ui-btn ui-btn-sm`,disabled:q===`loading`,onClick:()=>void r?.loadEarlier(i),children:`Load earlier`})}),$&&ge&&(0,Q.jsx)(`div`,{className:`ui-cutoff`,children:`Showing the newest 2,000 events`}),q===`loading`&&(0,Q.jsx)(`div`,{className:`ui-cutoff`,role:`status`,children:`Loading`}),xe]}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`header`,{className:`ox-head`,children:[p?(0,Q.jsx)(`a`,{className:`ui-tool`,href:n(d.route),title:ve,"aria-label":ve,children:(0,Q.jsx)(c,{icon:pe,className:`ui-ic`})}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`a`,{className:`ui-crumb`,href:n(d.route),title:ve,children:[(0,Q.jsx)(c,{icon:pe,size:16,className:`ui-ic`}),d.label]}),(0,Q.jsx)(`span`,{className:`ox-sep`})]}),(0,Q.jsx)(N,{vendor:j?.harness,status:ie.status,size:30,badge:j?R(i):void 0}),(0,Q.jsx)(`h1`,{children:P}),!p&&G&&(0,Q.jsx)(`span`,{className:`ui-topic`,children:G}),j&&(0,Q.jsx)(nr,{row:j}),(0,Q.jsx)(`span`,{className:`ui-sp`}),p?(0,Q.jsx)(`a`,{className:`ui-tool`,href:ye,title:`Message ${P}`,"aria-label":`Message ${P}`,onClick:be,children:(0,Q.jsx)(c,{icon:re,className:`ui-ic`})}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(x,{asChild:!0,variant:`outline`,size:`sm`,className:`ox-btn`,children:(0,Q.jsxs)(`a`,{href:ye,onClick:be,children:[(0,Q.jsx)(c,{icon:re,size:16}),`Message`]})}),v&&(0,Q.jsx)(`button`,{type:`button`,className:`ui-tool`,title:_e,"aria-label":_e,"aria-pressed":_,onClick:v,children:(0,Q.jsx)(c,{icon:oe,className:`ui-ic`})})]})]}),(0,Q.jsxs)(Jn,{value:a,activationMode:`manual`,onValueChange:e=>(e===`work`||e===`messages`||e===`profile`)&&y({view:`agent`,id:i,tab:e}),className:`ox-tabs`,children:[(0,Q.jsxs)(Xn,{variant:`line`,"aria-label":P,className:`ox-tablist`,children:[(0,Q.jsx)(Zn,{value:`work`,className:`ox-tab`,children:`Work`}),(0,Q.jsxs)(Zn,{value:`messages`,className:`ox-tab`,children:[`Messages `,(0,Q.jsx)(`span`,{className:`ox-n`,children:W})]}),(0,Q.jsx)(Zn,{value:`profile`,className:`ox-tab`,children:`Profile`})]}),(0,Q.jsx)(Qn,{value:`work`,className:`ox-tabc`,children:(0,Q.jsx)(Wn,{autoScroll:J,children:(0,Q.jsxs)(Gn,{className:`ox-scroller`,children:[(0,Q.jsx)(Kn,{ref:X,"aria-label":`Work`,className:`ox-viewport`,onScroll:fe,children:(0,Q.jsx)(qn,{className:`ox-scrollc`,children:Se})}),(0,Q.jsx)(ir,{steps:H,away:!J})]})})}),(0,Q.jsx)(Qn,{value:`messages`,className:`ox-tabc`,children:(0,Q.jsx)(`div`,{className:`ui-scroll`,children:(0,Q.jsx)(`div`,{className:`ox-col`,children:(0,Q.jsx)(Nt,{groups:U,row:ie,nameOf:le})})})}),(0,Q.jsx)(Qn,{value:`profile`,className:`ox-tabc`,children:(0,Q.jsx)(`div`,{className:`ui-scroll`,children:(0,Q.jsx)(`div`,{className:`ox-col`,children:(0,Q.jsx)(It,{store:e,id:i})})})})]}),ee&&(0,Q.jsx)(`div`,{className:`ui-dock`,children:(0,Q.jsx)(`div`,{className:`ui-dock-in`,children:(0,Q.jsx)(o,{store:e,target:ue,where:P,to:`to ${P} · direct message`})})})]})}export{or as AgentPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{_ as t,a as n,c as r,d as i,f as a,g as o,h as s,i as c,n as l,o as u,p as d,r as f,s as p,t as m}from"./dist-BB9Crw5c.js";import{t as h}from"./dist-DktEa9vr.js";var g=e(t(),1),_=s(),v=Object.defineProperty,y=(e,t)=>v(e,`name`,{value:t,configurable:!0}),b=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),x=g.forwardRef(y(function(e,t){return(0,_.jsx)(p.span,{...e,ref:t,style:{...b,...e.style}})},`VisuallyHidden`)),S=Object.defineProperty,C=(e,t)=>S(e,`name`,{value:t,configurable:!0}),w=`dismissableLayer.update`,T=`dismissableLayer.pointerDownOutside`,E=`dismissableLayer.focusOutside`,D,O=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),k=g.forwardRef(C(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:u,...d}=e,f=g.useContext(O),[m,v]=g.useState(null),y=m?.ownerDocument??globalThis?.document,[,b]=g.useState({}),x=a(t,v),S=Array.from(f.layers),[T]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=T?S.indexOf(T):-1,k=m?S.indexOf(m):-1,A=f.layersWithOutsidePointerEventsDisabled.size>0,j=k>=E,F=g.useRef(!1),ee=M(e=>{o?.(e),l?.(e),e.defaultPrevented||u?.()},{ownerDocument:y,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:F,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...f.branches].some(t=>t.contains(e));return j&&!t},[f.branches,j])}),I=N(e=>{if(r&&F.current)return;let t=e.target;[...f.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||u?.())},y),L=m?k===S.length-1:!1,R=h(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))});return g.useEffect(()=>{if(L)return y.addEventListener(`keydown`,R,{capture:!0}),()=>y.removeEventListener(`keydown`,R,{capture:!0})},[y,L,R]),g.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(D=y.body.style.pointerEvents,y.body.style.pointerEvents=`none`),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),P(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(m),f.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=D))}},[m,y,n,f]),g.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),P())},[m,f]),g.useEffect(()=>{let e=C(()=>b({}),`handleUpdate`);return document.addEventListener(w,e),()=>document.removeEventListener(w,e)},[]),(0,_.jsx)(p.div,{...d,ref:x,style:{pointerEvents:A?j?`auto`:`none`:void 0,...e.style},onFocusCapture:c(e.onFocusCapture,I.onFocusCapture),onBlurCapture:c(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,ee.onPointerDownCapture)})},`DismissableLayer`));function A(){let e=g.useContext(O),[t,n]=g.useState(null);return g.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}C(A,`useDismissableLayerSurface`);var j=C(()=>!0,`IS_TRUE`);function M(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=j}=t,s=h(e),c=g.useRef(!1),l=g.useRef(!1),u=g.useRef(new Map),d=g.useRef(()=>{});return g.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}C(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}C(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}C(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}C(p,`handleInteractionBubble`);let m=C(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||F(T,s,p,{discrete:!0})};if(C(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:C(()=>c.current=!0,`onPointerDownCapture`)}}C(M,`usePointerDownOutside`);function N(e,t=globalThis?.document){let n=h(e),r=g.useRef(!1);return g.useEffect(()=>{let e=C(e=>{e.target&&!r.current&&F(E,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:C(()=>r.current=!0,`onFocusCapture`),onBlurCapture:C(()=>r.current=!1,`onBlurCapture`)}}C(N,`useFocusOutside`);function P(){let e=new CustomEvent(w);document.dispatchEvent(e)}C(P,`dispatchUpdate`);function F(e,t,n,{discrete:i}){let a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),i?r(a,o):a.dispatchEvent(o)}C(F,`handleAndDispatchCustomEvent`);var ee=Object.defineProperty,I=(e,t)=>ee(e,`name`,{value:t,configurable:!0}),L=g.createContext(null);function R({registry:e,children:t}){return e?(0,_.jsx)(L.Provider,{value:e,children:t}):t}I(R,`FocusScopeBranchProvider`);function z(){let[e,t]=g.useState([]);return{nodes:e,registry:g.useMemo(()=>({add:I(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:I(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}I(z,`useFocusScopeBranchRegistry`);function te(e){let t=g.useContext(L);g.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}I(te,`useFocusScopeBranch`);function ne(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ce(r,{select:t}),document.activeElement!==n)return}I(ne,`focusFirst`);function re(e){let t=ie(e);return[ae(t,e),ae(t.reverse(),e)]}I(re,`getTabbableEdges`);function ie(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:I(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}I(ie,`getTabbableCandidates`);function ae(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):oe(r,{upTo:t})))return r}I(ae,`findVisible`);function oe(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}I(oe,`isHidden`);function se(e){return e.tagName===`INPUT`&&typeof e.select==`function`}I(se,`isSelectableInput`);function ce(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&se(e)&&t&&e.select()}}I(ce,`focus`);function le(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ue(e,t),e.unshift(t)},remove(t){e=ue(e,t),e[0]?.resume()}}}I(le,`createFocusScopesStack`);function ue(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}I(ue,`arrayRemove`);function de(e){return e.filter(e=>e.tagName!==`A`)}I(de,`removeLinks`);var fe=e(o(),1),pe=Object.defineProperty,me=g.forwardRef(((e,t)=>pe(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:r,...i}=e,[a,o]=g.useState(!1);n(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?fe.createPortal((0,_.jsx)(p.div,{...i,ref:t}),s):null},`Portal`)),he=Object.defineProperty,ge=(e,t)=>he(e,`name`,{value:t,configurable:!0});function _e(e){let[t,r]=g.useState(void 0);return n(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=0,n=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let i=n[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,n;if(`borderBoxSize`in i){let e=i.borderBoxSize,r=Array.isArray(e)?e[0]:e;t=r.inlineSize,n=r.blockSize}else t=e.offsetWidth,n=e.offsetHeight;r({width:t,height:n})})});return n.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}r(void 0)},[e]),t}ge(_e,`useSize`);var ve=[`top`,`right`,`bottom`,`left`],B=Math.min,V=Math.max,ye=Math.round,be=Math.floor,H=e=>({x:e,y:e}),xe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Se(e,t,n){return V(e,B(t,n))}function U(e,t){return typeof e==`function`?e(t):e}function W(e){return e.split(`-`)[0]}function Ce(e){return e.split(`-`)[1]}function we(e){return e===`x`?`y`:`x`}function Te(e){return e===`y`?`height`:`width`}function G(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ee(e){return we(G(e))}function De(e,t,n){n===void 0&&(n=!1);let r=Ce(e),i=Ee(e),a=Te(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ie(o)),[o,Ie(o)]}function Oe(e){let t=Ie(e);return[ke(e),t,ke(t)]}function ke(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ae=[`left`,`right`],je=[`right`,`left`],Me=[`top`,`bottom`],Ne=[`bottom`,`top`];function Pe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?je:Ae:t?Ae:je;case`left`:case`right`:return t?Me:Ne;default:return[]}}function Fe(e,t,n,r){let i=Ce(e),a=Pe(W(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ke)))),a}function Ie(e){let t=W(e);return xe[t]+e.slice(t.length)}function Le(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Re(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Le(e)}function ze(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Be(e,t,n){let{reference:r,floating:i}=e,a=G(t),o=Ee(t),s=Te(o),c=W(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ce(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ve(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=U(t,e),p=Re(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ze(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ze(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var He=50,Ue=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Be(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<He&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Be(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},We=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=U(e,t)||{};if(l==null)return{};let d=Re(u),f={x:n,y:r},p=Ee(i),m=Te(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=B(d[_],T),D=B(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Se(E,k,O),j=!c.arrow&&Ce(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Ge=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=U(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=W(r),_=G(o),v=W(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ie(o)]:Oe(o)),x=p!==`none`;!d&&x&&b.push(...Fe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=De(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===G(t)||T.every(e=>G(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=G(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ke(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qe(e){return ve.some(t=>e[t]>=0)}var Je=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=U(e,t);switch(i){case`referenceHidden`:{let e=Ke(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qe(e)}}}case`escaped`:{let e=Ke(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qe(e)}}}default:return{}}}}},Ye=new Set([`left`,`top`]);async function Xe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=W(n),s=Ce(n),c=G(n)===`y`,l=Ye.has(o)?-1:1,u=a&&c?-1:1,d=U(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ze=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Xe(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Qe=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=U(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=G(i),p=we(f),m=u[p],h=u[f],g=(e,t)=>Se(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},$e=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=U(e,t),u={x:n,y:r},d=G(i),f=we(d),p=u[f],m=u[d],h=U(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ye.has(W(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},et=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=U(e,t),c=await i.detectOverflow(t,s),l=W(n),u=Ce(n),d=G(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=B(p-c[m],g),y=B(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*V(c.left,c.right):S=p-2*V(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function tt(){return typeof window<`u`}function nt(e){return rt(e)?(e.nodeName||``).toLowerCase():`#document`}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){return((rt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function rt(e){return tt()?e instanceof Node||e instanceof K(e).Node:!1}function J(e){return tt()?e instanceof Element||e instanceof K(e).Element:!1}function Y(e){return tt()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function it(e){return!tt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}function at(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ot(e){return/^(table|td|th)$/.test(nt(e))}function st(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ct=/transform|translate|scale|rotate|perspective|filter/,lt=/paint|layout|strict|content/,ut=e=>!!e&&e!==`none`,dt;function ft(e){let t=J(e)?X(e):e;return ut(t.transform)||ut(t.translate)||ut(t.scale)||ut(t.rotate)||ut(t.perspective)||!mt()&&(ut(t.backdropFilter)||ut(t.filter))||ct.test(t.willChange||``)||lt.test(t.contain||``)}function pt(e){let t=_t(e);for(;Y(t)&&!ht(t);){if(ft(t))return t;if(st(t))return null;t=_t(t)}return null}function mt(){return dt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),dt}function ht(e){return/^(html|body|#document)$/.test(nt(e))}function X(e){return K(e).getComputedStyle(e)}function gt(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _t(e){if(nt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||it(e)&&e.host||q(e);return it(t)?t.host:t}function vt(e){let t=_t(e);return ht(t)?(e.ownerDocument||e).body:Y(t)&&at(t)?t:vt(t)}function yt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=vt(e),i=r===e.ownerDocument?.body,a=K(r);if(i){let e=bt(a);return t.concat(a,a.visualViewport||[],at(r)?r:[],e&&n?yt(e):[])}return t.concat(r,yt(r,[],n))}function bt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xt(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ye(n)!==a||ye(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function St(e){return J(e)?e:e.contextElement}function Ct(e){let t=St(e);if(!Y(t))return H(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=xt(t),o=(a?ye(n.width):n.width)/r,s=(a?ye(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var wt=H(0);function Tt(e){let t=K(e);return!mt()||!t.visualViewport?wt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Et(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===K(e)}function Z(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=St(e),o=H(1);t&&(r?J(r)&&(o=Ct(r)):o=Ct(e));let s=Et(a,n,r)?Tt(a):H(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=K(a),t=J(r)?K(r):r,n=e,i=bt(n);for(;i&&t!==n;){let e=Ct(i),t=i.getBoundingClientRect(),r=X(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=K(i),i=bt(n)}}return ze({width:u,height:d,x:c,y:l})}function Dt(e,t){let n=gt(e).scrollLeft;return t?t.left+n:Z(q(e)).left+n}function Ot(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Dt(e,n),y:n.top+t.scrollTop}}function kt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=q(r),s=t?st(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=H(1),u=H(0),d=Y(r);if((d||!a)&&((nt(r)!==`body`||at(o))&&(c=gt(r)),d)){let e=Z(r);l=Ct(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ot(o,c):H(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function At(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function jt(e){let t=gt(e),n=e.ownerDocument.body,r=V(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=V(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Dt(e),o=-t.scrollTop;return X(n).direction===`rtl`&&(a+=V(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Mt=25;function Nt(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=K(e),a=q(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!mt()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Dt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Mt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Pt(e,t){let n=Z(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ct(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ft(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Nt(e,n,t);else if(t===`document`)r=jt(q(e));else if(J(t))r=Pt(t,n);else{let n=Tt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ze(r)}function It(e,t){let n=t.get(e);if(n)return n;let r=yt(e,[],!1).filter(e=>J(e)&&nt(e)!==`body`),i=null,a=X(e).position===`fixed`,o=a?_t(e):e;for(;J(o)&&!ht(o);){let e=X(o),t=ft(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=_t(o)}return t.set(e,r),r}function Lt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?st(t)?[]:It(t,this._c):[].concat(n),r],o=Ft(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ft(t,a[e],i);s=V(n.top,s),c=B(n.right,c),l=B(n.bottom,l),u=V(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Rt(e){let{width:t,height:n}=xt(e);return{width:t,height:n}}function zt(e,t,n){let r=Y(t),i=q(t),a=n===`fixed`,o=Z(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=H(0);if((r||!a)&&((nt(t)!==`body`||at(i))&&(s=gt(t)),r)){let e=Z(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Dt(i));let l=i&&!r&&!a?Ot(i,s):H(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Bt(e){return X(e).position===`static`}function Vt(e,t){if(!Y(e)||X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function Ht(e,t){let n=K(e);if(st(e))return n;if(!Y(e)){let t=_t(e);for(;t&&!ht(t);){if(J(t)&&!Bt(t))return t;t=_t(t)}return n}let r=Vt(e,t);for(;r&&ot(r)&&Bt(r);)r=Vt(r,t);return r&&ht(r)&&Bt(r)&&!ft(r)?n:r||pt(e)||n}var Ut=async function(e){let t=this.getOffsetParent||Ht,n=this.getDimensions,r=await n(e.floating);return{reference:zt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wt(e){return X(e).direction===`rtl`}var Gt={convertOffsetParentRelativeRectToViewportRelativeRect:kt,getDocumentElement:q,getClippingRect:Lt,getOffsetParent:Ht,getElementRects:Ut,getClientRects:At,getDimensions:Rt,getScale:Ct,isElement:J,isRTL:Wt};function Kt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qt(e,t,n){let r=null,i,a=q(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=be(d),h=be(a.clientWidth-(u+f)),g=be(a.clientHeight-(d+p)),_=be(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:V(0,B(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Kt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=K(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Jt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=St(e),u=i||a?[...l?yt(l):[],...t?yt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?qt(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Z(e):null;c&&g();function g(){let t=Z(e);h&&!Kt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Yt=Ze,Xt=Qe,Zt=Ge,Qt=et,$t=Je,en=We,tn=$e,nn=(e,t,n)=>{let r=new Map,i=n??{},a={...Gt,...i.platform,_c:r};return Ue(e,t,{...i,platform:a})},rn=typeof document<`u`?g.useLayoutEffect:function(){};function an(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!an(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!an(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function on(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sn(e,t){let n=on(e);return Math.round(t*n)/n}function cn(e){let t=g.useRef(e);return rn(()=>{t.current=e}),t}function ln(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=g.useState(r);an(f,r)||p(r);let[m,h]=g.useState(null),[_,v]=g.useState(null),y=g.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=g.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||_,C=g.useRef(null),w=g.useRef(null),T=g.useRef(u),E=c!=null,D=cn(c),O=cn(i),k=cn(l),A=g.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),nn(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!an(T.current,t)&&(T.current=t,fe.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);rn(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=g.useRef(!1);rn(()=>(j.current=!0,()=>{j.current=!1}),[]),rn(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=g.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=g.useMemo(()=>({reference:x,floating:S}),[x,S]),P=g.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=sn(N.floating,u.x),r=sn(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...on(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var un=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:en({element:r.current,padding:i}).fn(n):r?en({element:r,padding:i}).fn(n):{}}}},dn=(e,t)=>{let n=Yt(e);return{name:n.name,fn:n.fn,options:[e,t]}},fn=(e,t)=>{let n=Xt(e);return{name:n.name,fn:n.fn,options:[e,t]}},pn=(e,t)=>({fn:tn(e).fn,options:[e,t]}),mn=(e,t)=>{let n=Zt(e);return{name:n.name,fn:n.fn,options:[e,t]}},hn=(e,t)=>{let n=Qt(e);return{name:n.name,fn:n.fn,options:[e,t]}},gn=(e,t)=>{let n=$t(e);return{name:n.name,fn:n.fn,options:[e,t]}},_n=(e,t)=>{let n=un(e);return{name:n.name,fn:n.fn,options:[e,t]}},vn=Object.defineProperty,yn=g.forwardRef(((e,t)=>vn(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,_.jsx)(p.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,_.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),bn=Object.defineProperty,Q=(e,t)=>bn(e,`name`,{value:t,configurable:!0}),xn={Partial:`partial`,Always:`always`},Sn={Optimized:`optimized`,Always:`always`},Cn=`Popper`,[wn,Tn]=u(Cn),[En,Dn]=wn(Cn),On=Q(e=>{let{__scopePopper:t,children:n}=e,[r,i]=g.useState(null),[a,o]=g.useState(void 0);return(0,_.jsx)(En,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),kn=`PopperAnchor`,An=g.forwardRef(Q(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,o=Dn(kn,n),s=g.useRef(null),c=o.onAnchorChange,l=g.useCallback(e=>{s.current=e,e&&c(e)},[c]),u=a(t,l),d=g.useRef(null);g.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&c(d.current)});let f=o.placementState&&Bn(o.placementState),m=f?.[0],h=f?.[1];return r?null:(0,_.jsx)(p.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...i,ref:u})},`PopperAnchor`)),jn=`PopperContent`,[Mn,Nn]=wn(jn),Pn=g.forwardRef(Q(function(e,t){let{__scopePopper:r,side:i=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:m=xn.Partial,hideWhenDetached:v=!1,updatePositionStrategy:y=Sn.Optimized,onPlaced:b,...x}=e,S=Dn(jn,r),[C,w]=g.useState(null),T=a(t,w),[E,D]=g.useState(null),O=_e(E),k=O?.width??0,A=O?.height??0,j=i+(s===`center`?``:`-`+s),M=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(d)?d:[d],P=N.length>0,F={padding:M,boundary:N.filter(Rn),altBoundary:P},{refs:ee,floatingStyles:I,placement:L,isPositioned:R,middlewareData:z}=ln({strategy:`fixed`,placement:j,whileElementsMounted:Q((...e)=>Jt(...e,{animationFrame:y===Sn.Always}),`whileElementsMounted`),elements:{reference:S.anchor},middleware:[dn({mainAxis:o+A,alignmentAxis:c}),u&&fn({mainAxis:!0,crossAxis:!1,...m===xn.Partial?{limiter:pn()}:{},...F}),u&&mn({...F}),hn({...F,apply:Q(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),E&&_n({element:E,padding:l}),zn({arrowWidth:k,arrowHeight:A}),v&&gn(P?{strategy:`referenceHidden`,...F}:{strategy:`referenceHidden`,padding:F.padding,altBoundary:F.altBoundary})]}),te=S.setPlacementState;n(()=>(te(L),()=>{te(void 0)}),[L,te]);let[ne,re]=Bn(L),ie=h(b);n(()=>{R&&ie?.()},[R,ie]);let ae=z.arrow?.x,oe=z.arrow?.y,se=z.arrow?.centerOffset!==0,[ce,le]=g.useState();return n(()=>{C&&le(window.getComputedStyle(C).zIndex)},[C]),(0,_.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...I,transform:R?I.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,_.jsx)(Mn,{scope:r,placedSide:ne,placedAlign:re,onArrowChange:D,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,_.jsx)(p.div,{"data-side":ne,"data-align":re,...x,ref:T,style:{...x.style,animation:R?x.style?.animation:`none`}})})})},`PopperContent`)),Fn=`PopperArrow`,In={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ln=g.forwardRef(Q(function(e,t){let{__scopePopper:n,...r}=e,i=Nn(Fn,n),a=In[i.placedSide];return(0,_.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,_.jsx)(yn,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Rn(e){return e!==null}Q(Rn,`isNotNull`);var zn=Q(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Bn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Bn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Q(Bn,`getSideAndAlignFromPlacement`);var Vn=Object.defineProperty,$=(e,t)=>Vn(e,`name`,{value:t,configurable:!0}),[Hn,Un]=u(`Tooltip`,[Tn]),Wn=Tn(),Gn=`TooltipProvider`,Kn=700,qn=`tooltip.open`,[Jn,Yn]=Hn(Gn),Xn=$(e=>{let{__scopeTooltip:t,delayDuration:n=Kn,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=g.useRef(!0),s=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,_.jsx)(Jn,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Zn=`Tooltip`,[Qn,$n]=Hn(Zn),er=$(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Yn(Zn,e.__scopeTooltip),l=Wn(t),[u,d]=g.useState(null),[p,h]=g.useState(void 0),v=m(),y=g.useRef(0),b=o??c.disableHoverableContent,x=s??c.delayDuration,S=g.useRef(!1),[C,w]=f({prop:r,defaultProp:i??!1,onChange:$(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(qn))):c.onClose(),a?.(e)},`onChange`),caller:Zn}),T=g.useMemo(()=>C?S.current?`delayed-open`:`instant-open`:`closed`,[C]),E=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,S.current=!1,w(!0)},[w]),D=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w(!1)},[w]),O=g.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{S.current=!0,w(!0),y.current=0},x)},[x,w]);g.useEffect(()=>()=>{y.current&&=(window.clearTimeout(y.current),0)},[]);let k=p??v;return(0,_.jsx)(On,{...l,children:(0,_.jsx)(Qn,{scope:t,contentId:k,setContentId:h,open:C,stateAttribute:T,trigger:u,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?O():E()},[c.isOpenDelayedRef,O,E]),onTriggerLeave:g.useCallback(()=>{b?D():(window.clearTimeout(y.current),y.current=0)},[D,b]),onOpen:E,onClose:D,disableHoverableContent:b,children:n})})},`Tooltip`),tr=`TooltipTrigger`,nr=g.forwardRef($(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,o=$n(tr,n),s=Yn(tr,n),l=Wn(n),u=g.useRef(null),d=a(t,u,o.onTriggerChange),f=g.useRef(!1),m=g.useRef(!1),h=g.useCallback(()=>f.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener(`pointerup`,h),[h]),(0,_.jsx)(An,{asChild:!0,...l,children:(0,_.jsx)(p.button,{"aria-describedby":o.open?yr(r,o.contentId):r,"data-state":o.stateAttribute,...i,ref:d,onPointerMove:c(e.onPointerMove,e=>{e.pointerType!==`touch`&&!m.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:c(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:c(e.onPointerDown,()=>{o.open&&o.onClose(),f.current=!0,document.addEventListener(`pointerup`,h,{once:!0})}),onFocus:c(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:c(e.onBlur,o.onClose),onClick:c(e.onClick,o.onClose)})})},`TooltipTrigger`)),rr=`TooltipPortal`,[ir,ar]=Hn(rr,{forceMount:void 0}),or=$(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=$n(rr,t);return(0,_.jsx)(ir,{scope:t,forceMount:n,children:(0,_.jsx)(l,{present:n||a.open,children:(0,_.jsx)(me,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),sr=`TooltipContent`,cr=g.forwardRef($(function(e,t){let n=ar(sr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=$n(sr,e.__scopeTooltip);return(0,_.jsx)(l,{present:r||o.open,children:o.disableHoverableContent?(0,_.jsx)(dr,{side:i,...a,ref:t}):(0,_.jsx)(lr,{side:i,...a,ref:t})})},`TooltipContent`)),lr=g.forwardRef($(function(e,t){let n=$n(sr,e.__scopeTooltip),r=Yn(sr,e.__scopeTooltip),i=g.useRef(null),o=a(t,i),[s,c]=g.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=g.useCallback(()=>{c(null),f(!1)},[f]),m=g.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=mr(r,pr(r,n.getBoundingClientRect())),a=hr(t.getBoundingClientRect()),o=_r([...i,...a]);c(o),f(!0)},[f]);return g.useEffect(()=>()=>p(),[p]),g.useEffect(()=>{if(l&&d){let e=$(e=>m(e,d),`handleTriggerLeave`),t=$(e=>m(e,l),`handleContentLeave`);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),g.useEffect(()=>{if(s){let e=$(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!gr(n,s);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,_.jsx)(dr,{...e,ref:o})},`TooltipContentHoverable`)),ur=i(`TooltipContent`),dr=g.forwardRef($(function(e,t){let{__scopeTooltip:r,children:i,"aria-label":o,id:s,onEscapeKeyDown:c,onPointerDownOutside:l,...u}=e,d=$n(sr,r),f=Wn(r),{onClose:p}=d,[m,h]=g.useState(null),v=a(t,h);te(m),g.useEffect(()=>(document.addEventListener(qn,p),()=>document.removeEventListener(qn,p)),[p]),g.useEffect(()=>{if(d.trigger){let e=$(e=>{e.target instanceof Node&&e.target.contains(d.trigger)&&p()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[d.trigger,p]);let{setContentId:y}=d;return n(()=>(y(s),()=>{y(void 0)}),[s,y]),(0,_.jsx)(k,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:(0,_.jsxs)(Pn,{"data-state":d.stateAttribute,role:o?void 0:`tooltip`,id:o?void 0:d.contentId,...f,...u,ref:v,style:{...u.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,_.jsx)(ur,{children:i}),o?(0,_.jsx)(x,{id:d.contentId,role:`tooltip`,children:o}):null]})})},`TooltipContentImpl`)),fr=g.forwardRef($(function(e,t){let{__scopeTooltip:n,...r}=e,i=Wn(n);return(0,_.jsx)(Ln,{...i,...r,ref:t})},`TooltipArrow`));function pr(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}$(pr,`getExitSideFromRect`);function mr(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}$(mr,`getPaddedExitPoints`);function hr(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}$(hr,`getPointsFromRect`);function gr(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}$(gr,`isPointInPolygon`);function _r(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),vr(t)}$(_r,`getHull`);function vr(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}$(vr,`getHullPresorted`);function yr(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}$(yr,`concatAriaDescribedby`);function br({delayDuration:e=0,...t}){return(0,_.jsx)(Xn,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function xr({...e}){return(0,_.jsx)(er,{"data-slot":`tooltip`,...e})}function Sr({...e}){return(0,_.jsx)(nr,{"data-slot":`tooltip-trigger`,...e})}function Cr({className:e,sideOffset:t=0,children:n,...r}){return(0,_.jsx)(or,{children:(0,_.jsxs)(cr,{"data-slot":`tooltip-content`,sideOffset:t,className:d(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-xl bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,_.jsx)(fr,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=left]:translate-x-[-1.5px] data-[side=right]:translate-x-[1.5px]`})]})})}function wr({line:e,words:t}){let[n,r]=(0,g.useState)(!1);return(0,_.jsx)(br,{children:(0,_.jsxs)(xr,{open:n,onOpenChange:r,children:[(0,_.jsx)(Sr,{type:`button`,className:`ox-tip`,onClick:e=>{e.preventDefault(),r(!n)},children:e}),(0,_.jsx)(Cr,{className:`ox-tipc`,sideOffset:4,children:t})]})})}export{wr as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[Object.freeze(JSON.parse(`{"displayName":"Shell","name":"shellscript","patterns":[{"include":"#initial_context"}],"repository":{"alias_statement":{"begin":"[\\\\t ]*+(alias)[\\\\t ]*+((?:((?<!\\\\w)-\\\\w+)\\\\b[\\\\t ]*+)*)[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"storage.type.alias.shell"},"2":{"patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"}]},"3":{"name":"string.unquoted.argument.shell constant.other.option.shell"},"4":{"name":"variable.other.assignment.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"variable.other.assignment.shell"},"7":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"8":{"name":"punctuation.definition.array.access.shell"},"9":{"name":"keyword.operator.assignment.shell"},"10":{"name":"keyword.operator.assignment.compound.shell"},"11":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\t ]|$)|(?:(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&))","endCaptures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"name":"meta.expression.assignment.alias.shell","patterns":[{"include":"#normal_context"}]},"argument":{"begin":"[\\\\t ]++(?![\\\\n#\\\\&(\\\\[|]|$|;)","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)\`])","endCaptures":{},"name":"meta.argument.shell","patterns":[{"include":"#argument_context"},{"include":"#line_continuation"}]},"argument_context":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell","patterns":[{"match":"\\\\*","name":"variable.language.special.wildcard.shell"},{"include":"#variable"},{"include":"#numeric_literal"},{"captures":{"1":{"name":"constant.language.$1.shell"}},"match":"(?<!\\\\w)\\\\b(true|false)\\\\b(?!\\\\w)"}]}},"match":"[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]+(?!>))"},{"include":"#normal_context"}]},"arithmetic_double":{"patterns":[{"begin":"\\\\(\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"end":"\\\\)\\\\s*\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"arithmetic_no_dollar":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"array_access_inline":{"captures":{"1":{"name":"punctuation.section.array.shell"},"2":{"patterns":[{"include":"#special_expansion"},{"include":"#string"},{"include":"#variable"}]},"3":{"name":"punctuation.section.array.shell"}},"match":"(\\\\[)([^]\\\\[]+)(])"},"array_value":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))[\\\\t ]*+(\\\\()","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"punctuation.definition.array.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.array.shell"}},"patterns":[{"include":"#comment"},{"captures":{"1":{"name":"variable.other.assignment.array.shell entity.other.attribute-name.shell"},"2":{"name":"keyword.operator.assignment.shell punctuation.definition.assignment.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(=)"},{"captures":{"1":{"name":"punctuation.definition.bracket.named-array.shell"},"2":{"name":"string.unquoted.shell entity.other.attribute-name.bracket.shell"},"3":{"name":"punctuation.definition.bracket.named-array.shell"},"4":{"name":"punctuation.definition.assignment.shell"}},"match":"(\\\\[)(.+?)(])(=)"},{"include":"#normal_context"},{"include":"#simple_unquoted"}]},"assignment_statement":{"patterns":[{"include":"#array_value"},{"include":"#modified_assignment_statement"},{"include":"#normal_assignment_statement"}]},"basic_command_name":{"captures":{"1":{"name":"storage.modifier.$1.shell"},"2":{"name":"entity.name.function.call.shell entity.name.command.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"support.function.builtin.shell"},{"include":"#variable"}]}},"match":"(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?:((?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$))|((?![\\"']|\\\\\\\\\\\\n?$)[^\\\\t\\\\n\\\\r !\\"'<>]+?))(?:(?=[\\\\t ])|(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\))","name":"meta.statement.command.name.basic.shell"},"block_comment":{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.shell"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.shell"}},"name":"comment.block.shell"},"boolean":{"match":"\\\\b(?:true|false)\\\\b","name":"constant.language.$0.shell"},"case_statement":{"begin":"\\\\b(case)\\\\b[\\\\t ]*+(.+?)[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.case.shell"},"2":{"patterns":[{"include":"#initial_context"}]},"3":{"name":"keyword.control.in.shell"}},"end":"\\\\besac\\\\b","endCaptures":{"0":{"name":"keyword.control.esac.shell"}},"name":"meta.case.shell","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"keyword.operator.pattern.case.default.shell"}},"match":"[\\\\t ]*+(\\\\* *\\\\))"},{"begin":"(?<!\\\\))(?![\\\\t ]*+(?:esac\\\\b|$))","beginCaptures":{},"end":"(?=\\\\besac\\\\b)|(\\\\))","endCaptures":{"1":{"name":"keyword.operator.pattern.case.shell"}},"name":"meta.case.entry.pattern.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"(?<=\\\\))","beginCaptures":{},"end":"(;;)|(?=\\\\besac\\\\b)","endCaptures":{"1":{"name":"punctuation.terminator.statement.case.shell"}},"name":"meta.case.entry.body.shell","patterns":[{"include":"#typical_statements"},{"include":"#initial_context"}]}]},"case_statement_context":{"patterns":[{"match":"\\\\*","name":"variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\+","name":"variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\?","name":"variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"@","name":"variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell"},{"match":"\\\\|","name":"keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell"},{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"match":"(?<=\\\\tin| in|[\\\\t ]|;;)\\\\(","name":"keyword.operator.pattern.case.shell"},{"begin":"(?<=\\\\S)(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"name":"meta.parenthese.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"name":"string.regexp.character-class.shell","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"}]},{"include":"#string"},{"match":"[^\\\\t\\\\n )*?@\\\\[|]","name":"string.unquoted.pattern.shell string.regexp.unquoted.shell"}]},"command_name_range":{"begin":"\\\\G","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)\`])|(?=<)","endCaptures":{},"name":"meta.statement.command.name.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"},{"include":"#variable"},{"captures":{"1":{"name":"entity.name.function.call.shell entity.name.command.shell"}},"match":"(?<!\\\\w)(?<=\\\\G|[\\"')}])([^\\\\t\\\\n\\\\r \\"\\\\&');->\`{|]+)"},{"begin":"(?:\\\\G|(?<![\\\\t\\\\n #\\\\&;{|]))(\\\\$?)((\\")|('))","beginCaptures":{"1":{"name":"meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"},"2":{},"3":{"name":"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},"4":{"name":"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"}},"end":"(?<!\\\\G)(?<=\\\\2)","endCaptures":{},"patterns":[{"include":"#continuation_of_single_quoted_command_name"},{"include":"#continuation_of_double_quoted_command_name"}]},{"include":"#line_continuation"},{"include":"#simple_unquoted"}]},"command_statement":{"begin":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"},{"include":"#heredoc"}]},"comment":{"captures":{"1":{"name":"comment.line.number-sign.shell meta.shebang.shell"},"2":{"name":"punctuation.definition.comment.shebang.shell"},"3":{"name":"comment.line.number-sign.shell"},"4":{"name":"punctuation.definition.comment.shell"}},"match":"(?:^|[\\\\t ]++)(?:((#!).*)|((#).*))"},"comments":{"patterns":[{"include":"#block_comment"},{"include":"#line_comment"}]},"compound-command":{"patterns":[{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical-expression"},{"include":"#initial_context"}]},{"begin":"(?<=\\\\s|^)\\\\{(?=\\\\s|$)","beginCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"end":"(?<=^|;)\\\\s*(})","endCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"continuation_of_double_quoted_command_name":{"begin":"\\\\G(?<=\\")","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command","end":"\\"","endCaptures":{"0":{"name":"string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"continuation_of_single_quoted_command_name":{"begin":"\\\\G(?<=')","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command","end":"'","endCaptures":{"0":{"name":"string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}}},"custom_command_names":{"patterns":[]},"custom_commands":{"patterns":[]},"double_quote_context":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"double_quote_escape_char":{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},"floating_keyword":{"patterns":[{"match":"(?<=^|[\\\\t \\\\&;])(?:then|elif|else|done|end|do|if|fi)(?=[\\\\t \\\\&;]|$)","name":"keyword.control.$0.shell"}]},"for_statement":{"patterns":[{"begin":"\\\\b(for)\\\\b[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"},"2":{"name":"variable.other.for.shell"},"3":{"name":"keyword.control.in.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.in.shell","patterns":[{"include":"#string"},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},{"begin":"\\\\b(for)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.shell","patterns":[{"include":"#arithmetic_double"},{"include":"#normal_context"}]}]},"function_definition":{"applyEndPatternLast":1,"begin":"[\\\\t ]*+(?:\\\\b(function)\\\\b[\\\\t ]*+([^\\\\t\\\\n\\\\r \\"'()=]+)(?:(\\\\()[\\\\t ]*+(\\\\)))?|([^\\\\t\\\\n\\\\r \\"'()=]+)[\\\\t ]*+(\\\\()[\\\\t ]*+(\\\\)))","beginCaptures":{"1":{"name":"storage.type.function.shell"},"2":{"name":"entity.name.function.shell"},"3":{"name":"punctuation.definition.arguments.shell"},"4":{"name":"punctuation.definition.arguments.shell"},"5":{"name":"entity.name.function.shell"},"6":{"name":"punctuation.definition.arguments.shell"},"7":{"name":"punctuation.definition.arguments.shell"}},"end":"(?<=[)}])","endCaptures":{},"name":"meta.function.shell","patterns":[{"match":"\\\\G[\\\\t\\\\n ]"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"include":"#initial_context"}]},"heredoc":{"patterns":[{"begin":"((?<!<)<<-)[\\\\t ]*+([\\"'])[\\\\t ]*+([^\\"']+?)(?=[\\"\\\\&';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.indent.$3","end":"^\\\\t*\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.$0.shell"}},"patterns":[]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([\\"'])[\\\\t ]*+([^\\"']+?)(?=[\\"\\\\&';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.no-indent.$3","end":"^\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[]},{"begin":"((?<!<)<<-)[\\\\t ]*+([^\\\\t \\"']+)(?=[\\"\\\\&';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.indent.$2","end":"^\\\\t*\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([^\\\\t \\"']+)(?=[\\"\\\\&';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.no-indent.$2","end":"^\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]}]},"herestring":{"patterns":[{"begin":"(<<<)\\\\s*(('))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.single.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.single.shell","end":"(')","endCaptures":{"0":{"name":"string.quoted.single.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell"},{"begin":"(<<<)\\\\s*((\\"))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.double.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.double.shell","end":"(\\")","endCaptures":{"0":{"name":"string.quoted.double.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell","patterns":[{"include":"#double_quote_context"}]},{"captures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.unquoted.herestring.shell","patterns":[{"include":"#initial_context"}]}},"match":"(<<<)\\\\s*(([^)\\\\\\\\\\\\s]|\\\\\\\\.)+)","name":"meta.herestring.shell"}]},"initial_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#logical_expression_double"},{"include":"#logical_expression_single"},{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#loop"},{"include":"#function_definition"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#misc_ranges"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#alias_statement"},{"include":"#normal_statement"},{"include":"#string"},{"include":"#support"}]},"inline_comment":{"captures":{"1":{"name":"comment.block.shell punctuation.definition.comment.begin.shell"},"2":{"name":"comment.block.shell"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.shell punctuation.definition.comment.end.shell"},{"match":"\\\\*","name":"comment.block.shell"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"},"interpolation":{"patterns":[{"include":"#arithmetic_dollar"},{"include":"#subshell_dollar"},{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"name":"string.interpolated.backtick.shell","patterns":[{"match":"\\\\\\\\[$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"begin":"(?<=\\\\W)(?=#)(?!#\\\\{)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.shell"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.shell"}},"end":"(?=\`)","name":"comment.line.number-sign.shell"}]},{"include":"#initial_context"}]}]},"keyword":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=[\\\\&;\\\\s]|$)","name":"keyword.control.shell"},{"match":"(?<=^|[\\\\&;\\\\s])(?:export|declare|typeset|local|readonly)(?=[\\\\&;\\\\s]|$)","name":"storage.modifier.shell"}]},"line_comment":{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.shell"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.shell","patterns":[{"include":"#line_continuation_character"}]},"line_continuation":{"match":"\\\\\\\\(?=\\\\n)","name":"constant.character.escape.line-continuation.shell"},"logical-expression":{"patterns":[{"include":"#arithmetic_no_dollar"},{"match":"=[=~]?|!=?|[<>]|&&|\\\\|\\\\|","name":"keyword.operator.logical.shell"},{"match":"(?<!\\\\S)-(nt|ot|ef|eq|ne|l[et]|g[et]|[GLNOSa-hknopr-uwxz])\\\\b","name":"keyword.operator.logical.shell"}]},"logical_expression_context":{"patterns":[{"include":"#regex_comparison"},{"include":"#arithmetic_no_dollar"},{"include":"#logical-expression"},{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#comment"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"logical_expression_double":{"begin":"\\\\[\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"logical_expression_single":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"loop":{"patterns":[{"begin":"(?<=^|[\\\\&;\\\\s])(for)\\\\s+(.+?)\\\\s+(in)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell","patterns":[{"include":"#string"}]},"3":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.for-in-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(while|until)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.while-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(select)\\\\s+((?:[^\\\\\\\\\\\\s]|\\\\\\\\.)+)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell"}},"end":"(?<=^|[\\\\&;\\\\s])(done)(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"1":{"name":"keyword.control.shell"}},"name":"meta.scope.select-block.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])if(?=[\\\\&;\\\\s]|$)","beginCaptures":{"0":{"name":"keyword.control.if.shell"}},"end":"(?<=^|[\\\\&;\\\\s])fi(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"keyword.control.fi.shell"}},"name":"meta.scope.if-block.shell","patterns":[{"include":"#initial_context"}]}]},"math":{"patterns":[{"include":"#variable"},{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":";","name":"punctuation.separator.semicolon.range"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"},{"match":"(?<!\\\\w)[0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"}]},"math_operators":{"patterns":[{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"}]},"misc_ranges":{"patterns":[{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#subshell_dollar"},{"begin":"(?<![^\\\\t ])(\\\\{)(?![$\\\\w])","beginCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"modified_assignment_statement":{"begin":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","beginCaptures":{"0":{"name":"storage.modifier.$0.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell meta.expression.assignment.modified.shell","patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"},{"include":"#array_value"},{"captures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"10":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"11":{"name":"constant.numeric.shell constant.numeric.other.shell"},"12":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"13":{"name":"constant.numeric.shell constant.numeric.version.shell"},"14":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))?(?:(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}]))?"},{"include":"#normal_context"}]},"modifiers":{"match":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","name":"storage.modifier.$0.shell"},"normal_assignment_statement":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.expression.assignment.shell","patterns":[{"include":"#comment"},{"include":"#string"},{"include":"#normal_assignment_statement"},{"begin":"(?<=[\\\\t ])(?![\\\\t ]|\\\\w+=)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.env.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"}]},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},"normal_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#misc_ranges"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"},{"include":"#parenthese"}]},"normal_statement":{"begin":"(?!^[\\\\t ]*+$)(?:(?<=(?:^until| until|\\\\tuntil|^while| while|\\\\twhile|^elif| elif|\\\\telif|^else| else|\\\\telse|^then| then|\\\\tthen|^do| do|\\\\tdo|^if| if|\\\\tif) )|(?<=^|[!\\\\&(;\`{|]))[\\\\t ]*+(?!nocorrect\\\\W|nocorrect\\\\$|function\\\\W|function\\\\$|foreach\\\\W|foreach\\\\$|repeat\\\\W|repeat\\\\$|logout\\\\W|logout\\\\$|coproc\\\\W|coproc\\\\$|select\\\\W|select\\\\$|while\\\\W|while\\\\$|pushd\\\\W|pushd\\\\$|until\\\\W|until\\\\$|case\\\\W|case\\\\$|done\\\\W|done\\\\$|elif\\\\W|elif\\\\$|else\\\\W|else\\\\$|esac\\\\W|esac\\\\$|popd\\\\W|popd\\\\$|then\\\\W|then\\\\$|time\\\\W|time\\\\$|for\\\\W|for\\\\$|end\\\\W|end\\\\$|fi\\\\W|fi\\\\$|do\\\\W|do\\\\$|in\\\\W|in\\\\$|if\\\\W|if\\\\$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell","patterns":[{"include":"#typical_statements"}]},"normal_statement_seperator":{"captures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"match":"(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&)"},"numeric_literal":{"captures":{"1":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"2":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"3":{"name":"constant.numeric.shell constant.numeric.other.shell"},"4":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"5":{"name":"constant.numeric.shell constant.numeric.version.shell"},"6":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}])"},"option":{"begin":"[\\\\t ]++(-)((?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;]))","beginCaptures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"contentName":"string.unquoted.argument constant.other.option","end":"(?=[\\\\t ])|(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"patterns":[{"include":"#option_context"}]},"option_context":{"patterns":[{"include":"#misc_ranges"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"parenthese":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"name":"meta.parenthese.group.shell","patterns":[{"include":"#initial_context"}]}]},"pathname":{"patterns":[{"match":"(?<=[:=\\\\s]|^)~","name":"keyword.operator.tilde.shell"},{"match":"[*?]","name":"keyword.operator.glob.shell"},{"begin":"([!*+?@])(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.extglob.shell"},"2":{"name":"punctuation.definition.extglob.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.extglob.shell"}},"name":"meta.structure.extglob.shell","patterns":[{"include":"#initial_context"}]}]},"pipeline":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(time)(?=[\\\\&;\\\\s]|$)","name":"keyword.other.shell"},{"match":"[!|]","name":"keyword.operator.pipe.shell"}]},"redirect_fix":{"captures":{"1":{"name":"keyword.operator.redirect.shell"},"2":{"name":"string.unquoted.argument.shell"}},"match":"(>>?)[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]+)"},"redirect_number":{"captures":{"1":{"name":"keyword.operator.redirect.stdout.shell"},"2":{"name":"keyword.operator.redirect.stderr.shell"},"3":{"name":"keyword.operator.redirect.$3.shell"}},"match":"(?<=[\\\\t ])(?:(1)|(2)|(\\\\d+))(?=>)"},"redirection":{"patterns":[{"begin":"[<>]\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.interpolated.process-substitution.shell","patterns":[{"include":"#initial_context"}]},{"match":"(?<![<>])(&>|\\\\d*>&\\\\d*|\\\\d*(>>|[<>])|\\\\d*<&|\\\\d*<>)(?![<>])","name":"keyword.operator.redirect.shell"}]},"regex_comparison":{"match":"=~","name":"keyword.operator.logical.regex.shell"},"regexp":{"patterns":[{"match":".+"}]},"simple_options":{"captures":{"0":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"match":"[\\\\t ]++(-)(\\\\w+)"}]}},"match":"(?:[\\\\t ]++-\\\\w+)*"},"simple_unquoted":{"match":"[^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]","name":"string.unquoted.shell"},"special_expansion":{"match":"!|:[-=?]?|[*@]|##?|%%|[%/]","name":"keyword.operator.expansion.shell"},"start_of_command":{"match":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)"},"string":{"patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.shell"},{"begin":"\\\\$?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.double.shell","patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"\\\\$'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.dollar.shell","patterns":[{"match":"\\\\\\\\['\\\\\\\\abefnrtv]","name":"constant.character.escape.ansi-c.shell"},{"match":"\\\\\\\\[0-9]{3}\\"","name":"constant.character.escape.octal.shell"},{"match":"\\\\\\\\x\\\\h{2}\\"","name":"constant.character.escape.hex.shell"},{"match":"\\\\\\\\c.\\"","name":"constant.character.escape.control-char.shell"}]}]},"subshell_dollar":{"patterns":[{"begin":"\\\\$\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"name":"meta.scope.subshell","patterns":[{"include":"#parenthese"},{"include":"#initial_context"}]}]},"support":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])[.:](?=[\\\\&;\\\\s]|$)","name":"support.function.builtin.shell"}]},"typical_statements":{"patterns":[{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#while_statement"},{"include":"#function_definition"},{"include":"#command_statement"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#normal_context"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.all.shell"},"2":{"name":"variable.parameter.positional.all.shell"}},"match":"(\\\\$)(@(?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"variable.parameter.positional.shell"}},"match":"(\\\\$)([0-9](?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.language.special.shell"},"2":{"name":"variable.language.special.shell"}},"match":"(\\\\$)([-!#$*0?_](?!\\\\w))"},{"begin":"(\\\\$)(\\\\{)[\\\\t ]*+(?=\\\\d)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"[0-9]+","name":"variable.parameter.positional.shell"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"begin":"(\\\\$)(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.other.normal.shell"},"2":{"name":"variable.other.normal.shell"}},"match":"(\\\\$)(\\\\w+(?!\\\\w))"}]},"while_statement":{"patterns":[{"begin":"\\\\b(while)\\\\b","beginCaptures":{"1":{"name":"keyword.control.while.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.while.shell","patterns":[{"include":"#line_continuation"},{"include":"#math_operators"},{"include":"#option"},{"include":"#simple_unquoted"},{"include":"#normal_context"},{"include":"#string"}]}]}},"scopeName":"source.shell","aliases":["bash","sh","shell","zsh"]}`))];export{e as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(()=>{let e=`#202B43`,t={blue:`#4D69E6`,yellow:`#E5C776`,orange:`#E38C6E`},n={claude:{kind:`pill`,fill:`#4663E7`,shade:`#354CBD`,name:`Claude Code`},opencode:{kind:`cloud`,fill:`#F4C758`,shade:`#D3A640`,name:`OpenCode`},codex:{kind:`square`,fill:`#F17858`,shade:`#CF5F43`,name:`Codex`},hermes:{kind:`dome`,fill:`#BCD4BB`,shade:`#90A599`,name:`Hermes`},pi:{kind:`round`,fill:`#B9A9DA`,shade:`#8E86B0`,name:`pi`}},r=e=>n[e]||{kind:`round`,fill:`#8FD0C8`,shade:`#64A79F`,name:``},i={square:`<rect x="12" y="14" width="76" height="74" rx="20" transform="rotate(-6 50 50)"/>`,pill:`<rect x="18" y="4" width="64" height="92" rx="32" transform="rotate(-4 50 50)"/>`,cloud:`<circle cx="50" cy="54" r="32"/><circle cx="26" cy="36" r="17"/><circle cx="50" cy="24" r="18"/><circle cx="74" cy="36" r="17"/><circle cx="80" cy="60" r="16"/><circle cx="20" cy="60" r="16"/><circle cx="34" cy="80" r="16"/><circle cx="66" cy="80" r="16"/>`,dome:`<path d="M14 94 V52 C14 32.1 30.1 16 50 16 C69.9 16 86 32.1 86 52 V94 Z"/>`,round:`<circle cx="50" cy="52" r="40"/>`},a={left:[-2.6,0],right:[2.6,0],up:[0,-3],down:[0,2.6],upleft:[-2,-2],upright:[2,-2],downleft:[-2,2],downright:[2,2]},o={neutral:`<path class="m" d="M40 66 Q50 75 60 66" fill="none" stroke="#202B43" stroke-width="2.6" stroke-linecap="round"/>`,happy:`<path class="m" d="M38 63 Q50 81 62 63 Z" fill="#202B43" stroke="#202B43" stroke-width="2.2" stroke-linejoin="round"/>`,surprised:`<ellipse class="m" cx="50" cy="69" rx="4.4" ry="5.4" fill="#202B43"/>`,open:`<ellipse class="m" cx="50" cy="68" rx="6" ry="4.6" fill="#202B43"/>`,sad:`<path class="m" d="M41 72 Q50 64 59 72" fill="none" stroke="#202B43" stroke-width="2.6" stroke-linecap="round"/>`};function s(t,{look:n,mood:s=`neutral`}={}){let c=r(t),[l,u]=a[n]||[0,0];return`<g fill="${c.shade}" transform="translate(5 5)">${i[c.kind]}</g>
|
|
2
|
+
<g fill="${c.fill}" stroke="${c.kind===`cloud`?`none`:e}" stroke-width="2.6">${i[c.kind]}</g>
|
|
3
|
+
<g class="eyes"><ellipse cx="39" cy="49" rx="8.5" ry="11" fill="#fff" stroke="${e}" stroke-width="2.2"/>
|
|
4
|
+
<ellipse cx="61" cy="49" rx="8.5" ry="11" fill="#fff" stroke="${e}" stroke-width="2.2"/>
|
|
5
|
+
<circle cx="${40+l}" cy="${52+u}" r="4.6" fill="${e}"/><circle cx="${62+l}" cy="${52+u}" r="4.6" fill="${e}"/></g>
|
|
6
|
+
<g class="mouth">${o[s]||o.neutral}</g>`}let c={open:{parts:`<ellipse cx="0" cy="-9" rx="7.6" ry="7.4"/><rect x="-2.5" y="-11" width="5" height="11.5" rx="2.5" transform="translate(-4.6 -11) rotate(-16)"/><rect x="-2.5" y="-12" width="5" height="12.5" rx="2.5" transform="translate(0 -12.5)"/><rect x="-2.5" y="-11" width="5" height="11.5" rx="2.5" transform="translate(4.6 -11) rotate(16)"/><rect x="-2.5" y="-9.5" width="5" height="10" rx="2.5" transform="translate(-6.2 -6.5) rotate(-62)"/>`,lines:``},thumb:{parts:`<rect x="-7.4" y="-16" width="14.8" height="14" rx="5"/><rect x="-6.6" y="-27" width="5.4" height="14" rx="2.7"/>`,lines:`M-0.6 -12 H5.6 M-0.6 -8 H5.6`},flat:{parts:`<rect x="-6" y="-23" width="12" height="22" rx="6"/><rect x="-2.5" y="-9" width="5" height="9.5" rx="2.5" transform="translate(-5.4 -6.5) rotate(-38)"/>`,lines:`M-2 -23 V-17 M2 -23 V-17`},fist:{parts:`<rect x="-7" y="-13" width="14" height="12.4" rx="4.8"/>`,lines:`M-2.3 -13 V-9 M2.3 -13 V-9`}};function l(t,[n,r],i,a){let o=c[t],s=2.3;return`<g transform="translate(${n} ${r}) rotate(${i}) scale(${a})" stroke-linejoin="round">
|
|
7
|
+
<g fill="${e}" stroke="${e}" stroke-width="${s*2}">${o.parts}</g><g fill="#fff">${o.parts}</g>
|
|
8
|
+
${o.lines?`<path d="${o.lines}" fill="none" stroke="${e}" stroke-width="${s*.85}" stroke-linecap="round"/>`:``}
|
|
9
|
+
<rect x="-5.6" y="-2.6" width="11.2" height="5.2" rx="2.4" fill="#fff" stroke="${e}" stroke-width="${s}"/></g>`}function u([e,t],n){let r=t=>e+n*t*1.35,i=e=>t+e*1.35;return`<path d="M${r(-6)} ${i(5.5)} C${r(-6)} ${i(-1.5)} ${r(4)} ${i(-2.5)} ${r(11)} ${i(2.5)} Q${r(12.5)} ${i(5.5)} ${r(9)} ${i(5.5)} Z"/>`}function d(t){let n=t.w/116,r=(t.rot||0)*Math.PI/180,i=Math.cos(r),a=Math.sin(r),o=(e,r)=>{let o=(e-52)*n,s=(r-52)*n;return[t.cx+o*i-s*a,t.cy+o*a+s*i]},c=``,d=``;for(let r of t.arms||[]){let i=o(...r.from),a=o(...r.via),s=r.toAbs||o(...r.to);c+=`<path d="M${i} Q${a} ${s}" fill="none" stroke="${t.limb||e}" stroke-width="${2.6*n}" stroke-linecap="round"/>`;let u=r.deg===`auto`?Math.atan2(s[0]-a[0],-(s[1]-a[1]))*180/Math.PI:r.deg+(t.rot||0);d+=l(r.hand,s,u,n*1.15*(r.size||1))}let f=(t.legs||[]).map(n=>`<path d="M${n.from} Q${(n.from[0]+n.to[0])/2+(n.bend||0)} ${(n.from[1]+n.to[1])/2} ${n.to}" fill="none" stroke="${t.limb||e}" stroke-width="2.6" stroke-linecap="round"/>`).join(``),p=(t.legs||[]).map(e=>u(e.to,e.dir)).join(``);return`${c}<g class="char" transform="translate(${t.cx} ${t.cy}) rotate(${t.rot||0}) scale(${n}) translate(-52 -52)">${f}<g fill="${t.limb||e}">${p}</g>${s(t.vendor,t)}</g>${d}`}let f=[`M218.82,166C218.82,173.79,222.39,180.74,227.98,185.32C227.05,187.91,226.4,190.64,226.08,193.48C217.06,187.66,211.09,177.53,211.09,166C211.09,147.94,225.73,133.31,243.78,133.31C261.3,133.31,275.6,147.09,276.43,164.4C273.9,163.3,271.21,162.48,268.42,161.99C266.5,150.11,256.2,141.04,243.78,141.04C230,141.04,218.82,152.21,218.82,166M240.62,198.54C240.61,198.24,240.6,197.93,240.6,197.63C240.6,195.27,240.98,193,241.69,190.87C242.38,190.92,243.08,190.95,243.78,190.95C253.76,190.95,262.37,185.09,266.36,176.63C268.96,177.16,271.38,178.16,273.54,179.53C268.4,190.83,257.01,198.69,243.78,198.69C242.72,198.69,241.67,198.64,240.63,198.54`,`M258.17,199.22C257.34,216.54,243.04,230.32,225.52,230.32C207.46,230.32,192.83,215.69,192.83,197.63C192.83,186.1,198.79,175.97,207.81,170.15C208.13,172.98,208.78,175.71,209.72,178.3C204.13,182.88,200.56,189.84,200.56,197.63C200.56,211.41,211.73,222.59,225.52,222.59C237.93,222.59,248.23,213.52,250.15,201.64C252.94,201.15,255.63,200.33,258.16,199.23M223.43,172.76C222.72,170.64,222.34,168.36,222.34,166C222.34,165.7,222.34,165.4,222.36,165.1C223.39,164.99,224.45,164.94,225.52,164.94C238.74,164.94,250.13,172.79,255.28,184.09C253.12,185.47,250.7,186.47,248.1,187C244.12,178.54,235.5,172.68,225.52,172.68C224.82,172.68,224.12,172.7,223.44,172.76`,`M237.09,197.63C237.09,202.92,238.73,207.83,241.54,211.86C239.83,213.8,237.76,215.43,235.45,216.64C231.61,211.29,229.35,204.72,229.35,197.63C229.35,190.54,231.61,183.98,235.44,178.63C237.76,179.83,239.83,181.46,241.55,183.39C238.73,187.43,237.09,192.34,237.09,197.63M253.19,174.29C251.39,172.15,249.34,170.23,247.09,168.55C251.57,166.25,256.65,164.94,262.04,164.94C280.1,164.94,294.73,179.58,294.73,197.63C294.73,215.69,280.1,230.32,262.04,230.32C256.66,230.32,251.57,229.02,247.09,226.71C249.34,225.04,251.39,223.11,253.19,220.98C255.94,222.02,258.92,222.59,262.04,222.59C275.83,222.59,287,211.41,287,197.63C287,183.85,275.83,172.68,262.04,172.68C258.93,172.68,255.94,173.25,253.19,174.29`],p=`185.197 128.504 117.165 117.165`,m=e=>`<svg viewBox="${p}" aria-hidden="true">${f.map((t,n)=>`<path d="${t}" fill="${Array.isArray(e)?e[n]:e}"/>`).join(``)}</svg>`,h=()=>m([t.blue,t.yellow,t.orange]),g={dome:new Path2D(`M14 94 V52 C14 32.1 30.1 16 50 16 C69.9 16 86 32.1 86 52 V94 Z`),neutral:new Path2D(`M40 66 Q50 75 60 66`),happy:new Path2D(`M38 63 Q50 81 62 63 Z`),flat:new Path2D(`M42 69 L58 69`),sad:new Path2D(`M41 72 Q50 64 59 72`)};function _(e,t){if(e.beginPath(),t===`square`)e.save(),e.translate(50,50),e.rotate(-6*Math.PI/180),e.roundRect(-38,-36,76,74,20),e.restore();else if(t===`pill`)e.save(),e.translate(50,50),e.rotate(-4*Math.PI/180),e.roundRect(-32,-46,64,92,32),e.restore();else if(t===`round`)e.arc(50,52,40,0,6.283);else if(t===`cloud`)for(let[t,n,r]of[[50,54,32],[26,36,17],[50,24,18],[74,36,17],[80,60,16],[20,60,16],[34,80,16],[66,80,16]])e.moveTo(t+r,n),e.arc(t,n,r,0,6.283)}function v(t,n,i,o,s,c={}){let l=r(n),u=s/116;t.save(),t.translate(i,o),t.rotate((c.rot||0)*Math.PI/180),t.scale(u,u),t.translate(-52,-52),c.alpha!=null&&(t.globalAlpha*=c.alpha);let d=e=>{t.fillStyle=e,l.kind===`dome`?t.fill(g.dome):(_(t,l.kind),t.fill())},f=c.status===`offline`;t.save(),t.translate(5,5),d(f?`#CFCABD`:l.shade),t.restore(),d(f?`#E6E1D3`:l.fill),l.kind!==`cloud`&&(t.lineWidth=2.6,t.strokeStyle=e,t.setLineDash(f?[6,5]:[]),l.kind===`dome`?t.stroke(g.dome):(_(t,l.kind),t.stroke()),t.setLineDash([]));let[p,m]=a[c.look]||[0,0];if(t.lineWidth=2.2,t.strokeStyle=e,t.lineCap=`round`,f||c.blink)t.beginPath(),t.moveTo(32,50),t.quadraticCurveTo(39,54,46,50),t.moveTo(54,50),t.quadraticCurveTo(61,54,68,50),t.lineWidth=2.6,t.stroke();else{for(let e of[39,61])t.beginPath(),t.ellipse(e,49,8.5,11,0,0,6.283),t.fillStyle=`#fff`,t.fill(),t.stroke();t.fillStyle=e;for(let e of[40,62])t.beginPath(),t.arc(e+p,52+m,4.6,0,6.283),t.fill()}t.lineWidth=2.6,t.strokeStyle=e,t.fillStyle=e;let h=f?`flat`:c.mood||`neutral`;h===`happy`?(t.fill(g.happy),t.lineJoin=`round`,t.stroke(g.happy)):h===`surprised`||h===`open`?(t.beginPath(),t.ellipse(50,69,h===`open`?6:4.4,h===`open`?4.6:5.4,0,0,6.283),t.fill()):t.stroke(h===`flat`?g.flat:h===`sad`?g.sad:g.neutral),t.restore()}window.CotalArt={NAVY:e,CREAM:`#FFFCEE`,RING:t,CHARS:n,charOf:r,SHAPES:i,body:s,hand:l,shoe:u,character:d,mark:m,markColour:h,MARK_PATHS:f,MARK_VIEWBOX:p,drawChar:v}})();
|