okengine 0.19.7 → 0.19.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/package.json +1 -1
  2. package/site/content/docs/reference/cli.mdx +15 -0
  3. package/src/cli/ask-vault-gaps.test.ts +60 -4
  4. package/src/cli/ask-vault-gaps.ts +59 -3
  5. package/src/cli/db.ts +7 -1
  6. package/src/cli/dev-app-runner.ts +12 -4
  7. package/src/cli/dev-schema-sync.ts +2 -0
  8. package/src/cli/dev.ts +60 -1
  9. package/src/cli/docker-clean.ts +6 -0
  10. package/src/console/ui-next/dist/assets/{access-page-BlgqbBeF.js → access-page-BoC83Ubl.js} +1 -1
  11. package/src/console/ui-next/dist/assets/{agent-disclosure-DRWvEi91.js → agent-disclosure-CKjAEOqA.js} +1 -1
  12. package/src/console/ui-next/dist/assets/{cache-glyph-hR_Fay0u.js → cache-glyph-Ceaq9pYh.js} +1 -1
  13. package/src/console/ui-next/dist/assets/{call-pii-button-Cg8n5s-c.js → call-pii-button-C4lmY7ck.js} +1 -1
  14. package/src/console/ui-next/dist/assets/{collapsible-BqOtz6bc.js → collapsible-82y257sL.js} +1 -1
  15. package/src/console/ui-next/dist/assets/{duration-tone-kihm6Evw.js → duration-tone-W63jaMZ8.js} +1 -1
  16. package/src/console/ui-next/dist/assets/{flows-page-BP2JDivE.js → flows-page-KFTFj2rK.js} +1 -1
  17. package/src/console/ui-next/dist/assets/{highlighted-json-BCDZafzK.js → highlighted-json-yE9zNTqC.js} +1 -1
  18. package/src/console/ui-next/dist/assets/{http-method-VL0ismmg.js → http-method-CwFeFroN.js} +1 -1
  19. package/src/console/ui-next/dist/assets/{index-MqeU3hlt.js → index-r7xXt_VV.js} +3 -3
  20. package/src/console/ui-next/dist/assets/{observability-page-Cb3Grw5m.js → observability-page-BDiliMiC.js} +1 -1
  21. package/src/console/ui-next/dist/assets/{replica-lag-D-4lXGTR.js → replica-lag-DYDzWUFT.js} +1 -1
  22. package/src/console/ui-next/dist/assets/{request-meta-DKmGNHMy.js → request-meta-CzrOfgiz.js} +1 -1
  23. package/src/console/ui-next/dist/assets/{store-page-B57gYCy_.js → store-page-CZC2cwaw.js} +1 -1
  24. package/src/console/ui-next/dist/assets/{trace-detail-sheet-wylXbVRZ.js → trace-detail-sheet-DgeeejW7.js} +1 -1
  25. package/src/console/ui-next/dist/assets/{tree-expand-toggle-BbYWf9LU.js → tree-expand-toggle-CzGIyOPY.js} +1 -1
  26. package/src/console/ui-next/dist/assets/{units-page-A1Jq2w4f.js → units-page-DBiDCLIB.js} +1 -1
  27. package/src/console/ui-next/dist/assets/{vault-page-CnOLwvLH.js → vault-page-CcHsthPe.js} +1 -1
  28. package/src/console/ui-next/dist/index.html +1 -1
  29. package/src/docker/index.ts +9 -0
  30. package/src/docker/postgres-auth.test.ts +16 -0
  31. package/src/docker/postgres-auth.ts +35 -0
  32. package/src/docker/stack-credentials-cache.test.ts +66 -0
  33. package/src/docker/stack-credentials-cache.ts +126 -0
  34. package/src/docker/stack-id.test.ts +21 -0
  35. package/src/docker/stack-id.ts +18 -4
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./react-dom-Ddte4I-Q.js";import{A as n}from"./xyflow-yApv7D4e.js";import{B as r,C as i,F as a,G as o,H as s,I as c,J as l,K as u,M as d,O as f,P as p,S as m,T as h,U as g,V as _,W as v,Y as y,_ as b,b as x,d as S,f as C,g as w,h as T,j as ee,k as te,m as E,p as D,q as O,u as k,v as A,w as j,x as ne,y as re,z as M}from"./index-MqeU3hlt.js";var N=[[`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`}]],ie=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ae=[[`path`,{d:`M8 5.5L20 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 12.5L20 12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M8 19.5L20 19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M4.375 5.5H4.25M4.5 5.5C4.5 5.63807 4.38807 5.75 4.25 5.75C4.11193 5.75 4 5.63807 4 5.5C4 5.36193 4.11193 5.25 4.25 5.25C4.38807 5.25 4.5 5.36193 4.5 5.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M4.375 12.5H4.25M4.5 12.5C4.5 12.6381 4.38807 12.75 4.25 12.75C4.11193 12.75 4 12.6381 4 12.5C4 12.3619 4.11193 12.25 4.25 12.25C4.38807 12.25 4.5 12.3619 4.5 12.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M4.375 19.5H4.25M4.5 19.5C4.5 19.6381 4.38807 19.75 4.25 19.75C4.11193 19.75 4 19.6381 4 19.5C4 19.3619 4.11193 19.25 4.25 19.25C4.38807 19.25 4.5 19.3619 4.5 19.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],oe=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function P(e,t){return M(e)?e[oe(0,e.length,t)]:e}var se=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return F(this.animations,`duration`)}get iterationDuration(){return F(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function F(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ce=class extends se{then(e,t){return this.finished.finally(e).then(()=>{})}},I=[];function le(e){g(typeof e.test==`function`&&typeof e.read==`function`,`Effects passed to animate.addEffect() need test() and read().`,`effect-missing-test`),L(e),I.unshift(e)}function L(e){o(I,e)}function ue(e){return I.find(t=>t.test(e))}function de(e,t,n,r={}){let i=[];for(let a in n){let o=n[a],s=e.get(t,a);if(!s){let n=e.read(t,a,o)??fe(o);g(n!==void 0,`"${a}" can't be read from the animated subject. Provide [from, to] keyframes.`,`effect-unreadable-value`),s=f(n),e(t,{[a]:s})}s.start(j(a,s,o,h(r,a))),s.animation&&i.push(s.animation)}return i}function fe(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function pe(e,t){return e in t}var R=class extends T{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(pe(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return b()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},z=n(),B=e(t(),1);function V(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function me(...e){return t=>{let n=!1,r=e.map(e=>{let r=V(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():V(e[t],null)}}}}function he(...e){return B.useCallback(me(...e),e)}var ge=class extends B.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(x(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=x(e)&&e.offsetWidth||0,r=x(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function _e({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,B.useId)(),s=(0,B.useRef)(null),c=(0,B.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,B.useContext)(S),u=he(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,B.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./react-dom-Ddte4I-Q.js";import{A as n}from"./xyflow-yApv7D4e.js";import{B as r,C as i,F as a,G as o,H as s,I as c,J as l,K as u,M as d,O as f,P as p,S as m,T as h,U as g,V as _,W as v,Y as y,_ as b,b as x,d as S,f as C,g as w,h as T,j as ee,k as te,m as E,p as D,q as O,u as k,v as A,w as j,x as ne,y as re,z as M}from"./index-r7xXt_VV.js";var N=[[`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`}]],ie=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ae=[[`path`,{d:`M8 5.5L20 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 12.5L20 12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M8 19.5L20 19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M4.375 5.5H4.25M4.5 5.5C4.5 5.63807 4.38807 5.75 4.25 5.75C4.11193 5.75 4 5.63807 4 5.5C4 5.36193 4.11193 5.25 4.25 5.25C4.38807 5.25 4.5 5.36193 4.5 5.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M4.375 12.5H4.25M4.5 12.5C4.5 12.6381 4.38807 12.75 4.25 12.75C4.11193 12.75 4 12.6381 4 12.5C4 12.3619 4.11193 12.25 4.25 12.25C4.38807 12.25 4.5 12.3619 4.5 12.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M4.375 19.5H4.25M4.5 19.5C4.5 19.6381 4.38807 19.75 4.25 19.75C4.11193 19.75 4 19.6381 4 19.5C4 19.3619 4.11193 19.25 4.25 19.25C4.38807 19.25 4.5 19.3619 4.5 19.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],oe=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function P(e,t){return M(e)?e[oe(0,e.length,t)]:e}var se=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return F(this.animations,`duration`)}get iterationDuration(){return F(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function F(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ce=class extends se{then(e,t){return this.finished.finally(e).then(()=>{})}},I=[];function le(e){g(typeof e.test==`function`&&typeof e.read==`function`,`Effects passed to animate.addEffect() need test() and read().`,`effect-missing-test`),L(e),I.unshift(e)}function L(e){o(I,e)}function ue(e){return I.find(t=>t.test(e))}function de(e,t,n,r={}){let i=[];for(let a in n){let o=n[a],s=e.get(t,a);if(!s){let n=e.read(t,a,o)??fe(o);g(n!==void 0,`"${a}" can't be read from the animated subject. Provide [from, to] keyframes.`,`effect-unreadable-value`),s=f(n),e(t,{[a]:s})}s.start(j(a,s,o,h(r,a))),s.animation&&i.push(s.animation)}return i}function fe(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function pe(e,t){return e in t}var R=class extends T{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(pe(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return b()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},z=n(),B=e(t(),1);function V(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function me(...e){return t=>{let n=!1,r=e.map(e=>{let r=V(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():V(e[t],null)}}}}function he(...e){return B.useCallback(me(...e),e)}var ge=class extends B.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(x(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=x(e)&&e.offsetWidth||0,r=x(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function _e({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,B.useId)(),s=(0,B.useRef)(null),c=(0,B.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,B.useContext)(S),u=he(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,B.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
2
2
  [data-motion-pop-id="${o}"] {
3
3
  position: absolute !important;
4
4
  width: ${e}px !important;
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./react-dom-Ddte4I-Q.js";import{A as n,a as r,c as i,d as a,o,p as s,r as c,s as l,t as u}from"./xyflow-yApv7D4e.js";import{Cr as d,Dr as f,E as p,Er as m,F as h,I as g,R as _,_r as v,br as y,cr as b,dr as x,ha as S,kr as C,vr as w,x as T,xr as E,yr as D}from"./shortcut-keys-3ILd8oGn.js";import{a as O,b as k,c as ee,d as te,f as ne,i as re,l as ie,n as ae,o as oe,p as se,r as ce,t as A,u as le}from"./element-icons-BI8cJgdh.js";import{s as ue}from"./collapsible-BqOtz6bc.js";import{t as de}from"./duration-tone-kihm6Evw.js";import{a as fe,c as pe,i as me,l as he,o as ge,s as _e}from"./highlighted-json-BCDZafzK.js";import{C as ve,S as ye,_ as j,b as be,d as xe,f as Se,g as M,h as Ce,p as we,v as N,y as P}from"./request-meta-DKmGNHMy.js";import{n as Te}from"./dagre.esm-B1_XeuLP.js";import{a as Ee,i as De,n as Oe,o as ke,r as Ae,t as je}from"./trace-detail-sheet-wylXbVRZ.js";import{a as Me,c as Ne,l as Pe,o as Fe,vt as Ie}from"./index-MqeU3hlt.js";import{a as Le,c as F,i as Re,n as ze,o as Be,r as Ve,t as He}from"./cache-glyph-hR_Fay0u.js";import{t as Ue}from"./agent-disclosure-DRWvEi91.js";var We=[[`path`,{d:`M4 5L20 5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M4 12L20 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M4 19L20 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],I=e(t(),1),L=[`flow`,`signal`,`store`,`clock`,`gate`,`vault`,`channel`,`ai`];function R(e,t,n){return{x:j.cx+t*Math.cos(e)-n.width/2,y:j.cy+t*Math.sin(e)-n.height/2}}function Ge(e){if(e<=0)return[];let t=2*Math.PI/e;return Array.from({length:e},(e,n)=>-Math.PI/2+n*t)}var Ke=2*Math.PI/L.length;function z(e,t,n=j.typeRing){if(t<=0)return[];if(t===1)return[e];let r=(N.type.width+10)/n,i=Math.min(r*(t-1),Ke*.7);return Array.from({length:t},(n,r)=>e-i/2+r/(t-1)*i)}function qe(e,t){if(t<=0)return[];let n=j.typeRing,r=j.typeRing+j.typeRow;if(t===1)return[{angle:e,radius:n}];if(t===4)return Ye(e,n,r);if(t<=3)return z(e,t,n).map(e=>({angle:e,radius:n}));let i=Math.ceil(t/2),a=t-i;return[...z(e,i,n).map(e=>({angle:e,radius:n})),...z(e,a,r).map(e=>({angle:e,radius:r}))]}function Je(e){return Math.abs(Math.cos(e))*N.type.height+Math.abs(Math.sin(e))*N.type.width}function Ye(e,t,n){let r=(Je(e)+24)/t;return[{angle:e-r/2,radius:t},{angle:e+r/2,radius:t},{angle:e-r/2,radius:n},{angle:e+r/2,radius:n}]}function B(e){let t=new Set([`flow`]),n=e.trigger;(n?.cron||n?.every)&&t.add(`clock`),n?.signal&&t.add(`signal`),(e.gates?.length??0)>0&&t.add(`gate`);let r=e.effects;return((r?.reads?.length??0)>0||(r?.writes?.length??0)>0)&&t.add(`store`),(r?.emits?.length??0)>0&&t.add(`signal`),(r?.sends?.length??0)>0&&t.add(`channel`),(r?.asks?.length??0)>0&&t.add(`ai`),(r?.secrets?.length??0)>0&&t.add(`vault`),L.filter(e=>t.has(e))}function Xe(e){let t=new Set([`flow`]);(e.trigger===`cron`||e.trigger===`every`)&&t.add(`clock`),e.trigger===`signal`&&t.add(`signal`),e.gates.length>0&&t.add(`gate`);for(let n of e.effects)switch(n.kind){case`read`:case`write`:t.add(`store`);break;case`emit`:t.add(`signal`);break;case`send`:case`fetch`:t.add(`channel`);break;case`ask`:case`embed`:t.add(`ai`);break;case`secret`:t.add(`vault`)}return L.filter(e=>t.has(e))}function Ze(e,t){let n=new Map,r=(e,t,r)=>{n.has(e)||n.set(e,r===void 0?{id:e,label:t}:{id:e,label:t,badge:r})};switch(t){case`flow`:for(let t of Object.keys(e.flows??{}).sort())r(`flow:${t}`,Ve(t),F(t));break;case`signal`:for(let t of Object.keys(e.signals??{}).sort())r(`signal:${t}`,t,`signal`);for(let t of Object.values(e.flows??{})){t.trigger?.signal&&r(`signal:${t.trigger.signal}`,t.trigger.signal,`signal`);for(let e of t.effects?.emits??[])r(`signal:${e}`,e,`signal`)}break;case`store`:for(let[t,n]of Object.entries(e.stores??{})){let e=n.facet;for(let t of Object.keys(n.tables??{}).sort())r(`${e}:${t}`,t,e);let i=n.namespaces&&n.namespaces.length>0?n.namespaces:[];e===`kv`&&i.length===0&&r(`kv:${t}`,t,`kv`);for(let e of[...i].sort())r(`kv:${e}`,e,`kv`);for(let e of[...n.buckets??[]].sort())r(`files:${e}`,e,`files`);for(let e of[...n.indexes??[]].sort())r(`index:${e}`,e,`index`)}for(let t of Object.values(e.flows??{}))for(let e of[...t.effects?.reads??[],...t.effects?.writes??[]]){let t=Qe(e);t&&r(t.id,t.label,t.badge)}break;case`clock`:for(let[t,n]of Object.entries(e.clocks??{}).sort(([e],[t])=>e.localeCompare(t)))r(`clock:${t}`,t,n.cron?`cron`:n.every?`every`:`clock`);for(let[t,n]of Object.entries(e.flows??{}))n.trigger?.cron&&r(`clock:${t}`,n.trigger.cron,`cron`),n.trigger?.every&&r(`clock:${t}`,n.trigger.every,`every`);break;case`gate`:for(let t of Object.keys(e.gates??{}).sort())r(`gate:${t}`,t,`gate`);for(let t of Object.values(e.flows??{}))for(let e of t.gates??[])r(`gate:${e}`,e,`gate`);break;case`vault`:for(let t of Object.keys(e.vault??{}).sort())r(`vault:${t}`,t,`vault`);for(let t of Object.values(e.flows??{}))for(let e of t.effects?.secrets??[])r(`vault:${e}`,e,`vault`);break;case`channel`:for(let t of Object.keys(e.channels??{}).sort())r(`channel:${t}`,t,`channel`);for(let t of Object.values(e.flows??{}))for(let e of t.effects?.sends??[])r(`channel:${e}`,e,`channel`);break;case`ai`:for(let t of Object.keys(e.ai?.prompts??{}).sort())r(`ai:${t}`,t,`prompt`);for(let t of Object.keys(e.ai?.agents??{}).sort())r(`ai:${t}`,t,`agent`);for(let t of Object.values(e.flows??{}))for(let e of t.effects?.asks??[])r(`ai:${e}`,e,`prompt`)}return[...n.values()].sort((e,t)=>e.label.localeCompare(t.label))}function Qe(e){return e.startsWith(`sql:`)?{id:e,label:e.slice(4),badge:`sql`}:e.startsWith(`kv:`)?{id:e,label:e.slice(3),badge:`kv`}:e.startsWith(`files:`)?{id:e,label:e.slice(6),badge:`files`}:e.startsWith(`index:`)?{id:e,label:e.slice(6),badge:`index`}:null}var $e={flow:xe.map(e=>({kind:e,label:Se[e].label})),signal:[{kind:`once`,label:`once`},{kind:`broadcast`,label:`broadcast`},{kind:`live`,label:`live`}],store:[{kind:`sql`,label:`SQL`},{kind:`kv`,label:`KV`},{kind:`files`,label:`Files`},{kind:`index`,label:`Index`}],clock:[{kind:`cron`,label:`cron`},{kind:`every`,label:`every`}],gate:[{kind:`policy`,label:`policy`},{kind:`scope`,label:`scope`},{kind:`rate`,label:`rate`},{kind:`public`,label:`public`}],vault:[{kind:`secret`,label:`secret`},{kind:`config`,label:`config`},{kind:`env`,label:`env`}],channel:[{kind:`email`,label:`email`},{kind:`sms`,label:`SMS`},{kind:`whatsapp`,label:`WA`},{kind:`push`,label:`Push`}],ai:[{kind:`model`,label:`model`},{kind:`prompt`,label:`prompt`},{kind:`embed`,label:`embed`},{kind:`agent`,label:`agent`}]};function et(e,t){return $e[t].map(e=>({id:`type:${t}:${e.kind}`,label:e.label,badge:e.kind}))}function tt(e,t){return t?.kind===`rate`||e.startsWith(`rate:`)?`rate`:e===`public`?`public`:(t?.scopes?.length??0)>0?`scope`:`policy`}function nt(e){return e?.sensitive===!1?`config`:`secret`}function rt(e,t){let n=t.split(`@`)[0]??t;return e.ai?.agents?.[n]?`agent`:e.ai?.models?.[n]?`model`:`prompt`}function it(e,t,n){let r=`type:${n}:`;switch(n){case`flow`:return[`${r}${we(t.trigger)}`];case`store`:{let e=new Set;for(let n of[...t.effects?.reads??[],...t.effects?.writes??[]]){let t=Qe(n);t?.badge&&e.add(t.badge)}return[...e].map(e=>`${r}${e}`)}case`signal`:{let n=[...t.trigger?.signal?[t.trigger.signal]:[],...t.effects?.emits??[]],i=new Set;for(let t of n){let n=e.signals?.[t]?.delivery;n&&i.add(n)}return[...i].map(e=>`${r}${e}`)}case`clock`:{let e=[];return t.trigger?.cron&&e.push(`${r}cron`),t.trigger?.every&&e.push(`${r}every`),e}case`gate`:return[...new Set((t.gates??[]).map(t=>tt(t,e.gates?.[t])))].map(e=>`${r}${e}`);case`vault`:return[...new Set((t.effects?.secrets??[]).map(t=>nt(e.vault?.[t])))].map(e=>`${r}${e}`);case`channel`:{let n=new Set;for(let r of t.effects?.sends??[]){let t=e.channels?.[r]?.medium;t&&t!==`any`&&n.add(t)}return[...n].map(e=>`${r}${e}`)}case`ai`:return[...new Set((t.effects?.asks??[]).map(t=>rt(e,t)))].map(e=>`${r}${e}`)}}function at(e){let t=e?.flows??{},n=new Map;for(let e of Object.keys(t).sort()){let t=F(e),r=n.get(t)??[];r.push(e),n.set(t,r)}let r=new Map,i=new Map,a=new Map;for(let[e,o]of n){let n=new Set;for(let i of o){let o=t[i];if(o)for(let t of B(o)){n.add(t);let o=`${e}\0${t}`;r.set(o,(r.get(o)??0)+1);let s=a.get(t)??new Set;s.add(i),a.set(t,s)}}i.set(e,n)}let o=[...n.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({unit:e,flowCount:t.length,elements:L.filter(t=>i.get(e)?.has(t)),live:0,errors:0})),s=L.map(t=>({element:t,resourceCount:e?Ze(e,t).length:0,flowCount:a.get(t)?.size??0,live:0,errors:0})),c=[];for(let e of o)for(let t of e.elements)c.push({unit:e.unit,element:t,flowCount:r.get(`${e.unit}\0${t}`)??0});return{units:o,hubs:s,couplings:c}}function ot(e,t){let n=new Map,r=new Map,i=new Map,a=new Map;for(let e of t){let t=e.unit??F(e.flow);n.set(t,(n.get(t)??0)+1),e.error&&r.set(t,(r.get(t)??0)+1);for(let t of Xe(e))i.set(t,(i.get(t)??0)+1),e.error&&a.set(t,(a.get(t)??0)+1)}return{couplings:e.couplings,units:e.units.map(e=>({...e,live:n.get(e.unit)??0,errors:r.get(e.unit)??0})),hubs:e.hubs.map(e=>({...e,live:i.get(e.element)??0,errors:a.get(e.element)??0}))}}function st(e,t=[],n=null){if(!e||Object.keys(e.flows??{}).length===0)return{nodes:[],edges:[],units:[],hubs:[]};let r=ot(at(e),t),i=n?.element,a=r.hubs.find(e=>e.element===`flow`)?.live??0,o=r.hubs.find(e=>e.element===`flow`)?.errors??0,s=[],c=[];s.push(V(`orbit:elements`,j.elementRing)),s.push(V(`orbit:types`,j.typeRing)),s.push(V(`orbit:spokes`,j.spokeRing)),s.push({id:`law:oke`,type:`law`,position:{x:j.cx-N.law.width/2,y:j.cy-N.law.height/2},data:{kind:`law`,label:e.app,refId:`oke`,badge:String(r.units.reduce((e,t)=>e+t.flowCount,0)),live:a,errors:o},selectable:!1,draggable:!1,zIndex:M.leaf,width:N.law.width,height:N.law.height,style:{width:N.law.width,height:N.law.height,overflow:`visible`}});let l=Ge(L.length);if(r.hubs.forEach((e,t)=>{let n=l[t]??0,r=N.hub;s.push({id:`element:${e.element}`,type:`element`,position:R(n,j.elementRing,r),data:{kind:`element`,label:A[e.element].symbol,refId:e.element,badge:String(e.resourceCount),live:e.live,errors:e.errors,dimmed:i!=null&&e.element!==i},draggable:!1,zIndex:M.leaf,width:r.width,height:r.height,style:{width:r.width,height:r.height}}),c.push(U(`element:${e.element}`,`law:oke`,e.element,1,!0))}),!i||i===`flow`){let t=N.type;r.hubs.forEach((n,r)=>{let i=l[r]??0,a=et(e,n.element),o=qe(i,a.length);a.forEach((e,r)=>{let a=o[r]??{angle:i,radius:j.typeRing};s.push({id:e.id,type:`typeChip`,position:R(a.angle,a.radius,t),data:{kind:n.element,label:e.label,refId:e.id,...e.badge===void 0?{}:{badge:e.badge,facet:e.badge}},draggable:!1,zIndex:M.leaf,width:t.width,height:t.height,style:{width:t.width,height:t.height}}),c.push(U(e.id,`element:${n.element}`,n.element,1))})})}if(i&&i!==`flow`){let t=Ze(e,i),n=be.store,r=Ge(t.length);t.forEach((e,t)=>{let a=r[t]??0;s.push({id:e.id,type:i,position:R(a,j.spokeRing,n),data:{kind:i,label:e.label,refId:e.id,...e.badge===void 0?{}:{badge:e.badge,facet:e.badge}},draggable:!1,zIndex:M.leaf,width:n.width,height:n.height,style:{width:n.width,height:n.height}}),c.push(U(e.id,`element:${i}`,i,1))})}else{let t=N.unit,n=Ge(r.units.length);r.units.forEach((e,r)=>{let i=n[r]??0;s.push({id:`unit:${e.unit}`,type:`unitChip`,position:R(i,j.spokeRing,t),data:{kind:`unit`,label:e.unit,refId:e.unit,badge:String(e.flowCount),elements:e.elements.filter(e=>e!==`flow`),live:e.live,errors:e.errors},draggable:!1,zIndex:M.leaf,width:t.width,height:t.height,style:{width:t.width,height:t.height}})});let a=new Map;for(let t of Object.keys(e.flows??{}).sort()){let e=F(t),n=a.get(e)??[];n.push(t),a.set(e,n)}for(let t of r.units){let n=new Map,r=new Set;for(let o of a.get(t.unit)??[]){let t=e.flows?.[o];if(t)for(let a of B(t)){if(i===`flow`&&a!==`flow`)continue;let o=it(e,t,a);o.length===0&&r.add(a);for(let e of o)n.set(e,(n.get(e)??0)+1)}}for(let[e,r]of n){let n=e.slice(5).split(`:`)[0];n&&n in P&&c.push(U(`unit:${t.unit}`,e,n,r))}for(let e of r)c.push(U(`unit:${t.unit}`,`element:${e}`,e,1))}}return{nodes:s,edges:c,units:r.units,hubs:r.hubs}}function V(e,t){let n=t*2;return{id:e,type:`orbit`,position:{x:j.cx-t,y:j.cy-t},data:{kind:`law`,label:``,refId:e},selectable:!1,draggable:!1,zIndex:M.edge,width:n,height:n,style:{width:n,height:n}}}function ct(e,t){return t===`law:oke`?`trunk`:e.startsWith(`type:`)&&t.startsWith(`element:`)?`bind`:`spoke`}function H(e){return e===`trunk`?.14:e===`bind`?.2:0}function U(e,t,n,r,i=!1){let a=i?`trunk`:ct(e,t),o=a===`trunk`?1.15:1+Math.min(1.25,Math.log2(1+r)*.45);return{id:`couple:${e}->${t}`,source:e,target:t,sourceHandle:`center`,targetHandle:`center`,type:`straight`,data:{kind:`couple`},style:{stroke:Ce.couple,strokeWidth:o,opacity:H(a)},zIndex:M.edge}}function lt(e){if(e.startsWith(`element:`)){let t=e.slice(8);return t in P?t:null}if(e.startsWith(`type:`)){let t=e.slice(5).split(`:`)[0];return t&&t in P?t:null}return null}function ut(e,t){for(let n of[t,e]){let e=lt(n);if(e)return P[e].accent}return Ce.couple}function dt(e,t){let n=new Set,r=new Set,i=(e,t)=>{r.add(`couple:${e}->${t}`)};if(!e)return{nodeIds:n,edgeIds:r};for(let r of t){let t=e.flows?.[r];if(!t)continue;let a=`unit:${F(r)}`;n.add(a);for(let r of B(t)){let o=`element:${r}`;n.add(o),n.add(`law:oke`),i(o,`law:oke`);let s=it(e,t,r);s.length===0&&i(a,o);for(let e of s)n.add(e),i(a,e),i(e,o)}}return{nodeIds:n,edgeIds:r}}function ft(e,t,n={}){let r=n.hoverNodeId??null,i=n.highlightedFlowIds??new Set,a=n.highlightedNodeIds??new Set,o=dt(n.manifest,i),s=o.nodeIds.size>0||a.size>0,c=r!=null,l=r==null?null:pt(r,t);return{nodes:e.map(e=>{if(e.type===`orbit`)return{...e,data:{...e.data,highlighted:!1,dimmed:!1}};let t=o.nodeIds.has(e.id)||a.has(e.id)||i.has(e.data.refId),n=l?.has(e.id)===!0;return{...e,data:{...e.data,highlighted:t||c&&e.id===r,dimmed:e.id===`law:oke`?!1:s&&!t||c&&!n}}}),edges:t.map(e=>{let t=l!=null&&l.has(e.source)&&l.has(e.target),n=s&&o.edgeIds.has(e.id),r=c?t:n,i=ct(e.source,e.target),a=c||s?r?1:H(i)*.35:H(i);return{...e,animated:r,style:{...e.style,stroke:r?ut(e.source,e.target):Ce.couple,opacity:a,strokeWidth:r?2.25:e.style?.strokeWidth}}})}}function W(e,t){let n=[];for(let r of e)r.source===t?n.push(r.target):r.target===t&&n.push(r.source);return n}function pt(e,t){let n=new Set([e]),r=e=>n.add(e);if(e.startsWith(`unit:`)){for(let n of W(t,e)){if(r(n),n.startsWith(`type:`)){for(let e of W(t,n))if(e.startsWith(`element:`)){r(e);for(let n of W(t,e))n===`law:oke`&&r(n)}}if(n.startsWith(`element:`))for(let e of W(t,n))e===`law:oke`&&r(e)}return n}if(e.startsWith(`type:`)){for(let n of W(t,e))r(n);let i=[...n].find(e=>e.startsWith(`element:`));if(i)for(let e of W(t,i))e===`law:oke`&&r(e);return n}if(e.startsWith(`element:`)||e===`law:oke`)for(let n of W(t,e))r(n);return n}var G=n(),mt={flow:A.flow.icon,signal:A.signal.icon,store:A.store.icon,clock:A.clock.icon,gate:A.gate.icon,vault:A.vault.icon,channel:A.channel.icon,ai:A.ai.icon},ht={flow:`rounded-xl`,store:`rounded-md`,signal:`rounded-full`,clock:`rounded-lg`,gate:`rounded-md`,vault:`rounded-md`,channel:`rounded-xl`,ai:`rounded-2xl`};function K(e,t){return m(`group relative flex h-full w-full items-center gap-2.5 border-2 px-2.5 text-xs transition-[opacity,filter,box-shadow,border-color] duration-200`,ht[t],e.dimmed&&`opacity-30 saturate-[0.35]`,e.highlighted&&`z-10`,e.focused&&`z-10`)}function q(e,t){let n=P[e],r=`color-mix(in oklab, ${n.accent} 20%, var(--card))`;return t.highlighted||t.focused?{borderColor:n.accent,background:`color-mix(in oklab, ${n.accent} 26%, var(--card))`,boxShadow:`0 0 0 1px ${n.accent}, 0 0 22px ${n.glow}`}:{borderColor:`color-mix(in oklab, ${n.accent} 78%, var(--border))`,background:r,boxShadow:`inset 3px 0 0 ${n.accent}`}}function J({data:e,kind:t,className:n,style:r,children:i,...a}){let o=Pe(),s=P[t];return(0,G.jsx)(Ne.div,{className:n,style:r,initial:!1,whileHover:o?void 0:{scale:1.04},whileTap:o?void 0:{scale:.97},animate:{scale:o?1:e.active?[1,1.08,1]:e.highlighted?1.02:1,boxShadow:e.active?`0 0 0 2px ${s.accent}, 0 0 30px ${s.glow}`:void 0},transition:e.active?{duration:.5,ease:`easeInOut`}:{type:`spring`,stiffness:400,damping:28},...a,children:i})}function gt({kind:e,size:t=`sm`}){let n=P[e];return(0,G.jsx)(`span`,{className:m(`flex shrink-0 items-center justify-center border`,t===`md`?`size-9`:`size-7`,e===`signal`?`rounded-full`:e===`store`||e===`gate`||e===`vault`?`rounded-md`:`rounded-full`),style:{color:n.accent,background:n.well,borderColor:`color-mix(in oklab, ${n.accent} 55%, transparent)`},"aria-hidden":!0,children:(0,G.jsx)(f,{icon:mt[e],size:t===`md`?17:15,strokeWidth:1.9})})}function _t({text:e}){return(0,G.jsx)(`span`,{className:`rounded border border-border/70 bg-background/50 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.16em] text-muted-foreground`,children:e})}function vt({type:e,kind:t}){let n=P[t];return(0,G.jsx)(r,{type:e,position:e===`source`?s.Right:s.Left,className:`!size-2 !border-0`,style:{background:n.accent}})}function Y({type:e}){return(0,G.jsx)(r,{id:`center`,type:e,position:e===`source`?s.Right:s.Left,isConnectable:!1,className:`oke-center-handle !top-1/2 !left-1/2 !size-px !-translate-x-1/2 !-translate-y-1/2 !border-0 !bg-transparent !opacity-0`})}function yt({live:e,errors:t}){return e<=0?null:(0,G.jsx)(`span`,{className:m(`size-2 shrink-0 rounded-full`,t>0?`bg-rose-400`:`bg-emerald-400`,e>0&&`animate-pulse`),title:t>0?`${e} live · ${t} failed`:`${e} live`})}function bt({elements:e}){return e.length===0?null:(0,G.jsx)(`span`,{className:`mt-0.5 flex items-center gap-1`,"aria-hidden":!0,children:e.map(e=>(0,G.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:P[e].accent},title:A[e].label},e))})}function xt({data:e}){return(0,G.jsx)(`div`,{className:`h-full w-full rounded-xl border border-dashed border-foreground/25 bg-muted/35 px-3 pt-1.5`,children:(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:e.label}),e.badge?(0,G.jsx)(_t,{text:e.badge}):null]})})}function St({data:e}){let t=e.kind in P?e.kind:`flow`;return(0,G.jsxs)(J,{data:e,kind:t,className:m(K(e,t),`justify-center gap-0 rounded-full px-2`),style:q(t,e),"data-slot":`type-chip`,"data-type":e.refId,children:[(0,G.jsx)(Y,{type:`source`}),(0,G.jsx)(Y,{type:`target`}),(0,G.jsx)(`div`,{className:`min-w-0 truncate text-center text-[10px] leading-none font-medium tracking-wide text-foreground`,children:e.label})]})}function Ct({data:e}){return(0,G.jsxs)(J,{data:e,kind:`flow`,className:m(K(e,`flow`),`rounded-full px-2.5`),style:q(`flow`,e),"data-slot":`unit-chip`,"data-unit":e.refId,children:[(0,G.jsx)(Y,{type:`source`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`div`,{className:`truncate font-medium tracking-wide text-foreground uppercase`,children:e.label}),(0,G.jsx)(yt,{live:e.live??0,errors:e.errors??0})]}),(0,G.jsx)(bt,{elements:e.elements??[]})]}),e.badge?(0,G.jsx)(_t,{text:e.badge}):null]})}function wt({data:e}){let t=Ot(e.refId)??`flow`,n=P[t];return(0,G.jsxs)(J,{data:e,kind:t,className:m(K(e,t),`flex-col justify-center gap-0.5 rounded-full px-1.5 text-center`),style:{...q(t,e),boxShadow:e.highlighted?`0 0 0 1px ${n.accent}, 0 0 22px ${n.glow}`:`0 0 0 1px color-mix(in oklab, ${n.accent} 55%, transparent)`},"data-slot":`element-hub`,"data-element":t,children:[(0,G.jsx)(Y,{type:`target`}),(0,G.jsx)(Y,{type:`source`}),(0,G.jsx)(`span`,{className:`text-[18px] font-semibold tracking-tight text-foreground`,title:A[t].label,children:e.label})]})}function Tt(e){return e>=40?1.05:e>=12?1.55:2.2}function Et({data:e}){let t=Pe(),n=e.live??0,r=e.errors??0,[i,a]=(0,I.useState)(0),o=(0,I.useRef)(n);(0,I.useEffect)(()=>{n>o.current&&a(e=>e+1),o.current=n},[n]);let s=n>0,c=Tt(n),l=r>0?`var(--color-rose-400)`:`var(--foreground)`;return(0,G.jsxs)(`div`,{className:m(`relative flex h-full w-full items-center justify-center overflow-visible`,e.highlighted&&`z-10`),"data-slot":`law-hub`,"data-live":n,children:[(0,G.jsx)(Y,{type:`target`}),!t&&s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:`oke-law-ripple`,style:{animationDuration:`${c}s`,color:l}}),(0,G.jsx)(`span`,{"aria-hidden":!0,className:`oke-law-ripple`,style:{animationDuration:`${c}s`,animationDelay:`${c/2}s`,color:l}})]}):null,i>0&&!t?(0,G.jsx)(`span`,{"aria-hidden":!0,className:`oke-law-hit`,style:{color:l}},i):null,(0,G.jsx)(Ne.div,{className:`flex h-full w-full items-center justify-center rounded-full border-4 bg-card px-4 text-center`,style:{borderColor:`color-mix(in oklab, var(--foreground) 82%, var(--border))`,boxShadow:e.highlighted?`0 0 0 1px ${l}, 0 0 36px color-mix(in oklab, ${l} 28%, transparent)`:`inset 0 0 28px color-mix(in oklab, var(--foreground) 7%, transparent), 0 0 22px color-mix(in oklab, ${l} ${s?16:6}%, transparent)`},animate:t||!s?{scale:1}:{scale:[1,1.045,1]},transition:t||!s?{duration:0}:{duration:c,repeat:1/0,ease:`easeInOut`},children:(0,G.jsx)(Me,{className:`h-7 w-auto text-foreground`})})]})}function Dt(){return(0,G.jsx)(`div`,{className:`pointer-events-none h-full w-full rounded-full border border-dashed border-foreground/15`,"data-slot":`orbit`})}function Ot(e){return e in P?e:null}function X({data:e,kind:t,slot:n}){return(0,G.jsxs)(J,{data:e,kind:t,className:K(e,t),style:q(t,e),"data-slot":n,"data-flow-id":t===`flow`?e.refId:void 0,"data-highlighted":e.highlighted?`true`:`false`,children:[(0,G.jsx)(vt,{type:`target`,kind:t}),(0,G.jsx)(Y,{type:`source`}),(0,G.jsx)(gt,{kind:t}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 flex items-center gap-1.5`,children:(0,G.jsx)(_t,{text:e.badge??e.plane??e.facet??t})})]}),t===`flow`||t===`signal`?(0,G.jsx)(vt,{type:`source`,kind:t}):null]})}function kt({data:e}){return(0,G.jsx)(X,{data:e,kind:`flow`,slot:`flow-node`})}function At({data:e}){return(0,G.jsx)(X,{data:e,kind:`store`,slot:`store-node`})}function jt({data:e}){return(0,G.jsx)(X,{data:e,kind:`signal`,slot:`signal-node`})}function Mt({data:e}){return(0,G.jsx)(X,{data:e,kind:`ai`,slot:`ai-node`})}function Nt({data:e}){return(0,G.jsx)(X,{data:e,kind:`clock`,slot:`clock-node`})}function Pt({data:e}){return(0,G.jsx)(X,{data:e,kind:`gate`,slot:`gate-node`})}function Ft({data:e}){return(0,G.jsx)(X,{data:e,kind:`vault`,slot:`vault-node`})}function It({data:e}){return(0,G.jsx)(X,{data:e,kind:`channel`,slot:`channel-node`})}var Lt={unit:xt,unitChip:Ct,typeChip:St,element:wt,law:Et,orbit:Dt,flow:kt,store:At,signal:jt,ai:Mt,clock:Nt,gate:Pt,vault:Ft,channel:It};function Rt(e,t){let n=e.flows??{},r=new Set;if(t.kind===`unit`){for(let e of Object.keys(n))F(e)===t.unit&&r.add(e);let e=[];for(let t of r)for(let r of n[t]?.effects?.calls??[])ve(r)||e.push(r);for(let t of e)r.add(t)}else if(t.kind===`flow`){r.add(t.flowId);let e=n[t.flowId];for(let t of e?.effects?.calls??[])ve(t)||r.add(t);for(let[e,i]of Object.entries(n))i.effects?.calls?.includes(t.flowId)&&r.add(e)}else for(let[e,i]of Object.entries(n))zt(i,e,t.nodeId)&&r.add(e);let i={};for(let e of r){let t=n[e];t&&(i[e]=t)}return{...e,flows:i}}function zt(e,t,n){if(n===`flow:${t}`||n===`clock:${t}`&&(e.trigger?.cron||e.trigger?.every)||e.trigger?.signal&&n===`signal:${e.trigger.signal}`||e.gates?.some(e=>n===`gate:${e}`))return!0;let r=e.effects;return r?!!(r.reads?.some(e=>e===n)||r.writes?.some(e=>e===n)||r.emits?.some(e=>n===`signal:${e}`)||r.sends?.some(e=>n===`channel:${e}`)||r.asks?.some(e=>n===`ai:${e}`)||r.secrets?.some(e=>n===`vault:${e}`)||r.calls?.some(e=>{let t=ve(e);return t?n===ye(t.server):n===`flow:${e}`})):!1}var Bt=[`!=`,`>=`,`<=`,`=`,`>`,`<`],Vt={clauses:[]},Ht=[`flow`,`unit`,`trigger`,`plane`,`tenant`,`principal`,`cache`,`replica`,`error`,`buildVersion`,`promptVersion`,`duration`];function Ut(e){if(!e||!e.trim())return Vt;let t=e.split(/\s+AND\s+/i).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){let t=en(e);t&&n.push(t)}return{clauses:n}}function Z(e,t){return{clauses:[...e.clauses.filter(e=>e.dimension!==t.dimension),t]}}function Wt(e,t){return{clauses:e.clauses.filter(e=>e.dimension!==t)}}function Gt(e,t){return e.dimension===t.dimension&&e.op===t.op&&e.value===t.value}function Kt(e,t){return e.clauses.some(e=>Gt(e,t))}function qt(e,t){return Kt(e,t)?Wt(e,t.dimension):Z(e,t)}function Jt(e){let t=rn(e.dimension,e.value);return`${e.dimension} ${e.op} ${t}`}function Yt(e,t){for(let n of t.clauses)if(!an(e,n))return!1;return!0}function Xt(e,t){return t.clauses.length===0?[...e]:e.filter(e=>Yt(e,t))}function Zt(e){let t=/^(-?\d+(?:\.\d+)?)\s*(ms|s|m)?$/i.exec(e.trim());if(!t)return;let n=Number(t[1]),r=(t[2]??`ms`).toLowerCase();if(r===`ms`)return n;if(r===`s`)return n*1e3;if(r===`m`)return n*6e4}function Qt(e,t){switch(t){case`flow`:return e.flow;case`unit`:return e.unit??null;case`trigger`:return e.trigger;case`plane`:return e.plane;case`tenant`:return e.tenant??null;case`principal`:return e.principal??null;case`cache`:return e.cache;case`replica`:return e.replica??null;case`replicaLagMs`:case`replica_lag_ms`:return e.replicaLagMs??null;case`error`:case`error_code`:return e.error??null;case`buildVersion`:case`build_version`:return e.buildVersion??null;case`promptVersion`:case`prompt_version`:return e.promptVersion??null;case`cost`:return e.cost??null;case`duration`:case`duration_ms`:return e.durationMs;case`gates`:return e.gates.join(`,`);default:return e.dimensions[t]}}function $t(e){let t=new Set(Ht);for(let n of e)for(let e of Object.keys(n.dimensions))t.add(e);return[...t].sort()}function en(e){let t=null,n=-1;for(let r of Bt){let i=e.indexOf(` ${r} `);if(i!==-1){t=r,n=i;break}}if(t===null||n<0)return null;let r=e.slice(0,n).trim(),i=e.slice(n+t.length+2).trim();if(!r||!i)return null;let a=tn(r,i);return a===void 0?null:{dimension:r,op:t,value:a}}function tn(e,t){return e===`duration`||e===`duration_ms`?Zt(t):t===`true`?!0:t===`false`?!1:t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):/^-?\d+(\.\d+)?$/.test(t)?Number(t):t}function nn(e,t){return rn(e,t)}function rn(e,t){if(e===`duration`||e===`duration_ms`){let e=typeof t==`number`?t:Number(t);return Number.isFinite(e)?e>=6e4&&e%6e4==0?`${e/6e4}m`:e>=1e3&&e%1e3==0?`${e/1e3}s`:`${e}ms`:String(t)}return typeof t==`string`&&/\s/.test(t)?`"${t}"`:String(t)}function an(e,t){let n=Qt(e,t.dimension);if(n==null)return t.op===`!=`;let r=t.value;if(t.op===`=`)return on(n,r);if(t.op===`!=`)return!on(n,r);let i=Q(n),a=Q(r);return i===void 0||a===void 0?!1:t.op===`>`?i>a:t.op===`<`?i<a:t.op===`>=`?i>=a:t.op===`<=`&&i<=a}function on(e,t){if(typeof e==`number`||typeof t==`number`){let n=Q(e),r=Q(t);if(n!==void 0&&r!==void 0)return n===r}return String(e)===String(t)}function Q(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`boolean`)return;let t=Number(e);return Number.isFinite(t)?t:void 0}var sn=new Set(Object.keys(A));function cn(e){if(e.startsWith(`flow:`))return{kind:`flow`,flowId:e.slice(5)};if(e.startsWith(`signal:`))return{kind:`signal`,signal:e.slice(7)};if(e.startsWith(`unit:`))return{kind:`unit`,unit:e.slice(5)};if(e.startsWith(`element:`)){let t=e.slice(8);return sn.has(t)?{kind:`element`,element:t}:null}if(e.startsWith(`type:`)){let t=e.slice(5).split(`:`)[0];return t&&sn.has(t)?{kind:`element`,element:t}:null}return e.startsWith(`sql:`)||e.startsWith(`kv:`)||e.startsWith(`files:`)||e.startsWith(`index:`)||e.startsWith(`vault:`)||e.startsWith(`channel:`)||e.startsWith(`gate:`)||e.startsWith(`clock:`)||e.startsWith(`ai:`)?{kind:`resource`,nodeId:e}:null}function ln(e){switch(e.kind){case`flow`:return e.flowId;case`signal`:return`signal:${e.signal}`;case`unit`:return e.unit;case`element`:return A[e.element].label;case`resource`:return e.nodeId}}function un(e,t){return t?.kind===`flow`?Z(e,{dimension:`flow`,op:`=`,value:t.flowId}):t?.kind===`unit`?Z(e,{dimension:`unit`,op:`=`,value:t.unit}):e}function dn(e,t,n){if(t.kind===`flow`)return Yt(e,{clauses:[{dimension:`flow`,op:`=`,value:t.flowId}]});if(t.kind===`unit`)return(e.unit??F(e.flow))===t.unit;if(t.kind===`element`)return t.element===`flow`||Xe(e).includes(t.element);if(t.kind===`resource`)return fn(e,t.nodeId,n);let r=n?.flows??{};for(let[n,i]of Object.entries(r))if(n===e.flow&&(i.trigger?.signal===t.signal||i.effects?.emits?.includes(t.signal)))return!0;return!1}function fn(e,t,n){let r=t.includes(`:`)?t.slice(t.indexOf(`:`)+1):t;if(e.effects.some(e=>e.resource===t||e.resource===r)||e.gates.some(e=>t===`gate:${e}`))return!0;let i=n?.flows?.[e.flow];return!!(i&&zt(i,e.flow,t))}function pn(e,t,n){return t?e.filter(e=>dn(e,t,n)):[...e]}function mn(e){return e?e.kind===`unit`||e.kind===`flow`||e.kind===`resource`?e:e.kind===`signal`?{kind:`resource`,nodeId:`signal:${e.signal}`}:null:null}function hn({manifest:e,runs:t=[],graphFilter:n,highlightedFlowIds:r,highlightedNodeIds:s,follow:l,activeNodeId:d=null,focusedNodeId:f=null,orchestraLabel:p=null,onNodeClick:m,onPaneClick:h}){let{fitView:g}=a(),{theme:_}=Fe(),[v,y]=(0,I.useState)(null),b=_===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:_,x=mn(n),S=n?.kind===`element`?n.element:null,C=x===null,w=(0,I.useMemo)(()=>st(e,t,S?{kind:`element`,element:S}:null),[e,t,S]),T=(0,I.useMemo)(()=>Be(!x||!e?e:Rt(e,x)),[e,x]),E=(0,I.useMemo)(()=>ft(w.nodes,w.edges,{hoverNodeId:v,highlightedFlowIds:r,highlightedNodeIds:s,manifest:e}),[w.nodes,w.edges,v,r,s,e]),D=(0,I.useMemo)(()=>Re(T.nodes,r,s,{activeNodeId:d,focusedNodeId:f}),[T.nodes,r,s,d,f]),O=(0,I.useMemo)(()=>Le(T.edges,D),[T.edges,D]),k=C?E.nodes:D,ee=C?E.edges:O;return(0,I.useEffect)(()=>{g({duration:280,padding:.18})},[C,n,e,g]),(0,I.useEffect)(()=>{if(!l||C||r.size===0)return;let e=[...r].map(e=>`flow:${e}`);g({nodes:e.map(e=>({id:e})),duration:300,padding:.2})},[l,C,r,g]),(0,G.jsxs)(`div`,{className:`relative h-full w-full`,children:[n?(0,G.jsxs)(`button`,{type:`button`,"data-slot":`flow-graph-map`,onClick:()=>h?.(),className:`absolute top-2 left-2 z-10 inline-flex max-w-[min(100%-1rem,20rem)] items-center gap-1.5 truncate rounded-md border border-border/70 bg-card/90 px-2 py-1 text-[10px] font-medium text-muted-foreground shadow-sm backdrop-blur-sm transition-colors hover:border-border hover:text-foreground`,children:[(0,G.jsx)(`span`,{className:`text-foreground`,children:`Map`}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`/`}),(0,G.jsx)(`span`,{className:`truncate`,children:ln(n)})]}):(0,G.jsx)(`div`,{className:`pointer-events-none absolute top-2 left-2 z-10 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:p?(0,G.jsxs)(G.Fragment,{children:[`Orchestra `,(0,G.jsx)(`span`,{className:`text-foreground normal-case`,children:p})]}):`Hover a unit — spokes light the elements it touches`}),(0,G.jsxs)(i,{nodes:k,edges:ee,nodeTypes:Lt,colorMode:b,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},minZoom:.15,maxZoom:1.6,defaultEdgeOptions:{type:`smoothstep`,zIndex:M.edge},zIndexMode:`manual`,onNodeClick:(e,t)=>m?.(t.id),onPaneClick:()=>h?.(),onNodeMouseEnter:(e,t)=>y(t.id),onNodeMouseLeave:()=>y(null),children:[(0,G.jsx)(u,{gap:24,size:1,color:`color-mix(in oklab, var(--foreground) 14%, transparent)`}),(0,G.jsx)(c,{showInteractive:!1}),(0,G.jsx)(o,{pannable:!0,zoomable:!0,ariaLabel:`Flow graph overview`,bgColor:`var(--card)`,maskColor:`color-mix(in oklab, var(--background) 55%, transparent)`,nodeColor:gn,nodeStrokeColor:_n,nodeStrokeWidth:12,nodeBorderRadius:10})]})]})}function gn(e){if(e.type===`orbit`)return`transparent`;let t=e.data.kind;if(t===`law`)return`color-mix(in oklab, var(--foreground) 45%, transparent)`;if(t===`unit`)return`color-mix(in oklab, var(--foreground) 8%, transparent)`;if(t===`element`){let t=e.data.refId;return P[t]?.accent??`#64748B`}return t in P?P[t].accent:`#64748B`}function _n(e){return e.data.kind===`unit`?`color-mix(in oklab, var(--foreground) 32%, transparent)`:`transparent`}function vn(e){let{leading:t,...n}=e;return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-col`,"data-slot":`flow-graph`,children:[t?(0,G.jsxs)(`header`,{className:w,children:[t,(0,G.jsx)(`span`,{className:`w-px shrink-0 self-stretch bg-border/60`,"aria-hidden":!0})]}):null,(0,G.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,G.jsx)(l,{children:(0,G.jsx)(hn,{...n})})})]})}var yn=`orch-`;function bn(e){return e.startsWith(yn)}function xn(e,t){return e&&t}function Sn(e,t=Math.random){let n=e.filter(e=>!bn(e.id)&&e.flow.length>0);return n.length===0?null:n[Math.floor(t()*n.length)]??null}function Cn(e,t,n){let r=t-e.startedAt,i=e.flow.replaceAll(`.`,`-`);return{...e,id:`${yn}${n}-${i}`,parentId:null,startedAt:t,endedAt:t+e.durationMs,effects:e.effects.map(e=>({...e,timestamp:e.timestamp+r})),logs:e.logs.map(e=>({...e,at:e.at+r}))}}function wn(e=Math.random){return 1800+Math.floor(e()*1600)}var Tn=1400;function En(e){let t=S(),[n,r]=(0,I.useState)(null),i=(0,I.useRef)(0),a=(0,I.useRef)(null),o=(0,I.useRef)(null),s=(0,I.useRef)(e.paused);return s.current=e.paused,(0,I.useEffect)(()=>{if(!xn(!1,e.enabled))return;let n=()=>{a.current&&=(clearTimeout(a.current),null)},c=()=>{if(s.current||document.hidden)return;let e=Sn(t.getQueryData(ge)??[]);if(!e)return;i.current+=1;let o=Cn(e,Date.now(),i.current);t.setQueryData(ge,e=>he(e??[],o)),r({flowId:o.flow,runId:o.id}),n(),a.current=setTimeout(()=>{r(null),a.current=null},Tn)},l=e=>{o.current=setTimeout(()=>{c(),l(wn())},e)};l(700);let u=()=>{document.hidden&&(r(null),n())};return document.addEventListener(`visibilitychange`,u),()=>{document.removeEventListener(`visibilitychange`,u),o.current&&clearTimeout(o.current),n(),r(null)}},[e.enabled,t]),e.paused?null:n}function Dn(e,t){let n=new Set;if(!t)return n;let r=new Map,i=new Map;for(let t of e)r.set(t.id,t);for(let t of e){if(!t.parentId)continue;let e=i.get(t.parentId)??[];e.push(t),i.set(t.parentId,e)}let a=r.get(t);if(!a)return n;let o=a,s=new Set;for(;o&&!s.has(o.id);)s.add(o.id),n.add(o.flow),o=o.parentId?r.get(o.parentId):void 0;let c=[a];for(;c.length>0;){let e=c.shift();if(!e)break;for(let t of i.get(e.id)??[])s.has(t.id)||(s.add(t.id),n.add(t.flow),c.push(t))}return n}var On=[{id:`signal`,label:`Signal`,expr:`trigger = signal`},{id:`clock`,label:`Clock`,expr:`trigger = cron`},{id:`cache-miss`,label:`Cache miss`,expr:`cache = miss`},{id:`slow`,label:`Slow`,expr:`duration > 100ms`}],kn=`h-7 min-w-0 rounded-none border-0 bg-transparent px-0 font-mono text-[11px] text-foreground shadow-none outline-none focus-visible:ring-0 dark:bg-transparent`,$=`rounded-none border-0 bg-transparent px-1.5 py-1 text-[11px] text-foreground/70 shadow-none transition-colors hover:bg-muted/50 hover:text-foreground`,An=`grid grid-cols-[minmax(0,1fr)_1.25rem_minmax(0,1fr)_1.25rem] items-center gap-x-1`;function jn({query:e,runs:t,onChange:n}){let r=(0,I.useMemo)(()=>$t(t),[t]),i=(0,I.useMemo)(()=>[...new Set([...Ht,...r])].sort(),[r]),[a,o]=(0,I.useState)(`trigger`),[s,c]=(0,I.useState)(`=`),[l,u]=(0,I.useState)(`signal`),[d,f]=(0,I.useState)(!1),h=()=>{let t=Ut(`${a} ${s} ${l}`).clauses[0];t&&(n(Z(e,t)),f(!1))};return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-b border-border/60 px-2 py-1.5`,"data-slot":`traces-advanced-filters`,children:[e.clauses.length>0?(0,G.jsx)(`ul`,{"aria-label":`Active filters`,className:`flex flex-col gap-0.5`,children:e.clauses.map(t=>(0,G.jsx)(`li`,{children:(0,G.jsx)(Mn,{clause:t,onRemove:()=>n(Wt(e,t.dimension))})},t.dimension))}):null,d?(0,G.jsxs)(`div`,{className:An,"data-slot":`traces-advanced-composer`,children:[(0,G.jsx)(`select`,{"aria-label":`Filter dimension`,className:kn,value:a,onChange:e=>o(e.target.value),children:i.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}),(0,G.jsx)(`select`,{"aria-label":`Filter operator`,className:m(kn,`text-center text-foreground/70`),value:s,onChange:e=>c(e.target.value),children:[`=`,`!=`,`>`,`<`,`>=`,`<=`].map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}),(0,G.jsx)(p,{"aria-label":`Filter value`,flat:!0,className:`h-7 px-0 font-mono text-[11px]`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()}}),(0,G.jsx)(`button`,{type:`button`,className:$,onClick:h,children:`Add`})]}):null,(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[On.map(t=>{let r=Ut(t.expr).clauses[0],i=r!==void 0&&Kt(e,r);return(0,G.jsx)(`button`,{type:`button`,"aria-pressed":i,disabled:r===void 0,onClick:()=>{r&&n(qt(e,r))},className:m($,i?`font-medium text-foreground`:`text-foreground/70`),children:t.label},t.id)}),(0,G.jsx)(`button`,{type:`button`,"aria-expanded":d,className:m($,`ml-auto`,d&&`text-foreground`),onClick:()=>f(e=>!e),children:d?`Cancel`:`Add clause`}),e.clauses.length>0?(0,G.jsx)(`button`,{type:`button`,className:$,onClick:()=>n(Ut(``)),children:`Clear`}):null]})]})}function Mn({clause:e,onRemove:t}){let n=Jt(e);return(0,G.jsxs)(`div`,{className:An,"data-slot":`traces-advanced-clause`,children:[(0,G.jsx)(`span`,{className:`truncate font-mono text-[11px] text-foreground/80`,children:e.dimension}),(0,G.jsx)(`span`,{className:`text-center font-mono text-[11px] text-foreground/65`,"aria-hidden":!0,children:e.op}),(0,G.jsx)(`span`,{className:`truncate font-mono text-[11px] text-foreground`,children:nn(e.dimension,e.value)}),(0,G.jsx)(`button`,{type:`button`,className:m($,`flex size-5 items-center justify-center text-foreground/55 hover:text-destructive`),"aria-label":`Remove ${n}`,onClick:t,children:(0,G.jsx)(f,{icon:C,className:`size-3`})})]})}var Nn={query:``,status:`all`,advanced:Vt};function Pn(e,t){let n=t.trim().toLowerCase();return!n||[e.flow,e.unit??``,e.trigger,e.cache,e.id,e.error??``,e.errorMessage??``].some(e=>e.toLowerCase().includes(n))}function Fn(e,t){return Xt(e.filter(e=>!(!Pn(e,t.query)||t.status===`errors`&&e.error===null)),t.advanced)}function In(e,t=Date.now()){let n=t-e;return n<1e3?`just now`:n<6e4?`${Math.floor(n/1e3)}s ago`:n<36e5?`${Math.floor(n/6e4)}m ago`:`${Math.floor(n/36e5)}h ago`}function Ln(e,t=Date.now()){let n=In(e.startedAt,t),r=e.error!==null;return{text:n,title:r?e.errorMessage?`${e.error} — ${e.errorMessage}`:e.error??n:n,failed:r}}function Rn({run:e,selected:t,onSelect:n,copyText:r=async e=>{await navigator.clipboard.writeText(e)}}){let i=Ln(e),a=i.failed,o=Oe(e.trigger),s=e.cache,[c,l]=(0,I.useState)(null),u=async t=>{t.stopPropagation();try{await r(Ae(e)),l(`Copied run id`)}catch{l(`Copy failed`)}};return(0,G.jsxs)(`div`,{"data-slot":`trace-row`,"data-run-id":e.id,"data-selected":t?`true`:`false`,"data-failed":a?`true`:`false`,"data-cache":e.cache,className:m(`group relative flex w-full items-stretch border-b border-border/60 text-xs transition-colors`,`hover:bg-muted/50 focus-within:bg-muted/50`,t&&`bg-muted/70`,a&&`bg-destructive/[0.04]`),children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:m(`absolute inset-y-0 left-0 w-0.5`,t&&!a&&`bg-sky-500`,a&&`bg-destructive`)}),(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>n(e.id),className:`flex min-w-0 flex-1 items-center gap-2 py-1.5 pr-1 pl-0 text-left outline-none`,children:[(0,G.jsx)(`span`,{className:m(`ml-2.5 size-1.5 shrink-0 rounded-full`,a?`bg-destructive`:`bg-emerald-500`),"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,title:o.label,"aria-hidden":!0,children:(0,G.jsx)(f,{icon:o.icon,className:`size-3.5`})}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-foreground`,children:e.flow}),(0,G.jsx)(He,{cache:s,dataSlot:`trace-row-cache`}),(0,G.jsx)(`span`,{className:m(`w-10 shrink-0 text-right tabular-nums font-medium`,de(e.durationMs)),children:me(e.durationMs)}),(0,G.jsx)(`span`,{className:`w-14 shrink-0 truncate text-right tabular-nums text-muted-foreground`,title:i.title,"data-slot":`trace-row-meta`,children:i.text})]}),(0,G.jsx)(`div`,{className:m(`flex shrink-0 items-center gap-0.5 pr-1.5 opacity-0 transition-opacity`,`group-hover:opacity-100 group-focus-within:opacity-100`,c&&`opacity-100`),children:(0,G.jsxs)(h,{children:[(0,G.jsx)(_,{render:e=>(0,G.jsx)(T,{...e,type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Copy run ID`,"data-slot":`trace-copy-id`,onClick:t=>{e.onClick?.(t),u(t)},children:(0,G.jsx)(f,{icon:k,className:`size-3`})})}),(0,G.jsx)(g,{side:`top`,children:`Copy run ID`})]})}),c?(0,G.jsx)(`span`,{className:`sr-only`,role:`status`,children:c}):null]})}var zn=[{value:`all`,label:`All`,icon:We},{value:`errors`,label:`Errors`,icon:ue}];function Bn({runs:e,selectedRunId:t,onSelect:n,liveStatus:r,manifest:i,graphFilter:a,onGraphFilterChange:o,focusEffectIndex:s,onFocusEffectChange:c,playbackKey:l,onReplayStart:u,selectedRun:p}){let[v,x]=(0,I.useState)(Nn),[S,C]=(0,I.useState)(!1);(0,I.useEffect)(()=>{(a?.kind===`flow`||a?.kind===`unit`)&&x(e=>({...e,advanced:un(e.advanced,a)}))},[a]);let T=(0,I.useMemo)(()=>pn(Fn(e,v),a,i),[e,v,a,i]),O=(0,I.useMemo)(()=>p===void 0?t?e.find(e=>e.id===t)??null:null:p,[p,e,t]),k=v.advanced.clauses.length>0,re=e=>{x(t=>({...t,query:e}))},ae=e=>{x(t=>({...t,status:e}))};return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,"data-slot":`traces-pane`,children:[(0,G.jsxs)(`div`,{className:`shrink-0 border-b border-border/60`,children:[(0,G.jsxs)(`div`,{className:m(d,`border-b-0`),children:[(0,G.jsx)(ee,{value:v.query,onChange:e=>re(e.target.value),placeholder:`Search traces…`,"aria-label":`Search traces`,"data-slot":`traces-search`}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-stretch pr-0.5`,children:[e.length>0?(0,G.jsxs)(h,{children:[(0,G.jsx)(_,{render:e=>(0,G.jsxs)(`button`,{...e,type:`button`,"aria-expanded":S,"aria-controls":`traces-advanced-panel`,"aria-label":k?`Advanced filters, ${v.advanced.clauses.length} active`:`Advanced filters`,"data-slot":`traces-advanced-toggle`,onClick:t=>{e.onClick?.(t),C(e=>!e)},className:m(b,`relative`,(S||k)&&`text-foreground`),children:[(0,G.jsx)(f,{icon:Te,className:`size-3`,"aria-hidden":!0}),k?(0,G.jsx)(`span`,{className:`absolute -top-0.5 -inset-e-0.5 flex size-3.5 items-center justify-center rounded-full bg-foreground text-[8px] font-medium text-background`,"aria-hidden":!0,children:v.advanced.clauses.length}):null]})}),(0,G.jsx)(g,{side:`bottom`,children:`Advanced`})]}):null,e.length>0?(0,G.jsx)(`span`,{className:`mx-0.5 h-3 w-px bg-border/60`,"aria-hidden":!0}):null,(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 pr-0.5 text-[10px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:r===`open`?`size-1.5 rounded-full bg-emerald-500`:`size-1.5 rounded-full bg-muted-foreground`,"aria-hidden":!0}),r===`open`?`live`:`polling`]})]})]}),e.length>0?(0,G.jsx)(`div`,{className:m(w,`border-t border-b-0`),"data-slot":`traces-filters`,children:(0,G.jsx)(`div`,{className:`flex shrink-0 items-stretch`,role:`group`,"aria-label":`Status filter`,children:zn.map(({value:e,label:t,icon:n})=>{let r=v.status===e;return(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>ae(e),className:m(y,`font-semibold tracking-[0.08em] uppercase`,r?e===`errors`?`text-destructive`:D:E),children:[(0,G.jsx)(f,{icon:n,className:`size-3`,"aria-hidden":!0}),t]},e)})})}):null,e.length>0&&a?(0,G.jsxs)(`button`,{type:`button`,"data-slot":`traces-graph-filter`,onClick:()=>o(null),title:`Clear graph filter`,className:`mx-2 mb-1.5 inline-flex max-w-full items-center gap-1 self-start truncate rounded-md border border-sky-500/40 bg-sky-500/10 px-2 py-0.5 text-[10px] font-medium text-sky-700 transition-colors hover:bg-sky-500/20 dark:text-sky-400`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:ln(a)}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`×`})]}):null]}),e.length>0?(0,G.jsx)(Ue,{id:`traces-advanced-panel`,role:`region`,"aria-label":`Advanced filters`,open:S,className:`shrink-0`,children:(0,G.jsx)(jn,{query:v.advanced,runs:e,onChange:e=>{x(t=>({...t,advanced:e}))}})}):null,(0,G.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:e.length===0?(0,G.jsx)(ie,{className:`border-none`,children:(0,G.jsxs)(te,{children:[(0,G.jsx)(ne,{variant:`icon`,children:(0,G.jsx)(f,{icon:A.flow.icon})}),(0,G.jsx)(se,{children:`No traces yet`}),(0,G.jsx)(le,{children:`No runs for the flows on this graph yet. Trigger a flow to see live activity here.`})]})}):T.length===0?(0,G.jsx)(ie,{className:`border-none`,children:(0,G.jsxs)(te,{children:[(0,G.jsx)(se,{children:`No matching traces`}),(0,G.jsx)(le,{children:`Nothing in this list matches the current search, status, or advanced filters.`})]})}):T.map(e=>(0,G.jsx)(Rn,{run:e,selected:e.id===t,onSelect:e=>n(e===t?null:e)},e.id))}),(0,G.jsx)(je,{run:O,onClose:()=>n(null),focusEffectIndex:s,onFocusEffectChange:c,playbackKey:l,onReplayStart:u})]})}function Vn(){let e=pe(),t=_e(),n=fe(!0),{selectedRunId:r,selectedFlowId:i,follow:a,setSelectedRun:o,setSelectedFlow:s}=Ie(),c=ae(),l=(0,G.jsx)(oe,{open:c.open,onToggle:c.toggle,noun:`traces`,controlsId:`overview-traces`,dataSlot:`overview-traces-toggle`}),[u,d]=(0,I.useState)(null),[f,p]=(0,I.useState)(null),[m,h]=(0,I.useState)(0),[g,_]=(0,I.useState)(null),y=(0,I.useRef)(null),b=(0,I.useMemo)(()=>new Set(Object.keys(e.data?.flows??{})),[e.data]),S=(0,I.useMemo)(()=>ze(t.data??[],b),[t.data,b]),C=En({enabled:!!e.data&&S.length>0,paused:r!=null||u!=null});(0,I.useEffect)(()=>{i&&d(e=>e?.kind===`flow`&&e.flowId===i?e:{kind:`flow`,flowId:i})},[i]);let w=(0,I.useCallback)(e=>{d(e),e?.kind===`flow`?s(e.flowId):s(null)},[s]),T=(0,I.useMemo)(()=>{let e=Dn(t.data??[],r);return e.size>0?e:i?new Set([i]):C?.flowId?new Set([C.flowId]):e},[t.data,r,i,C?.flowId]),E=(0,I.useMemo)(()=>{let t=new Set,n=e.data?.flows??{};for(let e of T){let r=n[e];if(r){r.trigger?.signal&&t.add(`signal:${r.trigger.signal}`),(r.trigger?.cron||r.trigger?.every)&&t.add(`clock:${e}`);for(let e of r.gates??[])t.add(`gate:${e}`);for(let e of r.effects?.reads??[])t.add(e);for(let e of r.effects?.writes??[])t.add(e);for(let e of r.effects?.emits??[])t.add(`signal:${e}`);for(let e of r.effects?.sends??[])t.add(`channel:${e}`);for(let e of r.effects?.asks??[])t.add(`ai:${e}`);for(let e of r.effects?.secrets??[])t.add(`vault:${e}`)}}return t},[T,e.data]),D=(0,I.useMemo)(()=>r?t.data?.find(e=>e.id===r)??null:null,[t.data,r]),k=(0,I.useCallback)(e=>{let t=cn(e);t&&w(u&&u.kind===t.kind&&JSON.stringify(u)===JSON.stringify(t)?null:t)},[w,u]),ee=(0,I.useCallback)(()=>{w(null)},[w]),te=(0,I.useCallback)(()=>{h(e=>e+1)},[]);return(0,I.useEffect)(()=>{if(m===0||!D)return;let n=ke(Dn(t.data??[],D.id),e.data??null);if(n.length===0)return;let r=Ee(D.durationMs),i=performance.now();return _(n[0]??null),y.current=setInterval(()=>{let e=Math.min(1,(performance.now()-i)/r);_(De(n,e)),e>=1&&y.current&&(clearInterval(y.current),y.current=null,setTimeout(()=>_(null),400))},60),()=>{y.current&&=(clearInterval(y.current),null),_(null)}},[m,D,t.data,e.data]),(0,G.jsx)(`div`,{className:x,"data-slot":`flows-page`,children:(0,G.jsxs)(O,{orientation:`horizontal`,className:`min-h-0 flex-1`,children:[(0,G.jsx)(re,{panelRef:c.panelRef,collapsible:!0,collapsedSize:0,defaultSize:v.start.defaultSize,minSize:v.start.minSize,maxSize:`50%`,onResize:c.onResize,className:`min-h-0`,children:(0,G.jsx)(`div`,{id:`overview-traces`,className:`h-full min-h-0 overflow-hidden`,"data-slot":`overview-traces`,children:(0,G.jsx)(Bn,{runs:S,selectedRunId:r,onSelect:o,liveStatus:n,manifest:e.data??null,graphFilter:u,onGraphFilterChange:w,focusEffectIndex:f,onFocusEffectChange:p,playbackKey:m,onReplayStart:te,selectedRun:D})})}),c.open?(0,G.jsx)(ce,{withHandle:!0}):null,(0,G.jsx)(re,{defaultSize:v.end.defaultSize,minSize:v.end.minSize,className:`min-h-0`,children:(0,G.jsx)(`div`,{className:`h-full min-h-0 overflow-hidden`,children:(0,G.jsx)(vn,{manifest:e.data??null,runs:S,graphFilter:u,highlightedFlowIds:T,highlightedNodeIds:E,orchestraLabel:C?.flowId??null,follow:a,activeNodeId:g,onNodeClick:k,onPaneClick:ee,leading:l})})})]})})}export{Vn as FlowsPage};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./react-dom-Ddte4I-Q.js";import{A as n,a as r,c as i,d as a,o,p as s,r as c,s as l,t as u}from"./xyflow-yApv7D4e.js";import{Cr as d,Dr as f,E as p,Er as m,F as h,I as g,R as _,_r as v,br as y,cr as b,dr as x,ha as S,kr as C,vr as w,x as T,xr as E,yr as D}from"./shortcut-keys-3ILd8oGn.js";import{a as O,b as k,c as ee,d as te,f as ne,i as re,l as ie,n as ae,o as oe,p as se,r as ce,t as A,u as le}from"./element-icons-BI8cJgdh.js";import{s as ue}from"./collapsible-82y257sL.js";import{t as de}from"./duration-tone-W63jaMZ8.js";import{a as fe,c as pe,i as me,l as he,o as ge,s as _e}from"./highlighted-json-yE9zNTqC.js";import{C as ve,S as ye,_ as j,b as be,d as xe,f as Se,g as M,h as Ce,p as we,v as N,y as P}from"./request-meta-CzrOfgiz.js";import{n as Te}from"./dagre.esm-B1_XeuLP.js";import{a as Ee,i as De,n as Oe,o as ke,r as Ae,t as je}from"./trace-detail-sheet-DgeeejW7.js";import{a as Me,c as Ne,l as Pe,o as Fe,vt as Ie}from"./index-r7xXt_VV.js";import{a as Le,c as F,i as Re,n as ze,o as Be,r as Ve,t as He}from"./cache-glyph-Ceaq9pYh.js";import{t as Ue}from"./agent-disclosure-CKjAEOqA.js";var We=[[`path`,{d:`M4 5L20 5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M4 12L20 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M4 19L20 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],I=e(t(),1),L=[`flow`,`signal`,`store`,`clock`,`gate`,`vault`,`channel`,`ai`];function R(e,t,n){return{x:j.cx+t*Math.cos(e)-n.width/2,y:j.cy+t*Math.sin(e)-n.height/2}}function Ge(e){if(e<=0)return[];let t=2*Math.PI/e;return Array.from({length:e},(e,n)=>-Math.PI/2+n*t)}var Ke=2*Math.PI/L.length;function z(e,t,n=j.typeRing){if(t<=0)return[];if(t===1)return[e];let r=(N.type.width+10)/n,i=Math.min(r*(t-1),Ke*.7);return Array.from({length:t},(n,r)=>e-i/2+r/(t-1)*i)}function qe(e,t){if(t<=0)return[];let n=j.typeRing,r=j.typeRing+j.typeRow;if(t===1)return[{angle:e,radius:n}];if(t===4)return Ye(e,n,r);if(t<=3)return z(e,t,n).map(e=>({angle:e,radius:n}));let i=Math.ceil(t/2),a=t-i;return[...z(e,i,n).map(e=>({angle:e,radius:n})),...z(e,a,r).map(e=>({angle:e,radius:r}))]}function Je(e){return Math.abs(Math.cos(e))*N.type.height+Math.abs(Math.sin(e))*N.type.width}function Ye(e,t,n){let r=(Je(e)+24)/t;return[{angle:e-r/2,radius:t},{angle:e+r/2,radius:t},{angle:e-r/2,radius:n},{angle:e+r/2,radius:n}]}function B(e){let t=new Set([`flow`]),n=e.trigger;(n?.cron||n?.every)&&t.add(`clock`),n?.signal&&t.add(`signal`),(e.gates?.length??0)>0&&t.add(`gate`);let r=e.effects;return((r?.reads?.length??0)>0||(r?.writes?.length??0)>0)&&t.add(`store`),(r?.emits?.length??0)>0&&t.add(`signal`),(r?.sends?.length??0)>0&&t.add(`channel`),(r?.asks?.length??0)>0&&t.add(`ai`),(r?.secrets?.length??0)>0&&t.add(`vault`),L.filter(e=>t.has(e))}function Xe(e){let t=new Set([`flow`]);(e.trigger===`cron`||e.trigger===`every`)&&t.add(`clock`),e.trigger===`signal`&&t.add(`signal`),e.gates.length>0&&t.add(`gate`);for(let n of e.effects)switch(n.kind){case`read`:case`write`:t.add(`store`);break;case`emit`:t.add(`signal`);break;case`send`:case`fetch`:t.add(`channel`);break;case`ask`:case`embed`:t.add(`ai`);break;case`secret`:t.add(`vault`)}return L.filter(e=>t.has(e))}function Ze(e,t){let n=new Map,r=(e,t,r)=>{n.has(e)||n.set(e,r===void 0?{id:e,label:t}:{id:e,label:t,badge:r})};switch(t){case`flow`:for(let t of Object.keys(e.flows??{}).sort())r(`flow:${t}`,Ve(t),F(t));break;case`signal`:for(let t of Object.keys(e.signals??{}).sort())r(`signal:${t}`,t,`signal`);for(let t of Object.values(e.flows??{})){t.trigger?.signal&&r(`signal:${t.trigger.signal}`,t.trigger.signal,`signal`);for(let e of t.effects?.emits??[])r(`signal:${e}`,e,`signal`)}break;case`store`:for(let[t,n]of Object.entries(e.stores??{})){let e=n.facet;for(let t of Object.keys(n.tables??{}).sort())r(`${e}:${t}`,t,e);let i=n.namespaces&&n.namespaces.length>0?n.namespaces:[];e===`kv`&&i.length===0&&r(`kv:${t}`,t,`kv`);for(let e of[...i].sort())r(`kv:${e}`,e,`kv`);for(let e of[...n.buckets??[]].sort())r(`files:${e}`,e,`files`);for(let e of[...n.indexes??[]].sort())r(`index:${e}`,e,`index`)}for(let t of Object.values(e.flows??{}))for(let e of[...t.effects?.reads??[],...t.effects?.writes??[]]){let t=Qe(e);t&&r(t.id,t.label,t.badge)}break;case`clock`:for(let[t,n]of Object.entries(e.clocks??{}).sort(([e],[t])=>e.localeCompare(t)))r(`clock:${t}`,t,n.cron?`cron`:n.every?`every`:`clock`);for(let[t,n]of Object.entries(e.flows??{}))n.trigger?.cron&&r(`clock:${t}`,n.trigger.cron,`cron`),n.trigger?.every&&r(`clock:${t}`,n.trigger.every,`every`);break;case`gate`:for(let t of Object.keys(e.gates??{}).sort())r(`gate:${t}`,t,`gate`);for(let t of Object.values(e.flows??{}))for(let e of t.gates??[])r(`gate:${e}`,e,`gate`);break;case`vault`:for(let t of Object.keys(e.vault??{}).sort())r(`vault:${t}`,t,`vault`);for(let t of Object.values(e.flows??{}))for(let e of t.effects?.secrets??[])r(`vault:${e}`,e,`vault`);break;case`channel`:for(let t of Object.keys(e.channels??{}).sort())r(`channel:${t}`,t,`channel`);for(let t of Object.values(e.flows??{}))for(let e of t.effects?.sends??[])r(`channel:${e}`,e,`channel`);break;case`ai`:for(let t of Object.keys(e.ai?.prompts??{}).sort())r(`ai:${t}`,t,`prompt`);for(let t of Object.keys(e.ai?.agents??{}).sort())r(`ai:${t}`,t,`agent`);for(let t of Object.values(e.flows??{}))for(let e of t.effects?.asks??[])r(`ai:${e}`,e,`prompt`)}return[...n.values()].sort((e,t)=>e.label.localeCompare(t.label))}function Qe(e){return e.startsWith(`sql:`)?{id:e,label:e.slice(4),badge:`sql`}:e.startsWith(`kv:`)?{id:e,label:e.slice(3),badge:`kv`}:e.startsWith(`files:`)?{id:e,label:e.slice(6),badge:`files`}:e.startsWith(`index:`)?{id:e,label:e.slice(6),badge:`index`}:null}var $e={flow:xe.map(e=>({kind:e,label:Se[e].label})),signal:[{kind:`once`,label:`once`},{kind:`broadcast`,label:`broadcast`},{kind:`live`,label:`live`}],store:[{kind:`sql`,label:`SQL`},{kind:`kv`,label:`KV`},{kind:`files`,label:`Files`},{kind:`index`,label:`Index`}],clock:[{kind:`cron`,label:`cron`},{kind:`every`,label:`every`}],gate:[{kind:`policy`,label:`policy`},{kind:`scope`,label:`scope`},{kind:`rate`,label:`rate`},{kind:`public`,label:`public`}],vault:[{kind:`secret`,label:`secret`},{kind:`config`,label:`config`},{kind:`env`,label:`env`}],channel:[{kind:`email`,label:`email`},{kind:`sms`,label:`SMS`},{kind:`whatsapp`,label:`WA`},{kind:`push`,label:`Push`}],ai:[{kind:`model`,label:`model`},{kind:`prompt`,label:`prompt`},{kind:`embed`,label:`embed`},{kind:`agent`,label:`agent`}]};function et(e,t){return $e[t].map(e=>({id:`type:${t}:${e.kind}`,label:e.label,badge:e.kind}))}function tt(e,t){return t?.kind===`rate`||e.startsWith(`rate:`)?`rate`:e===`public`?`public`:(t?.scopes?.length??0)>0?`scope`:`policy`}function nt(e){return e?.sensitive===!1?`config`:`secret`}function rt(e,t){let n=t.split(`@`)[0]??t;return e.ai?.agents?.[n]?`agent`:e.ai?.models?.[n]?`model`:`prompt`}function it(e,t,n){let r=`type:${n}:`;switch(n){case`flow`:return[`${r}${we(t.trigger)}`];case`store`:{let e=new Set;for(let n of[...t.effects?.reads??[],...t.effects?.writes??[]]){let t=Qe(n);t?.badge&&e.add(t.badge)}return[...e].map(e=>`${r}${e}`)}case`signal`:{let n=[...t.trigger?.signal?[t.trigger.signal]:[],...t.effects?.emits??[]],i=new Set;for(let t of n){let n=e.signals?.[t]?.delivery;n&&i.add(n)}return[...i].map(e=>`${r}${e}`)}case`clock`:{let e=[];return t.trigger?.cron&&e.push(`${r}cron`),t.trigger?.every&&e.push(`${r}every`),e}case`gate`:return[...new Set((t.gates??[]).map(t=>tt(t,e.gates?.[t])))].map(e=>`${r}${e}`);case`vault`:return[...new Set((t.effects?.secrets??[]).map(t=>nt(e.vault?.[t])))].map(e=>`${r}${e}`);case`channel`:{let n=new Set;for(let r of t.effects?.sends??[]){let t=e.channels?.[r]?.medium;t&&t!==`any`&&n.add(t)}return[...n].map(e=>`${r}${e}`)}case`ai`:return[...new Set((t.effects?.asks??[]).map(t=>rt(e,t)))].map(e=>`${r}${e}`)}}function at(e){let t=e?.flows??{},n=new Map;for(let e of Object.keys(t).sort()){let t=F(e),r=n.get(t)??[];r.push(e),n.set(t,r)}let r=new Map,i=new Map,a=new Map;for(let[e,o]of n){let n=new Set;for(let i of o){let o=t[i];if(o)for(let t of B(o)){n.add(t);let o=`${e}\0${t}`;r.set(o,(r.get(o)??0)+1);let s=a.get(t)??new Set;s.add(i),a.set(t,s)}}i.set(e,n)}let o=[...n.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({unit:e,flowCount:t.length,elements:L.filter(t=>i.get(e)?.has(t)),live:0,errors:0})),s=L.map(t=>({element:t,resourceCount:e?Ze(e,t).length:0,flowCount:a.get(t)?.size??0,live:0,errors:0})),c=[];for(let e of o)for(let t of e.elements)c.push({unit:e.unit,element:t,flowCount:r.get(`${e.unit}\0${t}`)??0});return{units:o,hubs:s,couplings:c}}function ot(e,t){let n=new Map,r=new Map,i=new Map,a=new Map;for(let e of t){let t=e.unit??F(e.flow);n.set(t,(n.get(t)??0)+1),e.error&&r.set(t,(r.get(t)??0)+1);for(let t of Xe(e))i.set(t,(i.get(t)??0)+1),e.error&&a.set(t,(a.get(t)??0)+1)}return{couplings:e.couplings,units:e.units.map(e=>({...e,live:n.get(e.unit)??0,errors:r.get(e.unit)??0})),hubs:e.hubs.map(e=>({...e,live:i.get(e.element)??0,errors:a.get(e.element)??0}))}}function st(e,t=[],n=null){if(!e||Object.keys(e.flows??{}).length===0)return{nodes:[],edges:[],units:[],hubs:[]};let r=ot(at(e),t),i=n?.element,a=r.hubs.find(e=>e.element===`flow`)?.live??0,o=r.hubs.find(e=>e.element===`flow`)?.errors??0,s=[],c=[];s.push(V(`orbit:elements`,j.elementRing)),s.push(V(`orbit:types`,j.typeRing)),s.push(V(`orbit:spokes`,j.spokeRing)),s.push({id:`law:oke`,type:`law`,position:{x:j.cx-N.law.width/2,y:j.cy-N.law.height/2},data:{kind:`law`,label:e.app,refId:`oke`,badge:String(r.units.reduce((e,t)=>e+t.flowCount,0)),live:a,errors:o},selectable:!1,draggable:!1,zIndex:M.leaf,width:N.law.width,height:N.law.height,style:{width:N.law.width,height:N.law.height,overflow:`visible`}});let l=Ge(L.length);if(r.hubs.forEach((e,t)=>{let n=l[t]??0,r=N.hub;s.push({id:`element:${e.element}`,type:`element`,position:R(n,j.elementRing,r),data:{kind:`element`,label:A[e.element].symbol,refId:e.element,badge:String(e.resourceCount),live:e.live,errors:e.errors,dimmed:i!=null&&e.element!==i},draggable:!1,zIndex:M.leaf,width:r.width,height:r.height,style:{width:r.width,height:r.height}}),c.push(U(`element:${e.element}`,`law:oke`,e.element,1,!0))}),!i||i===`flow`){let t=N.type;r.hubs.forEach((n,r)=>{let i=l[r]??0,a=et(e,n.element),o=qe(i,a.length);a.forEach((e,r)=>{let a=o[r]??{angle:i,radius:j.typeRing};s.push({id:e.id,type:`typeChip`,position:R(a.angle,a.radius,t),data:{kind:n.element,label:e.label,refId:e.id,...e.badge===void 0?{}:{badge:e.badge,facet:e.badge}},draggable:!1,zIndex:M.leaf,width:t.width,height:t.height,style:{width:t.width,height:t.height}}),c.push(U(e.id,`element:${n.element}`,n.element,1))})})}if(i&&i!==`flow`){let t=Ze(e,i),n=be.store,r=Ge(t.length);t.forEach((e,t)=>{let a=r[t]??0;s.push({id:e.id,type:i,position:R(a,j.spokeRing,n),data:{kind:i,label:e.label,refId:e.id,...e.badge===void 0?{}:{badge:e.badge,facet:e.badge}},draggable:!1,zIndex:M.leaf,width:n.width,height:n.height,style:{width:n.width,height:n.height}}),c.push(U(e.id,`element:${i}`,i,1))})}else{let t=N.unit,n=Ge(r.units.length);r.units.forEach((e,r)=>{let i=n[r]??0;s.push({id:`unit:${e.unit}`,type:`unitChip`,position:R(i,j.spokeRing,t),data:{kind:`unit`,label:e.unit,refId:e.unit,badge:String(e.flowCount),elements:e.elements.filter(e=>e!==`flow`),live:e.live,errors:e.errors},draggable:!1,zIndex:M.leaf,width:t.width,height:t.height,style:{width:t.width,height:t.height}})});let a=new Map;for(let t of Object.keys(e.flows??{}).sort()){let e=F(t),n=a.get(e)??[];n.push(t),a.set(e,n)}for(let t of r.units){let n=new Map,r=new Set;for(let o of a.get(t.unit)??[]){let t=e.flows?.[o];if(t)for(let a of B(t)){if(i===`flow`&&a!==`flow`)continue;let o=it(e,t,a);o.length===0&&r.add(a);for(let e of o)n.set(e,(n.get(e)??0)+1)}}for(let[e,r]of n){let n=e.slice(5).split(`:`)[0];n&&n in P&&c.push(U(`unit:${t.unit}`,e,n,r))}for(let e of r)c.push(U(`unit:${t.unit}`,`element:${e}`,e,1))}}return{nodes:s,edges:c,units:r.units,hubs:r.hubs}}function V(e,t){let n=t*2;return{id:e,type:`orbit`,position:{x:j.cx-t,y:j.cy-t},data:{kind:`law`,label:``,refId:e},selectable:!1,draggable:!1,zIndex:M.edge,width:n,height:n,style:{width:n,height:n}}}function ct(e,t){return t===`law:oke`?`trunk`:e.startsWith(`type:`)&&t.startsWith(`element:`)?`bind`:`spoke`}function H(e){return e===`trunk`?.14:e===`bind`?.2:0}function U(e,t,n,r,i=!1){let a=i?`trunk`:ct(e,t),o=a===`trunk`?1.15:1+Math.min(1.25,Math.log2(1+r)*.45);return{id:`couple:${e}->${t}`,source:e,target:t,sourceHandle:`center`,targetHandle:`center`,type:`straight`,data:{kind:`couple`},style:{stroke:Ce.couple,strokeWidth:o,opacity:H(a)},zIndex:M.edge}}function lt(e){if(e.startsWith(`element:`)){let t=e.slice(8);return t in P?t:null}if(e.startsWith(`type:`)){let t=e.slice(5).split(`:`)[0];return t&&t in P?t:null}return null}function ut(e,t){for(let n of[t,e]){let e=lt(n);if(e)return P[e].accent}return Ce.couple}function dt(e,t){let n=new Set,r=new Set,i=(e,t)=>{r.add(`couple:${e}->${t}`)};if(!e)return{nodeIds:n,edgeIds:r};for(let r of t){let t=e.flows?.[r];if(!t)continue;let a=`unit:${F(r)}`;n.add(a);for(let r of B(t)){let o=`element:${r}`;n.add(o),n.add(`law:oke`),i(o,`law:oke`);let s=it(e,t,r);s.length===0&&i(a,o);for(let e of s)n.add(e),i(a,e),i(e,o)}}return{nodeIds:n,edgeIds:r}}function ft(e,t,n={}){let r=n.hoverNodeId??null,i=n.highlightedFlowIds??new Set,a=n.highlightedNodeIds??new Set,o=dt(n.manifest,i),s=o.nodeIds.size>0||a.size>0,c=r!=null,l=r==null?null:pt(r,t);return{nodes:e.map(e=>{if(e.type===`orbit`)return{...e,data:{...e.data,highlighted:!1,dimmed:!1}};let t=o.nodeIds.has(e.id)||a.has(e.id)||i.has(e.data.refId),n=l?.has(e.id)===!0;return{...e,data:{...e.data,highlighted:t||c&&e.id===r,dimmed:e.id===`law:oke`?!1:s&&!t||c&&!n}}}),edges:t.map(e=>{let t=l!=null&&l.has(e.source)&&l.has(e.target),n=s&&o.edgeIds.has(e.id),r=c?t:n,i=ct(e.source,e.target),a=c||s?r?1:H(i)*.35:H(i);return{...e,animated:r,style:{...e.style,stroke:r?ut(e.source,e.target):Ce.couple,opacity:a,strokeWidth:r?2.25:e.style?.strokeWidth}}})}}function W(e,t){let n=[];for(let r of e)r.source===t?n.push(r.target):r.target===t&&n.push(r.source);return n}function pt(e,t){let n=new Set([e]),r=e=>n.add(e);if(e.startsWith(`unit:`)){for(let n of W(t,e)){if(r(n),n.startsWith(`type:`)){for(let e of W(t,n))if(e.startsWith(`element:`)){r(e);for(let n of W(t,e))n===`law:oke`&&r(n)}}if(n.startsWith(`element:`))for(let e of W(t,n))e===`law:oke`&&r(e)}return n}if(e.startsWith(`type:`)){for(let n of W(t,e))r(n);let i=[...n].find(e=>e.startsWith(`element:`));if(i)for(let e of W(t,i))e===`law:oke`&&r(e);return n}if(e.startsWith(`element:`)||e===`law:oke`)for(let n of W(t,e))r(n);return n}var G=n(),mt={flow:A.flow.icon,signal:A.signal.icon,store:A.store.icon,clock:A.clock.icon,gate:A.gate.icon,vault:A.vault.icon,channel:A.channel.icon,ai:A.ai.icon},ht={flow:`rounded-xl`,store:`rounded-md`,signal:`rounded-full`,clock:`rounded-lg`,gate:`rounded-md`,vault:`rounded-md`,channel:`rounded-xl`,ai:`rounded-2xl`};function K(e,t){return m(`group relative flex h-full w-full items-center gap-2.5 border-2 px-2.5 text-xs transition-[opacity,filter,box-shadow,border-color] duration-200`,ht[t],e.dimmed&&`opacity-30 saturate-[0.35]`,e.highlighted&&`z-10`,e.focused&&`z-10`)}function q(e,t){let n=P[e],r=`color-mix(in oklab, ${n.accent} 20%, var(--card))`;return t.highlighted||t.focused?{borderColor:n.accent,background:`color-mix(in oklab, ${n.accent} 26%, var(--card))`,boxShadow:`0 0 0 1px ${n.accent}, 0 0 22px ${n.glow}`}:{borderColor:`color-mix(in oklab, ${n.accent} 78%, var(--border))`,background:r,boxShadow:`inset 3px 0 0 ${n.accent}`}}function J({data:e,kind:t,className:n,style:r,children:i,...a}){let o=Pe(),s=P[t];return(0,G.jsx)(Ne.div,{className:n,style:r,initial:!1,whileHover:o?void 0:{scale:1.04},whileTap:o?void 0:{scale:.97},animate:{scale:o?1:e.active?[1,1.08,1]:e.highlighted?1.02:1,boxShadow:e.active?`0 0 0 2px ${s.accent}, 0 0 30px ${s.glow}`:void 0},transition:e.active?{duration:.5,ease:`easeInOut`}:{type:`spring`,stiffness:400,damping:28},...a,children:i})}function gt({kind:e,size:t=`sm`}){let n=P[e];return(0,G.jsx)(`span`,{className:m(`flex shrink-0 items-center justify-center border`,t===`md`?`size-9`:`size-7`,e===`signal`?`rounded-full`:e===`store`||e===`gate`||e===`vault`?`rounded-md`:`rounded-full`),style:{color:n.accent,background:n.well,borderColor:`color-mix(in oklab, ${n.accent} 55%, transparent)`},"aria-hidden":!0,children:(0,G.jsx)(f,{icon:mt[e],size:t===`md`?17:15,strokeWidth:1.9})})}function _t({text:e}){return(0,G.jsx)(`span`,{className:`rounded border border-border/70 bg-background/50 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.16em] text-muted-foreground`,children:e})}function vt({type:e,kind:t}){let n=P[t];return(0,G.jsx)(r,{type:e,position:e===`source`?s.Right:s.Left,className:`!size-2 !border-0`,style:{background:n.accent}})}function Y({type:e}){return(0,G.jsx)(r,{id:`center`,type:e,position:e===`source`?s.Right:s.Left,isConnectable:!1,className:`oke-center-handle !top-1/2 !left-1/2 !size-px !-translate-x-1/2 !-translate-y-1/2 !border-0 !bg-transparent !opacity-0`})}function yt({live:e,errors:t}){return e<=0?null:(0,G.jsx)(`span`,{className:m(`size-2 shrink-0 rounded-full`,t>0?`bg-rose-400`:`bg-emerald-400`,e>0&&`animate-pulse`),title:t>0?`${e} live · ${t} failed`:`${e} live`})}function bt({elements:e}){return e.length===0?null:(0,G.jsx)(`span`,{className:`mt-0.5 flex items-center gap-1`,"aria-hidden":!0,children:e.map(e=>(0,G.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:P[e].accent},title:A[e].label},e))})}function xt({data:e}){return(0,G.jsx)(`div`,{className:`h-full w-full rounded-xl border border-dashed border-foreground/25 bg-muted/35 px-3 pt-1.5`,children:(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:e.label}),e.badge?(0,G.jsx)(_t,{text:e.badge}):null]})})}function St({data:e}){let t=e.kind in P?e.kind:`flow`;return(0,G.jsxs)(J,{data:e,kind:t,className:m(K(e,t),`justify-center gap-0 rounded-full px-2`),style:q(t,e),"data-slot":`type-chip`,"data-type":e.refId,children:[(0,G.jsx)(Y,{type:`source`}),(0,G.jsx)(Y,{type:`target`}),(0,G.jsx)(`div`,{className:`min-w-0 truncate text-center text-[10px] leading-none font-medium tracking-wide text-foreground`,children:e.label})]})}function Ct({data:e}){return(0,G.jsxs)(J,{data:e,kind:`flow`,className:m(K(e,`flow`),`rounded-full px-2.5`),style:q(`flow`,e),"data-slot":`unit-chip`,"data-unit":e.refId,children:[(0,G.jsx)(Y,{type:`source`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`div`,{className:`truncate font-medium tracking-wide text-foreground uppercase`,children:e.label}),(0,G.jsx)(yt,{live:e.live??0,errors:e.errors??0})]}),(0,G.jsx)(bt,{elements:e.elements??[]})]}),e.badge?(0,G.jsx)(_t,{text:e.badge}):null]})}function wt({data:e}){let t=Ot(e.refId)??`flow`,n=P[t];return(0,G.jsxs)(J,{data:e,kind:t,className:m(K(e,t),`flex-col justify-center gap-0.5 rounded-full px-1.5 text-center`),style:{...q(t,e),boxShadow:e.highlighted?`0 0 0 1px ${n.accent}, 0 0 22px ${n.glow}`:`0 0 0 1px color-mix(in oklab, ${n.accent} 55%, transparent)`},"data-slot":`element-hub`,"data-element":t,children:[(0,G.jsx)(Y,{type:`target`}),(0,G.jsx)(Y,{type:`source`}),(0,G.jsx)(`span`,{className:`text-[18px] font-semibold tracking-tight text-foreground`,title:A[t].label,children:e.label})]})}function Tt(e){return e>=40?1.05:e>=12?1.55:2.2}function Et({data:e}){let t=Pe(),n=e.live??0,r=e.errors??0,[i,a]=(0,I.useState)(0),o=(0,I.useRef)(n);(0,I.useEffect)(()=>{n>o.current&&a(e=>e+1),o.current=n},[n]);let s=n>0,c=Tt(n),l=r>0?`var(--color-rose-400)`:`var(--foreground)`;return(0,G.jsxs)(`div`,{className:m(`relative flex h-full w-full items-center justify-center overflow-visible`,e.highlighted&&`z-10`),"data-slot":`law-hub`,"data-live":n,children:[(0,G.jsx)(Y,{type:`target`}),!t&&s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:`oke-law-ripple`,style:{animationDuration:`${c}s`,color:l}}),(0,G.jsx)(`span`,{"aria-hidden":!0,className:`oke-law-ripple`,style:{animationDuration:`${c}s`,animationDelay:`${c/2}s`,color:l}})]}):null,i>0&&!t?(0,G.jsx)(`span`,{"aria-hidden":!0,className:`oke-law-hit`,style:{color:l}},i):null,(0,G.jsx)(Ne.div,{className:`flex h-full w-full items-center justify-center rounded-full border-4 bg-card px-4 text-center`,style:{borderColor:`color-mix(in oklab, var(--foreground) 82%, var(--border))`,boxShadow:e.highlighted?`0 0 0 1px ${l}, 0 0 36px color-mix(in oklab, ${l} 28%, transparent)`:`inset 0 0 28px color-mix(in oklab, var(--foreground) 7%, transparent), 0 0 22px color-mix(in oklab, ${l} ${s?16:6}%, transparent)`},animate:t||!s?{scale:1}:{scale:[1,1.045,1]},transition:t||!s?{duration:0}:{duration:c,repeat:1/0,ease:`easeInOut`},children:(0,G.jsx)(Me,{className:`h-7 w-auto text-foreground`})})]})}function Dt(){return(0,G.jsx)(`div`,{className:`pointer-events-none h-full w-full rounded-full border border-dashed border-foreground/15`,"data-slot":`orbit`})}function Ot(e){return e in P?e:null}function X({data:e,kind:t,slot:n}){return(0,G.jsxs)(J,{data:e,kind:t,className:K(e,t),style:q(t,e),"data-slot":n,"data-flow-id":t===`flow`?e.refId:void 0,"data-highlighted":e.highlighted?`true`:`false`,children:[(0,G.jsx)(vt,{type:`target`,kind:t}),(0,G.jsx)(Y,{type:`source`}),(0,G.jsx)(gt,{kind:t}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 flex items-center gap-1.5`,children:(0,G.jsx)(_t,{text:e.badge??e.plane??e.facet??t})})]}),t===`flow`||t===`signal`?(0,G.jsx)(vt,{type:`source`,kind:t}):null]})}function kt({data:e}){return(0,G.jsx)(X,{data:e,kind:`flow`,slot:`flow-node`})}function At({data:e}){return(0,G.jsx)(X,{data:e,kind:`store`,slot:`store-node`})}function jt({data:e}){return(0,G.jsx)(X,{data:e,kind:`signal`,slot:`signal-node`})}function Mt({data:e}){return(0,G.jsx)(X,{data:e,kind:`ai`,slot:`ai-node`})}function Nt({data:e}){return(0,G.jsx)(X,{data:e,kind:`clock`,slot:`clock-node`})}function Pt({data:e}){return(0,G.jsx)(X,{data:e,kind:`gate`,slot:`gate-node`})}function Ft({data:e}){return(0,G.jsx)(X,{data:e,kind:`vault`,slot:`vault-node`})}function It({data:e}){return(0,G.jsx)(X,{data:e,kind:`channel`,slot:`channel-node`})}var Lt={unit:xt,unitChip:Ct,typeChip:St,element:wt,law:Et,orbit:Dt,flow:kt,store:At,signal:jt,ai:Mt,clock:Nt,gate:Pt,vault:Ft,channel:It};function Rt(e,t){let n=e.flows??{},r=new Set;if(t.kind===`unit`){for(let e of Object.keys(n))F(e)===t.unit&&r.add(e);let e=[];for(let t of r)for(let r of n[t]?.effects?.calls??[])ve(r)||e.push(r);for(let t of e)r.add(t)}else if(t.kind===`flow`){r.add(t.flowId);let e=n[t.flowId];for(let t of e?.effects?.calls??[])ve(t)||r.add(t);for(let[e,i]of Object.entries(n))i.effects?.calls?.includes(t.flowId)&&r.add(e)}else for(let[e,i]of Object.entries(n))zt(i,e,t.nodeId)&&r.add(e);let i={};for(let e of r){let t=n[e];t&&(i[e]=t)}return{...e,flows:i}}function zt(e,t,n){if(n===`flow:${t}`||n===`clock:${t}`&&(e.trigger?.cron||e.trigger?.every)||e.trigger?.signal&&n===`signal:${e.trigger.signal}`||e.gates?.some(e=>n===`gate:${e}`))return!0;let r=e.effects;return r?!!(r.reads?.some(e=>e===n)||r.writes?.some(e=>e===n)||r.emits?.some(e=>n===`signal:${e}`)||r.sends?.some(e=>n===`channel:${e}`)||r.asks?.some(e=>n===`ai:${e}`)||r.secrets?.some(e=>n===`vault:${e}`)||r.calls?.some(e=>{let t=ve(e);return t?n===ye(t.server):n===`flow:${e}`})):!1}var Bt=[`!=`,`>=`,`<=`,`=`,`>`,`<`],Vt={clauses:[]},Ht=[`flow`,`unit`,`trigger`,`plane`,`tenant`,`principal`,`cache`,`replica`,`error`,`buildVersion`,`promptVersion`,`duration`];function Ut(e){if(!e||!e.trim())return Vt;let t=e.split(/\s+AND\s+/i).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){let t=en(e);t&&n.push(t)}return{clauses:n}}function Z(e,t){return{clauses:[...e.clauses.filter(e=>e.dimension!==t.dimension),t]}}function Wt(e,t){return{clauses:e.clauses.filter(e=>e.dimension!==t)}}function Gt(e,t){return e.dimension===t.dimension&&e.op===t.op&&e.value===t.value}function Kt(e,t){return e.clauses.some(e=>Gt(e,t))}function qt(e,t){return Kt(e,t)?Wt(e,t.dimension):Z(e,t)}function Jt(e){let t=rn(e.dimension,e.value);return`${e.dimension} ${e.op} ${t}`}function Yt(e,t){for(let n of t.clauses)if(!an(e,n))return!1;return!0}function Xt(e,t){return t.clauses.length===0?[...e]:e.filter(e=>Yt(e,t))}function Zt(e){let t=/^(-?\d+(?:\.\d+)?)\s*(ms|s|m)?$/i.exec(e.trim());if(!t)return;let n=Number(t[1]),r=(t[2]??`ms`).toLowerCase();if(r===`ms`)return n;if(r===`s`)return n*1e3;if(r===`m`)return n*6e4}function Qt(e,t){switch(t){case`flow`:return e.flow;case`unit`:return e.unit??null;case`trigger`:return e.trigger;case`plane`:return e.plane;case`tenant`:return e.tenant??null;case`principal`:return e.principal??null;case`cache`:return e.cache;case`replica`:return e.replica??null;case`replicaLagMs`:case`replica_lag_ms`:return e.replicaLagMs??null;case`error`:case`error_code`:return e.error??null;case`buildVersion`:case`build_version`:return e.buildVersion??null;case`promptVersion`:case`prompt_version`:return e.promptVersion??null;case`cost`:return e.cost??null;case`duration`:case`duration_ms`:return e.durationMs;case`gates`:return e.gates.join(`,`);default:return e.dimensions[t]}}function $t(e){let t=new Set(Ht);for(let n of e)for(let e of Object.keys(n.dimensions))t.add(e);return[...t].sort()}function en(e){let t=null,n=-1;for(let r of Bt){let i=e.indexOf(` ${r} `);if(i!==-1){t=r,n=i;break}}if(t===null||n<0)return null;let r=e.slice(0,n).trim(),i=e.slice(n+t.length+2).trim();if(!r||!i)return null;let a=tn(r,i);return a===void 0?null:{dimension:r,op:t,value:a}}function tn(e,t){return e===`duration`||e===`duration_ms`?Zt(t):t===`true`?!0:t===`false`?!1:t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):/^-?\d+(\.\d+)?$/.test(t)?Number(t):t}function nn(e,t){return rn(e,t)}function rn(e,t){if(e===`duration`||e===`duration_ms`){let e=typeof t==`number`?t:Number(t);return Number.isFinite(e)?e>=6e4&&e%6e4==0?`${e/6e4}m`:e>=1e3&&e%1e3==0?`${e/1e3}s`:`${e}ms`:String(t)}return typeof t==`string`&&/\s/.test(t)?`"${t}"`:String(t)}function an(e,t){let n=Qt(e,t.dimension);if(n==null)return t.op===`!=`;let r=t.value;if(t.op===`=`)return on(n,r);if(t.op===`!=`)return!on(n,r);let i=Q(n),a=Q(r);return i===void 0||a===void 0?!1:t.op===`>`?i>a:t.op===`<`?i<a:t.op===`>=`?i>=a:t.op===`<=`&&i<=a}function on(e,t){if(typeof e==`number`||typeof t==`number`){let n=Q(e),r=Q(t);if(n!==void 0&&r!==void 0)return n===r}return String(e)===String(t)}function Q(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`boolean`)return;let t=Number(e);return Number.isFinite(t)?t:void 0}var sn=new Set(Object.keys(A));function cn(e){if(e.startsWith(`flow:`))return{kind:`flow`,flowId:e.slice(5)};if(e.startsWith(`signal:`))return{kind:`signal`,signal:e.slice(7)};if(e.startsWith(`unit:`))return{kind:`unit`,unit:e.slice(5)};if(e.startsWith(`element:`)){let t=e.slice(8);return sn.has(t)?{kind:`element`,element:t}:null}if(e.startsWith(`type:`)){let t=e.slice(5).split(`:`)[0];return t&&sn.has(t)?{kind:`element`,element:t}:null}return e.startsWith(`sql:`)||e.startsWith(`kv:`)||e.startsWith(`files:`)||e.startsWith(`index:`)||e.startsWith(`vault:`)||e.startsWith(`channel:`)||e.startsWith(`gate:`)||e.startsWith(`clock:`)||e.startsWith(`ai:`)?{kind:`resource`,nodeId:e}:null}function ln(e){switch(e.kind){case`flow`:return e.flowId;case`signal`:return`signal:${e.signal}`;case`unit`:return e.unit;case`element`:return A[e.element].label;case`resource`:return e.nodeId}}function un(e,t){return t?.kind===`flow`?Z(e,{dimension:`flow`,op:`=`,value:t.flowId}):t?.kind===`unit`?Z(e,{dimension:`unit`,op:`=`,value:t.unit}):e}function dn(e,t,n){if(t.kind===`flow`)return Yt(e,{clauses:[{dimension:`flow`,op:`=`,value:t.flowId}]});if(t.kind===`unit`)return(e.unit??F(e.flow))===t.unit;if(t.kind===`element`)return t.element===`flow`||Xe(e).includes(t.element);if(t.kind===`resource`)return fn(e,t.nodeId,n);let r=n?.flows??{};for(let[n,i]of Object.entries(r))if(n===e.flow&&(i.trigger?.signal===t.signal||i.effects?.emits?.includes(t.signal)))return!0;return!1}function fn(e,t,n){let r=t.includes(`:`)?t.slice(t.indexOf(`:`)+1):t;if(e.effects.some(e=>e.resource===t||e.resource===r)||e.gates.some(e=>t===`gate:${e}`))return!0;let i=n?.flows?.[e.flow];return!!(i&&zt(i,e.flow,t))}function pn(e,t,n){return t?e.filter(e=>dn(e,t,n)):[...e]}function mn(e){return e?e.kind===`unit`||e.kind===`flow`||e.kind===`resource`?e:e.kind===`signal`?{kind:`resource`,nodeId:`signal:${e.signal}`}:null:null}function hn({manifest:e,runs:t=[],graphFilter:n,highlightedFlowIds:r,highlightedNodeIds:s,follow:l,activeNodeId:d=null,focusedNodeId:f=null,orchestraLabel:p=null,onNodeClick:m,onPaneClick:h}){let{fitView:g}=a(),{theme:_}=Fe(),[v,y]=(0,I.useState)(null),b=_===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:_,x=mn(n),S=n?.kind===`element`?n.element:null,C=x===null,w=(0,I.useMemo)(()=>st(e,t,S?{kind:`element`,element:S}:null),[e,t,S]),T=(0,I.useMemo)(()=>Be(!x||!e?e:Rt(e,x)),[e,x]),E=(0,I.useMemo)(()=>ft(w.nodes,w.edges,{hoverNodeId:v,highlightedFlowIds:r,highlightedNodeIds:s,manifest:e}),[w.nodes,w.edges,v,r,s,e]),D=(0,I.useMemo)(()=>Re(T.nodes,r,s,{activeNodeId:d,focusedNodeId:f}),[T.nodes,r,s,d,f]),O=(0,I.useMemo)(()=>Le(T.edges,D),[T.edges,D]),k=C?E.nodes:D,ee=C?E.edges:O;return(0,I.useEffect)(()=>{g({duration:280,padding:.18})},[C,n,e,g]),(0,I.useEffect)(()=>{if(!l||C||r.size===0)return;let e=[...r].map(e=>`flow:${e}`);g({nodes:e.map(e=>({id:e})),duration:300,padding:.2})},[l,C,r,g]),(0,G.jsxs)(`div`,{className:`relative h-full w-full`,children:[n?(0,G.jsxs)(`button`,{type:`button`,"data-slot":`flow-graph-map`,onClick:()=>h?.(),className:`absolute top-2 left-2 z-10 inline-flex max-w-[min(100%-1rem,20rem)] items-center gap-1.5 truncate rounded-md border border-border/70 bg-card/90 px-2 py-1 text-[10px] font-medium text-muted-foreground shadow-sm backdrop-blur-sm transition-colors hover:border-border hover:text-foreground`,children:[(0,G.jsx)(`span`,{className:`text-foreground`,children:`Map`}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`/`}),(0,G.jsx)(`span`,{className:`truncate`,children:ln(n)})]}):(0,G.jsx)(`div`,{className:`pointer-events-none absolute top-2 left-2 z-10 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:p?(0,G.jsxs)(G.Fragment,{children:[`Orchestra `,(0,G.jsx)(`span`,{className:`text-foreground normal-case`,children:p})]}):`Hover a unit — spokes light the elements it touches`}),(0,G.jsxs)(i,{nodes:k,edges:ee,nodeTypes:Lt,colorMode:b,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},minZoom:.15,maxZoom:1.6,defaultEdgeOptions:{type:`smoothstep`,zIndex:M.edge},zIndexMode:`manual`,onNodeClick:(e,t)=>m?.(t.id),onPaneClick:()=>h?.(),onNodeMouseEnter:(e,t)=>y(t.id),onNodeMouseLeave:()=>y(null),children:[(0,G.jsx)(u,{gap:24,size:1,color:`color-mix(in oklab, var(--foreground) 14%, transparent)`}),(0,G.jsx)(c,{showInteractive:!1}),(0,G.jsx)(o,{pannable:!0,zoomable:!0,ariaLabel:`Flow graph overview`,bgColor:`var(--card)`,maskColor:`color-mix(in oklab, var(--background) 55%, transparent)`,nodeColor:gn,nodeStrokeColor:_n,nodeStrokeWidth:12,nodeBorderRadius:10})]})]})}function gn(e){if(e.type===`orbit`)return`transparent`;let t=e.data.kind;if(t===`law`)return`color-mix(in oklab, var(--foreground) 45%, transparent)`;if(t===`unit`)return`color-mix(in oklab, var(--foreground) 8%, transparent)`;if(t===`element`){let t=e.data.refId;return P[t]?.accent??`#64748B`}return t in P?P[t].accent:`#64748B`}function _n(e){return e.data.kind===`unit`?`color-mix(in oklab, var(--foreground) 32%, transparent)`:`transparent`}function vn(e){let{leading:t,...n}=e;return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-col`,"data-slot":`flow-graph`,children:[t?(0,G.jsxs)(`header`,{className:w,children:[t,(0,G.jsx)(`span`,{className:`w-px shrink-0 self-stretch bg-border/60`,"aria-hidden":!0})]}):null,(0,G.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,G.jsx)(l,{children:(0,G.jsx)(hn,{...n})})})]})}var yn=`orch-`;function bn(e){return e.startsWith(yn)}function xn(e,t){return e&&t}function Sn(e,t=Math.random){let n=e.filter(e=>!bn(e.id)&&e.flow.length>0);return n.length===0?null:n[Math.floor(t()*n.length)]??null}function Cn(e,t,n){let r=t-e.startedAt,i=e.flow.replaceAll(`.`,`-`);return{...e,id:`${yn}${n}-${i}`,parentId:null,startedAt:t,endedAt:t+e.durationMs,effects:e.effects.map(e=>({...e,timestamp:e.timestamp+r})),logs:e.logs.map(e=>({...e,at:e.at+r}))}}function wn(e=Math.random){return 1800+Math.floor(e()*1600)}var Tn=1400;function En(e){let t=S(),[n,r]=(0,I.useState)(null),i=(0,I.useRef)(0),a=(0,I.useRef)(null),o=(0,I.useRef)(null),s=(0,I.useRef)(e.paused);return s.current=e.paused,(0,I.useEffect)(()=>{if(!xn(!1,e.enabled))return;let n=()=>{a.current&&=(clearTimeout(a.current),null)},c=()=>{if(s.current||document.hidden)return;let e=Sn(t.getQueryData(ge)??[]);if(!e)return;i.current+=1;let o=Cn(e,Date.now(),i.current);t.setQueryData(ge,e=>he(e??[],o)),r({flowId:o.flow,runId:o.id}),n(),a.current=setTimeout(()=>{r(null),a.current=null},Tn)},l=e=>{o.current=setTimeout(()=>{c(),l(wn())},e)};l(700);let u=()=>{document.hidden&&(r(null),n())};return document.addEventListener(`visibilitychange`,u),()=>{document.removeEventListener(`visibilitychange`,u),o.current&&clearTimeout(o.current),n(),r(null)}},[e.enabled,t]),e.paused?null:n}function Dn(e,t){let n=new Set;if(!t)return n;let r=new Map,i=new Map;for(let t of e)r.set(t.id,t);for(let t of e){if(!t.parentId)continue;let e=i.get(t.parentId)??[];e.push(t),i.set(t.parentId,e)}let a=r.get(t);if(!a)return n;let o=a,s=new Set;for(;o&&!s.has(o.id);)s.add(o.id),n.add(o.flow),o=o.parentId?r.get(o.parentId):void 0;let c=[a];for(;c.length>0;){let e=c.shift();if(!e)break;for(let t of i.get(e.id)??[])s.has(t.id)||(s.add(t.id),n.add(t.flow),c.push(t))}return n}var On=[{id:`signal`,label:`Signal`,expr:`trigger = signal`},{id:`clock`,label:`Clock`,expr:`trigger = cron`},{id:`cache-miss`,label:`Cache miss`,expr:`cache = miss`},{id:`slow`,label:`Slow`,expr:`duration > 100ms`}],kn=`h-7 min-w-0 rounded-none border-0 bg-transparent px-0 font-mono text-[11px] text-foreground shadow-none outline-none focus-visible:ring-0 dark:bg-transparent`,$=`rounded-none border-0 bg-transparent px-1.5 py-1 text-[11px] text-foreground/70 shadow-none transition-colors hover:bg-muted/50 hover:text-foreground`,An=`grid grid-cols-[minmax(0,1fr)_1.25rem_minmax(0,1fr)_1.25rem] items-center gap-x-1`;function jn({query:e,runs:t,onChange:n}){let r=(0,I.useMemo)(()=>$t(t),[t]),i=(0,I.useMemo)(()=>[...new Set([...Ht,...r])].sort(),[r]),[a,o]=(0,I.useState)(`trigger`),[s,c]=(0,I.useState)(`=`),[l,u]=(0,I.useState)(`signal`),[d,f]=(0,I.useState)(!1),h=()=>{let t=Ut(`${a} ${s} ${l}`).clauses[0];t&&(n(Z(e,t)),f(!1))};return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-b border-border/60 px-2 py-1.5`,"data-slot":`traces-advanced-filters`,children:[e.clauses.length>0?(0,G.jsx)(`ul`,{"aria-label":`Active filters`,className:`flex flex-col gap-0.5`,children:e.clauses.map(t=>(0,G.jsx)(`li`,{children:(0,G.jsx)(Mn,{clause:t,onRemove:()=>n(Wt(e,t.dimension))})},t.dimension))}):null,d?(0,G.jsxs)(`div`,{className:An,"data-slot":`traces-advanced-composer`,children:[(0,G.jsx)(`select`,{"aria-label":`Filter dimension`,className:kn,value:a,onChange:e=>o(e.target.value),children:i.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}),(0,G.jsx)(`select`,{"aria-label":`Filter operator`,className:m(kn,`text-center text-foreground/70`),value:s,onChange:e=>c(e.target.value),children:[`=`,`!=`,`>`,`<`,`>=`,`<=`].map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}),(0,G.jsx)(p,{"aria-label":`Filter value`,flat:!0,className:`h-7 px-0 font-mono text-[11px]`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()}}),(0,G.jsx)(`button`,{type:`button`,className:$,onClick:h,children:`Add`})]}):null,(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[On.map(t=>{let r=Ut(t.expr).clauses[0],i=r!==void 0&&Kt(e,r);return(0,G.jsx)(`button`,{type:`button`,"aria-pressed":i,disabled:r===void 0,onClick:()=>{r&&n(qt(e,r))},className:m($,i?`font-medium text-foreground`:`text-foreground/70`),children:t.label},t.id)}),(0,G.jsx)(`button`,{type:`button`,"aria-expanded":d,className:m($,`ml-auto`,d&&`text-foreground`),onClick:()=>f(e=>!e),children:d?`Cancel`:`Add clause`}),e.clauses.length>0?(0,G.jsx)(`button`,{type:`button`,className:$,onClick:()=>n(Ut(``)),children:`Clear`}):null]})]})}function Mn({clause:e,onRemove:t}){let n=Jt(e);return(0,G.jsxs)(`div`,{className:An,"data-slot":`traces-advanced-clause`,children:[(0,G.jsx)(`span`,{className:`truncate font-mono text-[11px] text-foreground/80`,children:e.dimension}),(0,G.jsx)(`span`,{className:`text-center font-mono text-[11px] text-foreground/65`,"aria-hidden":!0,children:e.op}),(0,G.jsx)(`span`,{className:`truncate font-mono text-[11px] text-foreground`,children:nn(e.dimension,e.value)}),(0,G.jsx)(`button`,{type:`button`,className:m($,`flex size-5 items-center justify-center text-foreground/55 hover:text-destructive`),"aria-label":`Remove ${n}`,onClick:t,children:(0,G.jsx)(f,{icon:C,className:`size-3`})})]})}var Nn={query:``,status:`all`,advanced:Vt};function Pn(e,t){let n=t.trim().toLowerCase();return!n||[e.flow,e.unit??``,e.trigger,e.cache,e.id,e.error??``,e.errorMessage??``].some(e=>e.toLowerCase().includes(n))}function Fn(e,t){return Xt(e.filter(e=>!(!Pn(e,t.query)||t.status===`errors`&&e.error===null)),t.advanced)}function In(e,t=Date.now()){let n=t-e;return n<1e3?`just now`:n<6e4?`${Math.floor(n/1e3)}s ago`:n<36e5?`${Math.floor(n/6e4)}m ago`:`${Math.floor(n/36e5)}h ago`}function Ln(e,t=Date.now()){let n=In(e.startedAt,t),r=e.error!==null;return{text:n,title:r?e.errorMessage?`${e.error} — ${e.errorMessage}`:e.error??n:n,failed:r}}function Rn({run:e,selected:t,onSelect:n,copyText:r=async e=>{await navigator.clipboard.writeText(e)}}){let i=Ln(e),a=i.failed,o=Oe(e.trigger),s=e.cache,[c,l]=(0,I.useState)(null),u=async t=>{t.stopPropagation();try{await r(Ae(e)),l(`Copied run id`)}catch{l(`Copy failed`)}};return(0,G.jsxs)(`div`,{"data-slot":`trace-row`,"data-run-id":e.id,"data-selected":t?`true`:`false`,"data-failed":a?`true`:`false`,"data-cache":e.cache,className:m(`group relative flex w-full items-stretch border-b border-border/60 text-xs transition-colors`,`hover:bg-muted/50 focus-within:bg-muted/50`,t&&`bg-muted/70`,a&&`bg-destructive/[0.04]`),children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:m(`absolute inset-y-0 left-0 w-0.5`,t&&!a&&`bg-sky-500`,a&&`bg-destructive`)}),(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>n(e.id),className:`flex min-w-0 flex-1 items-center gap-2 py-1.5 pr-1 pl-0 text-left outline-none`,children:[(0,G.jsx)(`span`,{className:m(`ml-2.5 size-1.5 shrink-0 rounded-full`,a?`bg-destructive`:`bg-emerald-500`),"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,title:o.label,"aria-hidden":!0,children:(0,G.jsx)(f,{icon:o.icon,className:`size-3.5`})}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-foreground`,children:e.flow}),(0,G.jsx)(He,{cache:s,dataSlot:`trace-row-cache`}),(0,G.jsx)(`span`,{className:m(`w-10 shrink-0 text-right tabular-nums font-medium`,de(e.durationMs)),children:me(e.durationMs)}),(0,G.jsx)(`span`,{className:`w-14 shrink-0 truncate text-right tabular-nums text-muted-foreground`,title:i.title,"data-slot":`trace-row-meta`,children:i.text})]}),(0,G.jsx)(`div`,{className:m(`flex shrink-0 items-center gap-0.5 pr-1.5 opacity-0 transition-opacity`,`group-hover:opacity-100 group-focus-within:opacity-100`,c&&`opacity-100`),children:(0,G.jsxs)(h,{children:[(0,G.jsx)(_,{render:e=>(0,G.jsx)(T,{...e,type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Copy run ID`,"data-slot":`trace-copy-id`,onClick:t=>{e.onClick?.(t),u(t)},children:(0,G.jsx)(f,{icon:k,className:`size-3`})})}),(0,G.jsx)(g,{side:`top`,children:`Copy run ID`})]})}),c?(0,G.jsx)(`span`,{className:`sr-only`,role:`status`,children:c}):null]})}var zn=[{value:`all`,label:`All`,icon:We},{value:`errors`,label:`Errors`,icon:ue}];function Bn({runs:e,selectedRunId:t,onSelect:n,liveStatus:r,manifest:i,graphFilter:a,onGraphFilterChange:o,focusEffectIndex:s,onFocusEffectChange:c,playbackKey:l,onReplayStart:u,selectedRun:p}){let[v,x]=(0,I.useState)(Nn),[S,C]=(0,I.useState)(!1);(0,I.useEffect)(()=>{(a?.kind===`flow`||a?.kind===`unit`)&&x(e=>({...e,advanced:un(e.advanced,a)}))},[a]);let T=(0,I.useMemo)(()=>pn(Fn(e,v),a,i),[e,v,a,i]),O=(0,I.useMemo)(()=>p===void 0?t?e.find(e=>e.id===t)??null:null:p,[p,e,t]),k=v.advanced.clauses.length>0,re=e=>{x(t=>({...t,query:e}))},ae=e=>{x(t=>({...t,status:e}))};return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,"data-slot":`traces-pane`,children:[(0,G.jsxs)(`div`,{className:`shrink-0 border-b border-border/60`,children:[(0,G.jsxs)(`div`,{className:m(d,`border-b-0`),children:[(0,G.jsx)(ee,{value:v.query,onChange:e=>re(e.target.value),placeholder:`Search traces…`,"aria-label":`Search traces`,"data-slot":`traces-search`}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-stretch pr-0.5`,children:[e.length>0?(0,G.jsxs)(h,{children:[(0,G.jsx)(_,{render:e=>(0,G.jsxs)(`button`,{...e,type:`button`,"aria-expanded":S,"aria-controls":`traces-advanced-panel`,"aria-label":k?`Advanced filters, ${v.advanced.clauses.length} active`:`Advanced filters`,"data-slot":`traces-advanced-toggle`,onClick:t=>{e.onClick?.(t),C(e=>!e)},className:m(b,`relative`,(S||k)&&`text-foreground`),children:[(0,G.jsx)(f,{icon:Te,className:`size-3`,"aria-hidden":!0}),k?(0,G.jsx)(`span`,{className:`absolute -top-0.5 -inset-e-0.5 flex size-3.5 items-center justify-center rounded-full bg-foreground text-[8px] font-medium text-background`,"aria-hidden":!0,children:v.advanced.clauses.length}):null]})}),(0,G.jsx)(g,{side:`bottom`,children:`Advanced`})]}):null,e.length>0?(0,G.jsx)(`span`,{className:`mx-0.5 h-3 w-px bg-border/60`,"aria-hidden":!0}):null,(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 pr-0.5 text-[10px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:r===`open`?`size-1.5 rounded-full bg-emerald-500`:`size-1.5 rounded-full bg-muted-foreground`,"aria-hidden":!0}),r===`open`?`live`:`polling`]})]})]}),e.length>0?(0,G.jsx)(`div`,{className:m(w,`border-t border-b-0`),"data-slot":`traces-filters`,children:(0,G.jsx)(`div`,{className:`flex shrink-0 items-stretch`,role:`group`,"aria-label":`Status filter`,children:zn.map(({value:e,label:t,icon:n})=>{let r=v.status===e;return(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>ae(e),className:m(y,`font-semibold tracking-[0.08em] uppercase`,r?e===`errors`?`text-destructive`:D:E),children:[(0,G.jsx)(f,{icon:n,className:`size-3`,"aria-hidden":!0}),t]},e)})})}):null,e.length>0&&a?(0,G.jsxs)(`button`,{type:`button`,"data-slot":`traces-graph-filter`,onClick:()=>o(null),title:`Clear graph filter`,className:`mx-2 mb-1.5 inline-flex max-w-full items-center gap-1 self-start truncate rounded-md border border-sky-500/40 bg-sky-500/10 px-2 py-0.5 text-[10px] font-medium text-sky-700 transition-colors hover:bg-sky-500/20 dark:text-sky-400`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:ln(a)}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`×`})]}):null]}),e.length>0?(0,G.jsx)(Ue,{id:`traces-advanced-panel`,role:`region`,"aria-label":`Advanced filters`,open:S,className:`shrink-0`,children:(0,G.jsx)(jn,{query:v.advanced,runs:e,onChange:e=>{x(t=>({...t,advanced:e}))}})}):null,(0,G.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:e.length===0?(0,G.jsx)(ie,{className:`border-none`,children:(0,G.jsxs)(te,{children:[(0,G.jsx)(ne,{variant:`icon`,children:(0,G.jsx)(f,{icon:A.flow.icon})}),(0,G.jsx)(se,{children:`No traces yet`}),(0,G.jsx)(le,{children:`No runs for the flows on this graph yet. Trigger a flow to see live activity here.`})]})}):T.length===0?(0,G.jsx)(ie,{className:`border-none`,children:(0,G.jsxs)(te,{children:[(0,G.jsx)(se,{children:`No matching traces`}),(0,G.jsx)(le,{children:`Nothing in this list matches the current search, status, or advanced filters.`})]})}):T.map(e=>(0,G.jsx)(Rn,{run:e,selected:e.id===t,onSelect:e=>n(e===t?null:e)},e.id))}),(0,G.jsx)(je,{run:O,onClose:()=>n(null),focusEffectIndex:s,onFocusEffectChange:c,playbackKey:l,onReplayStart:u})]})}function Vn(){let e=pe(),t=_e(),n=fe(!0),{selectedRunId:r,selectedFlowId:i,follow:a,setSelectedRun:o,setSelectedFlow:s}=Ie(),c=ae(),l=(0,G.jsx)(oe,{open:c.open,onToggle:c.toggle,noun:`traces`,controlsId:`overview-traces`,dataSlot:`overview-traces-toggle`}),[u,d]=(0,I.useState)(null),[f,p]=(0,I.useState)(null),[m,h]=(0,I.useState)(0),[g,_]=(0,I.useState)(null),y=(0,I.useRef)(null),b=(0,I.useMemo)(()=>new Set(Object.keys(e.data?.flows??{})),[e.data]),S=(0,I.useMemo)(()=>ze(t.data??[],b),[t.data,b]),C=En({enabled:!!e.data&&S.length>0,paused:r!=null||u!=null});(0,I.useEffect)(()=>{i&&d(e=>e?.kind===`flow`&&e.flowId===i?e:{kind:`flow`,flowId:i})},[i]);let w=(0,I.useCallback)(e=>{d(e),e?.kind===`flow`?s(e.flowId):s(null)},[s]),T=(0,I.useMemo)(()=>{let e=Dn(t.data??[],r);return e.size>0?e:i?new Set([i]):C?.flowId?new Set([C.flowId]):e},[t.data,r,i,C?.flowId]),E=(0,I.useMemo)(()=>{let t=new Set,n=e.data?.flows??{};for(let e of T){let r=n[e];if(r){r.trigger?.signal&&t.add(`signal:${r.trigger.signal}`),(r.trigger?.cron||r.trigger?.every)&&t.add(`clock:${e}`);for(let e of r.gates??[])t.add(`gate:${e}`);for(let e of r.effects?.reads??[])t.add(e);for(let e of r.effects?.writes??[])t.add(e);for(let e of r.effects?.emits??[])t.add(`signal:${e}`);for(let e of r.effects?.sends??[])t.add(`channel:${e}`);for(let e of r.effects?.asks??[])t.add(`ai:${e}`);for(let e of r.effects?.secrets??[])t.add(`vault:${e}`)}}return t},[T,e.data]),D=(0,I.useMemo)(()=>r?t.data?.find(e=>e.id===r)??null:null,[t.data,r]),k=(0,I.useCallback)(e=>{let t=cn(e);t&&w(u&&u.kind===t.kind&&JSON.stringify(u)===JSON.stringify(t)?null:t)},[w,u]),ee=(0,I.useCallback)(()=>{w(null)},[w]),te=(0,I.useCallback)(()=>{h(e=>e+1)},[]);return(0,I.useEffect)(()=>{if(m===0||!D)return;let n=ke(Dn(t.data??[],D.id),e.data??null);if(n.length===0)return;let r=Ee(D.durationMs),i=performance.now();return _(n[0]??null),y.current=setInterval(()=>{let e=Math.min(1,(performance.now()-i)/r);_(De(n,e)),e>=1&&y.current&&(clearInterval(y.current),y.current=null,setTimeout(()=>_(null),400))},60),()=>{y.current&&=(clearInterval(y.current),null),_(null)}},[m,D,t.data,e.data]),(0,G.jsx)(`div`,{className:x,"data-slot":`flows-page`,children:(0,G.jsxs)(O,{orientation:`horizontal`,className:`min-h-0 flex-1`,children:[(0,G.jsx)(re,{panelRef:c.panelRef,collapsible:!0,collapsedSize:0,defaultSize:v.start.defaultSize,minSize:v.start.minSize,maxSize:`50%`,onResize:c.onResize,className:`min-h-0`,children:(0,G.jsx)(`div`,{id:`overview-traces`,className:`h-full min-h-0 overflow-hidden`,"data-slot":`overview-traces`,children:(0,G.jsx)(Bn,{runs:S,selectedRunId:r,onSelect:o,liveStatus:n,manifest:e.data??null,graphFilter:u,onGraphFilterChange:w,focusEffectIndex:f,onFocusEffectChange:p,playbackKey:m,onReplayStart:te,selectedRun:D})})}),c.open?(0,G.jsx)(ce,{withHandle:!0}):null,(0,G.jsx)(re,{defaultSize:v.end.defaultSize,minSize:v.end.minSize,className:`min-h-0`,children:(0,G.jsx)(`div`,{className:`h-full min-h-0 overflow-hidden`,children:(0,G.jsx)(vn,{manifest:e.data??null,runs:S,graphFilter:u,highlightedFlowIds:T,highlightedNodeIds:E,orchestraLabel:C?.flowId??null,follow:a,activeNodeId:g,onNodeClick:k,onPaneClick:ee,leading:l})})})]})})}export{Vn as FlowsPage};
@@ -1,4 +1,4 @@
1
- import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{r}from"./react-dom-Ddte4I-Q.js";import{A as i}from"./xyflow-yApv7D4e.js";import{Yi as a,Yr as o,Zr as s,ha as c}from"./shortcut-keys-3ILd8oGn.js";import{o as l,t as u}from"./index-MqeU3hlt.js";var d=[[`path`,{d:`M20.5 5.5H9.5C5.78672 5.5 3 8.18503 3 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3.5 18.5H14.5C18.2133 18.5 21 15.815 21 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M18.5 3C18.5 3 21 4.84122 21 5.50002C21 6.15882 18.5 8 18.5 8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M5.49998 16C5.49998 16 3.00001 17.8412 3 18.5C2.99999 19.1588 5.5 21 5.5 21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],f=[[`path`,{d:`M16 2V6M8 2V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13 4H11C7.22876 4 5.34315 4 4.17157 5.17157C3 6.34315 3 8.22876 3 12V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V12C21 8.22876 21 6.34315 19.8284 5.17157C18.6569 4 16.7712 4 13 4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 10H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12.1258 14H12.0008M12.1258 18H12.0008M7.625 14H7.5M7.625 18H7.5M16.625 14H16.5M12.2508 14C12.2508 14.1381 12.1389 14.25 12.0008 14.25C11.8628 14.25 11.7508 14.1381 11.7508 14C11.7508 13.8619 11.8628 13.75 12.0008 13.75C12.1389 13.75 12.2508 13.8619 12.2508 14ZM12.2508 18C12.2508 18.1381 12.1389 18.25 12.0008 18.25C11.8628 18.25 11.7508 18.1381 11.7508 18C11.7508 17.8619 11.8628 17.75 12.0008 17.75C12.1389 17.75 12.2508 17.8619 12.2508 18ZM7.75 14C7.75 14.1381 7.63807 14.25 7.5 14.25C7.36193 14.25 7.25 14.1381 7.25 14C7.25 13.8619 7.36193 13.75 7.5 13.75C7.63807 13.75 7.75 13.8619 7.75 14ZM7.75 18C7.75 18.1381 7.63807 18.25 7.5 18.25C7.36193 18.25 7.25 18.1381 7.25 18C7.25 17.8619 7.36193 17.75 7.5 17.75C7.63807 17.75 7.75 17.8619 7.75 18ZM16.75 14C16.75 14.1381 16.6381 14.25 16.5 14.25C16.3619 14.25 16.25 14.1381 16.25 14C16.25 13.8619 16.3619 13.75 16.5 13.75C16.6381 13.75 16.75 13.8619 16.75 14Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],p=[[`path`,{d:`M11.0809 13.152L8 7L13.4196 11.2796C14.1901 11.888 14.1941 13.0472 13.4277 13.6607C12.6614 14.2743 11.5189 14.0266 11.0809 13.152Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5 4.82C3.14864 6.63902 2 9.17385 2 11.9776C2 17.5129 6.47715 22.0001 12 22.0001C17.5228 22.0001 22 17.5129 22 11.9776C22 7.1242 18.5581 3.07656 13.9872 2.15288C13.1512 1.98394 12.7332 1.89947 12.3666 2.20022C12 2.50097 12 2.98714 12 3.95949V4.96175`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],m=t(r(),1),h=500;function g(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return[t,...e].slice(0,h);let r=e.slice();return r[n]=t,r}function _(e,t){let n=e;for(let e of t)n=g(n,e);return n}async function v(e,t){let n=await e();n.error||t([...n.data?.runs??[]])}function ee(e){let t=e.pollMs??5e3,n=e.reconnectMs??2e3,r=e.setTimeout??setTimeout,i=e.clearTimeout??clearTimeout,a=e.setInterval??setInterval,o=e.clearInterval??clearInterval,s=null,c=null,l=null,u=!0,d=()=>{c!==null&&(o(c),c=null)},f=()=>{c===null&&(c=a(()=>{e.onPoll()},t))},p=()=>{if(u)return;l!==null&&(i(l),l=null);let t=`${e.protocol}//${e.host}/console/live`;s=new e.WebSocket(t),e.setStatus(`connecting`),s.onopen=()=>{u||(e.setStatus(`open`),d())},s.onmessage=t=>{if(!u)try{e.onMessage(JSON.parse(String(t.data)))}catch{}},s.onclose=()=>{u||(e.setStatus(`closed`),f(),l=r(()=>{l=null,u||p()},n))},s.onerror=()=>{s?.close()}};return{start(){u=!1,p()},stop(){u=!0,d(),l!==null&&(i(l),l=null),s?.close(),s=null}}}var te=[`console.manifest.get`];function ne(){return a({queryKey:te,queryFn:async()=>{let e=await o();if(e.error)throw Error(e.error.code);return e.data?.manifest??null}})}var re=[`console.runs.list`];function ie(){return a({queryKey:re,queryFn:async()=>{let e=await s();if(e.error)throw Error(e.error.code);return e.data?.runs??[]}})}function ae(e){let t=c(),[n,r]=(0,m.useState)(`connecting`);return(0,m.useEffect)(()=>{if(!e)return;let n=e=>{if(e.type===`manifest`){t.setQueryData(te,e.manifest);return}if(e.type===`manifest.diff`){t.setQueryData(te,e.after);return}if(e.type===`run`){t.setQueryData(re,t=>g(t??[],e.run));return}if(e.type===`runs.batch`){t.setQueryData(re,t=>_(t??[],e.runs));return}},i=window.location.protocol===`https:`?`wss:`:`ws:`,a=ee({WebSocket:globalThis.WebSocket,host:window.location.host,protocol:i,setStatus:r,onMessage:n,onPoll:()=>{v(s,e=>{t.setQueryData(re,e)})}});return a.start(),()=>{a.stop()}},[e,t]),n}function oe(e){if(!Number.isFinite(e)||e<0)return`0μs`;if(e<1)return`${Math.round(e*1e3)}μs`;if(e<1e3){let t=Math.round(e*10)/10;return Number.isInteger(t)?`${t}ms`:`${t.toFixed(1)}ms`}let t=e/1e3,n=Math.round(t*10)/10;return Number.isInteger(n)?`${n}s`:`${n.toFixed(1)}s`}function se(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var ce=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,le=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ue={};function de(e,t){return((t||ue).jsx?le:ce).test(e)}var fe=/[ \t\n\f\r]/g;function pe(e){return typeof e==`object`?e.type===`text`&&me(e.value):me(e)}function me(e){return e.replace(fe,``)===``}var he=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};he.prototype.normal={},he.prototype.property={},he.prototype.space=void 0;function ge(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new he(n,r,t)}function _e(e){return e.toLowerCase()}var y=class{constructor(e,t){this.attribute=t,this.property=e}};y.prototype.attribute=``,y.prototype.booleanish=!1,y.prototype.boolean=!1,y.prototype.commaOrSpaceSeparated=!1,y.prototype.commaSeparated=!1,y.prototype.defined=!1,y.prototype.mustUseProperty=!1,y.prototype.number=!1,y.prototype.overloadedBoolean=!1,y.prototype.property=``,y.prototype.spaceSeparated=!1,y.prototype.space=void 0;var ve=e({boolean:()=>b,booleanish:()=>x,commaOrSpaceSeparated:()=>T,commaSeparated:()=>w,number:()=>S,overloadedBoolean:()=>be,spaceSeparated:()=>C}),ye=0,b=E(),x=E(),be=E(),S=E(),C=E(),w=E(),T=E();function E(){return 2**++ye}var xe=Object.keys(ve),Se=class extends y{constructor(e,t,n,r){let i=-1;if(super(e,t),Ce(this,`space`,r),typeof n==`number`)for(;++i<xe.length;){let e=xe[i];Ce(this,xe[i],(n&ve[e])===ve[e])}}};Se.prototype.defined=!0;function Ce(e,t,n){n&&(e[t]=n)}function we(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Se(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_e(r)]=r,n[_e(a.attribute)]=r}return new he(t,n,e.space)}var Te=we({properties:{ariaActiveDescendant:null,ariaAtomic:x,ariaAutoComplete:null,ariaBusy:x,ariaChecked:x,ariaColCount:S,ariaColIndex:S,ariaColSpan:S,ariaControls:C,ariaCurrent:null,ariaDescribedBy:C,ariaDetails:null,ariaDisabled:x,ariaDropEffect:C,ariaErrorMessage:null,ariaExpanded:x,ariaFlowTo:C,ariaGrabbed:x,ariaHasPopup:null,ariaHidden:x,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:C,ariaLevel:S,ariaLive:null,ariaModal:x,ariaMultiLine:x,ariaMultiSelectable:x,ariaOrientation:null,ariaOwns:C,ariaPlaceholder:null,ariaPosInSet:S,ariaPressed:x,ariaReadOnly:x,ariaRelevant:null,ariaRequired:x,ariaRoleDescription:C,ariaRowCount:S,ariaRowIndex:S,ariaRowSpan:S,ariaSelected:x,ariaSetSize:S,ariaSort:null,ariaValueMax:S,ariaValueMin:S,ariaValueNow:S,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ee(e,t){return t in e?e[t]:t}function De(e,t){return Ee(e,t.toLowerCase())}var Oe=we({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:w,acceptCharset:C,accessKey:C,action:null,allow:null,allowFullScreen:b,allowPaymentRequest:b,allowUserMedia:b,alpha:b,alt:null,as:null,async:b,autoCapitalize:null,autoComplete:C,autoFocus:b,autoPlay:b,blocking:C,capture:null,charSet:null,checked:b,cite:null,className:C,closedBy:null,colorSpace:null,cols:S,colSpan:S,command:null,commandFor:null,content:null,contentEditable:x,controls:b,controlsList:C,coords:S|w,crossOrigin:null,data:null,dateTime:null,decoding:null,default:b,defer:b,dir:null,dirName:null,disabled:b,download:be,draggable:x,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:b,formTarget:null,headers:C,height:S,hidden:be,high:S,href:null,hrefLang:null,htmlFor:C,httpEquiv:C,id:null,imageSizes:null,imageSrcSet:null,inert:b,inputMode:null,integrity:null,is:null,isMap:b,itemId:null,itemProp:C,itemRef:C,itemScope:b,itemType:C,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:b,low:S,manifest:null,max:null,maxLength:S,media:null,method:null,min:null,minLength:S,multiple:b,muted:b,name:null,nonce:null,noModule:b,noValidate:b,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:b,optimum:S,pattern:null,ping:C,placeholder:null,playsInline:b,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:b,referrerPolicy:null,rel:C,required:b,reversed:b,rows:S,rowSpan:S,sandbox:C,scope:null,scoped:b,seamless:b,selected:b,shadowRootClonable:b,shadowRootCustomElementRegistry:b,shadowRootDelegatesFocus:b,shadowRootMode:null,shadowRootSerializable:b,shape:null,size:S,sizes:null,slot:null,span:S,spellCheck:x,src:null,srcDoc:null,srcLang:null,srcSet:null,start:S,step:null,style:null,tabIndex:S,target:null,title:null,translate:null,type:null,typeMustMatch:b,useMap:null,value:x,width:S,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:C,axis:null,background:null,bgColor:null,border:S,borderColor:null,bottomMargin:S,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:b,declare:b,event:null,face:null,frame:null,frameBorder:null,hSpace:S,leftMargin:S,link:null,longDesc:null,lowSrc:null,marginHeight:S,marginWidth:S,noResize:b,noHref:b,noShade:b,noWrap:b,object:null,profile:null,prompt:null,rev:null,rightMargin:S,rules:null,scheme:null,scrolling:x,standby:null,summary:null,text:null,topMargin:S,valueType:null,version:null,vAlign:null,vLink:null,vSpace:S,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:b,disablePictureInPicture:b,disableRemotePlayback:b,exportParts:w,part:C,prefix:null,property:null,results:S,security:null,unselectable:null},space:`html`,transform:De}),ke=we({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:T,accentHeight:S,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:S,amplitude:S,arabicForm:null,ascent:S,attributeName:null,attributeType:null,azimuth:S,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:S,by:null,calcMode:null,capHeight:S,className:C,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:S,diffuseConstant:S,direction:null,display:null,dur:null,divisor:S,dominantBaseline:null,download:b,dx:null,dy:null,edgeMode:null,editable:null,elevation:S,enableBackground:null,end:null,event:null,exponent:S,externalResourcesRequired:null,fill:null,fillOpacity:S,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:w,g2:w,glyphName:w,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:S,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:S,horizOriginX:S,horizOriginY:S,id:null,ideographic:S,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:S,k:S,k1:S,k2:S,k3:S,k4:S,kernelMatrix:T,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:S,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:S,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:S,overlineThickness:S,paintOrder:null,panose1:null,path:null,pathLength:S,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:C,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:S,pointsAtY:S,pointsAtZ:S,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:T,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:T,rev:T,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:T,requiredFeatures:T,requiredFonts:T,requiredFormats:T,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:S,specularExponent:S,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:S,strikethroughThickness:S,string:null,stroke:null,strokeDashArray:T,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:S,strokeOpacity:S,strokeWidth:null,style:null,surfaceScale:S,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:T,tabIndex:S,tableValues:null,target:null,targetX:S,targetY:S,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:T,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:S,underlineThickness:S,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:S,values:null,vAlphabetic:S,vMathematical:S,vectorEffect:null,vHanging:S,vIdeographic:S,version:null,vertAdvY:S,vertOriginX:S,vertOriginY:S,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:S,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ee}),Ae=we({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),je=we({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:De}),Me=we({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ne={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Pe=/[A-Z]/g,Fe=/-[a-z]/g,Ie=/^data[-\w.:]+$/i;function Le(e,t){let n=_e(t),r=t,i=y;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ie.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Fe,ze);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Fe.test(e)){let n=e.replace(Pe,Re);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Se}return new i(r,t)}function Re(e){return`-`+e.toLowerCase()}function ze(e){return e.charAt(1).toUpperCase()}var Be=ge([Te,Oe,Ae,je,Me],`html`),Ve=ge([Te,ke,Ae,je,Me],`svg`);function He(e){return e.join(` `).trim()}var Ue=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
1
+ import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{r}from"./react-dom-Ddte4I-Q.js";import{A as i}from"./xyflow-yApv7D4e.js";import{Yi as a,Yr as o,Zr as s,ha as c}from"./shortcut-keys-3ILd8oGn.js";import{o as l,t as u}from"./index-r7xXt_VV.js";var d=[[`path`,{d:`M20.5 5.5H9.5C5.78672 5.5 3 8.18503 3 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3.5 18.5H14.5C18.2133 18.5 21 15.815 21 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M18.5 3C18.5 3 21 4.84122 21 5.50002C21 6.15882 18.5 8 18.5 8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M5.49998 16C5.49998 16 3.00001 17.8412 3 18.5C2.99999 19.1588 5.5 21 5.5 21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],f=[[`path`,{d:`M16 2V6M8 2V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13 4H11C7.22876 4 5.34315 4 4.17157 5.17157C3 6.34315 3 8.22876 3 12V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V12C21 8.22876 21 6.34315 19.8284 5.17157C18.6569 4 16.7712 4 13 4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 10H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12.1258 14H12.0008M12.1258 18H12.0008M7.625 14H7.5M7.625 18H7.5M16.625 14H16.5M12.2508 14C12.2508 14.1381 12.1389 14.25 12.0008 14.25C11.8628 14.25 11.7508 14.1381 11.7508 14C11.7508 13.8619 11.8628 13.75 12.0008 13.75C12.1389 13.75 12.2508 13.8619 12.2508 14ZM12.2508 18C12.2508 18.1381 12.1389 18.25 12.0008 18.25C11.8628 18.25 11.7508 18.1381 11.7508 18C11.7508 17.8619 11.8628 17.75 12.0008 17.75C12.1389 17.75 12.2508 17.8619 12.2508 18ZM7.75 14C7.75 14.1381 7.63807 14.25 7.5 14.25C7.36193 14.25 7.25 14.1381 7.25 14C7.25 13.8619 7.36193 13.75 7.5 13.75C7.63807 13.75 7.75 13.8619 7.75 14ZM7.75 18C7.75 18.1381 7.63807 18.25 7.5 18.25C7.36193 18.25 7.25 18.1381 7.25 18C7.25 17.8619 7.36193 17.75 7.5 17.75C7.63807 17.75 7.75 17.8619 7.75 18ZM16.75 14C16.75 14.1381 16.6381 14.25 16.5 14.25C16.3619 14.25 16.25 14.1381 16.25 14C16.25 13.8619 16.3619 13.75 16.5 13.75C16.6381 13.75 16.75 13.8619 16.75 14Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],p=[[`path`,{d:`M11.0809 13.152L8 7L13.4196 11.2796C14.1901 11.888 14.1941 13.0472 13.4277 13.6607C12.6614 14.2743 11.5189 14.0266 11.0809 13.152Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5 4.82C3.14864 6.63902 2 9.17385 2 11.9776C2 17.5129 6.47715 22.0001 12 22.0001C17.5228 22.0001 22 17.5129 22 11.9776C22 7.1242 18.5581 3.07656 13.9872 2.15288C13.1512 1.98394 12.7332 1.89947 12.3666 2.20022C12 2.50097 12 2.98714 12 3.95949V4.96175`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],m=t(r(),1),h=500;function g(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return[t,...e].slice(0,h);let r=e.slice();return r[n]=t,r}function _(e,t){let n=e;for(let e of t)n=g(n,e);return n}async function v(e,t){let n=await e();n.error||t([...n.data?.runs??[]])}function ee(e){let t=e.pollMs??5e3,n=e.reconnectMs??2e3,r=e.setTimeout??setTimeout,i=e.clearTimeout??clearTimeout,a=e.setInterval??setInterval,o=e.clearInterval??clearInterval,s=null,c=null,l=null,u=!0,d=()=>{c!==null&&(o(c),c=null)},f=()=>{c===null&&(c=a(()=>{e.onPoll()},t))},p=()=>{if(u)return;l!==null&&(i(l),l=null);let t=`${e.protocol}//${e.host}/console/live`;s=new e.WebSocket(t),e.setStatus(`connecting`),s.onopen=()=>{u||(e.setStatus(`open`),d())},s.onmessage=t=>{if(!u)try{e.onMessage(JSON.parse(String(t.data)))}catch{}},s.onclose=()=>{u||(e.setStatus(`closed`),f(),l=r(()=>{l=null,u||p()},n))},s.onerror=()=>{s?.close()}};return{start(){u=!1,p()},stop(){u=!0,d(),l!==null&&(i(l),l=null),s?.close(),s=null}}}var te=[`console.manifest.get`];function ne(){return a({queryKey:te,queryFn:async()=>{let e=await o();if(e.error)throw Error(e.error.code);return e.data?.manifest??null}})}var re=[`console.runs.list`];function ie(){return a({queryKey:re,queryFn:async()=>{let e=await s();if(e.error)throw Error(e.error.code);return e.data?.runs??[]}})}function ae(e){let t=c(),[n,r]=(0,m.useState)(`connecting`);return(0,m.useEffect)(()=>{if(!e)return;let n=e=>{if(e.type===`manifest`){t.setQueryData(te,e.manifest);return}if(e.type===`manifest.diff`){t.setQueryData(te,e.after);return}if(e.type===`run`){t.setQueryData(re,t=>g(t??[],e.run));return}if(e.type===`runs.batch`){t.setQueryData(re,t=>_(t??[],e.runs));return}},i=window.location.protocol===`https:`?`wss:`:`ws:`,a=ee({WebSocket:globalThis.WebSocket,host:window.location.host,protocol:i,setStatus:r,onMessage:n,onPoll:()=>{v(s,e=>{t.setQueryData(re,e)})}});return a.start(),()=>{a.stop()}},[e,t]),n}function oe(e){if(!Number.isFinite(e)||e<0)return`0μs`;if(e<1)return`${Math.round(e*1e3)}μs`;if(e<1e3){let t=Math.round(e*10)/10;return Number.isInteger(t)?`${t}ms`:`${t.toFixed(1)}ms`}let t=e/1e3,n=Math.round(t*10)/10;return Number.isInteger(n)?`${n}s`:`${n.toFixed(1)}s`}function se(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var ce=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,le=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ue={};function de(e,t){return((t||ue).jsx?le:ce).test(e)}var fe=/[ \t\n\f\r]/g;function pe(e){return typeof e==`object`?e.type===`text`&&me(e.value):me(e)}function me(e){return e.replace(fe,``)===``}var he=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};he.prototype.normal={},he.prototype.property={},he.prototype.space=void 0;function ge(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new he(n,r,t)}function _e(e){return e.toLowerCase()}var y=class{constructor(e,t){this.attribute=t,this.property=e}};y.prototype.attribute=``,y.prototype.booleanish=!1,y.prototype.boolean=!1,y.prototype.commaOrSpaceSeparated=!1,y.prototype.commaSeparated=!1,y.prototype.defined=!1,y.prototype.mustUseProperty=!1,y.prototype.number=!1,y.prototype.overloadedBoolean=!1,y.prototype.property=``,y.prototype.spaceSeparated=!1,y.prototype.space=void 0;var ve=e({boolean:()=>b,booleanish:()=>x,commaOrSpaceSeparated:()=>T,commaSeparated:()=>w,number:()=>S,overloadedBoolean:()=>be,spaceSeparated:()=>C}),ye=0,b=E(),x=E(),be=E(),S=E(),C=E(),w=E(),T=E();function E(){return 2**++ye}var xe=Object.keys(ve),Se=class extends y{constructor(e,t,n,r){let i=-1;if(super(e,t),Ce(this,`space`,r),typeof n==`number`)for(;++i<xe.length;){let e=xe[i];Ce(this,xe[i],(n&ve[e])===ve[e])}}};Se.prototype.defined=!0;function Ce(e,t,n){n&&(e[t]=n)}function we(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Se(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_e(r)]=r,n[_e(a.attribute)]=r}return new he(t,n,e.space)}var Te=we({properties:{ariaActiveDescendant:null,ariaAtomic:x,ariaAutoComplete:null,ariaBusy:x,ariaChecked:x,ariaColCount:S,ariaColIndex:S,ariaColSpan:S,ariaControls:C,ariaCurrent:null,ariaDescribedBy:C,ariaDetails:null,ariaDisabled:x,ariaDropEffect:C,ariaErrorMessage:null,ariaExpanded:x,ariaFlowTo:C,ariaGrabbed:x,ariaHasPopup:null,ariaHidden:x,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:C,ariaLevel:S,ariaLive:null,ariaModal:x,ariaMultiLine:x,ariaMultiSelectable:x,ariaOrientation:null,ariaOwns:C,ariaPlaceholder:null,ariaPosInSet:S,ariaPressed:x,ariaReadOnly:x,ariaRelevant:null,ariaRequired:x,ariaRoleDescription:C,ariaRowCount:S,ariaRowIndex:S,ariaRowSpan:S,ariaSelected:x,ariaSetSize:S,ariaSort:null,ariaValueMax:S,ariaValueMin:S,ariaValueNow:S,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ee(e,t){return t in e?e[t]:t}function De(e,t){return Ee(e,t.toLowerCase())}var Oe=we({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:w,acceptCharset:C,accessKey:C,action:null,allow:null,allowFullScreen:b,allowPaymentRequest:b,allowUserMedia:b,alpha:b,alt:null,as:null,async:b,autoCapitalize:null,autoComplete:C,autoFocus:b,autoPlay:b,blocking:C,capture:null,charSet:null,checked:b,cite:null,className:C,closedBy:null,colorSpace:null,cols:S,colSpan:S,command:null,commandFor:null,content:null,contentEditable:x,controls:b,controlsList:C,coords:S|w,crossOrigin:null,data:null,dateTime:null,decoding:null,default:b,defer:b,dir:null,dirName:null,disabled:b,download:be,draggable:x,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:b,formTarget:null,headers:C,height:S,hidden:be,high:S,href:null,hrefLang:null,htmlFor:C,httpEquiv:C,id:null,imageSizes:null,imageSrcSet:null,inert:b,inputMode:null,integrity:null,is:null,isMap:b,itemId:null,itemProp:C,itemRef:C,itemScope:b,itemType:C,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:b,low:S,manifest:null,max:null,maxLength:S,media:null,method:null,min:null,minLength:S,multiple:b,muted:b,name:null,nonce:null,noModule:b,noValidate:b,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:b,optimum:S,pattern:null,ping:C,placeholder:null,playsInline:b,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:b,referrerPolicy:null,rel:C,required:b,reversed:b,rows:S,rowSpan:S,sandbox:C,scope:null,scoped:b,seamless:b,selected:b,shadowRootClonable:b,shadowRootCustomElementRegistry:b,shadowRootDelegatesFocus:b,shadowRootMode:null,shadowRootSerializable:b,shape:null,size:S,sizes:null,slot:null,span:S,spellCheck:x,src:null,srcDoc:null,srcLang:null,srcSet:null,start:S,step:null,style:null,tabIndex:S,target:null,title:null,translate:null,type:null,typeMustMatch:b,useMap:null,value:x,width:S,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:C,axis:null,background:null,bgColor:null,border:S,borderColor:null,bottomMargin:S,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:b,declare:b,event:null,face:null,frame:null,frameBorder:null,hSpace:S,leftMargin:S,link:null,longDesc:null,lowSrc:null,marginHeight:S,marginWidth:S,noResize:b,noHref:b,noShade:b,noWrap:b,object:null,profile:null,prompt:null,rev:null,rightMargin:S,rules:null,scheme:null,scrolling:x,standby:null,summary:null,text:null,topMargin:S,valueType:null,version:null,vAlign:null,vLink:null,vSpace:S,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:b,disablePictureInPicture:b,disableRemotePlayback:b,exportParts:w,part:C,prefix:null,property:null,results:S,security:null,unselectable:null},space:`html`,transform:De}),ke=we({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:T,accentHeight:S,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:S,amplitude:S,arabicForm:null,ascent:S,attributeName:null,attributeType:null,azimuth:S,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:S,by:null,calcMode:null,capHeight:S,className:C,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:S,diffuseConstant:S,direction:null,display:null,dur:null,divisor:S,dominantBaseline:null,download:b,dx:null,dy:null,edgeMode:null,editable:null,elevation:S,enableBackground:null,end:null,event:null,exponent:S,externalResourcesRequired:null,fill:null,fillOpacity:S,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:w,g2:w,glyphName:w,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:S,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:S,horizOriginX:S,horizOriginY:S,id:null,ideographic:S,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:S,k:S,k1:S,k2:S,k3:S,k4:S,kernelMatrix:T,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:S,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:S,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:S,overlineThickness:S,paintOrder:null,panose1:null,path:null,pathLength:S,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:C,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:S,pointsAtY:S,pointsAtZ:S,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:T,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:T,rev:T,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:T,requiredFeatures:T,requiredFonts:T,requiredFormats:T,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:S,specularExponent:S,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:S,strikethroughThickness:S,string:null,stroke:null,strokeDashArray:T,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:S,strokeOpacity:S,strokeWidth:null,style:null,surfaceScale:S,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:T,tabIndex:S,tableValues:null,target:null,targetX:S,targetY:S,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:T,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:S,underlineThickness:S,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:S,values:null,vAlphabetic:S,vMathematical:S,vectorEffect:null,vHanging:S,vIdeographic:S,version:null,vertAdvY:S,vertOriginX:S,vertOriginY:S,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:S,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ee}),Ae=we({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),je=we({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:De}),Me=we({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ne={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Pe=/[A-Z]/g,Fe=/-[a-z]/g,Ie=/^data[-\w.:]+$/i;function Le(e,t){let n=_e(t),r=t,i=y;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ie.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Fe,ze);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Fe.test(e)){let n=e.replace(Pe,Re);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Se}return new i(r,t)}function Re(e){return`-`+e.toLowerCase()}function ze(e){return e.charAt(1).toUpperCase()}var Be=ge([Te,Oe,Ae,je,Me],`html`),Ve=ge([Te,ke,Ae,je,Me],`svg`);function He(e){return e.join(` `).trim()}var Ue=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
2
2
  `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=ee();)t!==!1&&e.push(t);return e}function ee(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function te(){var e=p(),t=g(a);if(t){if(ee(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function ne(){var e=[];v(e);for(var t;t=te();)t!==!1&&(e.push(t),v(e));return e}return _(),ne()}function d(e){return e?e.replace(l,``):``}t.exports=u})),We=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Ue());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Ge=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Ke=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(We()),r=Ge();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),qe=Je(`start`);function Je(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Ye(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Ze(e.position):`start`in e||`end`in e?Ze(e):`line`in e||`column`in e?Xe(e):``}function Xe(e){return Qe(e&&e.line)+`:`+Qe(e&&e.column)}function Ze(e){return Xe(e&&e.start)+`-`+Xe(e&&e.end)}function Qe(e){return e&&typeof e==`number`?e:1}var D=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ye(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};D.prototype.file=``,D.prototype.name=``,D.prototype.reason=``,D.prototype.message=``,D.prototype.stack=``,D.prototype.column=void 0,D.prototype.line=void 0,D.prototype.ancestors=void 0,D.prototype.cause=void 0,D.prototype.fatal=void 0,D.prototype.place=void 0,D.prototype.ruleId=void 0,D.prototype.source=void 0;var $e=t(Ke(),1),et={}.hasOwnProperty,tt=new Map,nt=/[A-Z]/g,rt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),it=new Set([`td`,`th`]),at=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function ot(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=_t(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=gt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Ve:Be,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=st(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function st(e,t,n){if(t.type===`element`)return ct(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return lt(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return dt(e,t,n);if(t.type===`mdxjsEsm`)return ut(e,t);if(t.type===`root`)return ft(e,t,n);if(t.type===`text`)return pt(e,t)}function ct(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ve,e.schema=i),e.ancestors.push(t);let a=Ct(e,t.tagName,!1),o=vt(e,t),s=bt(e,t);return rt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!pe(e)})),mt(e,o,a,t),ht(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function lt(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}wt(e,t.position)}function ut(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wt(e,t.position)}function dt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ve,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Ct(e,t.name,!0),o=yt(e,t),s=bt(e,t);return mt(e,o,a,t),ht(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ft(e,t,n){let r={};return ht(r,bt(e,t)),e.create(t,e.Fragment,r,n)}function pt(e,t){return t.value}function mt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ht(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function gt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function _t(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=qe(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function vt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&et.call(t.properties,i)){let a=xt(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&it.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function yt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else wt(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else wt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function bt(e,t){let n=[],r=-1,i=e.passKeys?new Map:tt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=st(e,a,o);s!==void 0&&n.push(s)}return n}function xt(e,t,n){let r=Le(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?se(n):He(n)),r.property===`style`){let t=typeof n==`object`?n:St(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Tt(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ne[r.property]||r.property:r.attribute,n]}}function St(e,t){try{return(0,$e.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new D("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=at+`#cannot-parse-style-attribute`,r}}function Ct(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=de(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=de(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return et.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);wt(e)}function wt(e,t){let n=new D("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=at+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Tt(e){let t={},n;for(n in e)et.call(e,n)&&(t[Et(n)]=e[n]);return t}function Et(e){let t=e.replace(nt,Dt);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Dt(e){return`-`+e.toLowerCase()}var O=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ot(e){return kt(e)}function kt(e){return Array.isArray(e)?At(e):e instanceof RegExp?e:typeof e==`object`?jt(e):e}function At(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=kt(e[n]);return t}function jt(e){let t={};for(let n in e)t[n]=kt(e[n]);return t}function Mt(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Nt(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Nt(e.substring(0,e.length-1)):e.substr(~t+1)}var Pt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ft=class{static hasCaptures(e){return e!==null&&(Pt.lastIndex=0,Pt.test(e))}static replaceCaptures(e,t,n){return e.replace(Pt,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function It(e,t){return e<t?-1:+(e>t)}function Lt(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=It(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Rt(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function zt(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Bt=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Vt=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Kt(e),t)}static createFromParsedTheme(e,t){return Jt(e,t)}_cachedMatchRoot=new Bt(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Ut(e.parent,t.parentScopes));return n?new Gt(n.fontStyle,n.foreground,n.background):null}},Ht=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Ut(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Wt(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Wt(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Gt=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Kt(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&Rt(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Rt(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new qt(l,u,e,o,s,c)}}return n}var qt=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},k=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(k||{});function Jt(e,t){e.sort((e,t)=>{let n=It(e.scope,t.scope);return n!==0||(n=Lt(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Yt(t),o=new Gt(n,a.getId(r),a.getId(i)),s=new Qt(new Zt(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Vt(a,o,s)}var Yt=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Xt=Object.freeze([]),Zt=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Xt,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Qt=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Zt.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Lt(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Zt(e,t,n,r,i))}},A=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=en(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function $t(e){return e}function en(e){return e}function tn(e,t){let n=[],r=rn(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(nn(i)){let e=[];do e.push(i),i=r.next();while(nn(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function nn(e){return!!e&&!!e.match(/[\w\.:]+/)}function rn(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function an(e){typeof e.dispose==`function`&&e.dispose()}var on=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},sn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},cn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ln=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new on(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new cn;for(let n of e)un(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof on){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function un(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof on?fn({baseGrammar:a,selfGrammar:i},r):dn(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new on(e))}function dn(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];pn([r],t,n)}}function fn(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&pn(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&pn(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function pn(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Mt({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&pn(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=yn(i);switch(a.kind){case 0:fn({...t,selfGrammar:t.baseGrammar},n);break;case 1:fn(t,n);break;case 2:dn(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?dn(a.ruleName,i,n):fn(i,n)}else a.kind===4?n.add(new sn(a.scopeName,a.ruleName)):n.add(new on(a.scopeName))}}}var mn=class{kind=0},hn=class{kind=1},gn=class{constructor(e){this.ruleName=e}kind=2},_n=class{constructor(e){this.scopeName=e}kind=3},vn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function yn(e){if(e===`$base`)return new mn;if(e===`$self`)return new hn;let t=e.indexOf(`#`);return t===-1?new _n(e):t===0?new gn(e.substring(1)):new vn(e.substring(0,t),e.substring(t+1))}var bn=/\\(\d+)/,xn=/\\(\d+)/g,Sn=-1,Cn=-2;function wn(e){return e}function Tn(e){return e}var En=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ft.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ft.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Nt(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Ft.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ft.replaceCaptures(this._contentName,e,t)}},Dn=class extends En{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},On=class extends En{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Nn(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Pn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},kn=class extends En{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Pn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},An=class extends En{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Nn(i,this.id),this.beginCaptures=a,this._end=new Nn(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Pn;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},jn=class extends En{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Nn(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Nn(o,Cn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Pn;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Pn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},Mn=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Dn(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new On(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Mt({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new kn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new jn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new An(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=yn(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof kn||e instanceof An||e instanceof jn)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Nn=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&bn.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return xn.lastIndex=0,this.source.replace(xn,(e,t)=>zt(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Pn=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Fn(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Fn(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Fn=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
3
3
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},In=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ln=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new In(e,8),this._embeddedLanguagesMatcher=new Rn(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new In(0,0);_getBasicScopeAttributes=new Bt(e=>new In(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Rn=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>zt(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var zn=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Bn(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Vn(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new zn(i,!0);f()}return new zn(i,!1);function f(){let o=Hn(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Sn){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),qn(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof An){let r=o;qn(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof jn){let r=o;qn(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(qn(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Vn(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof jn&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Kn(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Cn){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),qn(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Hn(e,t,n,r,i,a){let o=Un(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Wn(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Un(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Gn(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Wn(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Gn(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Gn(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Kn(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function qn(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Bn(e,p,n&&d.start===0,d.start,f,i,!1,0),an(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Jn(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Jn=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Yn(e,t,n,r,i,a,o,s){return new $n(e,t,n,r,i,a,o,s)}function Xn(e,t,n,r,i){let a=tn(t,Zn),o=Mn.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Zn(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Qn(t[r],e))return n=r+1,!0;return!1})}function Qn(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var $n=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ln(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=er(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=tn(e,Zn);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Xn(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Xn(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(wn(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Tn(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=er(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Mn.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===nr.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=A.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?tr.createRootAndLookUpScopeName(a,r,this):tr.createRoot(`unknown`,r),t=new nr(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
4
4
  `;let a=this.createOnigString(e),o=a.content.length,s=new ir(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Bn(this,a,i,0,t,s,!0,r);return an(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function er(e,t){return e=Ot(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var tr=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Ht.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Ht(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Ht(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),A.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},nr=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?tr.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Tn(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=tr.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,wn(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,tr.fromExtension(r,n.contentNameScopesList))}},rr=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):tn(e,Zn).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>tn(e,Zn).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ir=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=A.set(n,0,$t(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=A.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},ar=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Yn(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},or=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ar(Vt.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Vt.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new rr(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new ln(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},sr=nr.NULL;function cr(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function j(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function lr(e){return Array.isArray(e)?e:[e]}async function ur(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function dr(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function fr(e){return e===`ansi`||dr(e)}function pr(e){return e===`none`}function mr(e){return pr(e)}var hr=/(\r?\n)/g;function gr(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(hr),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var _r={light:`#333333`,dark:`#bbbbbb`},vr={light:`#fffffe`,dark:`#1e1e1e`},yr=`__shiki_resolved`;function br(e){if(e?.[yr])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?_r.light:_r.dark,n||=t.type===`light`?vr.light:vr.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,yr,{enumerable:!1,writable:!1,value:!0}),t}async function xr(e){return[...new Set((await Promise.all(e.filter(e=>!fr(e)).map(async e=>await ur(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Sr(e){return(await Promise.all(e.map(async e=>mr(e)?null:br(await ur(e))))).filter(e=>!!e)}function Cr(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new O(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var wr=class extends or{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=br(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Vt.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Cr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new O(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Tr=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Er=0;function Dr(e){Er+=1,e.warnings!==!1&&Er>=10&&Er%10==0&&console.warn(`[Shiki] ${Er} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new O("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(br),i=new wr(new Tr(e.engine,n),r,n,e.langAlias),a;function o(t){return Cr(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new O(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new O(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await xr(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Sr(e))}function g(){if(t)throw new O(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Er)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Or(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Sr(e.themes||[]),xr(e.langs||[]),e.engine]);return Dr({...e,themes:t,langs:n,engine:r})}var kr=new WeakMap;function Ar(e,t){kr.set(e,t)}function jr(e){return kr.get(e)}var Mr=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(lr(n).map(e=>[e,sr])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Nr(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Nr(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Pr(e,t){if(!(e instanceof Mr))throw new O(`Invalid grammar state`);return e.getInternalStack(t)}var Fr=/,/,Ir=/ /;function Lr(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(dr(e.resolveLangAlias(n.lang||`text`))||pr(r))return gr(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new O(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new O(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return zr(t,o,i,a,n)}function Rr(...e){if(e.length===2)return jr(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(dr(i)||pr(a))throw new O(`Plain language does not have grammar state`);if(i===`ansi`)throw new O(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Mr(Br(n,c,o,s,r).stateStack,c.name,o.name)}function zr(e,t,n,r,i){let a=Br(e,t,n,r,i),o=new Mr(a.stateStack,t.name,n.name);return Ar(a.tokens,o),a.tokens}function Br(e,t,n,r,i){let a=cr(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=gr(e),u=i.grammarState?Pr(i.grammarState,n.name)??sr:i.grammarContextCode==null?sr:Br(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=j(r[A.getForeground(s)],a),u=A.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=A.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Fr).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Ir))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Vr(t.scopes):Hr(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Vr(e){return e.map(e=>({scopeName:e}))}function Hr(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Gr(e,i,t.slice(0,r))}}return n}function Ur(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Wr(e,t,n){if(!Ur(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Ur(e[r],n[i])&&--r,--i;return r===-1}function Gr(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Wr(e,t,n)){r.push(a);break}return r}function Kr(e,t,n,r=Lr){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:jr(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=qr(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Mr(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Ar(s,c),s}function qr(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Jr=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Yr={}.hasOwnProperty;function Xr(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Yr.call(t,e)){let n=String(t[e]);i=Yr.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Zr=/["&'<>`]/g,Qr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$r=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ei=/[|\\{}()[\]^$+*?.]/g,ti=new WeakMap;function ni(e,t){if(e=e.replace(t.subset?ri(t.subset):Zr,r),t.subset||t.escapeOnly)return e;return e.replace(Qr,n).replace($r,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function ri(e){let t=ti.get(e);return t||(t=ii(e),ti.set(e,t)),t}function ii(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(ei,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var ai=/[\dA-Fa-f]/;function oi(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!ai.test(String.fromCharCode(t))?r:r+`;`}var si=/\d/;function ci(e,t,n){let r=`&#`+String(e);return n&&t&&!si.test(String.fromCharCode(t))?r:r+`;`}var li=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),ui={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},di=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],fi={}.hasOwnProperty,pi={},mi;for(mi in ui)fi.call(ui,mi)&&(pi[ui[mi]]=mi);var hi=/[^\dA-Za-z]/;function gi(e,t,n,r){let i=String.fromCharCode(e);if(fi.call(pi,i)){let e=pi[i],a=`&`+e;return n&&li.includes(e)&&!di.includes(e)&&(!r||t&&t!==61&&hi.test(String.fromCharCode(t)))?a:a+`;`}return``}function _i(e,t,n){let r=oi(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=gi(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=ci(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function M(e,t){return ni(e,Object.assign({format:_i},t))}var vi=/^>|^->|<!--|-->|--!>|<!-$/g,yi=[`>`],bi=[`<`,`>`];function xi(e,t,n,r){return r.settings.bogusComments?`<?`+M(e.value,Object.assign({},r.settings.characterReferences,{subset:yi}))+`>`:`<!--`+e.value.replace(vi,i)+`-->`;function i(e){return M(e,Object.assign({},r.settings.characterReferences,{subset:bi}))}}function Si(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Ci(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var N=Ei(1),wi=Ei(-1),Ti=[];function Ei(e){return t;function t(t,n,r){let i=t?t.children:Ti,a=(n||0)+e,o=i[a];if(!r)for(;o&&pe(o);)a+=e,o=i[a];return o}}var Di={}.hasOwnProperty;function Oi(e){return t;function t(t,n,r){return Di.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var ki=Oi({body:Mi,caption:Ai,colgroup:Ai,dd:Ii,dt:Fi,head:Ai,html:ji,li:Pi,optgroup:Ri,option:zi,p:Ni,rp:Li,rt:Li,tbody:Vi,td:Wi,tfoot:Hi,th:Wi,thead:Bi,tr:Ui});function Ai(e,t,n){let r=N(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&pe(r.value.charAt(0)))}function ji(e,t,n){let r=N(n,t);return!r||r.type!==`comment`}function Mi(e,t,n){let r=N(n,t);return!r||r.type!==`comment`}function Ni(e,t,n){let r=N(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Pi(e,t,n){let r=N(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Fi(e,t,n){let r=N(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function Ii(e,t,n){let r=N(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Li(e,t,n){let r=N(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Ri(e,t,n){let r=N(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function zi(e,t,n){let r=N(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Bi(e,t,n){let r=N(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function Vi(e,t,n){let r=N(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Hi(e,t,n){return!N(n,t)}function Ui(e,t,n){let r=N(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Wi(e,t,n){let r=N(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Gi=Oi({body:Ji,colgroup:Yi,head:qi,html:Ki,tbody:Xi});function Ki(e){let t=N(e,-1);return!t||t.type!==`comment`}function qi(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Ji(e){let t=N(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&pe(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Yi(e,t,n){let r=wi(n,t),i=N(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&ki(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Xi(e,t,n){let r=wi(n,t),i=N(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&ki(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Zi={name:[[`
@@ -1 +1 @@
1
- import{v as e}from"./element-icons-BI8cJgdh.js";import{n as t,r as n}from"./UserIcon-DaE2PB5_.js";import{it as r,rt as i,tt as a}from"./index-MqeU3hlt.js";var o=[[`path`,{d:`M12.001 5.00003V19.002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19.002 12.002L4.99998 12.002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],s=[[`path`,{d:`M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6 13.5L7.5 9L9.375 13.5M6 13.5L5.5 15M6 13.5H9.375M9.375 13.5L10 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12.5 12V9.7C12.5 9.51387 12.5 9.42081 12.5245 9.34549C12.5739 9.19327 12.6933 9.07393 12.8455 9.02447C12.9208 9 13.0139 9 13.2 9H14.5C15.3284 9 16 9.67157 16 10.5C16 11.3284 15.3284 12 14.5 12H12.5ZM12.5 12V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M18.5 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],c=[[`path`,{d:`M14.0737 3.88545C14.8189 3.07808 15.1915 2.6744 15.5874 2.43893C16.5427 1.87076 17.7191 1.85309 18.6904 2.39232C19.0929 2.6158 19.4769 3.00812 20.245 3.79276C21.0131 4.5774 21.3972 4.96972 21.6159 5.38093C22.1438 6.37312 22.1265 7.57479 21.5703 8.5507C21.3398 8.95516 20.9446 9.33578 20.1543 10.097L10.7506 19.1543C9.25288 20.5969 8.504 21.3182 7.56806 21.6837C6.63212 22.0493 5.6032 22.0224 3.54536 21.9686L3.26538 21.9613C2.63891 21.9449 2.32567 21.9367 2.14359 21.73C1.9615 21.5234 1.98636 21.2043 2.03608 20.5662L2.06308 20.2197C2.20301 18.4235 2.27297 17.5255 2.62371 16.7182C2.97444 15.9109 3.57944 15.2555 4.78943 13.9445L14.0737 3.88545Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13 4L20 11`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14 22L22 22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]];function l(e){switch((e??``).toUpperCase()){case`GET`:case`HEAD`:case`DELETE`:return!1;default:return!0}}function u(e){switch((e??``).toUpperCase()){case`GET`:return 0;case`POST`:return 1;case`QUERY`:return 2;case`PUT`:case`PATCH`:return 3;case`DELETE`:return 4;case`HEAD`:return 5;case`OPTIONS`:return 6;default:return e?7:8}}function d(l){switch(l.toUpperCase()){case`GET`:return a;case`QUERY`:return r;case`POST`:return o;case`PUT`:return c;case`PATCH`:return t;case`DELETE`:return n;case`HEAD`:return e;case`OPTIONS`:return i;default:return s}}function f(e){switch(e.toUpperCase()){case`GET`:return`border-emerald-500/35 bg-emerald-500/15 text-emerald-700 dark:text-emerald-400`;case`POST`:return`border-sky-500/35 bg-sky-500/15 text-sky-700 dark:text-sky-400`;case`PUT`:return`border-amber-500/35 bg-amber-500/15 text-amber-800 dark:text-amber-400`;case`PATCH`:return`border-violet-500/35 bg-violet-500/15 text-violet-700 dark:text-violet-400`;case`DELETE`:return`border-rose-500/35 bg-rose-500/15 text-rose-700 dark:text-rose-400`;case`HEAD`:return`border-slate-500/35 bg-slate-500/15 text-slate-700 dark:text-slate-300`;case`OPTIONS`:return`border-zinc-500/35 bg-zinc-500/15 text-zinc-700 dark:text-zinc-300`;case`QUERY`:return`border-emerald-500/35 bg-emerald-500/15 text-emerald-700 dark:text-emerald-400`;default:return`border-border bg-muted text-muted-foreground`}}function p(e){switch(e.toUpperCase()){case`GET`:return`bg-emerald-500`;case`POST`:return`bg-sky-500`;case`PUT`:return`bg-amber-500`;case`PATCH`:return`bg-violet-500`;case`DELETE`:return`bg-rose-500`;case`HEAD`:return`bg-slate-400`;case`OPTIONS`:return`bg-zinc-400`;case`QUERY`:return`bg-emerald-500`;default:return`bg-muted-foreground`}}export{u as a,p as i,l as n,s as o,d as r,f as t};
1
+ import{v as e}from"./element-icons-BI8cJgdh.js";import{n as t,r as n}from"./UserIcon-DaE2PB5_.js";import{it as r,rt as i,tt as a}from"./index-r7xXt_VV.js";var o=[[`path`,{d:`M12.001 5.00003V19.002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19.002 12.002L4.99998 12.002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],s=[[`path`,{d:`M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6 13.5L7.5 9L9.375 13.5M6 13.5L5.5 15M6 13.5H9.375M9.375 13.5L10 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12.5 12V9.7C12.5 9.51387 12.5 9.42081 12.5245 9.34549C12.5739 9.19327 12.6933 9.07393 12.8455 9.02447C12.9208 9 13.0139 9 13.2 9H14.5C15.3284 9 16 9.67157 16 10.5C16 11.3284 15.3284 12 14.5 12H12.5ZM12.5 12V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M18.5 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],c=[[`path`,{d:`M14.0737 3.88545C14.8189 3.07808 15.1915 2.6744 15.5874 2.43893C16.5427 1.87076 17.7191 1.85309 18.6904 2.39232C19.0929 2.6158 19.4769 3.00812 20.245 3.79276C21.0131 4.5774 21.3972 4.96972 21.6159 5.38093C22.1438 6.37312 22.1265 7.57479 21.5703 8.5507C21.3398 8.95516 20.9446 9.33578 20.1543 10.097L10.7506 19.1543C9.25288 20.5969 8.504 21.3182 7.56806 21.6837C6.63212 22.0493 5.6032 22.0224 3.54536 21.9686L3.26538 21.9613C2.63891 21.9449 2.32567 21.9367 2.14359 21.73C1.9615 21.5234 1.98636 21.2043 2.03608 20.5662L2.06308 20.2197C2.20301 18.4235 2.27297 17.5255 2.62371 16.7182C2.97444 15.9109 3.57944 15.2555 4.78943 13.9445L14.0737 3.88545Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13 4L20 11`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14 22L22 22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]];function l(e){switch((e??``).toUpperCase()){case`GET`:case`HEAD`:case`DELETE`:return!1;default:return!0}}function u(e){switch((e??``).toUpperCase()){case`GET`:return 0;case`POST`:return 1;case`QUERY`:return 2;case`PUT`:case`PATCH`:return 3;case`DELETE`:return 4;case`HEAD`:return 5;case`OPTIONS`:return 6;default:return e?7:8}}function d(l){switch(l.toUpperCase()){case`GET`:return a;case`QUERY`:return r;case`POST`:return o;case`PUT`:return c;case`PATCH`:return t;case`DELETE`:return n;case`HEAD`:return e;case`OPTIONS`:return i;default:return s}}function f(e){switch(e.toUpperCase()){case`GET`:return`border-emerald-500/35 bg-emerald-500/15 text-emerald-700 dark:text-emerald-400`;case`POST`:return`border-sky-500/35 bg-sky-500/15 text-sky-700 dark:text-sky-400`;case`PUT`:return`border-amber-500/35 bg-amber-500/15 text-amber-800 dark:text-amber-400`;case`PATCH`:return`border-violet-500/35 bg-violet-500/15 text-violet-700 dark:text-violet-400`;case`DELETE`:return`border-rose-500/35 bg-rose-500/15 text-rose-700 dark:text-rose-400`;case`HEAD`:return`border-slate-500/35 bg-slate-500/15 text-slate-700 dark:text-slate-300`;case`OPTIONS`:return`border-zinc-500/35 bg-zinc-500/15 text-zinc-700 dark:text-zinc-300`;case`QUERY`:return`border-emerald-500/35 bg-emerald-500/15 text-emerald-700 dark:text-emerald-400`;default:return`border-border bg-muted text-muted-foreground`}}function p(e){switch(e.toUpperCase()){case`GET`:return`bg-emerald-500`;case`POST`:return`bg-sky-500`;case`PUT`:return`bg-amber-500`;case`PATCH`:return`bg-violet-500`;case`DELETE`:return`bg-rose-500`;case`HEAD`:return`bg-slate-400`;case`OPTIONS`:return`bg-zinc-400`;case`QUERY`:return`bg-emerald-500`;default:return`bg-muted-foreground`}}export{u as a,p as i,l as n,s as o,d as r,f as t};