@burakboduroglu/nors 0.1.2 → 0.1.3
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/package.json +1 -1
- package/pb_public/nors/assets/{abnfDiagram-VCTEODGH-BjNTd20L.js → abnfDiagram-VCTEODGH-ruhEaSgX.js} +1 -1
- package/pb_public/nors/assets/architecture-7GRP2DOG-FixOTtMw.js +1 -0
- package/pb_public/nors/assets/{architectureDiagram-5GKGNRK7-DFNV5SNP.js → architectureDiagram-5GKGNRK7-CzCWMt5X.js} +1 -1
- package/pb_public/nors/assets/{blockDiagram-I7D4REHJ-DNijD6G8.js → blockDiagram-I7D4REHJ-oMLodvwS.js} +1 -1
- package/pb_public/nors/assets/{c4Diagram-7LVT6UL2-DLW_Vk73.js → c4Diagram-7LVT6UL2-D7Kvx5bG.js} +1 -1
- package/pb_public/nors/assets/channel-CpmEypED.js +1 -0
- package/pb_public/nors/assets/{chunk-4HAMMTFA-CQW8auRW.js → chunk-4HAMMTFA-CfDItMak.js} +1 -1
- package/pb_public/nors/assets/{chunk-75Z2AOVW-OUM6F-Z2.js → chunk-75Z2AOVW-JambT9gc.js} +1 -1
- package/pb_public/nors/assets/{chunk-DU6HZSFF-DdkkHC2K.js → chunk-DU6HZSFF-HXNYRQa7.js} +1 -1
- package/pb_public/nors/assets/{chunk-F27PBJKO-D4tBKW95.js → chunk-F27PBJKO-ClqBa20N.js} +1 -1
- package/pb_public/nors/assets/{chunk-GMAD6QVW-CZU7s-_u.js → chunk-GMAD6QVW-BgHQEQ7R.js} +1 -1
- package/pb_public/nors/assets/{chunk-GVQU2GXP-BQGI6BgU.js → chunk-GVQU2GXP-4BgM3wXc.js} +1 -1
- package/pb_public/nors/assets/{chunk-IMKFNOWR-BRvu8wxF.js → chunk-IMKFNOWR-mtk65J6o.js} +1 -1
- package/pb_public/nors/assets/{chunk-L3NEJ4N5-OjXnRmPt.js → chunk-L3NEJ4N5-qOkePrmd.js} +1 -1
- package/pb_public/nors/assets/{chunk-OSK3NFVY-puWVIqFn.js → chunk-OSK3NFVY-BjHX_8-9.js} +1 -1
- package/pb_public/nors/assets/{chunk-P2QGCYS3-BH6JrbP_.js → chunk-P2QGCYS3-SGZBqYWd.js} +1 -1
- package/pb_public/nors/assets/{chunk-POPQ4Y6H-XJIxFdlK.js → chunk-POPQ4Y6H-DcJcKYiy.js} +1 -1
- package/pb_public/nors/assets/{chunk-PWAF6VOD-B__l-VgZ.js → chunk-PWAF6VOD-B3ubF73c.js} +1 -1
- package/pb_public/nors/assets/{chunk-SHT3W25Y-B8vLWnR_.js → chunk-SHT3W25Y-vvRcRFqu.js} +1 -1
- package/pb_public/nors/assets/{chunk-SVP7TREG-Cjv1tk7U.js → chunk-SVP7TREG-C6Es_S0r.js} +1 -1
- package/pb_public/nors/assets/{chunk-TICWLB2K-B5znima5.js → chunk-TICWLB2K-DrKftLbE.js} +1 -1
- package/pb_public/nors/assets/classDiagram-ZZMXUADV-CXDptR1d.js +1 -0
- package/pb_public/nors/assets/classDiagram-v2-VYDZK3BY-CXDptR1d.js +1 -0
- package/pb_public/nors/assets/{cynefin-OW5HDTMX-CG0jDjpt.js → cynefin-OW5HDTMX-Btnpxygf.js} +1 -1
- package/pb_public/nors/assets/{cynefinDiagram-5FMLGOSQ-C_Ir6oea.js → cynefinDiagram-5FMLGOSQ-k51kgQ-B.js} +1 -1
- package/pb_public/nors/assets/{dagre-GXQ25YYZ-D8QhYxWu.js → dagre-GXQ25YYZ-Cs3cuZG4.js} +1 -1
- package/pb_public/nors/assets/{diagram-S7CK7UJ4-BpLSV2IE.js → diagram-S7CK7UJ4-4BhLGiaj.js} +1 -1
- package/pb_public/nors/assets/{diagram-UQ7AKVKN-CZdWRYnI.js → diagram-UQ7AKVKN-HSN5hvfb.js} +1 -1
- package/pb_public/nors/assets/{diagram-VSXAHHWV-DumOz0aB.js → diagram-VSXAHHWV-C8P7WlOX.js} +1 -1
- package/pb_public/nors/assets/{diagram-VX7I27RA-FEvMg4vC.js → diagram-VX7I27RA-CyN4rdT2.js} +1 -1
- package/pb_public/nors/assets/{diagram-Z3DM3KII-B0wSI-7M.js → diagram-Z3DM3KII-DxuGZ95A.js} +1 -1
- package/pb_public/nors/assets/{ebnfDiagram-PWID7BFC-DnVv0Jr0.js → ebnfDiagram-PWID7BFC-BV8ekp3J.js} +1 -1
- package/pb_public/nors/assets/{erDiagram-RLTQ6QDP-DRrBeVO-.js → erDiagram-RLTQ6QDP-Mx8uE8AM.js} +1 -1
- package/pb_public/nors/assets/eventmodeling-NTZA5JFV-XwcNizNP.js +1 -0
- package/pb_public/nors/assets/flowDiagram-HODETNUW-D7npSOTp.js +1 -0
- package/pb_public/nors/assets/{ganttDiagram-EL5Y4UJY-Boo75Thn.js → ganttDiagram-EL5Y4UJY-Dma-FCtx.js} +1 -1
- package/pb_public/nors/assets/{gitGraph-4MIJSDKK-DkHL0Vmb.js → gitGraph-4MIJSDKK-DHtizqGj.js} +1 -1
- package/pb_public/nors/assets/{gitGraphDiagram-WWUBYQGX-BxbzXOHt.js → gitGraphDiagram-WWUBYQGX-BCA2sf8N.js} +1 -1
- package/pb_public/nors/assets/index-CggD7ZD5.js +77 -0
- package/pb_public/nors/assets/index-_pnzcT9l.css +1 -0
- package/pb_public/nors/assets/{info-A6RAGUB7-Dm0lTq1F.js → info-A6RAGUB7-CDeXG_55.js} +1 -1
- package/pb_public/nors/assets/{infoDiagram-27XIBGKW-DqVr5vns.js → infoDiagram-27XIBGKW-BJ9SB24L.js} +1 -1
- package/pb_public/nors/assets/{ishikawaDiagram-5VMMS53U-D9UPVhhC.js → ishikawaDiagram-5VMMS53U-BcDILkPT.js} +1 -1
- package/pb_public/nors/assets/{journeyDiagram-3NMN7TZE-B_TT0UBS.js → journeyDiagram-3NMN7TZE-p6E7vL2h.js} +1 -1
- package/pb_public/nors/assets/{kanban-definition-UXKFOSKX-CYxipC8k.js → kanban-definition-UXKFOSKX-DFQ7CHVl.js} +1 -1
- package/pb_public/nors/assets/{line-CeGn86Ww.js → line-Cm4hKInN.js} +1 -1
- package/pb_public/nors/assets/{mermaid-parser.core-Bh2pMn-f.js → mermaid-parser.core-Bduruqas.js} +3 -3
- package/pb_public/nors/assets/{mermaid.core-CL8sN1KK.js → mermaid.core-BtBN7z80.js} +4 -4
- package/pb_public/nors/assets/{mindmap-definition-YA3MSWOX-DACQFk4_.js → mindmap-definition-YA3MSWOX-B-kI70Xy.js} +1 -1
- package/pb_public/nors/assets/{packet-AYTQ26CC-6s6XRIHO.js → packet-AYTQ26CC-DJCHtf_H.js} +1 -1
- package/pb_public/nors/assets/{pegDiagram-XKGWAZYB-3cpO6gJW.js → pegDiagram-XKGWAZYB-DqjJOq5a.js} +1 -1
- package/pb_public/nors/assets/{pie-WAS4IAKB-BNoU8wOh.js → pie-WAS4IAKB-BQ3vCOeu.js} +1 -1
- package/pb_public/nors/assets/{pieDiagram-E7YTZNPT-BCVRuVsN.js → pieDiagram-E7YTZNPT-CIiIZK2z.js} +1 -1
- package/pb_public/nors/assets/{quadrantDiagram-AXDQQJYC-B5ib9c-g.js → quadrantDiagram-AXDQQJYC-BnNrMjSv.js} +1 -1
- package/pb_public/nors/assets/{radar-RG4KPBEZ-7fT-y4bj.js → radar-RG4KPBEZ-COPQmxDH.js} +1 -1
- package/pb_public/nors/assets/{railroad-74A4TZTK-DfD5x0yO.js → railroad-74A4TZTK-DQ-mYa6o.js} +1 -1
- package/pb_public/nors/assets/railroad-abnf-HS5TGJTU-B7R28bHf.js +1 -0
- package/pb_public/nors/assets/railroad-ebnf-LZEXJU2U-DvhY4Bnt.js +1 -0
- package/pb_public/nors/assets/railroad-peg-WCYAUIDC-B1dhaWlf.js +1 -0
- package/pb_public/nors/assets/{railroadDiagram-O6MQD6OU-JtCr1lo_.js → railroadDiagram-O6MQD6OU-B-dWD-5-.js} +1 -1
- package/pb_public/nors/assets/{requirementDiagram-BXWQKSXE-BqStJCDF.js → requirementDiagram-BXWQKSXE-BXBGqOOo.js} +1 -1
- package/pb_public/nors/assets/{sankeyDiagram-P5KCCOFB-CX_LZnAD.js → sankeyDiagram-P5KCCOFB-Cxs240X3.js} +1 -1
- package/pb_public/nors/assets/{sequenceDiagram-WJ2MYXX4-BCudH1Kz.js → sequenceDiagram-WJ2MYXX4-DIajJjS-.js} +1 -1
- package/pb_public/nors/assets/{stateDiagram-D77RDMKH-rGlSUlYz.js → stateDiagram-D77RDMKH-DcTZSewZ.js} +1 -1
- package/pb_public/nors/assets/stateDiagram-v2-MP3YSRHH-SxUnZY4q.js +1 -0
- package/pb_public/nors/assets/{swimlanes-42K2YHIH-DKvSloZp.js → swimlanes-42K2YHIH-VYcLbc6q.js} +1 -1
- package/pb_public/nors/assets/swimlanesDiagram-VR7AAH4N-Nl2reNCg.js +8 -0
- package/pb_public/nors/assets/{timeline-definition-24CTP7MA-CELuFcfA.js → timeline-definition-24CTP7MA-R6Y5zNTL.js} +1 -1
- package/pb_public/nors/assets/{treeView-Q6P3EWNA-D5E6rNip.js → treeView-Q6P3EWNA-DXStGtQJ.js} +1 -1
- package/pb_public/nors/assets/{treemap-WGGIJYW6-CdXHwdKK.js → treemap-WGGIJYW6-Brk6Aicr.js} +1 -1
- package/pb_public/nors/assets/{vennDiagram-4TSXK5OY-ByJmWaze.js → vennDiagram-4TSXK5OY-GqAbHoJh.js} +1 -1
- package/pb_public/nors/assets/{wardley-WFR3VGLG-Bb28LKxc.js → wardley-WFR3VGLG-BWAndKh8.js} +1 -1
- package/pb_public/nors/assets/{wardleyDiagram-VM6X3IG4-CZbfB95E.js → wardleyDiagram-VM6X3IG4-7KKenvde.js} +1 -1
- package/pb_public/nors/assets/{xychartDiagram-S5SC5T6Z-BzhKhU_k.js → xychartDiagram-S5SC5T6Z-Ce-67g_s.js} +1 -1
- package/pb_public/nors/index.html +2 -2
- package/pb_public/nors/assets/architecture-7GRP2DOG-CszbBaLG.js +0 -1
- package/pb_public/nors/assets/channel-BBJC6jlq.js +0 -1
- package/pb_public/nors/assets/classDiagram-ZZMXUADV-CflNlJhy.js +0 -1
- package/pb_public/nors/assets/classDiagram-v2-VYDZK3BY-CflNlJhy.js +0 -1
- package/pb_public/nors/assets/eventmodeling-NTZA5JFV-CHTuxREV.js +0 -1
- package/pb_public/nors/assets/flowDiagram-HODETNUW-GyQBSUMm.js +0 -1
- package/pb_public/nors/assets/index-B1thqj8h.css +0 -1
- package/pb_public/nors/assets/index-CHyIcFAa.js +0 -71
- package/pb_public/nors/assets/railroad-abnf-HS5TGJTU-b8Cz753z.js +0 -1
- package/pb_public/nors/assets/railroad-ebnf-LZEXJU2U-B_O77J7F.js +0 -1
- package/pb_public/nors/assets/railroad-peg-WCYAUIDC-DY-15zgB.js +0 -1
- package/pb_public/nors/assets/stateDiagram-v2-MP3YSRHH-BYqH8M1b.js +0 -1
- package/pb_public/nors/assets/swimlanesDiagram-VR7AAH4N-XbCiub0l.js +0 -8
package/pb_public/nors/assets/{treeView-Q6P3EWNA-D5E6rNip.js → treeView-Q6P3EWNA-DXStGtQJ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{c as e}from"./mermaid-parser.core-
|
|
1
|
+
import"./chunk-FOHPRMQF-DzxwRta7.js";import{c as e}from"./mermaid-parser.core-Bduruqas.js";export{e as createTreeViewServices};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{o as e}from"./mermaid-parser.core-
|
|
1
|
+
import"./chunk-FOHPRMQF-DzxwRta7.js";import{o as e}from"./mermaid-parser.core-Bduruqas.js";export{e as createTreemapServices};
|
package/pb_public/nors/assets/{vennDiagram-4TSXK5OY-ByJmWaze.js → vennDiagram-4TSXK5OY-GqAbHoJh.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as e}from"./src-BH-TyZbA.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{H as n,K as r,U as i,a,b as o,c as s,et as c,f as l,nt as u,rt as d,tt as f,v as p,w as m,y as h}from"./chunk-DU6HZSFF-DdkkHC2K.js";import{i as g}from"./chunk-75Z2AOVW-OUM6F-Z2.js";import{t as _}from"./rough.esm-Dy-Kn_BL.js";import{f as v}from"./mermaid.core-CL8sN1KK.js";var y=(e,t)=>u(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e==="default"?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
|
|
1
|
+
import{p as e}from"./src-BH-TyZbA.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{H as n,K as r,U as i,a,b as o,c as s,et as c,f as l,nt as u,rt as d,tt as f,v as p,w as m,y as h}from"./chunk-DU6HZSFF-HXNYRQa7.js";import{i as g}from"./chunk-75Z2AOVW-JambT9gc.js";import{t as _}from"./rough.esm-Dy-Kn_BL.js";import{f as v}from"./mermaid.core-BtBN7z80.js";var y=(e,t)=>u(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e==="default"?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
|
|
2
2
|
M`,e,t),r.push(`
|
|
3
3
|
m`,-n,0),r.push(`
|
|
4
4
|
a`,n,n,0,1,0,n*2,0),r.push(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{i as e}from"./mermaid-parser.core-
|
|
1
|
+
import"./chunk-FOHPRMQF-DzxwRta7.js";import{i as e}from"./mermaid-parser.core-Bduruqas.js";export{e as createWardleyServices};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as e}from"./src-BH-TyZbA.js";import{n as t}from"./mermaid-parser.core-
|
|
1
|
+
import{m as e}from"./src-BH-TyZbA.js";import{n as t}from"./mermaid-parser.core-Bduruqas.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{D as r,H as i,K as a,U as o,a as s,b as c,c as l,v as u,w as d,x as f,y as p}from"./chunk-DU6HZSFF-HXNYRQa7.js";import{i as m}from"./chunk-75Z2AOVW-JambT9gc.js";import{t as h}from"./chunk-JWPE2WC7-DVXcaiue.js";import{f as g}from"./mermaid.core-BtBN7z80.js";var _=n((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=n((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=n(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=n(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=n((e,t)=>{if(h(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:n(async n=>{let r=await t(`wardley`,n);e.debug(r);let i=S.parser?.yy;if(!i||typeof i.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);x(r,i)},`parse`)},C=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{n(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function w(){return f()[`wardley-beta`]}n(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}n(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}n(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}n(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}n(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}n(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}n(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}n(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}n(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}n(N,`setSize`);function P(e){C.startPipeline(e)}n(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}n(F,`addPipelineComponent`);function I(e){C.setAxes(e)}n(I,`updateAxes`);function L(e){return C.getNode(e)}n(L,`getNode`);function R(e){return C.resolveNodeId(e)}n(R,`resolveNodeId`);function z(){return C.build()}n(z,`getWardleyData`);function B(){C.clear(),s()}n(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:o,getAccTitle:p,setDiagramTitle:a,getDiagramTitle:d,getAccDescription:u,setAccDescription:i},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=n(()=>{let{themeVariables:e}=f();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=n(()=>{let e=f()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:n((t,r,i,a)=>{e.debug(`Rendering Wardley map
|
|
2
2
|
`+t);let o=W(),s=U(),c=o.nodeRadius*1.6,u=a.db,d=u.getWardleyData(),f=u.getDiagramTitle(),p=d.size?.width??o.width,m=d.size?.height??o.height,h=g(r);h.selectAll(`*`).remove(),l(h,m,p,o.useMaxWidth),h.attr(`viewBox`,`0 0 ${p} ${m}`);let _=h.append(`g`).attr(`class`,`wardley-map`),v=h.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,p).attr(`height`,m).attr(`fill`,s.backgroundColor);let y=p-o.padding*2,b=m-o.padding*2;f&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,p/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let x=n(e=>o.padding+e/100*y,`projectX`),S=n(e=>m-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,m-o.padding).attr(`y2`,m-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,m-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,m-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:H;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,m-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,m-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,m-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,m-o.padding-b*n).attr(`y2`,m-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,l=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),l=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=l-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-c/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-c/2).attr(`y`,e=>D.get(e.id).y-c/2).attr(`width`,c).attr(`height`,c).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=p-o.padding-l,h=o.padding,g=m-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(h,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
|
|
3
3
|
M ${n} ${r-15}
|
|
4
4
|
L ${n+60-20} ${r-15}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as e}from"./src-BH-TyZbA.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-DU6HZSFF-
|
|
1
|
+
import{m as e}from"./src-BH-TyZbA.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-DU6HZSFF-HXNYRQa7.js";import{t as m}from"./linear-B6A2FQ2q.js";import{t as h}from"./ordinal-BDEzSJ7C.js";import{t as g}from"./init-C-OQMol4.js";import{i as _}from"./chunk-75Z2AOVW-JambT9gc.js";import{t as v}from"./line-Cm4hKInN.js";import"./chunk-PWAF6VOD-B3ubF73c.js";import{t as y}from"./chunk-GMAD6QVW-BgHQEQ7R.js";import{f as b}from"./mermaid.core-BtBN7z80.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s]}},`anonymous`),table:[e(n,r,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},e(n,r,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),e(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,36]),e(c,[2,37]),e(c,[2,38]),{1:[2,1]},e(n,r,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},e(c,[2,5]),e(n,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),e(E,[2,40]),e(E,[2,41]),e(D,[2,42]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(D,[2,52]),e(D,[2,53]),e(T,[2,10]),e(T,[2,24],{32:41,31:56,24:x,29:S}),e(T,[2,26]),e(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,11]),e(T,[2,32],{35:60,29:C}),e(T,[2,34]),{33:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},e(T,[2,14]),{17:66,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,43]),e(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(T,[2,33]),{29:[1,70]},e(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(k,[2,23],{30:[1,73]}),e(T,[2,15]),e(T,[2,28]),e(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,35]),e(T,[2,19]),{25:75,27:64,29:O},e(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};A.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<meta name="theme-color" content="#0B0D10" />
|
|
8
8
|
<title>Nors</title>
|
|
9
|
-
<script type="module" crossorigin src="/nors/assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/nors/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/nors/assets/index-CggD7ZD5.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/nors/assets/index-_pnzcT9l.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{M as e}from"./mermaid-parser.core-Bh2pMn-f.js";export{e as createArchitectureServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at as e,ot as t}from"./chunk-DU6HZSFF-DdkkHC2K.js";var n=(n,r)=>t.lang.round(e.parse(n)[r]);export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./src-BH-TyZbA.js";import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./chunk-DU6HZSFF-DdkkHC2K.js";import"./chunk-75Z2AOVW-OUM6F-Z2.js";import"./chunk-PWAF6VOD-B__l-VgZ.js";import"./chunk-GMAD6QVW-CZU7s-_u.js";import"./chunk-P2QGCYS3-BH6JrbP_.js";import"./chunk-4HAMMTFA-CQW8auRW.js";import"./chunk-GVQU2GXP-BQGI6BgU.js";import"./chunk-OSK3NFVY-puWVIqFn.js";import"./chunk-F27PBJKO-D4tBKW95.js";import"./chunk-XXDRQBXY-DFBUG-OT.js";import"./chunk-POPQ4Y6H-XJIxFdlK.js";import"./chunk-L3NEJ4N5-OjXnRmPt.js";import{i as t,n,r,t as i}from"./chunk-TICWLB2K-B5znima5.js";import"./mermaid.core-CL8sN1KK.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./src-BH-TyZbA.js";import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./chunk-DU6HZSFF-DdkkHC2K.js";import"./chunk-75Z2AOVW-OUM6F-Z2.js";import"./chunk-PWAF6VOD-B__l-VgZ.js";import"./chunk-GMAD6QVW-CZU7s-_u.js";import"./chunk-P2QGCYS3-BH6JrbP_.js";import"./chunk-4HAMMTFA-CQW8auRW.js";import"./chunk-GVQU2GXP-BQGI6BgU.js";import"./chunk-OSK3NFVY-puWVIqFn.js";import"./chunk-F27PBJKO-D4tBKW95.js";import"./chunk-XXDRQBXY-DFBUG-OT.js";import"./chunk-POPQ4Y6H-XJIxFdlK.js";import"./chunk-L3NEJ4N5-OjXnRmPt.js";import{i as t,n,r,t as i}from"./chunk-TICWLB2K-B5znima5.js";import"./mermaid.core-CL8sN1KK.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{O as e}from"./mermaid-parser.core-Bh2pMn-f.js";export{e as createEventModelingServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./src-BH-TyZbA.js";import"./chunk-DU6HZSFF-DdkkHC2K.js";import"./chunk-75Z2AOVW-OUM6F-Z2.js";import"./chunk-PWAF6VOD-B__l-VgZ.js";import"./chunk-GMAD6QVW-CZU7s-_u.js";import"./chunk-P2QGCYS3-BH6JrbP_.js";import"./chunk-4HAMMTFA-CQW8auRW.js";import"./chunk-GVQU2GXP-BQGI6BgU.js";import"./chunk-OSK3NFVY-puWVIqFn.js";import"./chunk-F27PBJKO-D4tBKW95.js";import"./chunk-XXDRQBXY-DFBUG-OT.js";import"./chunk-POPQ4Y6H-XJIxFdlK.js";import"./chunk-L3NEJ4N5-OjXnRmPt.js";import{n as e}from"./chunk-SHT3W25Y-B8vLWnR_.js";import"./mermaid.core-CL8sN1KK.js";export{e as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
html,body,#root{height:100%}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#0b0d10;--panel:#12151a;--ink:#e8eef5;--muted:#8b98a8;--accent:#6ec8ff;--tint:#b9e4ff;--line:#1e2430;--danger:#ff7b7b;background:var(--bg);color:var(--ink);font-family:IBM Plex Sans,Segoe UI,system-ui,sans-serif;line-height:1.45}*{box-sizing:border-box}body{background:var(--bg);min-height:100vh;margin:0}.shell{max-width:960px;margin:0 auto;padding:1.25rem 1rem 3rem}.top{justify-content:space-between;align-items:center;margin-bottom:1.5rem;display:flex}.brand{color:inherit;align-items:center;gap:.7rem;text-decoration:none;display:flex}.brand img{border-radius:7px;flex:none;width:30px;height:30px}.brand h1{letter-spacing:-.01em;margin:0;font-size:1.2rem;font-weight:650}.center-page{justify-content:center;align-items:center;min-height:70vh;display:flex}.login{background:var(--panel);border:1px solid var(--line);border-radius:8px;gap:.75rem;width:100%;max-width:360px;margin:0 auto;padding:1.25rem;display:grid}.login h2{margin:0}.login label{color:var(--muted);gap:.35rem;font-size:.85rem;display:grid}.login input{border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:6px;padding:.55rem .65rem}button,.button-link,.view-link{border:1px solid color-mix(in srgb, var(--accent) 48%, var(--line));background:var(--panel);height:40px;min-height:40px;color:var(--tint);white-space:nowrap;cursor:pointer;border-radius:6px;justify-content:center;align-items:center;gap:8px;padding:0 14px;font-family:inherit;font-size:14px;font-weight:600;line-height:1;text-decoration:none;display:inline-flex}button:hover,.button-link:hover,.view-link:hover{background:color-mix(in srgb, var(--panel) 82%, var(--accent))}button>svg,.button-link>svg,.view-link>svg{flex:none;width:16px;height:16px}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important}}button:disabled{opacity:.6;cursor:wait}button.ghost{background:var(--panel);color:var(--ink);border:1px solid var(--line)}button.icononly{justify-content:center;align-items:center;width:36px;height:36px;min-height:36px;padding:0;display:inline-flex}button.muted{background:var(--panel);color:var(--ink);border:1px solid var(--line);font-weight:550}.tabs{flex-wrap:wrap;gap:.5rem;margin:0 0 1rem;display:flex}.tabs button{background:var(--panel);height:34px;min-height:34px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:0 13px;font-size:13px;font-weight:500}.tabs button.on{color:var(--tint);border-color:var(--accent)}.hint,.empty{color:var(--muted);font-size:.9rem}.error{color:var(--danger);margin:0;font-size:.85rem}.toast-region{z-index:200;pointer-events:none;width:min(380px,100vw - 2rem);position:fixed;top:1rem;right:1rem}.toast{border:1px solid var(--line);background:color-mix(in srgb, var(--panel) 94%, black);min-height:52px;color:var(--ink);pointer-events:auto;border-radius:9px;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.7rem;padding:.65rem .65rem .65rem .85rem;font-size:.88rem;line-height:1.4;animation:.16s ease-out toast-in;display:grid;box-shadow:0 14px 38px #000a}.toast-error{border-color:color-mix(in srgb, var(--danger) 42%, var(--line))}.toast-error>svg{color:var(--danger);flex:none}button.toast-close{width:32px;height:32px;min-height:32px;color:var(--muted);background:0 0;border-color:#0000;padding:0}button.toast-close:hover{border-color:var(--line);background:var(--bg);color:var(--ink)}@keyframes toast-in{0%{opacity:0;transform:translateY(-6px)}}.dash-head{justify-content:space-between;align-items:center;margin-bottom:1rem;display:flex}.dash-head h2{color:var(--muted);text-transform:uppercase;letter-spacing:.08em;margin:0;font-size:1rem;font-weight:500}.cards{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:.75rem;margin:0;padding:0;list-style:none;display:grid}.card{background:var(--panel);border:1px solid var(--line);border-radius:8px;min-height:140px;padding:.9rem 1rem}.card.pinned{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.card.draft{opacity:.85}.card-top{text-transform:uppercase;letter-spacing:.06em;color:var(--muted);justify-content:space-between;gap:.5rem;margin-bottom:.4rem;font-size:.7rem;display:flex}.card h3{margin:0 0 .35rem;font-size:1.05rem}.card p{color:var(--muted);margin:0 0 .75rem;font-size:.9rem}.slug{color:var(--accent);font-size:.75rem}.row{align-items:center;gap:.5rem;display:flex}.card-link{color:inherit;text-decoration:none;display:block}.crumbs{flex-wrap:wrap;align-items:center;gap:.75rem;margin-bottom:1rem;display:flex}.crumbs a{color:var(--accent);text-decoration:none}.crumbs .spacer{flex:1}.editor-nav{gap:.4rem}.view-link{border:1px solid color-mix(in srgb, var(--accent) 32%, var(--line));background:var(--panel);color:var(--tint)!important}.view-link:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));background:var(--panel)}.pinbtn{width:40px;height:40px;min-height:40px;color:var(--muted);background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;padding:0;display:flex}.pinbtn:hover{color:var(--tint);background:var(--bg)}.pinbtn.on{color:var(--accent)}.pinbtn svg{width:17px;height:17px}.editor h2{margin:0 0 1rem}.reader-nav{justify-content:space-between;align-items:center;gap:1rem;margin-bottom:2.5rem;display:flex}.back-link{color:var(--muted);align-items:center;gap:.3rem;font-size:.9rem;font-weight:550;text-decoration:none;display:inline-flex}.back-link:hover{color:var(--tint)}.reader-actions{align-items:center;gap:.5rem;display:flex}.button-link,button.danger-ghost{min-width:112px}.button-link{background:var(--panel);color:var(--tint);border:1px solid color-mix(in srgb, var(--accent) 48%, var(--line))}.button-link:hover{background:color-mix(in srgb, var(--panel) 82%, var(--accent));border-color:var(--accent)}button.danger-ghost{background:var(--panel);color:var(--muted);border:1px solid var(--line)}button.danger-ghost:hover{color:var(--danger);border-color:color-mix(in srgb, var(--danger) 30%, transparent);background:color-mix(in srgb, var(--danger) 8%, transparent)}.dialog-backdrop{z-index:100;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#030508b8;place-items:center;padding:1rem;display:grid;position:fixed;inset:0}.confirm-dialog{border:1px solid var(--line);background:var(--panel);border-radius:12px;grid-template-columns:auto 1fr;gap:.9rem;width:min(100%,430px);padding:1.25rem;display:grid;box-shadow:0 24px 80px #000b}.dialog-icon{border:1px solid color-mix(in srgb, var(--danger) 32%, var(--line));background:color-mix(in srgb, var(--danger) 8%, var(--panel));width:42px;height:42px;color:var(--danger);border-radius:10px;place-items:center;display:grid}.dialog-copy h2{margin:0 0 .35rem;font-size:1.05rem}.dialog-copy p{color:var(--muted);margin:0;font-size:.9rem;line-height:1.55}.dialog-copy strong{color:var(--ink);font-weight:600}.dialog-actions{grid-column:1/-1;justify-content:flex-end;gap:.5rem;margin-top:.35rem;display:flex}.dialog-actions button{min-width:112px}button.danger-confirm{color:#ffd5d5;border-color:color-mix(in srgb, var(--danger) 58%, var(--line));background:color-mix(in srgb, var(--danger) 10%, var(--panel))}button.danger-confirm:hover{border-color:var(--danger);background:color-mix(in srgb, var(--danger) 16%, var(--panel))}.reader-document{max-width:76ch;margin:0 auto}.reader-head{border-bottom:1px solid var(--line);padding-bottom:1.75rem}.reader-badges{align-items:center;gap:.45rem;margin-bottom:.8rem;display:flex}.badge{border:1px solid var(--line);min-height:24px;color:var(--muted);letter-spacing:.055em;text-transform:uppercase;border-radius:999px;align-items:center;padding:.15rem .55rem;font-size:.68rem;font-weight:650;display:inline-flex}.badge.kind{color:var(--tint);border-color:color-mix(in srgb, var(--accent) 35%, var(--line));background:color-mix(in srgb, var(--accent) 7%, transparent)}.badge.status.draft{color:#f2c97d;border-color:color-mix(in srgb, #f2c97d 32%, var(--line))}.reader-head h1{letter-spacing:-.035em;max-width:22ch;margin:0;font-size:clamp(2rem,5vw,3rem);line-height:1.08}.reader-summary{color:#b3bfcc;max-width:60ch;margin:.85rem 0 0;font-size:1.05rem;line-height:1.55}.reader-details{color:var(--muted);flex-wrap:wrap;align-items:center;gap:.45rem;margin-top:1.1rem;font-size:.78rem;display:flex}.reader-tags{flex-wrap:wrap;gap:.4rem;display:flex}.tag{color:var(--accent)}.draft-notice{background:color-mix(in srgb, #f2c97d 7%, var(--panel));color:#d6bd8d;border-left:3px solid #f2c97d;border-radius:0 6px 6px 0;margin-top:1.5rem;padding:.7rem .85rem;font-size:.88rem}.reader-prose{margin-top:2rem}.prose{max-width:72ch}.prose>:first-child{margin-top:0}.prose h1,.prose h2,.prose h3{letter-spacing:-.015em;margin-top:1.8em;margin-bottom:.55em;line-height:1.25}.prose p,.prose li{color:#d3dbe4;line-height:1.72}.prose a{color:var(--accent)}.prose blockquote{border-left:3px solid var(--line);color:var(--muted);margin-left:0;padding-left:1rem}.prose pre{background:var(--panel);border:1px solid var(--line);border-radius:6px;padding:.75rem 1rem;overflow-x:auto}.prose code{font-size:.85em}.prose table{border-collapse:collapse}.prose th,.prose td{border:1px solid var(--line);padding:.25rem .75rem}.editor label{gap:.25rem;margin-bottom:.75rem;display:grid}.editor input,.editor select,.editor textarea{background:var(--panel);border:1px solid var(--line);color:var(--ink);font:inherit;border-radius:6px;padding:.5rem .75rem}.editor input,.editor select{height:2.5rem}.editor textarea{resize:vertical;font-family:ui-monospace,monospace}.card.dragging{opacity:.4}.card.drop{border-color:var(--accent)}.avatar-wrap{position:relative}.avatar{background:var(--panel);width:44px;min-width:44px;height:44px;color:var(--ink);border:1px solid var(--line);border-radius:50%;padding:0;font-weight:650}.avatar[aria-expanded=true]{border-color:var(--accent)}.menu{z-index:20;background:var(--panel);border:1px solid var(--line);border-radius:10px;min-width:210px;padding:6px;position:absolute;top:calc(100% + 8px);right:0;box-shadow:0 14px 34px #000a}.menu button{width:100%;min-height:0;color:var(--ink);text-align:left;background:0 0;border-radius:6px;padding:.5rem .75rem;font-weight:500;display:flex}.menu button:hover{background:var(--bg)}.menu button.out{color:var(--danger)}.menu-sep{background:var(--line);height:1px;margin:6px 4px}.menu-mail{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;margin:0;padding:.5rem .75rem;font-size:.8rem;overflow:hidden}.editor input.doctitle{letter-spacing:-.02em;width:100%;color:var(--ink);background:0 0;border:0;border-radius:0;height:auto;margin:0 0 .75rem;padding:.25rem 0;font-size:1.75rem;font-weight:700}.editor input.doctitle:focus{outline:none}.editor input.doctitle::placeholder{color:var(--muted);opacity:.55}.kindpills{margin-bottom:1rem}.iconbar{border-top:1px solid var(--line);border-bottom:1px solid var(--line);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem .75rem;margin-bottom:1rem;padding:.35rem 0;display:flex}.icons{align-items:center;gap:.3rem;display:flex}.icons button{width:36px;height:36px;min-height:36px;color:var(--muted);background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;padding:0;font-size:.95rem;font-weight:700;display:flex}.icons button:hover{color:var(--tint);background:var(--bg)}.icons button svg{width:16px;height:16px}.icons .glyph{font-size:.9rem}.minitabs{gap:.25rem;display:flex}.minitabs button{height:32px;min-height:32px;color:var(--muted);background:0 0;border:0;border-radius:6px;padding:0 10px;font-size:.85rem;font-weight:600}.minitabs button.on{color:var(--tint);background:var(--bg)}.edit-foot{justify-content:flex-end;gap:.5rem;margin-top:1rem;display:flex}.edit-foot button{min-width:132px}.editor textarea.doctext{width:100%;min-height:22vh;color:var(--ink);resize:vertical;background:0 0;border:0;border-radius:0;padding:.25rem 0;font-family:ui-monospace,monospace;font-size:.95rem;line-height:1.65}.editor textarea.doctext:focus{outline:none}.editor textarea.doctext::placeholder{color:var(--muted);opacity:.55}.prose.preview{background:var(--panel);border:1px solid var(--line);border-radius:6px;min-height:200px;padding:.75rem 1rem}.empty-wrap{text-align:center;color:var(--muted);padding:3rem 1rem}.empty-wrap svg{color:var(--muted);opacity:.7;margin:0 auto 1rem;display:block}.spin-wrap{justify-content:center;padding:2.5rem 0;display:flex}.spin{border:3px solid var(--line);border-top-color:var(--accent);border-radius:50%;width:28px;height:28px;animation:.8s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.empty-wrap p{margin:0 0 1rem}@media (max-width:600px){.shell{padding-inline:.9rem}.reader-nav{flex-wrap:wrap;align-items:stretch;margin-bottom:2rem}.reader-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:.25rem;width:100%;display:grid}.button-link,button.danger-ghost{width:100%;min-width:0}.reader-head h1{font-size:2rem}.detail-separator{display:none}.reader-tags{flex-basis:100%}}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CL8sN1KK.js","assets/src-BH-TyZbA.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/chunk-DU6HZSFF-DdkkHC2K.js","assets/chunk-75Z2AOVW-OUM6F-Z2.js","assets/dist-DTg6UBE_.js","assets/chunk-PWAF6VOD-B__l-VgZ.js","assets/chunk-GMAD6QVW-CZU7s-_u.js","assets/chunk-P2QGCYS3-BH6JrbP_.js","assets/chunk-4HAMMTFA-CQW8auRW.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-GVQU2GXP-BQGI6BgU.js","assets/chunk-OSK3NFVY-puWVIqFn.js","assets/line-CeGn86Ww.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/graphlib-DS17s2tU.js","assets/chunk-L3NEJ4N5-OjXnRmPt.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-track`),a={equals:r},o=null,s=ce,c=1,l=2,u={owned:null,cleanups:null,context:null,owner:null},d={},f=null,p=null,m=null,h=null,g=null,_=0;function v(e,t){let n=m,r=f,i=e.length===0,a=t===void 0?r:t,o=i?u:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>T(()=>P(o)));f=o,m=null;try{return N(s,!0)}finally{m=n,f=r}}function y(e,t){t=t?Object.assign({},a,t):a;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[ae.bind(n),e=>(typeof e==`function`&&(e=p&&p.running&&p.sources.has(n)?e(n.tValue):e(n.value)),k(n,e))]}function b(e,t,n){A(j(e,t,!0,c))}function x(e,t,n){A(j(e,t,!1,c))}function S(e,t,n){s=le;let r=j(e,t,!1,c),i=ie&&O(ie);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),g?g.push(r):A(r)}function C(e,t,n){n=n?Object.assign({},a,n):a;let r=j(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,A(r),ae.bind(r)}function ee(e){return e&&typeof e==`object`&&`then`in e}function w(t,n,r){let i,a,o;typeof n==`function`?(i=t,a=n,o=r||{}):(i=!0,a=t,o=n||{});let s=null,c=d,l=null,u=!1,h=!1,g=`initialValue`in o,_=typeof i==`function`&&C(i),v=new Set,[x,S]=(o.storage||y)(o.initialValue),[w,te]=y(void 0),[ne,re]=y(void 0,{equals:!1}),[ae,k]=y(g?`ready`:`unresolved`);f&&E(()=>{for(let e of v.keys())e.decrement();v.clear(),p&&s&&p.promises.delete(s),s=null}),e.context&&(l=e.getNextContextId(),o.ssrLoadFrom===`initial`?c=o.initialValue:e.load&&e.has(l)&&(c=e.load(l)));function A(e,t,n,r){return s===e&&(s=null,r!==void 0&&(g=!0),(e===c||t===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(r,{value:t})),c=d,p&&e&&u?(p.promises.delete(e),u=!1,N(()=>{p.running=!0,oe(t,n)},!1)):oe(t,n)),t}function oe(e,t){N(()=>{t===void 0&&S(()=>e),k(t===void 0?g?`ready`:`unresolved`:`errored`),te(t);for(let e of v.keys())e.decrement();v.clear()},!1)}function j(){let e=ie&&O(ie),t=x(),n=w();if(n!==void 0&&!s)throw n;return m&&!m.user&&e&&b(()=>{ne(),s&&(e.resolved&&p&&u?p.promises.add(s):v.has(e)||(e.increment(),v.add(e)))}),t}function M(e=!0){if(e!==!1&&h)return;h=!1;let t=_?_():i;if(u=p&&p.running,t==null||t===!1){A(s,T(x));return}p&&s&&p.promises.delete(s);let n,r=c===d?T(()=>{try{return a(t,{value:x(),refetching:e})}catch(e){n=e}}):c;if(n!==void 0){A(s,void 0,pe(n),t);return}return ee(r)?(s=r,`v`in r?(r.s===1?A(s,r.v,void 0,t):A(s,void 0,pe(r.v),t),r):(h=!0,queueMicrotask(()=>h=!1),N(()=>{k(g?`refreshing`:`pending`),re()},!1),r.then(e=>A(r,e,void 0,t),e=>A(r,void 0,pe(e),t)))):(A(s,r,void 0,t),r)}Object.defineProperties(j,{state:{get:()=>ae()},error:{get:()=>w()},loading:{get(){let e=ae();return e===`pending`||e===`refreshing`}},latest:{get(){if(!g)return j();let e=w();if(e&&!s)throw e;return x()}}});let se=f;return _?b(()=>(se=f,M(!1))):M(!1),[j,{refetch:e=>D(se,()=>M(e)),mutate:S}]}function T(e){if(m===null)return e();let t=m;m=null;try{return e()}finally{m=t}}function te(e){S(()=>T(e))}function E(e){return f===null||(f.cleanups===null?f.cleanups=[e]:f.cleanups.push(e)),e}function D(e,t){let n=f,r=m;f=e,m=null;try{return N(t,!0)}catch(e){he(e)}finally{f=n,m=r}}var[ne,re]=y(!1);function O(e){let t;return f&&f.context&&(t=f.context[e.id])!==void 0?t:e.defaultValue}var ie;function ae(){let e=p&&p.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===c)A(this);else{let e=h;h=null,N(()=>ue(this),!1),h=e}}if(m){let e=this.observers;if(!e||e[e.length-1]!==m){let t=e?e.length:0;m.sources?(m.sources.push(this),m.sourceSlots.push(t)):(m.sources=[this],m.sourceSlots=[t]),e?(e.push(m),this.observerSlots.push(m.sources.length-1)):(this.observers=[m],this.observerSlots=[m.sources.length-1])}}return e&&p.sources.has(this)?this.tValue:this.value}function k(e,t,n){let r=p&&p.running&&p.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(p){let r=p.running;(r||!n&&p.sources.has(e))&&(p.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&N(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=p&&p.running;r&&p.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?h.push(n):g.push(n),n.observers&&de(n)),r?n.tState=c:n.state=c)}if(h.length>1e6)throw h=[],Error()},!1)}return t}function A(e){if(!e.fn)return;P(e);let t=_;oe(e,p&&p.running&&p.sources.has(e)?e.tValue:e.value,t),p&&!p.running&&p.sources.has(e)&&queueMicrotask(()=>{N(()=>{p&&(p.running=!0),m=f=e,oe(e,e.tValue,t),m=f=null},!1)})}function oe(e,t,n){let r,i=f,a=m;m=f=e;try{r=e.fn(t)}catch(t){return e.pure&&(p&&p.running?(e.tState=c,e.tOwned&&e.tOwned.forEach(P),e.tOwned=void 0):(e.state=c,e.owned&&e.owned.forEach(P),e.owned=null)),e.updatedAt=n+1,he(t)}finally{m=a,f=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?k(e,r,!0):p&&p.running&&e.pure?(p.sources.has(e)||(e.value=r),p.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function j(e,t,n,r=c,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:f,context:f?f.context:null,pure:n};return p&&p.running&&(a.state=0,a.tState=r),f===null||f!==u&&(p&&p.running&&f.pure?f.tOwned?f.tOwned.push(a):f.tOwned=[a]:f.owned?f.owned.push(a):f.owned=[a]),a}function M(e){let t=p&&p.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===l)return ue(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<_);){if(t&&p.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(p.disposed.has(t))return}if((t?e.tState:e.state)===c)A(e);else if((t?e.tState:e.state)===l){let t=h;h=null,N(()=>ue(e,n[0]),!1),h=t}}}function N(e,t){if(h)return e();let n=!1;t||(h=[]),g?n=!0:g=[],_++;try{let t=e();return se(n),t}catch(e){n||(g=null),h=null,he(e)}}function se(e){if(h&&=(ce(h),null),e)return;let t;if(p){if(!p.promises.size&&!p.queue.size){let e=p.sources,n=p.disposed;g.push.apply(g,p.effects),t=p.resolve;for(let e of g)`tState`in e&&(e.state=e.tState),delete e.tState;p=null,N(()=>{for(let e of n)P(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)P(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}re(!1)},!1)}else if(p.running){p.running=!1,p.effects.push.apply(p.effects,g),g=null,re(!0);return}}let n=g;g=null,n.length&&N(()=>s(n),!1),t&&t()}function ce(e){for(let t=0;t<e.length;t++)M(e[t])}function le(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:M(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)M(t[r])}function ue(e,t){let n=p&&p.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===c?i!==t&&(!i.updatedAt||i.updatedAt<_)&&M(i):e===l&&ue(i,t)}}}function de(e){let t=p&&p.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=l:r.state=l,r.pure?h.push(r):g.push(r),r.observers&&de(r))}}function P(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)P(e.tOwned[t]);delete e.tOwned}if(p&&p.running&&e.pure)fe(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)P(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}p&&p.running?e.tState=0:e.state=0}function fe(e,t){if(t||(e.tState=0,p.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)fe(e.owned[t])}function pe(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function me(e,t,n){try{for(let n of t)n(e)}catch(e){he(e,n&&n.owner||null)}}function he(e,t=f){let n=o&&t&&t.context&&t.context[o],r=pe(e);if(!n)throw r;g?g.push({fn(){me(r,n,t)},state:c}):me(r,n,t)}var ge=Symbol(`fallback`);function _e(e){for(let t=0;t<e.length;t++)e[t]()}function ve(e,t,n={}){let r=[],a=[],o=[],s=0,c=t.length>1?[]:null;return E(()=>_e(o)),()=>{let l=e()||[],u=l.length,d,f;return l[i],T(()=>{let e,t,i,m,h,g,_,y,b;if(u===0)s!==0&&(_e(o),o=[],r=[],a=[],s=0,c&&=[]),n.fallback&&(r=[ge],a[0]=v(e=>(o[0]=e,n.fallback())),s=1);else if(s===0){for(a=Array(u),f=0;f<u;f++)r[f]=l[f],a[f]=v(p);s=u}else{for(i=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,y=u-1;_>=g&&y>=g&&r[_]===l[y];_--,y--)i[y]=a[_],m[y]=o[_],c&&(h[y]=c[_]);for(e=new Map,t=Array(y+1),f=y;f>=g;f--)b=l[f],d=e.get(b),t[f]=d===void 0?-1:d,e.set(b,f);for(d=g;d<=_;d++)b=r[d],f=e.get(b),f!==void 0&&f!==-1?(i[f]=a[d],m[f]=o[d],c&&(h[f]=c[d]),f=t[f],e.set(b,f)):o[d]();for(f=g;f<u;f++)f in i?(a[f]=i[f],o[f]=m[f],c&&(c[f]=h[f],c[f](f))):a[f]=v(p);a=a.slice(0,s=u),r=l.slice(0)}return a});function p(e){if(o[f]=e,c){let[e,n]=y(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function F(e,t){return T(()=>e(t||{}))}var ye=e=>`Stale read from <${e}>.`;function be(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return C(ve(()=>e.each,e.children,t||void 0))}function I(e){let t=e.keyed,n=C(()=>e.when,void 0,void 0),r=t?n:C(n,void 0,{equals:(e,t)=>!e==!t});return C(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw ye(`Show`);return n()})):a}return e.fallback},void 0,void 0)}var xe=e=>C(()=>e());function Se(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var Ce=`_$DX_DELEGATE`;function we(e,t,n,r={}){let i;return v(r=>{i=r,t===document?e():z(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function L(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>T(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function Te(e,t=window.document){let n=t[Ce]||(t[Ce]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,ke))}}function R(e,t,n){Oe(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Ee(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function De(e,t,n){return T(()=>e(t,n))}function z(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Ae(e,t,r,n);x(r=>Ae(e,t(),r,n),r)}function Oe(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function ke(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};if(Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0),t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}function Ae(e,t,n,r,i){let a=Oe(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=B(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=B(e,n,r)}else if(o===`function`)return x(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Ae(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(je(o,t,n,i))return x(()=>n=Ae(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=B(e,n,r),s)return n}else c?n.length===0?Me(e,o,r):Se(e,n,o):(n&&B(e),Me(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=B(e,n,r,t);B(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function je(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=je(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=je(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function Me(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function B(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}var Ne=`nors_pb_token`,Pe=`nors_pb_user`,Fe=[`diagram`,`runbook`,`reference`,`scratch`],Ie={diagram:`Diagram`,runbook:`Runbook`,reference:`Reference`,scratch:`Scratch`};function Le(){return``}function Re(){return localStorage.getItem(Ne)}function ze(){localStorage.removeItem(Ne),localStorage.removeItem(Pe)}async function Be(e,t){let n=await fetch(`${Le()}/api/collections/_superusers/auth-with-password`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({identity:e,password:t})});if(!n.ok){let e=await n.text();throw Error(e||`login failed (${n.status})`)}let r=await n.json();localStorage.setItem(Ne,r.token),localStorage.setItem(Pe,JSON.stringify(r.record))}function Ve(){let e=Re();if(!e)throw Error(`not authenticated`);return{Authorization:e,"Content-Type":`application/json`}}async function He(e){let t=e?.includeDrafts?`status != "archived"`:`status = "published"`,n=new URLSearchParams({filter:t,sort:`-pinned,sort,updated`,perPage:`200`}),r=await fetch(`${Le()}/api/collections/nors_notes/records?${n}`,{headers:Ve()});if(r.status===401)throw ze(),Error(`session expired`);if(!r.ok)throw Error(`list failed (${r.status})`);return(await r.json()).items.map(Ke)}async function Ue(e){let t=new URLSearchParams({filter:`slug = "${e}"`}),n=await fetch(`${Le()}/api/collections/nors_notes/records?${t}`,{headers:Ve()});if(n.status===401)throw ze(),Error(`session expired`);if(!n.ok)throw Error(`get failed (${n.status})`);let r=await n.json();if(r.items.length===0)throw Error(`no note: ${e}`);return Ke(r.items[0])}async function We(e,t){let n=await fetch(`${Le()}/api/collections/nors_notes/records${t?`/${t}`:``}`,{method:t?`PATCH`:`POST`,headers:Ve(),body:JSON.stringify(e)});if(n.status===401)throw ze(),Error(`session expired`);if(!n.ok){let e=await n.text();throw Error(e||`save failed (${n.status})`)}return Ke(await n.json())}async function Ge(e){let t=await fetch(`${Le()}/api/collections/nors_notes/records/${e}`,{method:`DELETE`,headers:Ve()});if(t.status===401)throw ze(),Error(`session expired`);if(!t.ok){let e=await t.text();throw Error(e||`delete failed (${t.status})`)}}function Ke(e){let t=e.tags;return{id:String(e.id),title:String(e.title??``),slug:String(e.slug??``),summary:String(e.summary??``),body:String(e.body??``),kind:e.kind||`scratch`,tags:Array.isArray(t)?t:[],pinned:!!e.pinned,status:e.status||`draft`,sort:Number(e.sort??0),updated:String(e.updated??``)}}var qe=`$new`;function Je(e){let t=e.replace(/^#\/?/,``).split(`/`);return t[0]===`n`&&t[1]?{name:`read`,slug:decodeURIComponent(t[1])}:t[0]===`edit`&&t[1]?{name:`edit`,slug:decodeURIComponent(t[1])}:{name:`dash`}}function Ye(e){location.hash=e}function Xe(){let[e,t]=y(Je(location.hash));return te(()=>{let e=()=>t(Je(location.hash));window.addEventListener(`hashchange`,e),E(()=>window.removeEventListener(`hashchange`,e))}),e}var Ze=L(`<div class=toast-region aria-live=assertive aria-atomic=true><div class="toast toast-error"role=alert><svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><circle cx=12 cy=12 r=10></circle><path d="M12 8v4M12 16h.01"></path></svg><span></span><button type=button class=toast-close aria-label="Dismiss notification"><svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round aria-hidden=true><path d="m18 6-12 12M6 6l12 12">`),Qe=e=>(S(()=>{if(!e.message)return;let t=window.setTimeout(e.onDismiss,4500);E(()=>window.clearTimeout(t))}),F(I,{get when(){return e.message},get children(){var t=Ze(),n=t.firstChild.firstChild.nextSibling,r=n.nextSibling;return z(n,()=>e.message),Ee(r,`click`,e.onDismiss,!0),t}}));Te([`click`]);var $e=L(`<div class=spin-wrap role=status aria-label=Loading><span class=spin>`),et=L(`<p class=hint>Saving order…`),tt=L(`<div class=empty-wrap><svg width=72 height=56 viewBox="0 0 72 56"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><ellipse cx=36 cy=46 rx=22 ry=5></ellipse><ellipse cx=36 cy=36 rx=15 ry=6></ellipse><ellipse cx=36 cy=26 rx=10 ry=5></ellipse><ellipse cx=36 cy=17 rx=5 ry=4></ellipse></svg><p>No notes yet</p><button type=button class=ghost>Write the first one`),nt=L(`<main class=dash><div class=dash-head><h2>Notes</h2><button type=button class="ghost icononly"title=Refresh aria-label=Refresh><svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg></button></div><nav class=tabs><button type=button>All</button></nav><ul class=cards>`),rt=L(`<button type=button>`),it=L(`<li class=card><a class=card-link><div class=card-top><span class=kind></span><span class=status></span></div><h3></h3><p></p><code class=slug>`),at=10,ot=e=>{let[t,n]=y(``),[r,i]=y(!1),[a,o]=y(null),[s,c]=y(null),[l,u]=y([]),[d,f]=y(`all`),[p,{refetch:m}]=w(async()=>{try{return await He({includeDrafts:!0})}catch(t){return t instanceof Error&&t.message===`session expired`?e.onExpired():n(t instanceof Error?t.message:String(t)),[]}});S(()=>{let e=p();e&&u(e)});let h=()=>l().find(e=>e.id===a())??null,g=()=>{let e=d();return e===`all`?l():l().filter(t=>t.kind===e)};async function _(e){i(!0),n(``);try{let t=0,n=0;await Promise.all(e.map(e=>{let r=e.pinned?t+=at:n+=at;return r===e.sort?Promise.resolve():We({title:e.title,slug:e.slug,summary:e.summary,body:e.body,kind:e.kind,tags:e.tags,pinned:e.pinned,status:e.status,sort:r},e.id)})),await m()}catch(e){n(e instanceof Error?e.message:String(e)),await m()}finally{i(!1)}}function v(e,t){t.preventDefault();let n=h();if(o(null),c(null),!n||n.id===e.id||n.pinned!==e.pinned)return;let r=l().filter(e=>e.id!==n.id),i=r.findIndex(t=>t.id===e.id),a=[...r.slice(0,i),n,...r.slice(i)];u(a),_(a)}return(()=>{var e=nt(),i=e.firstChild,l=i.firstChild.nextSibling,u=i.nextSibling,_=u.firstChild,y=u.nextSibling;return z(e,F(Qe,{get message(){return t()},onDismiss:()=>n(``)}),i),l.$$click=()=>m(),_.$$click=()=>f(`all`),z(u,F(be,{each:Fe,children:e=>(()=>{var t=rt();return t.$$click=()=>f(e),z(t,()=>Ie[e]),x(()=>t.classList.toggle(`on`,d()===e)),t})()}),null),z(e,F(I,{get when(){return p.loading},get children(){return $e()}}),y),z(e,F(I,{get when(){return r()},get children(){return et()}}),y),z(e,F(I,{get when(){return xe(()=>!p.loading)()&&(p()||[]).length===0},get children(){var e=tt(),t=e.firstChild.nextSibling.nextSibling;return t.$$click=()=>Ye(`/edit/$new`),e}}),y),z(y,F(be,{get each(){return g()},children:e=>(()=>{var t=it(),n=t.firstChild,i=n.firstChild,l=i.firstChild,u=l.nextSibling,f=i.nextSibling,p=f.nextSibling,m=p.nextSibling;return t.addEventListener(`dragend`,()=>{o(null),c(null)}),t.addEventListener(`drop`,t=>v(e,t)),t.addEventListener(`dragleave`,()=>{s()===e.id&&c(null)}),t.addEventListener(`dragover`,t=>{let n=h();n&&n.id!==e.id&&n.pinned===e.pinned&&(t.preventDefault(),c(e.id))}),t.addEventListener(`dragstart`,t=>{o(e.id),t.dataTransfer&&(t.dataTransfer.setData(`text/plain`,e.id),t.dataTransfer.effectAllowed=`move`)}),R(n,`draggable`,!1),z(l,()=>Ie[e.kind]),z(u,()=>e.status),z(f,()=>e.title),z(p,()=>e.summary||`—`),z(m,()=>e.slug),x(i=>{var o=!!e.pinned,c=e.status===`draft`,l=a()===e.id,u=s()===e.id,f=d()===`all`&&!r(),p=`#/n/${encodeURIComponent(e.slug)}`;return o!==i.e&&t.classList.toggle(`pinned`,i.e=o),c!==i.t&&t.classList.toggle(`draft`,i.t=c),l!==i.a&&t.classList.toggle(`dragging`,i.a=l),u!==i.o&&t.classList.toggle(`drop`,i.o=u),f!==i.i&&R(t,`draggable`,i.i=f),p!==i.n&&R(n,`href`,i.n=p),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()})),x(()=>_.classList.toggle(`on`,d()===`all`)),e})()};Te([`click`]);function st(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var V=st();function ct(e){V=e}var H={exec:()=>null};function U(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function W(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(G.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var lt=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),G={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:U(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:U(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:U(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:U(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:U(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:U(e=>RegExp(`^ {0,${e}}>`))},ut=/^(?:[ \t]*(?:\n|$))+/,dt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ft=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,mt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ht=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_t=W(gt).replace(/bull/g,ht).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),vt=W(gt).replace(/bull/g,ht).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,bt=/^[^\n]+/,xt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,St=W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,xt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ct=W(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ht).getRegex(),wt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Tt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Et=W(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Tt).replace(`tag`,wt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Dt=e=>W(yt).replace(`hr`,pt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,wt).getRegex(),Ot=Dt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),kt=Dt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),At={blockquote:W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,kt).getRegex(),code:dt,def:St,fences:ft,heading:mt,hr:pt,html:Et,lheading:_t,list:Ct,newline:ut,paragraph:Ot,table:H,text:bt},jt=W(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,pt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,wt).getRegex(),Mt={...At,lheading:vt,table:jt,paragraph:W(yt).replace(`hr`,pt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,jt).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,wt).getRegex()},Nt={...At,html:W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Tt).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:H,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(yt).replace(`hr`,pt).replace(`heading`,` *#{1,6} *[^
|
|
3
|
-
]`).replace(`lheading`,_t).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Pt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ft=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,It=/^( {2,}|\\)\n(?!\s*$)/,Lt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,K=/[\p{P}\p{S}]/u,q=/[\s\p{P}\p{S}]/u,Rt=/[^\s\p{P}\p{S}]/u,zt=W(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,q).getRegex(),Bt=/[\p{Pi}\p{Ps}"']/u,Vt=/(?!~)[\p{P}\p{S}]/u,Ht=/(?!~)[\s\p{P}\p{S}]/u,Ut=/(?:[^\s\p{P}\p{S}]|~)/u,Wt=W(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,lt?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Gt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Kt=W(Gt,`u`).replace(/punct/g,K).getRegex(),qt=W(Gt,`u`).replace(/punct/g,Vt).getRegex(),Jt=W(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Bt).replace(/punct/g,K).getRegex(),Yt=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Xt=W(Yt,`gu`).replace(/notPunctSpace/g,Rt).replace(/punctSpace/g,q).replace(/punct/g,K).getRegex(),Zt=W(Yt,`gu`).replace(/notPunctSpace/g,Ut).replace(/punctSpace/g,Ht).replace(/punct/g,Vt).getRegex(),Qt=W(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Rt).replace(/punctSpace/g,q).replace(/punct/g,K).getRegex(),$t=W(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Rt).replace(/punctSpace/g,q).replace(/punct/g,K).getRegex(),en=W(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Rt).replace(/punctSpace/g,q).replace(/punct/g,K).getRegex(),tn=W(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,K).getRegex(),nn=W(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Rt).replace(/punctSpace/g,q).replace(/punct/g,K).getRegex(),rn=W(/\\(punct)/,`gu`).replace(/punct/g,K).getRegex(),an=W(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),on=W(Tt).replace(`(?:-->|$)`,`-->`).getRegex(),sn=W(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,on).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),cn=W(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,/\[(?:\\[\s\S]|[^\[\]\\])*\]/).getRegex(),ln=W(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,cn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),un=W(/^!?\[(label)\]\[(ref)\]/).replace(`label`,cn).replace(`ref`,xt).getRegex(),dn=W(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,xt).getRegex(),fn=W(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,un).replace(`nolink`,dn).getRegex(),pn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,mn={_backpedal:H,anyPunctuation:rn,autolink:an,blockSkip:Wt,br:It,code:Ft,del:H,delLDelim:H,delRDelim:H,emStrongLDelim:Kt,emStrongRDelimAst:Xt,emStrongRDelimUnd:$t,escape:Pt,link:ln,nolink:dn,punctuation:zt,reflink:un,reflinkSearch:fn,tag:sn,text:Lt,url:H},hn={...mn,emStrongLDelim:Jt,emStrongRDelimAst:Qt,emStrongRDelimUnd:en,link:W(/^!?\[(label)\]\((.*?)\)/).replace(`label`,cn).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,cn).getRegex()},gn={...mn,emStrongRDelimAst:Zt,emStrongLDelim:qt,delLDelim:tn,delRDelim:nn,url:W(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,pn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:W(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,pn).getRegex()},_n={...gn,br:W(It).replace(`{2,}`,`*`).getRegex(),text:W(gn.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},vn={normal:At,gfm:Mt,pedantic:Nt},yn={normal:mn,gfm:gn,breaks:_n,pedantic:hn},bn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},xn=e=>bn[e];function J(e,t){if(t){if(G.escapeTest.test(e))return e.replace(G.escapeReplace,xn)}else if(G.escapeTestNoEncode.test(e))return e.replace(G.escapeReplaceNoEncode,xn);return e}function Sn(e){try{e=encodeURI(e).replace(G.percentDecode,`%`)}catch{return null}return e}function Cn(e,t){let n=e.replace(G.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(G.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(G.slashPipe,`|`);return n}function Y(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function wn(e){let t=e.split(`
|
|
4
|
-
`),n=t.length-1;for(;n>=0&&G.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
5
|
-
`)}function Tn(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function En(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Dn(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function On(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
6
|
-
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
|
7
|
-
`)}var kn=class{options;rules;lexer;constructor(e){this.options=e||V}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:wn(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=On(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Y(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Y(t[0],`
|
|
8
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Y(t[0],`
|
|
9
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Y(t[0],`
|
|
10
|
-
`).split(`
|
|
11
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
12
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
13
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
14
|
-
${s}`:s,r=r?`${r}
|
|
15
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
|
16
|
-
`),o=t.raw+`
|
|
17
|
-
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s,n=`${n}
|
|
18
|
-
${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
19
|
-
`+e.join(`
|
|
20
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
21
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=En(t[2].split(`
|
|
22
|
-
`,1)[0],t[1].length),l=e.split(`
|
|
23
|
-
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
24
|
-
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
25
|
-
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
26
|
-
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
27
|
-
`+l}u=!l.trim(),r+=p+`
|
|
28
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=wn(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Y(t[0],`
|
|
29
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Cn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
30
|
-
`):[],a={type:`table`,raw:Y(t[0],`
|
|
31
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Cn(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Y(t[0],`
|
|
32
|
-
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
33
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Y(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Tn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Dn(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Dn(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},X=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||V,this.options.tokenizer=this.options.tokenizer||new kn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:G,block:vn.normal,inline:yn.normal};this.options.pedantic?(t.block=vn.pedantic,t.inline=yn.pedantic):this.options.gfm&&(t.block=vn.gfm,t.inline=this.options.breaks?yn.breaks:yn.gfm),this.tokenizer.rules=t}static get rules(){return{block:vn,inline:yn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(G.carriageReturn,`
|
|
34
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(G.tabCharGlobal,` `).replace(G.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
35
|
-
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
36
|
-
`)?``:`
|
|
37
|
-
`)+i.raw,n.text+=`
|
|
38
|
-
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
39
|
-
`)?``:`
|
|
40
|
-
`)+i.raw,n.text+=`
|
|
41
|
-
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
42
|
-
`)?``:`
|
|
43
|
-
`)+i.raw,r.text+=`
|
|
44
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
45
|
-
`)?``:`
|
|
46
|
-
`)+i.raw,n.text+=`
|
|
47
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,e.slice(n+1,-1))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,n.slice(r+1,-1)))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},An=class{options;parser;constructor(e){this.options=e||V}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(G.notSpaceStart)?.[0],i=e?e.replace(G.endingNewline,``)+`
|
|
48
|
-
`:``;return r?`<pre><code class="language-`+J(r)+`">`+(n?i:J(i,!0))+`</code></pre>
|
|
49
|
-
`:`<pre><code>`+(n?i:J(i,!0))+`</code></pre>
|
|
50
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
51
|
-
${this.parser.parse(e)}</blockquote>
|
|
52
|
-
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
53
|
-
`}hr(e){return`<hr>
|
|
54
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
55
|
-
`+r+`</`+i+`>
|
|
56
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
57
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
58
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
59
|
-
<thead>
|
|
60
|
-
`+t+`</thead>
|
|
61
|
-
`+r+`</table>
|
|
62
|
-
`}tablerow({text:e}){return`<tr>
|
|
63
|
-
${e}</tr>
|
|
64
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
65
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${J(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?J(n,!0):this.parser.parseInline(r),o=Sn(e);if(o===null)return a;e=J(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+J(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Sn(e);if(i===null)return J(n);e=i;let a=`<img src="${J(e)}" alt="${J(n)}"`;return t&&(a+=` title="${J(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:J(e.text)}},jn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Z=class e{options;renderer;textRenderer;constructor(e){this.options=e||V,this.options.renderer=this.options.renderer||new An,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jn}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Mn=class{options;block;constructor(e){this.options=e||V}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?X.lex:X.lexInline}provideParser(e=this.block){return e?Z.parse:Z.parseInline}},Q=new class{defaults=st();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Z;Renderer=An;TextRenderer=jn;Lexer=X;Tokenizer=kn;Hooks=Mn;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new An(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new kn(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Mn;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Mn.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Mn.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return X.lex(e,t??this.defaults)}parser(e,t){return Z.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?X.lex:X.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Z.parse:Z.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?X.lex:X.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Z.parse:Z.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
66
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+J(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Q.parse(e,t)}$.options=$.setOptions=function(e){return Q.setOptions(e),$.defaults=Q.defaults,ct($.defaults),$},$.getDefaults=st,$.defaults=V;function Nn(...e){return Q.use(...e),$.defaults=Q.defaults,ct($.defaults),$}$.use=Nn,$.walkTokens=function(e,t){return Q.walkTokens(e,t)},$.parseInline=Q.parseInline,$.Parser=Z,$.parser=Z.parse,$.Renderer=An,$.TextRenderer=jn,$.Lexer=X,$.lexer=X.lex,$.Tokenizer=kn,$.Hooks=Mn,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,Z.parse,X.lex;var Pn=`modulepreload`,Fn=function(e){return`/nors/`+e},In={},Ln=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Fn(t,n),t=s(t),t in In)return;In[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Pn,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Rn(e){return{html:String(await $.parse(e??``)),mermaid:/```mermaid/.test(e)}}async function zn(e){if(!e)return;let t=[...e.querySelectorAll(`pre code.language-mermaid`)];if(t.length===0)return;let{default:n}=await Ln(async()=>{let{default:e}=await import(`./mermaid.core-CL8sN1KK.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));n.initialize({startOnLoad:!1}),await n.run({nodes:t})}var Bn=L(`<p class=hint>Loading…`),Vn=L(`<main class=reader>`),Hn=L(`<nav class=reader-nav aria-label="Note navigation"><a class=back-link href=#/><svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m15 18-6-6 6-6"></path></svg>All notes</a><div class=reader-actions><button type=button class=danger-ghost><svg width=17 height=17 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M3 6h18"></path><path d="M8 6V4h8v2"></path><path d="m19 6-1 14H6L5 6"></path><path d="M10 11v5M14 11v5"></path></svg></button><a class=button-link><svg width=17 height=17 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4Z"></path></svg>Edit note`),Un=L(`<p class=reader-summary>`),Wn=L(`<span class=detail-separator aria-hidden=true>·`),Gn=L(`<div class=reader-tags aria-label=Tags>`),Kn=L(`<div class=draft-notice>This note is still a draft.`),qn=L(`<article class=reader-document><header class=reader-head><div class=reader-badges><span class="kind badge"></span><span class="status badge"></span></div><h1></h1><div class=reader-details><span>Updated </span></div></header><div class="prose reader-prose">`),Jn=L(`<div class=dialog-backdrop role=presentation><section class=confirm-dialog role=alertdialog aria-modal=true aria-labelledby=delete-title aria-describedby=delete-description><div class=dialog-icon aria-hidden=true><svg width=22 height=22 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M3 6h18"></path><path d="M8 6V4h8v2"></path><path d="m19 6-1 14H6L5 6"></path><path d="M10 11v5M14 11v5"></path></svg></div><div class=dialog-copy><h2 id=delete-title>Delete this note?</h2><p id=delete-description><strong></strong> will be permanently deleted. This action cannot be undone.</p></div><div class=dialog-actions><button type=button class=ghost autofocus>Cancel</button><button type=button class=danger-confirm>`),Yn=L(`<span class=tag>#`),Xn=e=>{let[t,n]=y(``),[r,i]=y(!1),[a,o]=y(!1),s,[c]=w(()=>e.slug,async t=>{try{return await Ue(t)}catch(t){return t instanceof Error&&t.message===`session expired`?e.onExpired():n(t instanceof Error?t.message:String(t)),null}}),[l]=w(c,async e=>e?Rn(e.body):{html:``,mermaid:!1});S(async()=>{l()?.mermaid&&await zn(s)});function u(e){let t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,10):new Intl.DateTimeFormat(void 0,{day:`numeric`,month:`short`,year:`numeric`}).format(t)}async function d(t){i(!0),n(``);try{await Ge(t.id),Ye(`/`)}catch(t){t instanceof Error&&t.message===`session expired`?e.onExpired():n(t instanceof Error?t.message:String(t))}finally{i(!1),o(!1)}}return(()=>{var e=Vn();return z(e,F(Qe,{get message(){return t()},onDismiss:()=>n(``)}),null),z(e,F(I,{get when(){return c.loading||l.loading},get children(){return Bn()}}),null),z(e,F(I,{get when(){return c()},children:e=>[(()=>{var t=Hn(),n=t.firstChild.nextSibling.firstChild;n.firstChild;var i=n.nextSibling;return n.$$click=()=>o(!0),z(n,()=>r()?`Deleting…`:`Delete`,null),x(t=>{var a=r(),o=`#/edit/${encodeURIComponent(e().slug)}`;return a!==t.e&&(n.disabled=t.e=a),o!==t.t&&R(i,`href`,t.t=o),t},{e:void 0,t:void 0}),t})(),(()=>{var t=qn(),n=t.firstChild,r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=r.nextSibling,c=o.nextSibling,d=c.firstChild;d.firstChild;var f=n.nextSibling;z(i,()=>Ie[e().kind]),z(a,(()=>{var t=xe(()=>e().status===`draft`);return()=>t()?`Draft`:e().status===`archived`?`Archived`:`Published`})()),z(o,()=>e().title),z(n,F(I,{get when(){return e().summary},get children(){var t=Un();return z(t,()=>e().summary),t}}),c),z(d,()=>u(e().updated),null),z(c,F(I,{get when(){return e().tags.length>0},get children(){return[Wn(),(()=>{var t=Gn();return z(t,()=>e().tags.map(e=>(()=>{var t=Yn();return t.firstChild,z(t,e,null),t})())),t})()]}}),null),z(t,F(I,{get when(){return e().status===`draft`},get children(){return Kn()}}),f);var p=s;return typeof p==`function`?De(p,f):s=f,x(t=>{var n=e().status===`draft`,r=l()?.html??``;return n!==t.e&&a.classList.toggle(`draft`,t.e=n),r!==t.t&&(f.innerHTML=t.t=r),t},{e:void 0,t:void 0}),t})(),F(I,{get when(){return a()},get children(){var t=Jn(),n=t.firstChild.firstChild.nextSibling,i=n.firstChild.nextSibling.firstChild,a=n.nextSibling.firstChild,s=a.nextSibling;return t.$$keydown=e=>{e.key===`Escape`&&!r()&&o(!1)},t.$$click=e=>{e.target===e.currentTarget&&!r()&&o(!1)},z(i,()=>e().title),a.$$click=()=>o(!1),s.$$click=()=>d(e()),z(s,()=>r()?`Deleting…`:`Delete note`),x(e=>{var t=r(),n=r();return t!==e.e&&(a.disabled=e.e=t),n!==e.t&&(s.disabled=e.t=n),e},{e:void 0,t:void 0}),t}})]}),null),e})()};Te([`click`,`keydown`]);var Zn=L(`<p class=hint>Loading…`),Qn=L(`<main class=editor>`),$n=L(`<a class=view-link><svg width=17 height=17 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"></path><circle cx=12 cy=12 r=3></circle></svg>View note`),er=L(`<nav class="crumbs editor-nav"><a class=back-link href=#/><svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m15 18-6-6 6-6"></path></svg>All notes</a><span class=spacer></span><button type=button class=pinbtn><svg width=17 height=17 viewBox="0 0 24 24"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M8 3h8l-1 8 3 3v2H6v-2l3-3z"></path><line x1=12 y1=16 x2=12 y2=21>`),tr=L(`<input class=doctitle placeholder="New note title…"maxlength=160 required>`),nr=L(`<div class="tabs kindpills">`),rr=L(`<div class=iconbar><div class=icons><button type=button title=Bold aria-label=Bold>B</button><button type=button title=Italic aria-label=Italic>I</button><button type=button title=Link aria-label=Link><svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></button><button type=button title=List aria-label=List><svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=8 y1=6 x2=21 y2=6></line><line x1=8 y1=12 x2=21 y2=12></line><line x1=8 y1=18 x2=21 y2=18></line><line x1=3 y1=6 x2=3.01 y2=6></line><line x1=3 y1=12 x2=3.01 y2=12></line><line x1=3 y1=18 x2=3.01 y2=18></line></svg></button><button type=button title="Numbered list"aria-label="Numbered list"><span class=glyph>1.</span></button><button type=button title=Heading aria-label=Heading>H</button><button type=button title=Quote aria-label=Quote><span class=glyph>❝</span></button><button type=button title=Code aria-label=Code><svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></button><button type=button title="Mermaid diagram"aria-label="Mermaid diagram"><svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg></button></div><div class=minitabs><button type=button>Write</button><button type=button>Preview`),ir=L(`<textarea class=doctext placeholder="Write your note here…"rows=8>`),ar=L(`<button type=button class=ghost>`),or=L(`<button type=button>`),sr=L(`<div class=edit-foot>`),cr=L(`<div class="prose preview">`);function lr(e){let t={ç:`c`,ğ:`g`,ı:`i`,ö:`o`,ş:`s`,ü:`u`};return e.toLowerCase().replace(/[çğıöşü]/g,e=>t[e]).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,80)}function ur(){return{id:``,title:``,slug:``,summary:``,body:``,kind:`scratch`,tags:[],pinned:!1,status:`draft`,sort:0,updated:``}}var dr=e=>{let[t,n]=y(``),[r]=w(()=>e.slug,async t=>{if(t===`$new`)return ur();try{return await Ue(t)}catch(t){return t instanceof Error&&t.message===`session expired`?e.onExpired():n(t instanceof Error?t.message:String(t)),null}});return(()=>{var i=Qn();return z(i,F(Qe,{get message(){return t()},onDismiss:()=>n(``)}),null),z(i,F(I,{get when(){return r.loading},get children(){return Zn()}}),null),z(i,F(I,{get when(){return r()},children:t=>F(fr,{get initial(){return t()},get onExpired(){return e.onExpired}})}),null),i})()},fr=e=>{let t=()=>e.initial,[n,r]=y(t().title),[i,a]=y(t().body),[o,s]=y(t().kind),[c,l]=y(t().pinned),[u,d]=y(`write`),f=()=>JSON.stringify([n(),i(),o(),c()]),p=f(),m=!0,h=location.hash;te(()=>{let e=()=>{if(!m){m=!0;return}if(f()===p||confirm(`Discard unsaved changes?`)){h=location.hash;return}m=!1,location.hash===h?m=!0:location.hash=h};window.addEventListener(`hashchange`,e),E(()=>window.removeEventListener(`hashchange`,e))});let[g,_]=y(``),v,b;function S(e,t,n){queueMicrotask(()=>{e.focus(),e.setSelectionRange(t,n)})}function C(e,t,n){let r=v;if(!r)return;let o=i(),s=r.selectionStart??o.length,c=r.selectionEnd??o.length,l=o.slice(s,c)||n;a(o.slice(0,s)+e+l+t+o.slice(c)),d(`write`),S(r,s+e.length,s+e.length+l.length)}function ee(e){let t=v;if(!t)return;let n=i(),r=t.selectionStart??0,o=t.selectionEnd??0,s=n.lastIndexOf(`
|
|
67
|
-
`,r-1)+1,c=n.indexOf(`
|
|
68
|
-
`,o),l=c<0?n.length:c,u=n.slice(s,l).split(`
|
|
69
|
-
`).map(t=>t.startsWith(e)?t:e+t).join(`
|
|
70
|
-
`);a(n.slice(0,s)+u+n.slice(l)),d(`write`),S(t,s,s+u.length)}function w(){let e="\n```mermaid\ngraph TD\n A --> B\n```\n",t=v;if(!t)return a(i()+e);let n=i(),r=t.selectionStart??n.length;a(n.slice(0,r)+e+n.slice(t.selectionEnd??r)),d(`write`),S(t,r+35,r+35)}async function T(){d(`preview`);let e=await Rn(i());_(e.html),e.mermaid&&queueMicrotask(()=>zn(b))}let[D,ne]=y(!1),[re,O]=y(``);function ie(e){return(e.split(`
|
|
71
|
-
`).map(e=>e.trim()).find(e=>e!==``&&!e.startsWith(`#`)&&!e.startsWith("```"))??``).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/[*_`>#\-[\]()]/g,``).trim().slice(0,160)}function ae(e){let r=!t().id,a=n().trim();return{title:a,slug:r?lr(a)||`note`:t().slug,summary:r?ie(i()):t().summary,body:i(),kind:o(),tags:r?[]:t().tags,pinned:c(),status:e,sort:t().sort}}async function k(r){if(!n().trim())return O(`Title is required.`);let i=ae(r);ne(!0),O(``);try{let e=await We(i,t().id||void 0);p=f(),Ye(`/n/${encodeURIComponent(e.slug)}`)}catch(t){t instanceof Error&&t.message===`session expired`?e.onExpired():O(t instanceof Error?t.message:String(t))}finally{ne(!1)}}return[F(Qe,{get message(){return re()},onDismiss:()=>O(``)}),(()=>{var e=er(),n=e.firstChild.nextSibling.nextSibling,r=n.firstChild;return z(e,F(I,{get when(){return t().slug},get children(){var e=$n();return x(()=>R(e,`href`,`#/n/${encodeURIComponent(t().slug)}`)),e}}),n),n.$$click=()=>l(!c()),x(e=>{var t=!!c(),i=c()?`Unpin`:`Pin to top`,a=c(),o=c()?`currentColor`:`none`;return t!==e.e&&n.classList.toggle(`on`,e.e=t),i!==e.t&&R(n,`title`,e.t=i),a!==e.a&&R(n,`aria-pressed`,e.a=a),o!==e.o&&R(r,`fill`,e.o=o),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e})(),(()=>{var e=tr();return e.$$input=e=>r(e.currentTarget.value),x(()=>e.value=n()),e})(),(()=>{var e=nr();return z(e,F(be,{each:Fe,children:e=>(()=>{var t=or();return t.$$click=()=>s(e),z(t,()=>Ie[e]),x(()=>t.classList.toggle(`on`,o()===e)),t})()})),e})(),(()=>{var e=rr(),t=e.firstChild,n=t.firstChild,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling,o=a.nextSibling,s=o.nextSibling,c=s.nextSibling,l=c.nextSibling,f=l.nextSibling,p=t.nextSibling.firstChild,m=p.nextSibling;return n.$$click=()=>C(`**`,`**`,`text`),r.$$click=()=>C(`*`,`*`,`text`),i.$$click=()=>C(`[`,`](https://)`,`text`),a.$$click=()=>ee(`- `),o.$$click=()=>ee(`1. `),s.$$click=()=>ee(`## `),c.$$click=()=>ee(`> `),l.$$click=()=>C("`","`",`code`),f.$$click=w,p.$$click=()=>d(`write`),m.$$click=T,x(e=>{var t=u()===`write`,n=u()===`preview`;return t!==e.e&&p.classList.toggle(`on`,e.e=t),n!==e.t&&m.classList.toggle(`on`,e.t=n),e},{e:void 0,t:void 0}),e})(),F(I,{get when(){return u()===`write`},get fallback(){return(()=>{var e=cr(),t=b;return typeof t==`function`?De(t,e):b=e,x(()=>e.innerHTML=g()),e})()},get children(){var e=ir();e.$$input=e=>a(e.currentTarget.value);var t=v;return typeof t==`function`?De(t,e):v=e,x(()=>e.value=i()),e}}),(()=>{var e=sr();return z(e,F(I,{get when(){return t().status===`published`},get fallback(){return[(()=>{var e=ar();return e.$$click=()=>k(`draft`),z(e,()=>D()?`…`:`Save draft`),x(()=>e.disabled=D()),e})(),(()=>{var e=or();return e.$$click=()=>k(`published`),z(e,()=>D()?`…`:`Publish`),x(()=>e.disabled=D()),e})()]},get children(){return[(()=>{var e=ar();return e.$$click=()=>k(`draft`),z(e,()=>D()?`…`:`Move to drafts`),x(()=>e.disabled=D()),e})(),(()=>{var e=or();return e.$$click=()=>k(`published`),z(e,()=>D()?`…`:`Save changes`),x(()=>e.disabled=D()),e})()]}})),e})()]};Te([`click`,`input`]);var pr=L(`<p class=menu-mail>`),mr=L(`<div class=menu><button type=button class=out>Sign out`),hr=L(`<nav class=row><button type=button class=muted>+ New</button><div class=avatar-wrap><button type=button class=avatar aria-label=Account>`),gr=L(`<div class=shell><header class=top><a class=brand href=#/><img alt width=30 height=30><h1>Nors`),_r=L(`<p class=menu-mail>superuser`),vr=L(`<div class=center-page><form class=login><h2>Superuser</h2><p class=hint>Same PocketBase account as Skadi. Token stays in this browser.</p><label>Email<input type=email autocomplete=username required></label><label>Password<input type=password autocomplete=current-password required></label><button type=submit>`),yr=()=>{new URLSearchParams(location.search).get(`new`)===`1`&&history.replaceState(null,``,`${location.pathname}#/edit/${qe}`);let[e,t]=y(Re()),[n,r]=y(``),[i,a]=y(``),[o,s]=y(``),[c,l]=y(!1),u=Xe(),[d,f]=y(!1),p;te(()=>{let e=e=>{p&&!p.contains(e.target)&&f(!1)},t=e=>{e.key===`Escape`&&f(!1)};document.addEventListener(`click`,e),document.addEventListener(`keydown`,t),E(()=>{document.removeEventListener(`click`,e),document.removeEventListener(`keydown`,t)})});let m=()=>{e();try{let e=JSON.parse(localStorage.getItem(`nors_pb_user`)||`{}`);return e&&typeof e==`object`&&`email`in e&&typeof e.email==`string`?e.email:``}catch{return``}},h=()=>(m()[0]??`N`).toUpperCase();async function g(e){e.preventDefault(),l(!0),s(``);try{await Be(n(),i()),t(Re()),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}function _(){ze(),t(null)}return(()=>{var t=gr(),l=t.firstChild,v=l.firstChild.firstChild;return z(t,F(Qe,{get message(){return o()},onDismiss:()=>s(``)}),l),z(l,F(I,{get when(){return e()},get children(){var e=hr(),t=e.firstChild,n=t.nextSibling,r=n.firstChild;t.$$click=()=>Ye(`/edit/$new`);var i=p;return typeof i==`function`?De(i,n):p=n,r.$$click=()=>f(!d()),z(r,h),z(n,F(I,{get when(){return d()},get children(){var e=mr(),t=e.firstChild;return z(e,F(I,{get when(){return m()},get fallback(){return _r()},get children(){var e=pr();return z(e,m),e}}),t),t.$$click=_,e}}),null),x(()=>R(r,`aria-expanded`,d())),e}}),null),z(t,F(I,{get when(){return e()},get fallback(){return(()=>{var e=vr(),t=e.firstChild,o=t.firstChild.nextSibling.nextSibling,s=o.firstChild.nextSibling,l=o.nextSibling,u=l.firstChild.nextSibling,d=l.nextSibling;return t.addEventListener(`submit`,g),s.$$input=e=>r(e.currentTarget.value),u.$$input=e=>a(e.currentTarget.value),z(d,()=>c()?`…`:`Enter`),x(()=>d.disabled=c()),x(()=>s.value=n()),x(()=>u.value=i()),e})()},get children(){return(()=>{let e=u();return e.name===`read`?F(Xn,{get slug(){return e.slug},onExpired:_}):e.name===`edit`?F(dr,{get slug(){return e.slug},onExpired:_}):F(ot,{onExpired:_})})()}}),null),x(()=>R(v,`src`,`/nors/nors-mark.svg`)),t})()};Te([`click`,`input`]);var br=document.getElementById(`root`);if(!br)throw Error(`#root missing`);we(()=>F(yr,{}),br);export{Ln as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{m as e}from"./mermaid-parser.core-Bh2pMn-f.js";export{e as createRailroadAbnfServices};
|