showai-reader 0.9.0 → 0.10.0-reader.2b3akv2q
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/chunks/CardGrid-CXO2U3K5.js +2 -0
- package/chunks/CommandReference-E5Y6VMXC.js +3 -0
- package/chunks/ComparisonMatrix-TXTUZF55.js +1 -0
- package/chunks/EventTimeline-JOTYNIMI.js +2 -0
- package/chunks/ExperimentTracker-CWZCU2QO.js +1 -0
- package/chunks/{ExternalDiagram-3BONLRGZ.js → ExternalDiagram-WFWITA4Q.js} +7924 -4810
- package/chunks/Flowchart-DJGFXDXU.js +11 -0
- package/chunks/{G2Chart-GQH7Q6PL.js → G2Chart-YVTXVVRZ.js} +2 -2
- package/chunks/LayerDiagram-KDSBIPHG.js +2 -0
- package/chunks/{Mindmap-UMIFB7CR.js → Mindmap-SB34H5SG.js} +2 -2
- package/chunks/RichTextEditor-SMQMXUUN.js +156 -0
- package/chunks/Roadmap-BSPT5PBK.js +2 -0
- package/chunks/{Scene3D-J7TCRL6V.js → Scene3D-VILMVRHH.js} +2 -2
- package/chunks/SequenceDiagram-W2YQCHNV.js +2 -0
- package/chunks/StatusTree-57AOX2U2.js +1 -0
- package/chunks/StepGuide-VQRICGFO.js +1 -0
- package/chunks/StructureBrowser-PVPAFYTN.js +3 -0
- package/chunks/Waterfall-FIQDQSMD.js +2 -0
- package/chunks/chunk-3RZMLHCB.js +1 -0
- package/chunks/chunk-55FJSXTX.js +1 -0
- package/chunks/{chunk-WDYURK6F.js → chunk-5AW2WUSZ.js} +1 -1
- package/chunks/chunk-5HKZMSJF.js +9 -0
- package/chunks/{chunk-SWLYSV5D.js → chunk-5SAGHDIJ.js} +1 -1
- package/chunks/chunk-6WTBCWHP.js +23 -0
- package/chunks/{chunk-4QSHXFHM.js.LEGAL.txt → chunk-6WTBCWHP.js.LEGAL.txt} +26 -8
- package/chunks/{chunk-LAAA5HWB.js → chunk-7FHZWI2R.js} +1 -1
- package/chunks/chunk-7G6RMB6W.js +5 -0
- package/chunks/chunk-7TNODUAV.js +4 -0
- package/chunks/chunk-AIBH6MTQ.js +1 -0
- package/chunks/chunk-DCANE7XH.js +1 -0
- package/chunks/chunk-DTW4F4AN.js +1 -0
- package/chunks/{chunk-CEJFAFXK.js → chunk-GREB3PFJ.js} +50 -47
- package/chunks/chunk-ISEW5ABW.js +1 -0
- package/chunks/chunk-J6IRWTF7.js +1 -0
- package/chunks/chunk-JXKAISUX.js +1 -0
- package/chunks/chunk-KYWOOES7.js +2 -0
- package/chunks/{chunk-LY26FKQZ.js → chunk-MENLQ7WW.js} +1 -1
- package/chunks/{chunk-7GHGKKPY.js → chunk-SNEZ3O5V.js} +1 -1
- package/chunks/chunk-TFZIEWR5.js +1 -0
- package/chunks/chunk-UWAAPX6Y.js +1 -0
- package/chunks/{chunk-MPVTJQTD.js → chunk-VUDDBRCY.js} +2 -2
- package/chunks/chunk-X6OHYKIW.js +2 -0
- package/chunks/code-highlighting-F3WJZEML.js +1 -0
- package/chunks/{pdf-engine-PQMJ3BVE.js → pdf-engine-XQHKQXXX.js} +1 -1
- package/index.js +1 -1
- package/manifest.json +6 -5
- package/package.json +1 -1
- package/reader-2B3AKV2Q.js +51 -0
- package/chunks/ComparisonMatrix-SYFIP5WP.js +0 -1
- package/chunks/ExperimentTracker-HOUNXCEC.js +0 -1
- package/chunks/Flowchart-72CIZ5IT.js +0 -10
- package/chunks/RichTextEditor-YMFOBGOU.js +0 -155
- package/chunks/StatusTree-MDKGDYK5.js +0 -1
- package/chunks/chunk-4QSHXFHM.js +0 -21
- package/chunks/chunk-6WHB3GS2.js +0 -2
- package/chunks/chunk-DUIGVKKG.js +0 -1
- package/chunks/chunk-M3KEZP5Z.js +0 -1
- package/chunks/chunk-QSELZI5S.js +0 -1
- package/chunks/chunk-YSVZKKKM.js +0 -1
- package/reader-N3YKYCK3.js +0 -40
- /package/chunks/{G2Chart-GQH7Q6PL.js.LEGAL.txt → G2Chart-YVTXVVRZ.js.LEGAL.txt} +0 -0
- /package/chunks/{Scene3D-J7TCRL6V.js.LEGAL.txt → Scene3D-VILMVRHH.js.LEGAL.txt} +0 -0
- /package/chunks/{Flowchart-72CIZ5IT.js.LEGAL.txt → chunk-KYWOOES7.js.LEGAL.txt} +0 -0
- /package/chunks/{chunk-MPVTJQTD.js.LEGAL.txt → chunk-VUDDBRCY.js.LEGAL.txt} +0 -0
- /package/{reader-N3YKYCK3.js.LEGAL.txt → reader-2B3AKV2Q.js.LEGAL.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b,c as y,e as x}from"./chunk-55FJSXTX.js";var s=e=>{throw new Error(e)},E=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function u(e,n,o){(typeof e!="string"||!e.trim())&&s(`${n} must be non-empty text.`),e.length>o&&s(`${n} must be at most ${o} characters.`)}function f(e,n,o){e!==void 0&&u(e,n,o)}function j(e,n,o,i=1){return(!Array.isArray(e)||e.length<i||e.length>o)&&s(`${n} must be an array of ${i} to ${o} items.`),e.forEach((l,a)=>{E(l)||s(`${n}[${a}] must be an object.`)}),e}function A(e,n,o){for(let i of Object.keys(e))n.includes(i)||s(`${o}.${i} is not a supported field.`)}function d(e,n){if(e===void 0)return;let[o]=x(e);o!==void 0&&s(`${n} links to ${o}; only http(s), mailto, # anchors and relative paths are allowed.`)}var w=["dir","file","object","array","field"],I=["name","kind","type","badge","summary","detail","example","exampleLang","children","open"],p={siblings:60,nodes:400,depth:8},g=e=>e.replace(/\/+$/,"")||e,T=e=>e.split("/").filter(Boolean).join("/"),C=e=>e.kind??(e.children?.length?"dir":"file");function U(e){let n=new Map,o=[],i=(l,a,m,h)=>{for(let t of l??[]){let c=(a?`${a}/`:"")+g(t.name),r={node:t,path:c,depth:m,parent:a,kind:C(t),children:[]};n.set(c,r),h.push(c),i(t.children,c,m+1,r.children)}};return i(e,null,0,o),{items:n,roots:o}}function L(e){f(e.caption,"caption",600),d(e.caption,"caption");let n=0,o=new Set,i=(l,a,m,h)=>{h>p.depth&&s(`${a} is nested deeper than ${p.depth} levels.`),j(l,a,p.siblings),l.forEach((t,c)=>{let r=`${a}[${c}]`;n+=1,n>p.nodes&&s(`The structure has more than ${p.nodes} nodes.`),A(t,I,r),u(t.name,`${r}.name`,80),g(t.name).includes("/")&&s(`${r}.name may only end with "/"; it is one path segment.`);let $=(m?`${m}/`:"")+g(t.name);o.has($)&&s(`${r}.name repeats the path ${$}; sibling names must be unique.`),o.add($),t.kind!==void 0&&!w.includes(t.kind)&&s(`${r}.kind must be one of ${w.join(", ")}.`),f(t.type,`${r}.type`,80),f(t.badge,`${r}.badge`,16),f(t.summary,`${r}.summary`,300),f(t.detail,`${r}.detail`,3e3),f(t.example,`${r}.example`,6e3),f(t.exampleLang,`${r}.exampleLang`,24),d(t.summary,`${r}.summary`),d(t.detail,`${r}.detail`),t.exampleLang!==void 0&&t.example===void 0&&s(`${r}.exampleLang needs ${r}.example.`),t.open!==void 0&&typeof t.open!="boolean"&&s(`${r}.open must be true or false.`),t.children!==void 0&&i(t.children,`${r}.children`,$,h+1)})};if(i(e.nodes,"nodes",null,1),e.initial!==void 0){u(e.initial,"initial",400);let l=T(e.initial);o.has(l)||s(`initial ${e.initial} does not match a node path.`)}}var k=["brand","teal","warm","violet","rose","slate"],S=["tile","row"],R=["icon","title","body","href","tag","tone"];function K(e){if(e.columns)return e.columns;let n=e.cards.length;return e.variant==="row"?n>3?2:1:n===4?2:Math.max(1,Math.min(3,n))}function D(e){e.variant!==void 0&&!S.includes(e.variant)&&s(`variant must be one of ${S.join(", ")}.`),e.columns!==void 0&&(!Number.isInteger(e.columns)||e.columns<1||e.columns>4)&&s("columns must be an integer from 1 to 4."),j(e.cards,"cards",24).forEach((n,o)=>{let i=`cards[${o}]`;A(n,R,i),u(n.title,`${i}.title`,80),u(n.body,`${i}.body`,400),f(n.icon,`${i}.icon`,8),f(n.tag,`${i}.tag`,16),n.tone!==void 0&&!k.includes(n.tone)&&s(`${i}.tone must be one of ${k.join(", ")}.`),n.href!==void 0?(u(n.href,`${i}.href`,2e3),b(n.href)||s(`${i}.href must be an http(s), mailto, # anchor or relative link.`),y(n.body).some(l=>l.type==="link")&&s(`${i}.body cannot contain links when the card has an href.`)):d(n.body,`${i}.body`)})}function M(e,n){return E(n)||s("Component data must be an object."),f(n.title,"title",120),e==="structure-browser"?L(n):e==="card-grid"?D(n):s(`Unknown document browsing component ${e}.`),n}export{g as a,T as b,U as c,k as d,K as e,M as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function m(e,n){return{name:e,catalogs:n}}function f(e){let t=(typeof e=="string"?[e]:e??[]).find(r=>!!r&&r.trim()!=="");return t&&/^zh\b/i.test(t.trim())?"zh-CN":"en"}function c(){return typeof process<"u"&&process.env?process.env:{}}function d(){let e=c().SHOWAI_LANGUAGE;if(e)return[e];if(typeof navigator<"u"){if(navigator.languages?.length)return navigator.languages;if(navigator.language)return[navigator.language]}let n=c(),t=n.LC_ALL||n.LC_MESSAGES||n.LANG;return t&&t!=="C"&&t!=="POSIX"?[t.split(/[.@]/)[0].replace("_","-")]:[Intl.DateTimeFormat().resolvedOptions().locale]}function p(){if(typeof document>"u")return;let e=document.documentElement?.dataset.showaiLocale;return e==="zh-CN"||e==="en"?e:void 0}var g=f(d());var a=p()??g,i=new Set;function L(e,n=!1){if(typeof document<"u"&&(document.documentElement.lang=e,document.documentElement.dataset.showaiLocale=e),!(e===a&&!n)){a=e;for(let t of[...i])t()}}function T(){return a}function h(e,n){n&&(g=n),L(e)}function x(e){return i.add(e),()=>i.delete(e)}var l=new Map;function y(e,n,t=a){let r;if(typeof e=="string")r=e;else{let o=Number(n?.count??0),s=l.get(t);s||l.set(t,s=new Intl.PluralRules(t));let u=o===0&&e.zero!==void 0?"zero":s.select(o);r=e[u]??e.other}return n?r.replace(/\{(\w+)\}/g,(o,s)=>Object.prototype.hasOwnProperty.call(n,s)?String(n[s]):o):r}function v(e){return(n,t)=>{let o=e.catalogs[a][n]??e.catalogs["zh-CN"][n];return o===void 0?`${e.name}.${n}`:y(o,t)}}export{m as a,f as b,T as c,h as d,x as e,v as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=e=>{throw new Error(e)},E=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function c(e,n){(typeof e!="string"||!e.trim())&&o(`${n} must be non-empty text.`)}function d(e,n){e!==void 0&&c(e,n)}function b(e,n){(typeof e!="number"||!Number.isFinite(e))&&o(`${n} must be a finite number.`)}function $(e,n,i,u=0){return(!Array.isArray(e)||e.length<u||e.length>i)&&o(`${n} must be an array of ${u} to ${i} items.`),e.forEach((r,a)=>{E(r)||o(`${n}[${a}] must be an object.`)}),e}function g(e,n){e!==void 0&&!/^#[0-9a-fA-F]{6}$/.test(e)&&o(`${n} must be a six-digit hex color.`)}function N(e,n){e!==void 0&&typeof e!="boolean"&&o(`${n} must be true or false.`)}function h(e,n){e!==void 0&&!T.includes(e)&&o(`${n} must be one of ${T.join(", ")}.`)}var T=["neutral","info","good","warn","bad","accent"],k=["number","clock","date"],x={points:500,series:3,phases:12,kinds:8,events:80,summary:6},v=/^([01]\d|2[0-3]):[0-5]\d$/,D=/^\d{4}-\d{2}-\d{2}$/,S=864e5;function A(e){let[n,i,u]=e.split("-").map(Number),r=Date.UTC(n,i-1,u),a=new Date(r);return a.getUTCFullYear()===n&&a.getUTCMonth()===i-1&&a.getUTCDate()===u?r:NaN}function y(e,n,i){(!Number.isInteger(e)||e<0||e>=i)&&o(`${n} must be a point index from 0 to ${i-1}.`)}function C(e){if(E(e)||o("axis must be an object."),k.includes(e.type)||o(`axis.type must be one of ${k.join(", ")}.`),d(e.label,"axis.label"),e.step!==void 0&&(b(e.step,"axis.step"),e.step<=0&&o("axis.step must be greater than 0."),e.type!=="number"&&!Number.isInteger(e.step)&&o(`axis.step must be a whole number of ${e.type==="clock"?"minutes":"days"}.`)),e.type==="number"){e.start!==void 0&&b(e.start,"axis.start");for(let n of["prefix","unit"])e[n]!==void 0&&(typeof e[n]!="string"||!e[n].trim())&&o(`axis.${n} must be non-empty text.`)}else e.type==="clock"?(typeof e.start!="string"||!v.test(e.start))&&o("axis.start must be a 24-hour time like 13:50 for a clock axis."):(typeof e.start!="string"||!D.test(e.start)||Number.isNaN(A(e.start)))&&o("axis.start must be a date like 2026-10-18 for a date axis.");if(e.count!==void 0){let{points:n}=x;(!Number.isInteger(e.count)||e.count<2||e.count>n)&&o(`axis.count must be a whole number from 2 to ${n}.`)}}function I(e){return e.axis.count??e.series?.[0]?.values.length??0}function _(e){E(e)||o("Component data must be an object."),d(e.title,"title"),d(e.description,"description"),d(e.note,"note"),C(e.axis);let n=x,i=$(e.series??[],"series",n.series),u=new Set;i.forEach((t,f)=>{let s=`series[${f}]`;c(t.id,`${s}.id`),u.has(t.id)&&o(`series contains duplicate id ${t.id}.`),u.add(t.id),c(t.label,`${s}.label`),d(t.unit,`${s}.unit`),h(t.tone,`${s}.tone`),g(t.color,`${s}.color`),N(t.area,`${s}.area`),N(t.dashed,`${s}.dashed`),t.axis!==void 0&&!["left","right"].includes(t.axis)&&o(`${s}.axis must be left or right.`),t.min!==void 0&&b(t.min,`${s}.min`),t.max!==void 0&&b(t.max,`${s}.max`),t.min!==void 0&&t.max!==void 0&&t.min>=t.max&&o(`${s}.min must be below ${s}.max.`),Array.isArray(t.values)||o(`${s}.values must be an array of numbers.`),t.values.forEach((l,w)=>{l!==null&&b(l,`${s}.values[${w}]`)}),t.values.some(l=>l!==null)||o(`${s}.values needs at least one number.`)}),e.axis.count===void 0&&i.length===0&&o("axis.count is required when there are no series.");let r=I(e);(r<2||r>n.points)&&o(`The axis must have 2 to ${n.points} points.`),i.forEach((t,f)=>{t.values.length!==r&&o(`series[${f}].values must have ${r} values, one per axis point.`)}),$(e.phases??[],"phases",n.phases).forEach((t,f)=>{let s=`phases[${f}]`;c(t.label,`${s}.label`),h(t.tone,`${s}.tone`),y(t.from,`${s}.from`,r),y(t.to,`${s}.to`,r),t.to<=t.from&&o(`${s}.to must be after ${s}.from.`);let l=e.phases[f-1];l&&t.from<l.to&&o(`${s} overlaps the previous phase; phases must be in order.`)});let a=$(e.kinds??[],"kinds",n.kinds),m=new Set;a.forEach((t,f)=>{c(t.id,`kinds[${f}].id`),m.has(t.id)&&o(`kinds contains duplicate id ${t.id}.`),m.add(t.id),c(t.label,`kinds[${f}].label`),h(t.tone,`kinds[${f}].tone`),g(t.color,`kinds[${f}].color`)});let p=$(e.events,"events",n.events);return p.forEach((t,f)=>{let s=`events[${f}]`;y(t.at,`${s}.at`,r),f>0&&t.at<p[f-1].at&&o(`${s}.at is before the previous event; list events in time order.`),c(t.title,`${s}.title`),d(t.detail,`${s}.detail`),t.kind!==void 0&&!m.has(t.kind)&&o(`${s}.kind ${t.kind} is not a defined kind.`)}),$(e.summary??[],"summary",n.summary).forEach((t,f)=>{c(t.label,`summary[${f}].label`),c(t.value,`summary[${f}].value`),h(t.tone,`summary[${f}].tone`)}),e.initialAt!==void 0&&y(e.initialAt,"initialAt",r),e}function j(e,n){let i=-1;return e.forEach((u,r)=>{u.at<=n&&(i=r)}),i}function F(e,n){let i=-1;return(e??[]).forEach((u,r)=>{u.from<=n&&n<=u.to&&(i=r)}),i}function L(e){return e.initialAt??e.events[0]?.at??I(e)-1}function M(e,n,i="en"){let u=e.step??1;if(e.type==="clock"){let[m,p]=e.start.split(":").map(Number),t=((m*60+p+n*u)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}if(e.type==="date")return new Intl.DateTimeFormat(i,{month:"numeric",day:"numeric",timeZone:"UTC"}).format(new Date(A(e.start)+n*u*S));let r=(e.start??0)+n*u,a=new Intl.NumberFormat(i,{maximumFractionDigits:3}).format(r);return`${e.prefix??""}${a}${e.unit??""}`}export{I as a,_ as b,j as c,F as d,L as e,M as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var Ze=new Set(["request","skill","decision","reference","query","result"]),et=new Set(["__proto__","prototype","constructor"]),ae=["ok","warn","bad","idle","active"],tt=new Set(ae);function L(e,t,r=!1,n=1e4){if(!(e===void 0&&!r)&&(typeof e!="string"||e.length>n||r&&!e.trim()))throw new Error(`${t} must be ${r?"non-empty ":""}text.`)}function Y(e,t,r){if(!Array.isArray(e)||e.length>r)throw new Error(`${t} must contain at most ${r} items.`);let n=new Set;for(let i of e){if(!i||typeof i!="object"||Array.isArray(i))throw new Error(`${t} requires objects.`);if(L(i.id,`${t}.id`,!0,200),et.has(i.id)||n.has(i.id))throw new Error(`${t} requires unique, non-reserved IDs.`);n.add(i.id)}return n}function On(e){if(L(e.title,"flowchart.title"),L(e.description,"flowchart.description"),e.height!==void 0&&(!Number.isFinite(e.height)||e.height<360||e.height>1200))throw new Error("Flowchart height must be between 360 and 1200.");Y(e.flows,"flowchart.flows",20);for(let t of e.flows){if(L(t.label,"flow.label",!0,200),L(t.description,"flow.description"),t.direction!==void 0&&!["TB","LR"].includes(t.direction))throw new Error("Flow direction must be TB or LR.");let r=Y(t.nodes,"flow.nodes",200);Y(t.edges,"flow.edges",400);for(let n of t.nodes){L(n.label,"node.label",!0,200),L(n.subtitle,"node.subtitle",!1,300),L(n.detail,"node.detail");for(let i of["sourceSide","targetSide"])if(n[i]!==void 0&&!["top","bottom","left","right"].includes(n[i]))throw new Error(`${i} must be a valid connection side.`);if(n.kind!==void 0&&!Ze.has(n.kind))throw new Error("Unsupported flow node kind.");for(let i of["commands","references"])if(n[i]!==void 0){if(!Array.isArray(n[i])||n[i].length>30)throw new Error(`${i} must have at most 30 entries.`);n[i].forEach(o=>L(o,i,!0,3e3))}if(n.position&&(!Number.isFinite(n.position.x)||!Number.isFinite(n.position.y)))throw new Error("Node positions must be finite.")}for(let n of t.edges){if(!r.has(n.source)||!r.has(n.target))throw new Error(`Flow edge ${n.id} references a missing node.`);L(n.label,"edge.label",!1,300)}rt(t,`flowchart.flows[${e.flows.indexOf(t)}]`)}return e}function U(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object.`)}function rt(e,t){let r=new Set(e.nodes.map(i=>i.id)),n=new Map(e.edges.map(i=>[i.id,i]));if(e.journeys!==void 0){let i=Y(e.journeys,`${t}.journeys`,12);if(e.journeys.forEach((o,s)=>{let d=`${t}.journeys[${s}]`;if(L(o.label,`${d}.label`,!0,200),L(o.summary,`${d}.summary`,!1,1e3),!Array.isArray(o.steps)||!o.steps.length||o.steps.length>60)throw new Error(`${d}.steps must contain 1 to 60 steps.`);o.steps.forEach((a,l)=>{let u=`${d}.steps[${l}]`;if(U(a,u),!r.has(a.node))throw new Error(`${u}.node references a missing node.`);if(L(a.title,`${u}.title`,!0,200),L(a.text,`${u}.text`,!0,3e3),a.edge===void 0)return;let h=n.get(a.edge);if(!h)throw new Error(`${u}.edge references a missing edge.`);if(h.source!==a.node&&h.target!==a.node)throw new Error(`${u}.edge must connect to node ${a.node}.`)})}),e.initialJourney!==void 0&&!i.has(e.initialJourney))throw new Error(`${t}.initialJourney references a missing journey.`)}else if(e.initialJourney!==void 0)throw new Error(`${t}.initialJourney requires journeys.`);if(e.stages!==void 0){let i=Y(e.stages,`${t}.stages`,30);if(e.stages.forEach((o,s)=>{let d=`${t}.stages[${s}]`;L(o.label,`${d}.label`,!0,200),L(o.summary,`${d}.summary`,!1,3e3);for(let[a,l,u]of[["nodes",r,"note"],["edges",n,"label"]]){if(o[a]===void 0)continue;U(o[a],`${d}.${a}`);let h=Object.entries(o[a]);if(h.length>(a==="nodes"?200:400))throw new Error(`${d}.${a} has too many entries.`);for(let[c,f]of h){let p=`${d}.${a}.${c}`;if(!l.has(c))throw new Error(`${p} references a missing ${a==="nodes"?"node":"edge"}.`);if(U(f,p),!tt.has(f.state))throw new Error(`${p}.state must be one of ${ae.join(", ")}.`);L(f[u],`${p}.${u}`,!1,300)}}}),e.initialStage!==void 0&&!i.has(e.initialStage))throw new Error(`${t}.initialStage references a missing stage.`)}else if(e.initialStage!==void 0)throw new Error(`${t}.initialStage requires stages.`)}function xn(e,t){return t.steps.map((r,n)=>{if(r.edge!==void 0)return r.edge;let i=t.steps[n-1]?.node;return i===void 0||i===r.node?void 0:(e.edges.find(s=>s.source===i&&s.target===r.node)??e.edges.find(s=>s.source===r.node&&s.target===i))?.id})}var Se=Object.defineProperty,nt=(e,t,r)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,it=(e,t)=>{for(var r in t)Se(e,r,{get:t[r],enumerable:!0})},ot=(e,t,r)=>nt(e,typeof t!="symbol"?t+"":t,r),st={};it(st,{Graph:()=>F,alg:()=>ie});var dt=Object.defineProperty,Me=(e,t)=>{for(var r in t)dt(e,r,{get:t[r],enumerable:!0})},ne=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}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 typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(r=>{t!==void 0?this.setNode(r,t):this.setNode(r)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][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 e in this._nodes}removeNode(e){if(e in this._nodes){let t=r=>this.removeEdge(this._edgeObjs[r]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(r=>{this.setParent(r)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let r=t;r!==void 0;r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let r=new Set(t),n=this.successors(e);if(n)for(let i of n)r.add(i);return Array.from(r.values())}}isLeaf(e){var t;let r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),((t=r?.length)!=null?t:0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([i,o])=>{e(i)&&t.setNode(i,o)}),Object.values(this._edgeObjs).forEach(i=>{t.hasNode(i.v)&&t.hasNode(i.w)&&t.setEdge(i,this.edge(i))});let r={},n=i=>{let o=this.parent(i);return!o||t.hasNode(o)?(r[i]=o,o):o in r?r[o]:n(o)};return this._isCompound&&t.nodes().forEach(i=>t.setParent(i,n(i))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((r,n)=>(t!==void 0?this.setEdge(r,n,t):this.setEdge(r,n),n)),this}setEdge(e,t,r,n){let i,o,s,d,a=!1;typeof e=="object"&&e!==null&&"v"in e?(i=e.v,o=e.w,s=e.name,arguments.length===2&&(d=t,a=!0)):(i=e,o=t,s=n,arguments.length>2&&(d=r,a=!0)),i=""+i,o=""+o,s!==void 0&&(s=""+s);let l=V(this._isDirected,i,o,s);if(l in this._edgeLabels)return a&&(this._edgeLabels[l]=d),this;if(s!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(i),this.setNode(o),this._edgeLabels[l]=a?d:this._defaultEdgeLabelFn(i,o,s);let u=lt(this._isDirected,i,o,s);return i=u.v,o=u.w,Object.freeze(u),this._edgeObjs[l]=u,ue(this._preds[o],i),ue(this._sucs[i],o),this._in[o][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,r){let n=arguments.length===1?K(this._isDirected,e):V(this._isDirected,e,t,r);return this._edgeLabels[n]}edgeAsObj(e,t,r){let n=arguments.length===1?this.edge(e):this.edge(e,t,r);return typeof n!="object"||n===null?{label:n}:n}hasEdge(e,t,r){return(arguments.length===1?K(this._isDirected,e):V(this._isDirected,e,t,r))in this._edgeLabels}removeEdge(e,t,r){let n=arguments.length===1?K(this._isDirected,e):V(this._isDirected,e,t,r),i=this._edgeObjs[n];if(i){let o=i.v,s=i.w;delete this._edgeLabels[n],delete this._edgeObjs[n],he(this._preds[s],o),he(this._sucs[o],s),delete this._in[s][n],delete this._out[o][n],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,r){if(!e)return;let n=Object.values(e);return r?n.filter(i=>i.v===t&&i.w===r||i.v===r&&i.w===t):n}};function ue(e,t){e[t]?e[t]++:e[t]=1}function he(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function V(e,t,r,n){let i=""+t,o=""+r;if(!e&&i>o){let s=i;i=o,o=s}return i+""+o+""+(n===void 0?"\0":n)}function lt(e,t,r,n){let i=""+t,o=""+r;if(!e&&i>o){let d=i;i=o,o=d}let s={v:i,w:o};return n&&(s.name=n),s}function K(e,t){return V(e,t.v,t.w,t.name)}var at={};Me(at,{read:()=>ft,write:()=>ut});function ut(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ht(e),edges:ct(e)},r=e.graph();return r!==void 0&&(t.value=structuredClone(r)),t}function ht(e){return e.nodes().map(t=>{let r=e.node(t),n=e.parent(t),i={v:t};return r!==void 0&&(i.value=r),n!==void 0&&(i.parent=n),i})}function ct(e){return e.edges().map(t=>{let r=e.edge(t),n={v:t.v,w:t.w};return t.name!==void 0&&(n.name=t.name),r!==void 0&&(n.value=r),n})}function ft(e){let t=new ne(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(r=>{t.setNode(r.v,r.value),r.parent&&t.setParent(r.v,r.parent)}),e.edges.forEach(r=>{t.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),t}var ie={};Me(ie,{CycleException:()=>B,bellmanFord:()=>Ce,components:()=>wt,dijkstra:()=>q,dijkstraAll:()=>bt,findCycles:()=>Et,floydWarshall:()=>_t,isAcyclic:()=>Ot,postorder:()=>Nt,preorder:()=>jt,prim:()=>It,shortestPaths:()=>St,tarjan:()=>$e,topsort:()=>Te});var gt=()=>1;function Ce(e,t,r,n){return pt(e,String(t),r||gt,n||function(i){var o;return(o=e.outEdges(i))!=null?o:[]})}function pt(e,t,r,n){let i={},o,s=0,d=e.nodes(),a=function(h){let c=i[h.v],f=i[h.w];if(!c||!f)return;let p=r(h);c.distance+p<f.distance&&(i[h.w]={distance:c.distance+p,predecessor:h.v},o=!0)},l=function(){d.forEach(function(h){n(h).forEach(function(c){let f=c.v===h?c.v:c.w,p=f===c.v?c.w:c.v;a({v:f,w:p})})})};d.forEach(function(h){let c=h===t?0:Number.POSITIVE_INFINITY;i[h]={distance:c,predecessor:""}});let u=d.length;for(let h=1;h<u&&(o=!1,s++,l(),!!o);h++);if(s===u-1&&(o=!1,l(),o))throw new Error("The graph contains a negative weight cycle");return i}function wt(e){let t={},r=[],n;function i(o){var s,d;o in t||(t[o]=!0,n.push(o),(s=e.successors(o))==null||s.forEach(i),(d=e.predecessors(o))==null||d.forEach(i))}return e.nodes().forEach(function(o){n=[],i(o),n.length&&r.push(n)}),r}var Le=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let r=this._keyIndices,n=String(e);if(!(n in r)){let i=this._arr,o=i.length;return r[n]=o,i.push({key:n,priority:t}),this._decrease(o),!0}return!1}removeMin(){if(this.size()===0)throw new Error("Queue underflow");this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let r=this._keyIndices[e];if(r===void 0)throw new Error(`Key not found: ${e}`);let n=this._arr[r].priority;if(t>n)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${n} New: ${t}`);this._arr[r].priority=t,this._decrease(r)}_heapify(e){let t=this._arr,r=2*e,n=r+1,i=e;r<t.length&&(i=t[r].priority<t[i].priority?r:i,n<t.length&&(i=t[n].priority<t[i].priority?n:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,r=t[e].priority,n;for(;e!==0&&(n=e>>1,!(t[n].priority<r));)this._swap(e,n),e=n}_swap(e,t){let r=this._arr,n=this._keyIndices,i=r[e],o=r[t];r[e]=o,r[t]=i,n[o.key]=e,n[i.key]=t}},vt=()=>1;function q(e,t,r,n){let i=function(o){var s;return(s=e.outEdges(o))!=null?s:[]};return mt(e,String(t),r||vt,n||i)}function mt(e,t,r,n){let i={},o=new Le,s,d,a=function(l){let u=l.v!==s?l.v:l.w,h=i[u];if(!h)return;let c=r(l),f=d.distance+c;if(c<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+l+" Weight: "+c);f<h.distance&&(h.distance=f,h.predecessor=s,o.decrease(u,f))};for(e.nodes().forEach(function(l){let u=l===t?0:Number.POSITIVE_INFINITY;i[l]={distance:u,predecessor:""},o.add(l,u)});o.size()>0;){s=o.removeMin();let l=i[s];if(!l||l.distance===Number.POSITIVE_INFINITY)break;d=l,n(s).forEach(a)}return i}function bt(e,t,r){return e.nodes().reduce(function(n,i){return n[i]=q(e,i,t,r),n},{})}function $e(e){let t=0,r=[],n={},i=[];function o(s){var d;let a=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),(d=e.successors(s))==null||d.forEach(function(l){if(l in n){let u=n[l];u!=null&&u.onStack&&(a.lowlink=Math.min(a.lowlink,u.index))}else{o(l);let u=n[l];u&&(a.lowlink=Math.min(a.lowlink,u.lowlink))}}),a.lowlink===a.index){let l=[],u;do{u=r.pop();let h=n[u];h&&(h.onStack=!1),l.push(u)}while(s!==u);i.push(l)}}return e.nodes().forEach(function(s){s in n||o(s)}),i}function Et(e){return $e(e).filter(function(t){var r;let n=t[0];return n?t.length>1||t.length===1&&((r=e.outEdges(n,n))!=null?r:[]).length>0:!1})}var yt=()=>1;function _t(e,t,r){return kt(e,t||yt,r||function(n){var i;return(i=e.outEdges(n))!=null?i:[]})}function kt(e,t,r){let n={},i=e.nodes();return i.forEach(function(o){let s={};n[o]=s,s[o]={distance:0,predecessor:""},i.forEach(function(d){o!==d&&(s[d]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),r(o).forEach(function(d){let a=d.v===o?d.w:d.v,l=t(d);s[a]={distance:l,predecessor:o}})}),i.forEach(function(o){let s=n[o];s&&i.forEach(function(d){let a=n[d];a&&i.forEach(function(l){let u=a[o],h=s[l],c=a[l];if(u&&h&&c){let f=u.distance+h.distance;f<c.distance&&(c.distance=f,c.predecessor=h.predecessor)}})})}),n}var B=class extends Error{constructor(e){super(e),this.name="CycleException"}};function Te(e){let t={},r={},n=[];function i(o){var s;if(o in r)throw new B;o in t||(r[o]=!0,t[o]=!0,(s=e.predecessors(o))==null||s.forEach(i),delete r[o],n.push(o))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new B;return n}function Ot(e){try{Te(e)}catch(t){if(t instanceof B)return!1;throw t}return!0}function xt(e,t,r,n,i){Array.isArray(t)||(t=[t]);let o=(d=>{var a;return(a=e.isDirected()?e.successors(d):e.neighbors(d))!=null?a:[]}),s={};return t.forEach(function(d){if(!e.hasNode(d))throw new Error("Graph does not have node: "+d);i=Fe(e,d,r==="post",s,o,n,i)}),i}function Fe(e,t,r,n,i,o,s){return t in n||(n[t]=!0,r||(s=o(s,t)),i(t).forEach(function(d){s=Fe(e,d,r,n,i,o,s)}),r&&(s=o(s,t))),s}function Pe(e,t,r){return xt(e,t,r,function(n,i){return n.push(i),n},[])}function Nt(e,t){return Pe(e,t,"post")}function jt(e,t){return Pe(e,t,"pre")}function It(e,t){var r;let n=new ne,i={},o=new Le,s;function d(u){let h=u.v===s?u.w:u.v,c=o.priority(h);if(c!==void 0){let f=t(u);f<c&&(i[h]=s,o.decrease(h,f))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(u){o.add(u,Number.POSITIVE_INFINITY),n.setNode(u)});let a=e.nodes()[0];a!==void 0&&o.decrease(a,0);let l=!1;for(;o.size()>0;){if(s=o.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}(r=e.nodeEdges(s))==null||r.forEach(d)}return n}function St(e,t,r,n){return Mt(e,t,r,n??(i=>{var o;return(o=e.outEdges(i))!=null?o:[]}))}function Mt(e,t,r,n){if(r===void 0)return q(e,t,r,n);let i=!1,o=e.nodes();for(let s=0;s<o.length;s++){let d=o[s];if(d===void 0)continue;let a=n(d);for(let l=0;l<a.length;l++){let u=a[l];if(!u)continue;let h=u.v===d?u.v:u.w,c=h===u.v?u.w:u.v;r({v:h,w:c})<0&&(i=!0)}if(i)return Ce(e,t,r,n)}return q(e,t,r,n)}var F=ne;function D(e,t,r,n){let i=n;for(;e.hasNode(i);)i=oe(n);return r.dummy=t,e.setNode(i,r),i}function Ct(e){let t=new F().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function Re(e){let t=new F({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t}function ce(e,t){let r=e.x,n=e.y,i=t.x-r,o=t.y-n,s=e.width/2,d=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");let a,l;return Math.abs(o)*s>Math.abs(i)*d?(o<0&&(d=-d),a=d*i/o,l=d):(i<0&&(s=-s),a=s,l=s*o/i),{x:r+a,y:n+l}}function J(e){let t=G(De(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),i=n.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][n.order]=r)}),t}function Lt(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MAX_VALUE:i}),r=T(Math.min,t);e.nodes().forEach(n=>{let i=e.node(n);Object.hasOwn(i,"rank")&&(i.rank-=r)})}function $t(e){let t=e.nodes().map(s=>e.node(s).rank).filter(s=>s!==void 0),r=T(Math.min,t),n=[];e.nodes().forEach(s=>{let d=e.node(s).rank-r;n[d]||(n[d]=[]),n[d].push(s)});let i=0,o=e.graph().nodeRankFactor;Array.from(n).forEach((s,d)=>{s===void 0&&d%o!==0?--i:s!==void 0&&i&&s.forEach(a=>e.node(a).rank+=i)})}function fe(e,t,r,n){let i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),D(e,"border",i,t)}function Tt(e,t=Ae){let r=[];for(let n=0;n<e.length;n+=t){let i=e.slice(n,n+t);r.push(i)}return r}var Ae=65535;function T(e,t){if(t.length>Ae){let r=Tt(t);return e(...r.map(n=>e(...n)))}else return e(...t)}function De(e){let t=e.nodes().map(r=>{let n=e.node(r).rank;return n===void 0?Number.MIN_VALUE:n});return T(Math.max,t)}function Ft(e,t){let r={lhs:[],rhs:[]};return e.forEach(n=>{t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Pt(e,t){return t()}var Rt=0;function oe(e){let t=++Rt;return e+(""+t)}function G(e,t,r=1){t==null&&(t=e,e=0);let n=o=>o<t;r<0&&(n=o=>t<o);let i=[];for(let o=e;n(o);o+=r)i.push(o);return i}function z(e,t){let r={};for(let n of t)e[n]!==void 0&&(r[n]=e[n]);return r}function X(e,t){let r;return typeof t=="string"?r=n=>n[t]:r=t,Object.entries(e).reduce((n,[i,o])=>(n[i]=r(o,i),n),{})}function At(e,t){return e.reduce((r,n,i)=>(r[n]=t[i],r),{})}var W="\0";function Ye(e,t,r){var n,i,o,s,d,a;if(!(e&&t&&r&&t.dummy==="edge"&&r.dummy==="edge"&&t.edgeObj&&r.edgeObj&&e[t.edgeObj.v]&&e[r.edgeObj.v]&&e[t.edgeObj.w]&&e[r.edgeObj.w]))return 0;let l=!0;t.edgeObj.w===r.edgeObj.w&&(l=!1);let u=l?(i=(n=e[t.edgeObj.v])==null?void 0:n.rank)!=null?i:NaN+1:(s=(o=e[t.edgeObj.w])==null?void 0:o.rank)!=null?s:NaN-1,h=Object.entries(e).find(E=>{var y,m;return((y=E[1].edgeObj)==null?void 0:y.v)===t.edgeObj.v&&((m=E[1].edgeObj)==null?void 0:m.w)===t.edgeObj.w&&E[1].rank===u}),c=Object.entries(e).find(E=>{var y,m;return((y=E[1].edgeObj)==null?void 0:y.v)===r.edgeObj.v&&((m=E[1].edgeObj)==null?void 0:m.w)===r.edgeObj.w&&E[1].rank===u});if(!h||!c)return 0;let f=(d=h[1].order)!=null?d:NaN,p=(a=c[1].order)!=null?a:NaN;return isNaN(f-p)?0:f-p}var Dt=class{constructor(){ot(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return ge(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&ge(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,Yt)),r=r._prev;return"["+e.join(", ")+"]"}};function ge(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Yt(e,t){if(e!=="_next"&&e!=="_prev")return t}var Vt=Dt,Gt=()=>1;function qt(e,t){if(e.nodeCount()<=1)return[];let r=zt(e,t||Gt);return Bt(r.graph,r.buckets,r.zeroIdx).flatMap(n=>e.outEdges(n.v,n.w)||[])}function Bt(e,t,r){var n;let i=[],o=t[t.length-1],s=t[0],d;for(;e.nodeCount();){for(;d=s.dequeue();)Q(e,t,r,d);for(;d=o.dequeue();)Q(e,t,r,d);if(e.nodeCount()){for(let a=t.length-2;a>0;--a)if(d=(n=t[a])==null?void 0:n.dequeue(),d){i=i.concat(Q(e,t,r,d,!0)||[]);break}}}return i}function Q(e,t,r,n,i){let o=[],s=i?o:void 0;return(e.inEdges(n.v)||[]).forEach(d=>{let a=e.edge(d),l=e.node(d.v);i&&o.push({v:d.v,w:d.w}),l.out-=a,re(t,r,l)}),(e.outEdges(n.v)||[]).forEach(d=>{let a=e.edge(d),l=d.w,u=e.node(l);u.in-=a,re(t,r,u)}),e.removeNode(n.v),s}function zt(e,t){let r=new F,n=0,i=0;e.nodes().forEach(d=>{r.setNode(d,{v:d,in:0,out:0})}),e.edges().forEach(d=>{let a=r.edge(d.v,d.w)||0,l=t(d),u=a+l;r.setEdge(d.v,d.w,u);let h=r.node(d.v),c=r.node(d.w);i=Math.max(i,h.out+=l),n=Math.max(n,c.in+=l)});let o=Jt(i+n+3).map(()=>new Vt),s=n+1;return r.nodes().forEach(d=>{re(o,s,r.node(d))}),{graph:r,buckets:o,zeroIdx:s}}function re(e,t,r){var n,i,o;r.out?r.in?(o=e[r.out-r.in+t])==null||o.enqueue(r):(i=e[e.length-1])==null||i.enqueue(r):(n=e[0])==null||n.enqueue(r)}function Jt(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t}function Xt(e,t){(e.graph().acyclicer==="greedy"?qt(e,r(e)):Wt(e,t??null)).forEach(n=>{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,oe("rev"))});function r(n){return i=>n.edge(i).weight}}function Wt(e,t){let r=[],n={},i={};function o(a){Object.hasOwn(i,a)||(i[a]=!0,n[a]=!0,e.outEdges(a).forEach(l=>{Object.hasOwn(n,l.w)?r.push(l):o(l.w)}),delete n[a])}function s(a){var l;Object.hasOwn(i,a)||(i[a]=!0,n[a]=!0,(l=e.outEdges(a))==null||l.forEach(u=>{var h,c;Object.hasOwn(n,u.w)||((h=t.node(a))==null?void 0:h.rank)>((c=t.node(u.w))==null?void 0:c.rank)&&Kt(e,u.w,u)?r.push(u):s(u.w)}),delete n[a])}let d=o;return t&&typeof t.node=="function"&&(d=s),e.sources().forEach(d),e.nodes().forEach(d),r}function Ut(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}function Kt(e,t,r){let n=new Set;function i(o){var s;if(e.sources().includes(o))return!0;n.add(o);for(let d of(s=e.inEdges(o))!=null?s:[])if(!(d.v===r.v&&d.w===r.w)&&!n.has(d.v)&&i(d.v))return!0;return!1}return i(t)}function Qt(e){e.graph().dummyChains=[],e.edges().forEach(t=>Ht(e,t))}function Ht(e,t){let r=t.v,n=e.node(r).rank,i=t.w,o=e.node(i).rank,s=t.name,d=e.edge(t),a=d.labelRank;if(o===n+1)return;e.removeEdge(t);let l,u,h;for(h=0,++n;n<o;++h,++n)d.points=[],u={width:0,height:0,edgeLabel:d,edgeObj:t,rank:n},l=D(e,"edge",u,"_d"),n===a&&(u.width=d.width,u.height=d.height,u.dummy="edge-label",u.labelpos=d.labelpos),e.setEdge(r,l,{weight:d.weight},s),h===0&&e.graph().dummyChains.push(l),r=l;e.setEdge(r,i,{weight:d.weight},s)}function Zt(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,i;for(e.setEdge(r.edgeObj,n);r.dummy;)i=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=i,r=e.node(t)})}function se(e){let t={};function r(n){let i=e.node(n);if(Object.hasOwn(t,n))return i.rank;t[n]=!0;let o=e.outEdges(n),s=o?o.map(a=>a==null?Number.POSITIVE_INFINITY:r(a.w)-e.edge(a).minlen):[],d=T(Math.min,s);return d===Number.POSITIVE_INFINITY&&(d=0),i.rank=d}e.sources().forEach(r)}function A(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Ve=er;function er(e){let t=new F({directed:!1}),r=e.nodes();if(r.length===0)throw new Error("Graph must have at least one node");let n=r[0],i=e.nodeCount();t.setNode(n,{});let o,s;for(;tr(t,e)<i&&(o=rr(t,e),!!o);)s=t.hasNode(o.v)?A(e,o):-A(e,o),nr(t,e,s);return t}function tr(e,t){function r(n){let i=t.nodeEdges(n);i&&i.forEach(o=>{let s=o.v,d=n===s?o.w:s;!e.hasNode(d)&&!A(t,o)&&(e.setNode(d,{}),e.setEdge(n,d,{}),r(d))})}return e.nodes().forEach(r),e.nodeCount()}function rr(e,t){return t.edges().reduce((r,n)=>{let i=Number.POSITIVE_INFINITY;return e.hasNode(n.v)!==e.hasNode(n.w)&&(i=A(t,n)),i<r[0]?[i,n]:r},[Number.POSITIVE_INFINITY,null])[1]}function nr(e,t,r){e.nodes().forEach(n=>t.node(n).rank+=r)}var{preorder:ir,postorder:or}=ie,sr=P;P.initLowLimValues=le;P.initCutValues=de;P.calcCutValue=Ge;P.leaveEdge=Be;P.enterEdge=ze;P.exchangeEdges=Je;function P(e){e=Ct(e),se(e);let t=Ve(e);le(t),de(t,e);let r,n;for(;r=Be(t);)n=ze(t,e,r),Je(t,e,r,n)}function de(e,t){let r=or(e,e.nodes());r=r.slice(0,r.length-1),r.forEach(n=>dr(e,t,n))}function dr(e,t,r){let n=e.node(r).parent,i=e.edge(r,n);i.cutvalue=Ge(e,t,r)}function Ge(e,t,r){let n=e.node(r).parent,i=!0,o=t.edge(r,n),s=0;o||(i=!1,o=t.edge(n,r)),s=o.weight;let d=t.nodeEdges(r);return d&&d.forEach(a=>{let l=a.v===r,u=l?a.w:a.v;if(u!==n){let h=l===i,c=t.edge(a).weight;if(s+=h?c:-c,ar(e,r,u)){let f=e.edge(r,u).cutvalue;s+=h?-f:f}}}),s}function le(e,t){arguments.length<2&&(t=e.nodes()[0]),qe(e,{},1,t)}function qe(e,t,r,n,i){let o=r,s=e.node(n);t[n]=!0;let d=e.neighbors(n);return d&&d.forEach(a=>{Object.hasOwn(t,a)||(r=qe(e,t,r,a,n))}),s.low=o,s.lim=r++,i?s.parent=i:delete s.parent,r}function Be(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function ze(e,t,r){let n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);let o=e.node(n),s=e.node(i),d=o,a=!1;return o.lim>s.lim&&(d=s,a=!0),t.edges().filter(l=>a===pe(e,e.node(l.v),d)&&a!==pe(e,e.node(l.w),d)).reduce((l,u)=>A(t,u)<A(t,l)?u:l)}function Je(e,t,r,n){let i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(n.v,n.w,{}),le(e),de(e,t),lr(e,t)}function lr(e,t){let r=e.nodes().find(i=>!e.node(i).parent);if(!r)return;let n=ir(e,[r]);n=n.slice(1),n.forEach(i=>{let o=e.node(i).parent,s=t.edge(i,o),d=!1;s||(s=t.edge(o,i),d=!0),t.node(i).rank=t.node(o).rank+(d?s.minlen:-s.minlen)})}function ar(e,t,r){return e.hasEdge(t,r)}function pe(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var ur=hr;function hr(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":we(e);break;case"tight-tree":fr(e);break;case"longest-path":cr(e);break;case"none":break;default:we(e)}}var cr=se;function fr(e){se(e),Ve(e)}function we(e){sr(e)}var gr=pr;function pr(e){let t=vr(e),r=e.graph();Array.isArray(r.dummyChains)&&r.dummyChains.forEach(n=>{let i=e.node(n),o=i.edgeObj,s=wr(e,t,o.v,o.w),d=s.path,a=s.lca,l=0,u=d[l],h=!0;for(;n!==o.w;){if(i=e.node(n),h){for(;(u=d[l])!==a&&e.node(u).maxRank<i.rank;)l++;u===a&&(h=!1)}if(!h){for(;l<d.length-1&&e.node(d[l+1]).minRank<=i.rank;)l++;u=d[l]}u!==void 0&&e.setParent(n,u),n=e.successors(n)[0]}})}function wr(e,t,r,n){let i=[],o=[],s=Math.min(t[r].low,t[n].low),d=Math.max(t[r].lim,t[n].lim),a;a=r;do a=e.parent(a),i.push(a);while(a&&(t[a].low>s||d>t[a].lim));let l=a,u=n;for(;(u=e.parent(u))!==l;)o.push(u);return{path:i.concat(o.reverse()),lca:l}}function vr(e){let t={},r=0;function n(i){let o=r;e.children(i).forEach(n),t[i]={low:o,lim:r++}}return e.children(W).forEach(n),t}function mr(e){let t=D(e,"root",{},"_root"),r=br(e),n=Object.values(r),i=T(Math.max,n)-1,o=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(d=>e.edge(d).minlen*=o);let s=Er(e)+1;e.children(W).forEach(d=>{Xe(e,t,o,s,i,r,d)}),e.graph().nodeRankFactor=o}function Xe(e,t,r,n,i,o,s){var d;let a=e.children(s);if(!a.length){s!==t&&e.setEdge(t,s,{weight:0,minlen:r});return}let l=fe(e,"_bt"),u=fe(e,"_bb"),h=e.node(s);e.setParent(l,s),h.borderTop=l,e.setParent(u,s),h.borderBottom=u,a.forEach(c=>{var f;Xe(e,t,r,n,i,o,c);let p=e.node(c),E=p.borderTop?p.borderTop:c,y=p.borderBottom?p.borderBottom:c,m=p.borderTop?n:2*n,g=E!==y?1:i-((f=o[s])!=null?f:0)+1;e.setEdge(l,E,{weight:m,minlen:g,nestingEdge:!0}),e.setEdge(y,u,{weight:m,minlen:g,nestingEdge:!0})}),e.parent(s)||e.setEdge(t,l,{weight:0,minlen:i+((d=o[s])!=null?d:0)})}function br(e){let t={};function r(n,i){let o=e.children(n);o&&o.length&&o.forEach(s=>r(s,i+1)),t[n]=i}return e.children(W).forEach(n=>r(n,1)),t}function Er(e){return e.edges().reduce((t,r)=>t+e.edge(r).weight,0)}function yr(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(r=>{e.edge(r).nestingEdge&&e.removeEdge(r)})}var _r=kr;function kr(e){function t(r){let n=e.children(r),i=e.node(r);if(n.length&&n.forEach(t),i&&Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let o=i.minRank,s=i.maxRank+1;o<s;++o)ve(e,"borderLeft","_bl",r,i,o),ve(e,"borderRight","_br",r,i,o)}}e.children(W).forEach(t)}function ve(e,t,r,n,i,o){let s={width:0,height:0,rank:o,borderType:t},d=i[t][o-1],a=D(e,"border",s,r);i[t][o]=a,e.setParent(a,n),d&&e.setEdge(d,a,{weight:1})}function Or(e){var t;let r=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(r==="lr"||r==="rl")&&We(e)}function xr(e){var t;let r=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(r==="bt"||r==="rl")&&Nr(e),(r==="lr"||r==="rl")&&(jr(e),We(e))}function We(e){e.nodes().forEach(t=>me(e.node(t))),e.edges().forEach(t=>me(e.edge(t)))}function me(e){let t=e.width;e.width=e.height,e.height=t}function Nr(e){e.nodes().forEach(t=>H(e.node(t))),e.edges().forEach(t=>{var r;let n=e.edge(t);(r=n.points)==null||r.forEach(H),Object.hasOwn(n,"y")&&H(n)})}function H(e){e.y=-e.y}function jr(e){e.nodes().forEach(t=>Z(e.node(t))),e.edges().forEach(t=>{var r;let n=e.edge(t);(r=n.points)==null||r.forEach(Z),Object.hasOwn(n,"x")&&Z(n)})}function Z(e){let t=e.x;e.x=e.y,e.y=t}function Ir(e,t=null){let r={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),o=T(Math.max,i),s=G(o+1).map(()=>[]);function d(l){if(r[l])return;r[l]=!0;let u=e.node(l);s[u.rank].push(l);let h=e.successors(l);h&&[...h].sort((c,f)=>a(c,f)).forEach(d)}n.sort((l,u)=>e.node(l).rank-e.node(u).rank).forEach(d);function a(l,u){let h=e.node(l),c=e.node(u);return Ye(t,h,c)}return s}function Sr(e,t){let r=0;for(let n=1;n<t.length;++n)r+=Mr(e,t[n-1],t[n]);return r}function Mr(e,t,r){let n=At(r,r.map((l,u)=>u)),i=t.flatMap(l=>{let u=e.outEdges(l);return u?u.map(h=>({pos:n[h.w],weight:e.edge(h).weight})).sort((h,c)=>h.pos-c.pos):[]}),o=1;for(;o<r.length;)o<<=1;let s=2*o-1;o-=1;let d=new Array(s).fill(0),a=0;return i.forEach(l=>{let u=l.pos+o;d[u]+=l.weight;let h=0;for(;u>0;)u%2&&(h+=d[u+1]),u=u-1>>1,d[u]+=l.weight;a+=l.weight*h}),a}function Cr(e,t=[]){return t.map(r=>{let n=e.inEdges(r);if(!n||!n.length)return{v:r};{let i=n.reduce((o,s)=>{let d=e.edge(s),a=e.node(s.v);return{sum:o.sum+d.weight*a.order,weight:o.weight+d.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}})}function Lr(e,t){let r={};e.forEach((i,o)=>{let s={indegree:0,in:[],out:[],vs:[i.v],i:o};i.barycenter!==void 0&&(s.barycenter=i.barycenter,s.weight=i.weight),r[i.v]=s}),t.edges().forEach(i=>{let o=r[i.v],s=r[i.w];o!==void 0&&s!==void 0&&(s.indegree++,o.out.push(s))});let n=Object.values(r).filter(i=>!i.indegree);return $r(n)}function $r(e){let t=[];function r(i){return o=>{o.merged||(o.barycenter===void 0||i.barycenter===void 0||o.barycenter>=i.barycenter)&&Tr(i,o)}}function n(i){return o=>{o.in.push(i),--o.indegree===0&&e.push(o)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(r(i)),i.out.forEach(n(i))}return t.filter(i=>!i.merged).map(i=>z(i,["vs","i","barycenter","weight"]))}function Tr(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}function Fr(e,t,r,n,i){let o={},s=null,d=null,a=i;typeof t=="boolean"?(a=t,o={}):t&&(o=t,s=r??null,d=n??null);let l=Ft(e,m=>Object.hasOwn(m,"barycenter")),u=l.lhs,h=l.rhs.sort((m,g)=>g.i-m.i),c=[],f=0,p=0,E=0;u.sort(Pr(d,s,!!a));for(let[m,g]of Object.entries(o)){let w=u.findIndex(v=>v.vs[0]===m);u.splice(w+1,0,g)}E=be(c,h,E),u.forEach(m=>{E+=m.vs.length,c.push(m.vs),f+=m.barycenter*m.weight,p+=m.weight,E=be(c,h,E)});let y={vs:c.flat(1)};return p&&(y.barycenter=f/p,y.weight=p),y}function be(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}function Pr(e,t,r){return(n,i)=>{if(n.barycenter<i.barycenter)return-1;if(n.barycenter>i.barycenter)return 1;if(e&&(typeof n.vs[0]=="string"||typeof i.vs[0]=="string")){let o=e.node(n.vs[0]),s=e.node(i.vs[0]),d=Ye(t,o,s);if(d!==0)return d}return r?i.i-n.i:n.i-i.i}}function Ue(e,t,r,n,i){var o,s,d,a,l,u,h,c,f,p,E;let y=null,m=i;typeof n=="boolean"?(m=n,y=null):n!==void 0&&(y=n);let g=e.children(t),w=e.node(t),v=w?w.borderLeft:void 0,b=w?w.borderRight:void 0,x={};v&&(g=g.filter(O=>O!==v&&O!==b));let C=Cr(e,g);C.forEach(O=>{if(e.children(O.v).length){let{result:I}=Ue(e,O.v,r,y,m);x[O.v]=I,Object.hasOwn(I,"barycenter")&&Ar(O,I)}});let _=Lr(C,r);Rr(_,x);let M={},$=!1;for(let O=0;O<_.length;O++)for(let I=O+1;I<_.length;I++)if(!(!_[O]||!_[I]||!((o=_[O])!=null&&o.barycenter)||!((s=_[I])!=null&&s.barycenter))&&((d=_[O])==null?void 0:d.barycenter)===_[I].barycenter){let N=(l=(a=_[O])==null?void 0:a.vs[0])!=null?l:"",k=(h=(u=_[I])==null?void 0:u.vs[0])!=null?h:"",S=e.node(N),R=e.node(k);if(S.dummy==="edge"&&R.dummy==="edge"&&((c=S.edgeObj)==null?void 0:c.v)===((f=R.edgeObj)==null?void 0:f.v)&&((p=S.edgeObj)==null?void 0:p.w)===((E=R.edgeObj)==null?void 0:E.w))if(S.edgeLabel.reversed){M[k]=_[O],_.splice(O,1),O--;break}else M[N]=_[I],_.splice(I,1),I--;else $=!0}let j=Fr(_,M,y,e,m);if(v&&b){j.vs=[v,j.vs,b].flat(1);let O=e.predecessors(v);if(O&&O.length){let I=e.node(O[0]),N=e.predecessors(b),k=e.node(N[0]);Object.hasOwn(j,"barycenter")||(j.barycenter=0,j.weight=0),j.barycenter=(j.barycenter*j.weight+I.order+k.order)/(j.weight+2),j.weight+=2}}return Object.defineProperty(j,"result",{value:j,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(j,"usedBias",{value:$,enumerable:!1,configurable:!0,writable:!0}),j}function Rr(e,t){e.forEach(r=>{r.vs=r.vs.flatMap(n=>t[n]?t[n].vs:n)})}function Ar(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function Dr(e,t,r,n){n||(n=e.nodes());let i=Yr(e),o=new F({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(s=>e.node(s));return n.forEach(s=>{let d=e.node(s),a=e.parent(s);if(d.rank===t||d.minRank<=t&&t<=d.maxRank){o.setNode(s),o.setParent(s,a||i);let l=e[r](s);l&&l.forEach(u=>{let h=u.v===s?u.w:u.v,c=o.edge(h,s),f=c!==void 0?c.weight:0;o.setEdge(h,s,{weight:e.edge(u).weight+f})}),Object.hasOwn(d,"minRank")&&o.setNode(s,{borderLeft:d.borderLeft[t],borderRight:d.borderRight[t]})}}),o}function Yr(e){let t;for(;e.hasNode(t=oe("_root")););return t}function Vr(e,t,r){let n={},i;r.forEach(o=>{let s=e.parent(o),d,a;for(;s;){if(d=e.parent(s),d?(a=n[d],n[d]=s):(a=i,i=s),a&&a!==s){t.setEdge(a,s);return}s=d}})}function Ke(e,t={},r=null){if(typeof t.customOrder=="function"){t.customOrder(e,Ke);return}let n=De(e),i=Ee(e,G(1,n+1),"inEdges"),o=Ee(e,G(n-1,-1,-1),"outEdges"),s=Ir(e,r);if(ye(e,s),t.disableOptimalOrderHeuristic)return;let d=Number.POSITIVE_INFINITY,a,l=t.constraints||[];for(let u=0,h=0;h<4;++u,++h){Gr(u%2?i:o,u%4>=2,l,r),s=J(e);let c=Sr(e,s);c<d?(h=0,a=Object.assign({},s),d=c):c===d&&(a=structuredClone(s))}ye(e,a)}function Ee(e,t,r){let n=new Map,i=(o,s)=>{n.has(o)||n.set(o,[]),n.get(o).push(s)};for(let o of e.nodes()){let s=e.node(o);if(typeof s.rank=="number"&&i(s.rank,o),typeof s.minRank=="number"&&typeof s.maxRank=="number")for(let d=s.minRank;d<=s.maxRank;d++)d!==s.rank&&i(d,o)}return t.map(function(o){return Dr(e,o,r,n.get(o)||[])})}function Gr(e,t,r,n){let i=!0,o=new F;e.forEach(function(s){r.forEach(u=>o.setEdge(u.left,u.right));let d=s.graph().root,{result:a,usedBias:l}=Ue(s,d,o,n,i);t&&l&&(i=!i),a.vs.forEach((u,h)=>s.node(u).order=h),Vr(s,o,a.vs)})}function ye(e,t){Object.values(t).forEach(r=>r.forEach((n,i)=>e.node(n).order=i))}function qr(e,t){let r={};function n(i,o){let s=0,d=0,a=i.length,l=o[o.length-1];return o.forEach((u,h)=>{let c=zr(e,u),f=c?e.node(c).order:a;(c||u===l)&&(o.slice(d,h+1).forEach(p=>{let E=e.predecessors(p);E&&E.forEach(y=>{let m=e.node(y),g=m.order;(g<s||f<g)&&!(m.dummy&&e.node(p).dummy)&&Qe(r,y,p)})}),d=h+1,s=f)}),o}return t.length&&t.reduce(n),r}function Br(e,t){let r={};function n(o,s,d,a,l){G(s,d).forEach(u=>{let h=o[u];if(h!==void 0&&e.node(h).dummy){let c=e.predecessors(h);c&&c.forEach(f=>{if(f===void 0)return;let p=e.node(f);p.dummy&&(p.order<a||p.order>l)&&Qe(r,f,h)})}})}function i(o,s){let d=-1,a=-1,l=0;return s.forEach((u,h)=>{if(e.node(u).dummy==="border"){let c=e.predecessors(u);if(c&&c.length){let f=c[0];if(f===void 0)return;a=e.node(f).order,n(s,l,h,d,a),l=h,d=a}}n(s,l,s.length,a,o.length)}),s}return t.length&&t.reduce(i),r}function zr(e,t){if(e.node(t).dummy){let r=e.predecessors(t);if(r)return r.find(n=>e.node(n).dummy)}}function Qe(e,t,r){if(t>r){let i=t;t=r,r=i}let n=e[t];n||(e[t]=n={}),n[r]=!0}function Jr(e,t,r){if(t>r){let i=t;t=r,r=i}let n=e[t];return n!==void 0&&Object.hasOwn(n,r)}function Xr(e,t,r,n,i){let o={},s={},d={};return t.forEach(a=>{a.forEach((l,u)=>{o[l]=l,s[l]=l,d[l]=u})}),t.forEach(a=>{let l=-1,u=-1,h=!1,c=a,f=a.findIndex(p=>i?.includes(p)||_e(p,e,i));f>0&&(c=[a[f],...a.slice(0,f),...a.slice(f+1)],h=!0),c.forEach(p=>{var E;let y=n(p);if(y&&y.length){i!=null&&i.includes(p)&&(y=y.filter(w=>_e(w,e,i)));let m=y.sort((w,v)=>{let b=d[w],x=d[v];return(b!==void 0?b:0)-(x!==void 0?x:0)}),g=(m.length-1)/2;for(let w=Math.floor(g),v=Math.ceil(g);w<=v;++w){let b=m[w];if(b===void 0)continue;let x=d[b];if(x!==void 0&&s[p]===p&&l<x&&d[b]!==u&&!Jr(r,p,b)){let C=o[b];C!==void 0&&(s[b]=p,s[p]=o[p]=C,l=x,h&&(l=-1,u=(E=d[b])!=null?E:-1,h=!1))}}}})}),{root:o,align:s}}function Wr(e,t,r,n,i=!1){let o={},s=Ur(e,t,r,i),d=i?"borderLeft":"borderRight";function a(f,p){let E=s.nodes().slice(),y={},m=E.pop();for(;m;){if(y[m])f(m);else{y[m]=!0,E.push(m);for(let g of p(m))E.push(g)}m=E.pop()}}function l(f){let p=s.inEdges(f);p?o[f]=p.reduce((E,y)=>{var m;let g=(m=o[y.v])!=null?m:0,w=s.edge(y);return Math.max(E,g+(w!==void 0?w:0))},0):o[f]=0}function u(f){let p=s.outEdges(f),E=Number.POSITIVE_INFINITY;p&&(E=p.reduce((m,g)=>{let w=o[g.w],v=s.edge(g);return Math.min(m,(w!==void 0?w:0)-(v!==void 0?v:0))},Number.POSITIVE_INFINITY));let y=e.node(f);E!==Number.POSITIVE_INFINITY&&y.borderType!==d&&(o[f]=Math.max(o[f]!==void 0?o[f]:0,E))}function h(f){return s.predecessors(f)||[]}function c(f){return s.successors(f)||[]}return a(l,h),a(u,c),Object.keys(n).forEach(f=>{var p;let E=r[f];E!==void 0&&(o[f]=(p=o[E])!=null?p:0)}),o}function Ur(e,t,r,n){let i=new F,o=e.graph(),s=en(o.nodesep,o.edgesep,n);return t.forEach(d=>{let a;d.forEach(l=>{let u=r[l];if(u!==void 0){if(i.setNode(u),a!==void 0){let h=r[a];if(h!==void 0){let c=i.edge(h,u);i.setEdge(h,u,Math.max(s(e,l,a),c||0))}}a=l}})}),i}function Kr(e,t){return Object.values(t).reduce((r,n)=>{let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;Object.entries(n).forEach(([d,a])=>{let l=tn(e,d)/2;i=Math.max(a+l,i),o=Math.min(a-l,o)});let s=i-o;return s<r[0]&&(r=[s,n]),r},[Number.POSITIVE_INFINITY,null])[1]}function Qr(e,t){let r=Object.values(t),n=T(Math.min,r),i=T(Math.max,r);["u","d"].forEach(o=>{["l","r"].forEach(s=>{let d=o+s,a=e[d];if(!a||a===t)return;let l=Object.values(a),u=n-T(Math.min,l);s!=="l"&&(u=i-T(Math.max,l)),u&&(e[d]=X(a,h=>h+u))})})}function Hr(e,t=void 0){let r=e.ul;return r?X(r,(n,i)=>{var o,s;if(t){let a=t.toLowerCase(),l=e[a];if(l&&l[i]!==void 0)return l[i]}let d=Object.values(e).map(a=>{let l=a[i];return l!==void 0?l:0}).sort((a,l)=>a-l);return(((o=d[1])!=null?o:0)+((s=d[2])!=null?s:0))/2}):{}}function Zr(e,t){let r=J(e),n=Object.assign(qr(e,r),Br(e,r)),i={},o;["u","d"].forEach(d=>{o=d==="u"?r:Object.values(r).reverse(),["l","r"].forEach(a=>{a==="r"&&(o=o.map(h=>Object.values(h).reverse()));let l=Xr(e,o,n,h=>(d==="u"?e.predecessors(h):e.successors(h))||[],t),u=Wr(e,o,l.root,l.align,a==="r");a==="r"&&(u=X(u,h=>-h)),i[d+a]=u})});let s=Kr(e,i);return Qr(i,s),Hr(i,e.graph().align)}function en(e,t,r){return(n,i,o)=>{let s=n.node(i),d=n.node(o),a=0,l;if(a+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":l=-s.width/2;break;case"r":l=s.width/2;break}if(l&&(a+=r?l:-l),l=void 0,a+=(s.dummy?t:e)/2,a+=(d.dummy?t:e)/2,a+=d.width/2,Object.hasOwn(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":l=d.width/2;break;case"r":l=-d.width/2;break}return l&&(a+=r?l:-l),a}}function tn(e,t){return e.node(t).width}function _e(e,t,r){var n;if(!r)return!1;let i=(n=t.node(e))==null?void 0:n.edgeObj;if(!i||t.node(e).edgeLabel.reversed)return!1;let o=r.indexOf(i?.v),s=r.indexOf(i?.w);return o!==-1&&s!==-1&&o===(s+1)%r.length||o===(s-1)%r.length}function rn(e,t){e=Re(e),nn(e),Object.entries(Zr(e,t)).forEach(([r,n])=>e.node(r).x=n)}function nn(e){let t=J(e),r=e.graph(),n=r.ranksep,i=r.rankalign,o=0;t.forEach(s=>{let d=s.reduce((a,l)=>{var u;let h=(u=e.node(l).height)!=null?u:0;return a>h?a:h},0);s.forEach(a=>{let l=e.node(a);i==="top"?l.y=o+l.height/2:i==="bottom"?l.y=o+d-l.height/2:l.y=o+d/2}),o+=d+n})}var ke=new WeakMap;function jn(e,t={}){return He(e,Pt,t),e}function Oe(e,t,r){let n=t;for(;n!==void 0;){let i=e.parent(n);if(i===r)return n;n=i}}function He(e,t,r){var n;let i=e.nodes().filter(g=>e.children(g).length),o={};i.forEach(g=>{let w=e.node(g);if(w&&w.rankdir){let v=new F({multigraph:!0,compound:!0});v.setGraph({rankdir:w.rankdir});let b=e.children(g);b.forEach(N=>{let k={...e.node(N)};v.setNode(N,k);let S=e.parent(N);S&&S!==g&&b.includes(S)&&v.setParent(N,S)});let x=new Set;e.edges().forEach(N=>{let k=Oe(e,N.v,g),S=Oe(e,N.w,g);if(k&&S&&k!==S){let R=`${k}\0${S}`;x.has(R)||(x.add(R),v.setEdge(k,S,{...e.edge(N)}))}}),He(v,t,r);let C=Ie(v);xe(C,t,r,null),Ne(v,C);let _=1/0,M=1/0,$=-1/0,j=-1/0;v.nodes().forEach(N=>{if(N===g)return;let k=v.node(N);k&&typeof k.x=="number"&&typeof k.y=="number"&&typeof k.width=="number"&&typeof k.height=="number"&&(_=Math.min(_,k.x-k.width/2),$=Math.max($,k.x+k.width/2),M=Math.min(M,k.y-k.height/2),j=Math.max(j,k.y+k.height/2))}),(!isFinite(_)||!isFinite(M)||!isFinite($)||!isFinite(j))&&(_=M=0,$=j=0);let O=$-_,I=j-M;o[g]={minX:_,minY:M,maxX:$,maxY:j,width:O,height:I,offsetX:_,offsetY:M},w._dagreClusterSubgraph=v}});let s=[],d=g=>{let w=[],v=(e.children(g)||[]).filter(b=>b!==g);for(;v.length>0;){let b=v.shift();w.push(b),(e.children(b)||[]).filter(x=>x!==b).forEach(x=>v.push(x))}return w},a=new Map;i.forEach(g=>{let w=e.node(g);w&&w.rankdir&&o[g]&&a.set(g,(e.children(g)||[]).filter(v=>v!==g))});let l=new Set([...a.values()].flat()),u=new Map;a.forEach((g,w)=>{l.has(w)||u.set(w,d(w))});let h=new Set([...u.values()].flat()),c=g=>{for(let[w,v]of u)if(v.includes(g))return w;return g},f=[];e.edges().forEach(g=>{(h.has(g.v)||h.has(g.w))&&f.push({edge:g,label:e.edge(g)})});let p=new Map;h.forEach(g=>{let w=e.parent(g);p.set(g,typeof w=="string"?w:void 0)}),u.forEach((g,w)=>{let v=e.node(w),b=[];g.forEach(_=>{let M=e.node(_);M&&(b.push({id:_,node:M,parent:p.get(_)}),e.removeNode(_))});let x=f.filter(({edge:_})=>g.includes(_.v)||g.includes(_.w)),C=o[w];v&&(s.push({clusterId:w,subgraph:v._dagreClusterSubgraph,bounds:C,children:g,removedNodes:b,removedEdges:x}),v.width=C.width,v.height=C.height)});let E=new Set;f.forEach(({edge:g,label:w})=>{let v=c(g.v),b=c(g.w);if(v!==b&&e.hasNode(v)&&e.hasNode(b)){let x=`${v}\0${b}`;E.has(x)||(E.add(x),e.setEdge(v,b,{...w,width:0,height:0}))}});let y=Ie(e),m=xe(y,t,r,(n=ke.get(e))!=null?n:null);ke.set(e,m),Ne(e,y),E.forEach(g=>{let w=g.indexOf("\0"),v=g.slice(0,w),b=g.slice(w+1);e.hasEdge(v,b)&&e.removeEdge(v,b)}),s.forEach(({clusterId:g,subgraph:w,bounds:v,removedNodes:b,removedEdges:x})=>{var C,_;let M=e.node(g),$=(C=M?.x)!=null?C:0,j=(_=M?.y)!=null?_:0,O=(v.minX+v.maxX)/2,I=(v.minY+v.maxY)/2;b.forEach(({id:N,node:k,parent:S})=>{e.setNode(N,k),S!==void 0&&e.setParent(N,S)}),x.forEach(({edge:N,label:k})=>{e.setEdge(N,k)}),w.nodes().forEach(N=>{if(N===g)return;let k=w.node(N),S=e.node(N);S&&k&&typeof k.x=="number"&&typeof k.y=="number"&&(S.x=$+(k.x-O),S.y=j+(k.y-I))}),delete M._dagreClusterSubgraph}),i.forEach(g=>{var w,v;let b=e.node(g),x=o[g];if(b&&b.rankdir&&b._dagreClusterSubgraph&&x){let C=b._dagreClusterSubgraph,_=(w=b.x)!=null?w:0,M=(v=b.y)!=null?v:0,$=(x.minX+x.maxX)/2,j=(x.minY+x.maxY)/2;C.nodes().forEach(O=>{if(O===g)return;let I=C.node(O),N=e.node(O);if(N&&I&&typeof I.x=="number"&&typeof I.y=="number"){let k=I.x-$,S=I.y-j;N.x=_+k,N.y=M+S}}),delete b._dagreClusterSubgraph}})}function xe(e,t,r,n=null){var i,o;let s=r?.useDynamic!==!1,d=s&&(i=n?.graph)!=null?i:null,a=s&&(o=n?.rawNodes)!=null?o:null;t(" makeSpaceForEdgeLabels",()=>cn(e)),t(" removeSelfEdges",()=>yn(e)),t(" acyclic",()=>Xt(e,d)),t(" nestingGraph.run",()=>mr(e)),t(" rank",()=>ur(Re(e))),t(" injectEdgeLabelProxies",()=>fn(e)),t(" removeEmptyRanks",()=>$t(e)),t(" nestingGraph.cleanup",()=>yr(e)),t(" normalizeRanks",()=>Lt(e)),t(" assignRankMinMax",()=>gn(e)),t(" removeEdgeLabelProxies",()=>pn(e)),t(" normalize.run",()=>Qt(e)),t(" parentDummyChains",()=>gr(e)),t(" addBorderSegments",()=>_r(e)),t(" order",()=>Ke(e,r,a)),t(" insertSelfEdges",()=>_n(e)),t(" adjustCoordinateSystem",()=>Or(e)),t(" position",()=>rn(e,r.corePath)),t(" positionSelfEdges",()=>kn(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(" removeBorderNodes",()=>En(e)),t(" normalize.undo",()=>Zt(e)),t(" fixupEdgeLabelCoords",()=>mn(e)),t(" undoCoordinateSystem",()=>xr(e)),t(" translateGraph",()=>wn(e)),t(" assignNodeIntersects",()=>vn(e)),t(" reversePoints",()=>bn(e)),t(" acyclic.undo",()=>Ut(e)),{graph:e,rawNodes:l}}function Ne(e,t){e.nodes().forEach(r=>{let n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,n.order=i.order,n.rank=i.rank,t.children(r).length&&(n.width=i.width,n.height=i.height))}),e.edges().forEach(r=>{let n=e.edge(r),i=t.edge(r);n.points=i.points,Object.hasOwn(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var on=["nodesep","edgesep","ranksep","marginx","marginy"],sn={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},dn=["acyclicer","ranker","rankdir","align","rankalign"],ln=["width","height","rank"],je={width:0,height:0},an=["minlen","weight","width","height","labeloffset"],un={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},hn=["labelpos"];function Ie(e){let t=new F({multigraph:!0,compound:!0}),r=te(e.graph());return t.setGraph(Object.assign({},sn,ee(r,on),z(r,dn))),e.nodes().forEach(n=>{let i=te(e.node(n)),o=ee(i,ln);Object.keys(je).forEach(d=>{o[d]===void 0&&(o[d]=je[d])}),t.setNode(n,o);let s=e.parent(n);s!==void 0&&t.setParent(n,s)}),e.edges().forEach(n=>{let i=te(e.edge(n));t.setEdge(n,Object.assign({},un,ee(i,an),z(i,hn)))}),t}function cn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(r=>{var n;let i=e.edge(r);i.minlen*=2,((n=i.labelpos)!=null?n:"r").toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function fn(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.width&&r.height){let n=e.node(t.v),i={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};D(e,"edge-proxy",i,"_ep")}})}function gn(e){let t=0;e.nodes().forEach(r=>{let n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Math.max(t,n.maxRank))}),e.graph().maxRank=t}function pn(e){e.nodes().forEach(t=>{let r=e.node(t);if(r.dummy==="edge-proxy"){let n=r;e.edge(n.e).labelRank=r.rank,e.removeNode(t)}})}function wn(e){let t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,o=e.graph(),s=o.marginx||0,d=o.marginy||0;function a(l){let u=l.x,h=l.y,c=l.width,f=l.height;t=Math.min(t,u-c/2),r=Math.max(r,u+c/2),n=Math.min(n,h-f/2),i=Math.max(i,h+f/2)}e.nodes().forEach(l=>a(e.node(l))),e.edges().forEach(l=>{let u=e.edge(l);Object.hasOwn(u,"x")&&a(u)}),t-=s,n-=d,e.nodes().forEach(l=>{let u=e.node(l);u.x-=t,u.y-=n}),e.edges().forEach(l=>{let u=e.edge(l);u.points.forEach(h=>{h.x-=t,h.y-=n}),Object.hasOwn(u,"x")&&(u.x-=t),Object.hasOwn(u,"y")&&(u.y-=n)}),o.width=r-t+s,o.height=i-n+d}function vn(e){e.edges().forEach(t=>{if(t.v===t.w)return;let r=e.edge(t),n=e.node(t.v),i=e.node(t.w),o,s;r.points?(o=r.points[0],s=r.points[r.points.length-1]):(r.points=[],o=i,s=n),r.points.unshift(ce(n,o)),r.points.push(ce(i,s))})}function mn(e){e.edges().forEach(t=>{let r=e.edge(t);if(Object.hasOwn(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 bn(e){e.edges().forEach(t=>{let r=e.edge(t);r.reversed&&r.points.reverse()})}function En(e){e.nodes().forEach(t=>{if(e.children(t).length){let r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(r.borderLeft[r.borderLeft.length-1]),s=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-o.x),r.height=Math.abs(i.y-n.y),r.x=o.x+r.width/2,r.y=n.y+r.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function yn(e){e.edges().forEach(t=>{if(t.v===t.w){let r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function _n(e){J(e).forEach(t=>{let r=0;t.forEach((n,i)=>{let o=e.node(n);typeof o.rank!="number"&&(o.rank=0),o.order=i+r,(o.selfEdges||[]).forEach(s=>{D(e,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:i+ ++r,e:s.e,edgeLabel:s.label},"_se"),(!Array.isArray(s.label.points)||s.label.points.length!==7)&&(s.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete o.selfEdges})})}function kn(e){e.nodes().forEach(t=>{let r=e.node(t),n=i=>typeof i=="number"&&isFinite(i);if(r.dummy==="selfedge"){let i=r,o=e.node(i.e.v),s=n(o?.x)?o.x:0,d=n(o?.y)?o.y:0,a=n(o?.width)?o.width:0,l=n(o?.height)?o.height:0,u=n(r.x)?r.x:s,h=n(r.y)?r.y:d,c=a/2,f=l/2;i.edgeLabel.points=[{x:u+c,y:h-f},{x:u+c,y:h-f},{x:u,y:h},{x:u-c,y:h+f},{x:u-c,y:h+f},{x:u,y:h},{x:u,y:h}],i.edgeLabel.x=u,i.edgeLabel.y=h,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else r&&Array.isArray(r.selfEdges)&&r.selfEdges.forEach(i=>{if(!Array.isArray(i.label.points)||i.label.points.length!==7){let o=n(r.x)?r.x:0,s=n(r.y)?r.y:0,d=n(r.width)?r.width:0,a=n(r.height)?r.height:0,l=d/2,u=a/2;i.label.points=[{x:o+l,y:s-u},{x:o+l,y:s-u},{x:o,y:s},{x:o-l,y:s+u},{x:o-l,y:s+u},{x:o,y:s},{x:o,y:s}]}})})}function ee(e,t){return X(z(e,t),Number)}function te(e){let t={};return e&&Object.entries(e).forEach(([r,n])=>{typeof r=="string"&&(r=r.toLowerCase()),t[r]=n}),t}export{On as a,xn as b,st as c,jn as d};
|
|
2
|
+
/*! For license information please see chunk-KYWOOES7.js.LEGAL.txt */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e}from"./chunk-J6IRWTF7.js";var t=e("pdf",{"zh-CN":{loadFailed:"PDF \u65E0\u6CD5\u8BFB\u53D6\uFF1A{error}",pageFailed:"\u9875\u9762\u65E0\u6CD5\u663E\u793A\uFF1A{error}",controls:"PDF \u9605\u8BFB\u63A7\u5236",previousPage:"\u4E0A\u4E00\u9875",pageNumber:"PDF \u9875\u7801",nextPage:"\u4E0B\u4E00\u9875",zoomOut:"\u7F29\u5C0F PDF",fitWidth:"\u9002\u5408\u5BBD\u5EA6",fitWidthLabel:"PDF \u9002\u5408\u5BBD\u5EA6",zoomIn:"\u653E\u5927 PDF",download:"\u4E0B\u8F7D PDF",viewportLabel:"PDF \u7B2C {page} \u9875",loading:"\u6B63\u5728\u8BFB\u53D6 PDF\u2026",openOriginal:"\u6253\u5F00\u539F\u6587\u4EF6",pageContent:"\u7B2C {page} \u9875\u5185\u5BB9",pageText:"\u672C\u9875\u6587\u5B57",document:"PDF \u6587\u6863",emptyTitle:"\u6DFB\u52A0 PDF \u6587\u6863",emptyDescription:"\u5728\u9875\u9762\u4E2D\u7FFB\u9605\u8BBA\u6587\u3001\u62A5\u544A\u4E0E\u8D44\u6599",choose:"\u9009\u62E9 PDF",missingAsset:"PDF \u8D44\u6E90\u4E0D\u5B58\u5728\uFF1A{path}"},en:{loadFailed:"Couldn't read the PDF: {error}",pageFailed:"Couldn't display the page: {error}",controls:"PDF reader controls",previousPage:"Previous page",pageNumber:"PDF page number",nextPage:"Next page",zoomOut:"Zoom out of PDF",fitWidth:"Fit width",fitWidthLabel:"Fit PDF to width",zoomIn:"Zoom in on PDF",download:"Download PDF",viewportLabel:"PDF page {page}",loading:"Reading PDF\u2026",openOriginal:"Open original file",pageContent:"Page {page} content",pageText:"Text on this page",document:"PDF document",emptyTitle:"Add a PDF document",emptyDescription:"Page through papers, reports and references right in the page",choose:"Choose PDF",missingAsset:"PDF resource not found: {path}"}});export{t as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-5AW2WUSZ.js";import{c as d,f as g}from"./chunk-J6IRWTF7.js";var a=g(h),D=["#120a8f","#5147b8","#8179c2","#4674af","#6b78a8","#898892"],C=(e,r="")=>typeof e=="string"||typeof e=="number"?String(e):r,S=(e,r=0)=>typeof e=="number"&&Number.isFinite(e)?e:r,x=()=>globalThis.crypto?.randomUUID?.()??`row-${Date.now()}-${Math.random().toString(36).slice(2)}`;function w(e){if(typeof e=="string"&&!/^[\u0000-\u0020]|[\u0000-\u001f]/.test(e))try{let r=new URL(e);return["http:","https:"].includes(r.protocol)?r.href:void 0}catch{return}}function L(e){if(typeof e=="string")return/^data:image\/(?:png|jpeg|gif|webp|avif);base64,[a-z\d+/=\s]+$/i.test(e)?e:w(e)}function R(e){let r=JSON.parse(e);if(!r||typeof r!="object")throw new Error(a("chartData.notObject"));let{labels:o,series:n}=r;if(!Array.isArray(o)||!o.every(t=>typeof t=="string"))throw new Error(a("chartData.labels"));if(!Array.isArray(n))throw new Error(a("chartData.series"));if(o.length>500||n.length>20)throw new Error(a("chartData.tooLarge"));for(let t of n){if(!t||typeof t.name!="string"||!Array.isArray(t.values))throw new Error(a("chartData.seriesShape"));if(t.values.length!==o.length)throw new Error(a("chartData.length",{name:t.name}));if(!t.values.every(i=>typeof i=="number"&&Number.isFinite(i)))throw new Error(a("chartData.finite",{name:t.name}));if(t.color!==void 0&&(typeof t.color!="string"||!/^#(?:[a-f\d]{3}|[a-f\d]{4}|[a-f\d]{6}|[a-f\d]{8})$/i.test(t.color)))throw new Error(a("chartData.color",{name:t.name}))}return{labels:o,series:n}}function k(e,r,o,n,t){let i=o.trim().toLocaleLowerCase(),l=e.filter(s=>(!i||r.some(c=>String(s[c.id]??"").toLocaleLowerCase().includes(i)))&&(!n.column||String(s[n.column]??"")===n.value));if(!t)return l;let m=r.find(s=>s.id===t.column);return l.sort((s,c)=>{let u=s[t.column]??"",f=c[t.column]??"",p=m?.type==="number"?Number(u)-Number(f):m?.type==="checkbox"?+!!u-+!!f:String(u).localeCompare(String(f),d(),{numeric:!0});return t.direction==="asc"?p:-p})}function E(e,r){let o=n=>{let t=String(n??"");return`"${(/^[\s]*[=+@-]|^[\t\r\n]/.test(t)&&!/^-?\d+(\.\d+)?$/.test(t)?`'${t}`:t).replaceAll('"','""')}"`};return"\uFEFF"+[e.map(n=>o(n.name)).join(","),...r.map(n=>e.map(t=>o(n[t.id])).join(","))].join(`\r
|
|
2
2
|
`)}function U(e,r,o){let n=URL.createObjectURL(new Blob([e],{type:o})),t=document.createElement("a");t.href=n,t.download=r,t.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}export{D as a,C as b,S as c,x as d,w as e,L as f,R as g,k as h,E as i,U as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as h,G as g,H as p,a as m}from"./chunk-5HKZMSJF.js";import{c as E}from"./chunk-6WTBCWHP.js";import{c as x}from"./chunk-DCANE7XH.js";var w=Object.freeze({archify:["workflow","architecture","sequence","dataflow","lifecycle","erd","class","tree","timeline","waterfall"],"diagram-design":["architecture","architecture-delta","axonometric-plan","bar","data-flow","db-schema","dependency","deployment","dp-integration","dp-security-matrix","er","exploded","fishbone","flowchart","gantt","heatmap","high-level","it-state","journey","kanban","layers","line","loop","medallion","nested","org-chart","polar","process","pyramid","quadrant","radar","sankey","scatter","sequence","service-blueprint","state","story-map","swimlane","timeline","tree","treemap","uml-class","venn","wardley","waterfall"],"fireworks-tech-graph":Array.from({length:12},(o,t)=>`style-${t+1}`)});function T(o,t){if(!Object.hasOwn(w,o))throw new Error(`Unknown diagram family: ${o}.`);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("\u56FE\u5F62\u6570\u636E\u5FC5\u987B\u662F\u5BF9\u8C61\u3002");for(let r of Object.keys(t))if(!["template","source","title","description","height","presentation"].includes(r))throw new Error(`\u4E0D\u652F\u6301\u7684\u56FE\u5F62\u5B57\u6BB5\uFF1A${r}\u3002`);if(!w[o].includes(t.template)&&t.template!=="custom")throw new Error("\u8BF7\u9009\u62E9\u8BE5\u7EC4\u4EF6\u63D0\u4F9B\u7684\u6A21\u677F\uFF0C\u6216\u4F7F\u7528 custom \u5BFC\u5165\u56FE\u5F62\u6E90\u7801\u3002");for(let r of["title","description"])if(t[r]!==void 0&&(typeof t[r]!="string"||t[r].length>2e3))throw new Error(`${r} \u5FC5\u987B\u662F\u6700\u591A 2000 \u5B57\u7B26\u7684\u6587\u672C\u3002`);if(t.height!==void 0&&(!Number.isFinite(t.height)||t.height<240||t.height>1200))throw new Error("\u56FE\u5F62\u9AD8\u5EA6\u987B\u5728 240\u20131200 px \u4E4B\u95F4\u3002");if(t.source!==void 0){if(typeof t.source!="string"||!t.source.trim())throw new Error("\u56FE\u5F62\u6E90\u7801\u987B\u4E3A\u975E\u7A7A\u7684 SVG \u6216 HTML \u6587\u672C\u3002");if(new TextEncoder().encode(t.source).byteLength>8*1024*1024)throw new Error("\u56FE\u5F62\u6E90\u7801\u8D85\u8FC7 8 MiB \u4E0A\u9650\u3002");if(!/<svg\b/i.test(t.source))throw new Error("\u56FE\u5F62\u6E90\u7801\u987B\u5305\u542B SVG\u3002JSON \u8F93\u5165\u8BF7\u5148\u7528\u539F\u9879\u76EE\u6E32\u67D3\u5668\u751F\u6210 SVG \u6216 HTML\u3002")}if(t.template==="custom"&&t.source===void 0)throw new Error("\u81EA\u5B9A\u4E49\u56FE\u5F62\u987B\u63D0\u4F9B source\u3002");if(t.presentation!==void 0){let r=t.presentation;if(!r||typeof r!="object"||Array.isArray(r))throw new Error("presentation \u5FC5\u987B\u662F\u663E\u793A\u8BBE\u7F6E\u5BF9\u8C61\u3002");for(let n of Object.keys(r))if(!["title","description","notes","legend","controls"].includes(n))throw new Error(`\u4E0D\u652F\u6301\u7684\u663E\u793A\u8BBE\u7F6E\uFF1A${n}\u3002`);for(let n of["title","description"])if(r[n]!==void 0&&!["inside","outside","hidden"].includes(r[n]))throw new Error(`${n} \u7684\u663E\u793A\u4F4D\u7F6E\u65E0\u6548\u3002`);if(r.notes!==void 0&&!["inline","details","hidden"].includes(r.notes))throw new Error("\u8BF4\u660E\u6587\u5B57\u7684\u663E\u793A\u65B9\u5F0F\u65E0\u6548\u3002");for(let n of["legend","controls"])if(r[n]!==void 0&&typeof r[n]!="boolean")throw new Error(`${n} \u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002`)}}function S(o,t){let r="showai-frame-text-"+o,n=document.createElement("style");n.textContent=`::highlight(${r}){background:Highlight;color:HighlightText}`,document.head.append(n);let a=window,c=0,b=(e,i)=>{let s=document.caretRangeFromPoint(e,i);return s?t(document.body).offsetAt(s.startContainer,s.startOffset):null},f=()=>parent.postMessage({channel:o,type:"showai:text-selection-content",text:t(document.body).text.slice(0,256e3)},"*"),l=(e,i,s,u)=>{let d=b(i,s);d!==null&&(c=d),parent.postMessage({channel:o,type:"showai:text-selection-pointer",phase:e,x:i,y:s,width:innerWidth,height:innerHeight,buttons:u,offset:c},"*")};window.addEventListener("message",e=>{if(!(e.source!==parent||e.data?.channel!==o))if(e.data.type==="showai:text-selection-content-request")f();else if(e.data.type==="showai:text-selection-range"){let{from:i,to:s}=e.data;if(!Number.isFinite(i)||!Number.isFinite(s))return;if(s>i){let u=t(document.body);a.Highlight&&a.CSS.highlights&&a.CSS.highlights.set(r,new a.Highlight(...u.ranges(Math.max(0,i),Math.min(u.text.length,s)))),document.getSelection()?.removeAllRanges()}else a.CSS.highlights?.delete(r)}else e.data.type==="showai:text-selection-hit"&&[e.data.x,e.data.y].every(Number.isFinite)&&l("move",e.data.x,e.data.y,1)}),document.addEventListener("pointerdown",e=>{if(e.button!==0||e.pointerType!=="mouse"||e.shiftKey||e.metaKey||e.ctrlKey||!(e.target instanceof Element)||e.target.closest('button,input,textarea,select,summary,[role="button"],[role="slider"],[data-surface-ui],.react-flow,[data-surface-gesture="own"]')||getComputedStyle(e.target).userSelect==="none")return;let i=document.caretRangeFromPoint(e.clientX,e.clientY);i?.startContainer.nodeType!==Node.TEXT_NODE||!e.target.contains(i.startContainer)||(f(),l("down",e.clientX,e.clientY,e.buttons))},!0),document.addEventListener("pointermove",e=>{e.pointerType==="mouse"&&e.buttons&1&&l("move",e.clientX,e.clientY,e.buttons)},!0),document.addEventListener("pointerup",e=>l("up",e.clientX,e.clientY,e.buttons),!0),document.addEventListener("pointercancel",e=>l("cancel",e.clientX,e.clientY,e.buttons),!0)}function C(o){return`(${S.toString()})(${JSON.stringify(o)},${m.toString()});`}var y=x(E(),1);function F(o,t){(0,y.useEffect)(()=>{let r=o.current,n=h(r,t),a=c=>{c.source!==r.contentWindow||c.data?.channel!==t||(c.data.type==="showai:text-selection-pointer"&&p(r,c.data),c.data.type==="showai:text-selection-content"&&g(r,c.data.text))};return window.addEventListener("message",a),()=>{n(),window.removeEventListener("message",a)}},[t,o])}export{w as a,T as b,C as c,F as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ka as S,c as v,ib as B,jb as d,kb as T,mb as y}from"./chunk-6WTBCWHP.js";import{a as h}from"./chunk-J6IRWTF7.js";import{c as i}from"./chunk-DCANE7XH.js";var u=i(v(),1),N=i(T(),1),R=i(d(),1),g=(0,u.createContext)(null);function x({children:e}){let t=(0,u.useContext)(g);return t?t.selected&&t.target?(0,N.createPortal)(e,t.target):null:e}function H({children:e}){let t=(0,u.useContext)(g);return t?t.target?(0,N.createPortal)((0,R.jsx)("div",{className:"board-component-settings","data-surface-ui":!0,hidden:!t.selected,onKeyDown:s=>{s.key==="Escape"&&t.closeSettings&&(s.preventDefault(),s.stopPropagation(),t.closeSettings(),t.target?.querySelector(".sb-actions > button.sb-icon-button.is-active:last-child")?.focus({preventScroll:!0}))},children:e}),t.target):null:e}var m=i(v(),1);var A=h("blocks",{"zh-CN":{blockActions:"\u7EC4\u4EF6\u64CD\u4F5C",closeSettings:"\u5173\u95ED\u8BBE\u7F6E",editBlock:"\u7F16\u8F91\u533A\u5757"},en:{blockActions:"Block actions",closeSettings:"Close settings",editBlock:"Edit block"}});var o=i(d(),1),C=new Set(["\u6570\u636E\u56FE\u8868|\u6570\u636E\u5E93|\u5173\u952E\u6307\u6807|\u4EA4\u4E92\u8BA1\u7B97|\u56FE\u7247\u753B\u5ECA|\u4EA4\u4E92\u6D41\u7A0B\u56FE|\u601D\u7EF4\u5BFC\u56FE|G2 \u56FE\u8868|\u56FE\u8868","\u67F1\u72B6\u56FE|\u6298\u7EBF\u56FE|\u9762\u79EF\u56FE|\u6563\u70B9\u56FE|\u6C14\u6CE1\u56FE|\u5206\u7EC4\u67F1\u72B6\u56FE|\u53CC\u5411\u6761\u5F62\u56FE|\u96F7\u8FBE\u56FE|\u5F84\u5411\u6761\u5F62\u56FE|\u5E73\u884C\u5750\u6807|\u56DE\u5F52\u66F2\u7EBF","\u997C\u56FE|\u73AF\u56FE|\u5806\u53E0\u67F1\u72B6\u56FE|\u5806\u53E0\u9762\u79EF\u56FE|\u73AB\u7470\u56FE|\u9A6C\u8D5B\u514B\u56FE|\u77E9\u5F62\u6811\u56FE|\u65ED\u65E5\u56FE|\u6F0F\u6597\u56FE","\u76F4\u65B9\u56FE|\u7BB1\u7EBF\u56FE|\u5C0F\u63D0\u7434\u56FE|\u5206\u5E03\u66F2\u7EBF|\u5BC6\u5EA6\u70ED\u529B\u56FE|\u8272\u5757\u56FE|\u7B49\u9AD8\u7EBF\u56FE|\u830E\u53F6\u56FE","\u6851\u57FA\u56FE|\u5F26\u56FE|\u5F27\u56FE|\u5706\u5F62\u6253\u5305\u56FE|\u97E6\u6069\u56FE|\u7518\u7279\u56FE|K \u7EBF\u56FE|Kagi \u8F6C\u5411\u56FE|\u87BA\u65CB\u56FE","\u5206\u7EA7\u8BBE\u8272\u5730\u56FE|\u70B9\u5730\u56FE|\u6C14\u6CE1\u5730\u56FE|\u4EEA\u8868\u76D8|\u5B50\u5F39\u56FE|\u8BCD\u4E91"].join("|").split("|"));function D(e,t){return typeof e=="string"&&e.trim()&&!C.has(e.trim())?e:t}function P({title:e,defaultTitle:t,description:s,editable:c,editing:n,onEdit:l,children:b}){let r=y(A),a=(0,m.useContext)(g);(0,m.useLayoutEffect)(()=>{if(!(!a||!n||!l))return a.closeSettings=l,()=>{a.closeSettings===l&&delete a.closeSettings}},[a,n,l]);let p=e?.trim(),f=p&&p!==t&&!C.has(p)?p:"",k=!!(f||s?.trim());return!k&&!b&&!c?null:(0,o.jsxs)("div",{className:`sb-header${k?" has-caption":""}${n?" is-editing":""}`,children:[k&&(0,o.jsxs)("div",{className:"sb-heading",children:[f&&(0,o.jsx)("div",{className:"sb-title",children:f}),s?.trim()&&(0,o.jsx)("p",{className:"sb-description",children:s})]}),(b||c)&&(0,o.jsx)(x,{children:(0,o.jsxs)("div",{className:"sb-actions",role:"group","aria-label":r("blockActions"),children:[b,c&&(0,o.jsx)("button",{type:"button",className:`sb-icon-button ${n?"is-active":""}`,onClick:l,"aria-label":r(n?"closeSettings":"editBlock"),title:r(n?"closeSettings":"editBlock"),children:n?(0,o.jsx)(B,{size:16}):(0,o.jsx)(S,{size:16})})]})})]})}function q({icon:e,title:t,description:s,action:c}){return(0,o.jsxs)("div",{className:"sb-empty",children:[e,(0,o.jsx)("strong",{children:t}),s&&(0,o.jsx)("p",{children:s}),c]})}function F({label:e,children:t,className:s=""}){return(0,o.jsxs)("label",{className:`sb-field ${s}`,children:[(0,o.jsx)("span",{children:e}),t]})}export{g as a,x as b,H as c,D as d,P as e,q as f,F as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as p}from"./chunk-
|
|
2
|
-
/*! For license information please see chunk-
|
|
1
|
+
import{c as p}from"./chunk-6WTBCWHP.js";import{a as d}from"./chunk-DCANE7XH.js";var w=d(V=>{"use strict";var f=p();function q(e,u){return e===u&&(e!==0||1/e===1/u)||e!==e&&u!==u}var z=typeof Object.is=="function"?Object.is:q,I=f.useState,M=f.useEffect,_=f.useLayoutEffect,g=f.useDebugValue;function G(e,u){var t=u(),s=I({inst:{value:t,getSnapshot:u}}),r=s[0].inst,n=s[1];return _(function(){r.value=t,r.getSnapshot=u,E(r)&&n({inst:r})},[e,t,u]),M(function(){return E(r)&&n({inst:r}),e(function(){E(r)&&n({inst:r})})},[e]),g(t),t}function E(e){var u=e.getSnapshot;e=e.value;try{var t=u();return!z(e,t)}catch{return!0}}function L(e,u){return u()}var $=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?L:G;V.useSyncExternalStore=f.useSyncExternalStore!==void 0?f.useSyncExternalStore:$});var D=d((P,h)=>{"use strict";h.exports=w()});var R=d(O=>{"use strict";var m=p(),k=D();function C(e,u){return e===u&&(e!==0||1/e===1/u)||e!==e&&u!==u}var U=typeof Object.is=="function"?Object.is:C,W=k.useSyncExternalStore,A=m.useRef,B=m.useEffect,F=m.useMemo,H=m.useDebugValue;O.useSyncExternalStoreWithSelector=function(e,u,t,s,r){var n=A(null);if(n.current===null){var i={hasValue:!1,value:null};n.current=i}else i=n.current;n=F(function(){function y(o){if(!j){if(j=!0,l=o,o=s(o),r!==void 0&&i.hasValue){var c=i.value;if(r(c,o))return v=c}return v=o}if(c=v,U(l,o))return c;var b=s(o);return r!==void 0&&r(c,b)?(l=o,c):(l=o,v=b)}var j=!1,l,v,S=t===void 0?null:t;return[function(){return y(u())},S===null?void 0:function(){return y(S())}]},[u,t,s,r]);var a=W(e,n[0],n[1]);return B(function(){i.hasValue=!0,i.value=a},[a]),H(a),a}});var J=d((T,N)=>{"use strict";N.exports=R()});export{D as a,J as b};
|
|
2
|
+
/*! For license information please see chunk-VUDDBRCY.js.LEGAL.txt */
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as g,c as C,jb as x,kb as H,mb as w}from"./chunk-6WTBCWHP.js";import{a as v}from"./chunk-J6IRWTF7.js";import{c as l}from"./chunk-DCANE7XH.js";g(`.editor-tool{display:inline-flex;align-items:center;justify-content:center;width:28px;height:29px;padding:0;flex-shrink:0;color:var(--muted);border:0;border-radius:4px;background:transparent}.editor-tool svg{stroke-width:1.65}.editor-tool:hover,.editor-tool.is-active{color:var(--accent);background:var(--editor-soft)}.editor-tool:disabled{opacity:.32}.editor-bubble{--editor-line: var(--line, #e8ece5);--editor-soft: var(--accent-soft, #edf2e9);position:fixed;z-index:80;display:flex;align-items:center;gap:2px;padding:5px;border:1px solid var(--line, #e8ece5);border-radius:6px;background:var(--paper, #fff);color:var(--text, #343a35);font-family:var(--font-ui, system-ui, sans-serif);font-size:12px;font-weight:400;line-height:1.2;letter-spacing:normal;box-shadow:0 5px 20px #2434291c;animation:editor-menu-appear .13s ease;max-width:calc(100vw - 16px);overflow-x:auto}@keyframes editor-menu-appear{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.editor-bubble{animation:none!important;transition:none!important}}@media print{.editor-bubble{display:none!important}}
|
|
2
|
+
`);var i=l(C(),1),h=l(H(),1);var y=v("editor",{"zh-CN":{selectionToolbar:"\u9009\u4E2D\u6587\u5B57\u683C\u5F0F"},en:{selectionToolbar:"Selected text formatting"}});var k=l(x(),1);function O({id:M,anchor:n,anchorElement:t,children:L,onEscape:E,label:T,keyboardScope:z,viewportTop:d=8,className:b}){let R=w(y),u=(0,i.useRef)(null),[D,S]=(0,i.useState)(n);return(0,i.useLayoutEffect)(()=>{let e=u.current,r=()=>{let{width:o,height:c}=e.getBoundingClientRect(),a=t?.isConnected?t.getBoundingClientRect():null,s=a?{left:(a.left+a.right)/2,top:a.top,bottom:a.bottom}:n,m={left:Math.max(8,Math.min(s.left-o/2,window.innerWidth-o-8)),top:Math.max(d,Math.min(s.top-c-8>=d?s.top-c-8:(s.bottom??s.top)+8,window.innerHeight-c-8))};S(f=>f.left===m.left&&f.top===m.top?f:m)};r();let p=new ResizeObserver(r);if(p.observe(e),t)for(let o=t;o;o=o.parentElement)p.observe(o);return window.addEventListener("resize",r),t&&window.addEventListener("scroll",r,!0),()=>{p.disconnect(),window.removeEventListener("resize",r),t&&window.removeEventListener("scroll",r,!0)}},[n.left,n.top,n.bottom,t,d]),(0,h.createPortal)((0,k.jsx)("div",{ref:u,id:M,className:`editor-bubble${b?` ${b}`:""}`,"data-editor-menu-trigger":"selection","data-editor-keyboard-scope":z,role:"toolbar","aria-label":T??R("selectionToolbar"),style:D,onMouseDown:e=>{e.target.closest("input,select,textarea")||e.preventDefault()},onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),E())},children:L}),document.body)}export{O as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-7G6RMB6W.js";import"./chunk-DCANE7XH.js";export{e as codeHighlighter,a as codeLanguages,d as highlightCode,b as normalizeCodeLanguage,c as supportsCodeLanguage};
|