crewx 0.8.7-rc.8 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/MarketPage-Nn6v2smX.js +46 -0
- package/dist/assets/{PromptTab-BuoQEE8w.js → PromptTab-BLj5DYwG.js} +7 -7
- package/dist/assets/_baseUniq-Da8Sle23.js +1 -0
- package/dist/assets/{arc-Q_6SDEU_.js → arc-CRV7Gm3c.js} +1 -1
- package/dist/assets/architectureDiagram-UYN6MBPD-_c-wCif-.js +36 -0
- package/dist/assets/blockDiagram-ZHA2E4KO-PL5Jtj2V.js +121 -0
- package/dist/assets/{c4Diagram-6F5ED5ID-CdUpkxOB.js → c4Diagram-6F5ED5ID-_lOiUsIR.js} +1 -1
- package/dist/assets/channel-CDBdV73-.js +1 -0
- package/dist/assets/{chunk-5HRBRIJM-DVUzhNFC.js → chunk-5HRBRIJM-DAUxGvAh.js} +1 -1
- package/dist/assets/{chunk-7U56Z5CX-CQrO10el.js → chunk-7U56Z5CX-BVCYB-Np.js} +1 -1
- package/dist/assets/{chunk-ASOPGD6M-MUrfCDTG.js → chunk-ASOPGD6M-Dqv_Eb6I.js} +1 -1
- package/dist/assets/{chunk-KFBOBJHC-CVJX9mwi.js → chunk-KFBOBJHC-CGUpApfa.js} +1 -1
- package/dist/assets/{chunk-T2TOU4HS-CrURke6B.js → chunk-T2TOU4HS-J2SNjA-0.js} +1 -1
- package/dist/assets/{chunk-TMUBEWPD-WQFsoCZ2.js → chunk-TMUBEWPD-DKxHm_Td.js} +1 -1
- package/dist/assets/classDiagram-LNE6IOMH-CGD7eu5w.js +1 -0
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-CGD7eu5w.js +1 -0
- package/dist/assets/clone-QnduyJ89.js +1 -0
- package/dist/assets/dagre-4EVJKHTY-CeNbYgy6.js +4 -0
- package/dist/assets/diagram-QW4FP2JN-CF1MsCdY.js +24 -0
- package/dist/assets/{erDiagram-6RL3IURR-BFoFIeup.js → erDiagram-6RL3IURR-DJLQukyY.js} +2 -2
- package/dist/assets/{flowDiagram-7ASYPVHJ-BieiVkUq.js → flowDiagram-7ASYPVHJ-BP-ToBPt.js} +1 -1
- package/dist/assets/{ganttDiagram-NTVNEXSI-D5l7QxXC.js → ganttDiagram-NTVNEXSI-BCztwWm3.js} +3 -3
- package/dist/assets/gitGraph-YCYPL57B-C4wWI2lu.js +133 -0
- package/dist/assets/gitGraphDiagram-NRZ2UAAF-BOPfFGjh.js +65 -0
- package/dist/assets/graph-LhZDDtD9.js +1 -0
- package/dist/assets/index.browser-CAdCkbEw.js +18 -0
- package/dist/assets/infoDiagram-A4XQUW5V-DxhY4Cnk.js +2 -0
- package/dist/assets/{journeyDiagram-G5WM74LC-CaL2qxGH.js → journeyDiagram-G5WM74LC-Dn2RRgG3.js} +1 -1
- package/dist/assets/{kanban-definition-QRCXZQQD-MCNKy_ku.js → kanban-definition-QRCXZQQD-DxkXkkdi.js} +1 -1
- package/dist/assets/layout-BsjmiMVZ.js +1 -0
- package/dist/assets/{linear-D8eeF5og.js → linear-CtHlokEZ.js} +1 -1
- package/dist/assets/main-3IYf82MG.css +10 -0
- package/dist/assets/main-aGv85UbW.js +1167 -0
- package/dist/assets/min-BF7UvoIw.js +1 -0
- package/dist/assets/{mindmap-definition-GWI6TPTV-D6KTLj0I.js → mindmap-definition-GWI6TPTV-BBRhXbd9.js} +1 -1
- package/dist/assets/pieDiagram-YF2LJOPJ-DP_ktdUS.js +30 -0
- package/dist/assets/{quadrantDiagram-OS5C2QUG-D-K5fs_N.js → quadrantDiagram-OS5C2QUG-BIh4kwTo.js} +1 -1
- package/dist/assets/{requirementDiagram-MIRIMTAZ-Hlf3AE-0.js → requirementDiagram-MIRIMTAZ-Fe9rmLFI.js} +2 -2
- package/dist/assets/{sankeyDiagram-Y46BX6SQ-DNJopdo1.js → sankeyDiagram-Y46BX6SQ-CoadFop_.js} +1 -1
- package/dist/assets/{sequenceDiagram-G6AWOVSC-DAhVbPZG.js → sequenceDiagram-G6AWOVSC-QKs8kkyp.js} +1 -1
- package/dist/assets/stateDiagram-MAYHULR4-DgmimeQe.js +1 -0
- package/dist/assets/stateDiagram-v2-4JROLMXI-D87jsHh8.js +1 -0
- package/dist/assets/{timeline-definition-U7ZMHBDA-Bu7lHzin.js → timeline-definition-U7ZMHBDA-BnBpyaqh.js} +1 -1
- package/dist/assets/{xychartDiagram-6QU3TZC5-CjIoLTEW.js → xychartDiagram-6QU3TZC5-BMvMTHLV.js} +2 -2
- package/dist/index.html +2 -2
- package/dist-server/app.module.js +8 -0
- package/dist-server/common/analytics.client.js +180 -0
- package/dist-server/common/analytics.module.js +21 -0
- package/dist-server/common/device-id.js +33 -0
- package/dist-server/domain/cli/cli.service.js +66 -4
- package/dist-server/domain/cron/cron.controller.js +147 -0
- package/dist-server/domain/cron/cron.module.js +22 -0
- package/dist-server/domain/cron/cron.service.js +77 -0
- package/dist-server/domain/cron/dto/cron.dto.js +80 -0
- package/dist-server/domain/goal/dto/goal.dto.js +49 -0
- package/dist-server/domain/goal/goal.controller.js +86 -0
- package/dist-server/domain/goal/goal.module.js +22 -0
- package/dist-server/domain/goal/goal.service.js +197 -0
- package/dist-server/domain/goal/parser/goal-md-parser.js +166 -0
- package/dist-server/domain/goal/parser/goal-md-serializer.js +110 -0
- package/dist-server/domain/market/default-marketplace.json +24 -0
- package/dist-server/domain/market/market.controller.js +25 -1
- package/dist-server/domain/market/market.service.js +411 -17
- package/dist-server/domain/planner/dto/planner.dto.js +6 -0
- package/dist-server/domain/planner/planner.service.js +24 -0
- package/dist-server/domain/settings/settings.controller.js +52 -0
- package/dist-server/domain/settings/settings.module.js +22 -0
- package/dist-server/domain/settings/settings.service.js +105 -0
- package/dist-server/domain/task/task.service.js +20 -0
- package/dist-server/domain/thread/dto/reorder-pins.dto.js +22 -0
- package/dist-server/domain/thread/thread.controller.js +42 -0
- package/dist-server/domain/thread/thread.service.js +37 -8
- package/dist-server/main.js +1 -0
- package/dist-server/repository/task.repository.js +4 -0
- package/dist-server/repository/thread.repository.js +33 -0
- package/package.json +18 -11
- package/packages/cli/dist/builtin.js +1 -0
- package/packages/cli/dist/commands/init.js +218 -8
- package/packages/cli/package.json +2 -1
- package/server.js +6 -3
- package/dist/assets/MarketPage-CuU6QJrW.js +0 -56
- package/dist/assets/architectureDiagram-UYN6MBPD-BVCbyGQC.js +0 -36
- package/dist/assets/blockDiagram-ZHA2E4KO-Ce8sRoAx.js +0 -121
- package/dist/assets/channel-B6tspB-f.js +0 -1
- package/dist/assets/classDiagram-LNE6IOMH-CPTm4zzb.js +0 -1
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-CPTm4zzb.js +0 -1
- package/dist/assets/dagre-4EVJKHTY-Dvx3qWzp.js +0 -4
- package/dist/assets/diagram-QW4FP2JN-D20dsYKr.js +0 -24
- package/dist/assets/gitGraph-YCYPL57B-jCcBrUE9.js +0 -133
- package/dist/assets/gitGraphDiagram-NRZ2UAAF-DE2V7g8n.js +0 -65
- package/dist/assets/graph-BlwPajkw.js +0 -1
- package/dist/assets/infoDiagram-A4XQUW5V-C5Lz_ufO.js +0 -2
- package/dist/assets/layout-Bvwu4dCi.js +0 -1
- package/dist/assets/main-0MllC3Ui.js +0 -1065
- package/dist/assets/main-AcISG6yO.css +0 -10
- package/dist/assets/pieDiagram-YF2LJOPJ-lQkbccOm.js +0 -30
- package/dist/assets/stateDiagram-MAYHULR4-z5GWLjsY.js +0 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-B3YnZ4s0.js +0 -1
- package/packages/cli/dist/commands/task-db.d.ts +0 -33
- package/packages/cli/dist/commands/task-db.js +0 -107
- package/packages/cli/dist/examples/deny-secrets-plugin.d.ts +0 -22
- package/packages/cli/dist/examples/deny-secrets-plugin.js +0 -40
- package/packages/cli/dist/plugins/examples/echo-hook.d.ts +0 -24
- package/packages/cli/dist/plugins/examples/echo-hook.js +0 -60
- package/packages/cli/dist/plugins/examples/verify-echo-hook.d.ts +0 -8
- package/packages/cli/dist/plugins/examples/verify-echo-hook.js +0 -47
- package/packages/cli/dist/plugins/sqlite-tracing.d.ts +0 -11
- package/packages/cli/dist/plugins/sqlite-tracing.js +0 -19
- package/packages/cli/dist/repository/workspace.repository.d.ts +0 -26
- package/packages/cli/dist/repository/workspace.repository.js +0 -111
- package/packages/cli/dist/schema/tasks.d.ts +0 -7
- package/packages/cli/dist/schema/tasks.js +0 -48
- /package/dist/assets/{gemini-logo.svg → google-logo.svg} +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import{p as Z}from"./chunk-TMUBEWPD-DKxHm_Td.js";import{I as F}from"./chunk-KFBOBJHC-CGUpApfa.js";import{n as U,o as rr,s as er,g as tr,a as ar,b as nr,_ as h,l as w,d as sr,u as or,B as cr,v as ir,k as B,C as dr,D as hr,E as lr,c as $r,F as fr}from"./main-aGv85UbW.js";import{p as gr}from"./gitGraph-YCYPL57B-C4wWI2lu.js";import"./min-BF7UvoIw.js";import"./_baseUniq-Da8Sle23.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},yr=hr.gitGraph,z=h(()=>dr({...yr,...lr().gitGraph}),"getConfig"),i=new F(()=>{const t=z(),r=t.mainBranchName,a=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:a}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function S(){return fr({length:7})}h(S,"getID");function N(t,r){const a=Object.create(null);return t.reduce((s,e)=>{const n=r(e);return a[n]||(a[n]=!0,s.push(e)),s},[])}h(N,"uniqBy");var ur=h(function(t){i.records.direction=t},"setDirection"),xr=h(function(t){w.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{i.records.options=JSON.parse(t)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),pr=h(function(){return i.records.options},"getOptions"),br=h(function(t){let r=t.msg,a=t.id;const s=t.type;let e=t.tags;w.info("commit",r,a,s,e),w.debug("Entering commit:",r,a,s,e);const n=z();a=B.sanitizeText(a,n),r=B.sanitizeText(r,n),e=e==null?void 0:e.map(o=>B.sanitizeText(o,n));const c={id:a||i.records.seq+"-"+S(),message:r,seq:i.records.seq++,type:s??x.NORMAL,tags:e??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=c,w.info("main branch",n.mainBranchName),i.records.commits.set(c.id,c),i.records.branches.set(i.records.currBranch,c.id),w.debug("in pushCommit "+c.id)},"commit"),mr=h(function(t){let r=t.name;const a=t.order;if(r=B.sanitizeText(r,z()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:a}),_(r),w.debug("in createBranch")},"branch"),wr=h(t=>{let r=t.branch,a=t.id;const s=t.type,e=t.tags,n=z();r=B.sanitizeText(r,n),a&&(a=B.sanitizeText(a,n));const c=i.records.branches.get(i.records.currBranch),o=i.records.branches.get(r),$=c?i.records.commits.get(c):void 0,l=o?i.records.commits.get(o):void 0;if($&&l&&$.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const d=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if($===void 0||!$){const d=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},d}if(!i.records.branches.has(r)){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},d}if(l===void 0||!l){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},d}if($===l){const d=new Error('Incorrect usage of "merge". Both branches have same head');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if(a&&i.records.commits.has(a)){const d=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom Id");throw d.hash={text:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,token:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,expected:[`merge ${r} ${a}_UNIQUE ${s} ${e==null?void 0:e.join(" ")}`]},d}const f=o||"",g={id:a||`${i.records.seq}-${S()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,f],branch:i.records.currBranch,type:x.MERGE,customType:s,customId:!!a,tags:e??[]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),w.debug(i.records.branches),w.debug("in mergeBranch")},"merge"),vr=h(function(t){let r=t.id,a=t.targetId,s=t.tags,e=t.parent;w.debug("Entering cherryPick:",r,a,s);const n=z();if(r=B.sanitizeText(r,n),a=B.sanitizeText(a,n),s=s==null?void 0:s.map($=>B.sanitizeText($,n)),e=B.sanitizeText(e,n),!r||!i.records.commits.has(r)){const $=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw $.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},$}const c=i.records.commits.get(r);if(c===void 0||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(c.parents)&&c.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=c.branch;if(c.type===x.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!a||!i.records.commits.has(a)){if(o===i.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const $=i.records.branches.get(i.records.currBranch);if($===void 0||!$){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const l=i.records.commits.get($);if(l===void 0||!l){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const f={id:i.records.seq+"-"+S(),message:`cherry-picked ${c==null?void 0:c.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,c.id],branch:i.records.currBranch,type:x.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${c.id}${c.type===x.MERGE?`|parent:${e}`:""}`]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),w.debug(i.records.branches),w.debug("in cherryPick")}},"cherryPick"),_=h(function(t){if(t=B.sanitizeText(t,z()),i.records.branches.has(t)){i.records.currBranch=t;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function A(t,r,a){const s=t.indexOf(r);s===-1?t.push(a):t.splice(s,1,a)}h(A,"upsert");function D(t){const r=t.reduce((e,n)=>e.seq>n.seq?e:n,t[0]);let a="";t.forEach(function(e){e===r?a+=" *":a+=" |"});const s=[a,r.id,r.seq];for(const e in i.records.branches)i.records.branches.get(e)===r.id&&s.push(e);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=i.records.commits.get(r.parents[0]);A(t,r,e),r.parents[1]&&t.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=i.records.commits.get(r.parents[0]);A(t,r,e)}}t=N(t,e=>e.id),D(t)}h(D,"prettyPrintCommitHistory");var Cr=h(function(){w.debug(i.records.commits);const t=V()[0];D([t])},"prettyPrint"),Er=h(function(){i.reset(),ir()},"clear"),Br=h(function(){return[...i.records.branchConfig.values()].map((r,a)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${a}`)}).sort((r,a)=>(r.order??0)-(a.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),kr=h(function(){return i.records.branches},"getBranches"),Lr=h(function(){return i.records.commits},"getCommits"),V=h(function(){const t=[...i.records.commits.values()];return t.forEach(function(r){w.debug(r.id)}),t.sort((r,a)=>r.seq-a.seq),t},"getCommitsArray"),Tr=h(function(){return i.records.currBranch},"getCurrentBranch"),Mr=h(function(){return i.records.direction},"getDirection"),Rr=h(function(){return i.records.head},"getHead"),X={commitType:x,getConfig:z,setDirection:ur,setOptions:xr,getOptions:pr,commit:br,branch:mr,merge:wr,cherryPick:vr,checkout:_,prettyPrint:Cr,clear:Er,getBranchesAsObjArray:Br,getBranches:kr,getCommits:Lr,getCommitsArray:V,getCurrentBranch:Tr,getDirection:Mr,getHead:Rr,setAccTitle:nr,getAccTitle:ar,getAccDescription:tr,setAccDescription:er,setDiagramTitle:rr,getDiagramTitle:U},Ir=h((t,r)=>{Z(t,r),t.dir&&r.setDirection(t.dir);for(const a of t.statements)qr(a,r)},"populate"),qr=h((t,r)=>{const s={Commit:h(e=>r.commit(Or(e)),"Commit"),Branch:h(e=>r.branch(zr(e)),"Branch"),Merge:h(e=>r.merge(Gr(e)),"Merge"),Checkout:h(e=>r.checkout(Hr(e)),"Checkout"),CherryPicking:h(e=>r.cherryPick(Pr(e)),"CherryPicking")}[t.$type];s?s(t):w.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Or=h(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?x[t.type]:x.NORMAL,tags:t.tags??void 0}),"parseCommit"),zr=h(t=>({name:t.name,order:t.order??0}),"parseBranch"),Gr=h(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?x[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Hr=h(t=>t.branch,"parseCheckout"),Pr=h(t=>{var a;return{id:t.id,targetId:"",tags:((a=t.tags)==null?void 0:a.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Wr={parse:h(async t=>{const r=await gr("gitGraph",t);w.debug(r),Ir(r,X)},"parse")},j=$r(),b=j==null?void 0:j.gitGraph,R=10,I=40,k=4,L=2,O=8,C=new Map,E=new Map,P=30,G=new Map,W=[],M=0,u="LR",Sr=h(()=>{C.clear(),E.clear(),G.clear(),M=0,W=[],u="LR"},"clear"),J=h(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(s=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=s.trim(),r.appendChild(e)}),r},"drawText"),Q=h(t=>{let r,a,s;return u==="BT"?(a=h((e,n)=>e<=n,"comparisonFunc"),s=1/0):(a=h((e,n)=>e>=n,"comparisonFunc"),s=0),t.forEach(e=>{var c,o;const n=u==="TB"||u=="BT"?(c=E.get(e))==null?void 0:c.y:(o=E.get(e))==null?void 0:o.x;n!==void 0&&a(n,s)&&(r=e,s=n)}),r},"findClosestParent"),jr=h(t=>{let r="",a=1/0;return t.forEach(s=>{const e=E.get(s).y;e<=a&&(r=s,a=e)}),r||void 0},"findClosestParentBT"),Ar=h((t,r,a)=>{let s=a,e=a;const n=[];t.forEach(c=>{const o=r.get(c);if(!o)throw new Error(`Commit not found for key ${c}`);o.parents.length?(s=Yr(o),e=Math.max(s,e)):n.push(o),Kr(o,s)}),s=e,n.forEach(c=>{Nr(c,s,a)}),t.forEach(c=>{const o=r.get(c);if(o!=null&&o.parents.length){const $=jr(o.parents);s=E.get($).y-I,s<=e&&(e=s);const l=C.get(o.branch).pos,f=s-R;E.set(o.id,{x:l,y:f})}})},"setParallelBTPos"),Dr=h(t=>{var s;const r=Q(t.parents.filter(e=>e!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const a=(s=E.get(r))==null?void 0:s.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return a},"findClosestParentPos"),Yr=h(t=>Dr(t)+I,"calculateCommitPosition"),Kr=h((t,r)=>{const a=C.get(t.branch);if(!a)throw new Error(`Branch not found for commit ${t.id}`);const s=a.pos,e=r+R;return E.set(t.id,{x:s,y:e}),{x:s,y:e}},"setCommitPosition"),Nr=h((t,r,a)=>{const s=C.get(t.branch);if(!s)throw new Error(`Branch not found for commit ${t.id}`);const e=r+a,n=s.pos;E.set(t.id,{x:n,y:e})},"setRootPosition"),_r=h((t,r,a,s,e,n)=>{if(n===x.HIGHLIGHT)t.append("rect").attr("x",a.x-10).attr("y",a.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%O} ${s}-outer`),t.append("rect").attr("x",a.x-6).attr("y",a.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%O} ${s}-inner`);else if(n===x.CHERRY_PICK)t.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${r.id} ${s}`),t.append("circle").attr("cx",a.x-3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${s}`),t.append("circle").attr("cx",a.x+3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${s}`),t.append("line").attr("x1",a.x+3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${s}`),t.append("line").attr("x1",a.x-3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${s}`);else{const c=t.append("circle");if(c.attr("cx",a.x),c.attr("cy",a.y),c.attr("r",r.type===x.MERGE?9:10),c.attr("class",`commit ${r.id} commit${e%O}`),n===x.MERGE){const o=t.append("circle");o.attr("cx",a.x),o.attr("cy",a.y),o.attr("r",6),o.attr("class",`commit ${s} ${r.id} commit${e%O}`)}n===x.REVERSE&&t.append("path").attr("d",`M ${a.x-5},${a.y-5}L${a.x+5},${a.y+5}M${a.x-5},${a.y+5}L${a.x+5},${a.y-5}`).attr("class",`commit ${s} ${r.id} commit${e%O}`)}},"drawCommitBullet"),Vr=h((t,r,a,s)=>{var e;if(r.type!==x.CHERRY_PICK&&(r.customId&&r.type===x.MERGE||r.type!==x.MERGE)&&(b!=null&&b.showCommitLabel)){const n=t.append("g"),c=n.insert("rect").attr("class","commit-label-bkg"),o=n.append("text").attr("x",s).attr("y",a.y+25).attr("class","commit-label").text(r.id),$=(e=o.node())==null?void 0:e.getBBox();if($&&(c.attr("x",a.posWithOffset-$.width/2-L).attr("y",a.y+13.5).attr("width",$.width+2*L).attr("height",$.height+2*L),u==="TB"||u==="BT"?(c.attr("x",a.x-($.width+4*k+5)).attr("y",a.y-12),o.attr("x",a.x-($.width+4*k)).attr("y",a.y+$.height-12)):o.attr("x",a.posWithOffset-$.width/2),b.rotateCommitLabel))if(u==="TB"||u==="BT")o.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),c.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{const l=-7.5-($.width+10)/25*9.5,f=10+$.width/25*8.5;n.attr("transform","translate("+l+", "+f+") rotate(-45, "+s+", "+a.y+")")}}},"drawCommitLabel"),Xr=h((t,r,a,s)=>{var e;if(r.tags.length>0){let n=0,c=0,o=0;const $=[];for(const l of r.tags.reverse()){const f=t.insert("polygon"),g=t.append("circle"),d=t.append("text").attr("y",a.y-16-n).attr("class","tag-label").text(l),y=(e=d.node())==null?void 0:e.getBBox();if(!y)throw new Error("Tag bbox not found");c=Math.max(c,y.width),o=Math.max(o,y.height),d.attr("x",a.posWithOffset-y.width/2),$.push({tag:d,hole:g,rect:f,yOffset:n}),n+=20}for(const{tag:l,hole:f,rect:g,yOffset:d}of $){const y=o/2,p=a.y-19.2-d;if(g.attr("class","tag-label-bkg").attr("points",`
|
|
2
|
+
${s-c/2-k/2},${p+L}
|
|
3
|
+
${s-c/2-k/2},${p-L}
|
|
4
|
+
${a.posWithOffset-c/2-k},${p-y-L}
|
|
5
|
+
${a.posWithOffset+c/2+k},${p-y-L}
|
|
6
|
+
${a.posWithOffset+c/2+k},${p+y+L}
|
|
7
|
+
${a.posWithOffset-c/2-k},${p+y+L}`),f.attr("cy",p).attr("cx",s-c/2+k/2).attr("r",1.5).attr("class","tag-hole"),u==="TB"||u==="BT"){const m=s+d;g.attr("class","tag-label-bkg").attr("points",`
|
|
8
|
+
${a.x},${m+2}
|
|
9
|
+
${a.x},${m-2}
|
|
10
|
+
${a.x+R},${m-y-2}
|
|
11
|
+
${a.x+R+c+4},${m-y-2}
|
|
12
|
+
${a.x+R+c+4},${m+y+2}
|
|
13
|
+
${a.x+R},${m+y+2}`).attr("transform","translate(12,12) rotate(45, "+a.x+","+s+")"),f.attr("cx",a.x+k/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+a.x+","+s+")"),l.attr("x",a.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+a.x+","+s+")")}}}},"drawCommitTags"),Jr=h(t=>{switch(t.customType??t.type){case x.NORMAL:return"commit-normal";case x.REVERSE:return"commit-reverse";case x.HIGHLIGHT:return"commit-highlight";case x.MERGE:return"commit-merge";case x.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Qr=h((t,r,a,s)=>{const e={x:0,y:0};if(t.parents.length>0){const n=Q(t.parents);if(n){const c=s.get(n)??e;return r==="TB"?c.y+I:r==="BT"?(s.get(t.id)??e).y-I:c.x+I}}else return r==="TB"?P:r==="BT"?(s.get(t.id)??e).y-I:0;return 0},"calculatePosition"),Zr=h((t,r,a)=>{var c,o;const s=u==="BT"&&a?r:r+R,e=u==="TB"||u==="BT"?s:(c=C.get(t.branch))==null?void 0:c.pos,n=u==="TB"||u==="BT"?(o=C.get(t.branch))==null?void 0:o.pos:s;if(n===void 0||e===void 0)throw new Error(`Position were undefined for commit ${t.id}`);return{x:n,y:e,posWithOffset:s}},"getCommitPosition"),K=h((t,r,a)=>{if(!b)throw new Error("GitGraph config not found");const s=t.append("g").attr("class","commit-bullets"),e=t.append("g").attr("class","commit-labels");let n=u==="TB"||u==="BT"?P:0;const c=[...r.keys()],o=(b==null?void 0:b.parallelCommits)??!1,$=h((f,g)=>{var p,m;const d=(p=r.get(f))==null?void 0:p.seq,y=(m=r.get(g))==null?void 0:m.seq;return d!==void 0&&y!==void 0?d-y:0},"sortKeys");let l=c.sort($);u==="BT"&&(o&&Ar(l,r,n),l=l.reverse()),l.forEach(f=>{var y;const g=r.get(f);if(!g)throw new Error(`Commit not found for key ${f}`);o&&(n=Qr(g,u,n,E));const d=Zr(g,n,o);if(a){const p=Jr(g),m=g.customType??g.type,q=((y=C.get(g.branch))==null?void 0:y.index)??0;_r(s,g,d,p,q,m),Vr(e,g,d,n),Xr(e,g,d,n)}u==="TB"||u==="BT"?E.set(g.id,{x:d.x,y:d.posWithOffset}):E.set(g.id,{x:d.posWithOffset,y:d.y}),n=u==="BT"&&o?n+I:n+I+R,n>M&&(M=n)})},"drawCommits"),Fr=h((t,r,a,s,e)=>{const c=(u==="TB"||u==="BT"?a.x<s.x:a.y<s.y)?r.branch:t.branch,o=h(l=>l.branch===c,"isOnBranchToGetCurve"),$=h(l=>l.seq>t.seq&&l.seq<r.seq,"isBetweenCommits");return[...e.values()].some(l=>$(l)&&o(l))},"shouldRerouteArrow"),H=h((t,r,a=0)=>{const s=t+Math.abs(t-r)/2;if(a>5)return s;if(W.every(c=>Math.abs(c-s)>=10))return W.push(s),s;const n=Math.abs(t-r);return H(t,r-n/5,a+1)},"findLane"),Ur=h((t,r,a,s)=>{var y,p,m,q,Y;const e=E.get(r.id),n=E.get(a.id);if(e===void 0||n===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${a.id}`);const c=Fr(r,a,e,n,s);let o="",$="",l=0,f=0,g=(y=C.get(a.branch))==null?void 0:y.index;a.type===x.MERGE&&r.id!==a.parents[0]&&(g=(p=C.get(r.branch))==null?void 0:p.index);let d;if(c){o="A 10 10, 0, 0, 0,",$="A 10 10, 0, 0, 1,",l=10,f=10;const T=e.y<n.y?H(e.y,n.y):H(n.y,e.y),v=e.x<n.x?H(e.x,n.x):H(n.x,e.x);u==="TB"?e.x<n.x?d=`M ${e.x} ${e.y} L ${v-l} ${e.y} ${$} ${v} ${e.y+f} L ${v} ${n.y-l} ${o} ${v+f} ${n.y} L ${n.x} ${n.y}`:(g=(m=C.get(r.branch))==null?void 0:m.index,d=`M ${e.x} ${e.y} L ${v+l} ${e.y} ${o} ${v} ${e.y+f} L ${v} ${n.y-l} ${$} ${v-f} ${n.y} L ${n.x} ${n.y}`):u==="BT"?e.x<n.x?d=`M ${e.x} ${e.y} L ${v-l} ${e.y} ${o} ${v} ${e.y-f} L ${v} ${n.y+l} ${$} ${v+f} ${n.y} L ${n.x} ${n.y}`:(g=(q=C.get(r.branch))==null?void 0:q.index,d=`M ${e.x} ${e.y} L ${v+l} ${e.y} ${$} ${v} ${e.y-f} L ${v} ${n.y+l} ${o} ${v-f} ${n.y} L ${n.x} ${n.y}`):e.y<n.y?d=`M ${e.x} ${e.y} L ${e.x} ${T-l} ${o} ${e.x+f} ${T} L ${n.x-l} ${T} ${$} ${n.x} ${T+f} L ${n.x} ${n.y}`:(g=(Y=C.get(r.branch))==null?void 0:Y.index,d=`M ${e.x} ${e.y} L ${e.x} ${T+l} ${$} ${e.x+f} ${T} L ${n.x-l} ${T} ${o} ${n.x} ${T-f} L ${n.x} ${n.y}`)}else o="A 20 20, 0, 0, 0,",$="A 20 20, 0, 0, 1,",l=20,f=20,u==="TB"?(e.x<n.x&&(a.type===x.MERGE&&r.id!==a.parents[0]?d=`M ${e.x} ${e.y} L ${e.x} ${n.y-l} ${o} ${e.x+f} ${n.y} L ${n.x} ${n.y}`:d=`M ${e.x} ${e.y} L ${n.x-l} ${e.y} ${$} ${n.x} ${e.y+f} L ${n.x} ${n.y}`),e.x>n.x&&(o="A 20 20, 0, 0, 0,",$="A 20 20, 0, 0, 1,",l=20,f=20,a.type===x.MERGE&&r.id!==a.parents[0]?d=`M ${e.x} ${e.y} L ${e.x} ${n.y-l} ${$} ${e.x-f} ${n.y} L ${n.x} ${n.y}`:d=`M ${e.x} ${e.y} L ${n.x+l} ${e.y} ${o} ${n.x} ${e.y+f} L ${n.x} ${n.y}`),e.x===n.x&&(d=`M ${e.x} ${e.y} L ${n.x} ${n.y}`)):u==="BT"?(e.x<n.x&&(a.type===x.MERGE&&r.id!==a.parents[0]?d=`M ${e.x} ${e.y} L ${e.x} ${n.y+l} ${$} ${e.x+f} ${n.y} L ${n.x} ${n.y}`:d=`M ${e.x} ${e.y} L ${n.x-l} ${e.y} ${o} ${n.x} ${e.y-f} L ${n.x} ${n.y}`),e.x>n.x&&(o="A 20 20, 0, 0, 0,",$="A 20 20, 0, 0, 1,",l=20,f=20,a.type===x.MERGE&&r.id!==a.parents[0]?d=`M ${e.x} ${e.y} L ${e.x} ${n.y+l} ${o} ${e.x-f} ${n.y} L ${n.x} ${n.y}`:d=`M ${e.x} ${e.y} L ${n.x-l} ${e.y} ${o} ${n.x} ${e.y-f} L ${n.x} ${n.y}`),e.x===n.x&&(d=`M ${e.x} ${e.y} L ${n.x} ${n.y}`)):(e.y<n.y&&(a.type===x.MERGE&&r.id!==a.parents[0]?d=`M ${e.x} ${e.y} L ${n.x-l} ${e.y} ${$} ${n.x} ${e.y+f} L ${n.x} ${n.y}`:d=`M ${e.x} ${e.y} L ${e.x} ${n.y-l} ${o} ${e.x+f} ${n.y} L ${n.x} ${n.y}`),e.y>n.y&&(a.type===x.MERGE&&r.id!==a.parents[0]?d=`M ${e.x} ${e.y} L ${n.x-l} ${e.y} ${o} ${n.x} ${e.y-f} L ${n.x} ${n.y}`:d=`M ${e.x} ${e.y} L ${e.x} ${n.y+l} ${$} ${e.x+f} ${n.y} L ${n.x} ${n.y}`),e.y===n.y&&(d=`M ${e.x} ${e.y} L ${n.x} ${n.y}`));if(d===void 0)throw new Error("Line definition not found");t.append("path").attr("d",d).attr("class","arrow arrow"+g%O)},"drawArrow"),re=h((t,r)=>{const a=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const e=r.get(s);e.parents&&e.parents.length>0&&e.parents.forEach(n=>{Ur(a,r.get(n),e,r)})})},"drawArrows"),ee=h((t,r)=>{const a=t.append("g");r.forEach((s,e)=>{var p;const n=e%O,c=(p=C.get(s.name))==null?void 0:p.pos;if(c===void 0)throw new Error(`Position not found for branch ${s.name}`);const o=a.append("line");o.attr("x1",0),o.attr("y1",c),o.attr("x2",M),o.attr("y2",c),o.attr("class","branch branch"+n),u==="TB"?(o.attr("y1",P),o.attr("x1",c),o.attr("y2",M),o.attr("x2",c)):u==="BT"&&(o.attr("y1",M),o.attr("x1",c),o.attr("y2",P),o.attr("x2",c)),W.push(c);const $=s.name,l=J($),f=a.insert("rect"),d=a.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+n);d.node().appendChild(l);const y=l.getBBox();f.attr("class","branchLabelBkg label"+n).attr("rx",4).attr("ry",4).attr("x",-y.width-4-((b==null?void 0:b.rotateCommitLabel)===!0?30:0)).attr("y",-y.height/2+8).attr("width",y.width+18).attr("height",y.height+4),d.attr("transform","translate("+(-y.width-14-((b==null?void 0:b.rotateCommitLabel)===!0?30:0))+", "+(c-y.height/2-1)+")"),u==="TB"?(f.attr("x",c-y.width/2-10).attr("y",0),d.attr("transform","translate("+(c-y.width/2-5)+", 0)")):u==="BT"?(f.attr("x",c-y.width/2-10).attr("y",M),d.attr("transform","translate("+(c-y.width/2-5)+", "+M+")")):f.attr("transform","translate(-19, "+(c-y.height/2)+")")})},"drawBranches"),te=h(function(t,r,a,s,e){return C.set(t,{pos:r,index:a}),r+=50+(e?40:0)+(u==="TB"||u==="BT"?s.width/2:0),r},"setBranchPosition"),ae=h(function(t,r,a,s){if(Sr(),w.debug("in gitgraph renderer",t+`
|
|
14
|
+
`,"id:",r,a),!b)throw new Error("GitGraph config not found");const e=b.rotateCommitLabel??!1,n=s.db;G=n.getCommits();const c=n.getBranchesAsObjArray();u=n.getDirection();const o=sr(`[id="${r}"]`);let $=0;c.forEach((l,f)=>{var q;const g=J(l.name),d=o.append("g"),y=d.insert("g").attr("class","branchLabel"),p=y.insert("g").attr("class","label branch-label");(q=p.node())==null||q.appendChild(g);const m=g.getBBox();$=te(l.name,$,f,m,e),p.remove(),y.remove(),d.remove()}),K(o,G,!1),b.showBranches&&ee(o,c),re(o,G),K(o,G,!0),or.insertTitle(o,"gitTitleText",b.titleTopMargin??0,n.getDiagramTitle()),cr(void 0,o,b.diagramPadding,b.useMaxWidth)},"draw"),ne={draw:ae},se=h(t=>`
|
|
15
|
+
.commit-id,
|
|
16
|
+
.commit-msg,
|
|
17
|
+
.branch-label {
|
|
18
|
+
fill: lightgrey;
|
|
19
|
+
color: lightgrey;
|
|
20
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
21
|
+
font-family: var(--mermaid-font-family);
|
|
22
|
+
}
|
|
23
|
+
${[0,1,2,3,4,5,6,7].map(r=>`
|
|
24
|
+
.branch-label${r} { fill: ${t["gitBranchLabel"+r]}; }
|
|
25
|
+
.commit${r} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; }
|
|
26
|
+
.commit-highlight${r} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; }
|
|
27
|
+
.label${r} { fill: ${t["git"+r]}; }
|
|
28
|
+
.arrow${r} { stroke: ${t["git"+r]}; }
|
|
29
|
+
`).join(`
|
|
30
|
+
`)}
|
|
31
|
+
|
|
32
|
+
.branch {
|
|
33
|
+
stroke-width: 1;
|
|
34
|
+
stroke: ${t.lineColor};
|
|
35
|
+
stroke-dasharray: 2;
|
|
36
|
+
}
|
|
37
|
+
.commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
|
|
38
|
+
.commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
|
|
39
|
+
.tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
|
|
40
|
+
.tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
|
|
41
|
+
.tag-hole { fill: ${t.textColor}; }
|
|
42
|
+
|
|
43
|
+
.commit-merge {
|
|
44
|
+
stroke: ${t.primaryColor};
|
|
45
|
+
fill: ${t.primaryColor};
|
|
46
|
+
}
|
|
47
|
+
.commit-reverse {
|
|
48
|
+
stroke: ${t.primaryColor};
|
|
49
|
+
fill: ${t.primaryColor};
|
|
50
|
+
stroke-width: 3;
|
|
51
|
+
}
|
|
52
|
+
.commit-highlight-outer {
|
|
53
|
+
}
|
|
54
|
+
.commit-highlight-inner {
|
|
55
|
+
stroke: ${t.primaryColor};
|
|
56
|
+
fill: ${t.primaryColor};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.arrow { stroke-width: 8; stroke-linecap: round; fill: none}
|
|
60
|
+
.gitTitleText {
|
|
61
|
+
text-anchor: middle;
|
|
62
|
+
font-size: 18px;
|
|
63
|
+
fill: ${t.textColor};
|
|
64
|
+
}
|
|
65
|
+
`,"getStyles"),oe=se,fe={parser:Wr,db:X,renderer:ne,styles:oe};export{fe as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bA as T,bB as C,bC as z,bD as R,bE as S,bF as k,bG as V,bH as L,bI as K,bJ as j,bK as ee,bL as te,bM as re,bN as se,bO as ne,bP as ie,aC as ae,bQ as oe,bR as ue,bS as he,bT as y,bU as v,bV as $}from"./main-aGv85UbW.js";import{k as d,g as H,s as de,e as ce,f as fe,h as ge,j as le,d as be,l as _e,b as pe,m,n as g,r as ye}from"./_baseUniq-Da8Sle23.js";function me(t,e){return t&&T(e,d(e),t)}function je(t,e){return t&&T(e,C(e),t)}function Te(t,e){return T(t,H(t),e)}var Oe=Object.getOwnPropertySymbols,Y=Oe?function(t){for(var e=[];t;)ce(e,H(t)),t=z(t);return e}:de;function Ae(t,e){return T(t,Y(t),e)}function Ee(t){return fe(t,C,Y)}var Ce=Object.prototype,Le=Ce.hasOwnProperty;function we(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Le.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Ne(t,e){var r=e?R(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Fe=/\w*$/;function Pe(t){var e=new t.constructor(t.source,Fe.exec(t));return e.lastIndex=t.lastIndex,e}var I=S?S.prototype:void 0,D=I?I.valueOf:void 0;function Se(t){return D?Object(D.call(t)):{}}var ve="[object Boolean]",$e="[object Date]",Ie="[object Map]",De="[object Number]",Me="[object RegExp]",Ge="[object Set]",Ue="[object String]",xe="[object Symbol]",Be="[object ArrayBuffer]",Re="[object DataView]",Ve="[object Float32Array]",Ke="[object Float64Array]",He="[object Int8Array]",Ye="[object Int16Array]",qe="[object Int32Array]",Je="[object Uint8Array]",Qe="[object Uint8ClampedArray]",We="[object Uint16Array]",Xe="[object Uint32Array]";function Ze(t,e,r){var s=t.constructor;switch(e){case Be:return R(t);case ve:case $e:return new s(+t);case Re:return Ne(t,r);case Ve:case Ke:case He:case Ye:case qe:case Je:case Qe:case We:case Xe:return k(t,r);case Ie:return new s;case De:case Ue:return new s(t);case Me:return Pe(t);case Ge:return new s;case xe:return Se(t)}}var ze="[object Map]";function ke(t){return V(t)&&L(t)==ze}var M=j&&j.isMap,et=M?K(M):ke,tt="[object Set]";function rt(t){return V(t)&&L(t)==tt}var G=j&&j.isSet,st=G?K(G):rt,nt=1,it=2,at=4,q="[object Arguments]",ot="[object Array]",ut="[object Boolean]",ht="[object Date]",dt="[object Error]",J="[object Function]",ct="[object GeneratorFunction]",ft="[object Map]",gt="[object Number]",Q="[object Object]",lt="[object RegExp]",bt="[object Set]",_t="[object String]",pt="[object Symbol]",yt="[object WeakMap]",mt="[object ArrayBuffer]",jt="[object DataView]",Tt="[object Float32Array]",Ot="[object Float64Array]",At="[object Int8Array]",Et="[object Int16Array]",Ct="[object Int32Array]",Lt="[object Uint8Array]",wt="[object Uint8ClampedArray]",Nt="[object Uint16Array]",Ft="[object Uint32Array]",o={};o[q]=o[ot]=o[mt]=o[jt]=o[ut]=o[ht]=o[Tt]=o[Ot]=o[At]=o[Et]=o[Ct]=o[ft]=o[gt]=o[Q]=o[lt]=o[bt]=o[_t]=o[pt]=o[Lt]=o[wt]=o[Nt]=o[Ft]=!0;o[dt]=o[J]=o[yt]=!1;function O(t,e,r,s,n,a){var i,u=e&nt,h=e&it,X=e&at;if(i!==void 0)return i;if(!ee(t))return t;var w=ae(t);if(w){if(i=we(t),!u)return te(t,i)}else{var b=L(t),N=b==J||b==ct;if(re(t))return se(t,u);if(b==Q||b==q||N&&!n){if(i=h||N?{}:ne(t),!u)return h?Ae(t,je(i,t)):Te(t,me(i,t))}else{if(!o[b])return n?t:{};i=Ze(t,b,u)}}a||(a=new ie);var F=a.get(t);if(F)return F;a.set(t,i),st(t)?t.forEach(function(c){i.add(O(c,e,r,c,t,a))}):et(t)&&t.forEach(function(c,f){i.set(f,O(c,e,r,f,t,a))});var Z=X?h?Ee:le:h?C:d,P=w?void 0:Z(t);return ge(P||t,function(c,f){P&&(f=c,c=t[f]),oe(i,f,O(c,e,r,f,t,a))}),i}function Pt(t,e){return be(e,function(r){return t[r]})}function A(t){return t==null?[]:Pt(t,d(t))}function _(t){return t===void 0}var St=ue(function(t){return _e(pe(t,1,he,!0))}),vt="\0",l="\0",U="";class W{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=y(void 0),this._defaultEdgeLabelFn=y(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[l]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return v(e)||(e=y(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return d(this._nodes)}sources(){var e=this;return m(this.nodes(),function(r){return $(e._in[r])})}sinks(){var e=this;return m(this.nodes(),function(r){return $(e._out[r])})}setNodes(e,r){var s=arguments,n=this;return g(e,function(a){s.length>1?n.setNode(a,r):n.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=l,this._children[e]={},this._children[l][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],g(this.children(e),s=>{this.setParent(s)}),delete this._children[e]),g(d(this._in[e]),r),delete this._in[e],delete this._preds[e],g(d(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(_(r))r=l;else{r+="";for(var s=r;!_(s);s=this.parent(s))if(s===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==l)return r}}children(e){if(_(e)&&(e=l),this._isCompound){var r=this._children[e];if(r)return d(r)}else{if(e===l)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return d(r)}successors(e){var r=this._sucs[e];if(r)return d(r)}neighbors(e){var r=this.predecessors(e);if(r)return St(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var s=this;g(this._nodes,function(i,u){e(u)&&r.setNode(u,i)}),g(this._edgeObjs,function(i){r.hasNode(i.v)&&r.hasNode(i.w)&&r.setEdge(i,s.edge(i))});var n={};function a(i){var u=s.parent(i);return u===void 0||r.hasNode(u)?(n[i]=u,u):u in n?n[u]:a(u)}return this._isCompound&&g(r.nodes(),function(i){r.setParent(i,a(i))}),r}setDefaultEdgeLabel(e){return v(e)||(e=y(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return A(this._edgeObjs)}setPath(e,r){var s=this,n=arguments;return ye(e,function(a,i){return n.length>1?s.setEdge(a,i,r):s.setEdge(a,i),i}),this}setEdge(){var e,r,s,n,a=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(e=i.v,r=i.w,s=i.name,arguments.length===2&&(n=arguments[1],a=!0)):(e=i,r=arguments[1],s=arguments[3],arguments.length>2&&(n=arguments[2],a=!0)),e=""+e,r=""+r,_(s)||(s=""+s);var u=p(this._isDirected,e,r,s);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,u))return a&&(this._edgeLabels[u]=n),this;if(!_(s)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[u]=a?n:this._defaultEdgeLabelFn(e,r,s);var h=$t(this._isDirected,e,r,s);return e=h.v,r=h.w,Object.freeze(h),this._edgeObjs[u]=h,x(this._preds[r],e),x(this._sucs[e],r),this._in[r][u]=h,this._out[e][u]=h,this._edgeCount++,this}edge(e,r,s){var n=arguments.length===1?E(this._isDirected,arguments[0]):p(this._isDirected,e,r,s);return this._edgeLabels[n]}hasEdge(e,r,s){var n=arguments.length===1?E(this._isDirected,arguments[0]):p(this._isDirected,e,r,s);return Object.prototype.hasOwnProperty.call(this._edgeLabels,n)}removeEdge(e,r,s){var n=arguments.length===1?E(this._isDirected,arguments[0]):p(this._isDirected,e,r,s),a=this._edgeObjs[n];return a&&(e=a.v,r=a.w,delete this._edgeLabels[n],delete this._edgeObjs[n],B(this._preds[r],e),B(this._sucs[e],r),delete this._in[r][n],delete this._out[e][n],this._edgeCount--),this}inEdges(e,r){var s=this._in[e];if(s){var n=A(s);return r?m(n,function(a){return a.v===r}):n}}outEdges(e,r){var s=this._out[e];if(s){var n=A(s);return r?m(n,function(a){return a.w===r}):n}}nodeEdges(e,r){var s=this.inEdges(e,r);if(s)return s.concat(this.outEdges(e,r))}}W.prototype._nodeCount=0;W.prototype._edgeCount=0;function x(t,e){t[e]?t[e]++:t[e]=1}function B(t,e){--t[e]||delete t[e]}function p(t,e,r,s){var n=""+e,a=""+r;if(!t&&n>a){var i=n;n=a,a=i}return n+U+a+U+(_(s)?vt:s)}function $t(t,e,r,s){var n=""+e,a=""+r;if(!t&&n>a){var i=n;n=a,a=i}var u={v:n,w:a};return s&&(u.name=s),u}function E(t,e){return p(t,e.v,e.w,e.name)}export{W as G,O as b,_ as i,A as v};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var Mt=Object.defineProperty;var Zt=(e,t,r)=>t in e?Mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var B=(e,t,r)=>(Zt(e,typeof t!="symbol"?t+"":t,r),r);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function yt(e){return typeof e>"u"||e===null}function Pt(e){return typeof e=="object"&&e!==null}function Dt(e){return Array.isArray(e)?e:yt(e)?[]:[e]}function $t(e,t){var r,n,i,a;if(t)for(a=Object.keys(t),r=0,n=a.length;r<n;r+=1)i=a[r],e[i]=t[i];return e}function Bt(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function Vt(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Ut=yt,Yt=Pt,zt=Dt,qt=Bt,Wt=Vt,Gt=$t,j={isNothing:Ut,isObject:Yt,toArray:zt,repeat:qt,isNegativeZero:Wt,extend:Gt};function vt(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
2
|
+
|
|
3
|
+
`+e.mark.snippet),n+" "+r):n}function ue(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=vt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ue.prototype=Object.create(Error.prototype);ue.prototype.constructor=ue;ue.prototype.toString=function(t){return this.name+": "+vt(this,t)};var V=ue;function Te(e,t,r,n,i){var a="",s="",o=Math.floor(i/2)-1;return n-t>o&&(a=" ... ",t=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+e.slice(t,r).replace(/\t/g,"→")+s,pos:n-t+a.length}}function Oe(e,t){return j.repeat(" ",t-e.length)+e}function Kt(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(e.buffer);)i.push(a.index),n.push(a.index+a[0].length),e.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,c,u=Math.min(e.line+t.linesAfter,i.length).toString().length,f=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)c=Te(e.buffer,n[s-l],i[s-l],e.position-(n[s]-n[s-l]),f),o=j.repeat(" ",t.indent)+Oe((e.line-l+1).toString(),u)+" | "+c.str+`
|
|
4
|
+
`+o;for(c=Te(e.buffer,n[s],i[s],e.position,f),o+=j.repeat(" ",t.indent)+Oe((e.line+1).toString(),u)+" | "+c.str+`
|
|
5
|
+
`,o+=j.repeat("-",t.indent+u+3+c.pos)+`^
|
|
6
|
+
`,l=1;l<=t.linesAfter&&!(s+l>=i.length);l++)c=Te(e.buffer,n[s+l],i[s+l],e.position-(n[s]-n[s+l]),f),o+=j.repeat(" ",t.indent)+Oe((e.line+l+1).toString(),u)+" | "+c.str+`
|
|
7
|
+
`;return o.replace(/\n$/,"")}var Ht=Kt,Jt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Xt=["scalar","sequence","mapping"];function Qt(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function er(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Jt.indexOf(r)===-1)throw new V('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Qt(t.styleAliases||null),Xt.indexOf(this.kind)===-1)throw new V('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var R=er;function We(e,t){var r=[];return e[t].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}function tr(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function Ne(e){return this.extend(e)}Ne.prototype.extend=function(t){var r=[],n=[];if(t instanceof R)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new V("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(a){if(!(a instanceof R))throw new V("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new V("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new V("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(a){if(!(a instanceof R))throw new V("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Ne.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=We(i,"implicit"),i.compiledExplicit=We(i,"explicit"),i.compiledTypeMap=tr(i.compiledImplicit,i.compiledExplicit),i};var rr=Ne,nr=new R("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),ir=new R("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),ar=new R("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),sr=new rr({explicit:[nr,ir,ar]});function or(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function lr(){return null}function cr(e){return e===null}var ur=new R("tag:yaml.org,2002:null",{kind:"scalar",resolve:or,construct:lr,predicate:cr,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function dr(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function fr(e){return e==="true"||e==="True"||e==="TRUE"}function hr(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var pr=new R("tag:yaml.org,2002:bool",{kind:"scalar",resolve:dr,construct:fr,predicate:hr,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function mr(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function gr(e){return 48<=e&&e<=55}function yr(e){return 48<=e&&e<=57}function vr(e){if(e===null)return!1;var t=e.length,r=0,n=!1,i;if(!t)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===t)return!0;if(i=e[++r],i==="b"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!mr(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!gr(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<t;r++)if(i=e[r],i!=="_"){if(!yr(e.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}function _r(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function xr(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!j.isNegativeZero(e)}var kr=new R("tag:yaml.org,2002:int",{kind:"scalar",resolve:vr,construct:_r,predicate:xr,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),br=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function wr(e){return!(e===null||!br.test(e)||e[e.length-1]==="_")}function Ar(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var Cr=/^[-+]?[0-9]+e/;function Tr(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(j.isNegativeZero(e))return"-0.0";return r=e.toString(10),Cr.test(r)?r.replace("e",".e"):r}function Or(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||j.isNegativeZero(e))}var Sr=new R("tag:yaml.org,2002:float",{kind:"scalar",resolve:wr,construct:Ar,predicate:Or,represent:Tr,defaultStyle:"lowercase"}),Ir=sr.extend({implicit:[ur,pr,kr,Sr]}),Er=Ir,_t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),xt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Nr(e){return e===null?!1:_t.exec(e)!==null||xt.exec(e)!==null}function Rr(e){var t,r,n,i,a,s,o,l=0,c=null,u,f,b;if(t=_t.exec(e),t===null&&(t=xt.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,n,i));if(a=+t[4],s=+t[5],o=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],f=+(t[11]||0),c=(u*60+f)*6e4,t[9]==="-"&&(c=-c)),b=new Date(Date.UTC(r,n,i,a,s,o,l)),c&&b.setTime(b.getTime()-c),b}function jr(e){return e.toISOString()}var Lr=new R("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Nr,construct:Rr,instanceOf:Date,represent:jr});function Fr(e){return e==="<<"||e===null}var Mr=new R("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Fr}),$e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
8
|
+
\r`;function Zr(e){if(e===null)return!1;var t,r,n=0,i=e.length,a=$e;for(r=0;r<i;r++)if(t=a.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function Pr(e){var t,r,n=e.replace(/[\r\n=]/g,""),i=n.length,a=$e,s=0,o=[];for(t=0;t<i;t++)t%4===0&&t&&(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(t));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}function Dr(e){var t="",r=0,n,i,a=e.length,s=$e;for(n=0;n<a;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return i=a%3,i===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):i===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):i===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function $r(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Br=new R("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Zr,construct:Pr,predicate:$r,represent:Dr}),Vr=Object.prototype.hasOwnProperty,Ur=Object.prototype.toString;function Yr(e){if(e===null)return!0;var t=[],r,n,i,a,s,o=e;for(r=0,n=o.length;r<n;r+=1){if(i=o[r],s=!1,Ur.call(i)!=="[object Object]")return!1;for(a in i)if(Vr.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function zr(e){return e!==null?e:[]}var qr=new R("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Yr,construct:zr}),Wr=Object.prototype.toString;function Gr(e){if(e===null)return!0;var t,r,n,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],Wr.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;a[t]=[i[0],n[i[0]]]}return!0}function Kr(e){if(e===null)return[];var t,r,n,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],i=Object.keys(n),a[t]=[i[0],n[i[0]]];return a}var Hr=new R("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Gr,construct:Kr}),Jr=Object.prototype.hasOwnProperty;function Xr(e){if(e===null)return!0;var t,r=e;for(t in r)if(Jr.call(r,t)&&r[t]!==null)return!1;return!0}function Qr(e){return e!==null?e:{}}var en=new R("tag:yaml.org,2002:set",{kind:"mapping",resolve:Xr,construct:Qr}),tn=Er.extend({implicit:[Lr,Mr],explicit:[Br,qr,Hr,en]}),G=Object.prototype.hasOwnProperty,me=1,kt=2,bt=3,ge=4,Se=1,rn=2,Ge=3,nn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,an=/[\x85\u2028\u2029]/,sn=/[,\[\]\{\}]/,wt=/^(?:!|!!|![a-z\-]+!)$/i,At=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ke(e){return Object.prototype.toString.call(e)}function P(e){return e===10||e===13}function J(e){return e===9||e===32}function F(e){return e===9||e===32||e===10||e===13}function te(e){return e===44||e===91||e===93||e===123||e===125}function on(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function ln(e){return e===120?2:e===117?4:e===85?8:0}function cn(e){return 48<=e&&e<=57?e-48:-1}function He(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
9
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function un(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Ct=new Array(256),Tt=new Array(256);for(var Q=0;Q<256;Q++)Ct[Q]=He(Q)?1:0,Tt[Q]=He(Q);function dn(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||tn,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ot(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=Ht(r),new V(t,r)}function y(e,t){throw Ot(e,t)}function ye(e,t){e.onWarning&&e.onWarning.call(null,Ot(e,t))}var Je={YAML:function(t,r,n){var i,a,s;t.version!==null&&y(t,"duplication of %YAML directive"),n.length!==1&&y(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&y(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&y(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&ye(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var i,a;n.length!==2&&y(t,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],wt.test(i)||y(t,"ill-formed tag handle (first argument) of the TAG directive"),G.call(t.tagMap,i)&&y(t,'there is a previously declared suffix for "'+i+'" tag handle'),At.test(a)||y(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{y(t,"tag prefix is malformed: "+a)}t.tagMap[i]=a}};function q(e,t,r,n){var i,a,s,o;if(t<r){if(o=e.input.slice(t,r),n)for(i=0,a=o.length;i<a;i+=1)s=o.charCodeAt(i),s===9||32<=s&&s<=1114111||y(e,"expected valid JSON character");else nn.test(o)&&y(e,"the stream contains non-printable characters");e.result+=o}}function Xe(e,t,r,n){var i,a,s,o;for(j.isObject(r)||y(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),s=0,o=i.length;s<o;s+=1)a=i[s],G.call(t,a)||(t[a]=r[a],n[a]=!0)}function re(e,t,r,n,i,a,s,o,l){var c,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,u=i.length;c<u;c+=1)Array.isArray(i[c])&&y(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Ke(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&Ke(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(c=0,u=a.length;c<u;c+=1)Xe(e,t,a[c],r);else Xe(e,t,a,r);else!e.json&&!G.call(r,i)&&G.call(t,i)&&(e.line=s||e.line,e.lineStart=o||e.lineStart,e.position=l||e.position,y(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):t[i]=a,delete r[i];return t}function Be(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):y(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function I(e,t,r){for(var n=0,i=e.input.charCodeAt(e.position);i!==0;){for(;J(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(P(i))for(Be(e),i=e.input.charCodeAt(e.position),n++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&ye(e,"deficient indentation"),n}function Ae(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||F(r)))}function Ve(e,t){t===1?e.result+=" ":t>1&&(e.result+=j.repeat(`
|
|
10
|
+
`,t-1))}function fn(e,t,r){var n,i,a,s,o,l,c,u,f=e.kind,b=e.result,p;if(p=e.input.charCodeAt(e.position),F(p)||te(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),F(i)||r&&te(i)))return!1;for(e.kind="scalar",e.result="",a=s=e.position,o=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),F(i)||r&&te(i))break}else if(p===35){if(n=e.input.charCodeAt(e.position-1),F(n))break}else{if(e.position===e.lineStart&&Ae(e)||r&&te(p))break;if(P(p))if(l=e.line,c=e.lineStart,u=e.lineIndent,I(e,!1,-1),e.lineIndent>=t){o=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=c,e.lineIndent=u;break}}o&&(q(e,a,s,!1),Ve(e,e.line-l),a=s=e.position,o=!1),J(p)||(s=e.position+1),p=e.input.charCodeAt(++e.position)}return q(e,a,s,!1),e.result?!0:(e.kind=f,e.result=b,!1)}function hn(e,t){var r,n,i;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(q(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,i=e.position;else return!0;else P(r)?(q(e,n,i,!0),Ve(e,I(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Ae(e)?y(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);y(e,"unexpected end of the stream within a single quoted scalar")}function pn(e,t){var r,n,i,a,s,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return q(e,r,e.position,!0),e.position++,!0;if(o===92){if(q(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),P(o))I(e,!1,t);else if(o<256&&Ct[o])e.result+=Tt[o],e.position++;else if((s=ln(o))>0){for(i=s,a=0;i>0;i--)o=e.input.charCodeAt(++e.position),(s=on(o))>=0?a=(a<<4)+s:y(e,"expected hexadecimal character");e.result+=un(a),e.position++}else y(e,"unknown escape sequence");r=n=e.position}else P(o)?(q(e,r,n,!0),Ve(e,I(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Ae(e)?y(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}y(e,"unexpected end of the stream within a double quoted scalar")}function mn(e,t){var r=!0,n,i,a,s=e.tag,o,l=e.anchor,c,u,f,b,p,A=Object.create(null),O,T,E,k;if(k=e.input.charCodeAt(e.position),k===91)u=93,p=!1,o=[];else if(k===123)u=125,p=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),k=e.input.charCodeAt(++e.position);k!==0;){if(I(e,!0,t),k=e.input.charCodeAt(e.position),k===u)return e.position++,e.tag=s,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=o,!0;r?k===44&&y(e,"expected the node content, but found ','"):y(e,"missed comma between flow collection entries"),T=O=E=null,f=b=!1,k===63&&(c=e.input.charCodeAt(e.position+1),F(c)&&(f=b=!0,e.position++,I(e,!0,t))),n=e.line,i=e.lineStart,a=e.position,ne(e,t,me,!1,!0),T=e.tag,O=e.result,I(e,!0,t),k=e.input.charCodeAt(e.position),(b||e.line===n)&&k===58&&(f=!0,k=e.input.charCodeAt(++e.position),I(e,!0,t),ne(e,t,me,!1,!0),E=e.result),p?re(e,o,A,T,O,E,n,i,a):f?o.push(re(e,null,A,T,O,E,n,i,a)):o.push(O),I(e,!0,t),k=e.input.charCodeAt(e.position),k===44?(r=!0,k=e.input.charCodeAt(++e.position)):r=!1}y(e,"unexpected end of the stream within a flow collection")}function gn(e,t){var r,n,i=Se,a=!1,s=!1,o=t,l=0,c=!1,u,f;if(f=e.input.charCodeAt(e.position),f===124)n=!1;else if(f===62)n=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)Se===i?i=f===43?Ge:rn:y(e,"repeat of a chomping mode identifier");else if((u=cn(f))>=0)u===0?y(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?y(e,"repeat of an indentation width identifier"):(o=t+u-1,s=!0);else break;if(J(f)){do f=e.input.charCodeAt(++e.position);while(J(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!P(f)&&f!==0)}for(;f!==0;){for(Be(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<o)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>o&&(o=e.lineIndent),P(f)){l++;continue}if(e.lineIndent<o){i===Ge?e.result+=j.repeat(`
|
|
11
|
+
`,a?1+l:l):i===Se&&a&&(e.result+=`
|
|
12
|
+
`);break}for(n?J(f)?(c=!0,e.result+=j.repeat(`
|
|
13
|
+
`,a?1+l:l)):c?(c=!1,e.result+=j.repeat(`
|
|
14
|
+
`,l+1)):l===0?a&&(e.result+=" "):e.result+=j.repeat(`
|
|
15
|
+
`,l):e.result+=j.repeat(`
|
|
16
|
+
`,a?1+l:l),a=!0,s=!0,l=0,r=e.position;!P(f)&&f!==0;)f=e.input.charCodeAt(++e.position);q(e,r,e.position,!1)}return!0}function Qe(e,t){var r,n=e.tag,i=e.anchor,a=[],s,o=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,y(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!F(s))));){if(o=!0,e.position++,I(e,!0,-1)&&e.lineIndent<=t){a.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,ne(e,t,bt,!1,!0),a.push(e.result),I(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)y(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=n,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function yn(e,t,r){var n,i,a,s,o,l,c=e.tag,u=e.anchor,f={},b=Object.create(null),p=null,A=null,O=null,T=!1,E=!1,k;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),k=e.input.charCodeAt(e.position);k!==0;){if(!T&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,y(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),a=e.line,(k===63||k===58)&&F(n))k===63?(T&&(re(e,f,b,p,A,null,s,o,l),p=A=O=null),E=!0,T=!0,i=!0):T?(T=!1,i=!0):y(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,k=n;else{if(s=e.line,o=e.lineStart,l=e.position,!ne(e,r,kt,!1,!0))break;if(e.line===a){for(k=e.input.charCodeAt(e.position);J(k);)k=e.input.charCodeAt(++e.position);if(k===58)k=e.input.charCodeAt(++e.position),F(k)||y(e,"a whitespace character is expected after the key-value separator within a block mapping"),T&&(re(e,f,b,p,A,null,s,o,l),p=A=O=null),E=!0,T=!1,i=!1,p=e.tag,A=e.result;else if(E)y(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=u,!0}else if(E)y(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=u,!0}if((e.line===a||e.lineIndent>t)&&(T&&(s=e.line,o=e.lineStart,l=e.position),ne(e,t,ge,!0,i)&&(T?A=e.result:O=e.result),T||(re(e,f,b,p,A,O,s,o,l),p=A=O=null),I(e,!0,-1),k=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&k!==0)y(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return T&&re(e,f,b,p,A,null,s,o,l),E&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=f),E}function vn(e){var t,r=!1,n=!1,i,a,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&y(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,i="!!",s=e.input.charCodeAt(++e.position)):i="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(a=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):y(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!F(s);)s===33&&(n?y(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),wt.test(i)||y(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),sn.test(a)&&y(e,"tag suffix cannot contain flow indicator characters")}a&&!At.test(a)&&y(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{y(e,"tag name is malformed: "+a)}return r?e.tag=a:G.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:y(e,'undeclared tag handle "'+i+'"'),!0}function _n(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&y(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!F(r)&&!te(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&y(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function xn(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!F(n)&&!te(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&y(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),G.call(e.anchorMap,r)||y(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],I(e,!0,-1),!0}function ne(e,t,r,n,i){var a,s,o,l=1,c=!1,u=!1,f,b,p,A,O,T;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=o=ge===r||bt===r,n&&I(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;vn(e)||_n(e);)I(e,!0,-1)?(c=!0,o=a,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):o=!1;if(o&&(o=c||i),(l===1||ge===r)&&(me===r||kt===r?O=t:O=t+1,T=e.position-e.lineStart,l===1?o&&(Qe(e,T)||yn(e,T,O))||mn(e,O)?u=!0:(s&&gn(e,O)||hn(e,O)||pn(e,O)?u=!0:xn(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&y(e,"alias node should not have any properties")):fn(e,O,me===r)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=o&&Qe(e,T))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&y(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,b=e.implicitTypes.length;f<b;f+=1)if(A=e.implicitTypes[f],A.resolve(e.result)){e.result=A.construct(e.result),e.tag=A.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(G.call(e.typeMap[e.kind||"fallback"],e.tag))A=e.typeMap[e.kind||"fallback"][e.tag];else for(A=null,p=e.typeMap.multi[e.kind||"fallback"],f=0,b=p.length;f<b;f+=1)if(e.tag.slice(0,p[f].tag.length)===p[f].tag){A=p[f];break}A||y(e,"unknown tag !<"+e.tag+">"),e.result!==null&&A.kind!==e.kind&&y(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+A.kind+'", not "'+e.kind+'"'),A.resolve(e.result,e.tag)?(e.result=A.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):y(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function kn(e){var t=e.position,r,n,i,a=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(I(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(a=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!F(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),i=[],n.length<1&&y(e,"directive name must not be less than one character in length");s!==0;){for(;J(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!P(s));break}if(P(s))break;for(r=e.position;s!==0&&!F(s);)s=e.input.charCodeAt(++e.position);i.push(e.input.slice(r,e.position))}s!==0&&Be(e),G.call(Je,n)?Je[n](e,n,i):ye(e,'unknown document directive "'+n+'"')}if(I(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,I(e,!0,-1)):a&&y(e,"directives end mark is expected"),ne(e,e.lineIndent-1,ge,!1,!0),I(e,!0,-1),e.checkLineBreaks&&an.test(e.input.slice(t,e.position))&&ye(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ae(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,I(e,!0,-1));return}if(e.position<e.length-1)y(e,"end of the stream or a document separator is expected");else return}function bn(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
17
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new dn(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,y(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)kn(r);return r.documents}function wn(e,t){var r=bn(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new V("expected a single document in the stream, but found more")}}var An=wn,Cn={load:An},Tn=Cn.load,C;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},e.find=(i,a)=>{for(const s of i)if(a(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(C||(C={}));var et;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(et||(et={}));const m=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z=e=>{switch(typeof e){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(e)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(e)?m.array:e===null?m.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?m.promise:typeof Map<"u"&&e instanceof Map?m.map:typeof Set<"u"&&e instanceof Set?m.set:typeof Date<"u"&&e instanceof Date?m.date:m.object;default:return m.unknown}},d=C.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Y extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let o=n,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(r(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),n}static assert(t){if(!(t instanceof Y))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];r[a]=r[a]||[],r[a].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Y.create=e=>new Y(e);const Re=(e,t)=>{let r;switch(e.code){case d.invalid_type:e.received===m.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case d.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,C.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:r=`Unrecognized key(s) in object: ${C.joinValues(e.keys,", ")}`;break;case d.invalid_union:r="Invalid input";break;case d.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${C.joinValues(e.options)}`;break;case d.invalid_enum_value:r=`Invalid enum value. Expected ${C.joinValues(e.options)}, received '${e.received}'`;break;case d.invalid_arguments:r="Invalid function arguments";break;case d.invalid_return_type:r="Invalid function return type";break;case d.invalid_date:r="Invalid date";break;case d.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:C.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case d.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case d.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case d.custom:r="Invalid input";break;case d.invalid_intersection_types:r="Intersection results could not be merged";break;case d.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case d.not_finite:r="Number must be finite";break;default:r=t.defaultError,C.assertNever(e)}return{message:r}};let On=Re;function Sn(){return On}const In=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:t,defaultError:o}).message;return{...i,path:a,message:o}};function h(e,t){const r=Sn(),n=In({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Re?void 0:Re].filter(i=>!!i)});e.common.issues.push(n)}class L{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return _;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const a=await i.key,s=await i.value;n.push({key:a,value:s})}return L.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return _;a.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:t.value,value:n}}}const _=Object.freeze({status:"aborted"}),le=e=>({status:"dirty",value:e}),M=e=>({status:"valid",value:e}),tt=e=>e.status==="aborted",rt=e=>e.status==="dirty",ie=e=>e.status==="valid",ve=e=>typeof Promise<"u"&&e instanceof Promise;var g;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(g||(g={}));class ${constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const nt=(e,t)=>{if(ie(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Y(e.common.issues);return this._error=r,this._error}}};function x(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,o)=>{const{message:l}=e;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??r??o.defaultError}},description:i}}class w{get description(){return this._def.description}_getType(t){return z(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:z(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new L,ctx:{common:t.parent.common,data:t.data,parsedType:z(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(ve(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:z(t)},i=this._parseSync({data:t,path:n.path,parent:n});return nt(n,i)}"~validate"(t){var n,i;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:z(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:r});return ie(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(i=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(a=>ie(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:z(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(ve(i)?i:Promise.resolve(i));return nt(n,a)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const s=t(i),o=()=>a.addIssue({code:d.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new se({schema:this,typeName:v.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return W.create(this,this._def)}nullable(){return oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return D.create(this)}promise(){return we.create(this,this._def)}or(t){return xe.create([this,t],this._def)}and(t){return ke.create(this,t,this._def)}transform(t){return new se({...x(this._def),schema:this,typeName:v.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Fe({...x(this._def),innerType:this,defaultValue:r,typeName:v.ZodDefault})}brand(){return new Xn({typeName:v.ZodBranded,type:this,...x(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Me({...x(this._def),innerType:this,catchValue:r,typeName:v.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Ue.create(this,t)}readonly(){return Ze.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const En=/^c[^\s-]{8,}$/i,Nn=/^[0-9a-z]+$/,Rn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jn=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ln=/^[a-z0-9_-]{21}$/i,Fn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Mn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Zn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ie;const Dn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$n=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Bn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Vn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Un=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,St="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",zn=new RegExp(`^${St}$`);function It(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function qn(e){return new RegExp(`^${It(e)}$`)}function Wn(e){let t=`${St}T${It(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Gn(e,t){return!!((t==="v4"||!t)&&Dn.test(e)||(t==="v6"||!t)&&Bn.test(e))}function Kn(e,t){if(!Fn.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function Hn(e,t){return!!((t==="v4"||!t)&&$n.test(e)||(t==="v6"||!t)&&Vn.test(e))}class U extends w{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==m.string){const a=this._getOrReturnCtx(t);return h(a,{code:d.invalid_type,expected:m.string,received:a.parsedType}),_}const n=new L;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),h(i,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),h(i,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const s=t.data.length>a.value,o=t.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(t,i),s?h(i,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&h(i,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Zn.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"email",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ie||(Ie=new RegExp(Pn,"u")),Ie.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"emoji",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")jn.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"uuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Ln.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"nanoid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")En.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"cuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Nn.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"cuid2",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Rn.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"ulid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),h(i,{validation:"url",code:d.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"regex",code:d.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),h(i,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),h(i,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),h(i,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Wn(a).test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{code:d.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?zn.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{code:d.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?qn(a).test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{code:d.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Mn.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"duration",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Gn(t.data,a.version)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"ip",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?Kn(t.data,a.alg)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"jwt",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?Hn(t.data,a.version)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"cidr",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Un.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"base64",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Yn.test(t.data)||(i=this._getOrReturnCtx(t,i),h(i,{validation:"base64url",code:d.invalid_string,message:a.message}),n.dirty()):C.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:d.invalid_string,...g.errToObj(n)})}_addCheck(t){return new U({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...g.errToObj(t)})}url(t){return this._addCheck({kind:"url",...g.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...g.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...g.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...g.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...g.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...g.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...g.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...g.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...g.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...g.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...g.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...g.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...g.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...g.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...g.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...g.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...g.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...g.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...g.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...g.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...g.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...g.errToObj(r)})}nonempty(t){return this.min(1,g.errToObj(t))}trim(){return new U({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}U.create=e=>new U({checks:[],typeName:v.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...x(e)});function Jn(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}class de extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==m.number){const a=this._getOrReturnCtx(t);return h(a,{code:d.invalid_type,expected:m.number,received:a.parsedType}),_}let n;const i=new L;for(const a of this._def.checks)a.kind==="int"?C.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),h(n,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),h(n,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),h(n,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Jn(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),h(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),h(n,{code:d.not_finite,message:a.message}),i.dirty()):C.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,i){return new de({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new de({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:g.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:g.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&C.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}de.create=e=>new de({checks:[],typeName:v.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...x(e)});class fe extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==m.bigint)return this._getInvalidInput(t);let n;const i=new L;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),h(n,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),h(n,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),h(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):C.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return h(r,{code:d.invalid_type,expected:m.bigint,received:r.parsedType}),_}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,i){return new fe({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new fe({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}fe.create=e=>new fe({checks:[],typeName:v.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...x(e)});class it extends w{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==m.boolean){const n=this._getOrReturnCtx(t);return h(n,{code:d.invalid_type,expected:m.boolean,received:n.parsedType}),_}return M(t.data)}}it.create=e=>new it({typeName:v.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...x(e)});class _e extends w{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==m.date){const a=this._getOrReturnCtx(t);return h(a,{code:d.invalid_type,expected:m.date,received:a.parsedType}),_}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return h(a,{code:d.invalid_date}),_}const n=new L;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),h(i,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),h(i,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):C.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new _e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:g.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:g.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}_e.create=e=>new _e({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:v.ZodDate,...x(e)});class at extends w{_parse(t){if(this._getType(t)!==m.symbol){const n=this._getOrReturnCtx(t);return h(n,{code:d.invalid_type,expected:m.symbol,received:n.parsedType}),_}return M(t.data)}}at.create=e=>new at({typeName:v.ZodSymbol,...x(e)});class st extends w{_parse(t){if(this._getType(t)!==m.undefined){const n=this._getOrReturnCtx(t);return h(n,{code:d.invalid_type,expected:m.undefined,received:n.parsedType}),_}return M(t.data)}}st.create=e=>new st({typeName:v.ZodUndefined,...x(e)});class ot extends w{_parse(t){if(this._getType(t)!==m.null){const n=this._getOrReturnCtx(t);return h(n,{code:d.invalid_type,expected:m.null,received:n.parsedType}),_}return M(t.data)}}ot.create=e=>new ot({typeName:v.ZodNull,...x(e)});class lt extends w{constructor(){super(...arguments),this._any=!0}_parse(t){return M(t.data)}}lt.create=e=>new lt({typeName:v.ZodAny,...x(e)});class je extends w{constructor(){super(...arguments),this._unknown=!0}_parse(t){return M(t.data)}}je.create=e=>new je({typeName:v.ZodUnknown,...x(e)});class K extends w{_parse(t){const r=this._getOrReturnCtx(t);return h(r,{code:d.invalid_type,expected:m.never,received:r.parsedType}),_}}K.create=e=>new K({typeName:v.ZodNever,...x(e)});class ct extends w{_parse(t){if(this._getType(t)!==m.undefined){const n=this._getOrReturnCtx(t);return h(n,{code:d.invalid_type,expected:m.void,received:n.parsedType}),_}return M(t.data)}}ct.create=e=>new ct({typeName:v.ZodVoid,...x(e)});class D extends w{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==m.array)return h(r,{code:d.invalid_type,expected:m.array,received:r.parsedType}),_;if(i.exactLength!==null){const s=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(s||o)&&(h(r,{code:s?d.too_big:d.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(h(r,{code:d.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(h(r,{code:d.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,o)=>i.type._parseAsync(new $(r,s,r.path,o)))).then(s=>L.mergeArray(n,s));const a=[...r.data].map((s,o)=>i.type._parseSync(new $(r,s,r.path,o)));return L.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new D({...this._def,minLength:{value:t,message:g.toString(r)}})}max(t,r){return new D({...this._def,maxLength:{value:t,message:g.toString(r)}})}length(t,r){return new D({...this._def,exactLength:{value:t,message:g.toString(r)}})}nonempty(t){return this.min(1,t)}}D.create=(e,t)=>new D({type:e,minLength:null,maxLength:null,exactLength:null,typeName:v.ZodArray,...x(t)});function ee(e){if(e instanceof S){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=W.create(ee(n))}return new S({...e._def,shape:()=>t})}else return e instanceof D?new D({...e._def,type:ee(e.element)}):e instanceof W?W.create(ee(e.unwrap())):e instanceof oe?oe.create(ee(e.unwrap())):e instanceof X?X.create(e.items.map(t=>ee(t))):e}class S extends w{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=C.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==m.object){const c=this._getOrReturnCtx(t);return h(c,{code:d.invalid_type,expected:m.object,received:c.parsedType}),_}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||o.push(c);const l=[];for(const c of s){const u=a[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new $(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof K){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")o.length>0&&(h(i,{code:d.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new $(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,b=await u.value;c.push({key:f,value:b,alwaysSet:u.alwaysSet})}return c}).then(c=>L.mergeObjectSync(n,c)):L.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return g.errToObj,new S({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,s;const i=((s=(a=this._def).errorMap)==null?void 0:s.call(a,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:g.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new S({...this._def,unknownKeys:"strip"})}passthrough(){return new S({...this._def,unknownKeys:"passthrough"})}extend(t){return new S({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new S({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:v.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new S({...this._def,catchall:t})}pick(t){const r={};for(const n of C.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new S({...this._def,shape:()=>r})}omit(t){const r={};for(const n of C.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new S({...this._def,shape:()=>r})}deepPartial(){return ee(this)}partial(t){const r={};for(const n of C.objectKeys(this.shape)){const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new S({...this._def,shape:()=>r})}required(t){const r={};for(const n of C.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof W;)a=a._def.innerType;r[n]=a}return new S({...this._def,shape:()=>r})}keyof(){return Et(C.objectKeys(this.shape))}}S.create=(e,t)=>new S({shape:()=>e,unknownKeys:"strip",catchall:K.create(),typeName:v.ZodObject,...x(t)});S.strictCreate=(e,t)=>new S({shape:()=>e,unknownKeys:"strict",catchall:K.create(),typeName:v.ZodObject,...x(t)});S.lazycreate=(e,t)=>new S({shape:e,unknownKeys:"strip",catchall:K.create(),typeName:v.ZodObject,...x(t)});class xe extends w{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(o=>new Y(o.ctx.common.issues));return h(r,{code:d.invalid_union,unionErrors:s}),_}if(r.common.async)return Promise.all(n.map(async a=>{const s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const l of n){const c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(l=>new Y(l));return h(r,{code:d.invalid_union,unionErrors:o}),_}}get options(){return this._def.options}}xe.create=(e,t)=>new xe({options:e,typeName:v.ZodUnion,...x(t)});function Le(e,t){const r=z(e),n=z(t);if(e===t)return{valid:!0,data:e};if(r===m.object&&n===m.object){const i=C.objectKeys(t),a=C.objectKeys(e).filter(o=>i.indexOf(o)!==-1),s={...e,...t};for(const o of a){const l=Le(e[o],t[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(r===m.array&&n===m.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a<e.length;a++){const s=e[a],o=t[a],l=Le(s,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return r===m.date&&n===m.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ke extends w{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=(a,s)=>{if(tt(a)||tt(s))return _;const o=Le(a.value,s.value);return o.valid?((rt(a)||rt(s))&&r.dirty(),{status:r.value,value:o.data}):(h(n,{code:d.invalid_intersection_types}),_)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ke.create=(e,t,r)=>new ke({left:e,right:t,typeName:v.ZodIntersection,...x(r)});class X extends w{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.array)return h(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),_;if(n.data.length<this._def.items.length)return h(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&n.data.length>this._def.items.length&&(h(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new $(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(a).then(s=>L.mergeArray(r,s)):L.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new X({...this._def,rest:t})}}X.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new X({items:e,typeName:v.ZodTuple,rest:null,...x(t)})};class be extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.object)return h(n,{code:d.invalid_type,expected:m.object,received:n.parsedType}),_;const i=[],a=this._def.keyType,s=this._def.valueType;for(const o in n.data)i.push({key:a._parse(new $(n,o,n.path,o)),value:s._parse(new $(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?L.mergeObjectAsync(r,i):L.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof w?new be({keyType:t,valueType:r,typeName:v.ZodRecord,...x(n)}):new be({keyType:U.create(),valueType:t,typeName:v.ZodRecord,...x(r)})}}class ut extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.map)return h(n,{code:d.invalid_type,expected:m.map,received:n.parsedType}),_;const i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([o,l],c)=>({key:i._parse(new $(n,o,n.path,[c,"key"])),value:a._parse(new $(n,l,n.path,[c,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return _;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return _;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}}}}ut.create=(e,t,r)=>new ut({valueType:t,keyType:e,typeName:v.ZodMap,...x(r)});class he extends w{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.set)return h(n,{code:d.invalid_type,expected:m.set,received:n.parsedType}),_;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(h(n,{code:d.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(h(n,{code:d.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return _;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const o=[...n.data.values()].map((l,c)=>a._parse(new $(n,l,n.path,c)));return n.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(t,r){return new he({...this._def,minSize:{value:t,message:g.toString(r)}})}max(t,r){return new he({...this._def,maxSize:{value:t,message:g.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}he.create=(e,t)=>new he({valueType:e,minSize:null,maxSize:null,typeName:v.ZodSet,...x(t)});class dt extends w{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}dt.create=(e,t)=>new dt({getter:e,typeName:v.ZodLazy,...x(t)});class ft extends w{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return h(r,{received:r.data,code:d.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:t.data}}get value(){return this._def.value}}ft.create=(e,t)=>new ft({value:e,typeName:v.ZodLiteral,...x(t)});function Et(e,t){return new ae({values:e,typeName:v.ZodEnum,...x(t)})}class ae extends w{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return h(r,{expected:C.joinValues(n),received:r.parsedType,code:d.invalid_type}),_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return h(r,{received:r.data,code:d.invalid_enum_value,options:n}),_}return M(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ae.create(t,{...this._def,...r})}exclude(t,r=this._def){return ae.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ae.create=Et;class ht extends w{_parse(t){const r=C.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==m.string&&n.parsedType!==m.number){const i=C.objectValues(r);return h(n,{expected:C.joinValues(i),received:n.parsedType,code:d.invalid_type}),_}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=C.objectValues(r);return h(n,{received:n.data,code:d.invalid_enum_value,options:i}),_}return M(t.data)}get enum(){return this._def.values}}ht.create=(e,t)=>new ht({values:e,typeName:v.ZodNativeEnum,...x(t)});class we extends w{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==m.promise&&r.common.async===!1)return h(r,{code:d.invalid_type,expected:m.promise,received:r.parsedType}),_;const n=r.parsedType===m.promise?r.data:Promise.resolve(r.data);return M(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}we.create=(e,t)=>new we({type:e,typeName:v.ZodPromise,...x(t)});class se extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===v.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:s=>{h(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(n.data,a);if(n.common.async)return Promise.resolve(s).then(async o=>{if(r.value==="aborted")return _;const l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?_:l.status==="dirty"||r.value==="dirty"?le(l.value):l});{if(r.value==="aborted")return _;const o=this._def.schema._parseSync({data:s,path:n.path,parent:n});return o.status==="aborted"?_:o.status==="dirty"||r.value==="dirty"?le(o.value):o}}if(i.type==="refinement"){const s=o=>{const l=i.refinement(o,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?_:(o.status==="dirty"&&r.dirty(),s(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?_:(o.status==="dirty"&&r.dirty(),s(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ie(s))return _;const o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>ie(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:r.value,value:o})):_);C.assertNever(i)}}se.create=(e,t,r)=>new se({schema:e,typeName:v.ZodEffects,effect:t,...x(r)});se.createWithPreprocess=(e,t,r)=>new se({schema:t,effect:{type:"preprocess",transform:e},typeName:v.ZodEffects,...x(r)});class W extends w{_parse(t){return this._getType(t)===m.undefined?M(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}W.create=(e,t)=>new W({innerType:e,typeName:v.ZodOptional,...x(t)});class oe extends w{_parse(t){return this._getType(t)===m.null?M(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}oe.create=(e,t)=>new oe({innerType:e,typeName:v.ZodNullable,...x(t)});class Fe extends w{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Fe.create=(e,t)=>new Fe({innerType:e,typeName:v.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...x(t)});class Me extends w{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ve(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Y(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Y(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Me.create=(e,t)=>new Me({innerType:e,typeName:v.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...x(t)});class pt extends w{_parse(t){if(this._getType(t)!==m.nan){const n=this._getOrReturnCtx(t);return h(n,{code:d.invalid_type,expected:m.nan,received:n.parsedType}),_}return{status:"valid",value:t.data}}}pt.create=e=>new pt({typeName:v.ZodNaN,...x(e)});class Xn extends w{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Ue extends w{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?_:a.status==="dirty"?(r.dirty(),le(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?_:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new Ue({in:t,out:r,typeName:v.ZodPipeline})}}class Ze extends w{_parse(t){const r=this._def.innerType._parse(t),n=i=>(ie(i)&&(i.value=Object.freeze(i.value)),i);return ve(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:v.ZodReadonly,...x(t)});var v;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(v||(v={}));const N=U.create,Z=je.create;K.create;const pe=D.create,H=S.create,Nt=xe.create;ke.create;X.create;const ce=be.create;ae.create;we.create;W.create;oe.create;var Pe=class extends Error{constructor(e,t){let r=t.length>0?` Available: ${t.join(", ")}`:"";super(`Agent not found: "${e}".${r}`),this.name="AgentNotFoundError"}},Qn={claude:{id:"claude",provider:"cli/claude"},gemini:{id:"gemini",provider:"cli/gemini"},copilot:{id:"copilot",provider:"cli/copilot"},codex:{id:"codex",provider:"cli/codex"}};function mt(e,t){let r=e.startsWith("@")?e.slice(1):e,n=t.find(a=>a.id===r);if(n)return n;let i=Qn[r];if(i)return i;throw new Pe(e,t.map(a=>a.id))}var De=class extends Error{constructor(t,r){super(t);B(this,"providerStr");this.providerStr=r,this.name="ProviderError"}},Rt=new Map;function ei(e,t){Rt.set(e,t)}function gt(e){let t=e.split("/");if(t.length!==2)throw new De(`Invalid provider format: "${e}". Expected namespace/id (e.g., api/webllm)`,e);let[r,n]=t,i=Rt.get(r);if(i)return i(n,e);throw new De(`Unsupported provider namespace: "${r}". Register a factory with registerProviderFactory('${r}', factory).`,e)}var ti=new Function("u","return import(u)"),ci=class jt{constructor(t,r){B(this,"_agents");B(this,"_config");B(this,"_tools",new Map);B(this,"_apiProviders",new Map);this._agents=new Map(t.map(n=>[n.id,n])),this._config=r}static async fromConfig(t,r){let n=new jt(t.agents??[],t),i=t.agents??[],a=l=>Array.isArray(l.provider)?l.provider[0]:l.provider,s=i.filter(l=>a(l)==="api/webllm"),o=i.filter(l=>a(l)==="api/openrouter");if(s.length>0&&await n._initWebLLM(s,r==null?void 0:r.onProgress),o.length>0){if(!(r!=null&&r.openrouterApiKey))throw new Error("openrouterApiKey is required when using api/openrouter provider");n._initOpenRouter(o,r.openrouterApiKey)}return n._apiProviders.size>0&&ei("api",(l,c)=>{let u=n._apiProviders.get(l);if(!u)throw new De(`Unknown api provider: ${l}`,c);return u}),n}async _initWebLLM(t,r){var o,l;if(typeof navigator>"u"||!navigator.gpu)throw new Error("WebGPU is not available. Chrome 113+ or Edge 113+ required.");let n=await ti("https://esm.run/@mlc-ai/web-llm"),i=((l=(o=t[0])==null?void 0:o.inline)==null?void 0:l.model)??"gemma-2-2b-it-q4f16_1-MLC",a=await n.CreateMLCEngine(i,{initProgressCallback:r?c=>r(c):void 0}),s=[];this._apiProviders.set("webllm",{async query(c,u){var A,O,T;let f=[];u!=null&&u.systemPrompt&&f.push({role:"system",content:u.systemPrompt}),f.push(...s),f.push({role:"user",content:c});let b="",p=await a.chat.completions.create({messages:f,stream:!0,temperature:.7,max_tokens:4096});for await(let E of p){let k=((T=(O=(A=E.choices)==null?void 0:A[0])==null?void 0:O.delta)==null?void 0:T.content)??"";b+=k,u!=null&&u.onOutput&&u.onOutput(b,"stdout")}return s.push({role:"user",content:c}),s.push({role:"assistant",content:b}),b},async execute(c,u){return this.query(c,u)}})}_initOpenRouter(t,r){var a,s;let n=((s=(a=t[0])==null?void 0:a.inline)==null?void 0:s.model)??"google/gemma-2-2b-it",i=[];this._apiProviders.set("openrouter",{async query(o,l){var O,T,E;let c=[];l!=null&&l.systemPrompt&&c.push({role:"system",content:l.systemPrompt}),c.push(...i),c.push({role:"user",content:o});let u=await fetch("https://openrouter.ai/api/v1/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({model:(l==null?void 0:l.model)||n,messages:c,stream:!0})});if(!u.ok){let k=await u.text();throw new Error(`OpenRouter API error (${u.status}): ${k}`)}let f=u.body.getReader(),b=new TextDecoder,p="",A="";for(;;){let{done:k,value:Lt}=await f.read();if(k)break;A+=b.decode(Lt,{stream:!0});let Ye=A.split(`
|
|
18
|
+
`);A=Ye.pop();for(let Ft of Ye){let Ce=Ft.trim();if(!Ce||!Ce.startsWith("data: "))continue;let ze=Ce.slice(6);if(ze!=="[DONE]")try{let qe=((E=(T=(O=JSON.parse(ze).choices)==null?void 0:O[0])==null?void 0:T.delta)==null?void 0:E.content)??"";p+=qe,qe&&(l!=null&&l.onOutput)&&l.onOutput(p,"stdout")}catch{}}}return i.push({role:"user",content:o}),i.push({role:"assistant",content:p}),p},async execute(o,l){return this.query(o,l)}})}get agents(){return this._agents}get config(){return this._config}get tools(){return this._tools}registerTool(t,r){this._tools.set(t,{name:t,...r})}async query(t,r,n){var u,f,b;let i=Date.now(),a;try{a=mt(t,Array.from(this._agents.values()))}catch(p){if(p instanceof Pe)return{ok:!1,data:"",error:{code:"AGENT_NOT_FOUND",message:p.message},meta:{agentId:t.replace(/^@/,""),provider:"",durationMs:Date.now()-i}};throw p}let s=Array.isArray(a.provider)?a.provider[0]??"api/default":a.provider,o=(n==null?void 0:n.provider)??s,l=(n==null?void 0:n.model)??((u=a.inline)==null?void 0:u.model),c;try{c=gt(o)}catch(p){return{ok:!1,data:"",error:{code:"PROVIDER_ERROR",message:p.message},meta:{agentId:a.id,provider:o,model:l,durationMs:Date.now()-i}}}try{return{ok:!0,data:await c.query(r,{model:l,context:n==null?void 0:n.context,systemPrompt:((f=a.inline)==null?void 0:f.system_prompt)??((b=a.inline)==null?void 0:b.prompt),onOutput:n!=null&&n.onOutput?p=>n.onOutput(p):void 0}),meta:{agentId:a.id,provider:o,model:l,durationMs:Date.now()-i}}}catch(p){return{ok:!1,data:"",error:{code:"QUERY_FAILED",message:p.message},meta:{agentId:a.id,provider:o,model:l,durationMs:Date.now()-i}}}}async execute(t,r,n){var u,f,b;let i=Date.now(),a;try{a=mt(t,Array.from(this._agents.values()))}catch(p){if(p instanceof Pe)return{ok:!1,data:"",error:{code:"AGENT_NOT_FOUND",message:p.message},meta:{agentId:t.replace(/^@/,""),provider:"",durationMs:Date.now()-i}};throw p}let s=Array.isArray(a.provider)?a.provider[0]??"api/default":a.provider,o=(n==null?void 0:n.provider)??s,l=(n==null?void 0:n.model)??((u=a.inline)==null?void 0:u.model),c;try{c=gt(o)}catch(p){return{ok:!1,data:"",error:{code:"PROVIDER_ERROR",message:p.message},meta:{agentId:a.id,provider:o,model:l,durationMs:Date.now()-i}}}try{return{ok:!0,data:await c.execute(r,{model:l,context:n==null?void 0:n.context,systemPrompt:((f=a.inline)==null?void 0:f.system_prompt)??((b=a.inline)==null?void 0:b.prompt)}),meta:{agentId:a.id,provider:o,model:l,durationMs:Date.now()-i}}}catch(p){return{ok:!1,data:"",error:{code:"EXECUTE_FAILED",message:p.message},meta:{agentId:a.id,provider:o,model:l,durationMs:Date.now()-i}}}}},ri=H({model:N().optional(),system_prompt:N().optional(),prompt:N().optional(),layout:Nt([N(),H({id:N(),props:ce(Z()).optional()}),H({props:ce(Z())}),H({template:N()})]).optional()}).catchall(Z()),ni=H({include:pe(N()).optional()}).optional(),ii=H({id:N(),name:N().optional(),role:N().optional(),team:N().optional(),provider:Nt([N(),pe(N())]),working_directory:N().optional(),description:N().optional(),tags:pe(N()).optional(),inline:ri.optional(),skills:ni}).catchall(Z()),ai=H({agents:pe(ii).optional(),hooks:pe(Z()).optional(),settings:ce(Z()).optional(),skills:Z().optional(),layouts:ce(Z()).optional(),documents:ce(Z()).optional()}).catchall(Z()),Ee=class extends Error{constructor(t,r){super(t);B(this,"cause");this.cause=r,this.name="ConfigLoadError"}};function ui(e){if(!e||typeof e!="string"||!e.trim())throw new Ee("YAML content must be a non-empty string");let t;try{t=Tn(e)}catch(i){throw new Ee(`YAML parse error: ${i.message}`,i)}let r=si(t),n=ai.safeParse(r);if(!n.success)throw new Ee(`Config validation error: ${n.error.message}`);return n.data}function si(e){if(!e||typeof e!="object")return{agents:[]};let t=e;if(t.agents&&typeof t.agents=="object"&&!Array.isArray(t.agents)){let r=t.agents,n=Object.entries(r).map(([i,a])=>({id:i,...a&&typeof a=="object"?a:{}}));return{...t,agents:n}}return t.agents?t:{...t,agents:[]}}var oi="crewx:fs:",di=class{constructor(e){B(this,"prefix");B(this,"store");this.prefix=(e==null?void 0:e.prefix)??oi,this.store=(e==null?void 0:e.storage)??new Map}async readFile(e){let t=this.toKey(e),r=this.store.get(t);if(r===void 0)throw new Error(`BrowserFsAdapter: file not found: ${e}`);return r}async exists(e){return this.store.has(this.toKey(e))}resolvePath(...e){let t=e.map(a=>a.replace(/\\/g,"/")).join("/").replace(/\/+/g,"/"),r=t.split("/"),n=[];for(let a of r)a==="."||a===""||(a===".."?n.pop():n.push(a));let i=n.join("/");return t.startsWith("/")?`/${i}`:i}isAbsolute(e){return e.startsWith("/")}setItem(e,t){this.store.set(this.toKey(e),t)}removeItem(e){this.store.delete(this.toKey(e))}keys(){return Array.from(this.store.keys()).filter(e=>e.startsWith(this.prefix)).map(e=>e.slice(this.prefix.length))}async readdir(e){let t=e.replace(/\\/g,"/").replace(/\/$/,""),r=this.toKey(t+"/"),n=[];for(let i of this.store.keys())if(i.startsWith(r)){let a=i.slice(r.length).split("/")[0];a&&!n.includes(a)&&n.push(a)}return n}toKey(e){return`${this.prefix}${e.replace(/\\/g,"/")}`}};export{di as BrowserFsAdapter,Ee as ConfigLoadError,ci as Crewx,De as ProviderError,gt as createProvider,ui as parseYamlContent,ei as registerProviderFactory};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as e,l as s,G as n,e as i,H as p}from"./main-aGv85UbW.js";import{p as g}from"./gitGraph-YCYPL57B-C4wWI2lu.js";import"./min-BF7UvoIw.js";import"./_baseUniq-Da8Sle23.js";var v={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},d={version:p},m=e(()=>d.version,"getVersion"),c={getVersion:m},l=e((r,a,o)=>{s.debug(`rendering info diagram
|
|
2
|
+
`+r);const t=n(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),f={draw:l},y={parser:v,db:c,renderer:f};export{y as diagram};
|
package/dist/assets/{journeyDiagram-G5WM74LC-CaL2qxGH.js → journeyDiagram-G5WM74LC-Dn2RRgG3.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ft,g as at,f as gt,d as mt}from"./chunk-ASOPGD6M-
|
|
1
|
+
import{a as ft,g as at,f as gt,d as mt}from"./chunk-ASOPGD6M-Dqv_Eb6I.js";import{g as xt,s as kt,a as _t,b as vt,n as bt,o as wt,_ as i,c as A,d as W,e as Tt,v as St}from"./main-aGv85UbW.js";import{d as tt}from"./arc-CRV7Gm3c.js";var H=function(){var t=i(function(g,r,a,l){for(a=a||{},l=g.length;l--;a[g[l]]=r);return a},"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],c=[1,10],s=[1,11],u=[1,12],h=[1,13],p=[1,14],d={trace:i(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:i(function(r,a,l,y,f,o,S){var _=o.length-1;switch(f){case 1:return o[_-1];case 2:this.$=[];break;case 3:o[_-1].push(o[_]),this.$=o[_-1];break;case 4:case 5:this.$=o[_];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(o[_].substr(6)),this.$=o[_].substr(6);break;case 9:this.$=o[_].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=o[_].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(o[_].substr(8)),this.$=o[_].substr(8);break;case 13:y.addTask(o[_-1],o[_]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:c,14:s,16:u,17:h,18:p},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:c,14:s,16:u,17:h,18:p},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:i(function(r,a){if(a.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=a,l}},"parseError"),parse:i(function(r){var a=this,l=[0],y=[],f=[null],o=[],S=this.table,_="",B=0,J=0,ut=2,K=1,yt=o.slice.call(arguments,1),k=Object.create(this.lexer),E={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(E.yy[O]=this.yy[O]);k.setInput(r,E.yy),E.yy.lexer=k,E.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var Y=k.yylloc;o.push(Y);var dt=k.options&&k.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(b){l.length=l.length-2*b,f.length=f.length-b,o.length=o.length-b}i(pt,"popStack");function Q(){var b;return b=y.pop()||k.lex()||K,typeof b!="number"&&(b instanceof Array&&(y=b,b=y.pop()),b=a.symbols_[b]||b),b}i(Q,"lex");for(var v,P,w,q,C={},N,M,D,j;;){if(P=l[l.length-1],this.defaultActions[P]?w=this.defaultActions[P]:((v===null||typeof v>"u")&&(v=Q()),w=S[P]&&S[P][v]),typeof w>"u"||!w.length||!w[0]){var G="";j=[];for(N in S[P])this.terminals_[N]&&N>ut&&j.push("'"+this.terminals_[N]+"'");k.showPosition?G="Parse error on line "+(B+1)+`:
|
|
2
2
|
`+k.showPosition()+`
|
|
3
3
|
Expecting `+j.join(", ")+", got '"+(this.terminals_[v]||v)+"'":G="Parse error on line "+(B+1)+": Unexpected "+(v==K?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(G,{text:k.match,token:this.terminals_[v]||v,line:k.yylineno,loc:Y,expected:j})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+v);switch(w[0]){case 1:l.push(v),f.push(k.yytext),o.push(k.yylloc),l.push(w[1]),v=null,J=k.yyleng,_=k.yytext,B=k.yylineno,Y=k.yylloc;break;case 2:if(M=this.productions_[w[1]][1],C.$=f[f.length-M],C._$={first_line:o[o.length-(M||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(M||1)].first_column,last_column:o[o.length-1].last_column},dt&&(C._$.range=[o[o.length-(M||1)].range[0],o[o.length-1].range[1]]),q=this.performAction.apply(C,[_,J,B,E.yy,w[1],f,o].concat(yt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),f=f.slice(0,-1*M),o=o.slice(0,-1*M)),l.push(this.productions_[w[1]][0]),f.push(C.$),o.push(C._$),D=S[l[l.length-2]][l[l.length-1]],l.push(D);break;case 3:return!0}}return!0},"parse")},x=function(){var g={EOF:1,parseError:i(function(a,l){if(this.yy.parser)this.yy.parser.parseError(a,l);else throw new Error(a)},"parseError"),setInput:i(function(r,a){return this.yy=a||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:i(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:i(function(r){var a=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:i(function(){return this._more=!0,this},"more"),reject:i(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:i(function(r){this.unput(this.match.slice(r))},"less"),pastInput:i(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:i(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:i(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as c,l as te,c as W,G as fe,ae as ye,af as be,ag as me,T as _e,D as Y,i as F,x as Ee,J as ke,U as Se,V as le,W as ce}from"./main-
|
|
1
|
+
import{_ as c,l as te,c as W,G as fe,ae as ye,af as be,ag as me,T as _e,D as Y,i as F,x as Ee,J as ke,U as Se,V as le,W as ce}from"./main-aGv85UbW.js";var $=function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],E=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],U=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:U}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:U}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),b=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);b.setInput(s,T.yy),T.yy.lexer=b,T.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;e.push(q);var de=b.options&&b.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var k,R,v,Q,G={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((k===null||typeof k>"u")&&(k=ae()),v=B[R]&&B[R][k]),typeof v>"u"||!v.length||!v[0]){var Z="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");b.showPosition?Z="Parse error on line "+(z+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+K.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(k==re?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Z,{text:b.match,token:this.terminals_[k]||k,line:b.yylineno,loc:q,expected:K})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+k);switch(v[0]){case 1:a.push(k),u.push(b.yytext),e.push(b.yylloc),a.push(v[1]),k=null,ie=b.yyleng,l=b.yytext,z=b.yylineno,q=b.yylloc;break;case 2:if(I=this.productions_[v[1]][1],G.$=u[u.length-I],G._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(G._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(G,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(G.$),e.push(G._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},m=function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Ve,G as g,i as m,v as E}from"./graph-LhZDDtD9.js";import{i as z,c as C,k as Ye,o as $e,p as ve,q as pe,t as De,u as we,v as qe,w as be,d as V,x as We,b as ze,y as Xe,n as f,m as I,r as A}from"./_baseUniq-Da8Sle23.js";import{f as O,b as me,a as He,c as Ue,m as w,d as P}from"./min-BF7UvoIw.js";import{bK as M,c7 as Ke,c8 as Je,bR as ge,c9 as S,bB as ye,ca as Qe,aB as Ze,cb as en,cc as nn,aD as xe,cd as rn,bQ as Ee,aC as ke,bI as tn,bT as an,ce as X}from"./main-aGv85UbW.js";var on=/\s/;function un(e){for(var n=e.length;n--&&on.test(e.charAt(n)););return n}var dn=/^\s+/;function sn(e){return e&&e.slice(0,un(e)+1).replace(dn,"")}var re=NaN,fn=/^[-+]0x[0-9a-f]+$/i,cn=/^0b[01]+$/i,hn=/^0o[0-7]+$/i,ln=parseInt;function vn(e){if(typeof e=="number")return e;if(z(e))return re;if(M(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=M(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=sn(e);var r=cn.test(e);return r||hn.test(e)?ln(e.slice(2),r?2:8):fn.test(e)?re:+e}var te=1/0,pn=17976931348623157e292;function T(e){if(!e)return e===0?e:0;if(e=vn(e),e===te||e===-te){var n=e<0?-1:1;return n*pn}return e===e?e:0}function wn(e){var n=T(e),r=n%1;return n===n?r?n-r:n:0}function bn(e){return Ke(Je(e,void 0,O),e+"")}var mn=1,gn=4;function yn(e){return Ve(e,mn|gn)}var Oe=Object.prototype,xn=Oe.hasOwnProperty,En=ge(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&S(n[0],n[1],i)&&(t=1);++r<t;)for(var o=n[r],a=ye(o),u=-1,d=a.length;++u<d;){var s=a[u],c=e[s];(c===void 0||Qe(c,Oe[s])&&!xn.call(e,s))&&(e[s]=o[s])}return e});function F(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function kn(e){return function(n,r,t){var i=Object(n);if(!Ze(n)){var o=C(r);n=Ye(n),r=function(u){return o(i[u],u,i)}}var a=e(n,r,t);return a>-1?i[o?n[a]:a]:void 0}}var On=Math.max;function Nn(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:wn(r);return i<0&&(i=On(t+i,0)),$e(e,C(n),i)}var U=kn(Nn);function Ln(e,n){return e==null?e:en(e,ve(n),ye)}function Pn(e,n){return e&&pe(e,ve(n))}function _n(e,n){return e>n}var Cn=Object.prototype,In=Cn.hasOwnProperty;function Rn(e,n){return e!=null&&In.call(e,n)}function Ne(e,n){return e!=null&&De(e,n,Rn)}function j(e,n){var r={};return n=C(n),pe(e,function(t,i,o){nn(r,i,n(t,i,o))}),r}function y(e){return e&&e.length?me(e,xe,_n):void 0}function K(e,n){return e&&e.length?me(e,C(n),He):void 0}function Tn(e,n,r,t){if(!M(e))return e;n=we(n,e);for(var i=-1,o=n.length,a=o-1,u=e;u!=null&&++i<o;){var d=qe(n[i]),s=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(i!=a){var c=u[d];s=void 0,s===void 0&&(s=M(c)?c:rn(n[i+1])?[]:{})}Ee(u,d,s),u=u[d]}return e}function Mn(e,n,r){for(var t=-1,i=n.length,o={};++t<i;){var a=n[t],u=be(e,a);r(u,a)&&Tn(o,we(a,e),u)}return o}function Sn(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function Fn(e,n){if(e!==n){var r=e!==void 0,t=e===null,i=e===e,o=z(e),a=n!==void 0,u=n===null,d=n===n,s=z(n);if(!u&&!s&&!o&&e>n||o&&a&&d&&!u&&!s||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!s&&e<n||s&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!d)return-1}return 0}function Bn(e,n,r){for(var t=-1,i=e.criteria,o=n.criteria,a=i.length,u=r.length;++t<a;){var d=Fn(i[t],o[t]);if(d){if(t>=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function An(e,n,r){n.length?n=V(n,function(o){return ke(o)?function(a){return be(a,o.length===1?o[0]:o)}:o}):n=[xe];var t=-1;n=V(n,tn(C));var i=Ue(e,function(o,a,u){var d=V(n,function(s){return s(o)});return{criteria:d,index:++t,value:o}});return Sn(i,function(o,a){return Bn(o,a,r)})}function jn(e,n){return Mn(e,n,function(r,t){return We(e,t)})}var B=bn(function(e,n){return e==null?{}:jn(e,n)}),Gn=Math.ceil,Vn=Math.max;function Yn(e,n,r,t){for(var i=-1,o=Vn(Gn((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function $n(e){return function(n,r,t){return t&&typeof t!="number"&&S(n,r,t)&&(r=t=void 0),n=T(n),r===void 0?(r=n,n=0):r=T(r),t=t===void 0?n<r?1:-1:T(t),Yn(n,r,t)}}var k=$n(),R=ge(function(e,n){if(e==null)return[];var r=n.length;return r>1&&S(e,n[0],n[1])?n=[]:r>2&&S(n[0],n[1],n[2])&&(n=[n[0]]),An(e,ze(n),[])}),Dn=0;function J(e){var n=++Dn;return Xe(e)+n}function qn(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t<i;){var u=t<o?n[t]:void 0;r(a,e[t],u)}return a}function Wn(e,n){return qn(e||[],n||[],Ee)}class zn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return ie(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&ie(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,Xn)),t=t._prev;return"["+n.join(", ")+"]"}}function ie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Xn(e,n){if(e!=="_next"&&e!=="_prev")return n}var Hn=an(1);function Un(e,n){if(e.nodeCount()<=1)return[];var r=Jn(e,n||Hn),t=Kn(r.graph,r.buckets,r.zeroIdx);return O(w(t,function(i){return e.outEdges(i.v,i.w)}))}function Kn(e,n,r){for(var t=[],i=n[n.length-1],o=n[0],a;e.nodeCount();){for(;a=o.dequeue();)Y(e,n,r,a);for(;a=i.dequeue();)Y(e,n,r,a);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(a=n[u].dequeue(),a){t=t.concat(Y(e,n,r,a,!0));break}}}return t}function Y(e,n,r,t,i){var o=i?[]:void 0;return f(e.inEdges(t.v),function(a){var u=e.edge(a),d=e.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,H(n,r,d)}),f(e.outEdges(t.v),function(a){var u=e.edge(a),d=a.w,s=e.node(d);s.in-=u,H(n,r,s)}),e.removeNode(t.v),o}function Jn(e,n){var r=new g,t=0,i=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),i=Math.max(i,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var o=k(i+t+3).map(function(){return new zn}),a=t+1;return f(r.nodes(),function(u){H(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function H(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Qn(e){var n=e.graph().acyclicer==="greedy"?Un(e,r(e)):Zn(e);f(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,J("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Zn(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,f(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return f(e.nodes(),i),n}function er(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function N(e,n,r,t){var i;do i=J(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function nr(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function Le(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function ae(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,s=u):(i<0&&(a=-a),d=a,s=a*o/i),{x:r+d,y:t+s}}function G(e){var n=w(k(Pe(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),i=t.rank;m(i)||(n[i][t.order]=r)}),n}function rr(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);Ne(t,"rank")&&(t.rank-=n)})}function tr(e){var n=P(w(e.nodes(),function(o){return e.node(o).rank})),r=[];f(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;f(r,function(o,a){m(o)&&a%i!==0?--t:t&&f(o,function(u){e.node(u).rank+=t})})}function oe(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),N(e,"border",i,n)}function Pe(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function ir(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function ar(e,n){return n()}function or(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)ue(e,"borderLeft","_bl",r,i,o),ue(e,"borderRight","_br",r,i,o)}}f(e.children(),n)}function ue(e,n,r,t,i,o){var a={width:0,height:0,rank:o,borderType:n},u=i[n][o-1],d=N(e,"border",a,r);i[n][o]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function ur(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&_e(e)}function dr(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&sr(e),(n==="lr"||n==="rl")&&(fr(e),_e(e))}function _e(e){f(e.nodes(),function(n){de(e.node(n))}),f(e.edges(),function(n){de(e.edge(n))})}function de(e){var n=e.width;e.width=e.height,e.height=n}function sr(e){f(e.nodes(),function(n){$(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,$),Object.prototype.hasOwnProperty.call(r,"y")&&$(r)})}function $(e){e.y=-e.y}function fr(e){f(e.nodes(),function(n){D(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,D),Object.prototype.hasOwnProperty.call(r,"x")&&D(r)})}function D(e){var n=e.x;e.x=e.y,e.y=n}function cr(e){e.graph().dummyChains=[],f(e.edges(),function(n){hr(e,n)})}function hr(e,n){var r=n.v,t=e.node(r).rank,i=n.w,o=e.node(i).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(o!==t+1){e.removeEdge(n);var s=void 0,c,h;for(h=0,++t;t<o;++h,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},c=N(e,"edge",s,"_d"),t===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),h===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,i,{weight:u.weight},a)}}function lr(e){f(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,i;for(e.setEdge(r.edgeObj,t);r.dummy;)i=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=i,r=e.node(n)})}function Q(e){var n={};function r(t){var i=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return i.rank;n[t]=!0;var o=P(w(e.outEdges(t),function(a){return r(a.w)-e.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}f(e.sources(),r)}function _(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ce(e){var n=new g({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var i,o;vr(n,e)<t;)i=pr(n,e),o=n.hasNode(i.v)?_(e,i):-_(e,i),wr(n,e,o);return n}function vr(e,n){function r(t){f(n.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!e.hasNode(a)&&!_(n,i)&&(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}return f(e.nodes(),r),e.nodeCount()}function pr(e,n){return K(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return _(n,r)})}function wr(e,n,r){f(e.nodes(),function(t){n.node(t).rank+=r})}function br(){}br.prototype=new Error;function Ie(e,n,r){ke(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],o={};return f(n,function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);Re(e,a,r==="post",o,t,i)}),i}function Re(e,n,r,t,i,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),f(i(n),function(a){Re(e,a,r,t,i,o)}),r&&o.push(n))}function mr(e,n){return Ie(e,n,"post")}function gr(e,n){return Ie(e,n,"pre")}x.initLowLimValues=ee;x.initCutValues=Z;x.calcCutValue=Te;x.leaveEdge=Se;x.enterEdge=Fe;x.exchangeEdges=Be;function x(e){e=nr(e),Q(e);var n=Ce(e);ee(n),Z(n,e);for(var r,t;r=Se(n);)t=Fe(n,e,r),Be(n,e,r,t)}function Z(e,n){var r=mr(e,e.nodes());r=r.slice(0,r.length-1),f(r,function(t){yr(e,n,t)})}function yr(e,n,r){var t=e.node(r),i=t.parent;e.edge(r,i).cutvalue=Te(e,n,r)}function Te(e,n,r){var t=e.node(r),i=t.parent,o=!0,a=n.edge(r,i),u=0;return a||(o=!1,a=n.edge(i,r)),u=a.weight,f(n.nodeEdges(r),function(d){var s=d.v===r,c=s?d.w:d.v;if(c!==i){var h=s===o,l=n.edge(d).weight;if(u+=h?l:-l,Er(e,r,c)){var v=e.edge(r,c).cutvalue;u+=h?-v:v}}}),u}function ee(e,n){arguments.length<2&&(n=e.nodes()[0]),Me(e,{},1,n)}function Me(e,n,r,t,i){var o=r,a=e.node(t);return n[t]=!0,f(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Me(e,n,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function Se(e){return U(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Fe(e,n,r){var t=r.v,i=r.w;n.hasEdge(t,i)||(t=r.w,i=r.v);var o=e.node(t),a=e.node(i),u=o,d=!1;o.lim>a.lim&&(u=a,d=!0);var s=I(n.edges(),function(c){return d===se(e,e.node(c.v),u)&&d!==se(e,e.node(c.w),u)});return K(s,function(c){return _(n,c)})}function Be(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ee(e),Z(e,n),xr(e,n)}function xr(e,n){var r=U(e.nodes(),function(i){return!n.node(i).parent}),t=gr(e,r);t=t.slice(1),f(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function Er(e,n,r){return e.hasEdge(n,r)}function se(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function kr(e){switch(e.graph().ranker){case"network-simplex":fe(e);break;case"tight-tree":Nr(e);break;case"longest-path":Or(e);break;default:fe(e)}}var Or=Q;function Nr(e){Q(e),Ce(e)}function fe(e){x(e)}function Lr(e){var n=N(e,"root",{},"_root"),r=Pr(e),t=y(E(r))-1,i=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(a){e.edge(a).minlen*=i});var o=_r(e)+1;f(e.children(),function(a){Ae(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Ae(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var d=oe(e,"_bt"),s=oe(e,"_bb"),c=e.node(a);e.setParent(d,a),c.borderTop=d,e.setParent(s,a),c.borderBottom=s,f(u,function(h){Ae(e,n,r,t,i,o,h);var l=e.node(h),v=l.borderTop?l.borderTop:h,p=l.borderBottom?l.borderBottom:h,b=l.borderTop?t:2*t,L=v!==p?1:i-o[a]+1;e.setEdge(d,v,{weight:b,minlen:L,nestingEdge:!0}),e.setEdge(p,s,{weight:b,minlen:L,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:i+o[a]})}function Pr(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&f(o,function(a){r(a,i+1)}),n[t]=i}return f(e.children(),function(t){r(t,1)}),n}function _r(e){return A(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Cr(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Ir(e,n,r){var t={},i;f(r,function(o){for(var a=e.parent(o),u,d;a;){if(u=e.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){n.setEdge(d,a);return}a=u}})}function Rr(e,n,r){var t=Tr(e),i=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return f(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),f(e[r](o),function(d){var s=d.v===o?d.w:d.v,c=i.edge(s,o),h=m(c)?0:c.weight;i.setEdge(s,o,{weight:e.edge(d).weight+h})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Tr(e){for(var n;e.hasNode(n=J("_root")););return n}function Mr(e,n){for(var r=0,t=1;t<n.length;++t)r+=Sr(e,n[t-1],n[t]);return r}function Sr(e,n,r){for(var t=Wn(r,w(r,function(s,c){return c})),i=O(w(n,function(s){return R(w(e.outEdges(s),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=w(new Array(a),function(){return 0}),d=0;return f(i.forEach(function(s){var c=s.pos+o;u[c]+=s.weight;for(var h=0;c>0;)c%2&&(h+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*h})),d}function Fr(e){var n={},r=I(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),i=w(k(t+1),function(){return[]});function o(u){if(!Ne(n,u)){n[u]=!0;var d=e.node(u);i[d.rank].push(u),f(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return f(a,o),i}function Br(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var i=A(t,function(o,a){var u=e.edge(a),d=e.node(a.v);return{sum:o.sum+u.weight*d.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Ar(e,n){var r={};f(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),f(n.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=I(r,function(i){return!i.indegree});return jr(t)}function jr(e){var n=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&&Gr(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),f(i.in.reverse(),r(i)),f(i.out,t(i))}return w(I(n,function(o){return!o.merged}),function(o){return B(o,["vs","i","barycenter","weight"])})}function Gr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Vr(e,n){var r=ir(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,i=R(r.rhs,function(c){return-c.i}),o=[],a=0,u=0,d=0;t.sort(Yr(!!n)),d=ce(o,i,d),f(t,function(c){d+=c.vs.length,o.push(c.vs),a+=c.barycenter*c.weight,u+=c.weight,d=ce(o,i,d)});var s={vs:O(o)};return u&&(s.barycenter=a/u,s.weight=u),s}function ce(e,n,r){for(var t;n.length&&(t=F(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Yr(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function je(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=I(i,function(p){return p!==a&&p!==u}));var s=Br(e,i);f(s,function(p){if(e.children(p.v).length){var b=je(e,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&Dr(p,b)}});var c=Ar(s,r);$r(c,d);var h=Vr(c,t);if(a&&(h.vs=O([a,h.vs,u]),e.predecessors(a).length)){var l=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+l.order+v.order)/(h.weight+2),h.weight+=2}return h}function $r(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Dr(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function qr(e){var n=Pe(e),r=he(e,k(1,n+1),"inEdges"),t=he(e,k(n-1,-1,-1),"outEdges"),i=Fr(e);le(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){Wr(u%2?r:t,u%4>=2),i=G(e);var s=Mr(e,i);s<o&&(d=0,a=yn(i),o=s)}le(e,a)}function he(e,n,r){return w(n,function(t){return Rr(e,t,r)})}function Wr(e,n){var r=new g;f(e,function(t){var i=t.graph().root,o=je(t,i,r,n);f(o.vs,function(a,u){t.node(a).order=u}),Ir(t,r,o.vs)})}function le(e,n){f(n,function(r){f(r,function(t,i){e.node(t).order=i})})}function zr(e){var n=Hr(e);f(e.graph().dummyChains,function(r){for(var t=e.node(r),i=t.edgeObj,o=Xr(e,n,i.v,i.w),a=o.path,u=o.lca,d=0,s=a[d],c=!0;r!==i.w;){if(t=e.node(r),c){for(;(s=a[d])!==u&&e.node(s).maxRank<t.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<a.length-1&&e.node(s=a[d+1]).minRank<=t.rank;)d++;s=a[d]}e.setParent(r,s),r=e.successors(r)[0]}})}function Xr(e,n,r,t){var i=[],o=[],a=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),d,s;d=r;do d=e.parent(d),i.push(d);while(d&&(n[d].low>a||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)o.push(d);return{path:i.concat(o.reverse()),lca:s}}function Hr(e){var n={},r=0;function t(i){var o=r;f(e.children(i),t),n[i]={low:o,lim:r++}}return f(e.children(),t),n}function Ur(e,n){var r={};function t(i,o){var a=0,u=0,d=i.length,s=F(o);return f(o,function(c,h){var l=Jr(e,c),v=l?e.node(l).order:d;(l||c===s)&&(f(o.slice(u,h+1),function(p){f(e.predecessors(p),function(b){var L=e.node(b),ne=L.order;(ne<a||v<ne)&&!(L.dummy&&e.node(p).dummy)&&Ge(r,b,p)})}),u=h+1,a=v)}),o}return A(n,t),r}function Kr(e,n){var r={};function t(o,a,u,d,s){var c;f(k(a,u),function(h){c=o[h],e.node(c).dummy&&f(e.predecessors(c),function(l){var v=e.node(l);v.dummy&&(v.order<d||v.order>s)&&Ge(r,l,c)})})}function i(o,a){var u=-1,d,s=0;return f(a,function(c,h){if(e.node(c).dummy==="border"){var l=e.predecessors(c);l.length&&(d=e.node(l[0]).order,t(a,s,h,u,d),s=h,u=d)}t(a,s,a.length,d,o.length)}),a}return A(n,i),r}function Jr(e,n){if(e.node(n).dummy)return U(e.predecessors(n),function(r){return e.node(r).dummy})}function Ge(e,n,r){if(n>r){var t=n;n=r,r=t}var i=e[n];i||(e[n]=i={}),i[r]=!0}function Qr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Zr(e,n,r,t){var i={},o={},a={};return f(n,function(u){f(u,function(d,s){i[d]=d,o[d]=d,a[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(b){return a[b]});for(var h=(c.length-1)/2,l=Math.floor(h),v=Math.ceil(h);l<=v;++l){var p=c[l];o[s]===s&&d<a[p]&&!Qr(r,s,p)&&(o[p]=s,o[s]=i[s]=i[p],d=a[p])}}})}),{root:i,align:o}}function et(e,n,r,t,i){var o={},a=nt(e,n,r,i),u=i?"borderLeft":"borderRight";function d(h,l){for(var v=a.nodes(),p=v.pop(),b={};p;)b[p]?h(p):(b[p]=!0,v.push(p),v=v.concat(l(p))),p=v.pop()}function s(h){o[h]=a.inEdges(h).reduce(function(l,v){return Math.max(l,o[v.v]+a.edge(v))},0)}function c(h){var l=a.outEdges(h).reduce(function(p,b){return Math.min(p,o[b.w]-a.edge(b))},Number.POSITIVE_INFINITY),v=e.node(h);l!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(o[h]=Math.max(o[h],l))}return d(s,a.predecessors.bind(a)),d(c,a.successors.bind(a)),f(t,function(h){o[h]=o[r[h]]}),o}function nt(e,n,r,t){var i=new g,o=e.graph(),a=ot(o.nodesep,o.edgesep,t);return f(n,function(u){var d;f(u,function(s){var c=r[s];if(i.setNode(c),d){var h=r[d],l=i.edge(h,c);i.setEdge(h,c,Math.max(a(e,s,d),l||0))}d=s})}),i}function rt(e,n){return K(E(n),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return Ln(r,function(o,a){var u=ut(e,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function tt(e,n){var r=E(n),t=P(r),i=y(r);f(["u","d"],function(o){f(["l","r"],function(a){var u=o+a,d=e[u],s;if(d!==n){var c=E(d);s=a==="l"?t-P(c):i-y(c),s&&(e[u]=j(d,function(h){return h+s}))}})})}function it(e,n){return j(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var i=R(w(e,t));return(i[1]+i[2])/2})}function at(e){var n=G(e),r=X(Ur(e,n),Kr(e,n)),t={},i;f(["u","d"],function(a){i=a==="u"?n:E(n).reverse(),f(["l","r"],function(u){u==="r"&&(i=w(i,function(h){return E(h).reverse()}));var d=(a==="u"?e.predecessors:e.successors).bind(e),s=Zr(e,i,r,d),c=et(e,i,s.root,s.align,u==="r");u==="r"&&(c=j(c,function(h){return-h})),t[a+u]=c})});var o=rt(e,t);return tt(t,o),it(t,e.graph().align)}function ot(e,n,r){return function(t,i,o){var a=t.node(i),u=t.node(o),d=0,s;if(d+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=-a.width/2;break;case"r":s=a.width/2;break}if(s&&(d+=r?s:-s),s=0,d+=(a.dummy?n:e)/2,d+=(u.dummy?n:e)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(d+=r?s:-s),s=0,d}}function ut(e,n){return e.node(n).width}function dt(e){e=Le(e),st(e),Pn(at(e),function(n,r){e.node(r).x=n})}function st(e){var n=G(e),r=e.graph().ranksep,t=0;f(n,function(i){var o=y(w(i,function(a){return e.node(a).height}));f(i,function(a){e.node(a).y=t+o/2}),t+=o+r})}function At(e,n){var r=ar;r("layout",()=>{var t=r(" buildLayoutGraph",()=>yt(e));r(" runLayout",()=>ft(t,r)),r(" updateInputGraph",()=>ct(e,t))})}function ft(e,n){n(" makeSpaceForEdgeLabels",()=>xt(e)),n(" removeSelfEdges",()=>It(e)),n(" acyclic",()=>Qn(e)),n(" nestingGraph.run",()=>Lr(e)),n(" rank",()=>kr(Le(e))),n(" injectEdgeLabelProxies",()=>Et(e)),n(" removeEmptyRanks",()=>tr(e)),n(" nestingGraph.cleanup",()=>Cr(e)),n(" normalizeRanks",()=>rr(e)),n(" assignRankMinMax",()=>kt(e)),n(" removeEdgeLabelProxies",()=>Ot(e)),n(" normalize.run",()=>cr(e)),n(" parentDummyChains",()=>zr(e)),n(" addBorderSegments",()=>or(e)),n(" order",()=>qr(e)),n(" insertSelfEdges",()=>Rt(e)),n(" adjustCoordinateSystem",()=>ur(e)),n(" position",()=>dt(e)),n(" positionSelfEdges",()=>Tt(e)),n(" removeBorderNodes",()=>Ct(e)),n(" normalize.undo",()=>lr(e)),n(" fixupEdgeLabelCoords",()=>Pt(e)),n(" undoCoordinateSystem",()=>dr(e)),n(" translateGraph",()=>Nt(e)),n(" assignNodeIntersects",()=>Lt(e)),n(" reversePoints",()=>_t(e)),n(" acyclic.undo",()=>er(e))}function ct(e,n){f(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),f(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var ht=["nodesep","edgesep","ranksep","marginx","marginy"],lt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},vt=["acyclicer","ranker","rankdir","align"],pt=["width","height"],wt={width:0,height:0},bt=["minlen","weight","width","height","labeloffset"],mt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gt=["labelpos"];function yt(e){var n=new g({multigraph:!0,compound:!0}),r=W(e.graph());return n.setGraph(X({},lt,q(r,ht),B(r,vt))),f(e.nodes(),function(t){var i=W(e.node(t));n.setNode(t,En(q(i,pt),wt)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var i=W(e.edge(t));n.setEdge(t,X({},mt,q(i,bt),B(i,gt)))}),n}function xt(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Et(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};N(e,"edge-proxy",o,"_ep")}})}function kt(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Ot(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Nt(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function d(s){var c=s.x,h=s.y,l=s.width,v=s.height;n=Math.min(n,c-l/2),r=Math.max(r,c+l/2),t=Math.min(t,h-v/2),i=Math.max(i,h+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=a,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(h){h.x-=n,h.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Lt(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(ae(t,o)),r.points.push(ae(i,a))})}function Pt(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function _t(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ct(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(F(r.borderLeft)),a=e.node(F(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function It(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Rt(e){var n=G(e);f(n,function(r){var t=0;f(r,function(i,o){var a=e.node(i);a.order=o+t,f(a.selfEdges,function(u){N(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Tt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function q(e,n){return j(B(e,n),Number)}function W(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{At as l};
|