zdashboard 2.6.1 → 2.6.2

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 (28) hide show
  1. package/dist/cli.js +157 -22
  2. package/dist/cli.js.map +1 -1
  3. package/dist/web/assets/FileIcon-Bc03q6Gz.js +279 -0
  4. package/dist/web/assets/{FilterPills-B6u1IBeC.js → FilterPills-CSZQenbh.js} +1 -1
  5. package/dist/web/assets/{ProgressBar-CbyvyLzw.js → ProgressBar-ycyJBwG-.js} +1 -1
  6. package/dist/web/assets/{Workspace-DQmfVJh6.js → Workspace-jCfxaTOM.js} +1 -1
  7. package/dist/web/assets/badge-DUO7nDks.js +1 -0
  8. package/dist/web/assets/index-4aiRmNbP.css +1 -0
  9. package/dist/web/assets/{index-BvuOeKbq.js → index-BrvOKJRF.js} +1 -1
  10. package/dist/web/assets/{index-BfA6l4to.js → index-Co_rMXPa.js} +2 -2
  11. package/dist/web/assets/web-BKh2HY35.js +2 -0
  12. package/dist/web/assets/web-BNjs9lCy.js +139 -0
  13. package/dist/web/assets/{web-BcTJQUKr.js → web-BrsVNrGk.js} +1 -1
  14. package/dist/web/assets/{web-BXCBKn6i.js → web-Bt0s1qFE.js} +1 -1
  15. package/dist/web/assets/{web-C8I10oqh.js → web-CCoznDNk.js} +1 -1
  16. package/dist/web/assets/web-DxK2pSVl.js +1 -0
  17. package/dist/web/assets/web-ShIDOvFD.js +1 -0
  18. package/dist/web/index.html +2 -2
  19. package/package.json +1 -1
  20. package/dist/web/assets/FileIcon-B0-2gV6a.js +0 -10
  21. package/dist/web/assets/MdViewer-Cvh3TNQI.js +0 -270
  22. package/dist/web/assets/badge-DTb6qo3S.js +0 -1
  23. package/dist/web/assets/index-DQkehbup.css +0 -1
  24. package/dist/web/assets/web-5newSm97.js +0 -1
  25. package/dist/web/assets/web-BOg9UnpC.js +0 -1
  26. package/dist/web/assets/web-CLCAgjmg.js +0 -1
  27. package/dist/web/assets/web-CXE89yN1.js +0 -2
  28. /package/dist/web/assets/{MdViewer-BTcE7LSd.css → FileIcon-BTcE7LSd.css} +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-C8I10oqh.js","assets/badge-DTb6qo3S.js","assets/ProgressBar-CbyvyLzw.js","assets/index-BvuOeKbq.js","assets/web-BcTJQUKr.js","assets/FilterPills-B6u1IBeC.js","assets/web-BOg9UnpC.js","assets/MdViewer-Cvh3TNQI.js","assets/MdViewer-BTcE7LSd.css","assets/FileIcon-B0-2gV6a.js","assets/web-BXCBKn6i.js","assets/web-CLCAgjmg.js","assets/web-5newSm97.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-CCoznDNk.js","assets/badge-DUO7nDks.js","assets/ProgressBar-ycyJBwG-.js","assets/index-BrvOKJRF.js","assets/web-BrsVNrGk.js","assets/FilterPills-CSZQenbh.js","assets/web-DxK2pSVl.js","assets/FileIcon-Bc03q6Gz.js","assets/FileIcon-BTcE7LSd.css","assets/web-Bt0s1qFE.js","assets/web-ShIDOvFD.js"])))=>i.map(i=>d[i]);
2
2
  var vO=Object.defineProperty;var mb=e=>{throw TypeError(e)};var dO=(e,t,n)=>t in e?vO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var RV=(e,t,n)=>dO(e,typeof t!="symbol"?t+"":t,n),ub=(e,t,n)=>t.has(e)||mb("Cannot "+n);var Se=(e,t,n)=>(ub(e,t,"read from private field"),n?n.call(e):t.get(e)),pb=(e,t,n)=>t.has(e)?mb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),TV=(e,t,n,r)=>(ub(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function mO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Ele=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lZ(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cZ={exports:{}},lV={},sZ={exports:{}},G={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -7813,4 +7813,4 @@ Error generating stack: `+i.message+`
7813
7813
  `)},hie=0,Un=[];function nie(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(hie++)[0],i=h.useState(VB)[0],l=h.useRef(e);h.useEffect(function(){l.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=xoe([e.lockRef.current],(e.shards||[]).map(hZ),!0).filter(Boolean);return w.forEach(function(H){return H.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(H){return H.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=h.useCallback(function(w,H){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var g=uo(w),y=n.current,M="deltaX"in w?w.deltaX:y[0]-g[0],f="deltaY"in w?w.deltaY:y[1]-g[1],x,V=w.target,C=Math.abs(M)>Math.abs(f)?"h":"v";if("touches"in w&&C==="h"&&V.type==="range")return!1;var E=window.getSelection(),A=E&&E.anchorNode,I=A?A===V||A.contains(V):!1;if(I)return!1;var q=eZ(C,V);if(!q)return!0;if(q?x=C:(x=C==="v"?"h":"v",q=eZ(C,V)),!q)return!1;if(!r.current&&"changedTouches"in w&&(M||f)&&(r.current=x),!x)return!0;var j=r.current||x;return Joe(j,H,w,j==="h"?M:f)},[]),s=h.useCallback(function(w){var H=w;if(!(!Un.length||Un[Un.length-1]!==i)){var g="deltaY"in H?tZ(H):uo(H),y=t.current.filter(function(x){return x.name===H.type&&(x.target===H.target||H.target===x.shadowParent)&&eie(x.delta,g)})[0];if(y&&y.should){H.cancelable&&H.preventDefault();return}if(!y){var M=(l.current.shards||[]).map(hZ).filter(Boolean).filter(function(x){return x.contains(H.target)}),f=M.length>0?c(H,M[0]):!l.current.noIsolation;f&&H.cancelable&&H.preventDefault()}}},[]),v=h.useCallback(function(w,H,g,y){var M={name:w,delta:H,target:g,should:y,shadowParent:rie(g)};t.current.push(M),setTimeout(function(){t.current=t.current.filter(function(f){return f!==M})},1)},[]),u=h.useCallback(function(w){n.current=uo(w),r.current=void 0},[]),m=h.useCallback(function(w){v(w.type,tZ(w),w.target,c(w,e.lockRef.current))},[]),p=h.useCallback(function(w){v(w.type,uo(w),w.target,c(w,e.lockRef.current))},[]);h.useEffect(function(){return Un.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",s,Nn),document.addEventListener("touchmove",s,Nn),document.addEventListener("touchstart",u,Nn),function(){Un=Un.filter(function(w){return w!==i}),document.removeEventListener("wheel",s,Nn),document.removeEventListener("touchmove",s,Nn),document.removeEventListener("touchstart",u,Nn)}},[]);var d=e.removeScrollBar,z=e.inert;return h.createElement(h.Fragment,null,z?h.createElement(i,{styles:tie(o)}):null,d?h.createElement(_oe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const aie=Aoe(xB,nie);var bB=h.forwardRef(function(e,t){return h.createElement(jV,A2({},e,{ref:t,sideCar:aie}))});bB.classNames=jV.classNames;var oie=Object.defineProperty,he=(e,t)=>oie(e,"name",{value:t,configurable:!0}),iie=["Enter"," "],lie=["ArrowDown","PageUp","Home"],SB=["ArrowUp","PageDown","End"],cie=[...lie,...SB],BV="Menu",[TE,sie,vie]=QL(BV),[Bn,ZB]=At(BV,[vie,bV,gB]),ab=bV(),IB=gB(),[die,Pa]=Bn(BV),[mie,ob]=Bn(BV),uie=he(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:l=!0}=e,c=ab(t),[s,v]=h.useState(null),u=h.useRef(!1),m=Y2(i),p=JL(o);return h.useEffect(()=>{const d=he(()=>{u.current=!0,document.addEventListener("pointerdown",z,{capture:!0,once:!0}),document.addEventListener("pointermove",z,{capture:!0,once:!0})},"handleKeyDown"),z=he(()=>u.current=!1,"handlePointer");return document.addEventListener("keydown",d,{capture:!0}),()=>{document.removeEventListener("keydown",d,{capture:!0}),document.removeEventListener("pointerdown",z,{capture:!0}),document.removeEventListener("pointermove",z,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;const d=he(()=>m(!1),"handleBlur");return window.addEventListener("blur",d),()=>window.removeEventListener("blur",d)},[n,m]),k.jsx(uj,{...c,children:k.jsx(die,{scope:t,open:n,onOpenChange:m,content:s,onContentChange:v,children:k.jsx(mie,{scope:t,onClose:h.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:u,dir:p,modal:l,children:r})})})},"Menu"),pie=h.forwardRef(he(function(t,n){const{__scopeMenu:r,...o}=t,i=ab(r);return k.jsx(pj,{...i,...o,ref:n})},"MenuAnchor")),AB="MenuPortal",[yie,gie]=Bn(AB,{forceMount:void 0}),wie=he(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Pa(AB,t);return k.jsx(yie,{scope:t,forceMount:n,children:k.jsx(ZV,{present:n||i.open,children:k.jsx(gj,{asChild:!0,container:o,children:r})})})},"MenuPortal"),xt="MenuContent",[Mie,jB]=Bn(xt),zie=h.forwardRef(he(function(t,n){const r=gie(xt,t.__scopeMenu),{forceMount:o=r.forceMount,...i}=t,l=Pa(xt,t.__scopeMenu),c=ob(xt,t.__scopeMenu);return k.jsx(TE.Provider,{scope:t.__scopeMenu,children:k.jsx(ZV,{present:o||l.open,children:k.jsx(TE.Slot,{scope:t.__scopeMenu,children:c.modal?k.jsx(Hie,{...i,ref:n}):k.jsx(fie,{...i,ref:n})})})})},"MenuContent")),Hie=h.forwardRef(he(function(t,n){const r=Pa(xt,t.__scopeMenu),o=h.useRef(null),i=ze(n,o);return h.useEffect(()=>{const l=o.current;if(l)return koe(l)},[]),k.jsx(BB,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Q(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),fie=h.forwardRef(he(function(t,n){const r=Pa(xt,t.__scopeMenu);return k.jsx(BB,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),kie=Et("MenuContent.ScrollLock"),BB=h.forwardRef(he(function(t,n){const{__scopeMenu:r,loop:o=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:s,onEntryFocus:v,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:d,onDismiss:z,disableOutsideScroll:w,...H}=t,g=Pa(xt,r),y=ob(xt,r),M=ab(r),f=IB(r),x=sie(r),[V,C]=h.useState(null),E=h.useRef(null),A=ze(n,E,g.onContentChange),I=h.useRef(0),q=h.useRef(""),j=h.useRef(0),T=h.useRef(null),D=h.useRef("right"),K=h.useRef(0),N=w?bB:h.Fragment,R=w?{as:kie,allowPinchZoom:!0}:void 0,L=he(S=>{var t2,d2;const F=q.current+S,P=x().filter(Ce=>!Ce.disabled),U=document.activeElement,W=(t2=P.find(Ce=>Ce.ref.current===U))==null?void 0:t2.textValue,oe=P.map(Ce=>Ce.textValue),ge=TB(oe,F,W),X=(d2=P.find(Ce=>Ce.textValue===ge))==null?void 0:d2.ref.current;he(function Ce(m2){q.current=m2,window.clearTimeout(I.current),m2!==""&&(I.current=window.setTimeout(()=>Ce(""),1e3))},"updateSearch")(F),X&&setTimeout(()=>X.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(I.current),[]),tb();const b=h.useCallback(S=>{var P,U;return D.current===((P=T.current)==null?void 0:P.side)&&FB(S,(U=T.current)==null?void 0:U.area)},[]);return k.jsx(Mie,{scope:r,searchRef:q,onItemEnter:h.useCallback(S=>{b(S)&&S.preventDefault()},[b]),onItemLeave:h.useCallback(S=>{var F;b(S)||((F=E.current)==null||F.focus(),C(null))},[b]),onTriggerLeave:h.useCallback(S=>{b(S)&&S.preventDefault()},[b]),pointerGraceTimerRef:j,onPointerGraceIntentChange:h.useCallback(S=>{T.current=S},[]),children:k.jsx(N,{...R,children:k.jsx(roe,{asChild:!0,trapped:i,onMountAutoFocus:Q(l,S=>{var F;S.preventDefault(),(F=E.current)==null||F.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:k.jsx(GA,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:d,onDismiss:z,children:k.jsx(woe,{asChild:!0,...f,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:V,onCurrentTabStopIdChange:C,onEntryFocus:Q(v,S=>{y.isUsingKeyboardRef.current||S.preventDefault()}),preventScrollOnEntryFocus:!0,children:k.jsx(yj,{role:"menu","aria-orientation":"vertical","data-state":OB(g.open),"data-radix-menu-content":"",dir:y.dir,...M,...H,ref:A,style:{outline:"none",...H.style},onKeyDown:Q(H.onKeyDown,S=>{const P=S.target.closest("[data-radix-menu-content]")===S.currentTarget,U=S.ctrlKey||S.altKey||S.metaKey,W=S.key.length===1;P&&(S.key==="Tab"&&S.preventDefault(),!U&&W&&L(S.key));const oe=E.current;if(S.target!==oe||!cie.includes(S.key))return;S.preventDefault();const X=x().filter(t2=>!t2.disabled).map(t2=>t2.ref.current);SB.includes(S.key)&&X.reverse(),qB(X)}),onBlur:Q(t.onBlur,S=>{S.currentTarget.contains(S.target)||(window.clearTimeout(I.current),q.current="")}),onPointerMove:Q(t.onPointerMove,iV(S=>{const F=S.target,P=K.current!==S.clientX;if(S.currentTarget.contains(F)&&P){const U=S.clientX>K.current?"right":"left";D.current=U,K.current=S.clientX}}))})})})})})})},"MenuContentImpl")),DE="MenuItem",nZ="menu.itemSelect",xie=h.forwardRef(he(function(t,n){const{disabled:r=!1,onSelect:o,...i}=t,l=h.useRef(null),c=ob(DE,t.__scopeMenu),s=jB(DE,t.__scopeMenu),v=ze(n,l),u=h.useRef(!1),m=he(()=>{const p=l.current;if(!r&&p){const d=new CustomEvent(nZ,{bubbles:!0,cancelable:!0});p.addEventListener(nZ,z=>o==null?void 0:o(z),{once:!0}),RL(p,d),d.defaultPrevented?u.current=!1:c.onClose()}},"handleSelect");return k.jsx(Vie,{...i,ref:v,disabled:r,onClick:Q(t.onClick,m),onPointerDown:p=>{var d;(d=t.onPointerDown)==null||d.call(t,p),u.current=!0},onPointerUp:Q(t.onPointerUp,p=>{var d;u.current||(d=p.currentTarget)==null||d.click()}),onKeyDown:Q(t.onKeyDown,p=>{r||p.target!==p.currentTarget||s.searchRef.current!==""&&p.key===" "||iie.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})},"MenuItem")),Vie=h.forwardRef(he(function(t,n){const{__scopeMenu:r,disabled:o=!1,textValue:i,...l}=t,c=jB(DE,r),s=IB(r),v=h.useRef(null),u=ze(n,v),[m,p]=h.useState(!1),[d,z]=h.useState("");return h.useEffect(()=>{const w=v.current;w&&z((w.textContent??"").trim())},[l.children]),k.jsx(TE.ItemSlot,{scope:r,disabled:o,textValue:i??d,children:k.jsx(Moe,{asChild:!0,...s,focusable:!o,children:k.jsx(v2.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...l,ref:u,onPointerMove:Q(t.onPointerMove,iV(w=>{o?c.onItemLeave(w):(c.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Q(t.onPointerLeave,iV(w=>c.onItemLeave(w))),onFocus:Q(t.onFocus,()=>p(!0)),onBlur:Q(t.onBlur,()=>p(!1))})})})},"MenuItemImpl")),Cie="MenuRadioGroup",[Zle,Ile]=Bn(Cie,{value:void 0,onValueChange:he(()=>{},"onValueChange")}),Eie="MenuItemIndicator",[Ale,jle]=Bn(Eie,{checked:!1}),Lie=h.forwardRef(he(function(t,n){const{__scopeMenu:r,...o}=t;return k.jsx(v2.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),bie="MenuSub",[Ble,Ole]=Bn(bie);function OB(e){return e?"open":"closed"}he(OB,"getOpenState");function PB(e){return e==="indeterminate"}he(PB,"isIndeterminate");function Sie(e){return PB(e)?"indeterminate":e?"checked":"unchecked"}he(Sie,"getCheckedState");function qB(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}he(qB,"focusFirst");function RB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}he(RB,"wrapArray");function TB(e,t,n){const o=t.length>1&&Array.from(t).every(v=>v===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=RB(e,Math.max(i,0));o.length===1&&(l=l.filter(v=>v!==n));const s=l.find(v=>v.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}he(TB,"getNextMatch");function DB(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const c=t[i],s=t[l],v=c.x,u=c.y,m=s.x,p=s.y;u>r!=p>r&&n<(m-v)*(r-u)/(p-u)+v&&(o=!o)}return o}he(DB,"isPointInPolygon");function FB(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return DB(n,t)}he(FB,"isPointerInGraceArea");function iV(e){return t=>t.pointerType==="mouse"?e(t):void 0}he(iV,"whenMouse");var Zie=uie,Iie=pie,Aie=wie,jie=zie,Bie=xie,Oie=Lie,Pie=Object.defineProperty,Zr=(e,t)=>Pie(e,"name",{value:t,configurable:!0}),ib="DropdownMenu",[qie,Ple]=At(ib,[ZB]),Ir=ZB(),[Rie,NB]=qie(ib),Tie=Zr(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,s=Ir(t),v=h.useRef(null),[u,m]=IV({prop:o,defaultProp:i??!1,onChange:l,caller:ib});return k.jsx(Rie,{scope:t,triggerId:fa(),triggerRef:v,contentId:fa(),open:u,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(p=>!p),[m]),modal:c,children:k.jsx(Zie,{...s,open:u,onOpenChange:m,dir:r,modal:c,children:n})})},"DropdownMenu"),Die="DropdownMenuTrigger",Fie=h.forwardRef(Zr(function(t,n){const{__scopeDropdownMenu:r,disabled:o=!1,...i}=t,l=NB(Die,r),c=Ir(r),s=ze(n,l.triggerRef);return k.jsx(Iie,{asChild:!0,...c,children:k.jsx(v2.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:s,onPointerDown:Q(t.onPointerDown,v=>{!o&&v.button===0&&v.ctrlKey===!1&&(l.onOpenToggle(),l.open||v.preventDefault())}),onKeyDown:Q(t.onKeyDown,v=>{o||(["Enter"," "].includes(v.key)&&l.onOpenToggle(),v.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),Nie=Zr(e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ir(t);return k.jsx(Aie,{...r,...n})},"DropdownMenuPortal"),Uie="DropdownMenuContent",$ie=h.forwardRef(Zr(function(t,n){const{__scopeDropdownMenu:r,...o}=t,i=NB(Uie,r),l=Ir(r),c=h.useRef(!1);return k.jsx(jie,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...o,ref:n,onCloseAutoFocus:Q(t.onCloseAutoFocus,s=>{var v;c.current||(v=i.triggerRef.current)==null||v.focus(),c.current=!1,s.preventDefault()}),onInteractOutside:Q(t.onInteractOutside,s=>{const v=s.detail.originalEvent,u=v.button===0&&v.ctrlKey===!0,m=v.button===2||u;(!i.modal||m)&&(c.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),_ie=h.forwardRef(Zr(function(t,n){const{__scopeDropdownMenu:r,...o}=t,i=Ir(r);return k.jsx(Bie,{...i,...o,ref:n})},"DropdownMenuItem")),Wie=h.forwardRef(Zr(function(t,n){const{__scopeDropdownMenu:r,...o}=t,i=Ir(r);return k.jsx(Oie,{...i,...o,ref:n})},"DropdownMenuSeparator")),Gie=Tie,Xie=Fie,Kie=Nie,UB=$ie,$B=_ie,_B=Wie;const Qie=Gie,Yie=Xie,WB=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>k.jsx(Kie,{children:k.jsx(UB,{ref:r,sideOffset:t,className:C2("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));WB.displayName=UB.displayName;const GB=h.forwardRef(({className:e,...t},n)=>k.jsx($B,{ref:n,className:C2("relative flex cursor-default select-none items-center rounded-[var(--radius-sm)] px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));GB.displayName=$B.displayName;const Jie=h.forwardRef(({className:e,...t},n)=>k.jsx(_B,{ref:n,className:C2("-mx-1 my-1 h-px bg-muted",e),...t}));Jie.displayName=_B.displayName;const ele=[{id:"default",label:"Default",swatch:["#ffffff","#f4f4f5","#4f46e5","#18181b"]},{id:"pixel",label:"Pixel",swatch:["#1a1c2c","#29366f","#ef7d57","#38b764"]},{id:"slate",label:"Slate",swatch:["#f8fafc","#e2e8f0","#3b82f6","#0f172a"]}];function tle(){const[e,t]=h.useState(()=>document.documentElement.dataset.theme??"default"),{icon:n}=An(),r=o=>{document.documentElement.dataset.theme=o,localStorage.setItem("zd-theme",o),t(o),document.documentElement.dispatchEvent(new CustomEvent("themechange"))};return k.jsxs(Qie,{children:[k.jsx(Yie,{asChild:!0,children:k.jsx(ja,{variant:"ghost",size:"icon","aria-label":"切换风格",title:"切换风格",children:n("palette","h-4 w-4")})}),k.jsx(WB,{align:"end",className:"w-48",children:ele.map(o=>{const i=e===o.id;return k.jsxs(GB,{onClick:()=>r(o.id),className:"flex items-center gap-2.5 cursor-pointer",children:[k.jsx("span",{className:"flex gap-0.5","aria-hidden":"true",children:o.swatch.map((l,c)=>k.jsx("span",{className:"h-3 w-3 rounded-[var(--radius-sm)] inline-block border border-border/50",style:{backgroundColor:l}},c))}),k.jsx("span",{className:"flex-1 text-sm",children:o.label}),i&&k.jsx("span",{className:"h-3.5 w-3.5 text-foreground",children:n("check","h-3.5 w-3.5")})]},o.id)})})]})}function hle({stoppedRef:e}){const[t,n]=h.useState(!1),{icon:r}=An(),o=async()=>{if(confirm("停止预览服务?停止后需重新启动才能继续预览。")){e.current=!0;try{const i=await fetch("/__config").then(c=>c.json()),l=await fetch("/__stop",{method:"POST",headers:{"x-stop-token":i.stopToken??""}});if(!l.ok)throw new Error(`stop ${l.status}`)}catch{uT.error("停止预览服务失败");return}n(!0)}};return t?k.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-muted",children:k.jsxs("div",{className:"text-center text-muted-foreground",children:[k.jsx("div",{className:"mx-auto mb-3.5 grid h-14 w-14 place-items-center rounded-[var(--radius-md)] bg-primary text-primary-foreground text-2xl font-bold",children:"v"}),k.jsx("p",{children:"预览服务已停止"}),k.jsx("p",{className:"mt-1 text-xs",children:"关闭此页,或在终端重新启动"})]})}):k.jsx(ja,{variant:"ghost",size:"icon",onClick:o,"aria-label":"停止预览服务",title:"停止预览服务",children:r("power","h-4 w-4")})}function nle({status:e,stoppedRef:t,children:n}){const r=e==="live"?"bg-success":e==="lost"?"bg-destructive":"bg-muted-foreground";return k.jsxs("header",{className:"h-[var(--topbar-h)] border-b bg-background flex items-center px-3.5 gap-2",children:[k.jsx("strong",{className:"text-sm font-bold tracking-tight",children:"zdashboard"}),k.jsx("div",{className:"ml-auto flex items-center gap-2",children:n}),k.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[k.jsx("span",{className:`h-2 w-2 rounded-[var(--radius-full)] ${r}`}),k.jsx("span",{className:"hidden sm:inline",children:e==="live"?"实时":e==="lost"?"已断开":"连接中"})]}),k.jsx(tle,{}),k.jsx(Xae,{}),k.jsx(hle,{stoppedRef:t})]})}function rle({active:e,onSelect:t,plugins:n}){const{icon:r}=An();return k.jsxs("nav",{className:"w-[var(--icon-rail-w)] flex-none border-r bg-background flex flex-col items-center py-2 gap-1",children:[k.jsxs(aV,{children:[k.jsx(oV,{asChild:!0,children:k.jsx("button",{onClick:()=>t(null),className:`relative w-9 h-9 flex items-center justify-center rounded-[var(--radius-lg)] text-sm transition-all ${e===null?"bg-primary/10 text-primary":"hover:bg-muted text-muted-foreground hover:scale-105"}`,"aria-current":e===null?"page":void 0,children:r("rail:home","h-4 w-4")})}),k.jsx(Ca,{side:"right",children:"首页"})]}),n.map(o=>k.jsxs(aV,{children:[k.jsx(oV,{asChild:!0,children:k.jsx("button",{onClick:()=>t(o.mode),"aria-current":e===o.mode?"page":void 0,className:`relative w-9 h-9 flex items-center justify-center rounded-[var(--radius-lg)] text-base transition-all ${e===o.mode?"bg-primary/10 text-primary":"hover:bg-muted text-muted-foreground hover:scale-105"}`,children:k.jsx("span",{children:o.icon})})}),k.jsx(Ca,{side:"right",children:o.label})]},o.mode))]})}function XB(e,t){window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:t}))}const rZ=(e,t)=>{const n=JSON.stringify(t);window.localStorage.setItem(e,n),XB(e,n)},ale=e=>{window.localStorage.removeItem(e),XB(e,null)},aZ=e=>window.localStorage.getItem(e),ole=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),ile=()=>{throw Error("useLocalStorage is a client-only hook")};function lle(e,t){const n=()=>aZ(e),r=h.useSyncExternalStore(ole,n,ile),o=h.useCallback(i=>{try{const l=typeof i=="function"?i(JSON.parse(r)):i;l==null?ale(e):rZ(e,l)}catch(l){console.warn(l)}},[e,r]);return h.useEffect(()=>{aZ(e)===null&&typeof t<"u"&&rZ(e,t)},[e,t]),[r?JSON.parse(r):t,o]}const cle="zd-sidebar-";function sle({mode:e,hasContent:t=!0,children:n,className:r}){const{icon:o}=An(),[i,l]=lle(`${cle}${e}`,!0),[c,s]=h.useState(!1),v=()=>l(m=>!m),u=t&&(i||c);return k.jsxs("div",{className:`relative flex-none ${r??""}`,children:[k.jsx("div",{className:["bg-background overflow-hidden","fixed left-0 top-0 h-full w-[calc(var(--sidebar-w)*0.78)] max-w-[var(--sidebar-w)] z-40 shadow-lg","transition-[width,transform] duration-200 ease-out",u?"translate-x-0":"-translate-x-full","sm:max-w-none sm:translate-x-0 sm:h-full sm:top-auto sm:left-auto",u?i?"sm:relative sm:z-auto sm:w-[var(--sidebar-w)] sm:shadow-none sm:border-r":"sm:absolute sm:z-30 sm:w-[var(--sidebar-w)] sm:shadow-lg sm:border-r":"sm:relative sm:z-auto sm:w-0 sm:shadow-none"].join(" "),onMouseEnter:()=>!i&&s(!0),onMouseLeave:()=>s(!1),children:k.jsx("div",{className:"h-full w-[var(--sidebar-w)] overflow-auto",children:n})}),k.jsx("div",{className:`sm:hidden fixed inset-0 z-30 bg-black/40 transition-opacity ${u?"opacity-100":"pointer-events-none opacity-0"}`,onClick:v,"aria-hidden":"true"}),t&&k.jsx("button",{onClick:v,"aria-expanded":i,className:`hidden sm:flex absolute right-0 top-1/2 -translate-y-1/2 z-40
7814
7814
  h-10 w-5 items-center justify-center
7815
7815
  rounded-l-[var(--radius-md)] border border-r-0 border-border bg-background
7816
- text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,"aria-label":i?"折叠侧栏":"展开侧栏",children:o("chevron-left",`h-3.5 w-3.5 transition-transform duration-200 ${i?"":"rotate-180"}`)}),t&&!u&&k.jsx("button",{onClick:v,"aria-label":"展开侧栏",className:"sm:hidden fixed left-0 top-1/2 -translate-y-1/2 z-40 h-12 w-6 flex items-center justify-center rounded-r-[var(--radius-md)] border border-l-0 border-border bg-background text-muted-foreground shadow",children:o("chevron-left","h-3.5 w-3.5 rotate-180")}),t&&!i&&k.jsx("div",{className:"hidden sm:block absolute left-0 top-0 h-full w-1.5 z-10",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)})]})}const ur=new Set;let bx=null,Ea="connecting";const FE=new Set;let pr=null;function CC(e){Ea=e,FE.forEach(t=>t(e))}function KB(){if(bx)return;CC(Ea==="lost"?"connecting":Ea);const e=new EventSource("/__reload");bx=e,e.onopen=()=>CC("live"),e.addEventListener("reload",()=>ur.forEach(t=>t.onReload())),e.addEventListener("files",()=>ur.forEach(t=>t.onFiles())),e.onerror=()=>{e.close(),bx=null,CC("lost"),pr&&clearTimeout(pr),pr=setTimeout(KB,1500)}}function vle(){typeof window<"u"&&ur.size>0&&!bx&&KB()}function QB(e,t,n){const[r,o]=h.useState(Ea),i=h.useRef(e),l=h.useRef(t);return h.useEffect(()=>{i.current=e}),h.useEffect(()=>{l.current=t}),h.useEffect(()=>{const c={onReload:()=>i.current(),onFiles:()=>l.current(),onStatus:o};return ur.add(c),FE.add(o),o(Ea),vle(),()=>{ur.delete(c),FE.delete(o),ur.size===0&&pr&&(clearTimeout(pr),pr=null)}},[]),r}const po="inline-flex items-center gap-1.5 rounded-full bg-muted/60 px-2.5 h-[var(--chip-h)] font-mono text-xs leading-none text-muted-foreground";function dle({projectPath:e,stoppedRef:t}){const[n,r]=h.useState({}),[o,i]=h.useState(""),[l,c]=h.useState(0),s=QB(()=>{},()=>c(m=>m+1)),{icon:v}=An();h.useEffect(()=>{fetch("/__config",{cache:"no-store"}).then(m=>m.json()).then(m=>{r({branch:m.branch,dirty:m.dirty}),i(m.version??"")}).catch(()=>{})},[l]);const u=s==="live"?"bg-success animate-pulse":s==="lost"?"bg-destructive":"bg-muted-foreground";return k.jsxs("footer",{className:"h-[var(--statusbar-h)] border-t bg-background flex items-center justify-between px-3 gap-2 text-sm",children:[k.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e&&k.jsxs(aV,{children:[k.jsx(oV,{asChild:!0,children:k.jsxs("span",{className:`${po} shrink-0 cursor-default`,children:[v("folder-open","h-3 w-3"),e.split("/").pop()||e]})}),k.jsx(Ca,{side:"top",className:"font-mono text-xs",children:e})]}),n.branch&&k.jsxs(aV,{children:[k.jsx(oV,{asChild:!0,children:k.jsxs("span",{className:`${po} shrink-0 cursor-default`,children:[v("git-branch","h-3 w-3"),n.branch,n.dirty?k.jsxs("span",{className:"text-warning",children:["● ",n.dirty]}):k.jsx("span",{className:"text-success",children:"clean"})]})}),k.jsx(Ca,{side:"top",className:"font-mono text-xs",children:n.dirty?`${n.dirty} 个未提交变更`:"工作区干净"})]})]}),k.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o&&k.jsx("span",{className:po,children:o}),k.jsxs("span",{className:po,title:s==="live"?"实时推送已连接":s==="lost"?"连接断开,自动重连中":"连接中",children:[k.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${u}`}),s==="live"?"SSE":s==="lost"?"重连中":"连接中"]})]})]})}const mle=SA("rounded-[var(--radius-xl)] border bg-card text-card-foreground shadow-sm",{variants:{variant:{default:"",outline:"bg-background"}},defaultVariants:{variant:"default"}}),YB=h.forwardRef(({className:e,variant:t,...n},r)=>k.jsx("div",{ref:r,className:C2(mle({variant:t,className:e})),...n}));YB.displayName="Card";const JB=h.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:C2("flex flex-col space-y-1.5 p-6",e),...t}));JB.displayName="CardHeader";const eO=h.forwardRef(({className:e,...t},n)=>k.jsx("h3",{ref:n,className:C2("font-semibold leading-none tracking-tight",e),...t}));eO.displayName="CardTitle";const tO=h.forwardRef(({className:e,...t},n)=>k.jsx("p",{ref:n,className:C2("text-sm text-muted-foreground",e),...t}));tO.displayName="CardDescription";const ule=h.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:C2("p-6 pt-0",e),...t}));ule.displayName="CardContent";const ple=h.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:C2("flex items-center p-6 pt-0",e),...t}));ple.displayName="CardFooter";const yle=[{key:"hasOpenspec",label:"openspec"},{key:"hasDocs",label:"docs"},{key:"hasJust",label:"just"},{key:"hasBugs",label:"bugs"}];function gle({plugins:e,detect:t,onSelect:n}){return k.jsxs("div",{className:"space-y-5",children:[k.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:e.map(r=>k.jsx("button",{onClick:()=>n(r.mode),className:"text-left group rounded-[var(--radius-lg)] focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:k.jsx(YB,{className:"h-full transition-all duration-200 group-hover:-translate-y-0.5 group-hover:shadow-md group-hover:border-muted-foreground/30",children:k.jsx(JB,{children:k.jsxs("div",{className:"flex items-center gap-2.5",children:[k.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-[var(--radius-md)] bg-muted text-lg leading-none group-hover:bg-primary/10 transition-colors",children:r.icon}),k.jsxs("div",{className:"min-w-0",children:[k.jsxs(eO,{className:"text-sm flex items-center gap-1.5",children:[k.jsx("span",{className:"truncate",children:r.label}),r.external&&k.jsx("span",{className:"flex-none text-xs px-1.5 py-0.5 rounded-[var(--radius-full)] bg-muted text-muted-foreground border",children:"外部"})]}),k.jsx(tO,{className:"truncate",children:r.description??r.mode})]})]})})})},r.mode))}),k.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground",children:[k.jsx("span",{className:"mr-1",children:"探测"}),yle.map(r=>k.jsxs("span",{className:`inline-flex items-center gap-1 rounded-[var(--radius-full)] border px-2 h-[var(--chip-h)] font-mono ${t[r.key]?"border-success/30 bg-success/10 text-success":"border-border bg-muted/40 text-muted-foreground/70"}`,children:[k.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${t[r.key]?"bg-success":"bg-muted-foreground/40"}`}),r.label]},r.key))]})]})}const wle="modulepreload",Mle=function(e){return"/"+e},oZ={},Tt=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=Promise.allSettled(n.map(s=>{if(s=Mle(s),s in oZ)return;oZ[s]=!0;const v=s.endsWith(".css"),u=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${u}`))return;const m=document.createElement("link");if(m.rel=v?"stylesheet":wle,v||(m.as="script"),m.crossOrigin="",m.href=s,c&&m.setAttribute("nonce",c),document.head.appendChild(m),v)return new Promise((p,d)=>{m.addEventListener("load",p),m.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${s}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})};function zle({viewerUrl:e,label:t}){return k.jsx("div",{className:"mx-auto h-full w-full max-w-6xl overflow-hidden rounded-lg border bg-background shadow-sm",children:k.jsx("iframe",{src:e,title:t,className:"w-full h-full border-0 bg-background",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"})})}function Hle({icon:e,title:t,hint:n,tone:r="muted"}){return k.jsx("div",{className:"flex-1 grid place-items-center text-muted-foreground select-none",children:k.jsxs("div",{className:"text-center",children:[k.jsx("div",{className:`mx-auto mb-3.5 grid h-14 w-14 place-items-center rounded-[var(--radius-lg)] ${r==="primary"?"bg-primary text-primary-foreground shadow-sm":"bg-muted text-muted-foreground"}`,children:e}),k.jsx("p",{className:"text-sm text-foreground/80",children:t}),n&&k.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n})]})})}function fle({label:e}){const{icon:t}=An();return k.jsx(Hle,{icon:t("package-open"),title:`${e} · 无可视化界面`,hint:"该插件只提供后端能力;在插件目录添加 web/index.html 可获得 iframe 工作区"})}const iZ=["stats","view","bugs","review","design","apply","just"];function kle(){const[e,t]=B.useState([]),[n,r]=B.useState([]);return B.useEffect(()=>{let o=!1;return(async()=>{const l=Object.entries(Object.assign({"../../plugins/apply/web.tsx":()=>Tt(()=>import("./web-C8I10oqh.js"),__vite__mapDeps([0,1,2,3])),"../../plugins/bugs/web.tsx":()=>Tt(()=>import("./web-BcTJQUKr.js"),__vite__mapDeps([4,1,5])),"../../plugins/design/web.tsx":()=>Tt(()=>import("./web-BOg9UnpC.js"),__vite__mapDeps([6,7,3,8,9,5])),"../../plugins/just/web.tsx":()=>Tt(()=>import("./web-BXCBKn6i.js"),__vite__mapDeps([10,5])),"../../plugins/review/web.tsx":()=>Tt(()=>import("./web-CLCAgjmg.js"),__vite__mapDeps([11,7,3,8,2,5])),"../../plugins/stats/web.tsx":()=>Tt(()=>import("./web-CXE89yN1.js"),[]),"../../plugins/view/web.tsx":()=>Tt(()=>import("./web-5newSm97.js"),__vite__mapDeps([12,7,3,8,9]))})),c=[];for(const[,s]of l)try{const v=await s();v.default&&c.push(v.default)}catch(v){console.error("[zdashboard] failed to load web plugin:",v)}c.sort((s,v)=>{const u=iZ.indexOf(s.mode),m=iZ.indexOf(v.mode);return u===-1&&m===-1?s.mode.localeCompare(v.mode):u===-1?1:m===-1?-1:u-m}),o||t(c)})(),()=>{o=!0}},[]),B.useEffect(()=>{let o=!1;return(async()=>{try{const l=await(await fetch("/__plugins",{cache:"no-store"})).json();if(!o){const c=(l.plugins??[]).map(s=>s.viewerUrl?{...s,Workspace:()=>B.createElement(zle,{viewerUrl:s.viewerUrl,label:s.label})}:{...s,Workspace:()=>B.createElement(fle,{label:s.label})});r(c.filter(s=>!e.some(v=>v.mode===s.mode)))}}catch{}})(),()=>{o=!0}},[e]),[...e,...n]}function xle(){const e=kle(),[t,n]=h.useState(null),[r,o]=h.useState(""),i=h.useRef(!1),[l,c]=h.useState({hasOpenspec:!1,hasDocs:!1,hasJust:!1,hasBugs:!1}),[s,v]=h.useState(null),u=QB(()=>{window.location.reload()},()=>{});h.useEffect(()=>{let d=!1;return(async()=>{try{const w=await(await fetch("/__config",{cache:"no-store"})).json();if(d)return;o(w.root??"")}catch{}})(),()=>{d=!0}},[]),h.useEffect(()=>{let d=!1;return(async()=>{try{const w=await(await fetch("/__files",{cache:"no-store"})).json();d||c({hasOpenspec:w.hasOpenspec,hasDocs:w.hasDocs,hasJust:w.hasJust,hasBugs:w.hasBugs})}catch{}})(),()=>{d=!0}},[]);const m=h.useCallback(d=>{n(d),v(null),d===null?window.location.hash="":window.location.hash=d},[]);h.useEffect(()=>{const d=z=>{const w=z.detail;w!=null&&w.mode&&(v({...w,navToken:Date.now()}),n(w.mode),window.location.hash=w.mode)};return window.addEventListener("zd-dashboard-nav",d),()=>window.removeEventListener("zd-dashboard-nav",d)},[]),h.useEffect(()=>{const d=()=>{const z=window.location.hash.slice(1);!z||z==="home"?n(null):e.some(w=>w.mode===z)&&n(z)};return d(),window.addEventListener("hashchange",d),()=>window.removeEventListener("hashchange",d)},[e]);const p=t?e.find(d=>d.mode===t):null;return k.jsxs("div",{className:"flex h-screen flex-col",children:[k.jsx(nle,{status:u,stoppedRef:i}),k.jsxs("div",{className:"flex-1 min-h-0 flex",children:[k.jsx(rle,{active:t,onSelect:m,plugins:e.map(d=>({mode:d.mode,label:d.label,icon:d.icon}))}),k.jsx(sle,{mode:t??"home",hasContent:!!(p!=null&&p.Sidebar),children:p!=null&&p.Sidebar?k.jsx(h.Suspense,{fallback:k.jsx("div",{className:"w-full h-full"}),children:k.jsx("div",{className:"h-full animate-in fade-in slide-in-from-left-1 duration-200",children:k.jsx(p.Sidebar,{navTarget:s},(s==null?void 0:s.navToken)??"side")},t)}):null}),k.jsx("section",{className:"flex-1 min-h-0 dot-grid",children:k.jsx("div",{className:"h-full p-6",children:t&&p?k.jsx(h.Suspense,{fallback:k.jsx("div",{className:"mx-auto h-full max-w-6xl rounded-lg border bg-background shadow-sm animate-pulse"}),children:k.jsx("div",{className:"h-full animate-in fade-in duration-200",children:k.jsx(p.Workspace,{...s?{navTarget:s}:{}},(s==null?void 0:s.navToken)??"ws")},t)}):k.jsx(gle,{plugins:e,detect:l,onSelect:m})})})]}),k.jsx(dle,{projectPath:r,stoppedRef:i})]})}const lb=document.documentElement;let Sx=localStorage.getItem("zd-mode");Sx||(Sx=localStorage.getItem("zdashboard-theme")==="light"?"light":"dark",localStorage.setItem("zd-mode",Sx),localStorage.removeItem("zdashboard-theme"));lb.dataset.mode=Sx;let Vle=localStorage.getItem("zd-theme")??"default";lb.dataset.theme=Vle;lb.dispatchEvent(new CustomEvent("themechange"));EC.createRoot(document.getElementById("root")).render(k.jsx(B.StrictMode,{children:k.jsxs(PF,{children:[k.jsx(YR,{children:k.jsx(xle,{})}),k.jsx(CT,{position:"bottom-right",richColors:!0})]})}));export{ja as B,Hle as E,Tt as _,QB as a,SA as b,C2 as c,Ele as d,uT as e,Lle as f,lZ as g,k as j,h as r,An as u};
7816
+ text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,"aria-label":i?"折叠侧栏":"展开侧栏",children:o("chevron-left",`h-3.5 w-3.5 transition-transform duration-200 ${i?"":"rotate-180"}`)}),t&&!u&&k.jsx("button",{onClick:v,"aria-label":"展开侧栏",className:"sm:hidden fixed left-0 top-1/2 -translate-y-1/2 z-40 h-12 w-6 flex items-center justify-center rounded-r-[var(--radius-md)] border border-l-0 border-border bg-background text-muted-foreground shadow",children:o("chevron-left","h-3.5 w-3.5 rotate-180")}),t&&!i&&k.jsx("div",{className:"hidden sm:block absolute left-0 top-0 h-full w-1.5 z-10",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)})]})}const ur=new Set;let bx=null,Ea="connecting";const FE=new Set;let pr=null;function CC(e){Ea=e,FE.forEach(t=>t(e))}function KB(){if(bx)return;CC(Ea==="lost"?"connecting":Ea);const e=new EventSource("/__reload");bx=e,e.onopen=()=>CC("live"),e.addEventListener("reload",()=>ur.forEach(t=>t.onReload())),e.addEventListener("files",()=>ur.forEach(t=>t.onFiles())),e.onerror=()=>{e.close(),bx=null,CC("lost"),pr&&clearTimeout(pr),pr=setTimeout(KB,1500)}}function vle(){typeof window<"u"&&ur.size>0&&!bx&&KB()}function QB(e,t,n){const[r,o]=h.useState(Ea),i=h.useRef(e),l=h.useRef(t);return h.useEffect(()=>{i.current=e}),h.useEffect(()=>{l.current=t}),h.useEffect(()=>{const c={onReload:()=>i.current(),onFiles:()=>l.current(),onStatus:o};return ur.add(c),FE.add(o),o(Ea),vle(),()=>{ur.delete(c),FE.delete(o),ur.size===0&&pr&&(clearTimeout(pr),pr=null)}},[]),r}const po="inline-flex items-center gap-1.5 rounded-full bg-muted/60 px-2.5 h-[var(--chip-h)] font-mono text-xs leading-none text-muted-foreground";function dle({projectPath:e,stoppedRef:t}){const[n,r]=h.useState({}),[o,i]=h.useState(""),[l,c]=h.useState(0),s=QB(()=>{},()=>c(m=>m+1)),{icon:v}=An();h.useEffect(()=>{fetch("/__config",{cache:"no-store"}).then(m=>m.json()).then(m=>{r({branch:m.branch,dirty:m.dirty}),i(m.version??"")}).catch(()=>{})},[l]);const u=s==="live"?"bg-success animate-pulse":s==="lost"?"bg-destructive":"bg-muted-foreground";return k.jsxs("footer",{className:"h-[var(--statusbar-h)] border-t bg-background flex items-center justify-between px-3 gap-2 text-sm",children:[k.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e&&k.jsxs(aV,{children:[k.jsx(oV,{asChild:!0,children:k.jsxs("span",{className:`${po} shrink-0 cursor-default`,children:[v("folder-open","h-3 w-3"),e.split("/").pop()||e]})}),k.jsx(Ca,{side:"top",className:"font-mono text-xs",children:e})]}),n.branch&&k.jsxs(aV,{children:[k.jsx(oV,{asChild:!0,children:k.jsxs("span",{className:`${po} shrink-0 cursor-default`,children:[v("git-branch","h-3 w-3"),n.branch,n.dirty?k.jsxs("span",{className:"text-warning",children:["● ",n.dirty]}):k.jsx("span",{className:"text-success",children:"clean"})]})}),k.jsx(Ca,{side:"top",className:"font-mono text-xs",children:n.dirty?`${n.dirty} 个未提交变更`:"工作区干净"})]})]}),k.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o&&k.jsx("span",{className:po,children:o}),k.jsxs("span",{className:po,title:s==="live"?"实时推送已连接":s==="lost"?"连接断开,自动重连中":"连接中",children:[k.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${u}`}),s==="live"?"SSE":s==="lost"?"重连中":"连接中"]})]})]})}const mle=SA("rounded-[var(--radius-xl)] border bg-card text-card-foreground shadow-sm",{variants:{variant:{default:"",outline:"bg-background"}},defaultVariants:{variant:"default"}}),YB=h.forwardRef(({className:e,variant:t,...n},r)=>k.jsx("div",{ref:r,className:C2(mle({variant:t,className:e})),...n}));YB.displayName="Card";const JB=h.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:C2("flex flex-col space-y-1.5 p-6",e),...t}));JB.displayName="CardHeader";const eO=h.forwardRef(({className:e,...t},n)=>k.jsx("h3",{ref:n,className:C2("font-semibold leading-none tracking-tight",e),...t}));eO.displayName="CardTitle";const tO=h.forwardRef(({className:e,...t},n)=>k.jsx("p",{ref:n,className:C2("text-sm text-muted-foreground",e),...t}));tO.displayName="CardDescription";const ule=h.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:C2("p-6 pt-0",e),...t}));ule.displayName="CardContent";const ple=h.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:C2("flex items-center p-6 pt-0",e),...t}));ple.displayName="CardFooter";const yle=[{key:"hasOpenspec",label:"openspec"},{key:"hasDocs",label:"docs"},{key:"hasJust",label:"just"},{key:"hasBugs",label:"bugs"}];function gle({plugins:e,detect:t,onSelect:n}){return k.jsxs("div",{className:"space-y-5",children:[k.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:e.map(r=>k.jsx("button",{onClick:()=>n(r.mode),className:"text-left group rounded-[var(--radius-lg)] focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:k.jsx(YB,{className:"h-full transition-all duration-200 group-hover:-translate-y-0.5 group-hover:shadow-md group-hover:border-muted-foreground/30",children:k.jsx(JB,{children:k.jsxs("div",{className:"flex items-center gap-2.5",children:[k.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-[var(--radius-md)] bg-muted text-lg leading-none group-hover:bg-primary/10 transition-colors",children:r.icon}),k.jsxs("div",{className:"min-w-0",children:[k.jsxs(eO,{className:"text-sm flex items-center gap-1.5",children:[k.jsx("span",{className:"truncate",children:r.label}),r.external&&k.jsx("span",{className:"flex-none text-xs px-1.5 py-0.5 rounded-[var(--radius-full)] bg-muted text-muted-foreground border",children:"外部"})]}),k.jsx(tO,{className:"truncate",children:r.description??r.mode})]})]})})})},r.mode))}),k.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground",children:[k.jsx("span",{className:"mr-1",children:"探测"}),yle.map(r=>k.jsxs("span",{className:`inline-flex items-center gap-1 rounded-[var(--radius-full)] border px-2 h-[var(--chip-h)] font-mono ${t[r.key]?"border-success/30 bg-success/10 text-success":"border-border bg-muted/40 text-muted-foreground/70"}`,children:[k.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${t[r.key]?"bg-success":"bg-muted-foreground/40"}`}),r.label]},r.key))]})]})}const wle="modulepreload",Mle=function(e){return"/"+e},oZ={},Tt=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=Promise.allSettled(n.map(s=>{if(s=Mle(s),s in oZ)return;oZ[s]=!0;const v=s.endsWith(".css"),u=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${u}`))return;const m=document.createElement("link");if(m.rel=v?"stylesheet":wle,v||(m.as="script"),m.crossOrigin="",m.href=s,c&&m.setAttribute("nonce",c),document.head.appendChild(m),v)return new Promise((p,d)=>{m.addEventListener("load",p),m.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${s}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})};function zle({viewerUrl:e,label:t}){return k.jsx("div",{className:"mx-auto h-full w-full max-w-6xl overflow-hidden rounded-lg border bg-background shadow-sm",children:k.jsx("iframe",{src:e,title:t,className:"w-full h-full border-0 bg-background",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"})})}function Hle({icon:e,title:t,hint:n,tone:r="muted"}){return k.jsx("div",{className:"flex-1 grid place-items-center text-muted-foreground select-none",children:k.jsxs("div",{className:"text-center",children:[k.jsx("div",{className:`mx-auto mb-3.5 grid h-14 w-14 place-items-center rounded-[var(--radius-lg)] ${r==="primary"?"bg-primary text-primary-foreground shadow-sm":"bg-muted text-muted-foreground"}`,children:e}),k.jsx("p",{className:"text-sm text-foreground/80",children:t}),n&&k.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n})]})})}function fle({label:e}){const{icon:t}=An();return k.jsx(Hle,{icon:t("package-open"),title:`${e} · 无可视化界面`,hint:"该插件只提供后端能力;在插件目录添加 web/index.html 可获得 iframe 工作区"})}const iZ=["stats","view","bugs","review","design","apply","just"];function kle(){const[e,t]=B.useState([]),[n,r]=B.useState([]);return B.useEffect(()=>{let o=!1;return(async()=>{const l=Object.entries(Object.assign({"../../plugins/apply/web.tsx":()=>Tt(()=>import("./web-CCoznDNk.js"),__vite__mapDeps([0,1,2,3])),"../../plugins/bugs/web.tsx":()=>Tt(()=>import("./web-BrsVNrGk.js"),__vite__mapDeps([4,1,5])),"../../plugins/design/web.tsx":()=>Tt(()=>import("./web-DxK2pSVl.js"),__vite__mapDeps([6,7,3,8,5])),"../../plugins/just/web.tsx":()=>Tt(()=>import("./web-Bt0s1qFE.js"),__vite__mapDeps([9,5])),"../../plugins/review/web.tsx":()=>Tt(()=>import("./web-BNjs9lCy.js"),[]),"../../plugins/stats/web.tsx":()=>Tt(()=>import("./web-BKh2HY35.js"),[]),"../../plugins/view/web.tsx":()=>Tt(()=>import("./web-ShIDOvFD.js"),__vite__mapDeps([10,7,3,8]))})),c=[];for(const[,s]of l)try{const v=await s();v.default&&c.push(v.default)}catch(v){console.error("[zdashboard] failed to load web plugin:",v)}c.sort((s,v)=>{const u=iZ.indexOf(s.mode),m=iZ.indexOf(v.mode);return u===-1&&m===-1?s.mode.localeCompare(v.mode):u===-1?1:m===-1?-1:u-m}),o||t(c)})(),()=>{o=!0}},[]),B.useEffect(()=>{let o=!1;return(async()=>{try{const l=await(await fetch("/__plugins",{cache:"no-store"})).json();if(!o){const c=(l.plugins??[]).map(s=>s.viewerUrl?{...s,Workspace:()=>B.createElement(zle,{viewerUrl:s.viewerUrl,label:s.label})}:{...s,Workspace:()=>B.createElement(fle,{label:s.label})});r(c.filter(s=>!e.some(v=>v.mode===s.mode)))}}catch{}})(),()=>{o=!0}},[e]),[...e,...n]}function xle(){const e=kle(),[t,n]=h.useState(null),[r,o]=h.useState(""),i=h.useRef(!1),[l,c]=h.useState({hasOpenspec:!1,hasDocs:!1,hasJust:!1,hasBugs:!1}),[s,v]=h.useState(null),u=QB(()=>{window.location.reload()},()=>{});h.useEffect(()=>{let d=!1;return(async()=>{try{const w=await(await fetch("/__config",{cache:"no-store"})).json();if(d)return;o(w.root??"")}catch{}})(),()=>{d=!0}},[]),h.useEffect(()=>{let d=!1;return(async()=>{try{const w=await(await fetch("/__files",{cache:"no-store"})).json();d||c({hasOpenspec:w.hasOpenspec,hasDocs:w.hasDocs,hasJust:w.hasJust,hasBugs:w.hasBugs})}catch{}})(),()=>{d=!0}},[]);const m=h.useCallback(d=>{n(d),v(null),d===null?window.location.hash="":window.location.hash=d},[]);h.useEffect(()=>{const d=z=>{const w=z.detail;w!=null&&w.mode&&(v({...w,navToken:Date.now()}),n(w.mode),window.location.hash=w.mode)};return window.addEventListener("zd-dashboard-nav",d),()=>window.removeEventListener("zd-dashboard-nav",d)},[]),h.useEffect(()=>{const d=()=>{const z=window.location.hash.slice(1);!z||z==="home"?n(null):e.some(w=>w.mode===z)&&n(z)};return d(),window.addEventListener("hashchange",d),()=>window.removeEventListener("hashchange",d)},[e]);const p=t?e.find(d=>d.mode===t):null;return k.jsxs("div",{className:"flex h-screen flex-col",children:[k.jsx(nle,{status:u,stoppedRef:i}),k.jsxs("div",{className:"flex-1 min-h-0 flex",children:[k.jsx(rle,{active:t,onSelect:m,plugins:e.map(d=>({mode:d.mode,label:d.label,icon:d.icon}))}),k.jsx(sle,{mode:t??"home",hasContent:!!(p!=null&&p.Sidebar),children:p!=null&&p.Sidebar?k.jsx(h.Suspense,{fallback:k.jsx("div",{className:"w-full h-full"}),children:k.jsx("div",{className:"h-full animate-in fade-in slide-in-from-left-1 duration-200",children:k.jsx(p.Sidebar,{navTarget:s},(s==null?void 0:s.navToken)??"side")},t)}):null}),k.jsx("section",{className:"flex-1 min-h-0 dot-grid",children:k.jsx("div",{className:"h-full p-6",children:t&&p?k.jsx(h.Suspense,{fallback:k.jsx("div",{className:"mx-auto h-full max-w-6xl rounded-lg border bg-background shadow-sm animate-pulse"}),children:k.jsx("div",{className:"h-full animate-in fade-in duration-200",children:k.jsx(p.Workspace,{...s?{navTarget:s}:{}},(s==null?void 0:s.navToken)??"ws")},t)}):k.jsx(gle,{plugins:e,detect:l,onSelect:m})})})]}),k.jsx(dle,{projectPath:r,stoppedRef:i})]})}const lb=document.documentElement;let Sx=localStorage.getItem("zd-mode");Sx||(Sx=localStorage.getItem("zdashboard-theme")==="light"?"light":"dark",localStorage.setItem("zd-mode",Sx),localStorage.removeItem("zdashboard-theme"));lb.dataset.mode=Sx;let Vle=localStorage.getItem("zd-theme")??"default";lb.dataset.theme=Vle;lb.dispatchEvent(new CustomEvent("themechange"));EC.createRoot(document.getElementById("root")).render(k.jsx(B.StrictMode,{children:k.jsxs(PF,{children:[k.jsx(YR,{children:k.jsx(xle,{})}),k.jsx(CT,{position:"bottom-right",richColors:!0})]})}));export{ja as B,Hle as E,Tt as _,QB as a,SA as b,C2 as c,Ele as d,uT as e,Lle as f,lZ as g,k as j,h as r,An as u};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Workspace-jCfxaTOM.js","assets/index-Co_rMXPa.js","assets/index-4aiRmNbP.css","assets/ProgressBar-ycyJBwG-.js"])))=>i.map(i=>d[i]);
2
+ import{r as o,_ as t}from"./index-Co_rMXPa.js";const a={mode:"stats",label:"项目统计",icon:"📊",description:"项目文件统计 · 扫描生成",Workspace:o.lazy(()=>t(()=>import("./Workspace-jCfxaTOM.js"),__vite__mapDeps([0,1,2,3])))};export{a as default};
@@ -0,0 +1,139 @@
1
+ var Js=Object.defineProperty;var Ys=(s,e,t)=>e in s?Js(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var rt=(s,e,t)=>Ys(s,typeof e!="symbol"?e+"":e,t);const L={},St=Symbol.for("yaml.alias"),pt=Symbol.for("yaml.document"),W=Symbol.for("yaml.map"),Wt=Symbol.for("yaml.pair"),J=Symbol.for("yaml.scalar"),pe=Symbol.for("yaml.seq"),D=Symbol.for("yaml.node.type"),te=s=>!!s&&typeof s=="object"&&s[D]===St,se=s=>!!s&&typeof s=="object"&&s[D]===pt,me=s=>!!s&&typeof s=="object"&&s[D]===W,C=s=>!!s&&typeof s=="object"&&s[D]===Wt,I=s=>!!s&&typeof s=="object"&&s[D]===J,ye=s=>!!s&&typeof s=="object"&&s[D]===pe;function $(s){if(s&&typeof s=="object")switch(s[D]){case W:case pe:return!0}return!1}function _(s){if(s&&typeof s=="object")switch(s[D]){case St:case W:case J:case pe:return!0}return!1}const Xt=s=>(I(s)||$(s))&&!!s.anchor,M=Symbol("break visit"),zt=Symbol("skip children"),V=Symbol("remove node");function ne(s,e){const t=Zt(e);se(s)?oe(null,s.contents,t,Object.freeze([s]))===V&&(s.contents=null):oe(null,s,t,Object.freeze([]))}ne.BREAK=M;ne.SKIP=zt;ne.REMOVE=V;function oe(s,e,t,n){const i=xt(s,e,t,n);if(_(i)||C(i))return es(s,n,i),oe(s,i,t,n);if(typeof i!="symbol"){if($(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=oe(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===M)return M;o===V&&(e.items.splice(r,1),r-=1)}}}else if(C(e)){n=Object.freeze(n.concat(e));const r=oe("key",e.key,t,n);if(r===M)return M;r===V&&(e.key=null);const o=oe("value",e.value,t,n);if(o===M)return M;o===V&&(e.value=null)}}return i}async function Je(s,e){const t=Zt(e);se(s)?await ae(null,s.contents,t,Object.freeze([s]))===V&&(s.contents=null):await ae(null,s,t,Object.freeze([]))}Je.BREAK=M;Je.SKIP=zt;Je.REMOVE=V;async function ae(s,e,t,n){const i=await xt(s,e,t,n);if(_(i)||C(i))return es(s,n,i),ae(s,i,t,n);if(typeof i!="symbol"){if($(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=await ae(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===M)return M;o===V&&(e.items.splice(r,1),r-=1)}}}else if(C(e)){n=Object.freeze(n.concat(e));const r=await ae("key",e.key,t,n);if(r===M)return M;r===V&&(e.key=null);const o=await ae("value",e.value,t,n);if(o===M)return M;o===V&&(e.value=null)}}return i}function Zt(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function xt(s,e,t,n){var i,r,o,a,l;if(typeof t=="function")return t(s,e,n);if(me(e))return(i=t.Map)==null?void 0:i.call(t,s,e,n);if(ye(e))return(r=t.Seq)==null?void 0:r.call(t,s,e,n);if(C(e))return(o=t.Pair)==null?void 0:o.call(t,s,e,n);if(I(e))return(a=t.Scalar)==null?void 0:a.call(t,s,e,n);if(te(e))return(l=t.Alias)==null?void 0:l.call(t,s,e,n)}function es(s,e,t){const n=e[e.length-1];if($(n))n.items[s]=t;else if(C(n))s==="key"?n.key=t:n.value=t;else if(se(n))n.contents=t;else{const i=te(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Hs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Gs=s=>s.replace(/[!,[\]{}]/g,e=>Hs[e]);class B{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},B.defaultYaml,e),this.tags=Object.assign({},B.defaultTags,t)}clone(){const e=new B(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new B(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:B.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},B.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:B.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},B.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Gs(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(e&&n.length>0&&_(e.contents)){const r={};ne(e.contents,(o,a)=>{_(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
2
+ `)}}B.defaultYaml={explicit:!1,version:"1.2"};B.defaultTags={"!!":"tag:yaml.org,2002:"};function ts(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function ss(s){const e=new Set;return ne(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function ns(s,e){for(let t=1;;++t){const n=`${s}${t}`;if(!e.has(n))return n}}function Qs(s,e){const t=[],n=new Map;let i=null;return{onAnchor:r=>{t.push(r),i??(i=ss(s));const o=ns(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=n.get(r);if(typeof o=="object"&&o.anchor&&(I(o.node)||$(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}function le(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){const o=n[i],a=le(s,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const r=n.get(i),o=le(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(const i of Array.from(n)){const r=le(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(const[i,r]of Object.entries(n)){const o=le(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}function P(s,e,t){if(Array.isArray(s))return s.map((n,i)=>P(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!Xt(s))return s.toJSON(e,t);const n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};const i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!(t!=null&&t.keep)?Number(s):s}class kt{constructor(e){Object.defineProperty(this,D,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!se(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=P(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?le(r,{"":a},"",a):a}}class Ye extends kt{constructor(e){super(St),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if((t==null?void 0:t.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let n;t!=null&&t.aliasResolveCache?n=t.aliasResolveCache:(n=[],ne(e,{Node:(r,o)=>{(te(o)||Xt(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let i;for(const r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(a||(P(o,null,t),a=n.get(o)),(a==null?void 0:a.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Me(i,o,n)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,n){const i=`*${this.source}`;if(e){if(ts(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function Me(s,e,t){if(te(e)){const n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if($(e)){let n=0;for(const i of e.items){const r=Me(s,i,t);r>n&&(n=r)}return n}else if(C(e)){const n=Me(s,e.key,t),i=Me(s,e.value,t);return Math.max(n,i)}return 1}const is=s=>!s||typeof s!="function"&&typeof s!="object";class O extends kt{constructor(e){super(J),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:P(this.value,e,t)}toString(){return String(this.value)}}O.BLOCK_FOLDED="BLOCK_FOLDED";O.BLOCK_LITERAL="BLOCK_LITERAL";O.PLAIN="PLAIN";O.QUOTE_DOUBLE="QUOTE_DOUBLE";O.QUOTE_SINGLE="QUOTE_SINGLE";const Ws="tag:yaml.org,2002:";function Xs(s,e,t){if(e){const n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>{var i;return((i=n.identify)==null?void 0:i.call(n,s))&&!n.format})}function Oe(s,e,t){var f,d,h;if(se(s)&&(s=s.contents),_(s))return s;if(C(s)){const y=(d=(f=t.schema[W]).createNode)==null?void 0:d.call(f,t.schema,null,t);return y.items.push(s),y}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t;let l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor??(l.anchor=i(s)),new Ye(l.anchor);l={anchor:null,node:null},a.set(s,l)}e!=null&&e.startsWith("!!")&&(e=Ws+e.slice(2));let c=Xs(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){const y=new O(s);return l&&(l.node=y),y}c=s instanceof Map?o[W]:Symbol.iterator in Object(s)?o[pe]:o[W]}r&&(r(c),delete t.onTagObj);const p=c!=null&&c.createNode?c.createNode(t.schema,s,t):typeof((h=c==null?void 0:c.nodeClass)==null?void 0:h.from)=="function"?c.nodeClass.from(t.schema,s,t):new O(s);return e?p.tag=e:c.default||(p.tag=c.tag),l&&(l.node=p),p}function qe(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Oe(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}const ke=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done;class rs extends kt{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>_(n)||C(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ke(e))this.add(t);else{const[n,...i]=e,r=this.get(n,!0);if($(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const i=this.get(t,!0);if($(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&I(r)?r.value:r:$(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!C(t))return!1;const n=t.value;return n==null||e&&I(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(n.length===0)return this.has(t);const i=this.get(t,!0);return $(i)?i.hasIn(n):!1}setIn(e,t){const[n,...i]=e;if(i.length===0)this.set(n,t);else{const r=this.get(n,!0);if($(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}const zs=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function H(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}const z=(s,e,t)=>s.endsWith(`
3
+ `)?H(t,e):t.includes(`
4
+ `)?`
5
+ `+H(t,e):(s.endsWith(" ")?"":" ")+t,os="flow",mt="block",Ke="quoted";function He(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return s;i<r&&(r=0);const l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;const c=[],p={};let f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let d,h,y=!1,u=-1,m=-1,g=-1;t===mt&&(u=Kt(s,u,e.length),u!==-1&&(f=u+l));for(let k;k=s[u+=1];){if(t===Ke&&k==="\\"){switch(m=u,s[u+1]){case"x":u+=3;break;case"u":u+=5;break;case"U":u+=9;break;default:u+=1}g=u}if(k===`
6
+ `)t===mt&&(u=Kt(s,u,e.length)),f=u+e.length+l,d=void 0;else{if(k===" "&&h&&h!==" "&&h!==`
7
+ `&&h!==" "){const S=s[u+1];S&&S!==" "&&S!==`
8
+ `&&S!==" "&&(d=u)}if(u>=f)if(d)c.push(d),f=d+l,d=void 0;else if(t===Ke){for(;h===" "||h===" ";)h=k,k=s[u+=1],y=!0;const S=u>g+1?u-2:m-1;if(p[S])return s;c.push(S),p[S]=!0,f=S+l,d=void 0}else y=!0}h=k}if(y&&a&&a(),c.length===0)return s;o&&o();let b=s.slice(0,c[0]);for(let k=0;k<c.length;++k){const S=c[k],N=c[k+1]||s.length;S===0?b=`
9
+ ${e}${s.slice(0,N)}`:(t===Ke&&p[S]&&(b+=`${s[S]}\\`),b+=`
10
+ ${e}${s.slice(S+1,N)}`)}return b}function Kt(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
11
+ `);n=e,i=e+1,r=s[i]}return n}const Ge=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),Qe=s=>/^(%|---|\.\.\.)/m.test(s);function Zs(s,e,t){if(!e||e<0)return!1;const n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
12
+ `){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Ne(s,e){const t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Qe(s)?" ":"");let o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);const p=t.substr(l+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
13
+
14
+ `;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
15
+ `,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:He(o,r,Ke,Ge(e,!1))}function yt(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test(s))return Ne(s,e);const t=e.indent||(Qe(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${t}`)+"'";return e.implicitKey?n:He(n,t,os,Ge(e,!1))}function ce(s,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=Ne;else{const i=s.includes('"'),r=s.includes("'");i&&!r?n=yt:r&&!i?n=Ne:n=t?yt:Ne}return n(s,e)}let gt;try{gt=new RegExp(`(^|(?<!
18
+ ))
19
+ +(?!
20
+ |$)`,"g")}catch{gt=/\n+(?!\n|$)/g}function Pe({comment:s,type:e,value:t},n,i,r){const{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(t))return ce(t,n);const c=n.indent||(n.forceBlockIndent||Qe(t)?" ":""),p=o==="literal"?!0:o==="folded"||e===O.BLOCK_FOLDED?!1:e===O.BLOCK_LITERAL?!0:!Zs(t,l,c.length);if(!t)return p?`|
21
+ `:`>
22
+ `;let f,d;for(d=t.length;d>0;--d){const N=t[d-1];if(N!==`
23
+ `&&N!==" "&&N!==" ")break}let h=t.substring(d);const y=h.indexOf(`
24
+ `);y===-1?f="-":t===h||y!==h.length-1?(f="+",r&&r()):f="",h&&(t=t.slice(0,-h.length),h[h.length-1]===`
25
+ `&&(h=h.slice(0,-1)),h=h.replace(gt,`$&${c}`));let u=!1,m,g=-1;for(m=0;m<t.length;++m){const N=t[m];if(N===" ")u=!0;else if(N===`
26
+ `)g=m;else break}let b=t.substring(0,g<m?g+1:m);b&&(t=t.substring(b.length),b=b.replace(/\n+/g,`$&${c}`));let S=(u?c?"2":"1":"")+f;if(s&&(S+=" "+a(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const N=t.replace(/\n+/g,`
27
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let A=!1;const E=Ge(n,!0);o!=="folded"&&e!==O.BLOCK_FOLDED&&(E.onOverflow=()=>{A=!0});const w=He(`${b}${N}${h}`,c,mt,E);if(!A)return`>${S}
28
+ ${c}${w}`}return t=t.replace(/\n+/g,`$&${c}`),`|${S}
29
+ ${c}${b}${t}${h}`}function xs(s,e,t,n){const{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:p}=e;if(a&&r.includes(`
30
+ `)||p&&/[[\]{},]/.test(r))return ce(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||p||!r.includes(`
31
+ `)?ce(r,e):Pe(s,e,t,n);if(!a&&!p&&i!==O.PLAIN&&r.includes(`
32
+ `))return Pe(s,e,t,n);if(Qe(r)){if(l==="")return e.forceBlockIndent=!0,Pe(s,e,t,n);if(a&&l===c)return ce(r,e)}const f=r.replace(/\n+/g,`$&
33
+ ${l}`);if(o){const d=u=>{var m;return u.default&&u.tag!=="tag:yaml.org,2002:str"&&((m=u.test)==null?void 0:m.test(f))},{compat:h,tags:y}=e.doc.schema;if(y.some(d)||h!=null&&h.some(d))return ce(r,e)}return a?f:He(f,l,os,Ge(e,!1))}function Ie(s,e,t,n){const{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)});let{type:a}=s;a!==O.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=O.QUOTE_DOUBLE);const l=p=>{switch(p){case O.BLOCK_FOLDED:case O.BLOCK_LITERAL:return i||r?ce(o.value,e):Pe(o,e,t,n);case O.QUOTE_DOUBLE:return Ne(o.value,e);case O.QUOTE_SINGLE:return yt(o.value,e);case O.PLAIN:return xs(o,e,t,n);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:p,defaultStringType:f}=e.options,d=i&&p||f;if(c=l(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}function as(s,e){const t=Object.assign({blockQuote:!0,commentString:zs,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e);let n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function en(s,e){var i;if(e.tag){const r=s.filter(o=>o.tag===e.tag);if(r.length>0)return r.find(o=>o.format===e.format)??r[0]}let t,n;if(I(e)){n=e.value;let r=s.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,n)});if(r.length>1){const o=r.filter(a=>a.test);o.length>0&&(r=o)}t=r.find(o=>o.format===e.format)??r.find(o=>!o.format)}else n=e,t=s.find(r=>r.nodeClass&&n instanceof r.nodeClass);if(!t){const r=((i=n==null?void 0:n.constructor)==null?void 0:i.name)??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${r} value`)}return t}function tn(s,e,{anchors:t,doc:n}){if(!n.directives)return"";const i=[],r=(I(s)||$(s))&&s.anchor;r&&ts(r)&&(t.add(r),i.push(`&${r}`));const o=s.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function he(s,e,t,n){var l;if(C(s))return s.toString(e,t,n);if(te(s)){if(e.doc.directives)return s.toString(e);if((l=e.resolvedAliases)!=null&&l.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i;const r=_(s)?s:e.doc.createNode(s,{onTagObj:c=>i=c});i??(i=en(e.doc.schema.tags,r));const o=tn(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,e,t,n):I(r)?Ie(r,e,t,n):r.toString(e,t,n);return o?I(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
34
+ ${e.indent}${a}`:a}function sn({key:s,value:e},t,n,i){const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:p,simpleKeys:f}}=t;let d=_(s)&&s.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if($(s)||!_(s)&&typeof s=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let h=!f&&(!s||d&&e==null&&!t.inFlow||$(s)||(I(s)?s.type===O.BLOCK_FOLDED||s.type===O.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!h&&(f||!r),indent:a+l});let y=!1,u=!1,m=he(s,t,()=>y=!0,()=>u=!0);if(!h&&!t.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(t.inFlow){if(r||e==null)return y&&n&&n(),m===""?"?":h?`? ${m}`:m}else if(r&&!f||e==null&&h)return m=`? ${m}`,d&&!y?m+=z(m,t.indent,c(d)):u&&i&&i(),m;y&&(d=null),h?(d&&(m+=z(m,t.indent,c(d))),m=`? ${m}
35
+ ${a}:`):(m=`${m}:`,d&&(m+=z(m,t.indent,c(d))));let g,b,k;_(e)?(g=!!e.spaceBefore,b=e.commentBefore,k=e.comment):(g=!1,b=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!h&&!d&&I(e)&&(t.indentAtStart=m.length+1),u=!1,!p&&l.length>=2&&!t.inFlow&&!h&&ye(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let S=!1;const N=he(e,t,()=>S=!0,()=>u=!0);let A=" ";if(d||g||b){if(A=g?`
36
+ `:"",b){const E=c(b);A+=`
37
+ ${H(E,t.indent)}`}N===""&&!t.inFlow?A===`
38
+ `&&k&&(A=`
39
+
40
+ `):A+=`
41
+ ${t.indent}`}else if(!h&&$(e)){const E=N[0],w=N.indexOf(`
42
+ `),T=w!==-1,j=t.inFlow??e.flow??e.items.length===0;if(T||!j){let Y=!1;if(T&&(E==="&"||E==="!")){let q=N.indexOf(" ");E==="&"&&q!==-1&&q<w&&N[q+1]==="!"&&(q=N.indexOf(" ",q+1)),(q===-1||w<q)&&(Y=!0)}Y||(A=`
43
+ ${t.indent}`)}}else(N===""||N[0]===`
44
+ `)&&(A="");return m+=A+N,t.inFlow?S&&n&&n():k&&!S?m+=z(m,t.indent,c(k)):u&&i&&i(),m}function ls(s,e){(s==="debug"||s==="warn")&&console.warn(e)}const Ce="<<",G={identify:s=>s===Ce||typeof s=="symbol"&&s.description===Ce,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new O(Symbol(Ce)),{addToJSMap:cs}),stringify:()=>Ce},nn=(s,e)=>(G.identify(e)||I(e)&&(!e.type||e.type===O.PLAIN)&&G.identify(e.value))&&(s==null?void 0:s.doc.schema.tags.some(t=>t.tag===G.tag&&t.default));function cs(s,e,t){const n=fs(s,t);if(ye(n))for(const i of n.items)ot(s,e,i);else if(Array.isArray(n))for(const i of n)ot(s,e,i);else ot(s,e,n)}function ot(s,e,t){const n=fs(s,t);if(!me(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,s,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function fs(s,e){return s&&te(e)?e.resolve(s.doc,s):e}function us(s,e,{key:t,value:n}){if(_(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(nn(s,t))cs(s,e,n);else{const i=P(t,"",s);if(e instanceof Map)e.set(i,P(n,i,s));else if(e instanceof Set)e.add(i);else{const r=rn(t,i,s),o=P(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function rn(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(_(s)&&(t!=null&&t.doc)){const n=as(t.doc,{});n.anchors=new Set;for(const r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),ls(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function Nt(s,e,t){const n=Oe(s,void 0,t),i=Oe(e,void 0,t);return new v(n,i)}class v{constructor(e,t=null){Object.defineProperty(this,D,{value:Wt}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return _(t)&&(t=t.clone(e)),_(n)&&(n=n.clone(e)),new v(t,n)}toJSON(e,t){const n=t!=null&&t.mapAsMap?new Map:{};return us(t,n,this)}toString(e,t,n){return e!=null&&e.doc?sn(this,e,t,n):JSON.stringify(this)}}function hs(s,e,t){return(e.inFlow??s.flow?an:on)(s,e,t)}function on({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=t,p=Object.assign({},t,{indent:r,type:null});let f=!1;const d=[];for(let y=0;y<e.length;++y){const u=e[y];let m=null;if(_(u))!f&&u.spaceBefore&&d.push(""),Re(t,d,u.commentBefore,f),u.comment&&(m=u.comment);else if(C(u)){const b=_(u.key)?u.key:null;b&&(!f&&b.spaceBefore&&d.push(""),Re(t,d,b.commentBefore,f))}f=!1;let g=he(u,p,()=>m=null,()=>f=!0);m&&(g+=z(g,r,c(m))),f&&m&&(f=!1),d.push(n+g)}let h;if(d.length===0)h=i.start+i.end;else{h=d[0];for(let y=1;y<d.length;++y){const u=d[y];h+=u?`
45
+ ${l}${u}`:`
46
+ `}}return s?(h+=`
47
+ `+H(c(s),l),a&&a()):f&&o&&o(),h}function an({items:s},e,{flowChars:t,itemIndent:n}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;n+=r;const l=Object.assign({},e,{indent:n,inFlow:!0,type:null});let c=!1,p=0;const f=[];for(let y=0;y<s.length;++y){const u=s[y];let m=null;if(_(u))u.spaceBefore&&f.push(""),Re(e,f,u.commentBefore,!1),u.comment&&(m=u.comment);else if(C(u)){const b=_(u.key)?u.key:null;b&&(b.spaceBefore&&f.push(""),Re(e,f,b.commentBefore,!1),b.comment&&(c=!0));const k=_(u.value)?u.value:null;k?(k.comment&&(m=k.comment),k.commentBefore&&(c=!0)):u.value==null&&(b!=null&&b.comment)&&(m=b.comment)}m&&(c=!0);let g=he(u,l,()=>m=null);c||(c=f.length>p||g.includes(`
48
+ `)),y<s.length-1?g+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((b,k)=>b+k.length+2,2)+(g.length+2)>e.options.lineWidth)),c&&(g+=",")),m&&(g+=z(g,n,a(m))),f.push(g),p=f.length}const{start:d,end:h}=t;if(f.length===0)return d+h;if(!c){const y=f.reduce((u,m)=>u+m.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=d;for(const u of f)y+=u?`
49
+ ${r}${i}${u}`:`
50
+ `;return`${y}
51
+ ${i}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function Re({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const r=H(e(n),s);t.push(r.trimStart())}}function Z(s,e){const t=I(e)?e.value:e;for(const n of s)if(C(n)&&(n.key===e||n.key===t||I(n.key)&&n.key.value===t))return n}class K extends rs{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(W,e),this.items=[]}static from(e,t,n){const{keepUndefined:i,replacer:r}=n,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(Nt(l,c,n))};if(t instanceof Map)for(const[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(const l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){var o;let n;C(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new v(e,e==null?void 0:e.value):n=new v(e.key,e.value);const i=Z(this.items,n.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);I(i.value)&&is(n.value)?i.value.value=n.value:i.value=n.value}else if(r){const a=this.items.findIndex(l=>r(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){const t=Z(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const n=Z(this.items,e),i=n==null?void 0:n.value;return(!t&&I(i)?i.value:i)??void 0}has(e){return!!Z(this.items,e)}set(e,t){this.add(new v(e,t),!0)}toJSON(e,t,n){const i=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(i);for(const r of this.items)us(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!C(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),hs(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const ge={collection:"map",default:!0,nodeClass:K,tag:"tag:yaml.org,2002:map",resolve(s,e){return me(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>K.from(s,e,t)};class X extends rs{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(pe,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=$e(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=$e(e);if(typeof n!="number")return;const i=this.items[n];return!t&&I(i)?i.value:i}has(e){const t=$e(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=$e(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];I(i)&&is(t)?i.value=t:this.items[n]=t}toJSON(e,t){const n=[];t!=null&&t.onCreate&&t.onCreate(n);let i=0;for(const r of this.items)n.push(P(r,String(i++),t));return n}toString(e,t,n){return e?hs(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){const l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(Oe(a,void 0,n))}}return r}}function $e(s){let e=I(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const be={collection:"seq",default:!0,nodeClass:X,tag:"tag:yaml.org,2002:seq",resolve(s,e){return ye(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>X.from(s,e,t)},We={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),Ie(s,e,t,n)}},Xe={identify:s=>s==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new O(null),stringify:({source:s},e)=>typeof s=="string"&&Xe.test.test(s)?s:e.options.nullStr},Ot={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new O(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&Ot.test.test(s)){const n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};function U({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);const i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const ds={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:U},ps={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():U(s)}},ms={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){const e=new O(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:U},ze=s=>typeof s=="bigint"||Number.isInteger(s),Et=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function ys(s,e,t){const{value:n}=s;return ze(n)&&n>=0?t+n.toString(e):U(s)}const gs={identify:s=>ze(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Et(s,2,8,t),stringify:s=>ys(s,8,"0o")},bs={identify:ze,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Et(s,0,10,t),stringify:U},ws={identify:s=>ze(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Et(s,2,16,t),stringify:s=>ys(s,16,"0x")},ln=[ge,be,We,Xe,Ot,gs,bs,ws,ds,ps,ms];function Pt(s){return typeof s=="bigint"||Number.isInteger(s)}const _e=({value:s})=>JSON.stringify(s),cn=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:_e},{identify:s=>s==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:_e},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:_e},{identify:Pt,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>Pt(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:_e}],fn={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},un=[ge,be].concat(cn,fn),At={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof atob=="function"){const t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){if(!t)return"";const o=t;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=O.BLOCK_LITERAL),e!==O.QUOTE_DOUBLE){const l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),p=new Array(c);for(let f=0,d=0;f<c;++f,d+=l)p[f]=a.substr(d,l);a=p.join(e===O.BLOCK_LITERAL?`
52
+ `:" ")}return Ie({comment:s,type:e,value:a},n,i,r)}};function Ss(s,e){if(ye(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!C(n)){if(me(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");const i=n.items[0]||new v(new O(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
53
+ ${i.key.commentBefore}`:n.commentBefore),n.comment){const r=i.value??i.key;r.comment=r.comment?`${n.comment}
54
+ ${r.comment}`:n.comment}n=i}s.items[t]=C(n)?n:new v(n)}}else e("Expected a sequence for this tag");return s}function ks(s,e,t){const{replacer:n}=t,i=new X(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Nt(a,l,t))}return i}const It={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ss,createNode:ks};class fe extends X{constructor(){super(),this.add=K.prototype.add.bind(this),this.delete=K.prototype.delete.bind(this),this.get=K.prototype.get.bind(this),this.has=K.prototype.has.bind(this),this.set=K.prototype.set.bind(this),this.tag=fe.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(const i of this.items){let r,o;if(C(i)?(r=P(i.key,"",t),o=P(i.value,r,t)):r=P(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){const i=ks(e,t,n),r=new this;return r.items=i.items,r}}fe.tag="tag:yaml.org,2002:omap";const Tt={collection:"seq",identify:s=>s instanceof Map,nodeClass:fe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){const t=Ss(s,e),n=[];for(const{key:i}of t.items)I(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new fe,t)},createNode:(s,e,t)=>fe.from(s,e,t)};function Ns({value:s,source:e},t){return e&&(s?Os:Es).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}const Os={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new O(!0),stringify:Ns},Es={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new O(!1),stringify:Ns},hn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:U},dn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():U(s)}},pn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){const e=new O(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){const n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:U},Te=s=>typeof s=="bigint"||Number.isInteger(s);function Ze(s,e,t,{intAsBigInt:n}){const i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}const o=BigInt(s);return i==="-"?BigInt(-1)*o:o}const r=parseInt(s,t);return i==="-"?-1*r:r}function Lt(s,e,t){const{value:n}=s;if(Te(n)){const i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return U(s)}const mn={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Ze(s,2,2,t),stringify:s=>Lt(s,2,"0b")},yn={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Ze(s,1,8,t),stringify:s=>Lt(s,8,"0")},gn={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Ze(s,0,10,t),stringify:U},bn={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Ze(s,2,16,t),stringify:s=>Lt(s,16,"0x")};class ue extends K{constructor(e){super(e),this.tag=ue.tag}add(e){let t;C(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new v(e.key,null):t=new v(e,null),Z(this.items,t.key)||this.items.push(t)}get(e,t){const n=Z(this.items,e);return!t&&C(n)?I(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const n=Z(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new v(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Nt(o,null,n));return r}}ue.tag="tag:yaml.org,2002:set";const Ct={collection:"map",identify:s=>s instanceof Set,nodeClass:ue,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>ue.from(s,e,t),resolve(s,e){if(me(s)){if(s.hasAllNullValues(!0))return Object.assign(new ue,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function $t(s,e){const t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function As(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return U(s);let n="";e<0&&(n="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Is={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>$t(s,t),stringify:As},Ts={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>$t(s,!1),stringify:As},xe={identify:s=>s instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(s){const e=s.match(xe.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l);const p=e[8];if(p&&p!=="Z"){let f=$t(p,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>(s==null?void 0:s.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Dt=[ge,be,We,Xe,Os,Es,mn,yn,gn,bn,hn,dn,pn,At,G,Tt,It,Ct,Is,Ts,xe],qt=new Map([["core",ln],["failsafe",[ge,be,We]],["json",un],["yaml11",Dt],["yaml-1.1",Dt]]),Rt={binary:At,bool:Ot,float:ms,floatExp:ps,floatNaN:ds,floatTime:Ts,int:bs,intHex:ws,intOct:gs,intTime:Is,map:ge,merge:G,null:Xe,omap:Tt,pairs:It,seq:be,set:Ct,timestamp:xe},wn={"tag:yaml.org,2002:binary":At,"tag:yaml.org,2002:merge":G,"tag:yaml.org,2002:omap":Tt,"tag:yaml.org,2002:pairs":It,"tag:yaml.org,2002:set":Ct,"tag:yaml.org,2002:timestamp":xe};function at(s,e,t){const n=qt.get(e);if(n&&!s)return t&&!n.includes(G)?n.concat(G):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{const r=Array.from(qt.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(const r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(G)),i.reduce((r,o)=>{const a=typeof o=="string"?Rt[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(Rt).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}const Sn=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0;class et{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?at(e,"compat"):e?at(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?wn:{},this.tags=at(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,W,{value:ge}),Object.defineProperty(this,J,{value:We}),Object.defineProperty(this,pe,{value:be}),this.sortMapEntries=typeof o=="function"?o:o===!0?Sn:null}clone(){const e=Object.create(et.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function kn(s,e){var l;const t=[];let n=e.directives===!0;if(e.directives!==!1&&s.directives){const c=s.directives.toString(s);c?(t.push(c),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");const i=as(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");const c=r(s.commentBefore);t.unshift(H(c,""))}let o=!1,a=null;if(s.contents){if(_(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){const f=r(s.contents.commentBefore);t.push(H(f,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}const c=a?void 0:()=>o=!0;let p=he(s.contents,i,()=>a=null,c);a&&(p+=z(p,"",r(a))),(p[0]==="|"||p[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${p}`:t.push(p)}else t.push(he(s.contents,i));if((l=s.directives)!=null&&l.docEnd)if(s.comment){const c=r(s.comment);c.includes(`
55
+ `)?(t.push("..."),t.push(H(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=s.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(H(r(c),"")))}return t.join(`
56
+ `)+`
57
+ `}class we{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,D,{value:pt});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new B({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){const e=Object.create(we.prototype,{[D]:{value:pt}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=_(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ie(this.contents)&&this.contents.add(e)}addIn(e,t){ie(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=ss(this);e.anchor=!t||n.has(t)?ns(t||"a",n):t}return new Ye(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const m=b=>typeof b=="number"||b instanceof String||b instanceof Number,g=t.filter(m).map(String);g.length>0&&(t=t.concat(g)),i=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:p}=n??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=Qs(this,o||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:h},u=Oe(e,p,y);return a&&$(u)&&(u.flow=!0),d(),u}createPair(e,t,n={}){const i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new v(i,r)}delete(e){return ie(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ke(e)?this.contents==null?!1:(this.contents=null,!0):ie(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return $(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ke(e)?!t&&I(this.contents)?this.contents.value:this.contents:$(this.contents)?this.contents.getIn(e,t):void 0}has(e){return $(this.contents)?this.contents.has(e):!1}hasIn(e){return ke(e)?this.contents!==void 0:$(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=qe(this.schema,[e],t):ie(this.contents)&&this.contents.set(e,t)}setIn(e,t){ke(e)?this.contents=t:this.contents==null?this.contents=qe(this.schema,Array.from(e),t):ie(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new B({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new B({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new et(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=P(this.contents,t??"",a);if(typeof r=="function")for(const{count:c,res:p}of a.anchors.values())r(p,c);return typeof o=="function"?le(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return kn(this,e)}}function ie(s){if($(s))return!0;throw new Error("Expected a YAML collection as document contents")}class _t extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}}class x extends _t{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Ls extends _t{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const Fe=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));const{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
58
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=t.linePos[1];(l==null?void 0:l.line)===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(a);t.message+=`:
59
+
60
+ ${o}
61
+ ${c}
62
+ `}};function de(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,p=a,f="",d="",h=!1,y=!1,u=null,m=null,g=null,b=null,k=null,S=null,N=null;for(const w of s)switch(y&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&r(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),u&&(c&&w.type!=="comment"&&w.type!=="newline"&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),u=null),w.type){case"space":!e&&(t!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&w.source.includes(" ")&&(u=w),p=!0;break;case"comment":{p||r(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=w.source.substring(1)||" ";f?f+=d+T:f=T,d="",c=!1;break}case"newline":c?f?f+=w.source:(!S||t!=="seq-item-ind")&&(l=!0):d+=w.source,c=!0,h=!0,(m||g)&&(b=w),p=!0;break;case"anchor":m&&r(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&r(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=w,N??(N=w.offset),c=!1,p=!1,y=!0;break;case"tag":{g&&r(w,"MULTIPLE_TAGS","A node can have at most one tag"),g=w,N??(N=w.offset),c=!1,p=!1,y=!0;break}case t:(m||g)&&r(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),S&&r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e??"collection"}`),S=w,c=t==="seq-item-ind"||t==="explicit-key-ind",p=!1;break;case"comma":if(e){k&&r(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=w,c=!1,p=!1;break}default:r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),c=!1,p=!1}const A=s[s.length-1],E=A?A.offset+A.source.length:i;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),u&&(c&&u.indent<=o||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:l,comment:f,hasNewline:h,anchor:m,tag:g,newlineAfterProp:b,end:E,start:N??E}}function Ee(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
63
+ `))return!0;if(s.end){for(const e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of s.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(Ee(e.key)||Ee(e.value))return!0}return!1;default:return!0}}function bt(s,e,t){if((e==null?void 0:e.type)==="flow-collection"){const n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Ee(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Cs(s,e,t){const{uniqueKeys:n}=s.options;if(n===!1)return!1;const i=typeof n=="function"?n:(r,o)=>r===o||I(r)&&I(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}const Ft="All mapping items must start at the same column";function Nn({composeNode:s,composeEmptyNode:e},t,n,i,r){var p;const o=(r==null?void 0:r.nodeClass)??K,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(const f of n.items){const{start:d,key:h,sep:y,value:u}=f,m=de(d,{indicator:"explicit-key-ind",next:h??(y==null?void 0:y[0]),offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!m.found;if(g){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==n.indent&&i(l,"BAD_INDENT",Ft)),!m.anchor&&!m.tag&&!y){c=m.end,m.comment&&(a.comment?a.comment+=`
64
+ `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||Ee(h))&&i(h??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((p=m.found)==null?void 0:p.indent)!==n.indent&&i(l,"BAD_INDENT",Ft);t.atKey=!0;const b=m.end,k=h?s(t,h,m,i):e(t,b,d,null,m,i);t.schema.compat&&bt(n.indent,h,i),t.atKey=!1,Cs(t,a.items,k)&&i(b,"DUPLICATE_KEY","Map keys must be unique");const S=de(y??[],{indicator:"map-value-ind",next:u,offset:k.range[2],onError:i,parentIndent:n.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=S.end,S.found){g&&((u==null?void 0:u.type)==="block-map"&&!S.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&m.start<S.found.offset-1024&&i(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=u?s(t,u,S,i):e(t,l,y,null,S,i);t.schema.compat&&bt(n.indent,u,i),l=N.range[2];const A=new v(k,N);t.options.keepSourceTokens&&(A.srcToken=f),a.items.push(A)}else{g&&i(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(k.comment?k.comment+=`
65
+ `+S.comment:k.comment=S.comment);const N=new v(k);t.options.keepSourceTokens&&(N.srcToken=f),a.items.push(N)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}function On({composeNode:s,composeEmptyNode:e},t,n,i,r){const o=(r==null?void 0:r.nodeClass)??X,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(const{start:p,value:f}of n.items){const d=de(p,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)(f==null?void 0:f.type)==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=d.end,d.comment&&(a.comment=d.comment);continue}const h=f?s(t,f,d,i):e(t,d.end,p,null,d,i);t.schema.compat&&bt(n.indent,f,i),l=h.range[2],a.items.push(h)}return a.range=[n.offset,l,c??l],a}function Le(s,e,t,n){let i="";if(s){let r=!1,o="";for(const a of s){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=l.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}const lt="Block collections are not allowed within flow collections",ct=s=>s&&(s.type==="block-map"||s.type==="block-seq");function En({composeNode:s,composeEmptyNode:e},t,n,i,r){var m;const o=n.start.source==="{",a=o?"flow map":"flow sequence",l=(r==null?void 0:r.nodeClass)??(o?K:X),c=new l(t.schema);c.flow=!0;const p=t.atRoot;p&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset+n.start.source.length;for(let g=0;g<n.items.length;++g){const b=n.items[g],{start:k,key:S,sep:N,value:A}=b,E=de(k,{flow:a,indicator:"explicit-key-ind",next:S??(N==null?void 0:N[0]),offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!N&&!A){g===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<n.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(c.comment?c.comment+=`
66
+ `+E.comment:c.comment=E.comment),f=E.end;continue}!o&&t.options.strict&&Ee(S)&&i(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let w="";e:for(const T of k)switch(T.type){case"comma":case"space":break;case"comment":w=T.source.substring(1);break e;default:break e}if(w){let T=c.items[c.items.length-1];C(T)&&(T=T.value??T.key),T.comment?T.comment+=`
67
+ `+w:T.comment=w,E.comment=E.comment.substring(w.length+1)}}if(!o&&!N&&!E.found){const w=A?s(t,A,E,i):e(t,E.end,N,null,E,i);c.items.push(w),f=w.range[2],ct(A)&&i(w.range,"BLOCK_IN_FLOW",lt)}else{t.atKey=!0;const w=E.end,T=S?s(t,S,E,i):e(t,w,k,null,E,i);ct(S)&&i(T.range,"BLOCK_IN_FLOW",lt),t.atKey=!1;const j=de(N??[],{flow:a,indicator:"map-value-ind",next:A,offset:T.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(j.found){if(!o&&!E.found&&t.options.strict){if(N)for(const R of N){if(R===j.found)break;if(R.type==="newline"){i(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<j.found.offset-1024&&i(j.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&((m=A.source)==null?void 0:m[0])===":"?i(A,"MISSING_CHAR",`Missing space after : in ${a}`):i(j.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const Y=A?s(t,A,j,i):j.found?e(t,j.end,N,null,j,i):null;Y?ct(A)&&i(Y.range,"BLOCK_IN_FLOW",lt):j.comment&&(T.comment?T.comment+=`
68
+ `+j.comment:T.comment=j.comment);const q=new v(T,Y);if(t.options.keepSourceTokens&&(q.srcToken=b),o){const R=c;Cs(t,R.items,T)&&i(w,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(q)}else{const R=new K(t.schema);R.flow=!0,R.items.push(q);const Mt=(Y??T).range;R.range=[T.range[0],Mt[1],Mt[2]],c.items.push(R)}f=Y?Y.range[2]:j.end}}const d=o?"}":"]",[h,...y]=n.end;let u=f;if((h==null?void 0:h.source)===d)u=h.offset+h.source.length;else{const g=a[0].toUpperCase()+a.substring(1),b=p?`${g} must end with a ${d}`:`${g} in block collection must be sufficiently indented and end with a ${d}`;i(f,p?"MISSING_CHAR":"BAD_INDENT",b),h&&h.source.length!==1&&y.unshift(h)}if(y.length>0){const g=Le(y,u,t.options.strict,i);g.comment&&(c.comment?c.comment+=`
69
+ `+g.comment:c.comment=g.comment),c.range=[n.offset,u,g.offset]}else c.range=[n.offset,u,u];return c}function ft(s,e,t,n,i,r){const o=t.type==="block-map"?Nn(s,e,t,n,r):t.type==="block-seq"?On(s,e,t,n,r):En(s,e,t,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function An(s,e,t,n,i){var d;const r=n.tag,o=r?e.directives.tagName(r.source,h=>i(r,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){const{anchor:h,newlineAfterProp:y}=n,u=h&&r?h.offset>r.offset?h:r:h??r;u&&(!y||y.offset<u.offset)&&i(u,"MISSING_CHAR","Missing newline after block sequence props")}const a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===K.tagName&&a==="map"||o===X.tagName&&a==="seq")return ft(s,e,t,i,o);let l=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!l){const h=e.schema.knownTags[o];if((h==null?void 0:h.collection)===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?i(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ft(s,e,t,i,o)}const c=ft(s,e,t,i,o,l),p=((d=l.resolve)==null?void 0:d.call(l,c,h=>i(r,"TAG_RESOLVE_FAILED",h),e.options))??c,f=_(p)?p:new O(p);return f.range=c.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}function $s(s,e,t){const n=e.offset,i=In(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const r=i.mode===">"?O.BLOCK_FOLDED:O.BLOCK_LITERAL,o=e.source?Tn(e.source):[];let a=o.length;for(let u=o.length-1;u>=0;--u){const m=o[u][1];if(m===""||m==="\r")a=u;else break}if(a===0){const u=i.chomp==="+"&&o.length>0?`
70
+ `.repeat(Math.max(1,o.length-1)):"";let m=n+i.length;return e.source&&(m+=e.source.length),{value:u,type:r,comment:i.comment,range:[n,m,m]}}let l=e.indent+i.indent,c=e.offset+i.length,p=0;for(let u=0;u<a;++u){const[m,g]=o[u];if(g===""||g==="\r")i.indent===0&&m.length>l&&(l=m.length);else{m.length<l&&t(c+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=m.length),p=u,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=m.length+g.length+1}for(let u=o.length-1;u>=a;--u)o[u][0].length>l&&(a=u+1);let f="",d="",h=!1;for(let u=0;u<p;++u)f+=o[u][0].slice(l)+`
71
+ `;for(let u=p;u<a;++u){let[m,g]=o[u];c+=m.length+g.length+1;const b=g[g.length-1]==="\r";if(b&&(g=g.slice(0,-1)),g&&m.length<l){const S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-g.length-(b?2:1),"BAD_INDENT",S),m=""}r===O.BLOCK_LITERAL?(f+=d+m.slice(l)+g,d=`
72
+ `):m.length>l||g[0]===" "?(d===" "?d=`
73
+ `:!h&&d===`
74
+ `&&(d=`
75
+
76
+ `),f+=d+m.slice(l)+g,d=`
77
+ `,h=!0):g===""?d===`
78
+ `?f+=`
79
+ `:d=`
80
+ `:(f+=d+g,d=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let u=a;u<o.length;++u)f+=`
81
+ `+o[u][0].slice(l);f[f.length-1]!==`
82
+ `&&(f+=`
83
+ `);break;default:f+=`
84
+ `}const y=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,y,y]}}function In({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let o=0,a="",l=-1;for(let d=1;d<i.length;++d){const h=i[d];if(!a&&(h==="-"||h==="+"))a=h;else{const y=Number(h);!o&&y?o=y:l===-1&&(l=s+d)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,p="",f=i.length;for(let d=1;d<e.length;++d){const h=e[d];switch(h.type){case"space":c=!0;case"newline":f+=h.source.length;break;case"comment":t&&!c&&n(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,p=h.source.substring(1);break;case"error":n(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{const y=`Unexpected token in block scalar header: ${h.type}`;n(h,"UNEXPECTED_TOKEN",y);const u=h.source;u&&typeof u=="string"&&(f+=u.length)}}}return{mode:r,indent:o,chomp:a,comment:p,length:f}}function Tn(s){const e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n!=null&&n[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function _s(s,e,t){const{offset:n,type:i,source:r,end:o}=s;let a,l;const c=(d,h,y)=>t(n+d,h,y);switch(i){case"scalar":a=O.PLAIN,l=Ln(r,c);break;case"single-quoted-scalar":a=O.QUOTE_SINGLE,l=Cn(r,c);break;case"double-quoted-scalar":a=O.QUOTE_DOUBLE,l=$n(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}const p=n+r.length,f=Le(o,p,e,t);return{value:l,type:a,comment:f.comment,range:[n,p,f.offset]}}function Ln(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),vs(s)}function Cn(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),vs(s.slice(1,-1)).replace(/''/g,"'")}function vs(s){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
+ `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
86
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(s);)n[1]===""?r===`
87
+ `?i+=r:r=`
88
+ `:(i+=r+n[1],r=" "),o=t.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(s),i+r+((n==null?void 0:n[1])??"")}function $n(s,e){let t="";for(let n=1;n<s.length-1;++n){const i=s[n];if(!(i==="\r"&&s[n+1]===`
89
+ `))if(i===`
90
+ `){const{fold:r,offset:o}=_n(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n];const o=vn[r];if(o)t+=o;else if(r===`
91
+ `)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
92
+ `)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){const a=r==="x"?2:r==="u"?4:8;t+=jn(s,n+1,a,e),n+=a}else{const a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){const r=n;let o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
93
+ `&&!(o==="\r"&&s[n+2]===`
94
+ `)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function _n(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
95
+ `||n==="\r")&&!(n==="\r"&&s[e+2]!==`
96
+ `);)n===`
97
+ `&&(t+=`
98
+ `),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}const vn={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function jn(s,e,t,n){const i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{const a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function js(s,e,t,n){const{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?$s(s,e,n):_s(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null;let c;s.options.stringKeys&&s.atKey?c=s.schema[J]:l?c=Bn(s.schema,i,l,t,n):e.type==="scalar"?c=Mn(s,i,e,n):c=s.schema[J];let p;try{const f=c.resolve(i,d=>n(t??e,"TAG_RESOLVE_FAILED",d),s.options);p=I(f)?f:new O(f)}catch(f){const d=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",d),p=new O(i)}return p.range=a,p.source=i,r&&(p.type=r),l&&(p.tag=l),c.format&&(p.format=c.format),o&&(p.comment=o),p}function Bn(s,e,t,n,i){var a;if(t==="!")return s[J];const r=[];for(const l of s.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if((a=l.test)!=null&&a.test(e))return l;const o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[J])}function Mn({atKey:s,directives:e,schema:t},n,i,r){const o=t.tags.find(a=>{var l;return(a.default===!0||s&&a.default==="key")&&((l=a.test)==null?void 0:l.test(n))})||t[J];if(t.compat){const a=t.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(n))})??t[J];if(o.tag!==a.tag){const l=e.tagString(o.tag),c=e.tagString(a.tag),p=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function Kn(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];(i==null?void 0:i.type)==="space";)s+=i.source.length,i=e[++n];break}}return s}const Pn={composeNode:Bs,composeEmptyNode:vt};function Bs(s,e,t,n){const i=s.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t;let c,p=!0;switch(e.type){case"alias":c=Dn(s,e,n),(a||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=js(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=An(Pn,s,e,t,n),a&&(c.anchor=a.source.substring(1))}catch(f){const d=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",d)}break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),p=!1}}return c??(c=vt(s,e.offset,void 0,null,t,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!I(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&p&&(c.srcToken=e),c}function vt(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){const p={type:"scalar",offset:Kn(e,t,n),indent:-1,source:""},f=js(s,p,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function Dn({options:s},{offset:e,source:t,end:n},i){const r=new Ye(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+t.length,a=Le(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function qn(s,e,{offset:t,start:n,value:i,end:r},o){const a=Object.assign({_directives:e},s),l=new we(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=de(n,{indicator:"doc-start",next:i??(r==null?void 0:r[0]),offset:t,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Bs(c,i,p,o):vt(c,p.end,n,null,p,o);const f=l.contents.range[2],d=Le(r,f,!1,o);return d.comment&&(l.comment=d.comment),l.range=[t,f,d.offset],l}function Se(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];const{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Ut(s){var i;let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){const o=s[r];switch(o[0]){case"#":e+=(e===""?"":n?`
100
+
101
+ `:`
102
+ `)+(o.substring(1)||" "),t=!0,n=!1;break;case"%":((i=s[r+1])==null?void 0:i[0])!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}class jt{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{const o=Se(t);r?this.warnings.push(new Ls(o,n,i)):this.errors.push(new x(o,n,i))},this.directives=new B({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:i}=Ut(this.prelude);if(n){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
103
+ ${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if($(r)&&!r.flow&&r.items.length>0){let o=r.items[0];C(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${n}
104
+ ${a}`:n}else{const o=r.commentBefore;r.commentBefore=o?`${n}
105
+ ${o}`:n}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ut(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{const r=Se(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=qn(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new x(Se(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new x(Se(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const t=Le(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
106
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new x(Se(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const n=Object.assign({_directives:this.directives},this.options),i=new we(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}function Rn(s,e=!0,t){if(s){const n=(i,r,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new x([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return _s(s,e,n);case"block-scalar":return $s({options:{strict:e}},s,n)}}return null}function Fn(s,e){const{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Ie({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
107
+ `}];switch(a[0]){case"|":case">":{const c=a.indexOf(`
108
+ `),p=a.substring(0,c),f=a.substring(c+1)+`
109
+ `,d=[{type:"block-scalar-header",offset:r,indent:n,source:p}];return Ms(d,l)||d.push({type:"newline",offset:-1,indent:n,source:`
110
+ `}),{type:"block-scalar",offset:r,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function Un(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in s?s.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Ie({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Vn(s,l);break;case'"':ut(s,l,"double-quoted-scalar");break;case"'":ut(s,l,"single-quoted-scalar");break;default:ut(s,l,"scalar")}}function Vn(s,e){const t=e.indexOf(`
111
+ `),n=e.substring(0,t),i=e.substring(t+1)+`
112
+ `;if(s.type==="block-scalar"){const r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{const{offset:r}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];Ms(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
113
+ `});for(const l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:i})}}function Ms(s,e){if(e)for(const t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function ut(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{const n=s.props.slice(1);let i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(const r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{const i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
114
+ `};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{const n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(const r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}const Jn=s=>"type"in s?Ue(s):De(s);function Ue(s){switch(s.type){case"block-scalar":{let e="";for(const t of s.props)e+=Ue(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(const t of s.items)e+=De(t);return e}case"flow-collection":{let e=s.start.source;for(const t of s.items)e+=De(t);for(const t of s.end)e+=t.source;return e}case"document":{let e=De(s);if(s.end)for(const t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(const t of s.end)e+=t.source;return e}}}function De({start:s,key:e,sep:t,value:n}){let i="";for(const r of s)i+=r.source;if(e&&(i+=Ue(e)),t)for(const r of t)i+=r.source;return n&&(i+=Ue(n)),i}const wt=Symbol("break visit"),Yn=Symbol("skip children"),Ks=Symbol("remove item");function ee(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Ps(Object.freeze([]),s,e)}ee.BREAK=wt;ee.SKIP=Yn;ee.REMOVE=Ks;ee.itemAtPath=(s,e)=>{let t=s;for(const[n,i]of e){const r=t==null?void 0:t[n];if(r&&"items"in r)t=r.items[i];else return}return t};ee.parentCollection=(s,e)=>{const t=ee.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t==null?void 0:t[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Ps(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(const i of["key","value"]){const r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){const a=Ps(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===wt)return wt;a===Ks&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}const tt="\uFEFF",st="",nt="",Ae="",Hn=s=>!!s&&"items"in s,Gn=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function Qn(s){switch(s){case tt:return"<BOM>";case st:return"<DOC>";case nt:return"<FLOW_END>";case Ae:return"<SCALAR>";default:return JSON.stringify(s)}}function Ds(s){switch(s){case tt:return"byte-order-mark";case st:return"doc-mode";case nt:return"flow-error-end";case Ae:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
115
+ `:case`\r
116
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const Wn=Object.freeze(Object.defineProperty({__proto__:null,BOM:tt,DOCUMENT:st,FLOW_END:nt,SCALAR:Ae,createScalarToken:Fn,isCollection:Hn,isScalar:Gn,prettyToken:Qn,resolveAsScalar:Rn,setScalarValue:Un,stringify:Jn,tokenType:Ds,visit:ee},Symbol.toStringTag,{value:"Module"}));function F(s){switch(s){case void 0:case" ":case`
117
+ `:case"\r":case" ":return!0;default:return!1}}const Vt=new Set("0123456789ABCDEFabcdef"),Xn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ve=new Set(",[]{}"),zn=new Set(` ,[]{}
118
+ \r `),ht=s=>!s||zn.has(s);class qs{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
119
+ `?!0:t==="\r"?this.buffer[e+1]===`
120
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){const i=this.buffer[n+e+1];if(i===`
121
+ `||!i&&!this.atEnd)return e+n+1}return t===`
122
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){const n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&F(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
123
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===tt&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){const r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield st,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&F(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!F(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&F(t)){const n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ht),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&F(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield nt,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ht),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||F(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let i=n.indexOf(`
124
+ `,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
125
+ `,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>F(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
126
+ `:e=r,t=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
127
+ `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
128
+ `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
129
+ `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
130
+ `&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield Ae,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){const r=this.buffer[n+1];if(F(r)||e&&ve.has(r))break;t=n}else if(F(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
131
+ `?(n+=1,i=`
132
+ `,r=this.buffer[n+1]):t=n),r==="#"||e&&ve.has(r))break;if(i===`
133
+ `){const o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&ve.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ae,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(ht),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(F(n)||t&&ve.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!F(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Xn.has(t))t=this.buffer[++e];else if(t==="%"&&Vt.has(this.buffer[e+1])&&Vt.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
134
+ `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
135
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class Rs{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function Q(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function Jt(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Fs(s){switch(s==null?void 0:s.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function je(s){switch(s.type){case"document":return s.start;case"block-map":{const e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function re(s){var t;if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=s[++e])==null?void 0:t.type)==="space";);return s.splice(e,s.length)}function Ve(s,e){if(e.length<1e5)Array.prototype.push.apply(s,e);else for(let t=0;t<e.length;++t)s.push(e[t])}function Yt(s){if(s.start.type==="flow-seq-start")for(const e of s.items)e.sep&&!e.value&&!Q(e.start,"explicit-key-ind")&&!Q(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Fs(e.value)?e.value.end?Ve(e.value.end,e.sep):e.value.end=e.sep:Ve(e.start,e.sep),delete e.sep)}class Bt{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new qs,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=Ds(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(e==null?void 0:e.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Yt(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{const i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Jt(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Jt(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=je(this.peek(2)),n=re(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
136
+ `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
137
+ `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Ve(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(r&&t.sep&&!t.value){const a=[];for(let l=0;l<t.sep.length;++l){const c=t.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Fs(t.key)&&!Q(t.sep,"newline")){const a=re(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(Q(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const a=re(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Q(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);r||t.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!t.explicitKey&&t.sep&&!Q(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Ve(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Q(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while((n==null?void 0:n.type)==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const i=je(n),r=re(i);Yt(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
138
+ `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
139
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=je(e),n=re(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=je(e),n=re(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Us(s){const e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Rs||null,prettyErrors:e}}function Zn(s,e={}){const{lineCounter:t,prettyErrors:n}=Us(e),i=new Bt(t==null?void 0:t.addNewLine),r=new jt(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(const a of o)a.errors.forEach(Fe(s,t)),a.warnings.forEach(Fe(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Vs(s,e={}){const{lineCounter:t,prettyErrors:n}=Us(e),i=new Bt(t==null?void 0:t.addNewLine),r=new jt(e);let o=null;for(const a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new x(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(Fe(s,t)),o.warnings.forEach(Fe(s,t))),o}function xn(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);const i=Vs(s,t);if(!i)return null;if(i.warnings.forEach(r=>ls(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function ei(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){const{keepUndefined:i}=t??e??{};if(!i)return}return se(s)&&!n?s.toString(t):new we(s,n,t).toString(t)}const Ht=Object.freeze(Object.defineProperty({__proto__:null,Alias:Ye,CST:Wn,Composer:jt,Document:we,Lexer:qs,LineCounter:Rs,Pair:v,Parser:Bt,Scalar:O,Schema:et,YAMLError:_t,YAMLMap:K,YAMLParseError:x,YAMLSeq:X,YAMLWarning:Ls,isAlias:te,isCollection:$,isDocument:se,isMap:me,isNode:_,isPair:C,isScalar:I,isSeq:ye,parse:xn,parseAllDocuments:Zn,parseDocument:Vs,stringify:ei,visit:ne,visitAsync:Je},Symbol.toStringTag,{value:"Module"})),it=".zreview",dt=L.join(it,"review.yaml"),Gt=L.join(it,"docs"),Qt=L.join(it,"diagrams");class ti{constructor(e,t){rt(this,"root");rt(this,"onChange");this.root=e,this.onChange=t}exists(){return L.existsSync(L.join(this.root,dt))}read(){const e=L.join(this.root,dt);if(!L.existsSync(e))return{status:"draft",summary:"",documents:[],codebases:[],diagrams:[],items:[]};try{const t=Ht.parse(L.readFileSync(e,"utf8"));return!t||!Array.isArray(t.items)?{status:"draft",summary:(t==null?void 0:t.summary)??"",documents:(t==null?void 0:t.documents)??[],codebases:(t==null?void 0:t.codebases)??[],diagrams:(t==null?void 0:t.diagrams)??[],items:[]}:{status:t.status??"draft",summary:t.summary??"",documents:t.documents??[],codebases:t.codebases??[],diagrams:t.diagrams??[],items:t.items}}catch{return{status:"draft",summary:"",documents:[],codebases:[],diagrams:[],items:[]}}}write(e){var t;L.mkdirSync(L.join(this.root,it),{recursive:!0}),L.writeFileSync(L.join(this.root,dt),Ht.stringify(e),"utf8"),(t=this.onChange)==null||t.call(this)}updateItem(e,t){const n=this.read(),i=this.findItem(n.items,e);if(!i)throw new Error(`item ${e} not found`);return t.answer!==void 0&&(i.answer=t.answer),t.state!==void 0&&(i.state=t.state),t.priority!==void 0&&(i.priority=t.priority),t.title!==void 0&&(i.title=t.title),t.state==="answered"&&!t.answer&&!i.answer&&(i.answer=""),this.write(n),n}addChild(e,t,n="medium"){const i=this.read(),r=this.findItem(i.items,e);if(!r)throw new Error(`parent ${e} not found`);r.children||(r.children=[]);const o=`${e}-${r.children.length+1}`;return r.children.push({id:o,type:"decomposition",state:"open",title:t,priority:n}),this.write(i),i}removeItem(e){const t=this.read();if(!this.removeItemFromList(t.items,e))throw new Error(`item ${e} not found`);return this.write(t),t}setStatus(e){const t=this.read();if(e==="passed"&&this.hasOpenItems(t.items))throw new Error("存在未处理的评审项(open),不能通过");return t.status=e,this.write(t),t}listDocs(){const e=L.join(this.root,Gt);if(!L.existsSync(e))return[];try{return L.readdirSync(e).filter(t=>/\.(md|markdown|txt)$/i.test(t)).sort()}catch{return[]}}readDoc(e){const t=L.join(this.root,Gt,e);if(!L.existsSync(t))throw new Error(`doc ${e} not found`);return L.readFileSync(t,"utf8")}listDiagrams(){const e=L.join(this.root,Qt);if(!L.existsSync(e))return[];try{return L.readdirSync(e).filter(t=>/\.html$/i.test(t)).sort()}catch{return[]}}readDiagram(e){const t=L.join(this.root,Qt,e);if(!L.existsSync(t))throw new Error(`diagram ${e} not found`);return L.readFileSync(t,"utf8")}findItem(e,t){for(const n of e){if(n.id===t)return n;if(n.children){const i=this.findItem(n.children,t);if(i)return i}}return null}removeItemFromList(e,t){for(let n=0;n<e.length;n++){if(e[n].id===t)return e.splice(n,1),!0;if(e[n].children&&this.removeItemFromList(e[n].children,t))return!0}return!1}hasOpenItems(e){for(const t of e)if(t.state==="open"||t.children&&this.hasOpenItems(t.children))return!0;return!1}}async function Be(s){return new Promise(e=>{let t="";s.on("data",n=>{t+=n}),s.on("end",()=>e(t)),s.on("error",()=>e(""))})}const ni={inject:["server","dashboard","reload"],apply(s,e){const t=e.root;s.inject(["server"],()=>{var i;if(!((i=s.server)!=null&&i.route))return;s.dashboard.register({mode:"review",label:"文档评审",icon:"✅",description:"多文档需求评审与拆解 · zreview"});const n=new ti(t,()=>{s.reload.broadcast("files")});s.server.route("/__review",async(r,o)=>{o.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache"}),o.end(JSON.stringify(n.read()))}),s.server.route("/__review/item",async(r,o)=>{try{const a=JSON.parse(await Be(r)||"{}"),l=n.updateItem(a.id,{answer:a.answer,state:a.state,priority:a.priority,title:a.title});o.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache"}),o.end(JSON.stringify(l))}catch(a){o.writeHead(400,{"Content-Type":"application/json; charset=utf-8"}),o.end(JSON.stringify({error:a instanceof Error?a.message:"unknown error"}))}}),s.server.route("/__review/item/add-child",async(r,o)=>{try{const a=JSON.parse(await Be(r)||"{}"),l=n.addChild(a.parentId,a.title,a.priority);o.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache"}),o.end(JSON.stringify(l))}catch(a){o.writeHead(400,{"Content-Type":"application/json; charset=utf-8"}),o.end(JSON.stringify({error:a instanceof Error?a.message:"unknown error"}))}}),s.server.route("/__review/item/remove",async(r,o)=>{try{const a=JSON.parse(await Be(r)||"{}"),l=n.removeItem(a.id);o.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache"}),o.end(JSON.stringify(l))}catch(a){o.writeHead(400,{"Content-Type":"application/json; charset=utf-8"}),o.end(JSON.stringify({error:a instanceof Error?a.message:"unknown error"}))}}),s.server.route("/__review/status",async(r,o)=>{try{const a=JSON.parse(await Be(r)||"{}"),l=n.setStatus(a.status);o.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache"}),o.end(JSON.stringify(l))}catch(a){o.writeHead(400,{"Content-Type":"application/json; charset=utf-8"}),o.end(JSON.stringify({error:a instanceof Error?a.message:"unknown error"}))}}),s.server.route("/__docs",async(r,o)=>{o.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache"}),o.end(JSON.stringify(n.listDocs()))}),s.server.route("/__docs/:name",async(r,o)=>{var a;try{const l=(a=r.params)==null?void 0:a.name;if(!l)throw new Error("missing doc name");const c=n.readDoc(l);o.writeHead(200,{"Content-Type":"text/markdown; charset=utf-8","Cache-Control":"no-cache"}),o.end(c)}catch(l){o.writeHead(404,{"Content-Type":"application/json; charset=utf-8"}),o.end(JSON.stringify({error:l instanceof Error?l.message:"not found"}))}}),s.server.route("/__diagrams",async(r,o)=>{o.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache"}),o.end(JSON.stringify(n.listDiagrams()))}),s.server.route("/__diagrams/:name",async(r,o)=>{var a;try{const l=(a=r.params)==null?void 0:a.name;if(!l)throw new Error("missing diagram name");const c=n.readDiagram(l);o.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-cache"}),o.end(c)}catch(l){o.writeHead(404,{"Content-Type":"application/json; charset=utf-8"}),o.end(JSON.stringify({error:l instanceof Error?l.message:"not found"}))}})})}};export{ni as apply};
@@ -1 +1 @@
1
- import{u as g,r as a,j as e,B as p,E as f,_ as b}from"./index-BfA6l4to.js";import{B as u}from"./badge-DTb6qo3S.js";import{F as j}from"./FilterPills-B6u1IBeC.js";const v=[{key:"mine",label:"我的"},{key:"all",label:"全部"},{key:"active",label:"active"},{key:"resolved",label:"resolved"},{key:"closed",label:"closed"}];function y({status:l}){const s=l==="active"?"destructive":l==="resolved"?"success":"neutral";return e.jsx(u,{variant:s,children:l})}function k({severity:l}){const s=Number(l),r=s<=1?"destructive":s===2||s===3?"warning":"neutral";return e.jsxs(u,{variant:r,children:["S",s]})}function N(){const{icon:l}=g(),[s,r]=a.useState(null),[m,i]=a.useState(!1),[n,x]=a.useState("mine"),o=a.useCallback(()=>{i(!0),fetch("/__bugs",{cache:"no-store"}).then(t=>t.json()).then(r).finally(()=>i(!1))},[]);a.useEffect(o,[o]);const h=t=>n==="all"?!0:n==="mine"?t.mine:t.status===n,c=s!=null&&s.ok?s.bugs.filter(h):[],d=s!=null&&s.ok?{mine:s.bugs.filter(t=>t.mine).length,all:s.bugs.length,active:s.bugs.filter(t=>t.status==="active").length,resolved:s.bugs.filter(t=>t.status==="resolved").length,closed:s.bugs.filter(t=>t.status==="closed").length}:null;return e.jsxs("div",{className:"mx-auto h-full max-w-6xl flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"flex-none flex items-center gap-2 px-3 py-2 border-b",children:[e.jsx(j,{items:v.map(t=>({key:t.key,label:t.label,badge:d?String(d[t.key]):void 0})),value:n,onChange:x,ariaLabel:"状态筛选"}),e.jsx("span",{className:"ml-auto text-sm text-muted-foreground",children:"禅道 · 只读"}),e.jsx(p,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:o,title:"刷新",children:l("refresh-cw",`h-3.5 w-3.5 ${m?"animate-spin":""}`)})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:s?s.ok?c.length?e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"sticky top-0 bg-background border-b",children:e.jsxs("tr",{className:"text-left text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 font-medium w-16",children:"#"}),e.jsx("th",{className:"px-3 py-2 font-medium",children:"标题"}),e.jsx("th",{className:"px-3 py-2 font-medium w-14",children:"严重度"}),e.jsx("th",{className:"px-3 py-2 font-medium w-20",children:"状态"}),e.jsx("th",{className:"px-3 py-2 font-medium w-20",children:"指派"})]})}),e.jsx("tbody",{children:c.map(t=>e.jsxs("tr",{className:"border-b last:border-0 hover:bg-muted/40 transition-colors",children:[e.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:t.id}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("button",{className:"text-left hover:text-primary hover:underline flex items-center gap-1",onClick:()=>window.open(`${s.url}/bug-view-${t.id}.html`,"_blank","noopener"),title:"在禅道打开",children:[e.jsx("span",{className:"truncate max-w-[var(--bug-title-max-w)]",children:t.title}),l("external-link","h-3 w-3 shrink-0 text-muted-foreground")]})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(k,{severity:t.severity})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(y,{status:t.status})}),e.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:t.assignedTo||"—"})]},t.id))})]}):e.jsx(f,{icon:l("bug","h-6 w-6"),title:n==="mine"?"没有指派给你的 bug":"该状态下无 bug",hint:"🎉"}):e.jsx("p",{className:"p-4 text-xs text-destructive",children:s.error}):e.jsx("p",{className:"p-4 text-xs text-muted-foreground",children:"加载中…"})})]})}function w(){return e.jsx(N,{})}const _=Object.freeze(Object.defineProperty({__proto__:null,default:w},Symbol.toStringTag,{value:"Module"})),T={mode:"bugs",label:"禅道 Bugs",icon:"🎯",description:"只读 bug 列表 · zgoal",Workspace:a.lazy(()=>b(()=>Promise.resolve().then(()=>_),void 0))};export{w as BugWorkspace,T as default};
1
+ import{u as g,r as a,j as e,B as p,E as f,_ as b}from"./index-Co_rMXPa.js";import{B as u}from"./badge-DUO7nDks.js";import{F as j}from"./FilterPills-CSZQenbh.js";const v=[{key:"mine",label:"我的"},{key:"all",label:"全部"},{key:"active",label:"active"},{key:"resolved",label:"resolved"},{key:"closed",label:"closed"}];function y({status:l}){const s=l==="active"?"destructive":l==="resolved"?"success":"neutral";return e.jsx(u,{variant:s,children:l})}function k({severity:l}){const s=Number(l),r=s<=1?"destructive":s===2||s===3?"warning":"neutral";return e.jsxs(u,{variant:r,children:["S",s]})}function N(){const{icon:l}=g(),[s,r]=a.useState(null),[m,i]=a.useState(!1),[n,x]=a.useState("mine"),o=a.useCallback(()=>{i(!0),fetch("/__bugs",{cache:"no-store"}).then(t=>t.json()).then(r).finally(()=>i(!1))},[]);a.useEffect(o,[o]);const h=t=>n==="all"?!0:n==="mine"?t.mine:t.status===n,c=s!=null&&s.ok?s.bugs.filter(h):[],d=s!=null&&s.ok?{mine:s.bugs.filter(t=>t.mine).length,all:s.bugs.length,active:s.bugs.filter(t=>t.status==="active").length,resolved:s.bugs.filter(t=>t.status==="resolved").length,closed:s.bugs.filter(t=>t.status==="closed").length}:null;return e.jsxs("div",{className:"mx-auto h-full max-w-6xl flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"flex-none flex items-center gap-2 px-3 py-2 border-b",children:[e.jsx(j,{items:v.map(t=>({key:t.key,label:t.label,badge:d?String(d[t.key]):void 0})),value:n,onChange:x,ariaLabel:"状态筛选"}),e.jsx("span",{className:"ml-auto text-sm text-muted-foreground",children:"禅道 · 只读"}),e.jsx(p,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:o,title:"刷新",children:l("refresh-cw",`h-3.5 w-3.5 ${m?"animate-spin":""}`)})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:s?s.ok?c.length?e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"sticky top-0 bg-background border-b",children:e.jsxs("tr",{className:"text-left text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 font-medium w-16",children:"#"}),e.jsx("th",{className:"px-3 py-2 font-medium",children:"标题"}),e.jsx("th",{className:"px-3 py-2 font-medium w-14",children:"严重度"}),e.jsx("th",{className:"px-3 py-2 font-medium w-20",children:"状态"}),e.jsx("th",{className:"px-3 py-2 font-medium w-20",children:"指派"})]})}),e.jsx("tbody",{children:c.map(t=>e.jsxs("tr",{className:"border-b last:border-0 hover:bg-muted/40 transition-colors",children:[e.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:t.id}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("button",{className:"text-left hover:text-primary hover:underline flex items-center gap-1",onClick:()=>window.open(`${s.url}/bug-view-${t.id}.html`,"_blank","noopener"),title:"在禅道打开",children:[e.jsx("span",{className:"truncate max-w-[var(--bug-title-max-w)]",children:t.title}),l("external-link","h-3 w-3 shrink-0 text-muted-foreground")]})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(k,{severity:t.severity})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(y,{status:t.status})}),e.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:t.assignedTo||"—"})]},t.id))})]}):e.jsx(f,{icon:l("bug","h-6 w-6"),title:n==="mine"?"没有指派给你的 bug":"该状态下无 bug",hint:"🎉"}):e.jsx("p",{className:"p-4 text-xs text-destructive",children:s.error}):e.jsx("p",{className:"p-4 text-xs text-muted-foreground",children:"加载中…"})})]})}function w(){return e.jsx(N,{})}const _=Object.freeze(Object.defineProperty({__proto__:null,default:w},Symbol.toStringTag,{value:"Module"})),T={mode:"bugs",label:"禅道 Bugs",icon:"🎯",description:"只读 bug 列表 · zgoal",Workspace:a.lazy(()=>b(()=>Promise.resolve().then(()=>_),void 0))};export{w as BugWorkspace,T as default};