isorite 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +757 -98
- package/docs/terminal.md +3 -1
- package/guide/out-of-the-base/web-and-code-links.md +3 -1
- package/package.json +1 -1
- package/web/_app/immutable/assets/0.BEFtmzIh.css +1 -0
- package/web/_app/immutable/assets/4.LR47AJKA.css +1 -0
- package/web/_app/immutable/assets/NoteList.C2GYAaLW.css +1 -0
- package/web/_app/immutable/chunks/{BWE_HS0c.js → 0B47b24t.js} +1 -1
- package/web/_app/immutable/chunks/{CzYPMYd4.js → 1j--pDqt.js} +1 -1
- package/web/_app/immutable/chunks/{e2LGvGEb.js → AnnzTlE8.js} +1 -1
- package/web/_app/immutable/chunks/{DRcTlHZP.js → B7LnLClC.js} +1 -1
- package/web/_app/immutable/chunks/{ZwM5k8r0.js → BAVnZFPa.js} +1 -1
- package/web/_app/immutable/chunks/BHORylQC.js +1 -0
- package/web/_app/immutable/chunks/{BiATTH-R.js → BLe29cGh.js} +1 -1
- package/web/_app/immutable/chunks/{C8h1oeAZ.js → BLzZIf7l.js} +1 -1
- package/web/_app/immutable/chunks/BMijTvgG.js +1 -0
- package/web/_app/immutable/chunks/{DCZYeMlH.js → BPpUSQ2Y.js} +1 -1
- package/web/_app/immutable/chunks/{kG4HctVa.js → BQeONalw.js} +1 -1
- package/web/_app/immutable/chunks/{CtkUy_15.js → BZX8cNYL.js} +1 -1
- package/web/_app/immutable/chunks/{Bb_N98K9.js → BiHyHFlW.js} +1 -1
- package/web/_app/immutable/chunks/{BGW1TKtR.js → BtYMl4bD.js} +1 -1
- package/web/_app/immutable/chunks/{DKqMzyyE.js → BtcGx-KQ.js} +1 -1
- package/web/_app/immutable/chunks/{BK31dpt6.js → Bytzbt5l.js} +1 -1
- package/web/_app/immutable/chunks/{DDAG55ce.js → C1FDDux-.js} +1 -1
- package/web/_app/immutable/chunks/C7qBBO-i.js +1 -0
- package/web/_app/immutable/chunks/{NyWzYSz1.js → C8FxuPry.js} +1 -1
- package/web/_app/immutable/chunks/{CdY1G_wk.js → C9Qdslk3.js} +1 -1
- package/web/_app/immutable/chunks/CA-rzUq8.js +524 -0
- package/web/_app/immutable/chunks/{CMIt1Ma8.js → CSKABQj2.js} +1 -1
- package/web/_app/immutable/chunks/CSTv2fL0.js +1 -0
- package/web/_app/immutable/chunks/{Dzi94aDH.js → CTuuQ66F.js} +1 -1
- package/web/_app/immutable/chunks/{PsfIQCJ1.js → CUB9vnd0.js} +1 -1
- package/web/_app/immutable/chunks/{DrVtdHUW.js → CUNetmvQ.js} +1 -1
- package/web/_app/immutable/chunks/{Djr0h_v1.js → CVqwkR8N.js} +1 -1
- package/web/_app/immutable/chunks/{CTDYUZPz.js → CWc-mNzo.js} +1 -1
- package/web/_app/immutable/chunks/{CryuQgNh.js → CZSmkKvQ.js} +1 -1
- package/web/_app/immutable/chunks/{BA78_vo5.js → CcE14TDI.js} +1 -1
- package/web/_app/immutable/chunks/{DBLoWLMb.js → CglDFp51.js} +1 -1
- package/web/_app/immutable/chunks/{DjUnonHY.js → Ch5Z7cbP.js} +1 -1
- package/web/_app/immutable/chunks/{DFuPQaNa.js → Cpjqsnqr.js} +1 -1
- package/web/_app/immutable/chunks/{Bd-WxALw.js → CwHHpacD.js} +1 -1
- package/web/_app/immutable/chunks/{UDPiRmKc.js → D7jLdCNu.js} +1 -1
- package/web/_app/immutable/chunks/{CIYFNih-.js → D9uNsgxP.js} +1 -1
- package/web/_app/immutable/chunks/{CFf_dAzX.js → DAVMwq6b.js} +1 -1
- package/web/_app/immutable/chunks/{C2npZzkn.js → DEQsS4Ez.js} +1 -1
- package/web/_app/immutable/chunks/{B-DzK7Gb.js → DFo4P1vU.js} +1 -1
- package/web/_app/immutable/chunks/{CdmC_l9F.js → DH_19--P.js} +1 -1
- package/web/_app/immutable/chunks/{l1LsK1sB.js → DJQ6favH.js} +1 -1
- package/web/_app/immutable/chunks/{BvPxdlBc.js → DJT73ARj.js} +1 -1
- package/web/_app/immutable/chunks/{BCGaqnao.js → DW5uy3Jw.js} +1 -1
- package/web/_app/immutable/chunks/{BT_btfh0.js → DWwu8a1P.js} +1 -1
- package/web/_app/immutable/chunks/{BhEqJU15.js → DY0M2GMn.js} +1 -1
- package/web/_app/immutable/chunks/{TanDZqdf.js → DbtvzL7r.js} +1 -1
- package/web/_app/immutable/chunks/DtEVmiYo.js +1 -0
- package/web/_app/immutable/chunks/{CT4_O9X_.js → DxRGLDbV.js} +1 -1
- package/web/_app/immutable/chunks/{D6sVhEz3.js → Ih6r6QR2.js} +1 -1
- package/web/_app/immutable/chunks/{BXBhaEho.js → Kem7IXj7.js} +1 -1
- package/web/_app/immutable/chunks/{Ct_EK1xu.js → MrW4zd8l.js} +1 -1
- package/web/_app/immutable/chunks/{BqipEJXw.js → Mwr1r9aw.js} +1 -1
- package/web/_app/immutable/chunks/{D1LK3xRu.js → OG9GsKke.js} +1 -1
- package/web/_app/immutable/chunks/{DymLl-qY.js → Qej0SEux.js} +1 -1
- package/web/_app/immutable/chunks/TmxIGCN3.js +1 -0
- package/web/_app/immutable/chunks/{CPSlCQsu.js → Wv-ICQRy.js} +4 -4
- package/web/_app/immutable/chunks/{B35sQTcK.js → ZTEErEOd.js} +1 -1
- package/web/_app/immutable/chunks/{Cf-5I5_6.js → e7GRa0yc.js} +1 -1
- package/web/_app/immutable/chunks/{C5Z-Y7Lu.js → f7mFVWQS.js} +1 -1
- package/web/_app/immutable/chunks/{Bj-5n5Pb.js → hjSZ041d.js} +1 -1
- package/web/_app/immutable/chunks/{DHJ8FcFD.js → mhWk5y4o.js} +1 -1
- package/web/_app/immutable/chunks/{CMikI1NP.js → zasx25UV.js} +3 -3
- package/web/_app/immutable/entry/app.B9TPZNFw.js +2 -0
- package/web/_app/immutable/entry/start.WU9HKeyT.js +1 -0
- package/web/_app/immutable/nodes/0.C9NFEqJd.js +3 -0
- package/web/_app/immutable/nodes/1.B5PJwWOG.js +1 -0
- package/web/_app/immutable/nodes/2.DRtC7zjs.js +1 -0
- package/web/_app/immutable/nodes/3.EEMisvUL.js +1 -0
- package/web/_app/immutable/nodes/4.DthmsFQC.js +19 -0
- package/web/_app/immutable/nodes/5.CEu0DlpQ.js +1 -0
- package/web/_app/immutable/nodes/6.DzvF0ZPt.js +1 -0
- package/web/_app/version.json +1 -1
- package/web/index.html +16 -16
- package/web/_app/immutable/assets/0.BPP604gH.css +0 -1
- package/web/_app/immutable/assets/4.fOHsAKBF.css +0 -1
- package/web/_app/immutable/assets/NoteList.E6jC-AtZ.css +0 -1
- package/web/_app/immutable/chunks/BPrp4s2r.js +0 -1
- package/web/_app/immutable/chunks/CAlIuau0.js +0 -1
- package/web/_app/immutable/chunks/Cl5gQm2e.js +0 -1
- package/web/_app/immutable/chunks/DFKYo3Wx.js +0 -1
- package/web/_app/immutable/chunks/DxVFSMVD.js +0 -523
- package/web/_app/immutable/chunks/X3aTZRe_.js +0 -1
- package/web/_app/immutable/chunks/ej_0XxR7.js +0 -1
- package/web/_app/immutable/entry/app.BzA5QYtw.js +0 -2
- package/web/_app/immutable/entry/start.BOh0Gj31.js +0 -1
- package/web/_app/immutable/nodes/0.BmaxMLzC.js +0 -2
- package/web/_app/immutable/nodes/1.IQDu8pD1.js +0 -1
- package/web/_app/immutable/nodes/2.D2Oi-ADx.js +0 -1
- package/web/_app/immutable/nodes/3.CF1W85jb.js +0 -1
- package/web/_app/immutable/nodes/4.BMYBn904.js +0 -15
- package/web/_app/immutable/nodes/5.1vm6WZdM.js +0 -1
- package/web/_app/immutable/nodes/6.C9ia8cDm.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,i as r,o as i,s as a,u as o,x as s}from"./
|
|
1
|
+
import{_ as e,a as t,b as n,i as r,o as i,s as a,u as o,x as s}from"./DEQsS4Ez.js";import{a as c,t as l}from"./DciMwFJ1.js";import{a as u,d,i as f,l as p,s as m}from"./Kem7IXj7.js";import{n as h}from"./C1FDDux-.js";import{n as g}from"./CcE14TDI.js";import{i as _,t as v}from"./BtcGx-KQ.js";import{i as y,r as b,t as x}from"./OG9GsKke.js";import{PeleError as S,d as C,g as w,h as T,o as E,s as D,u as O}from"./zasx25UV.js";function k(e){let t=`TB`;for(let n of e)typeof n!=`string`&&n.stmt===`dir`&&(t=n.value);return t}function A(e,t,n){let r=[],i=[],a=new Map,o=new Map,s=new Map,c=0,l=0,u=e=>{if(!e.id||e.id===`</join></fork>`||e.id===`</choice>`)return;if(e.cssClasses){let t;for(let r of e.cssClasses.split(` `)){let i=n.get(r);if(i){t??=e.cssCompiledStyles.slice();for(let e of i.styles)t.push(e)}}t&&(e.cssCompiledStyles=t)}let t=a.get(e.id);if(t){let n=e.parentId??t.parentId;Object.assign(t,e),n!==void 0&&(t.parentId=n)}else a.set(e.id,e),r.push(e)},d=(e,n,r)=>{let a=n.id;if(a===`root`)return;let d=t.get(a),f=d?.classes?.join(` `)??``,p=d?.styles??[],m=o.get(a);if(!m){let e=`rect`;n.start===!0?e=`stateStart`:n.start===!1&&(e=`stateEnd`),n.type!=="default"&&(e=n.type),m={shape:e,description:a,cssClasses:`${f} statediagram-state`,cssStyles:p,type:void 0,dir:void 0,colorIndex:void 0},o.set(a,m)}if(n.description&&(Array.isArray(m.description)?(m.shape=`rectWithTitle`,m.description=m.description.concat(n.description)):m.description.length>0?(m.shape=`rectWithTitle`,m.description=m.description===a?[n.description].flat():[m.description,n.description].flat()):(m.shape=`rect`,m.description=Array.isArray(n.description)?n.description.slice():n.description)),m.description.length===1&&m.shape===`rectWithTitle`&&(m.shape=m.type===`group`?`roundedWithTitle`:`rect`),!m.type&&n.doc){if(m.type=`group`,m.dir=k(n.doc),m.shape=n.type===`divider`?`divider`:`roundedWithTitle`,m.shape===`divider`&&e?.id!==void 0&&s.has(e.id))m.colorIndex=s.get(e.id);else{let e=l++;m.colorIndex=f.trim()!==``||p.length>0?void 0:e}s.set(a,m.colorIndex),m.cssClasses=`${m.cssClasses} statediagram-cluster ${r?`statediagram-cluster-alt`:``}`}let h=m.description,g={id:a,shape:m.shape,label:Array.isArray(h)?h[0]:h,description:Array.isArray(h)?h.slice(1):[],cssClasses:m.cssClasses,cssCompiledStyles:[],cssStyles:m.cssStyles,type:m.type,isGroup:m.type===`group`,dir:m.dir,colorIndex:m.colorIndex};g.shape===`divider`&&(g.label=``),e&&e.id!==`root`&&(g.parentId=e.id);let _=n.note;if(!_){u(g);return}let v=(e,t,n,r)=>({id:e,shape:t,label:_.text,description:[],cssClasses:n,cssCompiledStyles:[],cssStyles:[],type:r?`group`:`node`,isGroup:r,dir:void 0,position:_.position}),y=v(`${a}----note-${c++}`,`note`,`statediagram-note`,!1);y.parentId=`${a}----parent`,y.noteFor=a,u(v(y.parentId,`noteGroup`,m.cssClasses,!0)),u(y),u(g);let b=_.position===`left of`,x=b?y.id:a,S=b?a:y.id;i.push({id:`${x}-${S}`,start:x,end:S,label:``,classes:`transition note-edge`,pattern:`dashed`})},f=[{item:void 0,doc:e,at:0,alt:!0}];for(;f.length>0;){let e=f[f.length-1];if(e.at>=e.doc.length){f.pop();continue}let t=e.doc[e.at++];typeof t!=`string`&&(t.stmt===`state`?(d(e.item,t,e.alt),t.doc&&f.push({item:t,doc:t.doc,at:0,alt:!e.alt})):t.stmt===`relation`&&(d(e.item,t.state1,e.alt),d(e.item,t.state2,e.alt),i.push({id:`edge${c++}`,start:t.state1.id,end:t.state2.id,label:t.description??``,classes:`transition`})))}for(let e of r)if(e.isGroup&&e.description.length>0)throw new S(`Group nodes can only have label. Remove the additional description for node [${e.id}]`,`semantic`,{type:`state`});return{nodes:r,edges:i}}var j=class{type=`state`;rootDoc=[];states=new Map;relations=[];classes=new Map;links=new Map;graph={nodes:[],edges:[]};title;accTitle;accDescr;dividerCount=0;get direction(){let e=`TB`;for(let t of this.rootDoc)typeof t!=`string`&&t.stmt===`dir`&&(e=t.value);return e}setRootDoc(e){this.rootDoc=e,this.translate(),this.extract(e)}extract(e){this.states=new Map,this.relations=[],this.classes=new Map;let t=Array.isArray(e)?e:e.doc;for(let e of t)if(typeof e!=`string`)switch(e.stmt){case`state`:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case`relation`:this.addRelation(e.state1,e.state2,e.description);break;case`classDef`:this.addStyleClass(e.id.trim(),e.classes);break;case`style`:{let t=e.styleClass.split(`,`).map(e=>e.replace(/;/g,``).trim());for(let n of this.named(e.id.trim()))n.styles=t.slice();break}case`applyClass`:this.setCssClass(e.id.trim(),e.styleClass);break;case`click`:this.addLink(typeof e.id==`string`?e.id:e.id.id,e.url,e.tooltip)}this.graph=A(t,this.states,this.classes)}translate(){let e=[[`root`,{stmt:`root`,id:`root`,doc:this.rootDoc},!0]];for(;e.length>0;){let[t,n,r]=e.pop();if(typeof n==`string`)continue;if(n.stmt===`relation`){e.push([t,n.state2,!1],[t,n.state1,!0]);continue}if(n.stmt===`state`)n.id===`[*]`?(n.id=t+(r?`_start`:`_end`),n.start=r):n.id=n.id.trim();else if(n.stmt!==`root`)continue;if(!n.doc)continue;let i=[],a=[];for(let e of n.doc)typeof e!=`string`&&e.stmt===`state`&&e.type===`divider`&&!e.doc?(i.push({...e,doc:a}),a=[]):a.push(e);i.length>0&&(a.length>0&&i.push({stmt:`state`,id:this.getDividerId(),type:`divider`,doc:a}),n.doc=i);for(let t=n.doc.length-1;t>=0;t--)e.push([n.id,n.doc[t],!0])}}addState(e,t=`default`,n,r,i,a){let o=e.trim(),s=this.states.get(o);if(s?(s.doc||(s.doc=n),s.type||(s.type=t)):(s={stmt:`state`,id:o,descriptions:[],type:t,doc:n,note:i,classes:[],styles:[],textStyles:[]},this.states.set(o,s)),r)for(let e of Array.isArray(r)?r:[r])this.addDescription(o,e.trim());if(i&&(s.note=i),a)for(let e of a)this.setCssClass(o,e.trim())}getState(e){return this.states.get(e)}addLink(e,t,n){this.links.set(e,{url:t,tooltip:n})}addRelation(e,t,n=``){for(let n of[e,t])this.addState(n.id,n.type,n.doc,n.description,n.note,n.classes);this.relations.push({id1:e.id.trim(),id2:t.id.trim(),relationTitle:n})}addDescription(e,t){this.states.get(e)?.descriptions?.push(t.startsWith(`:`)?t.replace(`:`,``).trim():t)}getDividerId(){return`divider-id-${++this.dividerCount}`}addStyleClass(e,t=``){let n=this.classes.get(e);if(n||(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t)for(let e of t.split(`,`)){let t=e.replace(`;`,``).trim();e.includes(`color`)&&n.textStyles.push(t.replace(`fill`,`bgFill`).replace(`color`,`fill`)),n.styles.push(t)}}setCssClass(e,t){for(let n of this.named(e))n.classes?.push(t)}getDirection(){for(let e of this.rootDoc)if(typeof e!=`string`&&e.stmt===`dir`)return e.value;return`TB`}setDirection(e){for(let t of this.rootDoc)if(typeof t!=`string`&&t.stmt===`dir`){t.value=e;return}this.rootDoc.unshift({stmt:`dir`,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}named(e){let t=[];for(let n of e.split(`,`)){let e=this.states.get(n);e||=(this.addState(n),this.states.get(n.trim())),e&&t.push(e)}return t}},M=`$end.INVALID.NL.SD.DESCR.-->.HIDE_EMPTY.scale.WIDTH.COMPOSIT_STATE.STRUCT_START.STRUCT_STOP.STATE_DESCR.AS.ID.FORK.JOIN.CHOICE.CONCURRENT.note.NOTE_TEXT.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.CLICK.STRING.HREF.classDef.CLASSDEF_ID.DEFAULT_CLASSDEF_ID.CLASSDEF_STYLEOPTS.DEFAULT.style.STYLE_IDS.STYLEDEF_STYLEOPTS.class.CLASSENTITY_IDS.STYLECLASS.direction_tb.direction_bt.direction_rl.direction_lr.EDGE_STATE.STYLE_SEPARATOR.left_of.right_of.INVALID`.split(`.`),N=/direction/gi,ee=/<<(?:fork|join|choice)>>|\[\[(?:fork|join|choice)\]\]/gi,te=/[\n\r\u2028\u2029]/g,P=/%%/g,F=/\{/g;function I(e,t){let n=0,r=-2;return i=>{if(r===-2||i<n||r!==-1&&i>r){e.lastIndex=i;let a=e.exec(t);r=a?a.index:-1,n=i}return r}}function L(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c,l=I(N,e),u=I(ee,e),d=I(te,e),f=I(P,e),p=I(F,e),m=-1,h=-1,g=[-1,-1,-1,-1],_=[0,0,0,0],v=-1,y=-1,b=[-1,-1,-1,-1,-1,-1],x=(t,a,o)=>{n.push(t),r.push(e.slice(a,o)),i.push(a),s=o},S=(e,t,a,o)=>{n.push(e),r.push(t),i.push(a),s=o},C=e=>{a.push(o),o=e},E=()=>{a.length>0&&(o=a.pop())},D=(t,n)=>{for(let r=0;r<t.length;r++){let i=t.charCodeAt(r),a=e.charCodeAt(n+r);if(a!==i&&!(i>=97&&i<=122&&a===i-32))return!1}return!0},O=n=>{let r=n;for(;r<t&&T(e.charCodeAt(r));)r++;return r},k=n=>{let r=n;for(;r<t&&w(e.charCodeAt(r));)r++;return r},A=n=>{let r=e.indexOf(`
|
|
3
3
|
`,n);return r===-1?t:r},j=e=>{let n=d(e);return n===-1?t:n},M=e=>{if(e<m||e>h){let n=l(e),r=n===-1?t:j(e);m=e,h=r,g[0]=g[1]=g[2]=g[3]=-1;for(let e=n;e!==-1&&e<r;e=l(e+1)){let t=O(e+9);if(t===e+9)continue;let n=D(`tb`,t)?0:D(`bt`,t)?1:D(`rl`,t)?2:D(`lr`,t)?3:-1;n!==-1&&(g[n]=e,_[n]=t+2)}}for(let t=0;t<4;t++)if(g[t]>=e)return t;return-1},L=n=>{if(n<v||n>y){let r=u(n),i=r===-1?t:j(n);v=n,y=i,b.fill(-1);for(let t=r;t!==-1&&t<i;t=u(t+1)){let n=e.charCodeAt(t+2)|32;b[(e.charCodeAt(t)===60?0:3)+(n===102?0:n===106?1:2)]=t}}for(let e=0;e<6;e++)if(b[e]>=n)return e;return-1},R=(e,t)=>{let n=f(e);return n===-1||n+2>t?(x(14,e,t),!0):n===e?(s=t,!1):(x(14,e,n),!0)},z=e=>(n.push(e),r.push(``),i.push(s),{types:n,texts:r,starts:i,error:c});for(;;){if(s>=t){switch(o){case 0:x(2,t,t);break;case 6:x(22,t,t);break;case 7:x(24,t,t);break;case 8:x(25,t,t);break;case 10:x(32,t,t);break;case 12:x(39,t,t);break;case 14:x(36,t,t);break;case 3:x(12,t,t);break;case 18:x(20,t,t);break;case 4:case 19:x(14,t,t)}return z(0)}let n=e.charCodeAt(s);switch(o){case 0:case 1:{let r=o===0,i=n|32;if(r){if(i===99&&D(`click`,s)&&!w(e.charCodeAt(s+5))){x(26,s,s+5);continue}if(i===104&&D(`href`,s)&&!w(e.charCodeAt(s+4))){x(28,s,s+4);continue}if(n===34){let t=e.indexOf(`"`,s+1);if(t!==-1){x(27,s,t+1);continue}}if(i===100&&D(`default`,s)&&!w(e.charCodeAt(s+7))){x(33,s,s+7);continue}let t=M(s);if(t!==-1){x(40+t,s,A(_[t]));continue}if(n===10){let t=s+1;for(;e.charCodeAt(t)===10;)t++;x(2,s,t);continue}if(T(n)){s=O(s);continue}}else if(n!==10&&T(n)){let n=s+1;for(;n<t&&e.charCodeAt(n)!==10&&T(e.charCodeAt(n));)n++;s=n;continue}if(n===35||n===37&&e.charCodeAt(s+1)===37&&e.charCodeAt(s+2)!==123){s=A(s);continue}if(i===115){if(r&&D(`scale`,s)){let e=O(s+5);if(e>s+5){x(7,s,e),C(5);continue}}if(D(`style`,s)){let e=O(s+5);if(e>s+5){x(34,s,e),C(13);continue}}if(D(`state`,s)){let e=O(s+5);if(e>s+5){s=e,C(2);continue}if(r&&D(`diagram`,s+5)){let t=D(`-v2`,s+12)?s+15:s+12;if(e=O(t),e>t){x(3,s,e);continue}}}}else if(i===99){if(D(`class`,s)){let e=D(`def`,s+5),t=e?s+8:s+5,n=O(t);if(n>t){x(e?29:37,s,n),C(e?9:11);continue}}}else if(i===97&&r&&(D(`acctitle`,s)||D(`accdescr`,s))){let t=(e.charCodeAt(s+3)|32)==116,n=O(s+8),r=e.charCodeAt(n);if(r===58){x(t?21:23,s,O(n+1)),C(t?6:7);continue}if(r===123&&!t){s=O(n+1),C(8);continue}}if(r){if(n===123){x(10,s,s+1),C(1);continue}}else{let e=M(s);if(e!==-1){x(40+e,s,A(_[e]));continue}if(n===125){x(11,s,s+1),E();continue}if(n===10){s++;continue}}if(i===110&&D(`note`,s)){let e=O(s+4);if(e>s+4){x(19,s,e),C(15);continue}}if(r&&i===104&&D(`hide empty description`,s)&&!w(e.charCodeAt(s+22))){x(6,s,s+22);continue}if(n===91&&e.charCodeAt(s+1)===42&&e.charCodeAt(s+2)===93){x(44,s,s+3);continue}let a=s;for(;a<t;){let t=e.charCodeAt(a);if(t===58||t===45||t===123||T(t))break;a++}if(a>s){R(s,a);continue}if(n===58){for(a=s+1;a<t;){let n=e.charCodeAt(a);if(n===10||n===59)break;if(n===58){let n=e.charCodeAt(a+1);if(a+1>=t||n===58||n===10||n===59)break;a++}a++}if(a>s+1){S(4,e.slice(s,a).trim(),s,a);continue}if(e.charCodeAt(s+1)===58&&e.charCodeAt(s+2)===58){x(45,s,s+3);continue}}else if(n===45&&e.charCodeAt(s+1)===45){if(e.charCodeAt(s+2)===62){x(5,s,s+3);continue}if(!r){x(18,s,s+2);continue}}if(!r)return z(1);x(48,s,s+1);continue}case 2:{if(n!==10&&T(n)){let n=s+1;for(;n<t&&e.charCodeAt(n)!==10&&T(e.charCodeAt(n));)n++;s=n;continue}if(n===35||n===37&&e.charCodeAt(s+1)===37&&e.charCodeAt(s+2)!==123){s=A(s);continue}let r=L(s);if(r!==-1){let t=b[r],n=r===2||r===5;S(n?17:r%3==0?15:16,e.slice(s,t).trim(),s,t+(n?10:8)),E();continue}if(n===34){s++,C(3);continue}let i=n===10?O(s):s;if(D(`as`,i)){let e=O(i+2);if(e>i+2){x(13,s,e),C(4);continue}}if(n===10){s++,E();continue}if(n===123){x(10,s,s+1),E(),C(1);continue}if(w(n)){let t=k(s),n=O(t);if(n>t&&w(e.charCodeAt(n))){let t=p(n+1);if(t!==-1&&t<j(n))return c=`Error: State name must be a single word. Found: "${e.slice(s,t+1).trim()}"`,z(1)}}let a=s+1;for(;a<t;){let t=e.charCodeAt(a);if(t===123||T(t))break;a++}x(9,s,a);continue}case 3:{if(n===34){s++,E();continue}let r=e.indexOf(`"`,s);x(12,s,r===-1?t:r);continue}case 4:{let n=s;for(;n<t;){let t=e.charCodeAt(n);if(t===10||t===123)break;n++}R(s,n)&&E();continue}case 5:{if(n>=48&&n<=57){let n=s+1;for(;n<t&&e.charCodeAt(n)>=48&&e.charCodeAt(n)<=57;)n++;x(8,s,n);continue}let r=O(s);if(r>s&&D(`width`,r)&&!w(e.charCodeAt(r+5))){s=r+5,E();continue}return z(1)}case 6:x(22,s,A(s)),E();continue;case 7:x(24,s,A(s)),E();continue;case 8:{if(n===125){s++,E();continue}let r=e.indexOf(`}`,s);x(25,s,r===-1?t:r);continue}case 9:{let e=D(`default`,s)&&O(s+7)>s+7,t=e?s+7:k(s),n=O(t);if(t===s||n===t)return z(1);x(e?31:30,s,n),E(),C(10);continue}case 10:x(32,s,A(s)),E();continue;case 11:{let t=k(s);if(t===s)return z(1);for(;e.charCodeAt(t)===44;){let e=O(t+1),n=k(e);if(n===e)break;t=n}x(38,s,t),E(),C(12);continue}case 12:x(39,s,A(s)),E();continue;case 13:{let n=s;for(;n<t&&(w(e.charCodeAt(n))||e.charCodeAt(n)===44);)n++;let r=O(n);if(n===s||r===n)return z(1);x(35,s,r),E(),C(14);continue}case 14:x(36,s,A(s)),E();continue;case 15:if(D(`left of`,s)&&!w(e.charCodeAt(s+7))){x(46,s,s+7),E(),C(16);continue}if(D(`right of`,s)&&!w(e.charCodeAt(s+8))){x(47,s,s+8),E(),C(16);continue}if(n===34){s++,E(),C(18);continue}return z(1);case 16:{let n=O(s),r=n;for(;r<t;){let t=e.charCodeAt(r);if(t===58||t===45||T(t))break;r++}if(r===n)return z(1);R(s,r)&&(E(),C(17));continue}case 17:{let n=O(s);if(e.charCodeAt(n)===58){let r=n+1;for(;r<t;){let t=e.charCodeAt(r);if(t===58||t===10||t===59)break;r++}if(r>n+1){S(20,e.slice(s+2,r).trim(),s,r),E();continue}}let r=e.indexOf(`
|
|
4
4
|
`,s),i=-1;for(;r!==-1&&(i=O(r),!D(`end note`,i)||w(e.charCodeAt(i+8)));)r=e.indexOf(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as e,f as t,m as n,p as r}from"./
|
|
1
|
+
import{d as e,f as t,m as n,p as r}from"./zasx25UV.js";var i=/[&<>"\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]/u,a=/[&<>"]|[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]+/gu,o={"&":`&`,"<":`<`,">":`>`,'"':`"`},s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]/u;function c(e){return i.test(e)?e.replace(a,e=>o[e]??``):e}function l(t){return c(e(t))}var u=[];for(let e=0;e<100;e++)u.push(e===0?``:e%10==0?`.`+e/10:`.`+(e<10?`0`+e:e));function d(e){let t=Math.round(e*100);if(t===0)return`0`;if(t>0){if(t<1e11){let e=Math.floor(t/100);return e+u[t-e*100]}}else if(t>-1e11){let e=-t,n=Math.floor(e/100);return`-`+n+u[e-n*100]}return String(t/100)}function f(e,t,n,r,i){let a=e.lines;if(a.length===0)return``;let o=e.lineHeight,s=e.heights,u=e.size*.35,f=n-e.height/2,p=a.length===1&&a[0].length===1?a[0][0]:void 0;if(p&&p.icon===void 0&&p.math===void 0&&p.style===0)return`<text${r} x="${d(t)}" y="${d(f+o/2+u)}" text-anchor="middle">${c(p.text)}</text>`;let m=T(e),h=r,g;r=E(r,m);let _=``,b=``;for(let n=0;n<a.length;n++){let r=a[n],p=s?s[n]:o,x=f+p/2,S=x+u,C=!1;for(let e of r)(e.icon!==void 0||e.math)&&(C=!0);if(C){let a=t-e.widths[n]/2;for(let t of r){if(t.math){let n=`x="${d(a)}" y="${d(x-t.math.height/2)}" width="${d(t.math.width)}" height="${d(t.math.height)}"`;g??=v(h),b+=g.halo===void 0?y(t.math,n,e.size,g.attrs):`<rect ${n} rx="2" fill="${g.halo}"/>`}else if(t.icon!==void 0){let n=e.size*1.1,r=i?.(t.icon)??``;b+=`<svg class="pele-icon" data-icon="${l(t.icon)}" x="${d(a)}" y="${d(x-n/2)}" width="${d(n)}" height="${d(n)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${r}</svg>`}else t.text!==``&&(_+=`<tspan x="${d(a)}" y="${d(S)}" text-anchor="start"${w(t.style&~m)}>${c(t.text)}</tspan>`);a+=t.width}}else{for(let e=0;e<r.length;e++){let n=r[e],i=e===0?` x="${d(t)}" y="${d(S)}"`:``;_+=`<tspan${i}${w(n.style&~m)}>${c(n.text)}</tspan>`}r.length===0&&(_+=`<tspan x="${d(t)}" y="${d(S)}"> </tspan>`)}f+=p}return`<text${r} text-anchor="middle" xml:space="preserve">${_}</text>${b}`}var p=/ fill="([^"]*)"/,m=/ stroke="([^"]*)"/,h=/ style="([^"]*)"/,g=/(?:^|;)\s*fill:([^;]*)/,_=/(?:^|;)\s*opacity:([^;]*)/;function v(e){let t=h.exec(e)?.[1]??``,n=(g.exec(t)?.[1]??p.exec(e)?.[1]??``).trim();if(n===`none`)return{attrs:``,halo:m.exec(e)?.[1]??`none`};let r=_.exec(t)?.[1].trim();return{attrs:(n===``?``:` color="${n}"`)+(r?` opacity="${r}"`:``)}}function y(e,t,n,r){return`svg`in e?`<svg class="pele-math" ${t} overflow="visible"${r}>${e.svg}</svg>`:`<foreignObject class="pele-math" ${t} overflow="visible"${r}><div xmlns="http://www.w3.org/1999/xhtml" style="display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:${d(n)}px;line-height:normal;white-space:nowrap">${e.html}</div></foreignObject>`}var b=` font-weight="var(--_w)"`,x=` font-style="italic"`,S=` text-decoration="underline"`,C=` font-family="var(--_fm)"`,ee=` baseline-shift="sub" font-size="smaller"`,te=` baseline-shift="super" font-size="smaller"`;function w(e){return(e&1?b:``)+(e&2?x:``)+(e&4?C:``)+(e&32?S:``)+(e&8?ee:e&16?te:``)}function T(e){let t=7,n=!1;for(let r of e.lines)for(let e of r)e.icon!==void 0||e.text===``||(t&=e.style,n=!0);return n?t:0}function E(e,t){return e+(t&1&&!e.includes(` font-weight="`)?b:``)+(t&2&&!e.includes(` font-style="`)?x:``)+(t&4&&!e.includes(` font-family="`)?C:``)}var ne=1.5,D=1.3,re=/<br\s*\/?>|\\n|\n/gi,O=/<\/?([a-zA-Z][\w-]*)(?:\s[^<>]*)?\/?>/y,k=/(fa[bklrs]?):fa-([\w-]+)/g,A=/[<\\\n*_]|fa[bklrs]?:fa-/,j=new Map([[`b`,1],[`strong`,1],[`i`,2],[`em`,2],[`cite`,2],[`dfn`,2],[`var`,2],[`code`,4],[`kbd`,4],[`samp`,4],[`tt`,4],[`sub`,8],[`sup`,16],[`u`,32],[`ins`,32]]),ie=24,ae=new Set(`a abbr address article aside audio b bdi bdo big blockquote body br button caption center cite code col colgroup data dd del details dfn dialog div dl dt em embed fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hr html i iframe img input ins kbd label legend li link main map mark meta meter nav noscript object ol optgroup option output p picture pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr`.split(` `)),M=`\\u2e80-\\u9fff\\uf900-\\ufaff\\uff00-\\uff60`,N=`、。,.:;!?)]}」』】〕〉》〙〗ー…‥・ゝゞぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮ,.:;!?)\\]}`,oe=`([{「『【〔〈《〘〖([{`,se=RegExp(`[${M}]`),P=`\\u200b\\u00ad`,ce=RegExp(`[${P}]`),le=RegExp(`\\s*(?:[${oe}]*[${M}][${N}]*|[^\\s${M}${P}]+[${P}]*[${N}]*|[${P}]+)\\s*|\\s+`,`g`),F=57344,I=6400,L=/\$\$(.+?)\$\$/g,R=/[\ue000-\uf8ff]/,z=/([\ue000-\uf8ff])/,B,V={lines:[],widths:[],width:0,height:0,size:0,lineHeight:0};function H(e){let t=e.split(`
|
|
2
2
|
`),n=1/0;for(let e of t){if(e.trim()===``)continue;let t=e.length-e.trimStart().length;t<n&&(n=t)}return n===1/0||n===0?e:t.map(e=>e.slice(Math.min(n,e.length-e.trimStart().length))).join(`
|
|
3
3
|
`)}function U(e){return e!==void 0&&e.icon===void 0&&e.math===void 0}function W(e,t,n){if(t!==``){if(B!==void 0&&R.test(t)){let r=B,i=t.split(z);for(let t=0;t<i.length;t++){if(t%2==0){i[t]!==``&&G(e,i[t],n);continue}let a=i[t].charCodeAt(0)-F,o=r.math[a];o?e.push({text:``,style:n,math:o,width:o.width}):G(e,`$$${r.tex[a]}$$`,n)}return}G(e,t,n)}}function G(t,n,r){let i=e(n),a=t[t.length-1];U(a)&&a.style===r?a.text+=i:t.push({text:i,style:r,width:0})}function ue(e,n,r){if(!n.includes(`:fa-`)){W(e,n,r);return}let i=0;k.lastIndex=0;let a;for(;(a=k.exec(n))!==null;){let o=`${a[1]}:fa-${a[2]}`;if(W(e,n.slice(i,a.index),r),i=a.index+a[0].length,t(o)!==``)e.push({text:``,style:r,icon:o,width:0});else if(n[i]===` `)i++;else if(i===n.length){let t=e[e.length-1];U(t)&&(t.text=t.text.trimEnd())}}W(e,n.slice(i),r)}function de(e,t,n,r,i){let a=i.style,o=0,s=``,c=0,l=t.length,u=()=>{ue(e,s,a|(i.shifts[i.shifts.length-1]??0)),s=``};for(;c<l;){let e=t[c];if(e===`<`){O.lastIndex=c;let e=O.exec(t);if(e&&e.index===c){let n=e[1].toLowerCase(),o=t[c+1]===`/`,s=j.get(n)??0;if(s&ie){u();let e=i.shifts.lastIndexOf(s);o?e!==-1&&i.shifts.splice(e,1):i.shifts.push(s)}else s&&(u(),i.style=o?i.style&~s|r&s:i.style|s,a=o?a&~s|r&s:a|s);if(s||ae.has(n)){c+=e[0].length;continue}}}else if(n&&(e===`*`||e===`_`)){let n=t[c+1]===e,i=n?1:2,s=n?2:1,d=(o&i)===0,f=c>0?t[c-1]:` `,p=c+s<l?t[c+s]:` `,m=d&&p.trim()!==``&&t.indexOf(n?e+e:e,c+s)!==-1,h=!d&&f.trim()!==``,g=e===`_`&&/\w/.test(f)&&/\w/.test(p);if((m||h)&&!g){u(),o=m?o|i:o&~i,a=m?a|i:a&~i|r&i,c+=s;continue}}s+=e,c++}u()}function fe(e,t,n){let r=0;for(let i of e)i.width=i.icon===void 0?i.math?i.math.width:t.width(i.text,n,i.style):n*1.25,r+=i.width;return r}function K(e,t,n,r,i,a){let o=[],s=0,c=(e=!1)=>{let r=o[o.length-1];if(U(r)){let i=r.text.trimEnd();if(e&&r.text.endsWith(``)&&(i=i.slice(0,-1)+`-`),i!==r.text){r.text=i;let e=t.width(i,n,r.style);s+=e-r.width,r.width=e}}i.push(o),a.push(s),o=[],s=0};for(let i of e){if(i.icon!==void 0||i.math){let e=i.math?i.math.width:n*1.25;s>0&&s+e>r&&c(),o.push({...i,width:e}),s+=e;continue}let a=i.text.match(le)??[],l=i.text.includes(``),u=l?a.length:0,d=new Float64Array(u),f=new Float64Array(u+1);for(let r=u-1;r>=0;r--){let o=a[r].endsWith(``),s=a[r].trimEnd();d[r]=t.width(o?s.slice(0,-1):s,n,i.style),f[r]=o?r===u-1?i===e[e.length-1]?d[r]:1/0:d[r]+f[r+1]:d[r]}for(let e=0;e<a.length;e++){let u=a[e],p=l?d[e]:t.width(u.trimEnd(),n,i.style),m=!l||!u.endsWith(``)?s+p<=r:s+t.width(u.slice(0,-1)+`-`,n,i.style)<=r||s+f[e]<=r;s>0&&!m&&(c(u.trimStart()===u),u=u.trimStart());let h=o[o.length-1];if(U(h)&&h.style===i.style){if(h.text+=u,p>0||u.trimEnd()!==u){let e=h.width;h.width=t.width(h.text,n,h.style),s+=h.width-e}}else{let e=t.width(u,n,i.style);o.push({text:u,style:i.style,width:e}),s+=e}}}(o.length>0||i.length===0)&&c()}function pe(t,i,a,o,s,c=0){if(t===void 0||t===``)return V;let l=Math.round(o*ne);if(r()&&t.includes(`$$`)&&!R.test(t)){let r={tex:[],math:[]},u=t.replace(L,(e,t)=>r.tex.length===I?e:(r.tex.push(t),String.fromCharCode(F+r.tex.length-1)));if(r.tex.length>0){for(let t of r.tex)r.math.push(n(e(t),o));return q(u,i,a,o,s,c,l,r)}}if(!A.test(t)&&!t.includes(`&`)&&!t.includes(`fl`)){let e=t.trim(),n=a.width(e,o,c);if(n<=s||!(e.includes(` `)||se.test(e)||ce.test(e)))return{lines:[[{text:e,style:c,width:n}]],widths:[n],width:n,height:l,size:o,lineHeight:l};let r=[],i=[];K([{text:e,style:c,width:n}],a,o,s,r,i);let u=0;for(let e of i)e>u&&(u=e);let d=r.length>1?Math.round(o*D):l;return{lines:r,widths:i,width:u,height:r.length*d,size:o,lineHeight:d}}return q(t,i,a,o,s,c,l)}function q(e,t,n,r,i,a,o,s){let c=B;B=s;try{let c=me(e,t,n,r,i,a,o);return s?J(c):c}finally{B=c}}function me(e,t,n,r,i,a,o){let s=t?H(e.replace(/\r\n?/g,`
|
|
4
4
|
`)).trim():e.trim(),c=[],l=[],u=0,d={style:a,shifts:[]};for(let e of s.split(re)){let o=[];de(o,e.trim(),t,a,d);let s=fe(o,n,r);s>i?K(o,n,r,i,c,l):(c.push(o),l.push(s))}for(let e of l)e>u&&(u=e);let f=c.length>1?Math.round(r*D):o;return{lines:c,widths:l,width:u,height:c.length*f,size:r,lineHeight:f}}function J(e){let t;for(let n=0;n<e.lines.length;n++){let r=e.lineHeight;for(let t of e.lines[n])t.math&&(r=Math.max(r,Math.ceil(t.math.height+e.size/4)));r!==e.lineHeight&&t===void 0&&(t=e.lines.map(()=>e.lineHeight)),t&&(t[n]=r)}if(t===void 0)return e.heights===void 0?e:{...e,heights:void 0,height:e.lines.length*e.lineHeight};let n=0;for(let e of t)n+=e;return{...e,heights:t,height:n}}function he(e){for(let t of e)if(t.math)return!0;return!1}function ge(e,t){let n=e.heights;if(!n)return(t+.5)*e.lineHeight;let r=0;for(let e=0;e<t;e++)r+=n[e];return r+n[t]/2}function _e(e,t){let n=e.widths[t],r=e.heights?e.heights[t]:e.lineHeight,i={lines:[e.lines[t]],widths:[n],width:n,height:r,size:e.size,lineHeight:e.lineHeight};return r!==e.lineHeight&&(i.heights=[r]),i}var ve=`--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg)`,ye=`var(--_fm)`,be=`var(--pele-radius,4px)`,Y=` style="rx:var(--_r)"`;function xe(e){let t=e.indexOf(` style="`);return t<0?e+Y:`${e.slice(0,t+8)}rx:var(--_r);${e.slice(t+8)}`}var Se=`var(--pele-critical,#e45756)`,X=String.raw`(?:"[^"'\\\n<>{}();:@]*"|'[^"'\\\n<>{}();:@]*'|[\p{L}\p{N}_-][\p{L}\p{N}_ .-]*)`,Ce=new RegExp(String.raw`^\s*${X}(?:\s*,\s*${X})*\s*$`,`u`);function Z(e,t){return e&&Ce.test(e)?e:t}function we(e,t,n){return`;--_fm:var(--pele-font-mono,${Z(n,`monospace`)});font:${e}px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,${Z(t,`sans-serif`)})`}var Te=new Set([`fill`,`fill-opacity`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`,`stroke-linecap`,`stroke-linejoin`,`stroke-opacity`,`opacity`,`rx`,`ry`]),Ee=new Set([`color`,`font-size`,`font-family`,`font-weight`,`font-style`,`text-decoration`,`letter-spacing`,`word-spacing`,`opacity`]),De=/url\s*\(|expression\s*\(|javascript:|[<>{};\\]|@import|image-set|\/\*/i,Q={shape:``,line:``,text:``,stroke:void 0,bold:!1,italic:!1,fontSize:void 0};function $(e){if(e.length===0)return Q;let t=new Map,n=new Map;for(let r of e){let e=r.indexOf(`:`);if(e<=0)continue;let i=r.slice(0,e).trim().toLowerCase(),a=r.slice(e+1).replace(/!important/gi,``).trim();a===``||De.test(a)||s.test(a)||(Te.has(i)&&t.set(i,a),Ee.has(i)&&n.set(i===`color`?`fill`:i,a))}if(t.size===0&&n.size===0)return Q;let r=``,i=``;for(let[e,n]of t)r+=`${e}:${n};`,e!==`fill`&&e!==`fill-opacity`&&(i+=`${e}:${n};`);let a=``;for(let[e,t]of n)a+=`${e}:${t};`;let o=n.get(`font-weight`),l=n.get(`font-size`),u=l&&/^[\d.]+(px)?$/.test(l)?parseFloat(l):void 0;return{shape:r?` style="${c(r)}"`:``,line:i?` style="${c(i)}"`:``,text:a?` style="${c(a)}"`:``,stroke:t.get(`stroke`),bold:o===`bold`||o===`bolder`||Number(o)>=600,italic:n.get(`font-style`)===`italic`,fontSize:u!==void 0&&u>0&&u<=200?u:void 0}}var Oe=/[^\w-]+/g;function ke(e){let t=e.replace(Oe,` `).trim();return t===``?``:` `+t}var Ae=[`#4c78a8`,`#f58518`,`#54a24b`,`#e45756`,`#72b7b2`,`#eeca3b`,`#b279a2`,`#9d755d`];function je(e){let t=(e%8+8)%8;return`var(--pele-series-${t+1},${Ae[t]})`}var Me=[[`tw`,`title`],[`hw`,`heading`],[`w`,`bold`]],Ne=/var\(--_(r|tw|hw|w)\)/g;function Pe(e,t,n,r,i,a,o){let s=c(i.idPrefix??`pele`),u=``,d=``;a.accTitle&&(u+=`<title id="${s}-title">${l(a.accTitle)}</title>`,d+=` aria-labelledby="${s}-title"`),a.accDescr&&(u+=`<desc id="${s}-desc">${l(a.accDescr)}</desc>`,d+=` aria-describedby="${s}-desc"`);let f=i.responsive===!1?``:`max-width:100%;height:auto;`,p=new Set;for(let[,e]of o.matchAll(Ne))if(p.add(e),p.size===4)break;let m=p.has(`r`)?`;--_r:${be}`:``;for(let[e,t]of Me)p.has(e)&&(m+=`;--_${e}:var(--pele-${t}-weight,bold)`);return`<svg xmlns="http://www.w3.org/2000/svg" class="pele pele-${e}" viewBox="0 0 ${t} ${n}" width="${t}" height="${n}" style="${f}${ve}${m}${c(we(r,i.fontFamily,i.fontFamilyMono))}" fill="var(--_fg)" role="graphics-document document" aria-roledescription="${e}"${d}>`+u+o+`</svg>`}export{Pe as _,c as a,ke as b,T as c,xe as d,je as f,Se as g,J as h,l as i,ye as l,w as m,s as n,f as o,ge as p,Y as r,$ as s,E as t,pe as u,he as v,d as x,_e as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,b as t,f as n,i as r,o as i,p as a,u as o,x as s,y as c}from"./
|
|
1
|
+
import{_ as e,b as t,f as n,i as r,o as i,p as a,u as o,x as s,y as c}from"./DEQsS4Ez.js";import{r as l,t as u}from"./DciMwFJ1.js";import{n as d,r as f,t as p}from"./BQeONalw.js";import{t as m}from"./C1FDDux-.js";import{a as ee,i as h,o as g}from"./CcE14TDI.js";import{PeleError as _,f as v,u as y}from"./zasx25UV.js";var b=11,x=class{type=`mindmap`;title;nodes=[];getType=p;baseLevel=0;open=[];addNode(e,t,n,r){let i=this.nodes.length===0;i&&(this.baseLevel=e),e-=this.baseLevel;let a=this.open,o=a.length;for(;o>0&&a[o-1].level>=e;)o--;let s=a[o-1];if(!s&&!i)throw new _(`There can be only one root. No parent could be found for ("${n}")`,`semantic`,{type:`mindmap`});let c={id:this.nodes.length,nodeId:t,level:e,descr:n,type:r,children:[],isRoot:i};s&&(c.section=s.isRoot?s.children.length%b:s.section,s.children.push(c)),a.length=o,a.push(c),this.nodes.push(c)}decorateNode(e){let t=this.nodes[this.nodes.length-1];!e||!t||(e.icon&&(t.icon=e.icon),e.class&&(t.class=e.class))}};function S(e,t){f(e,t,!1)}var te=[``,`rounded`,`rect`,`circle`,`cloud`,`bang`,`hex`],ne=`stadium`,re=36,ie=8,ae=18,oe=52,se=28,ce=6,le=12,ue=.22,C=6,w=28,de=12,fe=8,pe=10;function me(e,t,n,r){if(e.lines.length<2)return i(e,t+e.width/2,n,` class="pele-label"`,r);let o=``,s=n-e.height/2;for(let n=0;n<e.lines.length;n++)o+=i(c(e,n),t+e.widths[n]/2,s+a(e,n),` class="pele-label"`,r);return o}function he(e,t,n){return u(n,r=>T(e,t,n,r))}function T(a,c,u,f){let p=u.fontSize??16,_=u.measurer??y(u.fontFamily,u.fontFamilyMono),b=u.padding??8,x=u.icons,S=c.mindmap?.maxNodeWidth,he=typeof S==`number`&&S>0?Math.min(S,2e3):200,T=p*1.25,E=a.nodes,D=E.length,O=new Int32Array(D),k=new Int32Array(D);for(let e=0;e<D;e++)for(let t of E[e].children)O[t.id]=e,k[t.id]=k[e]+1;let ge=f&&u.maxWidth!==void 0&&u.maxWidth>0?u.maxWidth-2*b:1/0,A=Array(D),j=Array(D),M=new Float64Array(D),N=new Float64Array(D),P=new Float64Array(D),F=new Float64Array(D),I=new Uint8Array(D);for(let e=0;e<D;e++){let t=E[e];I[e]=+(t.icon!==void 0&&v(t.icon)!==``);let n=Math.min(he,Math.max(72,ge-k[e]*w-2*ce-(I[e]?T+C:0))),r=A[e]=o(t.descr,!0,_,p,n),i=r.width+(I[e]?T+(r.width>0?C:0):0),a=Math.max(r.height,Math.round(p*1.5)),s=te[t.type]||(e===0?ne:``);if(f&&e===0&&s!==`rect`&&s!==`rounded`&&(s=ne),j[e]=s,s===``){let n=t.children.length>0;M[e]=i+2*(n?le:ce),N[e]=a+(n?6:0),F[e]=N[e]/2}else{let t=h(s,i,a);M[e]=t.w,N[e]=t.h,P[e]=t.dy,F[e]=t.h/2}}let L=new Float64Array(D),R=new Float64Array(D),z=new Float64Array(D),_e=new Float64Array(D),ve=0,ye=(e,t,n,r)=>{let i=0,a=0;for(let o=t;o<n;o++){let t=e[o].id;R[t]=i,a=e[o].children.length>0||o+1<n&&e[o+1].children.length>0?Math.max(r,ae):r,i+=L[t]+a}ve=i-a;let o=e[t].id,s=e[n-1].id;return(R[o]+z[o]+F[o]+R[s]+z[s]+F[s])/2};for(let e=D-1;e>0;e--){let t=E[e].children;if(t.length===0){L[e]=N[e];continue}let n=ye(t,0,t.length,ie)-F[e],r=Math.min(0,n);L[e]=Math.max(ve,n+N[e])-r,z[e]=n-r,_e[e]=-r}let B=new Float64Array(D),V=new Float64Array(D),H=new Float64Array(D),U=new Int8Array(D),be=new Float64Array(D);if(f){let e=0;for(let t=0;t<D;t++)t>0&&O[t]===0&&(e+=pe),B[t]=k[t]*w+M[t]/2,V[t]=e,e+=N[t]+pe}else if(D>0){let e=E[0].children,t=e.length,n=0;for(let t of e)n+=L[t.id];let r=t,i=1/0,a=0;for(let o=1;o<t;o++){a+=L[e[o-1].id];let s=Math.abs(2*a-n+(2*o-t)*se);s<i&&(i=s,r=o)}for(let n=0,i=r,a=1;n<t;n=i,i=t,a=-1){let t=ye(e,n,i,se);for(let r=n;r<i;r++){let n=e[r].id;H[n]=R[n]-t,U[n]=a}}V[0]=-N[0]/2;for(let e=0;e<D;e++){e>0&&(V[e]=H[e]+z[e]);for(let t of E[e].children){let n=t.id;e>0&&(U[n]=U[e],H[n]=H[e]+_e[e]+R[n]),B[n]=B[e]+U[n]*(M[e]/2+(e>0?re:oe)+M[n]/2)}}}let W=0,G=0,K=0,q=0,J=``,Y=``,X=``,Z=``,xe=e=>{X!==``&&(J+=`<g class="pele-branch pele-section-${e??0}"><g class="pele-edges" fill="none" stroke="${Z}" stroke-width="1.5">${Y}</g>${X}</g>`,Y=X=``)};for(let e=1;e<=D;e++){let a=e%D,o=E[a],c=j[a],l=A[a],u=B[a],p=V[a];if(W=Math.min(W,u-M[a]/2),G=Math.max(G,u+M[a]/2),K=Math.min(K,p),q=Math.max(q,p+N[a]),(a===0||O[a]===0)&&xe(E[e-1].section),a>0&&f){O[a]===0&&(Z=n(o.section??0));let e=O[a],t=e===0?Math.min(Math.max(de,N[0]/2),w-fe):de,r=B[e]-M[e]/2+Math.min(t,M[e]/2),i=be[e]||V[e]+N[e],l=u-M[a]/2+(c?g(c,M[a],N[a],3):0),d=p+F[a],f=Math.max(0,Math.min(fe,l-r,d-i));be[e]=d-f,Y+=`<path class="pele-edge" d="M${s(r)},${s(i)}V${s(d-f)}Q${s(r)},${s(d)} ${s(r+f)},${s(d)}H${s(l)}"/>`}else if(a>0){O[a]===0&&(Z=n(o.section??0));let e=O[a],t=U[a],r=t>0?1:3,i=B[e]+t*(M[e]/2-(j[e]?g(j[e],M[e],N[e],r):0)),l=V[e]+F[e],d=u-t*M[a]/2+(c?t*g(c,M[a],N[a],4-r):0),f=p+F[a],m=s((i+d)/2);Y+=`<path class="pele-edge" d="M${s(i)},${s(l)}C${m},${s(l)} ${m},${s(f)} ${s(d)},${s(f)}"/>`}let m=!c&&o.children.length>0,h=` fill="${Z}" fill-opacity="${ue}" stroke="${Z}"`,_=``;c?_=a>0?ee(c,M[a],N[a],h,` stroke="${Z}"`):ee(c,M[a],N[a],` fill="var(--_s)" stroke="var(--_b)"`,` stroke="var(--_b)"`):m&&(_=`<rect x="${s(-M[a]/2)}" y="${s(-N[a]/2)}" width="${s(M[a])}" height="${s(N[a])}" rx="${s(N[a]/2)}"${h}/>`);let v=0;o.icon&&I[a]&&(v=(T+(l.width>0?C:0))/2,_+=d(o.icon,-v-l.width/2,P[a]-T/2,T,x));let y=`<g class="pele-node pele-shape-${c||(m?`branch`:`text`)}${a>0?``:` pele-root`}${t(o.class??``)}" data-id="${r(o.nodeId)}" transform="translate(${s(u)},${s(p+N[a]/2)})">`+_+(f&&!c?me(l,v-l.width/2,P[a],x):i(l,v,P[a],` class="pele-label"`,x))+`</g>`;a>0?X+=y:J+=y}let Q=m(a.title,_,p,l(u)),Se=Q.height>0?Q.height+16:0,Ce=Math.max(G-W,Q.width),$=Math.ceil(Ce+2*b),we=Math.ceil(q-K+Se+2*b),Te=i(Q,$/2,b+Q.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${s(b-W+(Ce-G+W)/2)},${s(b+Se-K)})">${J}</g>`;return{svg:e(`mindmap`,$,we,p,u,{},Te),width:$,height:we,links:[]}}var E={type:`mindmap`,math:!0,parse(e,t,n){let r=new x;return r.title=n,S(e,r),r},render:he};export{E as mindmap};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,r as l,s as u,t as d,u as f,v as p,x as m,y as h}from"./
|
|
1
|
+
import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,r as l,s as u,t as d,u as f,v as p,x as m,y as h}from"./DEQsS4Ez.js";import{a as g,t as _}from"./DciMwFJ1.js";import{i as v,l as y}from"./Kem7IXj7.js";import{t as b}from"./C1FDDux-.js";import{a as x,r as S}from"./BtcGx-KQ.js";import{t as C}from"./BZmnMkFw.js";import{n as w,r as ee}from"./DW5uy3Jw.js";import{i as te,n as ne,r as T,t as re}from"./OG9GsKke.js";import{d as ie,g as E,h as D,s as O,u as ae,y as k}from"./zasx25UV.js";function A(e){return e===`markdown`||e===`string`||e===`text`?e:`markdown`}var oe=class{type=`er`;direction=`TB`;entities=new Map;relationships=[];classes=new Map;subgraphs=[];title;accTitle;accDescr;subgraphLookup=new Map;claimed=new Set;addEntity(e,t=``){let n=this.entities.get(e);return n===void 0?(n={id:`entity-${e}-${this.entities.size}`,label:e,alias:t,attributes:[],cssClasses:`default`,cssStyles:[]},this.entities.set(e,n)):!n.alias&&t&&(n.alias=t),n}addAttributes(e,t){let n=this.addEntity(e);for(let e=t.length-1;e>=0;e--){let r=t[e];r.keys??=[],r.comment??=``,n.attributes.push(r)}}addRelationship(e,t,n,r){let i=this.subgraphLookup.has(e)?e:this.addEntity(e).id,a=this.subgraphLookup.has(n)?n:this.addEntity(n).id;this.relationships.push({entityA:i,roleA:t,entityB:a,relSpec:r})}setDirection(e){this.direction=e}addCssStyles(e,t){if(t)for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssStyles.push(n);let r=this.subgraphLookup.get(n);if(r)for(let e of t)r.cssStyles.push(e)}}addClass(e,t){for(let n of e){let e=this.classes.get(n);if(e===void 0&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e)),t)for(let n of t)n.includes(`color`)&&e.textStyles.push(n.replace(`fill`,`bgFill`)),e.styles.push(n)}}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subgraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}addSubGraph(e,t,n){let r=e.text.trim(),i=new Set,a=[],o;for(let e of t.flat()){if(typeof e!=`string`){e?.stmt===`dir`&&(o=e.value);continue}let t=e.trim();t===``||i.has(t)||(i.add(t),this.claimed.has(e)||a.push(e))}for(let e of a)this.claimed.add(e);let s={id:r,nodes:a,title:(n.text||``).trim(),classes:[],cssStyles:[],dir:o,labelType:A(n.type)};return this.subgraphs.push(s),this.subgraphLookup.set(r,s),r}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}},j=`$end.INVALID.ER_DIAGRAM.EOF.NEWLINE.COLON.STYLE_SEPARATOR.BLOCK_START.BLOCK_STOP.SQS.SQE.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.END.SUBGRAPH.direction_tb.direction_bt.direction_rl.direction_lr.CLASSDEF.UNICODE_TEXT.STYLE_TEXT.COMMA.CLASS.STYLE.SEMI.NUM.BRKT.ENTITY_NAME.DECIMAL_NUM.ENTITY_ONE.ATTRIBUTE_WORD.ATTRIBUTE_KEY.COMMENT.ZERO_OR_ONE.ZERO_OR_MORE.ONE_OR_MORE.ONLY_ONE.MD_PARENT.NON_IDENTIFYING.IDENTIFYING.WORD.CHAR`.split(`.`),M=1,N=2,P=4,F=8,I=new Uint8Array(128);for(let e=0;e<128;e++){let t=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95,n=t&&(e<48||e>57);t&&(I[e]|=M|N|F),n&&(I[e]|=P)}for(let e of`-*`)I[e.charCodeAt(0)]|=M|N|F;I[46]|=M|F,I[42]|=P;for(let e of`[](),`)I[e.charCodeAt(0)]|=F;var L=/accTitle\s*:\s*/iy,R=/accDescr\s*:\s*/iy,z=/accDescr\s*\{\s*/iy,se=[/.*direction\s+TB[^\n]*/iy,/.*direction\s+BT[^\n]*/iy,/.*direction\s+RL[^\n]*/iy,/.*direction\s+LR[^\n]*/iy],B=/direction/gi,V=/[\n\r\u2028\u2029]/g;function H(e,t){return e<128?(I[e]&t)!==0:e>=192||e===181}function U(e){let t=e.length,n=[],r=[],i=[],a=0,o=0,s=-2,c=0,l=-1,u=-2,d=-1,f=-1,p=-1,m=(t,a,s)=>{n.push(t),r.push(e.slice(a,s)),i.push(a),o=s},h=(t,n)=>(t.lastIndex=n,t.test(e)?t.lastIndex:-1),g=t=>{for(let n=0;n<t.length;n++){let r=t.charCodeAt(n),i=e.charCodeAt(o+n);if(i!==r&&(r<97||r>122||(i|32)!==r))return!1}return!0},_=t=>g(t)&&!E(e.charCodeAt(o+t.length)),v=t=>{let n=e.charCodeAt(t);return n>=65&&n<=90?n+32:n},y=n=>(V.lastIndex=n,V.test(e)?V.lastIndex-1:t),b=t=>{for(;k(e.charCodeAt(t));)t++;return t},x=()=>{if(s===-1||s<o&&(B.lastIndex=o,s=B.test(e)?B.lastIndex-9:-1,s===-1)||o<c||(l<o&&(l=y(o)),s>=l))return!1;for(let e=0;e<4;e++){let t=h(se[e],o);if(t>=0)return m(18+e,o,t),!0}return c=l,!1},S=()=>{let t=e.indexOf(`"`,o+1);if(t===-1){m(45,o,o+1);return}let n=t>o+1;for(let r=o+1;n&&r<t;r++){let t=e.charCodeAt(r);(t===37||t===92||t===13||t===10||t===11||t===8)&&(n=!1)}m(n?31:44,o,t+1)},C=t=>{let n=e.charCodeAt(o+1);if(n===43&&(t===49||t===48)){m(t===49?39:38,o,o+2);return}let r=b(o+1);if(e.charCodeAt(r)===46&&k(e.charCodeAt(r+1)))m(32,o,b(r+2));else{if(t===49){if(D(n)){let t=o+2;for(;D(e.charCodeAt(t));)t++;let n=e.charCodeAt(t);if(E(n)||n===34||n===39){m(40,o,o+1);return}}else if(n===45||n===46){let t=e.charCodeAt(o+2);if(t===45||t===46){m(40,o,o+1);return}}if(!E(n)){m(33,o,o+1);return}}m(29,o,r)}},w=t=>{let n=e.charCodeAt(o+1);switch(t){case 101:if(_(`erdiagram`))m(2,o,o+9);else if(_(`end`)){let t=o+3;for(;D(e.charCodeAt(t));)t++;m(16,o,t)}else return!1;return!0;case 115:if(_(`style`))a=6,m(27,o,o+5);else if(_(`subgraph`))m(17,o,o+8);else return!1;return!0;case 99:if(_(`classdef`))a=6,m(22,o,o+8);else if(_(`class`))m(26,o,o+5);else return!1;return!0;case 111:if(_(`one or zero`))m(37,o,o+11);else if(_(`one or more`)||_(`one or many`))m(39,o,o+11);else if(_(`one`))m(40,o,o+3);else if(_(`only one`))m(40,o,o+8);else if(n===124)m(37,o,o+2);else if(n===123)m(38,o,o+2);else if(_(`optionally to`))m(42,o,o+13);else return!1;return!0;case 122:if(_(`zero or one`))m(37,o,o+11);else if(_(`zero or more`)||_(`zero or many`))m(38,o,o+12);else return!1;return!0;case 109:if(g(`many(0)`))m(38,o,o+7);else if(g(`many(1)`))m(39,o,o+7);else if(_(`many`))m(38,o,o+4);else return!1;return!0;case 116:return _(`to`)?(m(43,o,o+2),!0):!1;case 117:return n!==46&&n!==45&&n!==124?!1:(m(41,o,o+1),!0);case 124:if(v(o+1)===111&&!E(e.charCodeAt(o+2)))m(37,o,o+2);else if(n===124)m(40,o,o+2);else if(n===123)m(39,o,o+2);else return!1;return!0;case 125:if(v(o+1)===111&&!E(e.charCodeAt(o+2)))m(38,o,o+2);else if(n===124)m(39,o,o+2);else return!1;return!0;case 46:return n!==46&&n!==45?!1:(m(42,o,o+2),!0);case 45:if(n===45)m(43,o,o+2);else if(n===46)m(42,o,o+2);else return!1;return!0}return!1},ee=t=>{let n;if((t===97||t===65)&&g(`acc`)){if((n=h(L,o))>=0){a=3,m(11,o,n);return}if((n=h(R,o))>=0){a=4,m(13,o,n);return}if((n=h(z,o))>=0){a=5,o=n;return}}if(!x()){switch(t){case 32:case 9:case 13:n=o+1;for(let t=e.charCodeAt(n);t===32||t===9||t===13;t=e.charCodeAt(n))n++;o=n;return;case 10:for(n=o+1;e.charCodeAt(n)===10;)n++;m(4,o,n);return;case 34:S();return;case 123:a=1,m(7,o,o+1);return;case 35:m(30,o,o+1);return;case 44:m(25,o,o+1);return;case 58:e.charCodeAt(o+1)===58&&e.charCodeAt(o+2)===58?m(6,o,o+3):m(5,o,o+1);return;case 91:m(9,o,o+1);return;case 93:m(10,o,o+1);return}if(k(t)){C(t);return}if(!w(t>=65&&t<=90?t+32:t)){if(t>=128||(I[t]&M)!==0){n=o+1;for(let t=e.charCodeAt(n);t>=128||(I[t]&M)!==0;t=e.charCodeAt(n))n++;m(23,o,n);return}m(45,o,o+1)}}},te=()=>{if(u===-1||u<o&&(u=e.indexOf(`~`,o),u===-1))return!1;if(p<o){let n=o;for(;n<t&&!D(e.charCodeAt(n));)n++;p=n}if(u>=p||(d<o&&(d=y(o),f=e.lastIndexOf(`~`,d-1)),f<=u))return!1;let n=f+1;for(;n<t&&!D(e.charCodeAt(n));)n++;return m(34,o,n),!0},ne=n=>{if(D(n)){for(o++;D(e.charCodeAt(o));)o++;return}let r=n|32;if((r===112||r===102||r===117)&&(e.charCodeAt(o+1)|32)==107&&!E(e.charCodeAt(o+2)))m(35,o,o+2);else if(!te()){if(H(n,P)){let n=o+1;for(;n<t&&H(e.charCodeAt(n),F);)n++;m(34,o,n);return}if(n===96){a=2,o++;return}if(n===34){let t=e.indexOf(`"`,o+1);if(t!==-1){m(36,o,t+1);return}}else if(n===125){a=0,m(8,o,o+1);return}m(45,o,o+1)}};for(;o<t;){let s=e.charCodeAt(o),c;switch(a){case 0:ee(s);break;case 1:ne(s);break;case 2:s===96?(a=1,o++):(c=e.indexOf("`",o),m(34,o,c===-1?t:c));break;case 3:case 4:c=e.indexOf(`
|
|
3
3
|
`,o),m(a===3?12:14,o,c===-1?t:c),a=0;break;case 5:s===125?(a=0,o++):(c=e.indexOf(`}`,o),m(15,o,c===-1?t:c));break;case 6:if(s===10){for(c=o+1;e.charCodeAt(c)===10;)c++;a=0,m(4,o,c)}else if(D(s))for(o++;D(e.charCodeAt(o));)o++;else if(s===58)m(5,o,o+1);else if(s===44)m(25,o,o+1);else if(s===35)m(30,o,o+1);else if(s===59)m(28,o,o+1);else if(s>=128||(I[s]&N)!==0){c=o+1;for(let t=e.charCodeAt(c);t>=128||(I[t]&N)!==0;t=e.charCodeAt(c))c++;m(24,o,c)}else return n.push(1),r.push(``),i.push(o),{types:n,texts:r,starts:i}}}let T=a===0?3:a===3?12:a===4?14:a===5?15:-1;return T!==-1&&(n.push(T),r.push(``),i.push(t)),n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i}}var W=new Map([[37,`ZERO_OR_ONE`],[38,`ZERO_OR_MORE`],[39,`ONE_OR_MORE`],[40,`ONLY_ONE`],[41,`MD_PARENT`]]),ce=[`TB`,`BT`,`RL`,`LR`],G=`'UNICODE_TEXT', 'NUM', 'ENTITY_NAME', 'DECIMAL_NUM', 'ENTITY_ONE'`,le=`'ZERO_OR_ONE', 'ZERO_OR_MORE', 'ONE_OR_MORE', 'ONLY_ONE', 'MD_PARENT'`,K=`'EOF', 'NEWLINE', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'SUBGRAPH', 'direction_tb', 'direction_bt', 'direction_rl', 'direction_lr', 'CLASSDEF', 'CLASS', 'STYLE', `+G;function q(e,t){let{types:n,texts:r,starts:i}=U(e),a=0,o=t=>{let o=n[a];throw o===1?O(`er`,e,i[a],``,!0):O(`er`,e,i[a],`Expecting ${t}, got '${o===45?r[a]:j[o]}'`)},s=e=>(n[a]!==e&&o(`'${j[e]}'`),r[a++]),c=()=>{let e=n[a];e!==4&&e!==28&&e!==3&&o(`'EOF', 'NEWLINE', 'SEMI'`),a++},l=e=>e===23||e===31||e===29||e===32||e===33,u=()=>{let e=n[a];l(e)||o(G);let t=r[a++];return e===31?t.slice(1,-1):t},d=()=>{let e=[];for(;;){let t=n[a];if(t!==23&&t!==24&&o(`'UNICODE_TEXT', 'STYLE_TEXT'`),e.push(r[a++]),n[a]!==25)return e;a++}},f=e=>e===24||e===29||e===5||e===30,p=()=>{let e=[];for(;;){f(n[a])||o(`'STYLE_TEXT', 'COLON', 'NUM', 'BRKT'`);let t=r[a++];for(;f(n[a]);)t+=r[a++];if(e.push(t),n[a]!==25)return e;a++}},m=()=>{let e=W.get(n[a++]),t=n[a];t!==43&&t!==42&&o(`'NON_IDENTIFYING', 'IDENTIFYING'`);let r=t===43?`IDENTIFYING`:`NON_IDENTIFYING`;a++;let i=W.get(n[a]);return i===void 0?o(le):(a++,{cardA:i,relType:r,cardB:e})},h=()=>{let e=n[a];e!==44&&e!==31&&e!==23&&o(`'UNICODE_TEXT', 'ENTITY_NAME', 'WORD'`);let t=r[a++];return e===23?t:t.slice(1,-1)},g=e=>n[a]===45&&r[a]===e,_=()=>{let e=[];do{let t=s(34);g(`?`)&&(t+=r[a++]),n[a]!==34&&o(t.endsWith(`?`)?`'ATTRIBUTE_WORD'`:`'ATTRIBUTE_WORD', '?'`);let i={type:t,name:r[a++]};if(n[a]===35){let e=[r[a++]];for(;g(`,`);)a++,e.push(s(35));i.keys=e}n[a]===36&&(i.comment=r[a++].slice(1,-1)),e.push(i)}while(n[a]!==8);return e.reverse()},v=()=>{if(n[a]!==7)return;if(a++,n[a]===8){a++;return}let e=_();return a++,e},y=()=>{let e=u(),r=n[a];if(r===9){a++;let r=u();s(10);let i;n[a]===6&&(a++,i=d());let o=v();return t.addEntity(e,r),o&&t.addAttributes(e,o),i&&t.setClass([e],i),[e]}let i;if(r===6&&(a++,i=d(),r=n[a]),W.has(r)){let r=m(),o=u(),c;n[a]===6&&(a++,c=d()),s(5);let l=h();return t.addEntity(e),t.addEntity(o),t.addRelationship(e,l,o,r),i&&t.setClass([e],i),c&&t.setClass([o],c),[e,o]}let o=v();return t.addEntity(e),o&&t.addAttributes(e,o),i&&t.setClass([e],i),[e]};s(2);let b=[{id:``,title:``,list:[]}],x=b[0],S=!1;for(;;){let e=n[a];switch(e){case 4:a++;break;case 3:a++,S&&o(`'END', ${K}`);return;case 16:{S||o(K),a++;let e=t.addSubGraph({text:x.id},x.list,{text:x.title});b.pop(),x=b[b.length-1],S=b.length>1,S&&x.list.push(e);break}case 17:{a++;let e=u(),t=e;if(n[a]===9){for(a++,t=u();l(n[a]);)t+=` `+u();s(10)}c(),x={id:e,title:t,list:[]},b.push(x),S=!0;break}case 11:{a++;let e=s(12).trim();t.setAccTitle(e),S&&x.list.push(e);break}case 13:{a++;let e=s(14).trim();t.setAccDescription(e),S&&x.list.push(e);break}case 15:{let e=r[a++].trim();t.setAccDescription(e),S&&x.list.push(e);break}case 18:case 19:case 20:case 21:{a++;let n=ce[e-18];S?x.list.push({stmt:`dir`,value:n}):t.setDirection(n);break}case 22:{let e=r[a++],n=d(),i=p();c(),t.addClass(n,i),S&&x.list.push(e);break}case 26:{let e=r[a++],n=d();t.setClass(n,d()),S&&x.list.push(e);break}case 27:{let e=r[a++],n=d(),i=p();c(),t.addCssStyles(n,i),S&&x.list.push(e);break}default:{l(e)||o(S?`'END', ${K}`:K);let t=y();if(S)for(let e of t)x.list.push(e)}}}}var ue=[];function de(e){let t=[],n=[],r=e.subgraphs,i=t=>{let n=[];for(let r of t){let t=e.classes.get(r);if(t!==void 0){for(let e of t.styles)n.push(e.trim());for(let e of t.textStyles)n.push(e.trim())}}return n},a=new Map,o=new Set;for(let e=r.length-1;e>=0;e--){let t=r[e];o.add(t.id);for(let e of t.nodes)a.set(e,t.id)}for(let e=r.length-1;e>=0;e--){let n=r[e];t.push({id:n.id,label:n.title,alias:``,attributes:ue,isGroup:!0,parentId:a.get(n.id),cssStyles:n.cssStyles,cssCompiledStyles:i(n.classes),cssClasses:n.classes.join(` `),dir:n.dir,labelType:n.labelType})}let s=new Map;for(let[n,r]of e.entities)o.has(n)?s.set(r.id,n):t.push({id:r.id,label:r.label,alias:r.alias,attributes:r.attributes,isGroup:!1,parentId:a.get(n),cssStyles:r.cssStyles,cssCompiledStyles:i(r.cssClasses.split(` `)),cssClasses:r.cssClasses,dir:void 0,labelType:`markdown`});return e.relationships.forEach((e,t)=>{n.push({id:`id_${e.entityA}_${e.entityB}_${t}`,start:s.get(e.entityA)??e.entityA,end:s.get(e.entityB)??e.entityB,label:e.roleA,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType===`IDENTIFYING`?`solid`:`dashed`})}),{nodes:t,edges:n}}var J=18,fe=5,pe=6,me=10,he=3.5;function Y(e,t,n,r,i){let a=(e,a)=>m(t-r*e-i*a)+`,`+m(n-i*e+r*a),o=e=>`M${a(e,-fe)}L${a(e,fe)}`,s=`M${a(0,-pe)}L${a(me,0)}L${a(0,pe)}`,c=e=>`<circle class="pele-marker" cx="${m(t-r*e)}" cy="${m(n-i*e)}" r="${he}" fill="var(--_bg)"/>`,l=e=>`<path class="pele-marker" d="${e}"/>`;switch(e){case`only_one`:return l(o(6)+o(10));case`zero_or_one`:return l(o(6))+c(13.5);case`one_or_more`:return l(s+o(me+3.5));case`zero_or_more`:return l(s)+c(me+he+.5);case`md_parent`:return`<path class="pele-marker" d="M${a(0,0)}L${a(6,4)}L${a(12,0)}L${a(6,-4)}Z" fill="var(--_bg)"/>`}return``}var ge=48,_e=20,ve=64,X=20,Z=28,ye=38,be=96,xe=18,Se=12,Ce=9,we=12,Te=16,Ee=9,De=260,Oe=1e6,ke=[],Ae=18,je=14,Me=` fill="var(--_s)" stroke="var(--_b)"`;function Ne(e,t,n){let r=e.er?.[t];return typeof r==`number`&&r>0?Math.min(r,2e3):n}function Q(e,n,i,l,u){let f=e.lines;if(f.length===0)return``;let g=f.length===1&&f[0].length===1?f[0][0]:void 0;if(g&&g.icon===void 0&&g.math===void 0&&g.style===0)return`<text${l} x="${m(n)}" y="${m(i)}">${t(g.text)}</text>`;let _=r(e),v=e.size*.35,y=i-v-e.lineHeight/2,b=``,x=``;for(let r=0;r<f.length;r++){let d=f[r],g=y+c(e,r);if(p(d)){x+=s(h(e,r),n+e.widths[r]/2,g,l,u);continue}i=g+v;let S=!1;for(let e of d)e.icon!==void 0&&(S=!0);let C=n,w=!1;for(let n of d){if(n.icon!==void 0){let t=e.size*1.1;x+=`<svg class="pele-icon" data-icon="${a(n.icon)}" x="${m(C)}" y="${m(i-e.size*.35-t/2)}" width="${m(t)}" height="${m(t)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${u?.(n.icon)??``}</svg>`}else if(n.text!==``){let e=S||!w?` x="${m(C)}" y="${m(i)}"`:``;b+=`<tspan${e}${o(n.style&~_)}>${t(n.text)}</tspan>`,w=!0}C+=n.width}}return`<text${d(l,_)} xml:space="preserve">${b}</text>${x}`}function $(e){let t=C(e);return t===e?e:t.replace(/</g,`<`).replace(/>/g,`>`)}function Pe(e,t,n){return g(e.direction)?_(n,r=>Fe(e,t,n,r)):Fe(e,t,n,!1)}function Fe(r,o,c,d){let p=de(r),h=c.fontSize??16,g=Math.round(h*.875),_=c.measurer??ae(c.fontFamily,c.fontFamilyMono),C=c.padding??8,E=c.icons,D=new Map,O=[],k=[];p.nodes.forEach((e,t)=>D.set(e.id,t));let A=[],oe=[],j=[],M=new Map,N=[];for(let e of p.edges){let t=D.get(e.start),n=D.get(e.end);if(t===void 0||n===void 0)continue;let r=f(e.label,!0,_,g,200),i;if(t===n){i={label:r,band:0,at:0};let e=M.get(t);e?e.push(i):M.set(t,[i])}N.push(i),j.push(e),oe.push(r),A.push({src:t,dst:n,minlen:1,labelW:r.width>0?r.width+12:0,labelH:r.height>0?r.height+4:0,route:[],labelX:0,labelY:0})}let P=e=>{let t=e;for(let e=0;e<p.nodes.length;e++){let e=p.nodes[t].parentId,n=e===void 0?void 0:D.get(e);if(n===void 0)break;let r=p.nodes[n].dir;if(r)return r===`LR`||r===`RL`;t=n}return r.direction===`LR`||r.direction===`RL`};for(let e=0;e<p.nodes.length;e++){let t=p.nodes[e],n=u(t.cssStyles.length>0?t.cssCompiledStyles.concat(t.cssStyles):t.cssCompiledStyles),r=+!!n.bold|(n.italic?2:0),i=n.fontSize??h,a=n.fontSize??g,o=n.fontSize??Math.round(h*.75),s=t.isGroup?f(t.label,!0,_,i,4e3,r):f(t.alias||t.label,!0,_,i,240,r),c=M.get(e)??ke,l=c.length>0&&!t.isGroup&&P(e),d={node:t,style:n,label:s,w:0,h:0,headH:0,rows:[],cols:[],rowSize:a,keySize:o,below:l},m=0,v=0;for(let e of c)e.band=Math.max(ye,l?e.label.width+12:e.label.height+6),v+=e.band,m=Math.max(m,l?e.label.height:e.label.width);let y=Math.max(be,l?v+8:0),b;if(t.isGroup)b=re(0,0),b.isGroup=!0,b.dir=t.dir?T(t.dir):void 0,b.padX=X,b.padTop=d.label.height>0?d.label.height+16:X,b.padBottom=X,b.minW=Math.max(d.label.width+2*X-12,be);else{let e=Math.max(s.height,Math.round(i*1.5));if(t.attributes.length===0)d.w=Math.max(s.width+2*xe,y),d.h=Math.max(e+2*Se,l?0:v+8);else{let n=Math.round(a*1.5),i=[0,0,0,0];for(let e of t.attributes){let t=[f($(e.type),!0,_,a,Oe,r),f($(e.name),!0,_,a,Oe,r),f(e.keys.join(`, `),!1,_,o,Oe,r),f($(e.comment),!0,_,a,De,r)],s=n;for(let e=0;e<4;e++)t[e].width>i[e]&&(i[e]=t[e].width),t[e].height>s&&(s=t[e].height);d.rows.push({cells:t,h:s+Ee}),d.h+=s+Ee}let c=0,l=0;for(let e of i)e!==0&&(l+=e+(c>0?Te:0),c++);d.w=Math.max(l+2*we,s.width+2*xe,y);let u=c>0?(d.w-l-2*we)/c:0,p=we;for(let e of i)d.cols.push(p),e>0&&(p+=e+u+Te);d.headH=e+2*Ce,d.h+=d.headH}let n=c.length>0?2*(J+Z*.75+10+m):0;b=l?re(d.w,d.h+n):re(d.w+n,d.h)}b.seq=O.length,O.push(d),k.push(b)}p.nodes.forEach((e,t)=>{k[t].parent=e.parentId===void 0?-1:D.get(e.parentId)??-1});let F=te(k,A,d?`TB`:T(r.direction),{nodeSep:Ne(o,`nodeSpacing`,ge),edgeSep:_e,rankSep:Ne(o,`rankSpacing`,ve),portSep:24});Le(A,k,O);let I=F.width;for(let[e,t]of M){let n=k[e];if(!n.isGroup)continue;let r=0;for(let e of t)r=Math.max(r,e.label.width);I=Math.max(I,n.x+n.w/2+J+Z*.75+10+r)}let L=b(r.title,_,h,4e3),R=L.height>0?L.height+12:0,z=Math.max(I,L.width),se=C+(z-I)/2,B=C+R;ne(k,A,se,B);let V=Math.ceil(z+2*C),H=Math.ceil(F.height+R+2*C),U=[],W=new Map,ce=!1;for(let e of k)e.isGroup&&(ce=!0);if(ce)for(let e of A)ee(W,e.route);let G=``,le=``;for(let e=0;e<O.length;e++){let r=O[e],o=k[e],u=r.node,d=n(u.cssClasses.replace(/^default\s?/,``));if(o.isGroup){r.w=o.w,r.h=o.h;let e=o.x-o.w/2,t=o.y-o.h/2,n=w(o,r.label.width,W,X);G+=`<g class="pele-cluster${d}" data-id="${a(u.id)}"><rect x="${m(e)}" y="${m(t)}" width="${m(o.w)}" height="${m(o.h)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${i(r.style.shape)}/>`+s(r.label,n,t+8+r.label.height/2,` class="pele-cluster-label" fill="var(--_m)"${r.style.text}`,E)+`</g>`;continue}let f=r.w,p=r.h,h=-f/2,g=-p/2,_=r.style.text,v=`x="${m(h)}" y="${m(g)}" width="${m(f)}" height="${m(p)}"`,y=s(r.label,0,r.rows.length>0?g+r.headH/2:0,` class="pele-label"${_}`,E),b=ie(u.alias||u.label);if(/ internal-link(?: |$)/.test(d+` `)&&y!==``&&c.links!==!1){let e=x(b,c),n=t(b);y=`<a class="internal-link"${e?` href="${n}"${S(c)}`:``} data-href="${n}">${y}</a>`,U.push({id:u.label,href:b,internal:!0})}let C;if(r.rows.length===0)C=`<rect ${v}${i(Me+r.style.shape)}/>`+y;else{let e=Math.round(r.rowSize*1.5),n=r.style.stroke?t(r.style.stroke):`var(--_b)`,a=``,o=``,s=g+r.headH;for(let t=0;t<r.rows.length;t++){let n=r.rows[t];if(t%2==0){let e=`x="${m(h)}" width="${m(f)}"`;t===r.rows.length-1?a+=`<rect ${e} y="${m(s)}" height="${m(n.h)}"${l}/><rect ${e} y="${m(s)}" height="${m(n.h/2)}"/>`:a+=`<rect ${e} y="${m(s)}" height="${m(n.h)}"/>`}let i=s+Ee/2+e/2+r.rowSize*.35,[c,u,d,p]=n.cells;o+=Q(c,h+r.cols[0],i,` class="pele-er-type" fill="var(--_m)"${_}`,E)+Q(u,h+r.cols[1],i,` class="pele-er-name"${_}`,E)+Q(d,h+r.cols[2],i,` class="pele-er-keys" font-size="${r.keySize}" fill="var(--_m)"${_}`,E)+Q(p,h+r.cols[3],i,` class="pele-er-comment" fill="var(--_m)"${_}`,E),s+=n.h}let c=m(g+r.headH);C=`<rect ${v}${i(Me+r.style.shape)}/><g class="pele-er-stripes" fill="var(--_bg)"${r.style.shape.includes(`fill:`)?` opacity="0.6"`:``}>${a}</g><path class="pele-er-divider" d="M${m(h)},${c}H${m(h+f)}" stroke="${n}"/><rect ${v} fill="none" stroke="var(--_b)"${i(r.style.line)}/>`+y+`<g class="pele-er-attributes" font-size="${r.rowSize}">${o}</g>`}le+=`<g class="pele-node pele-entity${d}" data-id="${a(u.label)}" transform="translate(${m(o.x)},${m(o.y)})">${C}</g>`}for(let[e,t]of M){let n=O[e],r=0;for(let e of t)r+=e.band;let i=Math.min(1,Math.max((n.below?n.w:n.h)-8,0)/r),a=-r*i/2;for(let e of t)e.band*=i,e.at=a+e.band/2,a+=e.band}let K=``,q=``;for(let e=0;e<A.length;e++){let t=A[e],n=j[e],r=oe[e],i,o,s,c=N[e];if(c){let e=k[t.src],a=O[t.src],l=Math.max(Math.min(c.band/2-6,13),1),u=J+Z*.75+6;if(a.below){let d=e.x+c.at,f=e.y+a.h/2,p=m(f+J),h=m(f+J+Z);i=`M${m(d-l)},${m(f)}V${p}C${m(d-l)},${h} ${m(d+l)},${h} ${m(d+l)},${p}V${m(f)}`,o=Y(n.arrowTypeStart,d-l,f,0,-1),s=Y(n.arrowTypeEnd,d+l,f,0,-1),t.labelX=d,t.labelY=f+u+r.height/2}else{let d=e.x+a.w/2,f=e.y+c.at,p=m(d+J),h=m(d+J+Z);i=`M${m(d)},${m(f-l)}H${p}C${h},${m(f-l)} ${h},${m(f+l)} ${p},${m(f+l)}H${m(d)}`,o=Y(n.arrowTypeStart,d,f-l,-1,0),s=Y(n.arrowTypeEnd,d,f+l,-1,0),t.labelX=d+u+r.width/2,t.labelY=f}}else{let e=Ie(t.route);if(e.length<6)continue;Re(e,0,O[t.src],k[t.src]),Re(e,e.length-3,O[t.dst],k[t.dst]);let r=Math.abs(e[e.length-3]-e[0]),a=Math.abs(e[e.length-2]-e[1]),c=e.length===6&&(r<.01||a<.01||Math.hypot(r,a)<=3*J)?0:J,l=y(e,void 0,c,c);i=c>0?`M${m(l.sx)},${m(l.sy)}L${l.d.slice(1)}L${m(l.ex)},${m(l.ey)}`:l.d,o=Y(n.arrowTypeStart,l.sx,l.sy,l.sdx,l.sdy),s=Y(n.arrowTypeEnd,l.ex,l.ey,l.edx,l.edy)}let l=n.pattern===`dashed`;if(K+=`<g class="pele-edge pele-er-${l?`non-identifying`:`identifying`}" data-id="${a(n.id)}"><path d="${i}"${l?` stroke-dasharray="4 3"`:``}/>`+o+s+`</g>`,r.width>0){let e=t.labelX,i=t.labelY;q+=v(n.id,r,e,i,``,E)}}return{svg:e(`er`,V,H,h,c,r,s(L,V/2,C+L.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(G?`<g class="pele-clusters">${G}</g>`:``)+(K?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${K}</g>`:``)+(q?`<g class="pele-edge-labels" font-size="${g}">${q}</g>`:``)+`<g class="pele-nodes">${le}</g>`),width:V,height:H,links:U}}function Ie(e){let t=e.slice(0,3);for(let n=3;n<e.length;n+=3){let r=t.length-3,i=i=>Math.abs(t[r+i]-e[n+i])<.01&&Math.abs(e[n+i]-e[n+3+i])<.01;n+3<e.length&&(i(0)||i(1))||t.push(e[n],e[n+1],e[n+2])}return t}function Le(e,t,n){let r=new Map,i=(e,n,i,a)=>{let o=t[e],s=n[i]-o.x,c=n[i+1]-o.y,l;if(Math.abs(Math.abs(c)-o.h/2)<.5)l=c<0?0:2;else if(Math.abs(Math.abs(s)-o.w/2)<.5)l=s<0?3:1;else return;let u=e*4+l,d={route:n,at:i,toward:n[a+(l&1?1:0)]},f=r.get(u);f?f.push(d):r.set(u,[d])};for(let t of e){let e=t.route.length-3;t.src===t.dst||e<3||(i(t.src,t.route,0,3),i(t.dst,t.route,e,e-3))}for(let[e,i]of r){if(i.length<2)continue;let r=e>>2,a=(e&1)==1,o=t[r].isGroup?t[r]:n[r],s=a?o.h:o.w,c=Math.max(Math.min(Ae,(s-2*je)/(i.length-1)),0),l=a?t[r].y:t[r].x;i.sort((e,t)=>e.toward-t.toward);for(let e=0;e<i.length;e++)i[e].route[i[e].at+ +!!a]=l+(e-(i.length-1)/2)*c}}function Re(e,t,n,r){if(r.isGroup)return;let i=e[t]-r.x,a=e[t+1]-r.y;r.w!==n.w&&Math.abs(Math.abs(i)-r.w/2)<.5&&(e[t]-=Math.sign(i)*(r.w-n.w)/2),r.h!==n.h&&Math.abs(Math.abs(a)-r.h/2)<.5&&(e[t+1]-=Math.sign(a)*(r.h-n.h)/2)}var ze={type:`er`,math:!0,parse(e,t,n){let r=new oe;return n&&(r.title=n),q(e,r),r},render:Pe};export{ze as er};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./
|
|
1
|
+
import{a as e}from"./CWc-mNzo.js";var t=/[\t ]*accDescr(?:[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)|\s*({))/y;function n(){let e=!1;return(n,r)=>{t.lastIndex=r;let i=t.exec(n);if(i===null)return-1;let a=t.lastIndex;if(i[1]===void 0)return a;if(e)return-1;let o=n.indexOf(`}`,a);return e=o===-1,o+1||-1}}function r(t=`ACC_DESCR`){return{...e,name:t,scanner:n}}export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,x as t}from"./C2npZzkn.js";import{f as n,n as r,o as i,t as a}from"./BXBhaEho.js";import{n as o,t as s}from"./Bd-WxALw.js";var c=34,l=24,u=8,d=2e4,f=1e4,p=2e6,m=4,h=3,ee=8,g=20,te=20,ne=14,_=3;function v(e,t,o,s,v=l){let b=e.length;if(b===0)return{width:0,height:0};let x=o===`LR`||o===`RL`,re=o===`BT`||o===`RL`,S=[];for(let t=b-1;t>=0;t--)e[t].parent<0&&e[t].isGroup&&S.push(t);let C=Math.max(1,S.length),w=new Int32Array(b).fill(-1);S.forEach((e,t)=>w[e]=t);let T=new Uint8Array(b);for(let t=0;t<b;t++)e[t].parent>=0&&(T[e[t].parent]=1);let ie=new Float64Array(C).fill(v),ae=v,E=t=>{let n=t,r=v;for(let t=0;e[n].parent>=0&&t<f;t++)n=e[n].parent,w[n]<0&&(r+=Math.max(e[n].padX,e[n].padTop,e[n].padBottom));let i=Math.max(0,w[n]);return r>ie[i]&&(ie[i]=r),r>ae&&(ae=r),i},oe=new Int32Array(b).fill(-1),D=[];for(let t=0;t<b;t++)w[t]>=0||(!e[t].isGroup||!T[t])&&(oe[t]=D.length,D.push(t));let O=e=>x?e.w:e.h,k=e=>x?e.h:e.w,A=D.map(t=>i(k(e[t]),O(e[t]))),j=[],se=[],M=1;{let e=new Set;for(let n=0;n<t.length;n++){let r=t[n],i=oe[r.src],o=oe[r.dst];if(i<0||o<0||i===o)continue;let s=Math.min(i,o)*D.length+Math.max(i,o);(r.labelW>0||e.has(s))&&(M=2),e.add(s),j.push(a(i,o,r.minlen,x?r.labelH:r.labelW,x?r.labelW:r.labelH)),se.push(n)}}n(A,j),r(A,j,M);let N=j.length,ce=Int32Array.from(D,E),P=(n,r)=>{let i=ie.map((e,t)=>r[t]?Math.max(e,te):e),a=new Uint8Array(C),o=0,l=new Int32Array(N);for(let e=0;e<N;e++)l[e]=Math.abs(A[j[e].head].rank-A[j[e].tail].rank),n[e]||(o+=l[e]-1);let h=o>d,v=D.length+(h?0:o),T=new Int32Array(v),E=new Int32Array(v),O=new Float64Array(v),k=new Float64Array(v),P=new Uint8Array(v),F=0;for(let e=0;e<D.length;e++)T[e]=A[e].rank,E[e]=ce[e],O[e]=A[e].w,k[e]=A[e].h,T[e]>F&&(F=T[e]);let I=new Int32Array(N).fill(-1),L=new Int32Array(N).fill(-1),R=[];{let e=D.length;for(let t=0;t<N;t++){let r=j[t],i=r.reversed?r.head:r.tail,a=r.reversed?r.tail:r.head;if(h||l[t]<2||n[t]){R.push(i,a);continue}let o=T[i],s=T[a],c=-1;r.labelW>0&&(c=o+(s-o>>1),M===2&&!(c&1)&&c--),I[t]=e;let u=i;for(let n=o+1;n<s;n++){let l=e++;T[l]=n,E[l]=E[i]+Math.round((E[a]-E[i])*(n-o)/(s-o)),P[l]=1,n===c&&(O[l]=r.labelW,k[l]=r.labelH,L[t]=l),R.push(u,l),u=l}R.push(u,a)}}let z=new Int32Array(v+1),B=new Int32Array(v+1);for(let e=0;e<R.length;e+=2)B[R[e]+1]++,z[R[e+1]+1]++;for(let e=0;e<v;e++)z[e+1]+=z[e],B[e+1]+=B[e];let le=new Int32Array(R.length/2),ue=new Int32Array(R.length/2);{let e=z.slice(0,v),t=B.slice(0,v);for(let n=0;n<R.length;n+=2)ue[t[R[n]]++]=R[n+1],le[e[R[n+1]]++]=R[n]}let V=[];for(let e=0;e<=F;e++)V.push([]);for(let e=0;e<v;e++)V[T[e]].push(e);let de=new Float64Array(v),H=new Float64Array(v),fe=e=>{e.sort((e,t)=>E[e]-E[t]||H[e]-H[t]||e-t);for(let t=0;t<e.length;t++)de[e[t]]=t};for(let e of V){for(let t=0;t<e.length;t++)H[e[t]]=t;fe(e)}for(let e=0;e<u&&F>0;e++){let t=!(e&1);for(let e=1;e<=F;e++){let n=V[t?e:F-e],r=t?z:B,i=t?le:ue;for(let e of n){let t=0,n=r[e+1]-r[e];for(let n=r[e];n<r[e+1];n++)t+=de[i[n]];H[e]=n>0?t/n:de[e]}fe(n)}}let U=(e,t)=>P[e]||P[t]?s.edgeSep:s.nodeSep,pe=(e,t)=>{let n=0;for(;n<e.length;){let r=n;for(;r+1<e.length&&E[e[r+1]]===E[e[n]];)r++;t(e,n,r),n=r+1}},me=(e,t,n)=>{let r=O[e[t]];for(let i=t;i<n;i++)r+=U(e[i],e[i+1])+O[e[i+1]];return r},he=new Float64Array(C),W=S.length>0?c:0;for(let t=0;t<S.length;t++){let n=e[S[t]];he[t]=Math.max(0,n.minW-2*i[t]),n.padTop>W&&(W=n.padTop)}for(let e of V)pe(e,(t,n,r)=>{let i=me(e,n,r);i>he[E[e[n]]]&&(he[E[e[n]]]=i)});let G=new Float64Array(C+1);for(let e=0;e<C;e++)G[e+1]=G[e]+he[e]+2*i[e];let K=new Float64Array(v),ge=new Float64Array(v),_e=(e,t,n)=>{let r=E[e[t]],a=(G[r]+i[r]+(G[r+1]-i[r])-me(e,t,n))/2;for(let r=t;r<=n;r++)K[e[r]]=a+O[e[r]]/2,r<n&&(a+=O[e[r]]+U(e[r],e[r+1]))},ve=(e,t,n)=>{let r=E[e[t]],a=G[r]+i[r];for(let r=t;r<=n;r++){let t=e[r];K[t]=Math.max(ge[t],a+O[t]/2),r<n&&(a=K[t]+O[t]/2+U(t,e[r+1]))}let o=G[r+1]-i[r];for(let r=n;r>=t;r--){let n=e[r];K[n]=Math.min(K[n],o-O[n]/2),r>t&&(o=K[n]-O[n]/2-U(e[r-1],n))}};for(let e of V)pe(e,_e);for(let e=0;e<4&&F>0;e++){let t=!(e&1);for(let e=1;e<=F;e++){let n=V[t?e:F-e],r=t?z:B,i=t?le:ue;for(let e of n){let t=0,n=0;for(let a=r[e];a<r[e+1];a++)E[i[a]]===E[e]&&(t+=K[i[a]],n++);ge[e]=n>0?t/n:K[e]}pe(n,ve)}}let q=new Float64Array(F+1),J=new Float64Array(F+1),Y=new Float64Array(F+1).fill(s.rankSep/M);if(n.some(e=>e===1)){let e=s.rankSep/M;Y.fill(e/_);for(let t=0;t<N;t++){let r=j[t],i=r.reversed?r.head:r.tail,a=r.reversed?r.tail:r.head;if(n[t]){if(r.labelH<=0||l[t]>M)continue;let n=Math.min(e,(r.labelH+2*g-Math.min(k[i],k[a])/2)/l[t]);for(let e=T[i];e<T[a];e++)n>Y[e]&&(Y[e]=n);continue}let o=I[t];if(o<0||l[t]<=M*r.minlen)for(let t=T[i];t<T[a];t++)Y[t]=e;else for(let n=o-1;n<o+l[t]-1;n++){let r=n<o?i:n,s=n+1<o+l[t]-1?n+1:a;(E[r]!==E[s]||Math.abs(K[r]-K[s])>=.5)&&(Y[T[r]]=e)}}}let ye=W+ae;for(let e=0;e<=F;e++){let t=0;for(let n of V[e])k[n]>t&&(t=k[n]);q[e]=ye,J[e]=ye+t,ye+=t+(e===F?0:Y[e])}let X=ye+ae,be=G[C],xe=e=>re?W+X-e:e,Z=(e,t)=>x?xe(t):e,Q=(e,t)=>x?e:xe(t),Se=+!!x;for(let t=0;t<D.length;t++){let n=e[D[t]],r=(q[T[t]]+J[T[t]])/2;n.x=Z(K[t],r),n.y=Q(K[t],r)}for(let t=0;t<S.length;t++){let n=e[S[t]],r=(G[t]+G[t+1])/2,i=G[t+1]-G[t];n.x=x?X/2:r,n.y=x?r:X/2,n.w=x?X:i,n.h=x?i:X,n.padTop=W}let Ce=new Int32Array(b),we=[];for(let t=0;t<b;t++){if(!e[t].isGroup||w[t]>=0||oe[t]>=0)continue;let n=0;for(let r=e[t].parent;r>=0&&n<f;r=e[r].parent)n++;Ce[t]=n,we.push(t)}we.sort((e,t)=>Ce[t]-Ce[e]||e-t);let $=new Float64Array(b*4);for(let e=0;e<b;e++)$[e*4]=1/0,$[e*4+1]=1/0,$[e*4+2]=-1/0,$[e*4+3]=-1/0;let Te=(e,t)=>{t.x-t.w/2<$[e*4]&&($[e*4]=t.x-t.w/2),t.y-t.h/2<$[e*4+1]&&($[e*4+1]=t.y-t.h/2),t.x+t.w/2>$[e*4+2]&&($[e*4+2]=t.x+t.w/2),t.y+t.h/2>$[e*4+3]&&($[e*4+3]=t.y+t.h/2)};for(let t of D)e[t].parent>=0&&w[e[t].parent]<0&&Te(e[t].parent,e[t]);for(let t of we){let n=e[t];if($[t*4]===1/0)continue;let r=Math.max($[t*4+2]-$[t*4]+2*n.padX,n.minW);n.x=($[t*4]+$[t*4+2])/2,n.w=r,n.y=($[t*4+1]-n.padTop+$[t*4+3]+n.padBottom)/2,n.h=$[t*4+3]-$[t*4+1]+n.padTop+n.padBottom,n.parent>=0&&w[n.parent]<0&&Te(n.parent,n)}for(let e of t)e.route=[];for(let e=0;e<N;e++){let n=j[e],r=t[se[e]],i=n.reversed?n.head:n.tail,a=n.reversed?n.tail:n.head,o=[K[i],J[T[i]]-(J[T[i]]-q[T[i]]-k[i])/2],s=I[e];if(s>=0)for(let t=s;t<s+l[e]-1;t++)o.push(K[t],q[T[t]]),J[T[t]]>q[T[t]]&&o.push(K[t],J[T[t]]);o.push(K[a],q[T[a]]+(J[T[a]]-q[T[a]]-k[a])/2);let c=[];for(let e=0;e<o.length;e+=2)c.push(Z(o[e],o[e+1]),Q(o[e],o[e+1]),Se);if(n.reversed)for(let e=0,t=c.length-3;e<t;e+=3,t-=3)for(let n=0;n<2;n++){let r=c[e+n];c[e+n]=c[t+n],c[t+n]=r}r.route=c;let u=L[e];if(u>=0){let e=(q[T[u]]+J[T[u]])/2;r.labelX=Z(K[u],e),r.labelY=Q(K[u],e)}else r.labelX=(c[0]+c[c.length-3])/2,r.labelY=(c[1]+c[c.length-2])/2}for(let n of t){if(n.route.length>0||n.src===n.dst)continue;let t=e[n.src],r=e[n.dst],[i,a]=y(t,r),[o,s]=y(r,t),c=+(Math.abs(o-i)>Math.abs(s-a));n.route=[i,a,c,o,s,c],n.labelX=(i+o)/2,n.labelY=(a+s)/2}let Ee=new Uint8Array(N),De=t.reduce((e,t)=>e+t.route.length/3,0),Oe=N*(D.length+t.length+De);if(Oe<=p){let e=e=>(q[T[e]]+J[T[e]])/2,n=t.map(e=>[x?e.labelY:e.labelX,xe(x?e.labelX:e.labelY)]),r=(e,t,n,r,i,a,o,s)=>n>i-o/2&&e<i+o/2&&r>a-s/2&&t<a+s/2,o=(i,a,o,s,c,l,u)=>{for(let t=0;t<D.length;t++)if(t!==c&&t!==l&&r(i,a,o,s,K[t],e(t),O[t]+8,k[t]+8))return!1;for(let e=0;e<t.length;e++){let c=t[e];if(e!==u&&c.labelW>0&&c.src!==c.dst&&r(i,a,o,s,n[e][0],n[e][1],x?c.labelH:c.labelW,x?c.labelW:c.labelH))return!1}return!0},s=(e,n,r,i,a)=>{let o=0;for(let s=0;s<t.length;s++){if(s===a)continue;let c=t[s].route;for(let t=3;t<c.length;t+=3)if(Math.max(c[t-3],c[t])>e&&Math.min(c[t-3],c[t])<r&&Math.max(c[t-2],c[t+1])>n&&Math.min(c[t-2],c[t+1])<i){o++;break}}return o},c=(e,n,r)=>{let i=0;for(let a=0;a<t.length;a++){let o=t[a].route;if(a===r||o.length===0)continue;let s=o.length-3;(Math.abs(o[0]-e)<1&&Math.abs(o[1]-n)<1||Math.abs(o[s]-e)<1&&Math.abs(o[s+1]-n)<1)&&i++}return i},l=(e,n,r,i,a)=>{let o=Math.abs(r-e)<.5,s=o?Math.min(n,i):Math.min(e,r),c=o?Math.max(n,i):Math.max(e,r),l=o?e:n;for(let e=0;e<t.length;e++){let n=t[e];if(e===a||n.src===t[a].src||n.dst===t[a].dst)continue;let r=n.route;for(let e=3;e<r.length;e+=3){let t=r[e-3+ +!o],n=r[e+ +!o];if(Math.abs(t-l)>=m||Math.abs(n-l)>=m)continue;let i=r[e-3+ +!!o],a=r[e+ +!!o];if(Math.min(c,Math.max(i,a))-Math.max(s,Math.min(i,a))>1)return!0}}return!1};for(let r=0;r<N;r++){let u=j[r],d=se[r],f=t[d],m=u.tail,h=u.head;if(E[m]===E[h]||Math.abs(K[h]-K[m])<1)continue;let _=K[m],v=K[h],y=e(m),b=e(h),x=Math.sign(v-_),re=Math.sign(b-y),S=(e,t)=>{for(let n=2;n<e.length;n+=2)if(!o(Math.min(e[n-2],e[n])-t,Math.min(e[n-1],e[n+1])-t,Math.max(e[n-2],e[n])+t,Math.max(e[n-1],e[n+1])+t,m,h,d)||l(Z(e[n-2],e[n-1]),Q(e[n-2],e[n-1]),Z(e[n],e[n+1]),Q(e[n],e[n+1]),d))return!1;let i=0,a=0,c=-1;if(f.labelW>0){let t=u.labelW,n=u.labelH;for(let r=2;r<e.length;r+=2){let l=(e[r-2]+e[r])/2,u=(e[r-1]+e[r+1])/2,p=Math.abs(e[r]-e[r-2]),m=Math.abs(e[r+1]-e[r-1]),h=p+m;if(h<=c||(p>0?p<t+8:m<n+8)||l-t/2<0||l+t/2>be||u-n/2<0||u+n/2>X||!o(l-t/2,u-n/2,l+t/2,u+n/2,-1,-1,d))continue;let ee=Z(l,u),g=Q(l,u);s(ee-f.labelW/2,g-f.labelH/2,ee+f.labelW/2,g+f.labelH/2,d)>0||(i=l,a=u,c=h)}if(c<0)return!1}let p=[e[0],e[1]];for(let t=2;t<e.length;t+=2){let n=e[t]-e[t-2],r=e[t+1]-e[t-1],i=Math.abs(n)+Math.abs(r),a=t>2?g:0,o=t+2<e.length?g:0;i>a+o+1&&(a&&p.push(e[t-2]+n/i*a,e[t-1]+r/i*a),o&&p.push(e[t]-n/i*o,e[t+1]-r/i*o)),p.push(e[t],e[t+1])}f.route=[];for(let e=0;e<p.length;e+=2){let t=e===0?p[0]!==p[2]:p[e]!==p[e-2];f.route.push(Z(p[e],p[e+1]),Q(p[e],p[e+1]),t?1-Se:Se)}return f.labelW>0&&(f.labelX=Z(i,a),f.labelY=Q(i,a),n[d]=[i,a]),Ee[r]=1,!0};if(S([_+x*O[m]/2,y,v,y,v,b-re*k[h]/2],2)||S([_,y+re*k[m]/2,_,b,v-x*O[h]/2,b],2)||Oe>p/ee)continue;let C=[];for(let e of E[m]<E[h]?[E[h],E[m]]:[E[m],E[h]]){let t=Math.max(i[e]-ne,Math.min(i[e]/2,te-ne));for(let n of[G[e]+t,G[e+1]-t]){if(Math.abs(n-_)<O[m]/2+4||Math.abs(n-v)<O[h]/2+4)continue;let t=[_+Math.sign(n-_)*O[m]/2,y,n,y,n,b,v+Math.sign(n-v)*O[h]/2,b],r=(c(Z(t[0],t[1]),Q(t[0],t[1]),d)+c(Z(t[6],t[7]),Q(t[6],t[7]),d))*1e6;for(let e=2;e<t.length;e+=2){let n=Z(t[e-2],t[e-1]),i=Q(t[e-2],t[e-1]),a=Z(t[e],t[e+1]),o=Q(t[e],t[e+1]);r+=s(Math.min(n,a),Math.min(i,o),Math.max(n,a),Math.max(i,o),d)*1e6+Math.abs(a-n)+Math.abs(o-i)}C.push({pts:t,cost:r,lane:e})}}C.sort((e,t)=>e.cost-t.cost);for(let e of C)if(S(e.pts,1)){a[e.lane]=1;break}}}return{width:x?X:be,height:x?be:X,routed:Ee,margins:a,work:Oe}},F=new Uint8Array(N),I=new Uint8Array(C),L=P(F,I);for(let e=0;e<h&&L.work<=p/ee;e++){let t=e===0?L.routed:F.map((e,t)=>e&L.routed[t]);if(t.every((e,t)=>e===F[t])&&L.margins.every((e,t)=>e===I[t]))break;F=t,I=L.margins,L=P(F,I)}return F.some((e,t)=>e&&!L.routed[t])&&(L=P(new Uint8Array(N),new Uint8Array(C))),{width:L.width,height:L.height}}function y(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.max(e.w/2,.5),a=Math.max(e.h/2,.5);if(Math.abs(n)<i&&Math.abs(r)<a)return i-Math.abs(n)<a-Math.abs(r)?[e.x+(n<0?-i:i),t.y]:[t.x,e.y+(r<0?-a:a)];let o=Math.min(n===0?1/0:i/Math.abs(n),r===0?1/0:a/Math.abs(r));return[e.x+n*o,e.y+r*o]}var b=`__swimlane_default__`;function x(e){let t=!1;for(let n of e.nodes)n.isGroup?n.dir=void 0:n.parentId===void 0&&(t=!0);if(t){for(let t of e.nodes)!t.isGroup&&t.parentId===void 0&&(t.parentId=b);e.nodes.push({id:b,label:void 0,labelType:`text`,shape:`rect`,isGroup:!0,parentId:void 0,cssStyles:[],cssCompiledStyles:[],cssClasses:``,dir:void 0})}}function re(n,r,i,a,o,s,c){let l=n.x-n.w/2,u=n.y-n.h/2,d=s===`LR`||s===`RL`,f=d?l+n.padTop/2:n.x,p=d?n.y:u+n.padTop/2,m=e(r,f,p,` class="pele-cluster-label" fill="var(--_m)"${i.text}`,c);return`<g class="pele-cluster pele-lane${a}" data-id="${o}"><rect x="${t(l)}" y="${t(u)}" width="${t(n.w)}" height="${t(n.h)}" fill="none" stroke="var(--_b)"/><rect x="${t(l)}" y="${t(u)}" width="${t(d?n.padTop:n.w)}" height="${t(d?n.h:n.padTop)}" fill="var(--_a)" stroke="var(--_b)"${i.shape}/>`+(d&&m?`<g transform="rotate(-90 ${t(f)} ${t(p)})">${m}</g>`:m)+`</g>`}var S={type:`swimlane`,prepare:x,layout:(e,t,n,r,i)=>v(e,t,n,r,i?12:void 0),drawGroup:re},C={type:`swimlane`,math:!0,parse:s.parse,render:(e,t,n)=>o(e,t,n,S)};export{C as swimlane};
|
|
1
|
+
import{o as e,x as t}from"./DEQsS4Ez.js";import{f as n,n as r,o as i,t as a}from"./Kem7IXj7.js";import{n as o,t as s}from"./CwHHpacD.js";var c=34,l=24,u=8,d=2e4,f=1e4,p=2e6,m=4,h=3,ee=8,g=20,te=20,ne=14,_=3;function v(e,t,o,s,v=l){let b=e.length;if(b===0)return{width:0,height:0};let x=o===`LR`||o===`RL`,re=o===`BT`||o===`RL`,S=[];for(let t=b-1;t>=0;t--)e[t].parent<0&&e[t].isGroup&&S.push(t);let C=Math.max(1,S.length),w=new Int32Array(b).fill(-1);S.forEach((e,t)=>w[e]=t);let T=new Uint8Array(b);for(let t=0;t<b;t++)e[t].parent>=0&&(T[e[t].parent]=1);let ie=new Float64Array(C).fill(v),ae=v,E=t=>{let n=t,r=v;for(let t=0;e[n].parent>=0&&t<f;t++)n=e[n].parent,w[n]<0&&(r+=Math.max(e[n].padX,e[n].padTop,e[n].padBottom));let i=Math.max(0,w[n]);return r>ie[i]&&(ie[i]=r),r>ae&&(ae=r),i},oe=new Int32Array(b).fill(-1),D=[];for(let t=0;t<b;t++)w[t]>=0||(!e[t].isGroup||!T[t])&&(oe[t]=D.length,D.push(t));let O=e=>x?e.w:e.h,k=e=>x?e.h:e.w,A=D.map(t=>i(k(e[t]),O(e[t]))),j=[],se=[],M=1;{let e=new Set;for(let n=0;n<t.length;n++){let r=t[n],i=oe[r.src],o=oe[r.dst];if(i<0||o<0||i===o)continue;let s=Math.min(i,o)*D.length+Math.max(i,o);(r.labelW>0||e.has(s))&&(M=2),e.add(s),j.push(a(i,o,r.minlen,x?r.labelH:r.labelW,x?r.labelW:r.labelH)),se.push(n)}}n(A,j),r(A,j,M);let N=j.length,ce=Int32Array.from(D,E),P=(n,r)=>{let i=ie.map((e,t)=>r[t]?Math.max(e,te):e),a=new Uint8Array(C),o=0,l=new Int32Array(N);for(let e=0;e<N;e++)l[e]=Math.abs(A[j[e].head].rank-A[j[e].tail].rank),n[e]||(o+=l[e]-1);let h=o>d,v=D.length+(h?0:o),T=new Int32Array(v),E=new Int32Array(v),O=new Float64Array(v),k=new Float64Array(v),P=new Uint8Array(v),F=0;for(let e=0;e<D.length;e++)T[e]=A[e].rank,E[e]=ce[e],O[e]=A[e].w,k[e]=A[e].h,T[e]>F&&(F=T[e]);let I=new Int32Array(N).fill(-1),L=new Int32Array(N).fill(-1),R=[];{let e=D.length;for(let t=0;t<N;t++){let r=j[t],i=r.reversed?r.head:r.tail,a=r.reversed?r.tail:r.head;if(h||l[t]<2||n[t]){R.push(i,a);continue}let o=T[i],s=T[a],c=-1;r.labelW>0&&(c=o+(s-o>>1),M===2&&!(c&1)&&c--),I[t]=e;let u=i;for(let n=o+1;n<s;n++){let l=e++;T[l]=n,E[l]=E[i]+Math.round((E[a]-E[i])*(n-o)/(s-o)),P[l]=1,n===c&&(O[l]=r.labelW,k[l]=r.labelH,L[t]=l),R.push(u,l),u=l}R.push(u,a)}}let z=new Int32Array(v+1),B=new Int32Array(v+1);for(let e=0;e<R.length;e+=2)B[R[e]+1]++,z[R[e+1]+1]++;for(let e=0;e<v;e++)z[e+1]+=z[e],B[e+1]+=B[e];let le=new Int32Array(R.length/2),ue=new Int32Array(R.length/2);{let e=z.slice(0,v),t=B.slice(0,v);for(let n=0;n<R.length;n+=2)ue[t[R[n]]++]=R[n+1],le[e[R[n+1]]++]=R[n]}let V=[];for(let e=0;e<=F;e++)V.push([]);for(let e=0;e<v;e++)V[T[e]].push(e);let de=new Float64Array(v),H=new Float64Array(v),fe=e=>{e.sort((e,t)=>E[e]-E[t]||H[e]-H[t]||e-t);for(let t=0;t<e.length;t++)de[e[t]]=t};for(let e of V){for(let t=0;t<e.length;t++)H[e[t]]=t;fe(e)}for(let e=0;e<u&&F>0;e++){let t=!(e&1);for(let e=1;e<=F;e++){let n=V[t?e:F-e],r=t?z:B,i=t?le:ue;for(let e of n){let t=0,n=r[e+1]-r[e];for(let n=r[e];n<r[e+1];n++)t+=de[i[n]];H[e]=n>0?t/n:de[e]}fe(n)}}let U=(e,t)=>P[e]||P[t]?s.edgeSep:s.nodeSep,pe=(e,t)=>{let n=0;for(;n<e.length;){let r=n;for(;r+1<e.length&&E[e[r+1]]===E[e[n]];)r++;t(e,n,r),n=r+1}},me=(e,t,n)=>{let r=O[e[t]];for(let i=t;i<n;i++)r+=U(e[i],e[i+1])+O[e[i+1]];return r},he=new Float64Array(C),W=S.length>0?c:0;for(let t=0;t<S.length;t++){let n=e[S[t]];he[t]=Math.max(0,n.minW-2*i[t]),n.padTop>W&&(W=n.padTop)}for(let e of V)pe(e,(t,n,r)=>{let i=me(e,n,r);i>he[E[e[n]]]&&(he[E[e[n]]]=i)});let G=new Float64Array(C+1);for(let e=0;e<C;e++)G[e+1]=G[e]+he[e]+2*i[e];let K=new Float64Array(v),ge=new Float64Array(v),_e=(e,t,n)=>{let r=E[e[t]],a=(G[r]+i[r]+(G[r+1]-i[r])-me(e,t,n))/2;for(let r=t;r<=n;r++)K[e[r]]=a+O[e[r]]/2,r<n&&(a+=O[e[r]]+U(e[r],e[r+1]))},ve=(e,t,n)=>{let r=E[e[t]],a=G[r]+i[r];for(let r=t;r<=n;r++){let t=e[r];K[t]=Math.max(ge[t],a+O[t]/2),r<n&&(a=K[t]+O[t]/2+U(t,e[r+1]))}let o=G[r+1]-i[r];for(let r=n;r>=t;r--){let n=e[r];K[n]=Math.min(K[n],o-O[n]/2),r>t&&(o=K[n]-O[n]/2-U(e[r-1],n))}};for(let e of V)pe(e,_e);for(let e=0;e<4&&F>0;e++){let t=!(e&1);for(let e=1;e<=F;e++){let n=V[t?e:F-e],r=t?z:B,i=t?le:ue;for(let e of n){let t=0,n=0;for(let a=r[e];a<r[e+1];a++)E[i[a]]===E[e]&&(t+=K[i[a]],n++);ge[e]=n>0?t/n:K[e]}pe(n,ve)}}let q=new Float64Array(F+1),J=new Float64Array(F+1),Y=new Float64Array(F+1).fill(s.rankSep/M);if(n.some(e=>e===1)){let e=s.rankSep/M;Y.fill(e/_);for(let t=0;t<N;t++){let r=j[t],i=r.reversed?r.head:r.tail,a=r.reversed?r.tail:r.head;if(n[t]){if(r.labelH<=0||l[t]>M)continue;let n=Math.min(e,(r.labelH+2*g-Math.min(k[i],k[a])/2)/l[t]);for(let e=T[i];e<T[a];e++)n>Y[e]&&(Y[e]=n);continue}let o=I[t];if(o<0||l[t]<=M*r.minlen)for(let t=T[i];t<T[a];t++)Y[t]=e;else for(let n=o-1;n<o+l[t]-1;n++){let r=n<o?i:n,s=n+1<o+l[t]-1?n+1:a;(E[r]!==E[s]||Math.abs(K[r]-K[s])>=.5)&&(Y[T[r]]=e)}}}let ye=W+ae;for(let e=0;e<=F;e++){let t=0;for(let n of V[e])k[n]>t&&(t=k[n]);q[e]=ye,J[e]=ye+t,ye+=t+(e===F?0:Y[e])}let X=ye+ae,be=G[C],xe=e=>re?W+X-e:e,Z=(e,t)=>x?xe(t):e,Q=(e,t)=>x?e:xe(t),Se=+!!x;for(let t=0;t<D.length;t++){let n=e[D[t]],r=(q[T[t]]+J[T[t]])/2;n.x=Z(K[t],r),n.y=Q(K[t],r)}for(let t=0;t<S.length;t++){let n=e[S[t]],r=(G[t]+G[t+1])/2,i=G[t+1]-G[t];n.x=x?X/2:r,n.y=x?r:X/2,n.w=x?X:i,n.h=x?i:X,n.padTop=W}let Ce=new Int32Array(b),we=[];for(let t=0;t<b;t++){if(!e[t].isGroup||w[t]>=0||oe[t]>=0)continue;let n=0;for(let r=e[t].parent;r>=0&&n<f;r=e[r].parent)n++;Ce[t]=n,we.push(t)}we.sort((e,t)=>Ce[t]-Ce[e]||e-t);let $=new Float64Array(b*4);for(let e=0;e<b;e++)$[e*4]=1/0,$[e*4+1]=1/0,$[e*4+2]=-1/0,$[e*4+3]=-1/0;let Te=(e,t)=>{t.x-t.w/2<$[e*4]&&($[e*4]=t.x-t.w/2),t.y-t.h/2<$[e*4+1]&&($[e*4+1]=t.y-t.h/2),t.x+t.w/2>$[e*4+2]&&($[e*4+2]=t.x+t.w/2),t.y+t.h/2>$[e*4+3]&&($[e*4+3]=t.y+t.h/2)};for(let t of D)e[t].parent>=0&&w[e[t].parent]<0&&Te(e[t].parent,e[t]);for(let t of we){let n=e[t];if($[t*4]===1/0)continue;let r=Math.max($[t*4+2]-$[t*4]+2*n.padX,n.minW);n.x=($[t*4]+$[t*4+2])/2,n.w=r,n.y=($[t*4+1]-n.padTop+$[t*4+3]+n.padBottom)/2,n.h=$[t*4+3]-$[t*4+1]+n.padTop+n.padBottom,n.parent>=0&&w[n.parent]<0&&Te(n.parent,n)}for(let e of t)e.route=[];for(let e=0;e<N;e++){let n=j[e],r=t[se[e]],i=n.reversed?n.head:n.tail,a=n.reversed?n.tail:n.head,o=[K[i],J[T[i]]-(J[T[i]]-q[T[i]]-k[i])/2],s=I[e];if(s>=0)for(let t=s;t<s+l[e]-1;t++)o.push(K[t],q[T[t]]),J[T[t]]>q[T[t]]&&o.push(K[t],J[T[t]]);o.push(K[a],q[T[a]]+(J[T[a]]-q[T[a]]-k[a])/2);let c=[];for(let e=0;e<o.length;e+=2)c.push(Z(o[e],o[e+1]),Q(o[e],o[e+1]),Se);if(n.reversed)for(let e=0,t=c.length-3;e<t;e+=3,t-=3)for(let n=0;n<2;n++){let r=c[e+n];c[e+n]=c[t+n],c[t+n]=r}r.route=c;let u=L[e];if(u>=0){let e=(q[T[u]]+J[T[u]])/2;r.labelX=Z(K[u],e),r.labelY=Q(K[u],e)}else r.labelX=(c[0]+c[c.length-3])/2,r.labelY=(c[1]+c[c.length-2])/2}for(let n of t){if(n.route.length>0||n.src===n.dst)continue;let t=e[n.src],r=e[n.dst],[i,a]=y(t,r),[o,s]=y(r,t),c=+(Math.abs(o-i)>Math.abs(s-a));n.route=[i,a,c,o,s,c],n.labelX=(i+o)/2,n.labelY=(a+s)/2}let Ee=new Uint8Array(N),De=t.reduce((e,t)=>e+t.route.length/3,0),Oe=N*(D.length+t.length+De);if(Oe<=p){let e=e=>(q[T[e]]+J[T[e]])/2,n=t.map(e=>[x?e.labelY:e.labelX,xe(x?e.labelX:e.labelY)]),r=(e,t,n,r,i,a,o,s)=>n>i-o/2&&e<i+o/2&&r>a-s/2&&t<a+s/2,o=(i,a,o,s,c,l,u)=>{for(let t=0;t<D.length;t++)if(t!==c&&t!==l&&r(i,a,o,s,K[t],e(t),O[t]+8,k[t]+8))return!1;for(let e=0;e<t.length;e++){let c=t[e];if(e!==u&&c.labelW>0&&c.src!==c.dst&&r(i,a,o,s,n[e][0],n[e][1],x?c.labelH:c.labelW,x?c.labelW:c.labelH))return!1}return!0},s=(e,n,r,i,a)=>{let o=0;for(let s=0;s<t.length;s++){if(s===a)continue;let c=t[s].route;for(let t=3;t<c.length;t+=3)if(Math.max(c[t-3],c[t])>e&&Math.min(c[t-3],c[t])<r&&Math.max(c[t-2],c[t+1])>n&&Math.min(c[t-2],c[t+1])<i){o++;break}}return o},c=(e,n,r)=>{let i=0;for(let a=0;a<t.length;a++){let o=t[a].route;if(a===r||o.length===0)continue;let s=o.length-3;(Math.abs(o[0]-e)<1&&Math.abs(o[1]-n)<1||Math.abs(o[s]-e)<1&&Math.abs(o[s+1]-n)<1)&&i++}return i},l=(e,n,r,i,a)=>{let o=Math.abs(r-e)<.5,s=o?Math.min(n,i):Math.min(e,r),c=o?Math.max(n,i):Math.max(e,r),l=o?e:n;for(let e=0;e<t.length;e++){let n=t[e];if(e===a||n.src===t[a].src||n.dst===t[a].dst)continue;let r=n.route;for(let e=3;e<r.length;e+=3){let t=r[e-3+ +!o],n=r[e+ +!o];if(Math.abs(t-l)>=m||Math.abs(n-l)>=m)continue;let i=r[e-3+ +!!o],a=r[e+ +!!o];if(Math.min(c,Math.max(i,a))-Math.max(s,Math.min(i,a))>1)return!0}}return!1};for(let r=0;r<N;r++){let u=j[r],d=se[r],f=t[d],m=u.tail,h=u.head;if(E[m]===E[h]||Math.abs(K[h]-K[m])<1)continue;let _=K[m],v=K[h],y=e(m),b=e(h),x=Math.sign(v-_),re=Math.sign(b-y),S=(e,t)=>{for(let n=2;n<e.length;n+=2)if(!o(Math.min(e[n-2],e[n])-t,Math.min(e[n-1],e[n+1])-t,Math.max(e[n-2],e[n])+t,Math.max(e[n-1],e[n+1])+t,m,h,d)||l(Z(e[n-2],e[n-1]),Q(e[n-2],e[n-1]),Z(e[n],e[n+1]),Q(e[n],e[n+1]),d))return!1;let i=0,a=0,c=-1;if(f.labelW>0){let t=u.labelW,n=u.labelH;for(let r=2;r<e.length;r+=2){let l=(e[r-2]+e[r])/2,u=(e[r-1]+e[r+1])/2,p=Math.abs(e[r]-e[r-2]),m=Math.abs(e[r+1]-e[r-1]),h=p+m;if(h<=c||(p>0?p<t+8:m<n+8)||l-t/2<0||l+t/2>be||u-n/2<0||u+n/2>X||!o(l-t/2,u-n/2,l+t/2,u+n/2,-1,-1,d))continue;let ee=Z(l,u),g=Q(l,u);s(ee-f.labelW/2,g-f.labelH/2,ee+f.labelW/2,g+f.labelH/2,d)>0||(i=l,a=u,c=h)}if(c<0)return!1}let p=[e[0],e[1]];for(let t=2;t<e.length;t+=2){let n=e[t]-e[t-2],r=e[t+1]-e[t-1],i=Math.abs(n)+Math.abs(r),a=t>2?g:0,o=t+2<e.length?g:0;i>a+o+1&&(a&&p.push(e[t-2]+n/i*a,e[t-1]+r/i*a),o&&p.push(e[t]-n/i*o,e[t+1]-r/i*o)),p.push(e[t],e[t+1])}f.route=[];for(let e=0;e<p.length;e+=2){let t=e===0?p[0]!==p[2]:p[e]!==p[e-2];f.route.push(Z(p[e],p[e+1]),Q(p[e],p[e+1]),t?1-Se:Se)}return f.labelW>0&&(f.labelX=Z(i,a),f.labelY=Q(i,a),n[d]=[i,a]),Ee[r]=1,!0};if(S([_+x*O[m]/2,y,v,y,v,b-re*k[h]/2],2)||S([_,y+re*k[m]/2,_,b,v-x*O[h]/2,b],2)||Oe>p/ee)continue;let C=[];for(let e of E[m]<E[h]?[E[h],E[m]]:[E[m],E[h]]){let t=Math.max(i[e]-ne,Math.min(i[e]/2,te-ne));for(let n of[G[e]+t,G[e+1]-t]){if(Math.abs(n-_)<O[m]/2+4||Math.abs(n-v)<O[h]/2+4)continue;let t=[_+Math.sign(n-_)*O[m]/2,y,n,y,n,b,v+Math.sign(n-v)*O[h]/2,b],r=(c(Z(t[0],t[1]),Q(t[0],t[1]),d)+c(Z(t[6],t[7]),Q(t[6],t[7]),d))*1e6;for(let e=2;e<t.length;e+=2){let n=Z(t[e-2],t[e-1]),i=Q(t[e-2],t[e-1]),a=Z(t[e],t[e+1]),o=Q(t[e],t[e+1]);r+=s(Math.min(n,a),Math.min(i,o),Math.max(n,a),Math.max(i,o),d)*1e6+Math.abs(a-n)+Math.abs(o-i)}C.push({pts:t,cost:r,lane:e})}}C.sort((e,t)=>e.cost-t.cost);for(let e of C)if(S(e.pts,1)){a[e.lane]=1;break}}}return{width:x?X:be,height:x?be:X,routed:Ee,margins:a,work:Oe}},F=new Uint8Array(N),I=new Uint8Array(C),L=P(F,I);for(let e=0;e<h&&L.work<=p/ee;e++){let t=e===0?L.routed:F.map((e,t)=>e&L.routed[t]);if(t.every((e,t)=>e===F[t])&&L.margins.every((e,t)=>e===I[t]))break;F=t,I=L.margins,L=P(F,I)}return F.some((e,t)=>e&&!L.routed[t])&&(L=P(new Uint8Array(N),new Uint8Array(C))),{width:L.width,height:L.height}}function y(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.max(e.w/2,.5),a=Math.max(e.h/2,.5);if(Math.abs(n)<i&&Math.abs(r)<a)return i-Math.abs(n)<a-Math.abs(r)?[e.x+(n<0?-i:i),t.y]:[t.x,e.y+(r<0?-a:a)];let o=Math.min(n===0?1/0:i/Math.abs(n),r===0?1/0:a/Math.abs(r));return[e.x+n*o,e.y+r*o]}var b=`__swimlane_default__`;function x(e){let t=!1;for(let n of e.nodes)n.isGroup?n.dir=void 0:n.parentId===void 0&&(t=!0);if(t){for(let t of e.nodes)!t.isGroup&&t.parentId===void 0&&(t.parentId=b);e.nodes.push({id:b,label:void 0,labelType:`text`,shape:`rect`,isGroup:!0,parentId:void 0,cssStyles:[],cssCompiledStyles:[],cssClasses:``,dir:void 0})}}function re(n,r,i,a,o,s,c){let l=n.x-n.w/2,u=n.y-n.h/2,d=s===`LR`||s===`RL`,f=d?l+n.padTop/2:n.x,p=d?n.y:u+n.padTop/2,m=e(r,f,p,` class="pele-cluster-label" fill="var(--_m)"${i.text}`,c);return`<g class="pele-cluster pele-lane${a}" data-id="${o}"><rect x="${t(l)}" y="${t(u)}" width="${t(n.w)}" height="${t(n.h)}" fill="none" stroke="var(--_b)"/><rect x="${t(l)}" y="${t(u)}" width="${t(d?n.padTop:n.w)}" height="${t(d?n.h:n.padTop)}" fill="var(--_a)" stroke="var(--_b)"${i.shape}/>`+(d&&m?`<g transform="rotate(-90 ${t(f)} ${t(p)})">${m}</g>`:m)+`</g>`}var S={type:`swimlane`,prepare:x,layout:(e,t,n,r,i)=>v(e,t,n,r,i?12:void 0),drawGroup:re},C={type:`swimlane`,math:!0,parse:s.parse,render:(e,t,n)=>o(e,t,n,S)};export{C as swimlane};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,x as t}from"./
|
|
1
|
+
import{o as e,x as t}from"./DEQsS4Ez.js";function n(e,t){for(let n=0;n<t.length;n+=3){let r=Math.round(t[n+1]),i=e.get(r);i?i.push(t[n]):e.set(r,[t[n]])}}function r(e,t,n,r){if(t===0)return e.x;let i=e.y-e.h/2,a=e.x-e.w/2,o=t/2,s=[a+r-6+o,e.x,a+e.w-r+6-o],c=n.get(Math.round(i));if(c===void 0)return s[0];let l=s[0],u=-1;for(let t of s){let n=1/0;for(let r of c)r>a&&r<a+e.w&&(n=Math.min(n,Math.abs(r-t)-o));if(n>=6)return t;n>u+.5&&(u=n,l=t)}return l}function i(e,t,n,r){let i=t>0?r.get(Math.round(e.y-e.h/2)):void 0;if(i===void 0)return!1;let a=e.x-e.w/2;for(let r of i)if(r>a&&r<a+e.w&&Math.abs(r-n)<t/2+4)return!0;return!1}function a(n,r,i,a,o,s,c,l){let u=1;for(let e=s[c].parent;e>=0&&u<8;e=s[e].parent)u++;let d=`color-mix(in srgb,var(--_a) ${t(100*(1-.5**u))}%,var(--_bg))`;return`<g class="pele-cluster-title" data-id="${o}">`+e(n,r,i,` fill="none" stroke="${d}" stroke-width="5" stroke-linejoin="round"`,l)+e(n,r,i,a,l)+`</g>`}export{i,r as n,n as r,a as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,f as t,i as n,o as r,r as i,u as a,x as o}from"./
|
|
1
|
+
import{_ as e,f as t,i as n,o as r,r as i,u as a,x as o}from"./DEQsS4Ez.js";import{a as s,s as c}from"./Kem7IXj7.js";import{a as l,c as u,d,f,g as p,h as m,i as h,l as g,m as ee,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./CWc-mNzo.js";import{u as te}from"./zasx25UV.js";var w=class{domains=new Map;transitions=[];setDomains(e){if(e)for(let t of e){let e=t.domain;this.domains.set(e,{name:e,items:(t.items??[]).map(e=>({label:e.label}))})}}setTransitions(e){e&&(this.transitions=e.filter(e=>e.from!==e.to).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))}};function T(e,t){let n=new w;return n.setDomains(e.domains),n.setTransitions(e.transitions),{type:`cynefin`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,domains:n.domains,transitions:n.transitions}}var E=[{name:`cynefin-beta:`,pattern:`cynefin-beta:`},h(`cynefin-beta`),{name:`-->`,pattern:`-->`},{name:`:`,pattern:`:`},{name:`DOMAIN_NAME`,pattern:/complex|complicated|clear|chaotic|confusion/y},l,S,y,ee,g,C,b,v,x];function D(e){let t=new m(_(e,E,`cynefin`),E,`cynefin`),n={$type:`Cynefin`,domains:[],transitions:[]},r=()=>{for(;t.kinds[t.i]===9;)t.i++},i=()=>{t.kind!==-1&&(t.kind!==9&&t.fail(`a line break or the end of input`),r())};for(r(),t.kind!==1&&t.kind!==0&&t.fail(`'cynefin-beta'`),t.i++;t.kind!==-1;)switch(t.kind){case 9:t.i++;break;case 5:n.accDescr=u(t.take()),i();break;case 6:n.accTitle=p(t.take()),i();break;case 7:n.title=d(t.take()),i();break;case 4:{let e=t.take();if(t.accept(2)){let r={$type:`Transition`,from:e,to:t.expect(4)};t.accept(3)&&(r.label=f(t.expect(8))),i(),n.transitions.push(r);break}let a={$type:`DomainBlock`,domain:e,items:[]};for(r();t.kinds[t.i]===8;)a.items.push({$type:`DomainItem`,label:f(t.take())}),r();n.domains.push(a);break}default:t.fail(`a domain, a transition, a title, or a line break`)}return n}function O(e){let t=e+1831565813|0;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function k(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}function ne(e,t){return typeof e==`number`&&Number.isFinite(e)&&e!==0?e:k(t)}var re={segments:7,vertical:!0,pointStep:17,controlStep:31,controlShift:7},A={segments:7,vertical:!1,pointStep:23,controlStep:37,controlShift:11};function j(e,t,n,r,i,a){let o=(t-e)/a.segments,s=[],c=[];for(let t=0;t<=a.segments;t++){let l=t===0&&a.pinStart||t===a.segments&&a.pinEnd;s.push(e+t*o),c.push(l?n:n+O(r+t*a.pointStep)*i*2-i)}let l=a.vertical?[c[0],s[0]]:[s[0],c[0]];for(let e=0;e<a.segments;e++){let t=(s[e]+s[e+1])/2,n=i*1.5*(e%2==0?1:-1)*O(r+e*a.controlStep+a.controlShift);a.vertical?l.push(c[e]+n,t,c[e+1]-n,t,c[e+1],s[e+1]):l.push(t,c[e]+n,t,c[e+1]-n,s[e+1],c[e+1])}return l}function ie(e,t,n,r){let i=n-t;return[e,t,e+r,t+i*.2,e-r*1.5,t+i*.55,e+r*.5,t+i*.75,e-r,t+i*.85,e+r*.3,t+i*.95,e,n]}function M(e){let t=``;for(let n=2;n<e.length;n+=6)t+=`C${o(e[n])},${o(e[n+1])} ${o(e[n+2])},${o(e[n+3])} ${o(e[n+4])},${o(e[n+5])}`;return t}function N(e){let t=``;for(let n=e.length-6;n>=2;n-=6)t+=`C${o(e[n+2])},${o(e[n+3])} ${o(e[n])},${o(e[n+1])} ${o(e[n-2])},${o(e[n-1])}`;return t}function P(e){return`M${o(e[0])},${o(e[1])}${M(e)}`}function F(e,t,n,r){let i=`${o(n)},${o(r)}`;return`M${o(e-n)},${o(t)}A${i} 0 1,1 ${o(e+n)},${o(t)}A${i} 0 1,1 ${o(e-n)},${o(t)}Z`}var I=[[`complex`,0,0,0],[`complicated`,1,0,1],[`chaotic`,0,1,3],[`clear`,1,1,2]],ae=4,L=new Map([[`complex`,[`Complex`,`Probe → Sense → Respond`,`Emergent Practices`]],[`complicated`,[`Complicated`,`Sense → Analyse → Respond`,`Good Practices`]],[`clear`,[`Clear`,`Sense → Categorise → Respond`,`Best Practices`]],[`chaotic`,[`Chaotic`,`Act → Sense → Respond`,`Novel Practices`]],[`confusion`,[`Confusion`,``,`Disorder`]]]),oe=3,se=200,ce=10,le=4,R=6,ue=10,de=20,z=10;function B(e,t,n,r,i){let a=e.cynefin?.[t];return typeof a==`number`&&a>=r&&a<=i?a:n}function V(l,u,d){let f=d.fontSize??16,p=Math.round(f*.8125),m=Math.round(f*.875),h=d.measurer??te(d.fontFamily,d.fontFamilyMono),g=d.padding??8,ee=d.icons,_=u.cynefin?.showDomainDescriptions!==!1,v=B(u,`boundaryAmplitude`,8,0,50),y=ne(B(u,`seed`,0,-0x38d7ea4c68000,0x38d7ea4c68000),d.idPrefix??`pele`),b=Math.round(m*1.5),x=(e,t)=>{let n=a(e,!1,h,m,se);return{text:e,label:n,w:n.width+2*ce,h:Math.max(n.height,b)+2*le,overflow:t}},S=e=>{let t=L.get(e),n=a(t[0],!1,h,f,4e3,1),r=[];if(_)for(let e of[t[1],t[2]])e&&r.push(a(e,!1,h,p,4e3,2));let i=l.domains.get(e)?.items??[],o=e===`confusion`&&i.length>oe?oe:i.length,s=[];for(let e=0;e<o;e++)s.push(x(i[e].label,!1));o<i.length&&s.push(x(`+${i.length-o} more`,!0));let c=n.width,u=n.height;for(let e of r)c=Math.max(c,e.width),u+=e.height;s.length>0&&(u+=ue-R);for(let e of s)c=Math.max(c,e.w),u+=R+e.h;return{name:e,title:n,subtitles:r,badges:s,w:c,h:u,cx:0,cy:0}},C=I.map(([e])=>S(e)),w=S(`confusion`),T=Math.max(88,w.w*.71+8),E=Math.max(64,w.h*.71+6),D=B(u,`width`,640,100,1e4)/2,O=B(u,`height`,440,100,1e4)/2;for(let e of C)D=Math.max(D,e.w+2*de),O=Math.max(O,e.h+2*de);for(let e of C){let t=(D-e.w)/2,n=(O-e.h)/2;if((t/(T+z))**2+(n/(E+z))**2>=1)continue;let r=e.w+2*(T+z),i=e.h+2*(E+z);r*O<=D*i?D=Math.max(D,r):O=Math.max(O,i)}let k=a(l.title,!1,h,f,4e3,1),V=k.height>0?k.height+12:0,H=2*D,fe=2*O,U=g,W=g+V,G=U+D,K=W+O,q=U+H,pe=W+fe,J=j(W,K,G,y,v,{...re,segments:4,pinEnd:!0}),Y=j(U,G,K,y+100,v,{...A,segments:4,pinEnd:!0}),X=j(G,q,K,y+200,v,{...A,segments:4,pinStart:!0}),Z=ie(G,K,pe,H*.03),Q=(e,t)=>t?`${o(e[e.length-2])},${o(e[e.length-1])}`:`${o(e[0])},${o(e[1])}`,me=new Map([[`complex`,`M${o(U)},${o(W)}L${Q(J,!1)}${M(J)}${N(Y)}Z`],[`complicated`,`M${Q(J,!1)}L${o(q)},${o(W)}L${Q(X,!0)}${N(X)}${N(J)}Z`],[`chaotic`,`M${Q(Y,!1)}${M(Y)}${M(Z)}L${o(U)},${o(pe)}Z`],[`clear`,`M${Q(X,!1)}${M(X)}L${o(q)},${o(pe)}L${Q(Z,!0)}${N(Z)}Z`]]),he=``;for(let[e,,,n]of I)he+=`<path class="pele-cynefin-region" data-id="${e}" d="${me.get(e)}" fill="${t(n)}" fill-opacity="0.14"/>`;let ge=`<g class="pele-cynefin-boundaries" fill="none" stroke="var(--_b)" stroke-dasharray="6 3"><path d="${P(J)}"/><path d="${P(Y)}"/><path d="${P(X)}"/><path class="pele-cynefin-cliff" d="${P(Z)}" stroke="var(--_l)" stroke-width="2" stroke-dasharray="none" stroke-linecap="round"/></g>`,_e=F(G,K,T,E),ve=`<path d="${_e}" fill="var(--_bg)"/><path class="pele-cynefin-region" data-id="confusion" d="${_e}" fill="${t(ae)}" fill-opacity="0.18" stroke="var(--_b)" stroke-dasharray="4 2"/>`,ye=e=>{let t=e.cy-e.h/2,a=r(e.title,e.cx,t+e.title.height/2,` class="pele-label" font-weight="var(--_hw)"`);t+=e.title.height;for(let n of e.subtitles)a+=r(n,e.cx,t+n.height/2,` class="pele-cynefin-subtitle" font-size="${p}" font-style="italic" fill="var(--_m)"`),t+=n.height;t+=ue-R;for(let s of e.badges)t+=R,a+=`<g class="pele-node${s.overflow?` pele-cynefin-overflow`:``}"${s.overflow?``:` data-id="${n(s.text)}"`}><rect x="${o(e.cx-s.w/2)}" y="${o(t)}" width="${o(s.w)}" height="${o(s.h)}" fill="var(--_bg)" stroke="var(--_b)"${s.overflow?` stroke-dasharray="3 2"`:``}${i}/>`+r(s.label,e.cx,t+s.h/2,` class="pele-label" font-size="${m}"${s.overflow?` fill="var(--_m)"`:``}`,ee)+`</g>`,t+=s.h;return`<g class="pele-cynefin-domain" data-id="${e.name}">${a}</g>`},$=new Map,be=``;I.forEach(([e,t,n],r)=>{let i=C[r];i.cx=U+D*(t+.5),i.cy=W+O*(n+.5),$.set(e,i),be+=ye(i)}),w.cx=G,w.cy=K,$.set(`confusion`,w),be+=ye(w);let xe=(e,t,n)=>e===w?((t-G)/(T+4))**2+((n-K)/(E+4))**2<=1:Math.abs(t-e.cx)<=e.w/2+8&&Math.abs(n-e.cy)<=e.h/2+8,Se=``,Ce=new Map;for(let e of l.transitions){let t=$.get(e.from),n=$.get(e.to);if(!t||!n||t===n)continue;let i=e.from<e.to?`${e.from} ${e.to}`:`${e.to} ${e.from}`,l=Ce.get(i)??0;Ce.set(i,l+1);let u=n.cx-t.cx,d=n.cy-t.cy,f=Math.hypot(u,d)||1,m=(t.cx+n.cx)/2,g=(t.cy+n.cy)/2,_=-d*(m-G)+u*(g-K)>=0?1:-1,v=-d/f*_,y=u/f*_,b=(t!==w&&n!==w&&Math.abs(u)>1&&Math.abs(d)>1?2*(Math.hypot(T*v,E*y)+16):f*.15)+l*56,x=m+v*b,S=g+y*b,C=e=>{let r=1-e;return[r*r*t.cx+2*r*e*x+e*e*n.cx,r*r*t.cy+2*r*e*S+e*e*n.cy]},te=(e,t,n,r)=>{for(let i=0;i<16;i++){let i=(t+n)/2;xe(e,...C(i))===r?t=i:n=i}return(t+n)/2},D=1;for(;D<=48&&xe(t,...C(D/48));)D++;if(D>48)continue;let O=te(t,(D-1)/48,D/48,!0);for(;D<=48&&!xe(n,...C(D/48));)D++;let k=D>48?1:te(n,(D-1)/48,D/48,!1),[ne,re]=C(O),[A,j]=C(k),ie=(e,t,n)=>(1-O)*(1-k)*e+((1-O)*k+O*(1-k))*t+O*k*n,M=ie(t.cx,x,n.cx),N=ie(t.cy,S,n.cy),P=Math.hypot(A-M,j-N)||1,F=(A-M)/P,I=(j-N)/P,ae=c(`arrow_point`,A,j,F,I,`var(--_l)`);A-=F*s(`arrow_point`),j-=I*s(`arrow_point`);let L=``;if(e.label){let t=a(e.label,!1,h,p,se),[n,i]=C((O+k)/2),o=Math.abs(v)*t.width/2+Math.abs(y)*t.height/2+6,s=t.width/2+4,c=Math.min(Math.max(n+v*o,U+s),Math.max(q-s,U+s));L=r(t,c,i+y*o,` class="pele-edge-label" font-size="${p}"`,ee)}Se+=`<g class="pele-edge" data-id="${e.from}-${e.to}"><path d="M${o(ne)},${o(re)}Q${o(M)},${o(N)} ${o(A)},${o(j)}" fill="none" stroke="var(--_l)"/>`+ae+L+`</g>`}let we=Math.ceil(Math.max(H,k.width)+2*g),Te=Math.ceil(fe+V+2*g),Ee=r(k,U+H/2,g+k.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g class="pele-cynefin-regions">${he}</g>`+ge+ve+be+(Se?`<g class="pele-edges">${Se}</g>`:``);return{svg:e(`cynefin`,we,Te,f,d,l,Ee),width:we,height:Te,links:[]}}var H={type:`cynefin`,parse:(e,t,n)=>T(D(e),n),render:V};export{H as cynefin};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,d as r,f as i,i as a,o,s,u as c,x as l}from"./
|
|
1
|
+
import{_ as e,a as t,b as n,d as r,f as i,i as a,o,s,u as c,x as l}from"./DEQsS4Ez.js";import{a as u,t as d}from"./DciMwFJ1.js";import{a as f,i as p,l as m,s as h,u as g}from"./Kem7IXj7.js";import{a as _,i as v,t as y}from"./CcE14TDI.js";import{a as ee,i as b,r as x,t as S}from"./BtcGx-KQ.js";import{t as C}from"./D6QVYUu9.js";import{n as w,r as T}from"./DW5uy3Jw.js";import{i as E,n as te,r as D,t as O}from"./OG9GsKke.js";import{n as k,t as A}from"./CggtIYAM.js";import{PeleError as j,c as M,d as ne,g as N,h as P,i as F,n as I,o as L,s as R,u as z}from"./zasx25UV.js";var B=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),V=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),re=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),H=`roundedRect`;function U(e){return e&&(B.get(e)??e)}function W(e){return A(e)||e===`constructor`}function ie(e,t){for(let n of e)n.isGroup||((!n.shape||n.shape===`squareRect`||n.shape===`rect`)&&(n.shape=H),V.has(n.shape)?(t.emitError(`SHAPE_REMOVED`,`shape "${n.shape}" was removed in v0.8.1, using "${H}"`,{nodeId:n.id}),n.shape=H):re.has(n.shape)||(t.emitWarning(`SHAPE_UNSUPPORTED`,`shape "${n.shape}" is not supported, using "${H}"`,{nodeId:n.id}),n.shape=H))}var G=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),ae=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]);function oe(e){return ae.has(e.type)}function K(e){return e===`markdown`||e===`string`||e===`text`?e:`markdown`}function q(e){return e.startsWith(`"`)&&e.endsWith(`"`)?e.substring(1,e.length-1):e}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function se(e){let t=e=>Array.isArray(e)?[]:J(e)?{}:e,n=t(e),r=[[e,n]];for(;r.length>0;){let[e,n]=r.pop();if(Array.isArray(e))for(let i of e){let e=t(i);n.push(e),typeof i==`object`&&i&&r.push([i,e])}else if(J(e))for(let i of Object.keys(e)){if(i===`__proto__`||i===`constructor`||i===`prototype`)continue;let a=e[i],o=t(a);n[i]=o,typeof a==`object`&&a&&r.push([a,o])}}return n}function Y(e,t){return Object.assign(e??{},t)}var ce=/:\s*[>|][\d+-]*\s*$/,le=/,([\t ]*)$/;function X(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(`
|
|
2
2
|
`)){if(i!==void 0){let e=o.length-o.trimStart().length;if(o.trim()===``||e>i){a.push(o);continue}i=void 0}let e=-1;for(let i=0;i<o.length;i++){let a=o[i];if(n)a===`\\`?i++:a===`"`&&(n=!1);else if(t)a===`'`&&(t=!1);else if(a===`"`)n=!0;else if(a===`'`)t=!0;else if(a===`#`&&(i===0||o[i-1]===` `||o[i-1]===` `)){e=i;break}else a===`[`||a===`{`?r++:(a===`]`||a===`}`)&&(r=Math.max(0,r-1))}if(t||n||r>0){a.push(o);continue}let s=e>=0?o.slice(0,e):o,c=e>=0?o.slice(e):``;ce.test(s)?(i=o.length-o.trimStart().length,a.push(o)):a.push(s.replace(le,`$1`)+c)}return a.join(`
|
|
3
3
|
`)}function ue(e,t){if(e===`arrow_point`&&t===`normal`)return`sequence`;if(e===`arrow_cross`&&t===`normal`)return`failure`;if(e===`arrow_open`&&t===`dotted`)return`reference`}function de(e){let t=e.trim(),n=t.slice(0,-1),r=`arrow_open`;switch(t.slice(-1)){case`x`:r=`arrow_cross`;break;case`>`:r=`arrow_point`;break;case`-`:case`.`:n=t}let i=`normal`,a=n.length-1,o=0;for(let e=0;e<n.length;e++)n[e]===`.`&&o++;return o>0&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}function fe(e){if(!e)return;let t={},n=!1;for(let r of Object.keys(e))G.has(r)||(t[r]=e[r],n=!0);return n?t:void 0}var pe=class{type=`agentflow`;direction;nodes=new Map;edges=[];subgraphs=[];connectors=new Map;classes=new Map;tooltips=new Map;defaultEdgeStyle;defaultInterpolate;mappings=[];diagnostics=[];title;accTitle;accDescr;lineOffset;subgraphLookup=new Map;globalNodes=new Set;members=new Set;edgeById=new Map;pairCount=new Map;subCount=0;bareMappings=new Set;firstMapping=new Map;reported=new Map;options;constructor(e={}){this.options=e,this.lineOffset=e.lineOffset??0}metadata(e,t,n){let r=t.includes(`
|
|
4
4
|
`),i;try{i=I(r?t+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,f as n,i as r,o as i,u as a,x as o}from"./
|
|
1
|
+
import{_ as e,a as t,f as n,i as r,o as i,u as a,x as o}from"./DEQsS4Ez.js";import{i as s}from"./DciMwFJ1.js";import{t as c}from"./CgA1WoRv.js";import{PeleError as l,b as u,g as d,h as f,s as p,u as m,y as h}from"./zasx25UV.js";var g=class{type=`xychart`;title;accTitle;accDescr;orientation;xAxis={type:`band`,title:``,categories:[]};yAxis={type:`linear`,title:``,min:1/0,max:-1/0};hasSetXAxis=!1;hasSetYAxis=!1;plots=[];setOrientation(e){this.orientation=e===`horizontal`?`horizontal`:`vertical`}setXAxisTitle(e){this.xAxis.title=e.text.trim()}setXAxisRangeData(e,t){this.xAxis={type:`linear`,title:this.xAxis.title,min:e,max:t},this.hasSetXAxis=!0}setXAxisBand(e){this.xAxis={type:`band`,title:this.xAxis.title,categories:e.map(e=>e.text.trim())},this.hasSetXAxis=!0}setYAxisTitle(e){this.yAxis.title=e.text.trim()}setYAxisRangeData(e,t){this.yAxis={type:`linear`,title:this.yAxis.title,min:e,max:t},this.hasSetYAxis=!0}plotData(e){if(e.length===0)return[];this.hasSetXAxis||this.setXAxisRangeData(1,e.length);let t=this.xAxis;if(t.type===`band`&&e.length>t.categories.length&&(e=e.slice(0,t.categories.length)),!this.hasSetYAxis){let{min:t,max:n}=this.yAxis;for(let r of e)r<t&&(t=r),r>n&&(n=r);this.yAxis={type:`linear`,title:this.yAxis.title,min:t,max:n}}if(t.type===`band`)return t.categories.map((t,n)=>[t,e[n]]);if(e.length===1)return[[`${t.min}`,e[0]]];let n=(t.max-t.min)/(e.length-1);return e.map((e,r)=>[`${t.min+r*n}`,e])}addPlot(e,t,n){let r={type:e,title:t.text.trim(),data:this.plotData(n.map(e=>e.value))};e===`line`&&n.some(e=>e.label.trim()!==``)&&(r.pointLabels=n.map(e=>e.label.trim())),this.plots.push(r)}setLineData(e,t){this.addPlot(`line`,e,t)}setBarData(e,t){this.addPlot(`bar`,e,t)}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}},_=`$end.INVALID.NEWLINE.title.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.XYCHART.CHART_ORIENTATION.X_AXIS.Y_AXIS.ARROW_DELIMITER.LINE.BAR.NUMBER_WITH_DECIMAL.SQUARE_BRACES_START.SQUARE_BRACES_END.STR.ALPHA.COLON.PLUS.COMMA.EQUALS.MULT.BRKT.UNDERSCORE.DOT.AMP.MINUS.NUM.SEMI.EOF`.split(`.`),v=[33,33,33,33,33,19,5,7,8],y="`)"+` `.repeat(36)+`{ this.pushstate(md_string); }
|
|
3
3
|
<md_string>(?:(?!\`").)+`+` `.repeat(18)+`{ return md_str; }
|
|
4
4
|
<md_string>(?:\``,b=new Uint8Array(128);for(let[e,t]of[[`:`,21],[`+`,22],[`,`,23],[`=`,24],[`*`,25],[`#`,26],[`_`,27],[`.`,28],[`&`,29],[`-`,30],[`;`,32]])b[e.charCodeAt(0)]=t;function x(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,l=(t,a,o)=>{n.push(t),r.push(e.slice(a,o)),i.push(a),s=o},p=e=>{a.push(o),o=e},m=()=>{a.length>0&&(o=a.pop())},g=n=>{let r=e.indexOf(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{t as flowchart}from"./CwHHpacD.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as e}from"./
|
|
1
|
+
import{h as e}from"./zasx25UV.js";function t(e,t){let n=e.indexOf(`
|
|
2
2
|
`,t);return n===-1?e.length:n}function n(e,t,n){for(let r=0;r<n.length;r++)if((e.charCodeAt(t+r)|32)!==n.charCodeAt(r))return!1;return!0}function r(n,r){let i=n.length,a=r;for(;a<i;){let r=n.charCodeAt(a);if(r===37&&n.charCodeAt(a+1)!==123)a=t(n,a);else{if(r===10)return a;if(e(r))do a++;while(a<i&&e(n.charCodeAt(a)));else if(r===35)a=t(n,a);else return a}}return a}function i(t,n){let r=n;for(;e(t.charCodeAt(r));)r++;return r}function a(e,r,a,o){let s=n(e,r,`accdescr`);if(!s&&!n(e,r,`acctitle`))return r;let c=e.length,l=i(e,r+8),u=e.charCodeAt(l),d=(t,n,r)=>{a.types.push(t),a.texts.push(e.slice(n,r)),a.starts.push(n)};if(u===58){l=i(e,l+1);let n=t(e,l);return d(s?o+2:o,r,l),d(s?o+3:o+1,l,n),n}if(!s||u!==123)return r;for(l=i(e,l+1);e.charCodeAt(l)!==125;){let t=e.indexOf(`}`,l);if(t===-1&&(t=c),d(o+4,l,t),l===c)return c;l=t}return l+1}export{a as i,r as n,t as r,n as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./
|
|
1
|
+
import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./DEQsS4Ez.js";import{n as o}from"./BZX8cNYL.js";import{t as s}from"./DciMwFJ1.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./CWc-mNzo.js";import{PeleError as ee,u as te}from"./zasx25UV.js";var w={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4};function T(e){throw new ee(e,`semantic`,{type:`gitGraph`})}function E(e){return e===`REVERSE`?w.REVERSE:e===`HIGHLIGHT`?w.HIGHLIGHT:w.NORMAL}function D(e,t){e.dir&&t.setDirection(e.dir);for(let n of e.statements)O(n,t)}function O(e,t){switch(e.$type){case`Commit`:t.commit({id:e.id,msg:e.message??``,type:e.type===void 0?w.NORMAL:E(e.type),tags:e.tags??void 0});break;case`Branch`:t.branch({name:e.name,order:e.order??0});break;case`Merge`:t.merge({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:E(e.type),tags:e.tags??void 0});break;case`Checkout`:t.checkout(e.branch);break;case`CherryPicking`:t.cherryPick({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent})}}function k(e,t,n){let r=t.gitGraph,i=typeof r?.mainBranchName==`string`?r.mainBranchName:`main`,a=typeof r?.mainBranchOrder==`number`?r.mainBranchOrder:0,o=new Map,s=new Map([[i,null]]),c=new Map([[i,a]]),l=[],u=null,d=i,f=`LR`,p=0,m=()=>{for(let e=p+1;;e+=2654435761){let t=`${p}-${(Math.imul(e,2654435761)>>>0).toString(16).padStart(8,`0`).slice(0,7)}`;if(!o.has(t))return t}},h=e=>{u=e,o.set(e.id,e),s.set(d,e.id)},g=e=>{s.has(e)||T(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`),d=e;let t=s.get(e);u=t?o.get(t)??null:null};D(e,{setDirection(e){f=e},commit({msg:e,id:t,type:n,tags:r}){let i={id:t||m(),message:e,seq:p++,type:n??w.NORMAL,tags:r?[...r]:[],parents:u===null?[]:[u.id],branch:d};o.has(i.id)&&l.push(`Commit ID ${i.id} already exists`),h(i)},branch({name:e,order:t}){s.has(e)&&T(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`),s.set(e,u===null?null:u.id),c.set(e,t),g(e)},merge({branch:e,id:t,type:n,tags:r}){let i=s.get(d),a=s.get(e),c=i?o.get(i):void 0,l=a?o.get(a):void 0;c&&l&&c.branch===e&&T(`Cannot merge branch '${e}' into itself.`),d===e&&T(`Incorrect usage of "merge". Cannot merge a branch to itself`),c===void 0&&T(`Incorrect usage of "merge". Current branch (${d})has no commits`),s.has(e)||T(`Incorrect usage of "merge". Branch to be merged (${e}) does not exist`),l===void 0&&T(`Incorrect usage of "merge". Branch to be merged (${e}) has no commits`),c===l&&T(`Incorrect usage of "merge". Both branches have same head`),t&&o.has(t)&&T(`Incorrect usage of "merge". Commit with id:${t} already exists, use different custom id`),h({id:t||m(),message:`merged branch ${e} into ${d}`,seq:p++,parents:u===null?[]:[u.id,a||``],branch:d,type:w.MERGE,customType:n,customId:!!t,tags:r?[...r]:[]})},cherryPick({id:e,targetId:t,tags:n,parent:r}){let i=e?o.get(e):void 0;if(i===void 0&&T(`Incorrect usage of "cherryPick". Source commit id should exist and provided`),r&&!i.parents.includes(r)&&T(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`),i.type===w.MERGE&&!r&&T(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`),t&&o.has(t))return;i.branch===d&&T(`Incorrect usage of "cherryPick". Source commit is already on current branch`);let a=s.get(d);(!a||!o.has(a))&&T(`Incorrect usage of "cherry-pick". Current branch (${d})has no commits`),h({id:m(),message:`cherry-picked ${i.message} into ${d}`,seq:p++,parents:u===null?[]:[u.id,i.id],branch:d,type:w.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${i.id}${i.type===w.MERGE?`|parent:${r}`:``}`]})},checkout:g});let _=[...c].map(([e,t],n)=>({name:e,order:t??parseFloat(`0.${n}`)})).sort((e,t)=>e.order-t.order).map(e=>e.name);return{type:`gitGraph`,title:e.title||n,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,direction:f,commits:o,branches:s,lanes:_,currentBranch:d,head:u,warnings:l}}var A={name:`REFERENCE`,pattern:/\w([-\./\w]*[-\w])?/y},j=[A];function M(e){return{name:e,pattern:e,longer:j}}var N=[M(`cherry-pick`),{name:`gitGraph:`,pattern:`gitGraph:`},M(`HIGHLIGHT`),{...m(`gitGraph`),longer:j},M(`checkout`),M(`REVERSE`),{name:`parent:`,pattern:`parent:`},M(`commit`),M(`NORMAL`),M(`branch`),{name:`order:`,pattern:`order:`},M(`switch`),{name:`type:`,pattern:`type:`},M(`merge`),{name:`msg:`,pattern:`msg:`},{name:`tag:`,pattern:`tag:`},{name:`id:`,pattern:`id:`},M(`LR`),M(`TB`),M(`BT`),{name:`:`,pattern:`:`},{...c,opener:/[\t ]*accDescr\s*{/y},S,y,{name:`INT`,pattern:/0|[1-9][0-9]*(?!\.)/y},g,h,C,b,v,x,A];function P(e){let t=new p(_(e,N,`gitGraph`),N,`gitGraph`),n={$type:`GitGraph`,statements:[]},r=()=>{if(t.kind!==-1)for(t.kind!==26&&t.fail(`a line break or the end of input`);t.kind===26;)t.i++},i=()=>t.kind===31?t.take():t.kind===25?d(t.take()):t.fail(`a branch name`),a=()=>d(t.expect(25)),o=()=>(t.kind!==8&&t.kind!==5&&t.kind!==2&&t.fail(`NORMAL, REVERSE, or HIGHLIGHT`),t.take());for(;t.kind===26;)t.i++;if(!t.accept(1)){t.expect(3);let e=t.kinds[t.i+1];(t.kind===17||t.kind===18||t.kind===19)&&e===20?(n.$type=`Direction`,n.dir=t.take(),t.i++):t.accept(20)}for(;t.kind!==-1;)switch(t.kind){case 26:t.i++;break;case 21:n.accDescr=l(t.take()),r();break;case 22:n.accTitle=f(t.take()),r();break;case 23:n.title=u(t.take()),r();break;case 7:{t.i++;let e={$type:`Commit`,tags:[]};for(;;)if(t.accept(16))e.id=a();else if(t.accept(15))e.tags.push(a());else if(t.accept(12))e.type=o();else if(t.accept(14)||t.kinds[t.i]===25)e.message=a();else break;r(),n.statements.push(e);break}case 9:{t.i++;let e={$type:`Branch`,name:i()};t.accept(10)&&(e.order=parseInt(t.expect(24))),r(),n.statements.push(e);break}case 13:{t.i++;let e={$type:`Merge`,branch:i(),tags:[]};for(;;)if(t.accept(16))e.id=a();else if(t.accept(15))e.tags.push(a());else if(t.accept(12))e.type=o();else break;r(),n.statements.push(e);break}case 4:case 11:{t.i++;let e={$type:`Checkout`,branch:i()};r(),n.statements.push(e);break}case 0:{t.i++;let e={$type:`CherryPicking`,tags:[]};for(;;)if(t.accept(16))e.id=a();else if(t.accept(15))e.tags.push(a());else if(t.accept(6))e.parent=a();else break;r(),n.statements.push(e);break}default:t.fail(`a statement, a title, or a line break`)}return n}var F=7,ne=44,re=44,I=36,L=8,R=20,z=20,B=7,ie=6,V=Math.SQRT1_2,ae=[`normal`,`reverse`,`highlight`,`merge`,`cherry-pick`];function H(e,t,n){let r=e.gitGraph?.[t];return typeof r==`boolean`?r:n}function oe(e){return B+4+e.width+6}function se(e,t,n,r){let i=`cx="${a(t)}" cy="${a(n)}"`;if(e===w.HIGHLIGHT)return`<rect x="${a(t-F-1)}" y="${a(n-F-1)}" width="${2*F+2}" height="${2*F+2}" rx="2" fill="${r}"/>`;if(e===w.MERGE)return`<circle ${i} r="${F-1}" fill="var(--_bg)" stroke="${r}" stroke-width="2"/><circle ${i} r="2.5" fill="${r}"/>`;let o=`<circle ${i} r="${F}" fill="${r}"/>`;return e===w.REVERSE?o+`<path d="M${a(t-3)},${a(n-3)}l6,6M${a(t-3)},${a(n+3)}l6,-6" fill="none" stroke="var(--_bg)" stroke-width="1.5" stroke-linecap="round"/>`:e===w.CHERRY_PICK?o+`<path d="M${a(t-2.6)},${a(n+1)}L${a(t+.8)},${a(n-4.2)}L${a(t+2.6)},${a(n+1)}" fill="none" stroke="var(--_bg)" stroke-linejoin="round"/><circle cx="${a(t-2.6)}" cy="${a(n+2.2)}" r="1.8" fill="var(--_bg)"/><circle cx="${a(t+2.6)}" cy="${a(n+2.2)}" r="1.8" fill="var(--_bg)"/>`:o}function U(e,t,n){return e.direction===`LR`?s(n,r=>W(e,t,n,r?`TB`:`LR`)):W(e,t,n,e.direction)}function W(s,c,l,u){let d=l.fontSize??16,f=Math.round(d*.75),p=l.measurer??te(l.fontFamily,l.fontFamilyMono),m=l.padding??8,h=H(c,`showBranches`,!0),g=H(c,`showCommitLabel`,!0),_=H(c,`rotateCommitLabel`,!0),v=H(c,`parallelCommits`,!1),y=u!==`LR`,b=u===`BT`,x=new Map;s.lanes.forEach((e,t)=>x.set(e,t));let S=s.lanes.length,C=Math.round(d*.875),ee=s.lanes.map(e=>o(h?e:``,p,C,4e3)),T=[],E=new Map;for(let e of[...s.commits.values()].sort((e,t)=>e.seq-t.seq)){let t=g&&e.type!==w.CHERRY_PICK&&(e.type!==w.MERGE||e.customId===!0),n=[];for(let t of e.tags){let e=o(t,p,f,4e3);e.lines.length>0&&n.push(e)}let r={commit:e,index:T.length,lane:x.get(e.branch)??0,m:0,label:t?o(e.id,p,f,4e3):void 0,tags:n};T.push(r),E.set(e.id,r)}let D=new Float64Array(T.length),O=new Float64Array(T.length),k=new Float64Array(S).fill(F),A=new Float64Array(S).fill(F);T.forEach((e,t)=>{let{label:n,tags:r}=e,i=0,a=0;for(let e of r){let t=oe(e);y?(i=Math.max(i,e.height),a+=t+4):(i=Math.max(i,t),a+=e.height+3)}let o=0,s=0;n!==void 0&&n.lines.length>0&&(_?s=3+V*(n.width+n.height):(o=y?n.height:n.width,s=6+(y?n.width:n.height))),D[t]=Math.max(F,i/2,o/2),O[t]=i/2;let c=F+(r.length>0?ie+a:0),l=F+s,u=e.lane;k[u]=Math.max(k[u],y?l:c),A[u]=Math.max(A[u],y?c:l)});let j=new Float64Array(T.length);y||T.forEach((e,t)=>{if(O[t]!==0)for(let n of e.commit.parents){let r=E.get(n);r!==void 0&&r.lane<e.lane&&(j[t]=O[t]+4)}});let M=(e,t)=>Math.max(ne,D[e]+D[t]+L,j[t]>0?D[e]+I+j[t]:0);T.forEach((e,t)=>{if(!v){e.m=t===0?0:T[t-1].m+M(t-1,t);return}let n=0;for(let r of e.commit.parents){let e=E.get(r);e===void 0||e.index>=t||(n=Math.max(n,e.m+M(e.index,t)))}e.m=n});let N=0;for(let e of T)N=Math.max(N,e.m);let P=new Float64Array(S);for(let e=0;e<S;e++){let t=ee[e],n=t.lines.length===0?0:y?t.width/2+8:t.height/2+2;k[e]=Math.max(k[e],n),A[e]=Math.max(A[e],n),e>0&&(P[e]=P[e-1]+Math.max(re,A[e-1]+k[e]+L))}let U=(e,t)=>y?t:e,W=(e,t)=>y?b?-e:e:t,G=(e,t)=>`${a(U(e,t))},${a(W(e,t))}`,K=1/0,q=1/0,J=-1/0,Y=-1/0,X=(e,t,n,r)=>{e<K&&(K=e),t<q&&(q=t),n>J&&(J=n),r>Y&&(Y=r)},Z=``;if(h)for(let e=0;e<S;e++){let i=ee[e],o=t(e),c=P[e],l=i.width+16,u=i.height+4,d=i.lines.length===0?-R:-R-(y?u:l),f=U(d+(y?u:l)/2,c),p=W(d+(y?u:l)/2,c);X(U(-R,c),W(-R,c),U(-R,c),W(-R,c)),X(U(N+z,c),W(N+z,c),U(N+z,c),W(N+z,c)),Z+=`<g class="pele-branch" data-id="${n(s.lanes[e])}"><path class="pele-lane" d="M${G(-R,c)}L${G(N+z,c)}" stroke="${o}" stroke-dasharray="2 4"/>`,i.lines.length>0&&(X(f-l/2,p-u/2,f+l/2,p+u/2),Z+=`<rect x="${a(f-l/2)}" y="${a(p-u/2)}" width="${a(l)}" height="${a(u)}" fill="${o}" style="rx:var(--_r)"/>`+r(i,f,p,` class="pele-label" fill="var(--_bg)"`)),Z+=`</g>`}let ce=Array.from({length:S},()=>[]);for(let e of T)ce[e.lane].push(e.m);if(v)for(let e of ce)e.sort((e,t)=>e-t);let le=(e,t,n)=>{let r=ce[e],i=0,a=r.length;for(;i<a;){let e=i+a>>1;r[e]<=t?i=e+1:a=e}return i<r.length&&r[i]<n},ue=``,Q=``;for(let e of T){let{commit:n}=e,r=P[e.lane],i=e.m;for(let a=0;a<n.parents.length;a++){let o=E.get(n.parents[a]);if(o===void 0||o===e)continue;let s=P[o.lane],c=o.m;if(o.lane===e.lane){Q+=`<path class="pele-edge" d="M${G(c,s)}L${G(i,r)}" stroke="${t(e.lane)}"/>`;continue}let l=a>0&&n.type===w.MERGE,u=a>0&&!l,d=`M${G(c,s)}`;if(i<=c){let e=(c+i)/2;d+=`C${G(e,s)} ${G(e,r)} ${G(i,r)}`}else if(!l&&!le(e.lane,c,i)){let e=Math.min(I,i-c);d+=`C${G(c+e/2,s)} ${G(c+e/2,r)} ${G(c+e,r)}L${G(i,r)}`}else{let t=o.lane<e.lane&&i-j[e.index]>c?i-j[e.index]:i,n=Math.min(I,t-c),a=s;(!l||le(o.lane,c,i))&&(a=s>r?r+A[e.lane]+L/2:r-k[e.lane]-L/2,n=Math.min(I,(t-c)/2),d+=`C${G(c+n/2,s)} ${G(c+n/2,a)} ${G(c+n,a)}`),d+=`L${G(t-n,a)}C${G(t-n/2,a)} ${G(t-n/2,r)} ${G(t,r)}`,t<i&&(d+=`L${G(i,r)}`)}ue+=`<path class="pele-edge${l?` pele-edge-merge`:u?` pele-edge-cherry-pick`:``}" d="${d}" stroke="${t(l?o.lane:e.lane)}"${u?` stroke-dasharray="4 3"`:``}/>`}}let de=``;for(let e of T){let{commit:i,label:o,tags:s}=e,c=U(e.m,P[e.lane]),l=W(e.m,P[e.lane]),u=i.customType??i.type;X(c-F-1,l-F-1,c+F+1,l+F+1);let d=i.type<w.MERGE&&i.message!==``?`<title>${n(i.message)}</title>`:``;if(d+=se(u,c,l,t(e.lane)),o!==void 0&&o.lines.length>0){let e=o.width,t=o.height,n=(n,r)=>`<rect x="${a(n-e/2-2)}" y="${a(r-t/2+2)}" width="${a(e+4)}" height="${a(t-4)}" rx="3" fill="var(--_bg)"/>`;if(_){let i=V*t/2,s=y?c-F-3-i:c+3,u=y?l:l+F+3+i,f=V*e+i;X(s-f,b?u-f:u-i,s+i,b?u+i:u+f),d+=`<g class="pele-commit-label" transform="rotate(${b?45:-45} ${a(s)} ${a(u)})">`+n(s-e/2,u)+r(o,s-e/2,u,``)+`</g>`}else{let i=y?c-F-6-e/2:c,a=y?l:l+F+6+t/2;X(i-e/2,a-t/2,i+e/2,a+t/2),d+=`<g class="pele-commit-label">${n(i,a)}${r(o,i,a,``)}</g>`}}let f=F+ie;for(let e=y?0:s.length-1;e>=0&&e<s.length;e+=y?1:-1){let t=s[e],n=oe(t),i=t.height,o=y?c+f:c-n/2,u=y?l:l-f-i/2;f+=y?n+4:i+3,X(o,u-i/2,o+n,u+i/2),d+=`<g class="pele-tag"><path d="M${a(o)},${a(u)}L${a(o+B)},${a(u-i/2)}H${a(o+n)}V${a(u+i/2)}H${a(o+B)}Z" fill="var(--_s)" stroke="var(--_b)" stroke-linejoin="round"/><circle cx="${a(o+B)}" cy="${a(u)}" r="1.5" fill="var(--_b)"/>`+r(t,o+B+4+t.width/2,u,` fill="var(--_fg)"`)+`</g>`}let p=i.type===w.MERGE&&u!==w.MERGE?` pele-commit-merge`:``;de+=`<g class="pele-commit pele-commit-${ae[u]??ae[0]}${p}" data-id="${n(i.id)}">${d}</g>`}K>J&&X(0,0,0,0);let $=i(s.title,!1,p,d,4e3,1),fe=$.height>0?$.height+16:0,pe=Math.max(J-K,$.width),me=Math.ceil(pe+2*m),he=Math.ceil(Y-q+fe+2*m),ge=m-K+(pe-(J-K))/2,_e=m+fe-q,ve=r($,me/2,m+$.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${a(ge)},${a(_e)})">`+(Z?`<g class="pele-branches" fill="none" font-size="${C}">${Z}</g>`:``)+(ue||Q?`<g class="pele-edges" fill="none" stroke-width="2" stroke-linecap="round">${ue}${Q}</g>`:``)+(de?`<g class="pele-commits" font-size="${f}" fill="var(--_m)">${de}</g>`:``)+`</g>`;return{svg:e(`gitGraph`,me,he,d,l,s,ve),width:me,height:he,links:[]}}var G={type:`gitGraph`,parse:(e,t,n)=>k(P(e),t,n),render:U};export{G as gitGraph};
|