@hardikg/mdview 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +2 -2
- package/bin/mdview.mjs +60 -26
- package/dist/client/assets/2DXBBFLN-BxPqHNSN.js +5 -0
- package/dist/client/assets/46IJ22JX-u_jvQJNg.js +2 -0
- package/dist/client/assets/4TTDE5I4-BgbNAVNj.js +3 -0
- package/dist/client/assets/4UF3HTLV-DNbPxlOE.js +2 -0
- package/dist/client/assets/5THPTBWS-D57irc_4.js +1 -0
- package/dist/client/assets/7WLXJQOR-CHhKreq0.js +1 -0
- package/dist/client/assets/AAXQQPKT-CsAJqrOC.js +5 -0
- package/dist/client/assets/AKE5O7KZ-MSuBOjCG.js +2 -0
- package/dist/client/assets/BNMLP6AG-Ca3zyKQY.js +3 -0
- package/dist/client/assets/DKTLEL5E-B7ILCVTH.js +1 -0
- package/dist/client/assets/DR6PKOQU-Bw7cHvYp.js +2 -0
- package/dist/client/assets/E4RJ7UJB-CYB5C4K7.js +2 -0
- package/dist/client/assets/ELSXBIJH-DG0MW5dC.js +1 -0
- package/dist/client/assets/ERTIBQVS-BMWumWfk.js +2 -0
- package/dist/client/assets/F653G4FO-FI8M9Mc0.js +12 -0
- package/dist/client/assets/FKCDD66M-BPFkyrwI.js +1 -0
- package/dist/client/assets/FP7KDXVC-BLEBNkCO.js +2 -0
- package/dist/client/assets/FT5I3RHX-j5YoMicq.js +6 -0
- package/dist/client/assets/FTXIJQGB-nrHdCfp7.js +1 -0
- package/dist/client/assets/G3MDBVQH-EkdejvdW.js +1 -0
- package/dist/client/assets/GY35JXOZ-3ovTGxgz.js +2 -0
- package/dist/client/assets/H5EEJPP2-CNVQBEB3.js +1 -0
- package/dist/client/assets/HWDLEDTA-C_JcdBMO.js +1 -0
- package/dist/client/assets/JZWSX6AR-OwVPptYv.js +1 -0
- package/dist/client/assets/KQOEJWJY-DKTXya68.js +2 -0
- package/dist/client/assets/KS3BB3KE-QkpqVdmA.js +1 -0
- package/dist/client/assets/KXJRRZHI-BQRjeGWj.js +2 -0
- package/dist/client/assets/MFVI5XKI-DrRaRE9X.js +1 -0
- package/dist/client/assets/MWY2J62P-AbEgJnzK.js +12 -0
- package/dist/client/assets/MXGNCBL2-DG3CZR8g.js +2 -0
- package/dist/client/assets/N6DAJLIZ-BsZQKTyT.js +3 -0
- package/dist/client/assets/NU5M23IW-CvtpIovv.js +2 -0
- package/dist/client/assets/NV4XNBIS-nS8wAx3h.js +8 -0
- package/dist/client/assets/OGLU4SIR-DoTUWhkz.js +2 -0
- package/dist/client/assets/OUNS5N76-BwVLonT4.js +8 -0
- package/dist/client/assets/PU4ISKXV-BYX7eA_r.js +2 -0
- package/dist/client/assets/PUZGS23X-n6IKOr7S.js +1 -0
- package/dist/client/assets/Q3IYVLG5-hWt1rVyh.js +4 -0
- package/dist/client/assets/QYHQDLKZ-CjGeJM7R.js +4 -0
- package/dist/client/assets/RVARI57O-CXmrUIiS.js +1 -0
- package/dist/client/assets/RZSVICHU-BiwjruZZ.js +4 -0
- package/dist/client/assets/UEXXS2NB-Dkz_tz-N.js +2 -0
- package/dist/client/assets/UHTQJXKL-lvl-7QeT.js +5 -0
- package/dist/client/assets/URA2L2QI-B8pYKxOk.js +1 -0
- package/dist/client/assets/UXCHDUKG-BGy3ZRLM.js +2 -0
- package/dist/client/assets/VKNV3BUX-DZnoX4IV.js +5 -0
- package/dist/client/assets/VMV7XPHP-6QkisQwm.js +4 -0
- package/dist/client/assets/WEVWDWVA-nohBBhTA.js +2 -0
- package/dist/client/assets/XRRJ35LF-BE7gSN1k.js +2 -0
- package/dist/client/assets/YFKBLVVN-CVTPpei6.js +6 -0
- package/dist/client/assets/YHRE5QGZ-Bs7dUKjj.js +4 -0
- package/dist/client/assets/ZF3OVT4B-6LaC6iLs.js +3 -0
- package/dist/client/assets/index-392ivruk.js +2 -0
- package/dist/client/assets/index-CGQuEJ_w.css +1 -0
- package/dist/client/assets/lazy-CKqR1774.js +43 -0
- package/dist/client/index.html +2 -2
- package/package.json +4 -3
- package/dist/client/assets/abnfDiagram-VCTEODGH-d5-zUW3h.js +0 -1
- package/dist/client/assets/arc-DIbSNhHb.js +0 -1
- package/dist/client/assets/architectureDiagram-5GKGNRK7-Cq_KBCV9.js +0 -36
- package/dist/client/assets/blockDiagram-NRAW4CY4-CKgrJGzB.js +0 -129
- package/dist/client/assets/c4Diagram-UCG6FXSJ-CamsXU_i.js +0 -38
- package/dist/client/assets/channel-MJp4QxQY.js +0 -1
- package/dist/client/assets/chunk-2Q5K7J3B-DHB85OBA.js +0 -1
- package/dist/client/assets/chunk-5VM5RSS4-C3v07bfZ.js +0 -15
- package/dist/client/assets/chunk-F27PBJKO-bDA5q_T9.js +0 -1
- package/dist/client/assets/chunk-G27WJ6UU-DjS6mkGt.js +0 -231
- package/dist/client/assets/chunk-JWPE2WC7-ln94eTAD.js +0 -1
- package/dist/client/assets/chunk-LCL6LL3I-SEXOnCPG.js +0 -206
- package/dist/client/assets/chunk-POPQ4Y6H-Dpgmgmgq.js +0 -1
- package/dist/client/assets/chunk-SVP7TREG-C_qgSQCy.js +0 -88
- package/dist/client/assets/chunk-XXDRQBXY-CguISEfl.js +0 -1
- package/dist/client/assets/classDiagram-DTDB5LWJ-BlbBfPMZ.js +0 -1
- package/dist/client/assets/classDiagram-v2-JRS7N3AN-BlbBfPMZ.js +0 -1
- package/dist/client/assets/cose-bilkent-JH36ORCC-CjtLn09K.js +0 -1
- package/dist/client/assets/cynefin-OW5HDTMX-BgNmTgCR.js +0 -178
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-BFfuQ7YY.js +0 -62
- package/dist/client/assets/cytoscape.esm-BjAbmLdb.js +0 -331
- package/dist/client/assets/dagre-3AP2YEHR-BDLHOy1Z.js +0 -4
- package/dist/client/assets/defaultLocale-DX6XiGOO.js +0 -1
- package/dist/client/assets/diagram-S7CK7UJ4-CfzUQiTU.js +0 -30
- package/dist/client/assets/diagram-UQ7AKVKN-Ds3lTKuY.js +0 -41
- package/dist/client/assets/diagram-VSXAHHWV-lwAuvia3.js +0 -3
- package/dist/client/assets/diagram-VX7I27RA-CsU4EPwU.js +0 -24
- package/dist/client/assets/diagram-Z3DM3KII-DFieIgnM.js +0 -24
- package/dist/client/assets/ebnfDiagram-PWID7BFC-BzR_CBzj.js +0 -1
- package/dist/client/assets/erDiagram-SSCWMZ5O-joYlyDrM.js +0 -99
- package/dist/client/assets/flowDiagram-A5DVABFB-DVyMxsTJ.js +0 -168
- package/dist/client/assets/ganttDiagram-EL5Y4UJY-Cf4FwZsI.js +0 -292
- package/dist/client/assets/gitGraphDiagram-WWUBYQGX-9grceorS.js +0 -106
- package/dist/client/assets/index-7zMmn_PY.js +0 -2
- package/dist/client/assets/index-CcKPW3Oc.css +0 -1
- package/dist/client/assets/infoDiagram-RXCK75RN-ja-7F4cO.js +0 -2
- package/dist/client/assets/init-Gi6I4Gst.js +0 -1
- package/dist/client/assets/ishikawaDiagram-5VMMS53U-uRRSMmsi.js +0 -70
- package/dist/client/assets/journeyDiagram-EYS64GPL-BdD_OYKc.js +0 -139
- package/dist/client/assets/kanban-definition-3QL26DDD-3rMqnFFk.js +0 -89
- package/dist/client/assets/layout-3dyJkKek.js +0 -1
- package/dist/client/assets/linear-B49R1aTA.js +0 -1
- package/dist/client/assets/mermaid.core-CVM43n3z.js +0 -312
- package/dist/client/assets/mindmap-definition-FBJOCRG2-B8QesUuH.js +0 -96
- package/dist/client/assets/ordinal-Cboi1Yqb.js +0 -1
- package/dist/client/assets/pegDiagram-XKGWAZYB-BeO8X3By.js +0 -1
- package/dist/client/assets/pieDiagram-E7YTZNPT-DD3M93Je.js +0 -39
- package/dist/client/assets/quadrantDiagram-AXDQQJYC-LxJ8Qxzg.js +0 -7
- package/dist/client/assets/railroadDiagram-O6MQD6OU-Cc6-wuTB.js +0 -1
- package/dist/client/assets/requirementDiagram-EFPCY7ZU-D-vaSng7.js +0 -84
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-C-SrB4wj.js +0 -40
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-BpUTXTa1.js +0 -162
- package/dist/client/assets/sizeCapture-X5ZJPWSS-BG1rRkMg.js +0 -1
- package/dist/client/assets/stateDiagram-HBIQ2CUA-CAsJ9kP3.js +0 -1
- package/dist/client/assets/stateDiagram-v2-4QOOHH4V-ssPfmTD6.js +0 -1
- package/dist/client/assets/swimlanes-XN3QIQJK-DH5txxCi.js +0 -1
- package/dist/client/assets/swimlanesDiagram-VK2B7HYN-Cqi1auey.js +0 -8
- package/dist/client/assets/timeline-definition-24CTP7MA-DPSR_k-5.js +0 -120
- package/dist/client/assets/vennDiagram-4TSXK5OY-CRMSJqLq.js +0 -34
- package/dist/client/assets/wardleyDiagram-VM6X3IG4-DRCnYQxB.js +0 -78
- package/dist/client/assets/xychartDiagram-S5SC5T6Z-x5N3gqvJ.js +0 -7
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var Nt=Object.defineProperty;var xt=(t,a,s)=>a in t?Nt(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s;var _=(t,a,s)=>xt(t,typeof a!="symbol"?a+"":a,s);import{c as Mt}from"./MFVI5XKI-DrRaRE9X.js";import{c as Le}from"./G3MDBVQH-EkdejvdW.js";import{h as Et}from"./7WLXJQOR-CHhKreq0.js";import{x as kt,h as St,y as vt,C as Ot}from"./ELSXBIJH-DG0MW5dC.js";import{b as _t,d as ie,m as It}from"./FKCDD66M-BPFkyrwI.js";import{L as Rt,N as Dt}from"./JZWSX6AR-OwVPptYv.js";import{R as Pt}from"./URA2L2QI-B8pYKxOk.js";import{$ as te,o as rt,e as V,i as me,L as at,H as Ut}from"./lazy-CKqR1774.js";import{m as Gt,c as Bt,p as Ht}from"./DKTLEL5E-B7ILCVTH.js";import{F as Wt,S as zt,D as Ft,w as Yt}from"./HWDLEDTA-C_JcdBMO.js";import{_ as ne,g as Ue,y as Ge,a as lt,x as g,f as ge,b as be,h as Kt,$ as Xt}from"./RZSVICHU-BiwjruZZ.js";import"./index-392ivruk.js";function it(t){return t==="#"||t==="+"||t==="~"||t==="-"}var nt=class{constructor(t,a){_(this,"id","");_(this,"memberType");_(this,"visibility","");_(this,"classifier","");_(this,"parameters","");_(this,"returnType","");this.memberType=a,(a!=="method"||!this.parseMethod(t))&&this.parseAttribute(t),this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim()}parseMethod(t){let a=t.length;for(let s=0;s<a;){let o=s;for(;o<a&&!rt(t.charCodeAt(o));)o++;let b=o-1;for(;b>s&&t.charCodeAt(b)!==41;)b--;let l=b-1;for(;l>s&&t.charCodeAt(l)!==40;)l--;if(l>s){let m=t[s],e=it(m)&&l>s+1;e&&(this.visibility=m),this.id=t.slice(e?s+1:s,l),this.parameters=t.slice(l+1,b).trim();let M=b+1,w="";if(M<a){let d=t[M];(d==="$"||d==="*"||d.trim()==="")&&(w=d.trim(),M++)}let S=M;for(;S<a&&!rt(t.charCodeAt(S));)S++;if(this.returnType=t.slice(M,S).trim(),w===""){let d=this.returnType.slice(-1);(d==="$"||d==="*")&&(w=d,this.returnType=this.returnType.slice(0,-1))}return this.classifier=w,!0}s=o+1}return this.memberType="attribute",!1}parseAttribute(t){let a=t.slice(0,1),s=t.slice(-1);it(a)&&(this.visibility=a),(s==="$"||s==="*")&&(this.classifier=s),this.id=t.substring(this.visibility===""?0:1,this.classifier===""?t.length:t.length-1)}getDisplayDetails(){let t=this.visibility+Le(this.id);return this.memberType==="method"&&(t+=`(${Le(this.parameters.trim())})`,this.returnType&&(t+=" : "+Le(this.returnType))),{displayText:t.trim(),cssStyle:this.parseClassifier()}}parseClassifier(){return this.classifier==="*"?"font-style:italic;":this.classifier==="$"?"text-decoration:underline;":""}},jt={LINE:0,DOTTED_LINE:1},de={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},Qt="classId-";function j(t){let a=t.indexOf("~");if(a<=0)return{className:t,type:""};let s=t.indexOf("~",a+1);return{className:t.slice(0,a),type:t.slice(a+1,s===-1?t.length:s)}}function ot(t){let a=t.charCodeAt(0);return j(a>=48&&a<=57?Qt+t:t).className}var Vt=class{constructor(){_(this,"type","class");_(this,"lineType",jt);_(this,"relationType",de);_(this,"direction","TB");_(this,"classes",new Map);_(this,"relations",[]);_(this,"notes",new Map);_(this,"namespaces",new Map);_(this,"interfaces",[]);_(this,"styleClasses",new Map);_(this,"title");_(this,"accTitle");_(this,"accDescr");_(this,"namespaceStack",[]);_(this,"withCssClass",new Map)}addClass(t){let{className:a,type:s}=j(t);if(this.classes.has(a))return;let o={id:a,type:s,label:a,cssClasses:"default",methods:[],members:[],annotations:[],styles:[]};this.classes.set(a,o),this.tag(o,"default")}tag(t,a){let s=this.withCssClass.get(a);s?s.add(t):this.withCssClass.set(a,new Set([t]))}ensure(t){return this.addClass(t),this.classes.get(j(t).className)}setClassLabel(t,a){this.ensure(t).label=a}addRelation(t){let{type1:a,type2:s}=t.relation;a===de.LOLLIPOP&&s==="none"?(this.addClass(t.id2),t.id1=this.addInterface(t.id1,t.id2)):s===de.LOLLIPOP&&a==="none"?(this.addClass(t.id1),t.id2=this.addInterface(t.id2,t.id1)):(this.addClass(t.id1),this.addClass(t.id2)),t.id1=j(t.id1).className,t.id2=j(t.id2).className,t.relationTitle1=t.relationTitle1.trim(),t.relationTitle2=t.relationTitle2.trim(),this.relations.push(t)}addInterface(t,a){let s=`interface${this.interfaces.length}`;return this.interfaces.push({id:s,label:t,classId:a}),s}addAnnotation(t,a){this.ensure(t).annotations.push(a)}addMember(t,a){let s=this.ensure(t);if(typeof a!="string")return;let o=a.trim();if(o.startsWith("<<")&&o.endsWith(">>"))s.annotations.push(o.substring(2,o.length-2));else if(o.indexOf(")")>0){let b=new nt(o,"method");(b.memberType==="method"?s.methods:s.members).push(b)}else o&&s.members.push(new nt(o,"attribute"))}addMembers(t,a){if(Array.isArray(a)){a.reverse();for(let s of a)this.addMember(t,s)}}addNote(t,a){let s=this.notes.size,o=`note${s}`;return this.notes.set(o,{id:o,class:a,text:t,index:s}),o}cleanupLabel(t){return(t.startsWith(":")?t.substring(1):t).trim()}setCssClass(t,a){for(let s of t.split(",")){let o=this.classes.get(ot(s));if(o!==void 0){o.cssClasses+=" "+a;for(let b of a.split(" "))this.tag(o,b)}}}defineClass(t,a){for(let s of t){let o=this.styleClasses.get(s);if(o===void 0&&(o={id:s,styles:[],textStyles:[]},this.styleClasses.set(s,o)),!a)continue;for(let m of a)m.includes("color")&&o.textStyles.push(m.replace("fill","bgFill")),o.styles.push(m);let b=this.withCssClass.get(s);if(b===void 0)continue;let l=a.flatMap(m=>m.split(","));for(let m of b)for(let e of l)m.styles.push(e)}}setTooltip(t,a){if(a!==void 0)for(let s of t.split(",")){let o=this.classes.get(j(s).className);o&&(o.tooltip=a)}}setLink(t,a,s){let o=te(a).trim();for(let b of t.split(",")){let l=this.classes.get(ot(b));l&&(l.link=o?Rt(o):void 0,l.linkTarget=typeof s=="string"?s:"_blank")}this.setCssClass(t,"clickable")}setClickEvent(t,a,s){for(let o of t.split(",")){let b=this.classes.get(j(o).className);b&&(b.haveCallback=!0)}this.setCssClass(t,"clickable")}setDirection(t){this.direction=t}setAccTitle(t){this.accTitle=t.replace(/^\s+/g,"")}setAccDescription(t){this.accDescr=t.replace(/\n\s+/g,`
|
|
2
|
+
`)}addNamespace(t,a){let s=this.namespaceStack[this.namespaceStack.length-1],o=s?`${s}.${t}`:t;this.namespaceStack.push(o);let b=this.namespaces.get(o);if(b)return b.explicit=!0,a&&(b.label=a),o;let l=s||void 0,m=s?s.length+1:0;for(;;){let e=o.indexOf(".",m),M=e===-1,w=M?o:o.slice(0,e),S=this.namespaces.get(w);if(S===void 0){let f=o.slice(m,M?o.length:e);S={id:w,label:M&&a?a:f,classes:new Map,notes:new Map,children:new Map,parent:l,explicit:M},this.namespaces.set(w,S)}else M&&(S.explicit=!0);let d=l?this.namespaces.get(l):void 0;if(d&&(d.children.has(w)||d.children.set(w,S),S.parent??(S.parent=l)),M)return o;l=w,m=e+1}}popNamespace(){this.namespaceStack.pop()}addClassesToNamespace(t,a,s){let o=this.namespaces.get(t);if(o!==void 0){for(let b of a){let{className:l}=j(b),m=this.classes.get(l);m!==void 0&&(m.parent=t,o.classes.set(l,m))}for(let b of s){let l=this.notes.get(b);l!==void 0&&(l.parent=t,o.notes.set(b,l))}}}setCssStyle(t,a){let s=this.classes.get(t);if(!(!a||!s))for(let o of a)for(let b of o.split(","))s.styles.push(b)}},ct=["$end","INVALID","CLASS_DIAGRAM","NEWLINE","EOF","SQS","STR","SQE","DOT","GENERICTYPE","LABEL","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","STRUCT_START","STRUCT_STOP","NAMESPACE","STYLE_SEPARATOR","ANNOTATION_START","ANNOTATION_END","CLASS","MEMBER","NOTE_FOR","NOTE","CLASSDEF","ALPHA","COMMA","direction_tb","direction_bt","direction_rl","direction_lr","AGGREGATION","EXTENSION","COMPOSITION","DEPENDENCY","LOLLIPOP","LINE","DOTTED_LINE","CALLBACK","LINK","LINK_TARGET","CLICK","CALLBACK_NAME","CALLBACK_ARGS","HREF","STYLE","CSSCLASS","COLON","BRKT","PCT","MINUS","UNICODE_TEXT","BQUOTE_STR","EDGE_STATE","EOF_IN_STRUCT","OPEN_IN_STRUCT","PLUS","EQUALS","PUNCTUATION"],Zt=[4,6,4,9,44,45,12,14,15,4,56,4,56],qt=[/.*direction\s+TB[^\n]*/y,/.*direction\s+BT[^\n]*/y,/.*direction\s+RL[^\n]*/y,/.*direction\s+LR[^\n]*/y],Be=/[\n\r\u2028\u2029]/g;function Jt(t){let a=t.length,s=[],o=[],b=[],l=[],m=0,e=0,M=t.indexOf("direction"),w=-1,S=0,d=(i,c,y)=>(s.push(i),o.push(t.slice(c,y)),b.push(c),e=y,!0),f=i=>{l.push(m),m=i},k=()=>{l.length>0&&(m=l.pop())},N=i=>t.startsWith(i,e)&&!me(t.charCodeAt(e+i.length)),U=i=>{for(;i<a&&V(t.charCodeAt(i));)i++;return i},I=i=>{let c=t.indexOf(i,e);return c===-1?a:c},B=i=>{let c=e,y=-1;for(let R=t.charCodeAt(c);c<a&&V(R);R=t.charCodeAt(++c))R===10&&(y=c);if(y<0){e=c;return}i&&k(),d(3,e,y+1)},Y=i=>{switch(i){case 99:if(N("cssClass"))return d(48,e,e+8);if(N("callback"))return d(40,e,e+8);if(N("click"))return d(43,e,e+5);break;case 108:if(N("link"))return d(41,e,e+4);break;case 110:if(N("note for"))return d(24,e,e+8);if(N("note"))return d(25,e,e+4);break;case 60:if(t.charCodeAt(e+1)===60)return d(20,e,e+2);break;case 62:if(t.charCodeAt(e+1)===62)return d(21,e,e+2);break;case 104:if(N("href"))return d(46,e,e+4);break}return!1},K=i=>{if(Y(i))return!0;let c=t.charCodeAt(e+1);switch(i){case 34:return f(1),e++,!0;case 126:return f(3),e++,!0;case 96:return f(2),e++,!0;case 95:if(N("_self"))return d(42,e,e+5);if(N("_blank"))return d(42,e,e+6);if(N("_parent"))return d(42,e,e+7);if(N("_top"))return d(42,e,e+4);break;case 60:return c===124?d(34,e,e+2):d(36,e,e+1);case 124:return c===62&&d(34,e,e+2);case 62:return d(36,e,e+1);case 42:return d(35,e,e+1);case 111:if(!me(c))return d(33,e,e+1);break;case 40:return c===41&&d(37,e,e+2);case 45:return c===45?d(38,e,e+2):d(52,e,e+1);case 46:return c===46?d(39,e,e+2):d(8,e,e+1);case 58:{let y=e+1;for(;y<a;){let R=t.charCodeAt(y);if(R===58||R===10||R===59)break;y++}return y>e+1?d(10,e,y):c===58&&t.charCodeAt(e+2)===58&&d(19,e,e+3)}case 43:return d(58,e,e+1);case 37:return d(51,e,e+1);case 61:return d(59,e,e+1);case 91:return d(5,e,e+1);case 93:return d(7,e,e+1);case 33:case 35:case 36:case 38:case 39:case 44:case 63:case 92:case 47:return d(60,e,e+1)}if(me(i)){let y=e+1;for(;me(t.charCodeAt(y));)y++;return d(27,e,y)}return Et(i)&&d(53,e,e+1)},J=()=>{if(M===-1||e<S||(M<e&&(M=t.indexOf("direction",e)),M===-1)||(w<e&&(Be.lastIndex=e,w=Be.test(t)?Be.lastIndex-1:a),M>=w))return!1;for(let i=0;i<4;i++){let c=qt[i];if(c.lastIndex=e,c.test(t))return d(29+i,e,c.lastIndex)}return S=w,!1},F=i=>{if(J())return!0;if(V(i))return B(!1),!0;switch(i){case 37:if(t.charCodeAt(e+1)===37){let c=I(`
|
|
3
|
+
`);for(;c<a&&(t.charCodeAt(c)===10||t.charCodeAt(c)===13);)c++;return e=c,!0}break;case 97:{let c=t.startsWith("accTitle",e);if(!c&&!t.startsWith("accDescr",e))break;let y=U(e+8),R=t.charCodeAt(y);if(R===58)return d(c?11:13,e,U(y+1)),f(c?6:7),!0;if(R===123&&!c)return e=U(y+1),f(8),!0;break}case 99:if(N("classDiagram-v2"))return d(2,e,e+15);if(N("classDiagram"))return d(2,e,e+12);if(t.startsWith("call",e)&&V(t.charCodeAt(e+4)))return e=U(e+4),f(4),!0;if(N("classDef"))return d(26,e,e+8);if(N("class"))return f(9),d(22,e,e+5);break;case 91:if(t.startsWith("*]",e+1))return d(55,e,e+3);break;case 115:if(N("style"))return d(47,e,e+5);break;case 110:if(N("namespace"))return f(11),d(18,e,e+9);break;case 44:return d(28,e,e+1);case 35:return d(50,e,e+1)}return K(i)||i===58&&d(49,e,e+1)};for(;;){if(e>=a){s.push(Zt[m]),o.push(""),b.push(a);break}let i=t.charCodeAt(e),c=!0;switch(m){case 0:c=F(i);break;case 9:V(i)?B(!0):i===125?(k(),k(),d(17,e,e+1)):i===123?(f(10),d(16,e,e+1)):c=K(i);break;case 10:if(i===34)f(1),e++;else if(i===125)k(),d(17,e,e+1);else if(i===91&&t.startsWith("*]",e+1))d(55,e,e+3);else if(i===123)d(57,e,e+1);else if(i===10)e++;else{let y=e+1;for(;y<a;){let R=t.charCodeAt(y);if(R===123||R===125||R===10)break;y++}d(23,e,y)}break;case 11:V(i)?B(!0):i===123?(f(12),d(16,e,e+1)):i===125?k():i===110&&N("namespace")?(f(11),d(18,e,e+9)):c=K(i);break;case 12:V(i)?B(!1):i===125?(k(),d(17,e,e+1)):i===110&&N("namespace")?(f(11),d(18,e,e+9)):i===91&&t.startsWith("*]",e+1)?d(55,e,e+3):i===99&&N("class")?(f(9),d(22,e,e+5)):c=K(i);break;case 1:i===34?(k(),e++):d(6,e,I('"'));break;case 3:if(i===34)f(1),e++;else{if(Y(i))break;i===126?(k(),e++):d(9,e,I("~"))}break;case 2:if(i===34)f(1),e++;else{if(Y(i))break;i===126?(f(3),e++):i===96?(k(),e++):d(54,e,I("`"))}break;case 4:if(i===40){let y=U(e+1);k(),t.charCodeAt(y)===41?e=y+1:(f(5),e++)}else d(44,e,I("("));break;case 5:i===41?(k(),e++):d(45,e,I(")"));break;case 6:case 7:d(m===6?12:14,e,I(`
|
|
4
|
+
`)),k();break;case 8:i===125?(k(),e++):d(15,e,I("}"));break}if(!c)return s.push(1),o.push(""),b.push(e),{types:s,texts:o,starts:b}}return s.push(0),o.push(""),b.push(a),{types:s,texts:o,starts:b}}var Ye=61,we=new Uint8Array(Ye);for(let t of[53,27,52])we[t]=1;var ze=new Uint8Array(Ye);for(let t of[27,49,50,47,51,10])ze[t]=1;var q=new Uint8Array(Ye);q[33]=1;q[34]=2;q[35]=3;q[36]=4;q[37]=5;var es="'UNICODE_TEXT', 'NUM', 'ALPHA', 'MINUS', 'BQUOTE_STR'";function ts(t,a){let{types:s,texts:o,starts:b}=Jt(t),l=0,m=i=>{let c=s[l];throw c===1?at("class",t,b[l],"",!0):at("class",t,b[l],`Expecting ${i}, got '${ct[c]}'`)},e=i=>(s[l]!==i&&m(`'${ct[i]}'`),o[l++]),M=()=>(we[s[l]]===0&&m("'UNICODE_TEXT', 'NUM', 'ALPHA', 'MINUS'"),o[l++]),w=i=>{let c="";for(;;){if(s[l]===54){c+=o[l++];break}we[s[l]]===0&&m(es),c+=o[l++];let y=s[l];if(y===8)c+=".",l++;else if(we[y]===0&&y!==54)break}return i&&s[l]===9&&(c+="~"+o[l++]+"~"),c},S=()=>{l++;let i=e(6);return e(7),i},d=()=>{s[l]!==23&&m("'STRUCT_STOP', 'MEMBER'");let i=[];for(;s[l]===23;)i.push(o[l++]);return e(17),i.reverse()},f=()=>{l++;let i=w(!0);switch(a.addClass(i),s[l]===5&&a.setClassLabel(i,S()),s[l]){case 19:{l++;let c=M();a.setCssClass(i,c),s[l]===16&&(l++,a.addMembers(i,d()));break}case 16:l++,s[l]===17?l++:a.addMembers(i,d());break;case 20:{l++;let c=M();e(21),a.addAnnotation(i,c),s[l]===16&&(l++,s[l]===17?l++:a.addMembers(i,d()));break}}return i},k=()=>{if(s[l++]===25)return a.addNote(e(6));let i=w(!0);return a.addNote(e(6),i)},N=()=>{let i=[];for(;;){l++;let c=w(!1),y=s[l]===5?a.addNamespace(c,S()):a.addNamespace(c);e(16),s[l]===3&&l++,i.push({id:y,classes:[],notes:[]});let R=!0;for(;R;){let G=i[i.length-1],W=s[l];if(W===18)break;for(W===22?G.classes.push(f()):W===25||W===24?G.notes.push(k()):m("'NAMESPACE', 'CLASS', 'NOTE_FOR', 'NOTE'");;){if(s[l]===3){let H=s[l+1];if(H===18||H===22||H===25||H===24){l++;break}l++}e(17);let X=i.pop();if(a.addClassesToNamespace(X.id,X.classes,X.notes),a.popNamespace(),i.length===0){R=!1;break}}}if(i.length===0)return}},U=()=>{let i=q[s[l]];return i===0?"none":(l++,i-1)},I=()=>{let i=w(!0),c=s[l];if(c===10){a.addMember(i,a.cleanupLabel(o[l++]));return}let y="none";if(c===6)y=o[l++],c=s[l];else if(q[c]===0&&c!==38&&c!==39)return;let R=U();c=s[l],c!==38&&c!==39&&m("'AGGREGATION', 'EXTENSION', 'COMPOSITION', 'DEPENDENCY', 'LOLLIPOP', 'LINE', 'DOTTED_LINE'"),l++;let G=U(),W=s[l]===6?o[l++]:"none",X=w(!0),H={id1:i,id2:X,relation:{type1:R,type2:G,lineType:c===38?0:1},relationTitle1:y,relationTitle2:W};s[l]===10&&(H.title=a.cleanupLabel(o[l++])),a.addRelation(H)},B=()=>{let i=[];for(;;){ze[s[l]]===0&&m("'ALPHA', 'NUM', 'COLON', 'UNIT', 'SPACE', 'BRKT', 'STYLE', 'PCT', 'LABEL'");let c=o[l++];for(;ze[s[l]]===1;)c+=o[l++];if(i.push(c),s[l]!==28)return i;l++}},Y=i=>{s[l]===6&&a.setTooltip(i,o[l++])},K=i=>{let c=e(6),y=s[l]===6?o[l++]:void 0;s[l]===42?a.setLink(i,c,o[l++]):a.setLink(i,c),y!==void 0&&a.setTooltip(i,y)},J=()=>{let i=s[l];switch(i){case 53:case 27:case 52:case 54:I();return;case 18:N();return;case 22:f();return;case 23:l++;return;case 20:{l++;let c=M();e(21),a.addAnnotation(w(!0),c);return}case 40:{l++;let c=w(!0);a.setClickEvent(c,e(6)),Y(c);return}case 41:l++,K(w(!0));return;case 43:{l++;let c=w(!0);if(s[l]===46){l++,K(c);return}let y=e(44);s[l]===45?a.setClickEvent(c,y,o[l++]):a.setClickEvent(c,y),Y(c);return}case 47:{l++;let c=e(27);a.setCssStyle(c,B());return}case 48:{l++;let c=e(6);a.setCssClass(c,e(27));return}case 25:case 24:k();return;case 26:{l++;let c=[e(27)];for(;s[l]===28;)l++,c.push(e(27));a.defineClass(c,B());return}case 29:case 30:case 31:case 32:l++,a.setDirection(i===29?"TB":i===30?"BT":i===31?"RL":"LR");return;case 11:l++,a.setAccTitle(e(12).trim());return;case 13:l++,a.setAccDescription(e(14).trim());return;case 15:a.setAccDescription(o[l++].trim());return}m("'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'NAMESPACE', 'ANNOTATION_START', 'CLASS', 'MEMBER', 'NOTE_FOR', 'NOTE', 'CLASSDEF', 'direction_tb', 'CALLBACK', 'LINK', 'CLICK', 'STYLE', 'CSSCLASS', 'ALPHA', 'MINUS', 'BQUOTE_STR'")},F=s[l]===2;for(F&&(l++,e(3));J(),!(s[l]!==3||(l++,s[l]===4||s[l]===0)););F&&e(4),e(0)}var ss=["aggregation","extension","composition","dependency","lollipop"];function dt(t){return typeof t=="number"&&ss[t]||"none"}function rs(t,a=!0){let s=[],o=[],b=new Map,l=new Map,m=new Map,e=new Map,M=f=>{if(a||f===void 0)return f;let k=[],N=f,U;for(;N;){if(e.has(N)){U=e.get(N);break}let I=t.namespaces.get(N);if(I===void 0)break;if(I.explicit){U=N;break}k.push(N),N=I.parent}for(let I of k)e.set(I,U);return U},w=f=>f===void 0?-1:b.get(f)??-1;for(let f of t.namespaces.values())!a&&!f.explicit||(b.set(f.id,s.length),s.push({id:f.id,label:a?f.label:f.id,isGroup:!0,shape:"rect",parentId:a?f.parent:void 0,parent:-1}));for(let f of s)f.parent=w(f.parentId);let S=0;for(let f of t.classes.values()){let k=M(f.parent);l.set(f.id,s.length),s.push({id:f.id,label:f.label,isGroup:!1,shape:"classBox",parentId:k,parent:w(k),classNode:f,colorIndex:S++})}for(let f of t.notes.values()){let k=M(f.parent),N=f.class===void 0?void 0:l.get(f.class);N!==void 0&&o.push({id:`edgeNote${f.index}`,start:f.id,end:s[N].id,source:s.length,target:N,label:void 0,arrowTypeStart:"none",arrowTypeEnd:"none",startLabelRight:"",endLabelLeft:"",pattern:"dotted",classes:"relation"}),s.push({id:f.id,label:f.text,isGroup:!1,shape:"note",parentId:k,parent:w(k)})}for(let f of t.interfaces){let k=l.get(f.classId);m.set(f.id,s.length),s.push({id:f.id,label:f.label,isGroup:!1,shape:"interface",parentId:void 0,parent:k===void 0?-1:s[k].parent})}let d=0;for(let f of t.relations){d++;let{type1:k,type2:N}=f.relation,U=k===de.LOLLIPOP&&N==="none"?m:l,I=U===l&&N===de.LOLLIPOP&&k==="none"?m:l;o.push({id:`id_${f.id1}_${f.id2}_${d}`,start:f.id1,end:f.id2,source:U.get(f.id1)??-1,target:I.get(f.id2)??-1,label:f.title,arrowTypeStart:dt(k),arrowTypeEnd:dt(N),startLabelRight:f.relationTitle1==="none"?"":f.relationTitle1,endLabelLeft:f.relationTitle2==="none"?"":f.relationTitle2,pattern:f.relation.lineType===1?"dashed":"solid",classes:"relation"})}return{nodes:s,edges:o}}var Fe=12,ce=16,oe=6,Ae=5;function ht(t){switch(t){case"extension":return Fe;case"composition":case"aggregation":return ce;case"lollipop":return 2*Ae;case"dependency":return Yt("arrow_point")}return 0}function ft(t,a,s,o,b,l){let m=-b,e=o;switch(t){case"extension":{let M=a-o*Fe,w=s-b*Fe;return`<path class="pele-marker" d="M${g(a)},${g(s)}L${g(M+m*oe)},${g(w+e*oe)}L${g(M-m*oe)},${g(w-e*oe)}Z" stroke-linejoin="round"/>`}case"composition":case"aggregation":{let M=a-o*ce/2,w=s-b*ce/2,S=oe-1;return`<path class="pele-marker" d="M${g(a)},${g(s)}L${g(M+m*S)},${g(w+e*S)}L${g(a-o*ce)},${g(s-b*ce)}L${g(M-m*S)},${g(w-e*S)}Z" stroke-linejoin="round"${t==="composition"?` fill="${l}"`:""}/>`}case"lollipop":return`<circle class="pele-marker" cx="${g(a-o*Ae)}" cy="${g(s-b*Ae)}" r="${Ae}"/>`;case"dependency":return Ft("arrow_point",a,s,o,b,l)}return""}var as=40,ls=16,pt=56,Z=20,ut=26,He=12,$e=8,mt=6,is=10,ns=64,Te=8,We="var(--_l)",os=new Set(["_self","_blank","_parent","_top"]);function gt(t,a,s){let o=t[a];return typeof o=="number"&&o>0?Math.min(o,2e3):s}var ye=[],Ce=[];function bt(t,a,s){let o=te(t.getDisplayDetails().displayText).trim();return{text:o,width:a.width(o,s,t.classifier==="*"?2:0),classifier:t.classifier}}function cs(t,a,s){let o=b=>Ht(s,l=>ds(t,a,s,b,l));return Gt(t.direction)?Bt(s,o):o(!1)}function ds(t,a,s,o,b){let l=a.class??{},m=rs(t,l.hierarchicalNamespaces!==!1),e=l.hideEmptyMembersBox===!0,M=s.fontSize??16,w=Math.round(M*.875),S=Math.round(M*.8),d=Math.round(S*1.4),f=s.measurer??Ut(s.fontFamily),k=s.padding??8,N=o?"TB":_t(t.direction),U=new Map,I=new Map,B=new Map,Y=r=>{let n=U.get(r);if(n===void 0){let h=Ue([r]);n=h.shape===""&&h.text===""?"":r.slice(0,r.indexOf(":")).trim().toLowerCase(),U.set(r,n)}n!==""&&B.set(n,r)},K=r=>{B.clear();let n=I.get(r.cssClasses);if(n===void 0){for(let h of r.cssClasses.split(" ")){let p=t.styleClasses.get(h);if(p)for(let u of p.styles)for(let $ of u.split(","))Y($)}n=[...B],I.set(r.cssClasses,n)}else for(let[h,p]of n)B.set(h,p);for(let h of r.styles)Y(h);return Ue(B.size===0?Ce:[...B.values()])},J=new Int32Array(m.nodes.length);for(let r of m.nodes)r.parent>=0&&J[r.parent]++;let F=new Uint8Array(m.nodes.length);for(let r of m.edges){if(r.source<0||r.target<0)continue;let n=m.nodes[r.source].parent,h=m.nodes[r.target].parent;if(n!==h){for(let p=n;p>=0&&F[p]===0;p=m.nodes[p].parent)F[p]=1;for(let p=h;p>=0&&F[p]===0;p=m.nodes[p].parent)F[p]=1}}let i=[],c=[];m.nodes.forEach((r,n)=>{let h,p;if(r.isGroup){let u=ne(r.label,!1,f,M,4e3);h=y(r,u,0,0,M),J[n]>0?(p=ie(0,0),p.isGroup=!0,p.padX=Z,p.padTop=u.height>0?u.height+16:Z,p.padBottom=Z,p.minW=u.width+2*Z-12+(F[n]===1&&!b?Math.min(u.width+24,240):0)):(h.w=Math.max(u.width+2*Z,80),h.h=u.height+2*Z,p=ie(h.w,h.h))}else if(r.classNode)h=R(r,r.classNode),p=ie(h.w,h.h);else if(r.shape==="note"){let u=ne(r.label,!0,f,w,260);h=y(r,u,Math.max(u.width+2*He,40),u.height+2*$e,w),p=ie(h.w,h.h)}else{let u=ne(r.label,!1,f,w,200);h=y(r,u,Math.max(u.width,12)+4,Math.max(u.height,12),w),p=ie(h.w,h.h)}p.parent=r.parent,p.seq=n,i.push(h),c.push(p)});function y(r,n,h,p,u){return{node:r,style:Ue(Ce),label:n,w:h,h:p,loops:0,annotations:Ce,attributes:ye,methods:ye,titleH:0,attributesH:0,fontSize:u}}function R(r,n){let h=K(n),p=h.fontSize??M,u=Math.round(p*.875),$=Math.round(u*1.5),L=n.type?"<"+Le(n.type).replace(/</g,"<").replace(/>/g,">")+">":"",A=ne(n.label+L,!1,f,p,4e3,1|(h.italic?2:0)),C=n.annotations.length>0?n.annotations.map(P=>`«${te(P).trim()}»`):Ce,E=n.members.length>0?n.members.map(P=>bt(P,f,u)):ye,x=n.methods.length>0?n.methods.map(P=>bt(P,f,u)):ye,T=A.width;for(let P of C)T=Math.max(T,f.width(P,S,0));for(let P of E)T=Math.max(T,P.width);for(let P of x)T=Math.max(T,P.width);let D=!(e&&E.length===0&&x.length===0),O=P=>D?P>0?2*mt+P*$:is:0,v=2*$e+C.length*d+Math.max(A.height,Math.round(p*1.5)),z=O(E.length);return{node:r,style:h,label:A,w:Math.max(T+2*He,ns),h:v+z+O(x.length),loops:0,annotations:C,attributes:E,methods:x,titleH:v,attributesH:z,fontSize:p}}let G=[],W=[],X=[],H=[],ee=[],se=new Float64Array(i.length*4),Ke=(r,n,h)=>{se[r*4+n]++,h>se[r*4+n+1]&&(se[r*4+n+1]=h)};for(let r of m.edges){if(r.source<0||r.target<0)continue;let n=ne(r.label,!0,f,w,200),h=r.startLabelRight?f.width(te(r.startLabelRight),S,0):0,p=r.endLabelLeft?f.width(te(r.endLabelLeft),S,0):0;r.source===r.target?(i[r.source].loops++,c[r.source].w+=2*(ut+(n.width>0?n.width+12:0))):(Ke(r.source,0,h),Ke(r.target,2,p)),H.push(h),ee.push(p),W.push(r),X.push(n),G.push({src:r.source,dst:r.target,minlen:1,labelW:n.width>0?n.width+12:0,labelH:n.height>0?n.height+4:0,route:[],labelX:0,labelY:0})}if(N==="TB"||N==="BT")for(let r=0;r<i.length;r++){if(!i[r].node.classNode)continue;let n=0;for(let h=0;h<4;h+=2){let p=se[r*4+h],u=se[r*4+h+1];p>1&&(n=Math.max(n,(p-1)*(u>0?u+24:14)+24))}n=Math.min(n,480),n>i[r].w&&(c[r].w+=n-i[r].w,i[r].w=n)}let Ne=!1;for(let r=0;r<W.length&&!Ne;r++)Ne=H[r]>0||ee[r]>0;let Xe=It(c,G,N,{nodeSep:gt(l,"nodeSpacing",as),edgeSep:ls,rankSep:gt(l,"rankSpacing",Ne?pt+16:pt),portSep:20,apart:!0}),xe=new Map,je=[],Qe=(r,n,h,p,u)=>{let $=r.route,L=c[h],A=Pt($,n,L);if(A<0)return;let C=(L.w-i[h].w)/2;A===1?$[n]-=C:A===3&&($[n]+=C);let E=A&1,x=$[(n===0?3:n-3)+E],T=x-$[n+E],D={route:$,at:n,toward:x,order:u,room:p,side:A,after:E?T>0:T>=0},O=h*4+A,v=xe.get(O);return v?v.push(D):xe.set(O,[D]),D},Me=[],Ee=[];for(let r=0;r<G.length;r++){let n=G[r],h=n.src!==n.dst&&n.route.length>=6;Me.push(h?Qe(n,0,n.src,H[r],r):void 0),Ee.push(h?Qe(n,n.route.length-3,n.dst,ee[r],r):void 0)}let $t=(r,n,h)=>{for(let p=c[r].parent,u=0;p>=0&&u<1e4;p=c[p].parent,u++){let $=c[p],L=Math.abs(n-$.x),A=Math.abs(h-$.y);if(Math.abs(A-$.h/2)<.5&&L<=$.w/2+.5||Math.abs(L-$.w/2)<.5&&A<=$.h/2+.5)return!0}return!1},Ve=[];for(let[r,n]of xe){if(n.length<2)continue;let h=r>>2,p=r&1,u=p?i[h].h:i[h].w;n.sort((C,E)=>C.toward-E.toward||C.order-E.order);let $=0;for(let C=0;C+1<n.length;C++){let E=n[C],x=n[C+1],T=p?20:24;E.room>0&&E.after&&(T+=p?d+6:E.room),x.room>0&&!x.after&&(T+=p?d+6:x.room),Ve[C]=T,$+=T}let L=Math.min(1,(u-24)/$);if(L<=0)continue;let A=(p?c[h].y:c[h].x)-$*L/2;for(let C=0;C<n.length;C++){let{route:E,at:x}=n[C],T=x===0?3:-3,D=x+T,O=-1;for(let v=D;v>=0&&v<E.length&&Math.abs(E[v+p]-E[D+p])<.5;v+=T)if($t(h,E[v],E[v+1])){O=v;break}if(O>=0&&Math.abs(E[D+p]-A)<=24)for(let v=D;v!==O+T;v+=T)E[v+p]=A;E[x+p]=A,A+=Ve[C]*L}}let Ze=(r,n,h,p)=>{if(n===void 0||h<=0)return;let u=n.side&1,$=p?0:r.length-3,L=$+1-u,A=Math.abs(r[(p?3:$-3)+1-u]-r[L]),C=Math.min(u?h+10:d+6,A*.35);if(C<4)return;let E=[r[$],r[$+1],r[$+2]];E[1-u]+=(n.side===0||n.side===3?-1:1)*C,r.splice(p?3:$,0,E[0],E[1],E[2])};for(let r=0;r<G.length;r++)Ze(G[r].route,Me[r],H[r],!0),Ze(G[r].route,Ee[r],ee[r],!1);let he=0,fe=0,ke=Xe.width,Se=Xe.height,pe=(r,n,h,p,u,$)=>{if(!r)return;let L=h,A=p;u&1?(L+=(u===3?-1:1)*(5+n/2),A+=($?1:-1)*(7+d/2)):(L+=($?1:-1)*(9+n/2),A+=(u===0?-1:1)*(3+d/2)),je.push({text:te(r),x:L,y:A}),he=Math.min(he,L-n/2),ke=Math.max(ke,L+n/2),fe=Math.min(fe,A-d/2),Se=Math.max(Se,A+d/2)},qe=new Map,Je=new Int32Array(G.length);for(let r=0;r<G.length;r++){let n=G[r],h=W[r],p=n.route;if(n.src===n.dst){let u=qe.get(n.src)??0;qe.set(n.src,u+1),Je[r]=u;let $=c[n.src],L=i[n.src],A=$.x+L.w/2,C=Math.min(L.h/2-4,8+u*6);pe(h.startLabelRight,H[r],A,$.y-C,1,!1),pe(h.endLabelLeft,ee[r],A,$.y+C,1,!0)}else if(p.length>=6){let u=p.length-3,$=Me[r],L=Ee[r];pe(h.startLabelRight,H[r],p[0],p[1],$?$.side:2,$?$.after:!0),pe(h.endLabelLeft,ee[r],p[u],p[u+1],L?L.side:0,L?L.after:!0)}}let Q=k-he,re=k-fe,Tt=Math.ceil(ke-he+2*k),yt=Math.ceil(Se-fe+2*k),et=[],ve=new Map;if(m.nodes.length>0&&m.nodes[0].isGroup)for(let r of G)kt(ve,r.route);let Oe="",_e="",ue="";for(let r=0;r<i.length;r++){let n=i[r],h=c[r],p=n.node,u=h.x+Q,$=h.y+re,L=Ge(p.id),A=h.isGroup?h.w:n.w,C=h.isGroup?h.h:n.h;if(p.isGroup){let x=h.isGroup?St(h,n.label.width,ve,Z):h.x,T=$-C/2+8+n.label.height/2,D=' class="pele-cluster-label" fill="var(--_m)"',O=h.isGroup&&vt(h,n.label.width,x,ve);O&&(_e+=Ot(n.label,x+Q,T,D,L,m.nodes,r)),Oe+=`<g class="pele-cluster pele-namespace" data-id="${L}"><rect x="${g(u-A/2)}" y="${g($-C/2)}" width="${g(A)}" height="${g(C)}" rx="${lt}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"/>`+(O?"":ge(n.label,x+Q,T,D))+"</g>";continue}let E=` transform="translate(${g(u)},${g($)})"`;if(p.classNode)ue+=Ct(n,p.classNode,L,E);else if(p.shape==="note"){let x=A/2,T=-C/2;ue+=`<g class="pele-node pele-note" data-id="${L}"${E}><path d="M${g(-x)},${g(T)}H${g(x-Te)}L${g(x)},${g(T+Te)}V${g(-T)}H${g(-x)}Z" fill="var(--_a)" stroke="var(--_b)" stroke-linejoin="round"/><path d="M${g(x-Te)},${g(T)}V${g(T+Te)}H${g(x)}" fill="none" stroke="var(--_b)" stroke-linejoin="round"/>`+ge(n.label,0,0,` class="pele-label" font-size="${w}"`,s.icons)+"</g>"}else ue+=`<g class="pele-node pele-interface" data-id="${L}"${E}>`+ge(n.label,0,0,` class="pele-label" font-size="${w}"`,s.icons)+"</g>"}function Ct(r,n,h,p){let{w:u,h:$,style:L}=r,A=-u/2,C=-$/2,E=Math.round(r.fontSize*.875),x=Math.round(E*1.5),T=`<rect x="${g(A)}" y="${g(C)}" width="${g(u)}" height="${g($)}" rx="${lt}" fill="var(--_s)" stroke="var(--_b)"${L.shape}/>`,D=C+r.titleH,O=D+r.attributesH;if($>r.titleH){let le=L.stroke?` style="stroke:${be(L.stroke)}"`:"";T+=`<path class="pele-divider" d="M${g(A)},${g(D)}H${g(-A)}M${g(A)},${g(O)}H${g(-A)}" fill="none" stroke="var(--_b)"${le}/>`}let v=C+$e;for(let le of r.annotations)T+=`<text class="pele-annotation" x="0" y="${g(v+d/2+S*.35)}" text-anchor="middle" font-size="${S}" fill="var(--_m)">${be(le)}</text>`,v+=d;let z=r.fontSize===M?"":` font-size="${g(r.fontSize)}"`;T+=ge(r.label,0,(v+D-$e)/2,` class="pele-label"${z} font-weight="var(--_hw)"${L.text}`,s.icons);let P=(le,Lt,wt)=>{let tt="",st=wt+mt+x/2+E*.35;for(let Pe of le){let At=Pe.classifier==="$"?` pele-static"${L.text?L.text.slice(0,-1)+'text-decoration:underline"':' style="text-decoration:underline"'}`:Pe.classifier==="*"?` pele-abstract" font-style="italic"${L.text}`:`"${L.text}`;tt+=`<text class="pele-member pele-${Lt}${At} x="${g(A+He)}" y="${g(st)}">${be(Pe.text)}</text>`,st+=x}return tt};return(r.attributes.length>0||r.methods.length>0)&&(T+=`<g class="pele-members" font-size="${E}">${P(r.attributes,"attribute",D)}${P(r.methods,"method",O)}</g>`),n.tooltip&&(T=`<title>${Ge(n.tooltip)}</title>`+T),n.link&&(T=Dt(T,n.link,n.id,et,s,n.linkTarget&&os.has(n.linkTarget)?` target="${n.linkTarget}"`:"")),`<g class="pele-node pele-class${Kt(n.cssClasses.replace(/^default\s?/,""))}" data-id="${h}"${p}>${T}</g>`}let Ie="",Re="";for(let r=0;r<G.length;r++){let n=G[r],h=W[r],p=X[r],u=h.arrowTypeStart,$=h.arrowTypeEnd,L=ht(u),A=ht($),C;if(n.src===n.dst){let x=c[n.src],T=i[n.src],D=Je[r],O=x.x+Q+T.w/2,v=x.y+re,z=Math.min(T.h/2-4,8+D*6),P=ut+D*8;C={d:`M${g(O+L)},${g(v-z)}C${g(O+P+L)},${g(v-z)} ${g(O+P+A)},${g(v+z)} ${g(O+A)},${g(v+z)}`,sx:O,sy:v-z,sdx:-1,sdy:0,ex:O,ey:v+z,edx:-1,edy:0},n.labelX=x.x+T.w/2+P+4+n.labelW/2,n.labelY=x.y}else{let x=n.route;for(let T=0;T<x.length;T+=3)x[T]+=Q,x[T+1]+=re;C=Wt(x,void 0,L,A)}let E=h.pattern==="dashed"?' stroke-dasharray="6 4"':h.pattern==="dotted"?' stroke-dasharray="2 4"':"";if(Ie+=`<g class="pele-edge${h.pattern==="dotted"?" pele-note-edge":" pele-relation"}" data-id="${Ge(h.id)}"><path d="${C.d}"${E}/>`+ft(u,C.sx,C.sy,C.sdx,C.sdy,We)+ft($,C.ex,C.ey,C.edx,C.edy,We)+"</g>",p.width>0){let x=n.labelX+Q,T=n.labelY+re;Re+=zt(h.id,p,x,T,"",s.icons)}}let De="";for(let r of je)De+=`<text class="pele-cardinality" x="${g(r.x+Q)}" y="${g(r.y+re+S*.35)}" text-anchor="middle">${be(r.text)}</text>`;let ae=Mt(t.title,f,M,k,Tt,yt,(Oe?`<g class="pele-clusters">${Oe}</g>`:"")+(Ie?`<g class="pele-edges" fill="none" stroke="${We}" stroke-linecap="round">${Ie}</g>`:"")+(_e?`<g class="pele-cluster-titles">${_e}</g>`:"")+(Re?`<g class="pele-edge-labels" font-size="${w}">${Re}</g>`:"")+(De?`<g class="pele-cardinalities" font-size="${S}" fill="var(--_m)">${De}</g>`:"")+`<g class="pele-nodes">${ue}</g>`);return{svg:Xt("class",ae.width,ae.height,M,s,t,ae.content),width:ae.width,height:ae.height,links:et}}var As={type:"class",parse(t,a,s){let o=new Vt;return s&&(o.title=s),ts(t,o),o},render:cs};export{As as classDiagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function l(o,f,e){for(let t=0;t<e.length;t++){let n=o.charCodeAt(f+t),r=e.charCodeAt(t);if(n!==r&&!(r>=97&&r<=122&&n===r-32))return!1}return!0}export{l as s};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{$ as O,W as B}from"./lazy-CKqR1774.js";var D=/[&<>"\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/,T=/[&<>"]|[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]+/g,q={"&":"&","<":"<",">":">",'"':"""};function v(e){return D.test(e)?e.replace(T,t=>q[t]??""):e}function _(e){return v(O(e))}var k=[];for(let e=0;e<100;e++)k.push(e===0?"":e%10===0?"."+e/10:"."+(e<10?"0"+e:e));function $(e){let t=Math.round(e*100);if(t===0)return"0";if(t>0){if(t<1e11){let r=Math.floor(t/100);return r+k[t-r*100]}}else if(t>-1e11){let r=-t,i=Math.floor(r/100);return"-"+i+k[r-i*100]}return String(t/100)}function fe(e,t,r,i,l){let h=e.lines;if(h.length===0)return"";let f=e.lineHeight,s=e.size*.35,d=r-e.height/2+f/2+s;if(h.length===1&&h[0].length===1&&h[0][0].icon===void 0&&h[0][0].style===0)return`<text${i} x="${$(t)}" y="${$(d)}" text-anchor="middle">${v(h[0][0].text)}</text>`;let n=A(e);i=I(i,n);let c="",a="";for(let o=0;o<h.length;o++){let u=h[o],x=!1;for(let g of u)g.icon!==void 0&&(x=!0);if(x){let g=t-e.widths[o]/2;for(let p of u){if(p.icon!==void 0){let w=e.size*1.1,m=(l==null?void 0:l(p.icon))??"";a+=`<svg class="pele-icon" data-icon="${_(p.icon)}" x="${$(g)}" y="${$(d-s-w/2)}" width="${$(w)}" height="${$(w)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${m}</svg>`}else p.text!==""&&(c+=`<tspan x="${$(g)}" y="${$(d)}" text-anchor="start"${z(p.style&~n)}>${v(p.text)}</tspan>`);g+=p.width}}else{for(let g=0;g<u.length;g++){let p=u[g],w=g===0?` x="${$(t)}" y="${$(d)}"`:"";c+=`<tspan${w}${z(p.style&~n)}>${v(p.text)}</tspan>`}u.length===0&&(c+=`<tspan x="${$(t)}" y="${$(d)}"> </tspan>`)}d+=f}return`<text${i} text-anchor="middle" xml:space="preserve">${c}</text>${a}`}var C=' font-weight="var(--_w)"',F=' font-style="italic"';function z(e){return(e&1?C:"")+(e&2?F:"")}function A(e){let t=3,r=!1;for(let i of e.lines)for(let l of i)l.icon!==void 0||l.text===""||(t&=l.style,r=!0);return r?t:0}function I(e,t){return e+(t&1&&!e.includes(' font-weight="')?C:"")+(t&2&&!e.includes(' font-style="')?F:"")}var P="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg)",ce="var(--_fm)",N="var(--pele-radius,4px)",he="var(--pele-critical,#e45756)",S=String.raw`(?:"[^"'\\\n<>{}();:@]*"|'[^"'\\\n<>{}();:@]*'|[\p{L}\p{N}_-][\p{L}\p{N}_ .-]*)`,R=new RegExp(String.raw`^\s*${S}(?:\s*,\s*${S})*\s*$`,"u");function M(e,t){return e&&R.test(e)?e:t}function Z(e,t,r){return`;--_fm:var(--pele-font-mono,${M(r,"monospace")});font:${e}px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,${M(t,"sans-serif")})`}var G=new Set(["fill","fill-opacity","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","opacity","rx","ry"]),J=new Set(["color","font-size","font-family","font-weight","font-style","text-decoration","letter-spacing","word-spacing","opacity"]),K=/url\s*\(|expression\s*\(|javascript:|[<>{};\\]|@import|image-set|\/\*/i,H={shape:"",line:"",text:"",stroke:void 0,bold:!1,italic:!1,fontSize:void 0};function de(e){if(e.length===0)return H;let t=new Map,r=new Map;for(let n of e){let c=n.indexOf(":");if(c<=0)continue;let a=n.slice(0,c).trim().toLowerCase(),o=n.slice(c+1).replace(/!important/gi,"").trim();o===""||K.test(o)||(G.has(a)&&t.set(a,o),J.has(a)&&r.set(a==="color"?"fill":a,o))}if(t.size===0&&r.size===0)return H;let i="",l="";for(let[n,c]of t)i+=`${n}:${c};`,n!=="fill"&&n!=="fill-opacity"&&(l+=`${n}:${c};`);let h="";for(let[n,c]of r)h+=`${n}:${c};`;let f=r.get("font-weight"),s=r.get("font-size"),d=s&&/^[\d.]+(px)?$/.test(s)?parseFloat(s):void 0;return{shape:i?` style="${v(i)}"`:"",line:l?` style="${v(l)}"`:"",text:h?` style="${v(h)}"`:"",stroke:t.get("stroke"),bold:f==="bold"||f==="bolder"||Number(f)>=600,italic:r.get("font-style")==="italic",fontSize:d!==void 0&&d>0&&d<=200?d:void 0}}var Q=/[^\w-]+/g;function ue(e){let t=e.replace(Q," ").trim();return t===""?"":" "+t}var U=["#4c78a8","#f58518","#54a24b","#e45756","#72b7b2","#eeca3b","#b279a2","#9d755d"];function ge(e){let t=(e%8+8)%8;return`var(--pele-series-${t+1},${U[t]})`}var y=` rx="${N}"`,V=/<rect\b[^>]*>/g;function X(e){return e.includes(y)?e.replace(V,t=>{let r=t.indexOf(y);if(r<0)return t;let i=t.slice(0,r)+t.slice(r+y.length),l=i.indexOf(' style="');if(l>=0)return`${i.slice(0,l+8)}rx:var(--_r);${i.slice(l+8)}`;let h=i.endsWith("/>")?i.length-2:i.length-1;return`${i.slice(0,h)} style="rx:var(--_r)"${i.slice(h)}`}):e}var Y=[["--_tw","title"],["--_hw","heading"],["--_w","bold"]];function pe(e,t,r,i,l,h,f){let s=v(l.idPrefix??"pele"),d="",n="";h.accTitle&&(d+=`<title id="${s}-title">${_(h.accTitle)}</title>`,n+=` aria-labelledby="${s}-title"`),h.accDescr&&(d+=`<desc id="${s}-desc">${_(h.accDescr)}</desc>`,n+=` aria-describedby="${s}-desc"`);let c=l.responsive===!1?"":"max-width:100%;height:auto;";f=X(f);let a=f.includes("var(--_r)")?`;--_r:${N}`:"";for(let[o,u]of Y)f.includes(`var(${o})`)&&(a+=`;${o}:var(--pele-${u}-weight,bold)`);return`<svg xmlns="http://www.w3.org/2000/svg" class="pele pele-${e}" viewBox="0 0 ${t} ${r}" width="${t}" height="${r}" style="${c}${P}${a}${v(Z(i,l.fontFamily,l.fontFamilyMono))}" fill="var(--_fg)" role="graphics-document document" aria-roledescription="${e}"${n}>`+d+f+"</svg>"}var ee=1.5,te=/<br\s*\/?>|\\n|\n/gi,j=/<\/?([a-zA-Z][\w-]*)(?:\s[^<>]*)?\/?>/y,E=/(fa[bklrs]?):fa-([\w-]+)/g,ie=/[<\\\n*_]|fa[bklrs]?:fa-/,le={lines:[],widths:[],width:0,height:0,size:0,lineHeight:0};function re(e){let t=e.split(`
|
|
2
|
+
`),r=1/0;for(let i of t){if(i.trim()==="")continue;let l=i.length-i.trimStart().length;l<r&&(r=l)}return r===1/0||r===0?e:t.map(i=>i.slice(Math.min(r,i.length-i.trimStart().length))).join(`
|
|
3
|
+
`)}function b(e,t,r){if(t==="")return;let i=O(t),l=e[e.length-1];l&&l.style===r&&l.icon===void 0?l.text+=i:e.push({text:i,style:r,width:0})}function ne(e,t,r){if(!t.includes(":fa-")){b(e,t,r);return}let i=0;E.lastIndex=0;let l;for(;(l=E.exec(t))!==null;){let h=`${l[1]}:fa-${l[2]}`;if(b(e,t.slice(i,l.index),r),i=l.index+l[0].length,B(h)!=="")e.push({text:"",style:r,icon:h,width:0});else if(t[i]===" ")i++;else if(i===t.length){let f=e[e.length-1];f&&f.icon===void 0&&(f.text=f.text.trimEnd())}}b(e,t.slice(i),r)}function oe(e,t,r,i){let l=i,h=0,f="",s=0,d=t.length,n=()=>{ne(e,f,l),f=""};for(;s<d;){let c=t[s];if(c==="<"){j.lastIndex=s;let a=j.exec(t);if(a&&a.index===s){let o=a[1].toLowerCase(),u=t[s+1]==="/",x=o==="b"||o==="strong"?1:o==="i"||o==="em"?2:0;x&&(n(),l=u?l&~x|i&x:l|x),s+=a[0].length;continue}}else if(r&&(c==="*"||c==="_")){let a=t[s+1]===c,o=a?1:2,u=a?2:1,x=(h&o)===0,g=s>0?t[s-1]:" ",p=s+u<d?t[s+u]:" ",w=x&&p.trim()!==""&&t.indexOf(a?c+c:c,s+u)!==-1,m=!x&&g.trim()!=="",W=c==="_"&&/\w/.test(g)&&/\w/.test(p);if((w||m)&&!W){n(),h=w?h|o:h&~o,l=w?l|o:l&~o|i&o,s+=u;continue}}f+=c,s++}n()}function se(e,t,r){let i=0;for(let l of e)l.width=l.icon!==void 0?r*1.25:t.width(l.text,r,l.style),i+=l.width;return i}function L(e,t,r,i,l,h){let f=[],s=0,d=()=>{let n=f[f.length-1];if(n&&n.icon===void 0){let c=n.text.trimEnd();if(c!==n.text){n.text=c;let a=t.width(c,r,n.style);s+=a-n.width,n.width=a}}l.push(f),h.push(s),f=[],s=0};for(let n of e){if(n.icon!==void 0){let c=r*1.25;s>0&&s+c>i&&d(),f.push({...n,width:c}),s+=c;continue}for(let c of n.text.match(/\s*\S+\s*|\s+/g)??[]){let a=c;s>0&&s+t.width(a.trimEnd(),r,n.style)>i&&(d(),a=a.trimStart());let o=f[f.length-1];if(o&&o.style===n.style&&o.icon===void 0){o.text+=a,o.width=t.width(o.text,r,o.style),s=0;for(let u of f)s+=u.width}else{let u=t.width(a,r,n.style);f.push({text:a,style:n.style,width:u}),s+=u}}}(f.length>0||l.length===0)&&d()}function xe(e,t,r,i,l,h=0){if(e===void 0||e==="")return le;let f=Math.round(i*ee);if(!ie.test(e)&&!e.includes("&")&&!e.includes("fl")){let a=e.trim(),o=r.width(a,i,h);if(o<=l||!a.includes(" "))return{lines:[[{text:a,style:h,width:o}]],widths:[o],width:o,height:f,size:i,lineHeight:f};let u=[],x=[];L([{text:a,style:h,width:o}],r,i,l,u,x);let g=0;for(let p of x)p>g&&(g=p);return{lines:u,widths:x,width:g,height:u.length*f,size:i,lineHeight:f}}let s=t?re(e.replace(/\r\n?/g,`
|
|
4
|
+
`)).trim():e.trim(),d=[],n=[],c=0;for(let a of s.split(te)){let o=[];oe(o,a.trim(),t,h);let u=se(o,r,i);u>l?L(o,r,i,l,d,n):(d.push(o),n.push(u))}for(let a of n)a>c&&(c=a);return{lines:d,widths:n,width:c,height:d.length*f,size:i,lineHeight:f}}export{pe as $,z as T,A as Y,xe as _,N as a,v as b,fe as f,de as g,ue as h,ge as m,ce as p,I as q,he as u,$ as x,_ as y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as s}from"./RZSVICHU-BiwjruZZ.js";var u=/<(?!br\s*\/?>)/gi,g=/:fa-/g,h=/<br\s*\/?>|fl°°?\w+¶ß|&#?\w+;|[\ud800-\udbff][\udc00-\udfff]|[\s\S]/gi;function c(f,r,n,t,i=0){let e=f;return e!==void 0&&(e.includes("<")&&(e=e.replace(u,"<")),e.includes(":fa-")&&(e=e.replace(g,":fa-"))),s(e,!1,r,n,t,i)}function b(f,r,n,t,i=0){let e=c(f,r,n,t,i);if(f===void 0||e.width<=t)return e;let d="",o=0;for(let l of f.match(h)??[]){if(l.trim()===""||l.length>2&&l[0]==="<")o=0;else{let a=r.width(l.length>2?"x":l,n,i);o>0&&o+a>t&&(d+=`
|
|
2
|
+
`,o=0),o+=a}d+=l}return c(d,r,n,t,i)}export{b as T,c as s};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var vt=Object.defineProperty;var xt=(t,l,i)=>l in t?vt(t,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[l]=i;var A=(t,l,i)=>xt(t,typeof l!="symbol"?l+"":l,i);import{X as ot,W as kt,Y as Mt}from"./N6DAJLIZ-BsZQKTyT.js";import{H as bt,q as _t,x as G,W as St}from"./lazy-CKqR1774.js";import{M as Lt,A as Ct,O as Wt}from"./JZWSX6AR-OwVPptYv.js";import{h as At}from"./DKTLEL5E-B7ILCVTH.js";import{_ as pt,a as ct,x as S,b as mt,h as dt,y as gt,f as $t,$ as zt,q as Tt,u as ft}from"./RZSVICHU-BiwjruZZ.js";import"./index-392ivruk.js";var Ht=class{constructor(){A(this,"type","kanban");A(this,"title");A(this,"sections",[]);A(this,"getType",kt);A(this,"last");A(this,"sectionLevel",0);A(this,"misplaced")}addNode(t,l,i,d,s){let r={id:l,level:t,label:i};if(s!==void 0){let h=s.includes(`
|
|
2
|
+
`)?s+`
|
|
3
|
+
`:`{
|
|
4
|
+
`+s+`
|
|
5
|
+
}`,e;try{e=_t(h)}catch(n){throw new G(`Metadata of "${r.id}" is not valid YAML. ${n.message}`,"syntax",{type:"kanban"})}if(e!==null&&typeof e=="object"&&!Array.isArray(e)){let n=e.shape?String(e.shape):"";if(n!==n.toLowerCase()||n.includes("_"))throw new G(`No such shape: ${n}. Shape names should be lowercase.`,"semantic",{type:"kanban"});e.label&&(r.label=String(e.label)),e.icon&&(r.icon=String(e.icon)),e.assigned&&(r.assigned=String(e.assigned)),e.ticket&&(r.ticket=String(e.ticket)),e.priority&&(r.priority=String(e.priority))}}if(this.misplaced)throw new G(`Items without section detected, found section ("${this.misplaced.label}")`,"semantic",{type:"kanban"});let a=this.sections;if(a.length===0&&(this.sectionLevel=t),this.last=r,t===this.sectionLevel){let h=r;h.items=[],a.push(h)}else a[a.length-1].items.push(r),t<this.sectionLevel&&(this.misplaced=r)}decorateNode(t){let l=this.last;!t||!l||(t.icon&&(l.icon=t.icon),t.class&&(l.cssClasses=t.class))}};function It(t,l){Mt(t,l,!0)}var k=12,z=8,M=10,X=8,Nt=4,J=6,qt=new Map([["very high",`stroke="${ft}"`],["high",`stroke="${ft}" opacity="0.5"`],["low",'stroke="var(--_m)" opacity="0.5"'],["very low",'stroke="var(--_m)"']]);function R(t,l,i,d,s,r=0){let a=pt(t,l,i,d,s,r);if(a.width<=s)return a;let h=[],e=[],n=0,f=[],o=0,y=()=>{h.push(f),e.push(o),n=Math.max(n,o),f=[],o=0};for(let $=0;$<a.lines.length;$++){if(a.widths[$]<=s){f=a.lines[$],o=a.widths[$],y();continue}for(let u of a.lines[$]){if(u.icon!==void 0){o>0&&o+u.width>s&&y(),f.push(u),o+=u.width;continue}let b="",v=o;for(let L of u.text){let N=i.width(L,d,u.style);o>0&&o+N>s&&(b&&f.push({text:b,style:u.style,width:o-v}),y(),b="",v=0),b+=L,o+=N}b&&f.push({text:b,style:u.style,width:o-v})}y()}return{...a,lines:h,widths:e,width:n,height:h.length*a.lineHeight}}function F(t,l,i,d,s,r=!1){let a="";for(let h=0;h<t.lines.length;h++){let e=t.lines[h],n=i+(h+.5)*t.lineHeight;if(e.length===1&&e[0].icon===void 0)a+=`<text${Tt(d,e[0].style)} x="${S(l)}" y="${S(n+t.size*.35)}"${r?' text-anchor="end"':""}>${mt(e[0].text)}</text>`;else{let f=t.widths[h],o={...t,lines:[e],widths:[f],height:t.lineHeight};a+=$t(o,l+(r?-f:f)/2,n,d,s)}}return a}var V=t=>!!t&&St(t)!=="";function Ut(t,l,i){let d=i.fontSize??16,s=Math.round(d*.875),r=Math.round(d*1.5),a=Math.round(s*1.5),h=i.measurer??bt(i.fontFamily),e=i.padding??8,n=i.icons,f=l.kanban??{},o=f.sectionWidth,y=typeof o=="number"&&o>0?Math.min(Math.max(o,80),2e3):200,$=i.maxWidth!==void 0&&i.maxWidth>0?i.maxWidth-2*e:1/0,u=t.sections.length,b=u*(y+k)-k<=$,v=b?Math.max(u,1):Math.max(1,Math.floor(($+k)/(y+k))),L=b?y:Math.max(Math.min(y,$),Math.min(Math.floor(($+k)/v)-k,y*2)),N=typeof f.ticketBaseUrl=="string"?f.ticketBaseUrl:"",q=L-2*z,O=q-2*M,C=s*1.25,Q=[],T=t.sections,Z=[],tt=[],et=[],H=r,it=[];for(let c of T){let w=h.width(String(c.items.length),s,0),_=w+12+(V(c.icon)?C+J:0),x=R(c.label,!0,h,d,q-8-_,1);H=Math.max(H,x.height),tt.push(w),Z.push(x);let K=[],p=0;for(let g of c.items){let j=R(g.label,!0,h,s,O-(V(g.icon)?C+J:0)),W=R(g.ticket,!1,h,s,O),m=R(g.assigned,!1,h,s,O),I=W.width+m.width+8>O?W.height+m.height:Math.max(W.height,m.height),E=2*M+Math.max(j.height,a)+(I?Nt+I:0);K.push({item:g,label:j,ticket:W,assigned:m,meta:I,height:E}),p+=E+X}et.push(K),it.push(p)}H+=2*z;let U=[],P=[];for(let c=0,w=0;c<T.length;c+=v){let _=X;for(let x=c;x<Math.min(c+v,T.length);x++)_=Math.max(_,it[x]);P.push(w),U.push(H+_),w+=H+_+k}let ut=U.length>0?P[P.length-1]+U[U.length-1]:0,B=pt(t.title,!1,h,d,At(i),1),lt=B.height>0?B.height+16:0,st=Math.max(Math.min(T.length,v)*(L+k)-k,0),at=Math.max(st,B.width),wt=e+(at-st)/2,ht=L-z-4,nt="";for(let c=0;c<T.length;c++){let w=T[c],_=Math.floor(c/v),x=`<rect width="${L}" height="${S(U[_])}" rx="${ct}" fill="var(--_s)"/>`+F(Z[c],z+4,z,' class="pele-cluster-label" font-weight="var(--_hw)"',n)+`<text class="pele-count" x="${ht}" y="${S(z+r/2+s*.35)}" text-anchor="end" font-size="${s}" fill="var(--_m)">${w.items.length}</text>`;V(w.icon)&&(x+=ot(w.icon,ht-tt[c]-J-C,z+(r-C)/2,C,n));let K=H;for(let p of et[c]){let g=p.item,j=(g.priority??"").trim().toLowerCase(),W=qt.get(j),m=`<rect width="${q}" height="${S(p.height)}" rx="${ct}" fill="var(--_bg)" stroke="var(--_b)"/>`;W!==void 0&&(m+=`<path class="pele-priority" d="M2.5,5V${S(p.height-5)}" fill="none" ${W} stroke-width="3" stroke-linecap="round"/>`),m+=F(p.label,M,M,' class="pele-label"',n),V(g.icon)&&(m+=ot(g.icon,q-M-C,M+(a-C)/2,C,n));let I=p.height-M;if(g.ticket){let E=I-p.meta,D=N?Lt(Ct(N.replace("#TICKET#",()=>g.ticket)),i):void 0;D===void 0?m+=F(p.ticket,M,E,' class="pele-ticket" fill="var(--_m)"',n):(m+=`<a href="${mt(D)}" target="_blank"${Wt(i)}>`+F(p.ticket,M,E,' class="pele-ticket" fill="var(--_c)"',n)+"</a>",Q.push({id:g.id,href:D,internal:!1}))}g.assigned&&(m+=F(p.assigned,q-M,I-p.assigned.height,' class="pele-assigned" fill="var(--_m)"',n,!0)),x+=`<g class="pele-node pele-card${W===void 0?"":" pele-priority-"+j.replace(" ","-")}${dt(g.cssClasses??"")}" data-id="${gt(g.id)}" transform="translate(${z},${S(K)})" font-size="${s}">${m}</g>`,K+=p.height+X}nt+=`<g class="pele-cluster pele-column${dt(w.cssClasses??"")}" data-id="${gt(w.id)}" transform="translate(${S(wt+c%v*(L+k))},${S(e+lt+P[_])})">${x}</g>`}let Y=Math.ceil(at+2*e),rt=Math.ceil(ut+lt+2*e),yt=$t(B,Y/2,e+B.height/2,' class="pele-title" font-weight="var(--_tw)"')+nt;return{svg:zt("kanban",Y,rt,d,i,{},yt),width:Y,height:rt,links:Q}}var Rt={type:"kanban",parse(t,l,i){let d=new Ht;return d.title=i,It(t,d),d},render:Ut};export{Rt as kanban};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as P,x as a}from"./RZSVICHU-BiwjruZZ.js";var l=18,d=12,z=12,o=(e,$,r)=>(r?$:e)-2*z,x=e=>($,r,t)=>t?0:$-2*e(r)-2*z;function V(e,$,r){let t=Math.min(1,Math.abs(e)/$);return r*(1-Math.sqrt(1-t*t))}var p=(e,$,r,t)=>r&1?V(t,$/2,e/2):V(t,e/2,$/2),M=(e,$,r)=>(r?$:e)*.6,q=(e,$,r,t)=>r&1?0:V(t,e/2,Math.min(12,Math.max(6,e/14))),y=(e,$)=>()=>({w:e,h:$,dy:0});function v(e,$,r){let t=Math.max(1.6*e+40,80),i=($+10)/(1-(e+8)/t),s=i/2-10-$/2;return{w:t,h:i,dy:r?-s:s}}function f(e,$){return`<path d="${e}"${$}/>`}var g=(e,$,r)=>r&1?$/8:0,m=(e,$)=>({w:Math.max(e+2*l,2*l+12),h:$+2*d,dy:0});function c(e,$){let r="";for(let t=0;t<e.length;t+=2)r+=(t?" ":"")+a(e[t])+","+a(e[t+1]);return`<polygon points="${r}"${$}/>`}function w(e,$,r,t=""){return`<rect x="${a(-e/2)}" y="${a(-$/2)}" width="${a(e)}" height="${a($)}"${t}${r}/>`}var u=` rx="${P}"`,_={rect:{size:m,span:o,draw:(e,$,r)=>w(e,$,r,u)},rounded:{size:m,span:o,draw:(e,$,r)=>w(e,$,r,` rx="${a(Math.min(12,$/2))}"`)},stadium:{inset:(e,$,r,t)=>r&1?V(t,$/2,$/2):0,span:(e,$,r)=>r?$*.6:e-$,size:(e,$)=>{let r=$+2*d;return{w:e+r*.5+2*l-8,h:r,dy:0}},draw:(e,$,r)=>w(e,$,r,` rx="${a($/2)}"`)},"fr-rect":{span:o,size:(e,$)=>({w:e+2*l+16,h:$+2*d,dy:0}),draw:(e,$,r,t)=>{let i=e/2-8;return w(e,$,r,u)+`<path d="M${a(-i)},${a(-$/2)}V${a($/2)}M${a(i)},${a(-$/2)}V${a($/2)}" fill="none"${t}/>`}},cyl:{inset:q,span:(e,$,r)=>r?$-2*z-12:e*.6,size:(e,$)=>{let r=Math.max(e+2*l,56),t=Math.min(12,Math.max(6,r/14));return{w:r,h:$+2*d+2*t,dy:t/2}},draw:(e,$,r,t)=>{let i=e/2,s=Math.min(12,Math.max(6,e/14)),n=-$/2+s,h=$/2-s;return`<path d="M${a(-i)},${a(n)}A${a(i)},${a(s)} 0 0 1 ${a(i)},${a(n)}V${a(h)}A${a(i)},${a(s)} 0 0 1 ${a(-i)},${a(h)}Z"${r}/><path d="M${a(-i)},${a(n)}A${a(i)},${a(s)} 0 0 0 ${a(i)},${a(n)}" fill="none"${t}/>`}},circle:{inset:p,span:M,size:(e,$)=>{let r=Math.max(Math.sqrt(e*e+$*$)+16,44);return{w:r,h:r,dy:0}},draw:(e,$,r)=>`<circle r="${a(e/2)}"${r}/>`},"dbl-circ":{inset:p,span:M,size:(e,$)=>{let r=Math.max(Math.sqrt(e*e+$*$)+26,54);return{w:r,h:r,dy:0}},draw:(e,$,r,t)=>`<circle r="${a(e/2)}"${r}/><circle r="${a(e/2-5)}" fill="none"${t}/>`},ellipse:{inset:p,span:M,size:(e,$)=>({w:e*1.3+2*l,h:$*1.2+2*d,dy:0}),draw:(e,$,r)=>`<ellipse rx="${a(e/2)}" ry="${a($/2)}"${r}/>`},diam:{inset:(e,$,r,t)=>r&1?Math.abs(t)*e/$:Math.abs(t)*$/e,span:(e,$,r)=>(r?$:e)*.6,size:(e,$)=>{let r=e+16,t=$+8;return{w:r+1.6*t,h:r/1.6+t,dy:0}},draw:(e,$,r)=>c([0,-$/2,e/2,0,0,$/2,-e/2,0],r)},hex:{inset:(e,$,r,t)=>r&1?Math.abs(t)/2:0,span:(e,$,r)=>r?$*.5:e-$/2-z,size:(e,$)=>{let r=$+2*d;return{w:e+2*l+r/2,h:r,dy:0}},draw:(e,$,r)=>{let t=$/4;return c([-e/2+t,-$/2,e/2-t,-$/2,e/2,0,e/2-t,$/2,-e/2+t,$/2,-e/2,0],r)}},odd:{inset:(e,$,r)=>r===3?$/4:0,span:x(()=>0),size:(e,$)=>{let r=$+2*d;return{w:e+2*l+r/4,h:r,dy:0}},draw:(e,$,r)=>{let t=$/4;return c([-e/2,-$/2,e/2,-$/2,e/2,$/2,-e/2,$/2,-e/2+t,0],r)}},"lean-r":{inset:g,span:x(e=>e/4),size:(e,$)=>{let r=$+2*d;return{w:e+2*l+r/2,h:r,dy:0}},draw:(e,$,r)=>{let t=$/4;return c([-e/2+t,-$/2,e/2,-$/2,e/2-t,$/2,-e/2,$/2],r)}},"lean-l":{inset:g,span:x(e=>e/4),size:(e,$)=>{let r=$+2*d;return{w:e+2*l+r/2,h:r,dy:0}},draw:(e,$,r)=>{let t=$/4;return c([-e/2,-$/2,e/2-t,-$/2,e/2,$/2,-e/2+t,$/2],r)}},"trap-b":{inset:g,span:x(e=>e/4),size:(e,$)=>{let r=$+2*d;return{w:e+2*l+r/2,h:r,dy:0}},draw:(e,$,r)=>{let t=$/4;return c([-e/2+t,-$/2,e/2-t,-$/2,e/2,$/2,-e/2,$/2],r)}},"trap-t":{inset:g,span:x(e=>e/4),size:(e,$)=>{let r=$+2*d;return{w:e+2*l+r/2,h:r,dy:0}},draw:(e,$,r)=>{let t=$/4;return c([-e/2,-$/2,e/2,-$/2,e/2-t,$/2,-e/2+t,$/2],r)}},text:{span:o,size:(e,$)=>({w:e+8,h:$+8,dy:0}),draw:(e,$)=>w(e,$,' fill="none" stroke="none"')},"sm-circ":{noLabel:!0,inset:p,span:M,size:y(14,14),draw:(e,$,r)=>`<circle r="${a(e/2)}"${r}/>`},"f-circ":{noLabel:!0,inset:p,span:M,size:y(14,14),draw:(e,$,r,t)=>`<circle r="${a(e/2)}" fill="var(--_l)"${t}/>`},"fr-circ":{noLabel:!0,inset:p,span:M,size:y(18,18),draw:(e,$,r,t)=>`<circle r="${a(e/2)}"${r}/><circle r="${a(e/2-4)}" fill="var(--_l)"${t}/>`},fork:{noLabel:!0,span:(e,$,r)=>(r?$:e)-8,size:y(72,8),draw:(e,$,r,t)=>w(e,$,` fill="var(--_l)"${t}`,' rx="2"')},"notch-rect":{size:m,span:o,draw:(e,$,r)=>c([-e/2+10,-$/2,e/2,-$/2,e/2,$/2,-e/2,$/2,-e/2,-$/2+10],r)},"lin-rect":{span:o,size:(e,$)=>({w:e+2*l+8,h:$+2*d,dy:0}),draw:(e,$,r,t)=>w(e,$,r,u)+`<path d="M${a(-e/2+8)},${a(-$/2)}V${a($/2)}" fill="none"${t}/>`},"div-rect":{span:o,size:(e,$)=>({w:e+2*l,h:$+2*d+8,dy:4}),draw:(e,$,r,t)=>w(e,$,r,u)+`<path d="M${a(-e/2)},${a(-$/2+8)}H${a(e/2)}" fill="none"${t}/>`},"win-pane":{span:o,size:(e,$)=>({w:e+2*l+8,h:$+2*d+8,dy:4}),draw:(e,$,r,t)=>w(e,$,r,u)+`<path d="M${a(-e/2+8)},${a(-$/2)}V${a($/2)}M${a(-e/2)},${a(-$/2+8)}H${a(e/2)}" fill="none"${t}/>`},tri:{inset:(e,$,r)=>r&1?e/4:0,size:(e,$)=>v(e,$,!1),draw:(e,$,r)=>c([0,-$/2,e/2,$/2,-e/2,$/2],r)},"flip-tri":{inset:(e,$,r)=>r&1?e/4:0,size:(e,$)=>v(e,$,!0),draw:(e,$,r)=>c([-e/2,-$/2,e/2,-$/2,0,$/2],r)},"sl-rect":{inset:(e,$,r)=>r===0?5:0,size:(e,$)=>({w:e+2*l,h:$+2*d+10,dy:5}),draw:(e,$,r)=>c([-e/2,-$/2+10,e/2,-$/2,e/2,$/2,-e/2,$/2],r)},"notch-pent":{span:o,size:(e,$)=>({w:e+2*l,h:$+2*d,dy:0}),draw:(e,$,r)=>c([-e/2+10,-$/2,e/2-10,-$/2,e/2,-$/2+10,e/2,$/2,-e/2,$/2,-e/2,-$/2+10],r)},hourglass:{noLabel:!0,inset:(e,$,r)=>r&1?e/2:0,size:y(32,40),draw:(e,$,r)=>c([-e/2,-$/2,e/2,-$/2,-e/2,$/2,e/2,$/2],r)},delay:{size:(e,$)=>{let r=$+2*d;return{w:e+2*l+r/4,h:r,dy:0}},draw:(e,$,r)=>{let t=$/2;return`<path d="M${a(-e/2)},${a(-t)}H${a(e/2-t)}A${a(t)},${a(t)} 0 0 1 ${a(e/2-t)},${a(t)}H${a(-e/2)}Z"${r}/>`}},"h-cyl":{size:(e,$)=>{let r=$+2*d,t=Math.min(12,r/4);return{w:e+2*l+2*t,h:r,dy:0}},draw:(e,$,r,t)=>{let i=$/2,s=Math.min(12,$/4),n=-e/2+s,h=e/2-s;return`<path d="M${a(n)},${a(-i)}H${a(h)}A${a(s)},${a(i)} 0 0 1 ${a(h)},${a(i)}H${a(n)}A${a(s)},${a(i)} 0 0 1 ${a(n)},${a(-i)}Z"${r}/><path d="M${a(h)},${a(-i)}A${a(s)},${a(i)} 0 0 0 ${a(h)},${a(i)}" fill="none"${t}/>`}},"cross-circ":{noLabel:!0,inset:p,span:M,size:y(44,44),draw:(e,$,r,t)=>{let i=e/2,s=i*Math.SQRT1_2;return`<circle r="${a(i)}"${r}/><path d="M${a(-s)},${a(-s)}L${a(s)},${a(s)}M${a(s)},${a(-s)}L${a(-s)},${a(s)}" fill="none"${t}/>`}},"st-rect":{span:(e,$,r)=>(r?$:e)-2*z-8,size:(e,$)=>({w:e+2*l+8,h:$+2*d+8,dy:4}),draw:(e,$,r)=>{let t=e-8,i=$-8,s="";for(let n=0;n<3;n++){let h=-e/2+(2-n)*4,A=-$/2+n*4;s+=`<rect x="${a(h)}" y="${a(A)}" width="${a(t)}" height="${a(i)}"${u}${r}/>`}return s}},doc:{inset:(e,$,r)=>r===2?10:0,size:(e,$)=>({w:e+2*l,h:$+2*d+10,dy:-5}),draw:(e,$,r)=>L(e,$,r)},flag:{inset:(e,$,r)=>r&1?0:8,size:(e,$)=>({w:e+2*l,h:$+2*d+16,dy:0}),draw:(e,$,r)=>{let t=e/2,i=$/2-8,s=e/4;return`<path d="M${a(-t)},${a(-i)}q${a(s)},-10 ${a(2*s)},0t${a(2*s)},0V${a(i)}q${a(-s)},10 ${a(-2*s)},0t${a(-2*s)},0Z"${r}/>`}},datastore:{size:m,span:o,draw:(e,$,r,t)=>w(e,$,r.replace('stroke="var(--_b)"','stroke="none"'))+`<path d="M${a(-e/2)},${a(-$/2)}H${a(e/2)}M${a(-e/2)},${a($/2)}H${a(e/2)}" fill="none"${t}/>`},folder:{size:(e,$)=>({w:Math.max(e+2*l,64),h:$+2*d+8,dy:4}),draw:(e,$,r)=>{let t=e/2,i=$/2,s=Math.min(e*.4,48);return f(`M${a(-t)},${a(-i)}H${a(-t+s)}L${a(-t+s+8)},${a(-i+8)}H${a(t)}V${a(i)}H${a(-t)}Z`,r)}},bucket:{size:(e,$)=>({w:e+2*l+20,h:$+2*d+10,dy:3}),inset:(e,$,r)=>r&1?$/12:0,draw:(e,$,r,t)=>{let i=e/2,s=$/2,n=5,h=$/6;return f(`M${a(-i)},${a(-s+n)}A${a(i)},${a(n)} 0 0 1 ${a(i)},${a(-s+n)}L${a(i-h)},${a(s-n)}A${a(i-h)},${a(n)} 0 0 1 ${a(-i+h)},${a(s-n)}Z`,r)+`<path d="M${a(-i)},${a(-s+n)}A${a(i)},${a(n)} 0 0 0 ${a(i)},${a(-s+n)}" fill="none"${t}/>`}},console:{span:o,size:(e,$)=>({w:Math.max(e+2*l,72),h:$+2*d+12,dy:6}),draw:(e,$,r,t)=>w(e,$,r,u)+`<path d="M${a(-e/2)},${a(-$/2+12)}H${a(e/2)}M${a(-e/2+7)},${a(-$/2+4)}l3,2.5l-3,2.5M${a(-e/2+13)},${a(-$/2+9)}h4" fill="none"${t}/>`},browser:{span:o,size:(e,$)=>({w:Math.max(e+2*l,72),h:$+2*d+12,dy:6}),draw:(e,$,r,t)=>{let i="";for(let s=0;s<3;s++)i+=`<circle cx="${a(-e/2+8+s*7)}" cy="${a(-$/2+6)}" r="1.5" fill="none"${t}/>`;return w(e,$,r,u)+`<path d="M${a(-e/2)},${a(-$/2+12)}H${a(e/2)}" fill="none"${t}/>`+i}},person:{size:(e,$)=>({w:Math.max(e+2*l,56),h:$+2*d+26,dy:13}),draw:(e,$,r)=>{let t=-$/2;return`<rect x="${a(-e/2)}" y="${a(t+26)}" width="${a(e)}" height="${a($-26)}" rx="12"${r}/><circle cy="${a(t+14)}" r="13"${r}/>`}},bang:{size:(e,$)=>({w:e+2*l+28,h:$+2*d+24,dy:0}),inset:()=>3,draw:(e,$,r)=>{let t=[];for(let i=0;i<28;i++){let s=Math.PI*i/14-Math.PI/2,n=i%2===0?1:.82;t.push(Math.cos(s)*(e/2)*n,Math.sin(s)*($/2)*n)}return c(t,r)}},cloud:{size:(e,$)=>({w:e+2*l+32,h:$+2*d+24,dy:0}),inset:(e,$,r)=>r&1?2:1,draw:(e,$,r)=>{let t=e/2,i=$/2,s=i*.55;return f(`M${a(-t+s)},${a(i)}A${a(s)},${a(s)} 0 0 1 ${a(-t+s*.6)},${a(-i*.1)}A${a(t*.42)},${a(i*.7)} 0 0 1 ${a(-t*.1)},${a(-i*.72)}A${a(t*.4)},${a(i*.62)} 0 0 1 ${a(t*.62)},${a(-i*.42)}A${a(s*1.05)},${a(s*1.05)} 0 0 1 ${a(t-s)},${a(i)}Z`,r)}},brace:{size:(e,$)=>({w:e+2*l+12,h:$+2*d,dy:0}),draw:(e,$,r,t)=>w(e,$,' fill="none" stroke="none"')+H(-e/2+12,$,-1,t)},"brace-r":{size:(e,$)=>({w:e+2*l+12,h:$+2*d,dy:0}),draw:(e,$,r,t)=>w(e,$,' fill="none" stroke="none"')+H(e/2-12,$,1,t)},braces:{size:(e,$)=>({w:e+2*l+24,h:$+2*d,dy:0}),draw:(e,$,r,t)=>w(e,$,' fill="none" stroke="none"')+H(-e/2+12,$,-1,t)+H(e/2-12,$,1,t)},bolt:{noLabel:!0,size:y(36,56),inset:(e,$,r)=>r&1?e/4:0,draw:(e,$,r)=>c([e*.15,-$/2,-e/2,$*.08,-e*.05,$*.08,-e*.15,$/2,e/2,-$*.08,e*.05,-$*.08],r)},"lin-cyl":{inset:q,span:(e,$,r)=>r?$-2*z-20:e*.6,size:(e,$)=>{let r=Math.max(e+2*l,56),t=Math.min(12,Math.max(6,r/14));return{w:r,h:$+2*d+2*t+8,dy:t/2+4}},draw:(e,$,r,t)=>{let i=e/2,s=Math.min(12,Math.max(6,e/14)),n=-$/2+s,h=$/2-s,A=Z=>`M${a(-i)},${a(Z)}A${a(i)},${a(s)} 0 0 0 ${a(i)},${a(Z)}`;return f(`M${a(-i)},${a(n)}A${a(i)},${a(s)} 0 0 1 ${a(i)},${a(n)}V${a(h)}A${a(i)},${a(s)} 0 0 1 ${a(-i)},${a(h)}Z`,r)+`<path d="${A(n)}${A(n+8)}" fill="none"${t}/>`}},"curv-trap":{size:(e,$)=>{let r=$+2*d;return{w:e+2*l+r*.6,h:r,dy:0}},draw:(e,$,r)=>{let t=e/2,i=$/2,s=$*.3;return f(`M${a(-t+s)},${a(-i)}H${a(t-s)}A${a(s)},${a(i)} 0 0 1 ${a(t-s)},${a(i)}H${a(-t+s)}L${a(-t)},0Z`,r)}},docs:{size:(e,$)=>({w:e+2*l+8,h:$+2*d+18,dy:-1}),inset:(e,$,r)=>r===2?10:0,draw:(e,$,r)=>{let t="";for(let i=0;i<3;i++)t+=`<g transform="translate(${(1-i)*4},${(i-1)*4})">${L(e-8,$-8,r)}</g>`;return t}},"bow-rect":{size:(e,$)=>{let r=$+2*d;return{w:e+2*l+r*.4,h:r,dy:0}},inset:(e,$,r)=>r===1?$*.2:0,draw:(e,$,r)=>{let t=e/2,i=$/2,s=$*.2;return f(`M${a(-t+s)},${a(-i)}H${a(t)}A${a(s)},${a(i)} 0 0 0 ${a(t)},${a(i)}H${a(-t+s)}A${a(s)},${a(i)} 0 0 1 ${a(-t+s)},${a(-i)}Z`,r)}},"tag-rect":{size:m,span:o,draw:(e,$,r,t)=>w(e,$,r,u)+`<path d="M${a(e/2-12)},${a($/2)}L${a(e/2)},${a($/2-12)}" fill="none"${t}/>`},"tag-doc":{size:(e,$)=>({w:e+2*l,h:$+2*d+10,dy:-5}),inset:(e,$,r)=>r===2?10:0,draw:(e,$,r,t)=>L(e,$,r)+`<path d="M${a(e/2-12)},${a($/2-14)}L${a(e/2)},${a($/2-26)}" fill="none"${t}/>`},"lin-doc":{size:(e,$)=>({w:e+2*l+8,h:$+2*d+10,dy:-5}),inset:(e,$,r)=>r===2?10:0,draw:(e,$,r,t)=>L(e,$,r)+`<path d="M${a(-e/2+8)},${a(-$/2)}V${a($/2-6)}" fill="none"${t}/>`},collapsedGroup:{size:(e,$)=>({w:e+2*l+8,h:$+2*d+8,dy:-2}),draw:(e,$,r)=>`<rect x="${a(-e/2+6)}" y="${a(-$/2+8)}" width="${a(e-12)}" height="${a($-8)}"${u}${r}/><rect x="${a(-e/2)}" y="${a(-$/2)}" width="${a(e)}" height="${a($-4)}"${u}${r}/>`}};function H(e,$,r,t){let i=$/2,s=6*r;return`<path d="M${a(e)},${a(-i)}q${a(s)},0 ${a(s)},6V-6q0,6 ${a(s)},6q${a(-s)},0 ${a(-s)},6V${a(i-6)}q0,6 ${a(-s)},6" fill="none"${t}/>`}function L(e,$,r){let t=e/2,i=-$/2,s=$/2-10,n=e/4;return`<path d="M${a(-t)},${a(i)}H${a(t)}V${a(s)}q${a(-n)},-12 ${a(-2*n)},0t${a(-2*n)},0Z"${r}/>`}var I=_.rect,b=new Map(Object.entries(_));function O(e,$,r){return(b.get(e)??I).size($,r)}function R(e,$,r,t,i){return(b.get(e)??I).draw($,r,t,i)}function k(e,$,r,t,i=0){var s,n;return((n=(s=b.get(e))==null?void 0:s.inset)==null?void 0:n.call(s,$,r,t,i))??0}function S(e,$,r,t){var i,s;return Math.max(0,((s=(i=b.get(e))==null?void 0:i.span)==null?void 0:s.call(i,$,r,t))??0)}function B(e){var $;return(($=b.get(e))==null?void 0:$.noLabel)!==!0}function j(e,$,r){let t=e[$]-r.x,i=e[$+1]-r.y;return Math.abs(Math.abs(i)-r.h/2)<.5?i<0?0:2:Math.abs(Math.abs(t)-r.w/2)<.5?t<0?3:1:-1}function D(e,$,r,t){if(t.isGroup)return;let i=j(e,$,t);if(i===0||i===2){let s=k(r.shape,r.w,r.h,i,e[$]-t.x)+(t.h-r.h)/2;e[$+1]+=i===0?s:-s}else if(i>=0){let s=k(r.shape,r.w,r.h,i,e[$+1]-t.y)+(t.w-r.w)/2;e[$]+=i===3?s:-s}}export{D as B,R as E,S as O,O as P,j as R,k as V,d as i,B as j,l as o};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var ie=Object.defineProperty;var oe=(h,s,t)=>s in h?ie(h,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[s]=t;var H=(h,s,t)=>oe(h,typeof s!="symbol"?s+"":s,t);import{k as se}from"./KQOEJWJY-DKTXya68.js";import{e as re,L as ne,i as ee,H as le}from"./lazy-CKqR1774.js";import{c as de,h as pe}from"./DKTLEL5E-B7ILCVTH.js";import{D as te,a as fe}from"./HWDLEDTA-C_JcdBMO.js";import{_ as W,x as r,f as N,y as q,a as $e,$ as he}from"./RZSVICHU-BiwjruZZ.js";import"./index-392ivruk.js";var xe=class{constructor(){H(this,"type","ishikawa");H(this,"title");H(this,"root");H(this,"stack",[]);H(this,"baseLevel")}addNode(h,s){let t={text:s,children:[]};if(!this.root){this.root=t,this.stack=[{level:0,node:t}];return}this.baseLevel??(this.baseLevel=h);let n=Math.max(h-this.baseLevel+1,1),i=this.stack;for(;i.length>1&&i[i.length-1].level>=n;)i.pop();i[i.length-1].node.children.push(t),i.push({level:n,node:t})}},ge=["$end","EOF","SPACELINE","NL","ISHIKAWA","SPACELIST","TEXT"];function be(h,s){let t="ishikawa-beta",n=0;for(;n<13;){let i=h.charCodeAt(s+n),e=t.charCodeAt(n);if(i!==e&&(i+32!==e||i<65||i>90))break;n++}return n===13&&!ee(h.charCodeAt(s+13))?13:n>=8&&!ee(h.charCodeAt(s+8))?8:0}function ce(h){let s=[],t=[],n=[],i=h.length,e=0;for(;e<i;){let $=e,o=-1;for(;$<i&&re(h.charCodeAt($));)h.charCodeAt($)===10&&(o=$),$++;let p,d;if(h.charCodeAt($)===37&&h.charCodeAt($+1)===37)for(p=2,d=$+2;d<i;){let b=h.charCodeAt(d);if(b===10||b===13||b===8232||b===8233)break;d++}else if($===e){let b=be(h,e);b>0?(p=4,d=e+b):(p=6,d=h.indexOf(`
|
|
2
|
+
`,e),d===-1&&(d=i))}else o>e?(p=2,d=o+1):o===e?(p=3,d=e+1):(p=5,d=$);s.push(p),t.push(e),n.push(d),e=d}return s.push(1,0),t.push(i,i),n.push(i,i),{types:s,starts:t,ends:n}}var Z="'SPACELINE', 'NL', 'EOF'";function we(h,s){let{types:t,starts:n,ends:i}=ce(h),e=0,$=o=>{throw ne("ishikawa",h,n[e],`Expecting ${o}, got '${ge[t[e]]}'`)};if(t[e]===2){for(e++;t[e]===2||t[e]===3;)e++;t[e]!==4&&$("'SPACELINE', 'NL', 'ISHIKAWA'")}else t[e]!==4&&$("'SPACELINE', 'ISHIKAWA'");for(e++,t[e]===3&&e++;;){let o=t[e];if(o===6||o===5&&t[e+1]===6){let p=o===6?e:e+1;e=p+1,t[e]!==2&&t[e]!==3&&t[e]!==1&&$(Z),s.addNode(o===6?0:i[p-1]-n[p-1],h.slice(n[p],i[p]).trim())}else o===2||o===5?(e++,t[e]!==2&&t[e]!==3&&t[e]!==1&&$(o===5?`${Z}, 'TEXT'`:Z)):$("'SPACELINE', 'SPACELIST', 'TEXT'");for(e++;t[e]===3||t[e]===1;)e++;if(t[e]===0)return}}var D=.5,O=Math.hypot(D,1),ue=14,me=6,ke=8,ae=22,Me=18,B=5,ve=26,Ee=28,Ae=10,_e=5;function ye(h,s,t,n,i){let e=W(h.text,!1,t,n,180),$=Math.round(i*1.5),o=[],p=[],d=[],b=(l,x,_)=>{let v=l.length;for(let k=v-1;k>=0;k--)d.push({node:l[s?v-1-k:k],depth:x,parent:_,slot:k,bone:-1})};for(b(h.children,2,-1);d.length>0;){let l=d.pop();if(l.bone!==-1){p.push(l.bone);continue}let x=o.length;o.push({label:W(l.node.text,!1,t,i,200),depth:l.depth,parent:l.parent,slot:l.slot,kids:l.node.children.length,rise:0,at:0,textEnd:0}),l.depth%2===0?p.push(x):(l.bone=x,d.push(l)),b(l.node.children,l.depth+1,x)}let u=ue;for(let l of p){let x=Math.max(o[l].label.height,$)+me;o[l].rise=u+x/2,u+=x}let c=e.width+2*Ae,w=c/2;for(let l of o){let x=l.parent===-1?void 0:o[l.parent];l.depth%2===0?(l.at=x?x.at:0,l.textEnd=l.at-(l.kids>0?(l.kids+1)*ae:Me)-B):(l.at=x.at-(x.kids-l.slot)*ae,l.textEnd=l.at-B),w=Math.max(w,l.label.width-l.textEnd)}return{node:h,label:e,boxW:c,boxH:e.height+2*_e,bones:o,rise:u+ke,reach:w}}function Ce(h,s,t){return de(t,n=>Se(h,s,t,n))}function Se(h,s,t,n){let i=t.fontSize??16,e=Math.round(i*.875),$=t.measurer??le(t.fontFamily),o=t.padding??8;if(n)return Ie(h,t);let p=h.root,d=W(h.title,!1,$,i,4e3,1),b=d.height>0?d.height+12:0,u="",c=0,w=0,l=0,x=0;if(p){let M=W(p.text,!1,$,i,200,1),E=Math.max(M.height+24,48),P=M.width+24+E/2,S=p.children.map((f,y)=>ye(f,y%2===0,$,i,e));for(let f of S)f.rise=Math.max(f.rise,E/2+14);let J=[],F=-34;for(let f=0;f<S.length;f+=2){if(f>0){let y=0;for(let m=0;m<2;m++){let L=S[f-2+m],A=S[f+m];L&&(y=Math.max(y,L.reach+(A?A.boxW/2:0)))}F-=y+ve}J.push(F,F)}let Q=S.length>0?F-Ee:-34;w=P,c=Q,l=-E/2,x=E/2;let R="";S.forEach((f,y)=>{let m=y%2===0?-1:1,L=J[y],A=(g,z)=>L+g-z*D,T=A(0,f.rise),V=m*f.rise,G=fe-1,X=`M${r(L-D/O*G)},${r(m*G/O)}L${r(T)},${r(V)}`,j="";for(let g of f.bones){let z=m*g.rise;if(g.depth%2===0)X+=`M${r(A(g.at,g.rise))},${r(z)}H${r(A(g.textEnd+B,g.rise))}`;else{let Y=f.bones[g.parent].rise;X+=`M${r(A(g.at,Y))},${r(m*Y)}L${r(A(g.at,g.rise))},${r(z)}`}let U=A(g.textEnd,g.rise);j+=N(g.label,U-g.label.width/2,z,g.depth>2?' fill="var(--_m)"':""),c=Math.min(c,U-g.label.width)}let K=V+m*(f.boxH/2);c=Math.min(c,T-f.boxW/2),w=Math.max(w,T+f.boxW/2),l=Math.min(l,K-f.boxH/2),x=Math.max(x,K+f.boxH/2),R+=`<g class="pele-ishikawa-category" data-id="${q(f.node.text)}"><path class="pele-ishikawa-bones" d="${X}" fill="none" stroke="var(--_l)"/>`+te("arrow_point",L,0,D/O,-m/O,"var(--_l)")+`<rect x="${r(T-f.boxW/2)}" y="${r(K-f.boxH/2)}" width="${r(f.boxW)}" height="${r(f.boxH)}" rx="${$e}" fill="var(--_s)" stroke="var(--_b)"/>`+N(f.label,T,K,' class="pele-label"')+(j?`<g class="pele-ishikawa-causes" font-size="${e}">${j}</g>`:"")+"</g>"});let I=E/2;u=`<path class="pele-ishikawa-spine" d="M${r(Q)},0H${r(-7)}" fill="none" stroke="var(--_l)"/>`+te("arrow_point",0,0,1,0,"var(--_l)")+R+`<g class="pele-ishikawa-head" data-id="${q(p.text)}"><path d="M0,${r(-I)}H${r(P-I)}A${r(I)},${r(I)} 0 0 1 ${r(P-I)},${r(I)}H0Z" fill="var(--_s)" stroke="var(--_b)" stroke-linejoin="round"/>`+N(M,12+M.width/2,0,' class="pele-label" font-weight="var(--_hw)"')+"</g>"}let _=Math.max(w-c,d.width),v=Math.ceil(_+2*o),k=Math.ceil(x-l+b+2*o),a=o+(_-(w-c))/2-c,C=o+b-l;return{svg:he("ishikawa",v,k,i,t,{},N(d,v/2,o+d.height/2,' class="pele-title" font-weight="var(--_tw)"')+(u?`<g transform="translate(${r(a)},${r(C)})">${u}</g>`:"")),width:v,height:k,links:[]}}function Ie(h,s){let t=s.fontSize??16,n=Math.round(t*.875),i=s.measurer??le(s.fontFamily),e=s.padding??8,$=Math.max(140,(s.maxWidth??320)-2*e),o=W(h.title,!1,i,t,pe(s),1),p=[],d=h.root?[{node:h.root,depth:0,parent:-1}]:[],b=0;for(;d.length;){let a=d.pop(),C=p.length;p.push({...a,x:0,y:0,w:0,h:0}),b=Math.max(b,a.depth);for(let M=a.node.children.length-1;M>=0;M--)d.push({node:a.node.children[M],depth:a.depth+1,parent:C})}let u=Math.min(20,Math.max(2,($-120)/Math.max(1,b))),c=e+(o.height?o.height+12:0),w=o.width,l="",x="";for(let a of p){a.x=e+a.depth*u;let C=Math.max(60,$-a.depth*u-20);a.label=se(W(a.node.text,!1,i,a.depth<2?t:n,C,a.depth<2?1:0),i,C),a.w=a.label.width+20,a.h=a.label.height+12,a.y=c,c+=a.h+12,w=Math.max(w,a.x-e+a.w);let M=a.depth<2;if(l+=`<g class="pele-node ${a.depth===0?"pele-ishikawa-head":a.depth===1?"pele-ishikawa-category":"pele-ishikawa-cause"}" data-id="${q(a.node.text)}">`+(M?`<rect x="${r(a.x)}" y="${r(a.y)}" width="${r(a.w)}" height="${r(a.h)}" rx="${a.depth===0?12:4}" fill="var(--_s)" stroke="var(--_b)"/>`:"")+N(a.label,a.x+a.w/2,a.y+a.h/2,` class="pele-label"${a.depth<2?' font-weight="var(--_hw)"':""}${a.depth>1?` font-size="${n}"`:""}`)+"</g>",a.parent>=0){let E=p[a.parent],P=E.x+u/2;x+=`<path class="pele-edge" d="M${r(P)},${r(E.y+E.h)}V${r(a.y+a.h/2)}H${r(a.x)}" fill="none" stroke="var(--_b)"/>`}}let _=Math.ceil(w+2*e),v=Math.ceil(Math.max(e+o.height,c-12)+e),k=N(o,_/2,e+o.height/2,' class="pele-title" font-weight="var(--_tw)"')+x+l;return{svg:he("ishikawa",_,v,t,s,{},k),width:_,height:v,links:[]}}var Fe={type:"ishikawa",parse(h,s,t){let n=new xe;return n.title=t,we(h,n),n},render:Ce};export{Fe as ishikawa};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var Te=Object.defineProperty;var ke=(t,e,n)=>e in t?Te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var W=(t,e,n)=>ke(t,typeof e!="symbol"?e+"":e,n);import{i as Ie}from"./PUZGS23X-n6IKOr7S.js";import{H as ae,A as se}from"./KQOEJWJY-DKTXya68.js";import{x as R,r as _,H as be,$ as H}from"./lazy-CKqR1774.js";import{p as Me,h as Oe}from"./DKTLEL5E-B7ILCVTH.js";import{x as _e,D as Ce,$ as Ee,v as De,U as Ve,z as Se,Y as We,H as He}from"./VMV7XPHP-6QkisQwm.js";import{_ as Le,x as c,a as Xe,y as ce,b as de,h as ze,f as Pe,$ as je}from"./RZSVICHU-BiwjruZZ.js";import"./index-392ivruk.js";var Z=/[─━│┃└┗├┣]/,xe=/[└┗├┣]/,Be=/[─━]/,he=/^[\s│┃]+$/,Qe=/^[\s─━│┃└┗├┣]+$/,Ue=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Ye=/^\s*%%/,Re=" ";function Ze(t){return t.some(e=>Z.test(e))}function Fe(t){for(let e of t){let n=xe.exec(e);if(n!=null&&n.index&&n.index>0)return n.index}return 4}function fe(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(n,i)=>{let o=e.get(parseInt(i,10));return o?`line ${o}`:n})}function pe(t,e){throw new R(`Line ${t}: ${e}`,"syntax",{type:"treeView",line:t})}function Je(t){let e=new Map;if(!Z.test(t))return{text:t,lineMap:e};let n=t.split(`
|
|
2
|
+
`),i=-1;for(let l=0;l<n.length;l++)if(n[l].trim()==="treeView-beta"){i=l;break}if(i===-1)return{text:t,lineMap:e};let o=l=>l.trim()===""||Ye.test(l)||Ue.test(l),a=[];for(let l=i+1;l<n.length;l++){let p=n[l];o(p)||he.test(p)||a.push(p.replace(/\t/g," "))}if(!Ze(a))return{text:t,lineMap:e};let s=Fe(a),y=[],A=(l,p)=>{y.push(l),e.set(y.length,p+1)};for(let l=0;l<=i;l++)A(n[l],l);for(let l=i+1;l<n.length;l++){let p=n[l];if(o(p)){A(p,l);continue}if(he.test(p))continue;let $=p.replace(/\t/g," "),T=xe.exec($);if(T){let k=Math.round(T.index/s)+1,x=T.index+1;for(;x<$.length&&Be.test($[x]);)x++;for(;x<$.length&&$[x]===" ";)x++;let I=$.slice(x).trimEnd();I||pe(l+1,"Empty node — expected a filename or directory name after the box-drawing prefix"),A(Re.repeat(k)+I,l)}else{if(Qe.test($))continue;Z.test($)?A(p,l):/^\s+/.test($)?pe(l+1,"Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes."):A(p,l)}}return{text:y.join(`
|
|
3
|
+
`),lineMap:e}}function Ke(t,e){if(t.startsWith("##",e)||t.startsWith("icon(",e))return!0;if(!t.startsWith(":::",e))return!1;let n=e+3;for(;_(t.charCodeAt(n));)n++;let i=t.charCodeAt(n);return i>=65&&i<=90||i>=97&&i<=122||i===95}function qe(t,e){let n=t.charCodeAt(e);if(_(n)||n===10||n===13||n===34||n===39||t.startsWith(":::",e)||t.startsWith("icon(",e)||t.startsWith("##",e))return-1;let i=t.length,o=e+1;for(;o<i;){let a=t.charCodeAt(o);if(a===10||a===13)break;if(_(a)){let s=o+1;for(;_(t.charCodeAt(s));)s++;if(Ke(t,s))break;o=s}else o++}return o}var ue={name:"BARE_NAME",pattern:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/y,match:qe},ge=[{...He("treeView-beta"),longer:[ue]},Ie(),Ee,De,{name:"CLASS_ANNOTATION",pattern:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/y},{name:"ICON_ANNOTATION",pattern:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/y},{name:"DESC_ANNOTATION",pattern:/[ \t]+##[^\n\r]*/y},{name:"INDENTATION",pattern:/[ \t]{1,}/y},{name:"QUOTED_NAME",pattern:/"[^"]*"|'[^']*'/y},{name:"WS",pattern:/[ \t]+/y,hidden:!0},{name:"ML_COMMENT",pattern:/\%\%[^\n]*/y,hidden:!0},{name:"NL",pattern:/\r?\n/y,hidden:!0},ue];function we(t){let e=t.length;for(;e>0&&_(t.charCodeAt(e-1));)e--;return e===t.length?t:t.slice(0,e)}function U(t,e){switch(t){case"INDENTATION":return(e==null?void 0:e.length)||0;case"QUOTED_NAME":return e.substring(1,e.length-1);case"BARE_NAME":return we(e);case"CLASS_ANNOTATION":return e.trim().substring(3).trim();case"ICON_ANNOTATION":{let n=e.trim();return n.substring(5,n.length-1)}case"DESC_ANNOTATION":return e.trim().substring(2).trim();default:return}}function Ge(t){let e=new _e(Ce(t,ge,"treeView"),ge,"treeView"),n={$type:"TreeView",nodes:[]};for(e.expect(0);;)if(e.kind===1)n.accDescr=Ve(e.take());else if(e.kind===2)n.accTitle=Se(e.take());else if(e.kind===3)n.title=We(e.take());else break;for(;e.kind!==-1;){let i={$type:"TreeNode",name:""};if(e.kind===7&&(i.indent=e.take().length),e.kind===8){let o=e.take();i.name=o.substring(1,o.length-1)}else e.kind===12?i.name=we(e.take()):e.fail("a name");for(;;)if(e.kind===4)i.classAnnotation=U("CLASS_ANNOTATION",e.take());else if(e.kind===5)i.iconAnnotation=U("ICON_ANNOTATION",e.take());else if(e.kind===6)i.descAnnotation=U("DESC_ANNOTATION",e.take());else break;n.nodes.push(i)}return n}var et=class{constructor(){W(this,"count",1);W(this,"root",{id:0,level:-1,name:"/",nodeType:"directory",children:[]});W(this,"stack",[this.root])}addNode(t,e,n,i,o,a){let s=this.stack;for(;t<=s[s.length-1].level;)s.pop();let y={id:this.count++,level:t,name:e,nodeType:n,icon:o,cssClass:i,description:a,children:[]};s[s.length-1].children.push(y),s.push(y)}};function tt(t,e){for(let n of t.nodes){let i=typeof n.indent=="number"?n.indent:0,o=n.name,a=o.endsWith("/");a&&(o=o.slice(0,-1));let s=n.iconAnnotation;e.addNode(i,o,a?"directory":"file",n.classAnnotation||void 0,s!==void 0?s||"none":void 0,n.descAnnotation||void 0)}}function nt(t){let{text:e,lineMap:n}=Je(t);try{return Ge(e)}catch(i){if(n.size===0||!(i instanceof R))throw i;let o=i.message.indexOf(`
|
|
4
|
+
`),a=o===-1?fe(i.message,n):fe(i.message.slice(0,o),n)+i.message.slice(o);throw new R(a,i.code,{type:i.type,line:n.get(i.line)??i.line,column:i.column,snippet:i.snippet})}}function it(t,e){let n=new et;return tt(t,n),{type:"treeView",title:t.title||e,accTitle:t.accTitle?t.accTitle.replace(/^\s+/g,""):void 0,accDescr:t.accDescr?t.accDescr.replace(/\n\s+/g,`
|
|
5
|
+
`):void 0,root:n.root,count:n.count}}var z="mermaid-treeview",F=new Map([["folder","M3 6.5A1.5 1.5 0 0 1 4.5 5h4.6l2.4 2.5h8A1.5 1.5 0 0 1 21 9v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18z"],["file","M6.5 3h7L19 8.5v11a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 5 19.5v-15A1.5 1.5 0 0 1 6.5 3zM13.5 3v5.5H19"]]);function Y(t,e){if(t===void 0||!Object.prototype.hasOwnProperty.call(t,e))return;let n=t[e];return typeof n=="string"?n:void 0}function rt(t,e){let n=Y(e==null?void 0:e.filenameIcons,t);if(n)return n;let i=t.lastIndexOf(".");if(i>0){let o=t.substring(i).toLowerCase();return Y(e==null?void 0:e.extensionIcons,o)??Y(e==null?void 0:e.extensionIcons,o.slice(1))}}function me(t,e){return t.includes(":")?t:F.has(t)||!e?`${z}:${t}`:`${e}:${t}`}function $e(t,e){if(t.icon!=="none"){if(t.icon)return me(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){let n=rt(t.name,e);if(n==="none")return;if(n)return me(n,e.defaultIconPack)}return`${z}:${t.nodeType==="directory"?"folder":"file"}`}}}function ot(t){let e=i=>typeof i=="object"&&i!==null&&!Array.isArray(i)?i:void 0,n=e(t.treeView)??{};return{showIcons:!!n.showIcons,defaultIconPack:typeof n.defaultIconPack=="string"?n.defaultIconPack:"",filenameIcons:e(n.filenameIcons),extensionIcons:e(n.extensionIcons)}}var lt=6,at=16,st=7,ct=4,L=4;function X(t,e,n,i,o){var s;let a=(s=t.treeView)==null?void 0:s[e];return typeof a=="number"&&a>=i&&a<=o?a:n}function dt(t){return{paddingX:X(t,"paddingX",5,0,100),paddingY:X(t,"paddingY",2,0,100),rowIndent:X(t,"rowIndent",15,0,400),lineThickness:X(t,"lineThickness",1,.25,12)}}function ht(t,e,n){return Me(n,i=>ft(t,e,n,i))}function ft(t,e,n,i){var ne,ie;let o=n.fontSize??16,a=n.measurer??be(n.fontFamily),s=n.padding??8,y=ot(e),{paddingX:A,paddingY:l,rowIndent:p,lineThickness:$}=dt(e),T=0,k=t.root.children.map(r=>[r,0]);for(let r=0;i&&r<k.length;r++){let[d,h]=k[r];T=Math.max(T,h);for(let f of d.children)k.push([f,h+1])}let x=i?Math.min(p+A,Math.max(2,((n.maxWidth??320)-120)/Math.max(1,T))):p+A,I=Math.round(o*1.5)+2*l,b=o,M=Le(t.title,!1,a,o,i?Oe(n):4e3,1),ye=M.height>0?M.height+12:0,Ae=r=>r.some(d=>$e(d,y)!==void 0),C=[],P=new Map,j=[],J=(r,d)=>{let h=Ae(r);for(let f=r.length-1;f>=0;f--)j.push([r[f],d,h])};J(t.root.children,0);let E=0,K=!1,D=0;for(;j.length>0;){let[r,d,h]=j.pop(),f=d*x,u=H(r.name),m=f+(h?b+lt:0),v=Math.max(40,(n.maxWidth??320)-2*s-2*L-m),g=i?ae(u,a,o,v,r.nodeType==="directory"?1:0):void 0,S=i&&r.description?ae(H(r.description),a,o,v,2):void 0,re=g?g.width:a.width(u,o,r.nodeType==="directory"?1:0);m+re>E&&(E=m+re);let oe=r.cssClass!==void 0&&r.cssClass.split(/\s+/).includes("highlight");oe&&(K=!0);let Q=i?Math.max(I,((g==null?void 0:g.height)??0)+((S==null?void 0:S.height)??0)+2*l):I,ve=D+(i?l+Math.max(b,(g==null?void 0:g.height)??0)/2:Q/2),le={node:r,x:f,cy:ve,icon:$e(r,y),text:u,labelX:m,highlighted:oe,label:g,description:S,top:D,height:Q};D+=Q,C.push(le),P.set(r,le),J(r.children,d+1)}let q=E+at,O=E;for(let r of C){let d=r.node.description;if(!d)continue;let h=r.description?r.description.width:a.width(H(d),o,2);O=Math.max(O,(i?r.labelX:q)+h)}O=Math.max(O,M.width);let w=s+(K?L:0),N=s+ye,V=Math.ceil(O+2*w),G=Math.ceil(N+D+s),B="";for(let r of C){let d=r.node.children;if(d.length===0)continue;let h=w+r.x+st,f=Math.max(h,w+r.x+x-A),u=N+P.get(d[d.length-1]).cy,m=Math.min(ct,f-h),v=`M${c(h)},${c(N+r.top+r.height-2)}V${c(u-m)}`;m>0&&(v+=`Q${c(h)},${c(u)} ${c(h+m)},${c(u)}H${c(f)}`);for(let g=0;g<d.length-1&&f>h;g++)v+=`M${c(h)},${c(N+P.get(d[g]).cy)}H${c(f)}`;B+=`<path d="${v}"/>`}let ee=o*.35,te="";for(let r of C){let d=r.node,h=N+r.cy,f=d.nodeType==="directory",u="";if(r.highlighted){let m=w+r.x-L;u+=`<rect class="pele-tree-highlight" x="${c(m)}" y="${c(N+r.top+1)}" width="${c(V-w+L-m)}" height="${c(r.height-2)}" rx="${Xe}" fill="var(--_c)" fill-opacity="0.14"/>`}if(r.icon!==void 0){let m=r.icon.startsWith(z+":")?r.icon.slice(z.length+1):"",v=F.get(m)??F.get(f?"folder":"file"),g=((ne=n.icons)==null?void 0:ne.call(n,r.icon))??`<path d="${v}" stroke="var(--_m)" stroke-width="1.5"/>`;u+=`<svg class="pele-icon" data-icon="${ce(r.icon)}" x="${c(w+r.x)}" y="${c(h-b/2)}" width="${c(b)}" height="${c(b)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${g}</svg>`}r.label?u+=se(r.label,w+r.labelX,N+r.top+l,` class="pele-label"${f?' font-weight="var(--_hw)"':""}`):r.text!==""&&(u+=`<text class="pele-label" x="${c(w+r.labelX)}" y="${c(h+ee)}"${f?' font-weight="var(--_hw)"':""} xml:space="preserve">${de(r.text)}</text>`),r.description?u+=se(r.description,w+r.labelX,N+r.top+l+(((ie=r.label)==null?void 0:ie.height)??0),' class="pele-tree-description" font-style="italic" fill="var(--_m)"'):d.description&&(u+=`<text class="pele-tree-description" x="${c(w+q)}" y="${c(h+ee)}" font-style="italic" fill="var(--_m)" xml:space="preserve">${de(H(d.description))}</text>`),te+=`<g class="pele-node pele-tree-${f?"dir":"file"}${ze(d.cssClass??"")}" data-id="${ce(d.name)}">${u}</g>`}let Ne=Pe(M,V/2,s+M.height/2,' class="pele-title" font-weight="var(--_tw)"')+(B?`<g class="pele-tree-guides" fill="none" stroke="var(--_b)" stroke-width="${c($)}">${B}</g>`:"")+te;return{svg:je("treeView",V,G,o,n,t,Ne),width:V,height:G,links:[]}}var At={type:"treeView",parse:(t,e,n)=>it(nt(t),n),render:ht};export{At as treeView};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var T=Object.defineProperty;var L=(t,e,r)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var u=(t,e,r)=>L(t,typeof e!="symbol"?e+"":e,r);import{L as C}from"./lazy-CKqR1774.js";var I=new WeakMap;function $(t){let e=t.map((i,s)=>s),r=[];for(let i=0;i<128;i++){let s=String.fromCharCode(i);r.push(e.filter(f=>{let{pattern:d,first:p}=t[f];return typeof d=="string"?d[0]===s:p===void 0||p.includes(s)}))}let l={starting:r,every:e,longer:t.map(i=>{var s;return(s=i.longer)==null?void 0:s.map(f=>t.indexOf(f))})};return I.set(t,l),l}function W(t,e,r){let l=[],i=[],s=[],f=new Uint8Array(e.length),{starting:d,every:p,longer:S}=I.get(e)??$(e),m=[],g=t.length,y=(c,a)=>{if(f[c])return-1;let n=e[c];if(n.match!==void 0)return n.match(t,a);if(n.scanner!==void 0)return(m[c]??(m[c]=n.scanner()))(t,a);let o=n.pattern;return typeof o=="string"?t.startsWith(o,a)?a+o.length:-1:(o.lastIndex=a,o.test(t)?o.lastIndex:(n.opener!==void 0&&(n.opener.lastIndex=a,n.opener.test(t)&&(f[c]=1)),-1))},h=0;t:for(;h<g;){let c=t.charCodeAt(h);for(let a of c<128?d[c]:p){let n=y(a,h);if(n<=h)continue;let o=a,v=S[a];if(v!==void 0)for(let x of v){let E=y(x,h);if(E>n){o=x,n=E;break}}e[o].hidden||(l.push(o),i.push(h),s.push(n)),h=n;continue t}throw C(r,t,h,"",!0)}return l.push(-1),i.push(g),s.push(g),{kinds:l,starts:i,ends:s,src:t}}var _={name:"ACC_DESCR",pattern:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:" a"},R={name:"ACC_TITLE",pattern:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:" a"},G={name:"TITLE",pattern:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:" t"},O={name:"STRING",pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`},H={name:"NEWLINE",pattern:/\r?\n/y,first:`\r
|
|
2
|
+
`},P={name:"WHITESPACE",pattern:/[\t ]+/y,hidden:!0,first:" "},U={name:"YAML",pattern:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/y,hidden:!0,opener:/---[\t ]*\r?\n/y,first:"-"},V={name:"DIRECTIVE",pattern:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/y,hidden:!0,opener:/[\t ]*%%{/y,first:" %"},Y={name:"SINGLE_LINE_COMMENT",pattern:/[\t ]*%%[^\n\r]*/y,first:" %",hidden:!0};function j(t){return{name:t,pattern:new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"(?:(?=%%)|(?!\\S))","y"),first:t[0]}}var w=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,A=/accTitle[\t ]*:([^\n\r]*)/,N=/title([\t ][^\n\r]*|)/;function k(t){return t.trim().replace(/[\t ]{2,}/gm," ")}function z(t){return k(N.exec(t)[1])}function q(t){return k(A.exec(t)[1])}function B(t){let e=w.exec(t);return e[1]!==void 0?k(e[1]):e[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
|
|
3
|
+
`)}var M=new Map([["b","\b"],["f","\f"],["n",`
|
|
4
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function F(t){if(!t.includes("\\"))return t.slice(1,-1);let e="";for(let r=1;r<t.length-1;r++){let l=t[r];if(l==="\\"){let i=t[++r];e+=M.get(i)??i}else e+=l}return e}var J=class{constructor(t,e,r){u(this,"tokens");u(this,"types");u(this,"diagram");u(this,"i",0);u(this,"kinds");this.tokens=t,this.types=e,this.diagram=r,this.kinds=t.kinds}get kind(){return this.kinds[this.i]}text(t=this.i){return this.tokens.src.slice(this.tokens.starts[t],this.tokens.ends[t])}take(){return this.text(this.i++)}accept(t){return this.kinds[this.i]!==t?!1:(this.i++,!0)}expect(t){return this.kinds[this.i]!==t&&this.fail(`token of type '${this.types[t].name}'`),this.take()}fail(t){let e=this.kind===-1?"end of input":`\`${this.text()}\``;throw C(this.diagram,this.tokens.src,this.tokens.starts[this.i],`Expecting ${t} but found ${e}.`)}};export{R as $,W as D,U as G,j as H,_ as M,V as O,Y as P,B as U,H as V,P as W,z as Y,F as j,G as v,O as w,J as x,q as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e as a}from"./lazy-CKqR1774.js";function c(t,n){let e=t.indexOf(`
|
|
2
|
+
`,n);return e===-1?t.length:e}function A(t,n,e){for(let r=0;r<e.length;r++)if((t.charCodeAt(n+r)|32)!==e.charCodeAt(r))return!1;return!0}function g(t,n){let e=t.length,r=n;for(;r<e;){let f=t.charCodeAt(r);if(f===37&&t.charCodeAt(r+1)!==123)r=c(t,r);else if(f!==125&&t.charCodeAt(r+1)===37&&t.charCodeAt(r+2)===37)r=c(t,r+3);else{if(f===10)return r;if(a(f))do r++;while(r<e&&a(t.charCodeAt(r)));else if(f===35)r=c(t,r);else return r}}return r}function h(t,n){let e=n;for(;a(t.charCodeAt(e));)e++;return e}function x(t,n,e,r){let f=A(t,n,"accdescr");if(!f&&!A(t,n,"acctitle"))return n;let i=t.length,o=h(t,n+8),d=t.charCodeAt(o),l=(u,s,C)=>{e.types.push(u),e.texts.push(t.slice(s,C)),e.starts.push(s)};if(d===58){o=h(t,o+1);let u=c(t,o);return l(f?r+2:r,n,o),l(f?r+3:r+1,o,u),u}if(!f||d!==123)return n;for(o=h(t,o+1);t.charCodeAt(o)!==125;){let u=t.indexOf("}",o);if(u===-1&&(u=i),l(r+4,o,u),o===i)return i;o=u}return o+1}export{x as A,c as a,g,A as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{f as me,h as xe}from"./DKTLEL5E-B7ILCVTH.js";import{x as Me,D as we,M as be,$ as ke,v as ve,w as ye,V as Ae,W as De,G as Pe,O as Ce,P as _e,j as ze,Y as Ie,z as Fe,U as He,H as le}from"./VMV7XPHP-6QkisQwm.js";import{_ as se,y as oe,m as ce,x as r,f as ne,$ as Te}from"./RZSVICHU-BiwjruZZ.js";import{x as Ee,H as Ne}from"./lazy-CKqR1774.js";import"./index-392ivruk.js";function Se(i,e){let t=new Map;for(let{label:a,value:c}of i.sections){if(c<0)throw new Ee(`"${a}" has invalid value: ${c}. Negative values are not allowed in pie charts. All slice values must be >= 0.`,"semantic",{type:"pie"});t.has(a)||t.set(a,c)}return{type:"pie",title:i.title||e,accTitle:i.accTitle?i.accTitle.replace(/^\s+/g,""):void 0,accDescr:i.accDescr?i.accDescr.replace(/\n\s+/g,`
|
|
2
|
+
`):void 0,showData:i.showData,sections:t}}function he(i,e){let t=e;for(let a=i.charCodeAt(t);a>=48&&a<=57;a=i.charCodeAt(t))t++;return t}function je(){let i=0,e=0,t=-1;return(a,c)=>{let o=a.charCodeAt(c)===45?c+1:c;if((o<i||o>=e)&&(i=o,e=he(a,o),t=-1,e>o&&a.charCodeAt(e)===46)){let l=he(a,e+1),h=l-e-1;h>0&&a.charCodeAt(l)!==46?t=l:h>1&&(t=l-1)}return e===o?-1:t>=0?t:a.charCodeAt(o)===48?a.charCodeAt(o+1)===46?-1:o+1:a.charCodeAt(e)!==46?e:e-1>o?e-1:-1}}var $e=[le("showData"),le("pie"),{name:":",pattern:":"},{name:"NUMBER_PIE",pattern:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/y,scanner:je,first:"-0123456789"},be,ke,ve,ye,Ae,De,Pe,Ce,_e];function Le(i){let e=new Me(we(i,$e,"pie"),$e,"pie"),t={$type:"Pie",showData:!1,sections:[]},a=()=>{if(e.kind!==-1)for(e.kind!==8&&e.fail("a line break or the end of input");e.kind===8;)e.i++};for(;e.kind===8;)e.i++;for(e.expect(1),t.showData=e.accept(0);e.kind!==-1;)switch(e.kind){case 8:e.i++;break;case 4:t.accDescr=He(e.take()),a();break;case 5:t.accTitle=Fe(e.take()),a();break;case 6:t.title=Ie(e.take()),a();break;case 7:{let c=ze(e.take());e.expect(2);let o=Number(e.expect(3));t.sections.push({$type:"PieSection",label:c,value:o}),a();break}default:e.fail("a section, a title, or a line break")}return t}var Oe=120,I=12,G=26,B=32,fe=28;function J(i,e){var t;return(t=i.pie)==null?void 0:t[e]}function k(i,e){return`${r(Math.sin(i)*e)},${r(-Math.cos(i)*e)}`}function Re(i,e,t,a){if(e-i>=Math.PI*2-1e-9){let o=(l,h)=>`M0,${r(-l)}A${r(l)},${r(l)} 0 1 ${h} 0,${r(l)}A${r(l)},${r(l)} 0 1 ${h} 0,${r(-l)}Z`;return o(t,1)+(a>0?o(a,0):"")}let c=e-i>Math.PI?1:0;return a<=0?`M0,0L${k(i,t)}A${r(t)},${r(t)} 0 ${c} 1 ${k(e,t)}Z`:`M${k(i,t)}A${r(t)},${r(t)} 0 ${c} 1 ${k(e,t)}L${k(e,a)}A${r(a)},${r(a)} 0 ${c} 0 ${k(i,a)}Z`}function Ue(i,e,t){return me(t,Oe*2,140,(a,c)=>Ve(i,e,t,a/2,c))}function Ve(i,e,t,a,c){let o=t.fontSize??16,l=Math.round(o*.875),h=t.measurer??Ne(t.fontFamily),g=t.padding??8,F=J(e,"textPosition"),Q=typeof F=="number"&&F>=0&&F<=1?F:.75,H=J(e,"donutHole"),de=typeof H=="number"&&H>0&&H<=.9?H*a:0,j=String(J(e,"legendPosition")??"right"),f=c&&(j==="left"||j==="right")?"bottom":j,v=[...i.sections],L=0;for(let[,s]of v)L+=s;let T=v.map(([s,n])=>se(i.showData?`${s} [${n}]`:s,!1,h,l,4e3)),$=0;for(let s of T)$=Math.max($,s.width);$+=T.length>0?I+8:0;let m=T.length*G,y=se(i.title,!1,h,o,xe(t),1),X=y.height>0?y.height+16:0,Y=v.map(([,s])=>{let n=L>0?s/L:0;return n*100>=1&&(n*100).toFixed(0)!=="0"?n:0}),q=Y.map(s=>s===0||s>=.5?!1:2*a*Q*Math.sin(s*Math.PI)<h.width((s*100).toFixed(0)+"%",l,0)+6),pe=q.includes(!0)?fe:0,x=f==="left"||f==="right"||f==="center"?f:"",K=f==="top"||f==="bottom",d=(a+pe)*2,p=d,M=d;x==="left"||x==="right"?(p+=$>0?B+$:0,M=Math.max(M,m)):K&&(p=Math.max(p,$),M+=m>0?20+m:0),p=Math.max(p,y.width);let A=g+(x==="left"?$+B+d/2:x==="right"?d/2:p/2),D=g+X,E=D+(f==="top"?m+20+d/2:K?d/2:M/2),N="",O="",R="",S=0,P=a+fe/2,ee=[],ue=(s,n,u)=>ee.every(w=>Math.abs(s-w.x)>=(u+w.width)/2+2||Math.abs(n-w.y)>=l+2);v.forEach(([s],n)=>{let u=Y[n];if(u===0)return;let w=S+u*Math.PI*2;N+=`<path class="pele-slice" data-id="${oe(s)}" d="${Re(S,w,a,de)}" fill="${ce(n)}"/>`;let W=(S+w)/2,Z=(u*100).toFixed(0)+"%";if(q[n]){let _=h.width(Z,l,0),z=W;for(let re=0;re<360&&!ue(Math.sin(z)*P,-Math.cos(z)*P,_);re++)z+=2/P;let ae=Math.sin(z)*P,ie=-Math.cos(z)*P;ee.push({x:ae,y:ie,width:_}),R+=`<text x="${r(ae)}" y="${r(ie+l*.35)}">${Z}</text>`}else{let _=a*Q;O+=`<text x="${r(Math.sin(W)*_)}" y="${r(-Math.cos(W)*_+l*.35)}">${Z}</text>`}S=w}),N===""&&(N=`<circle class="pele-slice" r="${a}" fill="none" stroke="var(--_b)"/>`);let U="",b,C;x==="right"?(b=A+d/2+B,C=D+(M-m)/2):x==="left"?(b=g,C=D+(M-m)/2):x==="center"?(b=A-$/2,C=E-m/2):(b=g+(p-$)/2,C=f==="top"?D:D+d+20),T.forEach((s,n)=>{let u=C+n*G+G/2;U+=`<g class="pele-legend-item" data-id="${oe(v[n][0])}"><rect x="${r(b)}" y="${r(u-I/2)}" width="${I}" height="${I}" rx="2" fill="${ce(n)}"/>`+ne(s,b+I+8+s.width/2,u,"")+"</g>"});let V=Math.ceil(p+2*g),te=Math.ceil(M+X+2*g),ge=ne(y,V/2,g+y.height/2,' class="pele-title" font-weight="var(--_tw)"')+`<g class="pele-slices" transform="translate(${r(A)},${r(E)})" stroke="var(--_bg)" stroke-width="1" stroke-linejoin="round">${N}</g>`+(O?`<g class="pele-slice-labels" transform="translate(${r(A)},${r(E)})" font-size="${l}" text-anchor="middle" fill="var(--_bg)">${O}</g>`:"")+(R?`<g class="pele-slice-labels" transform="translate(${r(A)},${r(E)})" font-size="${l}" text-anchor="middle">${R}</g>`:"")+(U?`<g class="pele-legend" font-size="${l}">${U}</g>`:"");return{svg:Te("pie",V,te,o,t,i,ge),width:V,height:te,links:[]}}var Qe={type:"pie",parse:(i,e,t)=>Se(Le(i),t),render:Ue};export{Qe as pie};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var Vt=Object.defineProperty;var jt=(e,t,a)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var M=(e,t,a)=>jt(e,typeof t!="symbol"?t+"":t,a);import{N as qt,A as Jt}from"./JZWSX6AR-OwVPptYv.js";import{H as Ut,x as J,e as ge,L as Bt}from"./lazy-CKqR1774.js";import{l as Rt}from"./DKTLEL5E-B7ILCVTH.js";import{_ as Qe,f as re,$ as ct,b as Kt,y as ye,x as u,u as ea,a as ta,g as aa}from"./RZSVICHU-BiwjruZZ.js";import"./index-392ivruk.js";var R=["January","February","March","April","May","June","July","August","September","October","November","December"],Q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function ie(e){return!Number.isNaN(e.getTime())}function S(e,t){let a=String(e);return a.length>=t?a:"0".repeat(t-a.length)+a}function vt(e){let t=["th","st","nd","rd"],a=e%100;return e+(t[(a-20)%10]||t[a]||t[0])}function Ve(e){let t=-Math.round(e.getTimezoneOffset()/15)*15;return t===0?0:t}function ut(e){let t=Ve(e),a=Math.abs(t);return(t>=0?"+":"-")+S(Math.floor(a/60),2)+":"+S(a%60,2)}function $t(e){return e.getDay()||7}function Z(e,t){let a=new Date(e);return a.setDate(a.getDate()+t),a}function ra(e){let t=new Date(e.getFullYear(),e.getMonth()+1,0);return t.setHours(23,59,59,999),t.getDate()}function ht(e,t){let a=new Date(e);return a.setDate(1),t(a),a.setDate(Math.min(e.getDate(),ra(a))),a}function Tt(e,t,a){switch(a){case"M":return ht(e,r=>r.setMonth(e.getMonth()+t));case"y":return ht(e,r=>r.setFullYear(e.getFullYear()+t));case"d":return Z(e,Math.round(t));case"w":return Z(e,Math.round(7*t));case"h":return new Date(e.getTime()+t*36e5);case"m":return new Date(e.getTime()+t*6e4);case"s":return new Date(e.getTime()+t*1e3);default:return new Date(e.getTime()+t)}}function St(e){return Z(e,4-$t(e))}function ft(e){let t=St(e),a=new Date(t.getFullYear(),0,1),r=$t(a),i=Z(a,4-r+(r>4?7:0)),n=(Ve(i)-Ve(t))*6e4,s=(t.getTime()-i.getTime()-n)/6048e5;return(s<0?Math.ceil(s)||0:Math.floor(s))+1}var sa=/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,na=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ia="YYYY-MM-DDTHH:mm:ssZ";function Yt(e,t){if(!ie(e))return"Invalid Date";let a=t||ia;if(a==="YYYY-MM-DD")return _t(e);let r=!1,i=a.replace(sa,s=>{switch(s){case"Q":return String(Math.ceil((e.getMonth()+1)/3));case"Do":return"["+vt(e.getDate())+"]";case"GGGG":return String(St(e).getFullYear());case"W":return String(ft(e));case"WW":return S(ft(e),2);case"k":return String(e.getHours()||24);case"kk":return S(e.getHours()||24,2);case"X":return String(Math.floor(e.getTime()/1e3));case"x":return String(e.getTime());case"gggg":case"wo":case"w":case"ww":case"z":case"zzz":return r=!0,s;default:return s}});if(r)return;let n=e.getHours();return i.replace(na,(s,l)=>{if(l)return l;switch(s){case"YY":return String(e.getFullYear()).slice(-2);case"YYYY":return S(e.getFullYear(),4);case"M":return String(e.getMonth()+1);case"MM":return S(e.getMonth()+1,2);case"MMM":return R[e.getMonth()].slice(0,3);case"MMMM":return R[e.getMonth()];case"D":return String(e.getDate());case"DD":return S(e.getDate(),2);case"d":return String(e.getDay());case"dd":return Q[e.getDay()].slice(0,2);case"ddd":return Q[e.getDay()].slice(0,3);case"dddd":return Q[e.getDay()];case"H":return String(n);case"HH":return S(n,2);case"h":return String(n%12||12);case"hh":return S(n%12||12,2);case"a":return n<12?"am":"pm";case"A":return n<12?"AM":"PM";case"m":return String(e.getMinutes());case"mm":return S(e.getMinutes(),2);case"s":return String(e.getSeconds());case"ss":return S(e.getSeconds(),2);case"SSS":return S(e.getMilliseconds(),3);case"Z":return ut(e);default:return ut(e).replace(":","")}})}function _t(e){let t=e.getFullYear(),a=e.getMonth()+1,r=e.getDate();return(t>=1e3&&t<=9999?t:S(t,4))+(a<10?"-0":"-")+a+(r<10?"-0":"-")+r}var la=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,oa=/\[[^\]]+]/g,mt=/\d/,se=/\d\d/,da=/\d{3}/,ca=/\d{4}/,F=/\d\d?/,ua=/[+-]?\d+/,gt=/[+-]\d\d:?(\d\d)?|Z/,ne=/\d*[^-_:/,()\s\d]+/;function b(e){return(t,a)=>(t[e]=+a,!0)}var yt=(e,t)=>{if(t==="Z")return e.offset=0,!0;let a=t.match(/([+-]|\d\d)/g),r=+a[1]*60+(+a[2]||0);return e.offset=r===0?0:a[0]==="+"?-r:r,!0};function kt(e){return(t,a)=>{let r=e.indexOf(a)+1;return r<1?!1:(t.month=r%12||r,!0)}}var ha=new Map([["A",{re:ne,read:(e,t)=>(e.afternoon=t==="PM",!0)}],["a",{re:ne,read:(e,t)=>(e.afternoon=t==="pm",!0)}],["Q",{re:mt,read:(e,t)=>(e.month=(+t-1)*3+1,!0)}],["S",{re:mt,read:(e,t)=>(e.milliseconds=+t*100,!0)}],["SS",{re:se,read:(e,t)=>(e.milliseconds=+t*10,!0)}],["SSS",{re:da,read:(e,t)=>(e.milliseconds=+t,!0)}],["s",{re:F,read:b("seconds")}],["ss",{re:F,read:b("seconds")}],["m",{re:F,read:b("minutes")}],["mm",{re:F,read:b("minutes")}],["H",{re:F,read:b("hours")}],["h",{re:F,read:b("hours")}],["HH",{re:F,read:b("hours")}],["hh",{re:F,read:b("hours")}],["D",{re:F,read:b("day")}],["DD",{re:se,read:b("day")}],["Do",{re:ne,read:(e,t)=>{let a=t.match(/\d+/);if(!a)return!1;e.day=+a[0],e.dayGiven=!0;for(let r=1;r<=31;r++)vt(r)===t&&(e.day=r);return!0}}],["w",{re:F,read:b("week")}],["ww",{re:se,read:b("week")}],["M",{re:F,read:b("month")}],["MM",{re:se,read:b("month")}],["MMM",{re:ne,read:kt(R.map(e=>e.slice(0,3)))}],["MMMM",{re:ne,read:kt(R)}],["Y",{re:ua,read:b("year")}],["YY",{re:se,read:(e,t)=>(e.year=+t+(+t>68?1900:2e3),!0)}],["YYYY",{re:ca,read:b("year")}],["Z",{re:gt,read:yt}],["ZZ",{re:gt,read:yt}]]),wt,ke=null;function fa(e){if(e===wt)return ke;if(wt=e,ke=null,/[Ll]/.test(e.replace(oa,"")))return null;let t=e.match(la);return t?(ke=t.map(a=>ha.get(a)??a.replace(/^\[|\]$/g,"")),ke):null}function ma(e,t,a){if(t==="x"||t==="X")return new Date((t==="X"?1e3:1)*Number(e));let r=fa(t);if(!r)return;let i={},n=e,s=0;for(let D of r){if(typeof D=="string"){s+=D.length;continue}let N=D.re.exec(n.slice(s));if(!N||!D.read(i,N[0]))return;n=n.replace(N[0],"")}i.afternoon!==void 0&&i.hours!==void 0&&(i.afternoon?i.hours<12&&(i.hours+=12):i.hours===12&&(i.hours=0));let l=i.dayGiven||i.day?i.day:!i.year&&!i.month?a.getDate():1,h=i.year||a.getFullYear(),g=0;i.year&&!i.month||(g=i.month>0?i.month-1:a.getMonth());let p=i.hours||0,y=i.minutes||0,c=i.seconds||0,k=i.milliseconds||0;if(i.offset!==void 0)return new Date(Date.UTC(h,g,l,p,y,c,k+i.offset*6e4));if(!i.week)return new Date(h,g,l,p,y,c,k)}function ga(e,t,a){let r=ma(e,t,a);return r&&ie(r)&&Yt(r,t)===e?r:void 0}var ya=/^[YMDHhmsSZXx\-/.:, T]*$/,ka=/^\s*(active|done|crit|milestone|vert)\s*$/,wa=/^after\s+([\d\w- ]+)/,Ma=/^until\s+([\d\w- ]+)/,pa=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/,Da=/[\s,]+/,xa=/^\d+$/,ba=new Set(Q.map(e=>e.toLowerCase())),va=4e8,$a=400,Ta=200,Sa=400;function Ft(e){let t=e===void 0?NaN:+e;return Number.isFinite(t)?t:Date.now()}function Ya(e){let t=pa.exec(e.trim());return t?[Number.parseFloat(t[1]),t[2]]:[NaN,"ms"]}function Mt(e,t){let a=new Set(e);for(let r of t.toLowerCase().split(Da))r!==""&&a.add(r);return[...a]}var _a=class{constructor(e={}){M(this,"type","gantt");M(this,"title");M(this,"accTitle");M(this,"accDescr");M(this,"dateFormat","");M(this,"axisFormat","");M(this,"tickInterval");M(this,"todayMarker","");M(this,"includes",[]);M(this,"excludes",[]);M(this,"inclusiveEndDates",!1);M(this,"topAxis",!1);M(this,"displayMode","");M(this,"weekday");M(this,"weekend","saturday");M(this,"sections",[]);M(this,"links",new Map);M(this,"tasks",[]);M(this,"byId",new Map);M(this,"currentSection","");M(this,"taskCount",0);M(this,"lastOrder",0);M(this,"lastTaskId");M(this,"options");M(this,"now",0);M(this,"work",0);M(this,"includeSet",new Set);M(this,"excludeSet",new Set);M(this,"excludedDays",[]);M(this,"datedTokens",!1);this.options=e}setDateFormat(e){this.dateFormat=e}enableInclusiveEndDates(){this.inclusiveEndDates=!0}TopAxis(){this.topAxis=!0}setAxisFormat(e){this.axisFormat=e}setTickInterval(e){this.tickInterval=e}setTodayMarker(e){this.todayMarker=e}setIncludes(e){this.includes=Mt(this.includes,e)}setExcludes(e){this.excludes=Mt(this.excludes,e)}setWeekday(e){this.weekday=e}setWeekend(e){this.weekend=e}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,"")}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
|
+
`)}addSection(e){this.currentSection=e,this.sections.push(e)}addTask(e,t){let a=(t.startsWith(":")?t.slice(1):t).split(","),r={id:"",task:e,section:this.currentSection,startTime:void 0,endTime:void 0,renderEndTime:null,manualEndTime:!1,processed:!1,active:!1,done:!1,crit:!1,milestone:!1,vert:!1,order:-1,classes:[],prevTaskId:this.lastTaskId,raw:{data:t,start:void 0,end:""}},i;for(;a.length>0&&(i=ka.exec(a[0]))!==null;)r[i[1]]=!0,a.shift();if(a.length===0)throw new J(`Task "${e.trim()}" needs a duration or an end date.`,"semantic",{type:"gantt"});if(a.length>3)throw new J(`Task "${e.trim()}" has too many fields. A task takes an id, a start, and an end or duration.`,"semantic",{type:"gantt"});for(let n=0;n<a.length;n++)a[n]=a[n].trim();a.length===3?r.id=a[0]:(this.taskCount++,r.id="task"+this.taskCount),a.length>1&&(r.raw.start=a[a.length-2]),r.raw.end=a[a.length-1],r.vert||(r.order=this.lastOrder++),this.tasks.push(r),this.lastTaskId=r.id,this.byId.set(r.id,r)}setLink(e,t){let a=Jt(t);for(let r of e.split(","))this.byId.has(r)&&this.links.set(r,a);this.setClass(e,"clickable")}setClickEvent(e,t,a){this.setClass(e,"clickable")}setClass(e,t){var a;for(let r of e.split(","))(a=this.byId.get(r))==null||a.classes.push(t)}getTasks(e){this.now=Ft(e),this.work=0,this.includeSet=new Set(this.includes),this.excludeSet=new Set(this.excludes);let t=this.weekend==="friday"?5:this.weekend==="saturday"?6:NaN,a=this.excludeSet.has("weekends");this.excludedDays=Q.map((i,n)=>{let s=n||7;return a&&(s===t||s===t+1)||this.excludeSet.has(i.toLowerCase())}),this.datedTokens=this.includes.length>0||!ya.test(this.dateFormat.trim());for(let i of this.excludes)i!=="weekends"&&!ba.has(i)&&(this.datedTokens=!0);for(let i of this.tasks)i.startTime=i.endTime=void 0,i.renderEndTime=null,i.processed=i.manualEndTime=!1;let r=this.compileTasks();for(let i=0;!r&&i<10;i++)r=this.compileTasks();return this.tasks}isInvalidDate(e){let t=this.excludedDays[e.getDay()];if(!this.datedTokens)return t;let a=this.dateFormat.trim(),r=_t(e),i=r;this.spend(Ta),a!=="YYYY-MM-DD"&&(this.spend(Sa+a.length*8),i=Yt(e,a));let n=s=>s.has(r)||i!==void 0&&s.has(i);return n(this.includeSet)?!1:t||n(this.excludeSet)}spend(e){if(this.work+=e,this.work>va)throw new J("The gantt chart takes too much work to schedule.","limit",{type:"gantt"})}parse(e,t){return this.spend((t.length+1)*(e.length+1)),ga(e,t,new Date(this.now))}today(){let e=new Date(this.now);return e.setHours(0,0,0,0),e}warn(e){this.options.warn&&this.options.warn(e())}compileTasks(){let e=!0;for(let t of this.tasks)this.compileTask(t),e=e&&t.processed;return e}compileTask(e){let t=e.raw.start;if(t===void 0){let a=e.prevTaskId===void 0?void 0:this.byId.get(e.prevTaskId);e.startTime=a?a.endTime:this.today()}else{let a=this.getStartDate(t);a&&(e.startTime=a)}e.startTime&&(e.endTime=this.getEndDate(e.startTime,e.raw.end),e.endTime&&(e.processed=!0,e.manualEndTime=this.parse(e.raw.end,"YYYY-MM-DD")!==void 0,this.checkTaskDates(e)))}references(e,t){let a=[],r;for(let i of t.split(" ")){if(i==="")continue;let n=this.byId.get(i);n?a.push(n):(r??(r=[])).push(i)}if(r){let i=r;this.warn(()=>`Gantt: "${e}" refers to task ids that do not exist: ${i.join(", ")}.`)}return a}getStartDate(e){let t=e.trim(),a=this.dateFormat.trim();if((a==="x"||a==="X")&&xa.test(t))return this.checked(new Date(Number(t)),t);let r=wa.exec(t);if(r!==null){let s=this.references("after",r[1]),l;for(let h of s)(!l||h.endTime>l.endTime)&&(l=h);return l?l.endTime:this.today()}let i=this.parse(t,a);if(i)return i;let n=new Date(t);if(!ie(n)||n.getFullYear()<-1e4||n.getFullYear()>1e4)throw new J("Invalid date:"+t,"semantic",{type:"gantt"});return n}checked(e,t){if(!ie(e))throw new J("Invalid date:"+t,"semantic",{type:"gantt"});return e}getEndDate(e,t){let a=t.trim(),r=Ma.exec(a);if(r!==null){let g=this.references("until",r[1]),p;for(let y of g)(!p||y.startTime<p.startTime)&&(p=y);return p?p.startTime:this.today()}let i=this.dateFormat.trim(),n=this.parse(a,i);if(n)return this.inclusiveEndDates?Z(n,1):n;let[s,l]=Ya(a);if(Number.isNaN(s))return this.warn(()=>`Gantt: "${a}" is neither a date in the "${i}" format nor a duration such as "3d", so the task gets no duration.`),new Date(e);let h=Tt(e,s,l);return ie(h)?h:new Date(e)}checkTaskDates(e){if(this.excludes.length===0||e.manualEndTime)return;let t=Z(e.startTime,1),a=new Date(e.endTime),r=+Z(a,1e4),i=!1,n=null;for(;+t<=+a;){if(this.spend($a),i||(n=+a),i=this.isInvalidDate(t),i&&(a.setDate(a.getDate()+1),+a>r))throw new J("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.","semantic",{type:"gantt"});t.setDate(t.getDate()+1)}e.endTime=a,e.renderEndTime=n===null?null:new Date(n)}},Fa=["$end","INVALID","open_directive","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","NL","href","callbackname","callbackargs","click","gantt","dateFormat","inclusiveEndDates","topAxis","axisFormat","tickInterval","includes","excludes","todayMarker","weekday_monday","weekday_tuesday","weekday_wednesday","weekday_thursday","weekday_friday","weekday_saturday","weekday_sunday","weekend_friday","weekend_saturday","date","title","accDescription","section","taskTxt","taskData",":","EOF"],Aa=/accTitle\s*:\s*/iy,Ia=/accDescr\s*:\s*/iy,Na=/accDescr\s*\{\s*/iy,Ha=/href\s+"/iy,Ea=/call\s+/iy,Ca=/click\s+/iy,za=/\(\s*\)/y,Ze=/weekday\s+(monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/iy,La=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],Oe=/weekend\s+(?:(friday)|saturday)\b/iy,Wa=/\d\d\d\d-\d\d-\d\d\b/y,Ga=new Map([[97,[[/axisFormat\s[^#\n;]+/iy,17],[/accDescription\s[^#\n;]+/iy,33]]],[103,[[/gantt\b/iy,13]]],[100,[[/dateFormat\s[^#\n;]+/iy,14]]],[105,[[/inclusiveEndDates\b/iy,15],[/includes\s[^#\n;]+/iy,19]]],[116,[[/topAxis\b/iy,16],[/tickInterval\s[^#\n;]+/iy,18],[/todayMarker\s[^\n;]+/iy,21],[/title\s[^\n]+/iy,32]]],[101,[[/excludes\s[^#\n;]+/iy,20]]],[115,[[/section\s[^\n]+/iy,34]]]]);function Za(e){let t=e.length,a=[],r=[],i=[],n=0,s=0,l=(y,c,k)=>{a.push(y),r.push(e.slice(c,k)),i.push(c),s=k},h=y=>(y.lastIndex=s,y.test(e)?y.lastIndex:-1),g=(y,c)=>{let k=e.indexOf(y,c);return k===-1?t:k},p=y=>{let c;switch(y|32){case 97:if((c=h(Aa))>=0)return n=1,l(3,s,c),!0;if((c=h(Ia))>=0)return n=2,l(5,s,c),!0;if((c=h(Na))>=0)return n=3,s=c,!0;break;case 104:if((c=h(Ha))>=0)return n=4,s=c,!0;break;case 99:if((c=h(Ea))>=0)return n=5,s=c,!0;if((c=h(Ca))>=0)return n=7,s=c,!0;break;case 119:{Ze.lastIndex=s;let D=Ze.exec(e);if(D)return l(22+La.indexOf(D[1].toLowerCase()),s,Ze.lastIndex),!0;if(Oe.lastIndex=s,D=Oe.exec(e),D)return l(D[1]!==void 0?29:30,s,Oe.lastIndex),!0;break}}let k=Ga.get(y|32);if(k){for(let[D,N]of k)if((c=h(D))>=0)return l(N,s,c),!0}return!1};for(;;){if(s>=t){let c=38;switch(n){case 1:c=4;break;case 2:c=6;break;case 3:c=7;break;case 4:c=9;break;case 5:c=10;break;case 6:c=11;break;case 7:c=12;break}l(c,t,t);break}let y=e.charCodeAt(s);switch(n){case 0:{let c=e.charCodeAt(s+1);if(y===37)if(c!==37){let k=g(`
|
|
3
|
+
`,s+1);for(;e.charCodeAt(k)===10;)k++;s=k}else{if(e.charCodeAt(s+2)===123)return l(2,s,s+3),l(1,s,s),{types:a,texts:r,starts:i};s=g(`
|
|
4
|
+
`,s+2)}else if(y!==125&&c===37)s=g(`
|
|
5
|
+
`,s+2);else if(y===10){let k=s+1;for(;e.charCodeAt(k)===10;)k++;l(8,s,k)}else if(ge(y))for(s++;s<t&&ge(e.charCodeAt(s));)s++;else{if(p(y))break;if(y>=48&&y<=57&&h(Wa)>=0)l(31,s,s+10);else if(y!==58){let k=s+1;for(;k<t;){let D=e.charCodeAt(k);if(D===58||D===10)break;k++}l(35,s,k)}else{let k=s+1;for(;k<t;){let D=e.charCodeAt(k);if(D===35||D===10||D===59)break;k++}l(k>s+1?36:37,s,k)}}break}case 1:case 2:{let c=n===1?4:6;n=0,l(c,s,g(`
|
|
6
|
+
`,s));break}case 3:y===125?(n=0,s++):l(7,s,g("}",s));break;case 4:y===34?(n=0,s++):l(9,s,g('"',s));break;case 5:if(y===40){let c=h(za);c>=0?(n=0,s=c):(n=6,s++)}else l(10,s,g("(",s));break;case 6:y===41?(n=0,s++):l(11,s,g(")",s));break;case 7:if(ge(y))n=0,s++;else{let c=s+1;for(;c<t&&!ge(e.charCodeAt(c));)c++;l(12,s,c)}break}}return a.push(0),r.push(""),i.push(t),{types:a,texts:r,starts:i}}var Oa=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],pt="'EOF', 'SPACE', 'NL', 'weekday_monday', 'weekday_tuesday', 'weekday_wednesday', 'weekday_thursday', 'weekday_friday', 'weekday_saturday', 'weekday_sunday', 'weekend_friday', 'weekend_saturday', 'dateFormat', 'inclusiveEndDates', 'topAxis', 'axisFormat', 'tickInterval', 'excludes', 'includes', 'todayMarker', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'section', 'taskTxt', 'click'",xe=new Uint8Array(39);for(let e=22;e<=30;e++)xe[e]=1;for(let e of[38,8,14,15,16,17,18,20,19,21,32,3,5,7,34,35,12])xe[e]=1;function Xa(e,t){let{types:a,texts:r,starts:i}=Za(e),n=0,s=h=>{let g=a[n];throw Bt("gantt",e,i[n],`Expecting ${h}, got '${g===0?"1":Fa[g]}'`)},l=(h="")=>{xe[a[n]]!==1&&s(pt+h)};for(a[n]!==13&&s("'gantt'"),n++;;){let h=a[n],g=r[n];switch(xe[h]!==1&&s(pt),n++,h){case 38:if(a[n]===0)return;l();break;case 8:break;case 14:l(),t.setDateFormat(g.slice(11));break;case 15:l(),t.enableInclusiveEndDates();break;case 16:l(),t.TopAxis();break;case 17:l(),t.setAxisFormat(g.slice(11));break;case 18:l(),t.setTickInterval(g.slice(13));break;case 20:l(),t.setExcludes(g.slice(9));break;case 19:l(),t.setIncludes(g.slice(9));break;case 21:l(),t.setTodayMarker(g.slice(12));break;case 29:l(),t.setWeekend("friday");break;case 30:l(),t.setWeekend("saturday");break;case 32:l(),t.setDiagramTitle(g.slice(6));break;case 3:{a[n]!==4&&s("'acc_title_value'");let p=r[n++];l(),t.setAccTitle(p.trim());break}case 5:{a[n]!==6&&s("'acc_descr_value'");let p=r[n++];l(),t.setAccDescription(p.trim());break}case 7:l(),t.setAccDescription(g.trim());break;case 34:l(),t.addSection(g.slice(8));break;case 35:{a[n]!==36&&s("'taskData'");let p=r[n++];l(),t.addTask(g,p);break}case 12:{let p,y=null,c;a[n]===10?(p=r[n++],a[n]===11&&(y=r[n++]),a[n]===9?(c=r[n++],l()):l(y===null?", 'callbackargs', 'href'":", 'href'")):a[n]===9?(c=r[n++],a[n]===10?(p=r[n++],a[n]===11?(y=r[n++],l()):l(", 'callbackargs'")):l(", 'callbackname'")):s("'callbackname', 'href'"),p!==void 0&&t.setClickEvent(g,p,y),c!==void 0&&t.setLink(g,c);break}default:l(),t.setWeekday(Oa[h-22])}}}var z=1e3,L=60*z,P=60*L,V=24*P,oe=7*V,je=30*V,be=365*V;function we(e){e.setHours(0,0,0,0)}function $e(e){return{floor(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),we(t)},offset:(t,a)=>t.setDate(t.getDate()+a*7),cycle:1/0,ms:oe}}var le={millisecond:{floor:()=>{},offset:(e,t)=>e.setTime(+e+t),cycle:1/0,ms:1},second:{floor:e=>e.setTime(+e-e.getMilliseconds()),offset:(e,t)=>e.setTime(+e+t*z),field:e=>e.getUTCSeconds(),cycle:60,ms:z},minute:{floor:e=>e.setTime(+e-e.getMilliseconds()-e.getSeconds()*z),offset:(e,t)=>e.setTime(+e+t*L),field:e=>e.getMinutes(),cycle:60,ms:L},hour:{floor:e=>e.setTime(+e-e.getMilliseconds()-e.getSeconds()*z-e.getMinutes()*L),offset:(e,t)=>e.setTime(+e+t*P),field:e=>e.getHours(),cycle:24,ms:P},day:{floor:we,offset:(e,t)=>e.setDate(e.getDate()+t),field:e=>e.getDate()-1,cycle:31,ms:V},month:{floor(e){e.setDate(1),we(e)},offset:(e,t)=>e.setMonth(e.getMonth()+t),field:e=>e.getMonth(),cycle:12,ms:je},year:{floor(e){e.setMonth(0,1),we(e)},offset:(e,t)=>e.setFullYear(e.getFullYear()+t),cycle:1/0,ms:be}};function ve(e,t,a){return Math.floor((+t-+e-(t.getTimezoneOffset()-e.getTimezoneOffset())*L)/a)}function Pa(e,t){return(e%t+t)%t}function Me(e,t,a){let r=e==="week"?$e(a):le[e];if(t<=1)return r;if(e==="millisecond")return{...r,floor:s=>s.setTime(Math.floor(+s/t)*t),offset:(s,l)=>s.setTime(+s+l*t)};if(e==="year")return{...r,floor(s){s.setFullYear(Math.floor(s.getFullYear()/t)*t),r.floor(s)},offset:(s,l)=>s.setFullYear(s.getFullYear()+l*t)};if(e==="week"){let s=new Date(0);return r.floor(s),{...r,floor(l){r.floor(l),r.offset(l,-Pa(ve(s,l,oe),t))},offset:(l,h)=>r.offset(l,h*t)}}let i=r.field,n=s=>i(s)%t===0;return{...r,floor(s){for(r.floor(s);Number.isFinite(+s)&&!n(s);r.floor(s))s.setTime(+s-1)},offset(s,l){for(let h=0;h<l&&Number.isFinite(+s);h++)do r.offset(s,1);while(Number.isFinite(+s)&&!n(s))}}}function At(e,t,a,r){let i=new Date(t-1);e.floor(i),e.offset(i,1),e.floor(i);let n=[],s=-1/0;for(;+i<=a&&+i>s;){if(n.length>=r)return;s=+i,n.push(s),e.offset(i,1),e.floor(i)}return n}function Dt(e,t,a){let r=(t-e)/Math.max(0,a),i=Math.floor(Math.log10(r)),n=r/Math.pow(10,i),s=n>=Math.sqrt(50)?10:n>=Math.sqrt(10)?5:n>=Math.SQRT2?2:1;return Math.pow(10,i)*s}var U=[["second",1,z],["second",5,5*z],["second",15,15*z],["second",30,30*z],["minute",1,L],["minute",5,5*L],["minute",15,15*L],["minute",30,30*L],["hour",1,P],["hour",3,3*P],["hour",6,6*P],["hour",12,12*P],["day",1,V],["day",2,2*V],["week",1,oe],["month",1,je],["month",3,3*je],["year",1,be]];function Qa(e,t,a){let r=(t-e)/a,i=0;for(;i<U.length&&U[i][2]<=r;)i++;let n;if(i===U.length)n=Me("year",Math.max(1,Dt(e/be,t/be,a)),0);else if(i===0)n=Me("millisecond",Math.max(Dt(e,t,a),1),0);else{let[s,l]=U[r/U[i-1][2]<U[i][2]/r?i-1:i];n=Me(s,l,0)}return At(n,e,t,4*a+8)??[]}var Va=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/,ja=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function qa(e,t,a,r,i){let n=Va.exec(e);if(!n)return;let s=parseInt(n[1],10),l=n[2],h=Me(l,s,Math.max(0,ja.indexOf(t)));if(!((r-a)/(Math.min(s,h.cycle)*h.ms)>i))return At(h,a,r,i)}function x(e,t,a){let r=e<0?"-":"",i=String(r?-e:e);return r+(i.length<a?t.repeat(a-i.length)+i:i)}function G(e,t){let a=new Date(+e);return t.floor(a),a}function xt(e,t){let a=$e(t),r=G(e,le.year);return ve(G(new Date(+r-1),a),G(e,a),oe)}function Xe(e){let t=$e(4),a=e.getDay(),r=G(a>=4||a===0?e:new Date(+e-1),t);return a>=4||a===0||(t.offset(r,1),t.floor(r)),r}var Ja=new Map([["-",""],["_"," "],["0","0"]]);function pe(e,t){let a="",r=0,i=e.length;for(let n=0;n<i;n++){if(e.charCodeAt(n)!==37)continue;a+=e.slice(r,n);let s=e.charAt(++n),l=Ja.get(s);l!==void 0?s=e.charAt(++n):l=s==="e"?" ":"0",a+=Ua(s,t,l),r=n+1}return a+e.slice(r)}function Ua(e,t,a){switch(e){case"a":return Q[t.getDay()].slice(0,3);case"A":return Q[t.getDay()];case"b":return R[t.getMonth()].slice(0,3);case"B":return R[t.getMonth()];case"c":return pe("%x, %X",t);case"d":case"e":return x(t.getDate(),a,2);case"f":return x(t.getMilliseconds(),a,3)+"000";case"g":return x(Xe(t).getFullYear()%100,a,2);case"G":return x(Xe(t).getFullYear()%1e4,a,4);case"H":return x(t.getHours(),a,2);case"I":return x(t.getHours()%12||12,a,2);case"j":return x(1+ve(G(t,le.year),G(t,le.day),V),a,3);case"L":return x(t.getMilliseconds(),a,3);case"m":return x(t.getMonth()+1,a,2);case"M":return x(t.getMinutes(),a,2);case"p":return t.getHours()>=12?"PM":"AM";case"q":return String(1+Math.floor(t.getMonth()/3));case"Q":return String(+t);case"s":return String(Math.floor(+t/1e3));case"S":return x(t.getSeconds(),a,2);case"u":return String(t.getDay()||7);case"U":return x(xt(t,0),a,2);case"V":{let r=Xe(t),i=G(r,le.year),n=G(i,$e(4));return x(ve(n,r,oe)+(i.getDay()===4?1:0),a,2)}case"w":return String(t.getDay());case"W":return x(xt(t,1),a,2);case"x":return pe("%-m/%-d/%Y",t);case"X":return pe("%-I:%M:%S %p",t);case"y":return x(t.getFullYear()%100,a,2);case"Y":return x(t.getFullYear()%1e4,a,4);case"Z":{let r=t.getTimezoneOffset(),i=Math.abs(r);return(r>0?"-":"+")+x(Math.floor(i/60),"0",2)+x(i%60,"0",2)}case"%":return"%";default:return e}}var Ba=800,Ra=240,B=8,Ka=/<br\s*\/?>/gi;function I(e,t,a,r){var n;let i=(n=e.gantt)==null?void 0:n[t];return typeof i=="number"&&Number.isFinite(i)?Math.min(r,Math.max(a,i)):void 0}function Pe(e,t){var r;let a=(r=e.gantt)==null?void 0:r[t];return typeof a=="string"?a:void 0}function er(e,t){var a;return((a=e.gantt)==null?void 0:a[t])===!0}function bt(e,t,a){let r=Qe(e.replace(Ka," "),!1,t,a,4e3);return r.lines.length<=1?r:{...r,lines:[r.lines[0]],widths:[r.widths[0]],width:r.widths[0],height:r.lineHeight}}function De(e){return Number.isFinite(+e.startTime)&&Number.isFinite(+e.endTime)}function tr(e,t,a){let r=e.filter(De).sort((s,l)=>+s.startTime-+l.startTime||s.order-l.order),i=[];for(let s of r){let l=+s.startTime,h=0;for(;h<i.length&&l<i[h];)h++;i[h]=+s.endTime,a.set(s,t+h)}let n=i.length;for(let s of e)a.has(s)||a.set(s,t+n++);return Math.max(n,1)}function ar(e,t,a){let r=a.fontSize??16,i=a.measurer??Ut(a.fontFamily),n=a.padding??8,s=Ft(a.now),l=I(t,"fontSize",4,72)??Math.round(r*.8125),h=I(t,"sectionFontSize",4,72)??l,g=Math.round(r*.75),p=I(t,"barHeight",4,400)??Math.round(l*1.85),y=I(t,"barGap",0,400)??Math.round(p/4),c=p+y,k=Math.round(I(t,"numberSectionStyles",1,1e3)??4),D=e.displayMode==="compact",N=e.topAxis||er(t,"topAxis"),Te=e.getTasks(s),de=Te.filter(o=>!o.vert),It=Te.filter(o=>o.vert&&De(o)),j=new Map;for(let o of de)j.has(o.section)||j.set(o.section,j.size);let Se=new Map,O=[];if(D){let o=new Map;for(let d of de){let f=o.get(d.section);f?f.push(d):o.set(d.section,[d])}for(let[d,f]of o){let m=tr(f,O.length,Se);for(let w=0;w<m;w++)O.push(d)}}else for(let o of de)Se.set(o,O.length),O.push(o.section);let Ye=O.length,$=1/0,Y=-1/0;for(let o of Te)De(o)&&($=Math.min($,+o.startTime),Y=Math.max(Y,+o.endTime));let Nt=$<=Y,H=Qe(e.title,!1,i,r,4e3,1),Ht=H.height>0?H.height+16:0;if(!Nt){let o=Math.ceil(Math.max(H.width,1)+2*n),d=Math.ceil(Math.max(H.height,1)+2*n),f=re(H,o/2,n+H.height/2,' class="pele-title" font-weight="var(--_tw)"');return{svg:ct("gantt",o,d,r,a,e,f),width:o,height:d,links:[]}}let qe=new Map,ce=0;for(let o of j.keys()){let d=Qe(o,!1,i,h,180);qe.set(o,d),ce=Math.max(ce,d.width)}let Et=e.axisFormat||(e.dateFormat==="D"?"%d":Pe(t,"axisFormat")??"%Y-%m-%d"),_e=o=>pe(Et,new Date(o)),Fe=Math.max(i.width(_e($),g,0),i.width(_e(Y),g,0)),E=n+(I(t,"leftPadding",0,2e3)??Math.max(ce>0?ce+24:0,Fe/2)),Ae=I(t,"rightPadding",0,2e3)??Math.max(16,Fe/2),Ct=Rt(a,I(t,"useWidth",100,2e4)??Ba,280),K=Math.max(Ra,Ct-E-Ae-n),ee=E+K,Je=Y>$?K/(Y-$):0,W=o=>Je===0?E+K/2:E+(o-$)*Je,te=Math.round(g*1.75),Ie=I(t,"topPadding",0,2e3),Ue=I(t,"gridLineStartPadding",0,2e3),Be=n+Ht+(N?te:0),A=Math.max(Be,Ie??0),ae=Ie!==void 0&&Ue!==void 0?Math.max(0,Math.min(Ie-Ue,A-Be)):0,Re=Math.max(Ye,1)*c,X=A+Re,Ne=[],C=ee+Ae;for(let o of de){let d=bt(o.task,i,l),f=Se.get(o);if(!De(o)){let _=E+B+d.width/2;C=Math.max(C,_+d.width/2),Ne.push({task:o,label:d,row:f,x0:NaN,x1:NaN,labelX:_,inside:!1});continue}let m=W(+o.startTime),w=Math.max(W(+(o.renderEndTime??o.endTime)),m+(o.milestone?0:2));if(o.milestone){let _=m+(W(+o.endTime)-m)/2;m=_-p/2,w=_+p/2}let T=!o.milestone&&d.width+2*B<=w-m,v=(m+w)/2;if(!T){let _=w+B+d.width<=ee+Ae,he=m-B-d.width>=E;v=_||!he?w+B+d.width/2:m-B-d.width/2,C=Math.max(C,v+d.width/2)}Ne.push({task:o,label:d,row:f,x0:m,x1:w,labelX:v,inside:T})}let zt=e.tickInterval||Pe(t,"tickInterval")||"",Lt=e.weekday??Pe(t,"weekday")??"sunday",Wt=Math.max(2,Math.min(10,Math.floor(K/(Fe+24)))),Gt=qa(zt,Lt,$,Y,Math.ceil(K/3))??Qa($,Y,Wt),Ke="",et="",tt="",He=-1/0,at="",Zt=X+te/2+2,Ot=A-ae-te/2-2;for(let o of Gt){let d=W(o);Ke+=`M${u(d)},${u(A-ae)}V${u(X)}`;let f=_e(o),m=i.width(f,g,0);if(d-m/2<He+8||f===at)continue;He=d+m/2,at=f,C=Math.max(C,He);let w=`text-anchor="middle">${Kt(f)}</text>`;et+=`<text x="${u(d)}" y="${u(Zt+g*.35)}" ${w}`,N&&(tt+=`<text x="${u(d)}" y="${u(Ot+g*.35)}" ${w}`)}let Ee="",Ce="",q=[],Xt=X+te+4,ze=Math.round(l*1.5);for(let o of[...It].sort((d,f)=>+d.startTime-+f.startTime)){let d=W(+o.startTime),f=bt(o.task,i,l),m=Math.max(n+f.width/2,d),w=0;for(;w<q.length&&m-f.width/2<q[w]+8;)w++;q[w]=m+f.width/2,C=Math.max(C,q[w]),Ee+=`<path class="pele-vert" data-id="${ye(o.id)}" d="M${u(d)},${u(A-ae)}V${u(X)}"/>`,Ce+=re(f,m,Xt+w*ze+ze/2,` class="pele-vert-label" data-id="${ye(o.id)}"`)}let ue=Math.ceil(Math.max(C,n+H.width)+n),rt=Math.ceil(X+te+(q.length>0?4+q.length*ze:0)+n),Le="",st="";for(let o=0;o<Ye;){let d=O[o],f=o+1;for(;f<Ye&&O[f]===d;)f++;let m=j.get(d)%k,w=A+o*c,T=(f-o)*c;(j.size>1||d!=="")&&(Le+=`<rect class="pele-section pele-section-${m}" x="0" y="${u(w)}" width="${ue}" height="${u(T)}" fill="${m%2===0?"var(--_s)":"none"}"/>`);let v=qe.get(d);st+=re(v,n+8+v.width/2,w+T/2,` class="pele-section-label" data-id="${ye(d)}"`,a.icons),o=f}let We="";if((e.excludes.length>0||e.includes.length>0)&&+Tt(new Date($),6,"y")>Y){let o,d,f=()=>{if(!o||!d)return;let m=new Date(o);m.setHours(0,0,0,0);let w=new Date(d);w.setHours(23,59,59,999);let T=Math.max(E,W(+m)),v=Math.min(ee,W(+w));v>T&&(We+=`<rect x="${u(T)}" y="${u(A)}" width="${u(v-T)}" height="${u(Re)}"/>`),o=d=void 0};for(let m=new Date($);+m<=Y;m=Z(m,1))e.isInvalidDate(m)?(o??(o=m),d=m):f();f()}let nt=[],it="";for(let o of Ne){let d=o.task,f=A+o.row*c+c/2,m=d.active?"active":d.done?"done":"",w="pele-task";m&&(w+=" pele-"+m),d.crit&&(w+=" pele-crit"),d.milestone&&(w+=" pele-milestone"),d.classes.includes("clickable")&&(w+=" pele-clickable");let T="",v="";if(Number.isNaN(o.x0))w+=" pele-unscheduled",v=' fill="var(--_m)"';else{let Ge=d.crit?ea:"var(--_c)",ot=m==="done"?'fill="var(--_a)"':m==="active"?`fill="${Ge}" fill-opacity="0.25"`:`fill="${Ge}"`,dt=`stroke="${m==="done"&&!d.crit?"var(--_b)":Ge}"`;if(d.milestone){let fe=(o.x0+o.x1)/2,me=p/2;T=`<path d="M${u(fe)},${u(f-me)}L${u(fe+me)},${u(f)}L${u(fe)},${u(f+me)}L${u(fe-me)},${u(f)}Z" ${ot} ${dt} stroke-linejoin="round"/>`}else T=`<rect x="${u(o.x0)}" y="${u(f-p/2)}" width="${u(o.x1-o.x0)}" height="${u(p)}" rx="${ta}" ${ot} ${dt}/>`;o.inside?v=m===""?' fill="var(--_bg)"':"":m==="done"&&(v=' fill="var(--_m)"')}let _=T+re(o.label,o.labelX,f,` class="pele-label"${v}`),he=e.links.get(d.id);he!==void 0&&(_=qt(_,he,d.id,nt,a)),it+=`<g class="${w}" data-id="${ye(d.id)}">${_}</g>`}let lt="";if(e.todayMarker!=="off"&&s>=$&&s<=Y&&Y>$){let o=W(s),d=A-ae,f=e.todayMarker?aa(e.todayMarker.split(",")).line:"";lt=`<g class="pele-today"><path d="M${u(o)},${u(d)}V${u(X)}" fill="none" stroke="var(--_c)" stroke-width="2"${f}/>`+(f?"":`<path d="M${u(o-4)},${u(d-5)}H${u(o+4)}L${u(o)},${u(d+1)}Z" fill="var(--_c)"/>`)+"</g>"}let Pt=`M${u(E)},${u(X)}H${u(ee)}`+(N?`M${u(E)},${u(A-ae)}H${u(ee)}`:""),Qt=re(H,ue/2,n+H.height/2,' class="pele-title" font-weight="var(--_tw)"')+(Le?`<g class="pele-sections">${Le}</g>`:"")+(We?`<g class="pele-excluded" fill="var(--_a)">${We}</g>`:"")+`<g class="pele-grid" fill="none"><path d="${Ke}" stroke="var(--_b)" stroke-dasharray="1 3"/><path d="${Pt}" stroke="var(--_b)"/></g>`+(Ee?`<g class="pele-verts" fill="none" stroke="var(--_l)" stroke-width="1.5" stroke-dasharray="4 3">${Ee}</g>`:"")+lt+`<g class="pele-tasks" font-size="${u(l)}">${it}</g><g class="pele-section-labels" font-size="${u(h)}">${st}</g><g class="pele-axis" font-size="${g}" fill="var(--_m)">${et}${tt}</g>`+(Ce?`<g class="pele-vert-labels" font-size="${u(l)}">${Ce}</g>`:"");return{svg:ct("gantt",ue,rt,r,a,e,Qt),width:ue,height:rt,links:nt}}var dr={type:"gantt",parse(e,t,a){var n;let r=new _a;a&&(r.title=a);let i=(n=t.gantt)==null?void 0:n.displayMode;return typeof i=="string"&&(r.displayMode=i),Xa(e,r),r},render:ar};export{dr as gantt};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var ft=Object.defineProperty;var dt=(e,t,r)=>t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var L=(e,t,r)=>dt(e,typeof t!="symbol"?t+"":t,r);import{A as Re}from"./KQOEJWJY-DKTXya68.js";import{N as ct,L as pt}from"./JZWSX6AR-OwVPptYv.js";import{E as ut}from"./URA2L2QI-B8pYKxOk.js";import{e as xe,i as ze,L as Fe,H as yt,x as xt}from"./lazy-CKqR1774.js";import{p as mt,h as gt}from"./DKTLEL5E-B7ILCVTH.js";import{a as te,D as He,w as _t}from"./HWDLEDTA-C_JcdBMO.js";import{b as Mt,y as he,_ as j,x as A,f as ne,a as bt,$ as Ct,g as Et}from"./RZSVICHU-BiwjruZZ.js";import"./index-392ivruk.js";var wt=new Set(["label","type","descr","techn","sprite","tags","link","bgColor","fontColor","borderColor","shadowing","shape","legendText","legendSprite"]),$t=new Set(["label","descr","techn","sprite","tags","link","textColor","lineColor"]);function de(e,t){let{key:r,value:o}=t;"from"in e&&(r==="offsetX"||r==="offsetY")?e[r]=parseInt(o):("from"in e?$t:wt).has(r)?e[r]=o:(e.extra??(e.extra=new Map)).set(r,o)}function k(e,t,r){r!==void 0&&(typeof r=="string"?e[t]=r:de(e,r))}function le(e,t,r){r===void 0?e[t]??(e[t]=""):k(e,t,r)}function Ke(e,t){e.labelAttr=void 0,typeof t=="object"?(e.label="",e.labelAttr=t,de(e,t)):e.label=t??""}var Tt=class{constructor(){L(this,"type","c4");L(this,"c4Type");L(this,"title");L(this,"accTitle");L(this,"accDescr");L(this,"shapes",[]);L(this,"boundaries",[{alias:"global",label:"global",type:"global",parent:void 0}]);L(this,"rels",[]);L(this,"shapeInRow",4);L(this,"boundaryInRow",2);L(this,"shapeIndex",new Map);L(this,"boundaryIndex",new Map);L(this,"relIndex",new Map);L(this,"current",this.boundaries[0]);L(this,"stack",[])}setC4Type(e){this.c4Type=e}setTitle(e){this.title=e}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
|
+
`)}element(e,t,r,o){let s=typeof r=="string"?t.get(r):void 0;return s===void 0&&(s={alias:"",label:"",parent:void 0},e.push(s),typeof r=="string"?(s.alias=r,t.set(r,s)):(s.aliasAttr=r,de(s,r))),Ke(s,o),s}addPersonOrSystem(e,t){let r=this.element(this.shapes,this.shapeIndex,t[0],t[1]);le(r,"descr",t[2]),this.finishShape(r,e,t,3)}addContainer(e,t){let r=this.element(this.shapes,this.shapeIndex,t[0],t[1]);le(r,"techn",t[2]),le(r,"descr",t[3]),this.finishShape(r,e,t,4)}addComponent(e,t){this.addContainer(e,t)}finishShape(e,t,r,o){k(e,"sprite",r[o]),k(e,"tags",r[o+1]),k(e,"link",r[o+2]),e.kind=t,e.parent=this.current}boundary(e,t){let r=this.element(this.boundaries,this.boundaryIndex,e[0],e[1]);return e[2]===void 0?r.type=t:k(r,"type",e[2]),r}open(e){e.parent=this.current,this.stack.push(this.current),this.current=e}addPersonOrSystemBoundary(e,t="system"){let r=this.boundary(e,t);k(r,"tags",e[3]),k(r,"link",e[4]),this.open(r)}addContainerBoundary(e){this.addPersonOrSystemBoundary(e,"container")}addDeploymentNode(e,t){let r=this.boundary(t,"node");le(r,"descr",t[3]),k(r,"sprite",t[4]),k(r,"tags",t[5]),k(r,"link",t[6]),r.nodeType=e,this.open(r)}popBoundaryParseStack(){this.current=this.stack.pop()??this.boundaries[0]}addRel(e,t){var h;let r=t[0],o=t[1];if(r===void 0||o===void 0||t[2]===void 0)return;let s=typeof r=="string"&&typeof o=="string",n=s?(h=this.relIndex.get(r))==null?void 0:h.get(o):void 0;if(n===void 0){if(n={type:e,from:"",to:"",label:""},this.rels.push(n),s){let a=this.relIndex.get(r);a===void 0&&this.relIndex.set(r,a=new Map),a.set(o,n)}typeof r=="string"?n.from=r:n.fromAttr=r,typeof o=="string"?n.to=o:n.toAttr=o}n.type=e,Ke(n,t[2]),le(n,"techn",t[3]),le(n,"descr",t[4]),k(n,"sprite",t[5]),k(n,"tags",t[6]),k(n,"link",t[7])}getC4Shape(e){return this.shapeIndex.get(e)??this.boundaryIndex.get(e)}updateElStyle(e,t){let r=typeof t[0]=="string"?this.getC4Shape(t[0]):void 0;r!==void 0&&(k(r,"bgColor",t[1]),k(r,"fontColor",t[2]),k(r,"borderColor",t[3]),k(r,"shadowing",t[4]),k(r,"shape",t[5]),k(r,"sprite",t[6]),k(r,"techn",t[7]),k(r,"legendText",t[8]),k(r,"legendSprite",t[9]))}updateRelStyle(e,t){var a;let r=t[0],o=t[1],s=typeof r=="string"&&typeof o=="string"?(a=this.relIndex.get(r))==null?void 0:a.get(o):void 0;if(s===void 0)return;k(s,"textColor",t[2]),k(s,"lineColor",t[3]);let n=t[4],h=t[5];typeof n=="string"?s.offsetX=parseInt(n):n!==void 0&&de(s,n),typeof h=="string"?s.offsetY=parseInt(h):h!==void 0&&de(s,h)}updateLayoutConfig(e,t){let r=n=>n===void 0?NaN:parseInt(typeof n=="string"?n:n.value),o=r(t[0]),s=r(t[1]);o>=1&&(this.shapeInRow=o),s>=1&&(this.boundaryInRow=s)}},Ve=["$end","INVALID","direction_tb","direction_bt","direction_rl","direction_lr","title","accDescription","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","NEWLINE","C4_CONTEXT","C4_CONTAINER","C4_COMPONENT","C4_DYNAMIC","C4_DEPLOYMENT","PERSON","PERSON_EXT","SYSTEM","SYSTEM_DB","SYSTEM_QUEUE","SYSTEM_EXT","SYSTEM_EXT_DB","SYSTEM_EXT_QUEUE","CONTAINER","CONTAINER_DB","CONTAINER_QUEUE","CONTAINER_EXT","CONTAINER_EXT_DB","CONTAINER_EXT_QUEUE","COMPONENT","COMPONENT_DB","COMPONENT_QUEUE","COMPONENT_EXT","COMPONENT_EXT_DB","COMPONENT_EXT_QUEUE","ENTERPRISE_BOUNDARY","SYSTEM_BOUNDARY","BOUNDARY","CONTAINER_BOUNDARY","NODE","NODE_L","NODE_R","REL","BIREL","REL_U","REL_D","REL_L","REL_R","REL_B","REL_INDEX","UPDATE_EL_STYLE","UPDATE_REL_STYLE","UPDATE_LAYOUT_CONFIG","EOF_IN_STRUCT","ATTRIBUTE_EMPTY","STR","STR_KEY","STR_VALUE","LBRACE","RBRACE","EOF"],Nt=new Map([["C4Context",14],["C4Container",15],["C4Component",16],["C4Dynamic",17],["C4Deployment",18],["Person",19],["Person_Ext",20],["System",21],["SystemDb",22],["SystemQueue",23],["System_Ext",24],["SystemDb_Ext",25],["SystemQueue_Ext",26],["Container",27],["ContainerDb",28],["ContainerQueue",29],["Container_Ext",30],["ContainerDb_Ext",31],["ContainerQueue_Ext",32],["Component",33],["ComponentDb",34],["ComponentQueue",35],["Component_Ext",36],["ComponentDb_Ext",37],["ComponentQueue_Ext",38],["Enterprise_Boundary",39],["System_Boundary",40],["Boundary",41],["Container_Boundary",42],["Deployment_Node",43],["Node",43],["Node_L",44],["Node_R",45],["Rel",46],["BiRel",47],["Rel_Up",48],["Rel_U",48],["Rel_Down",49],["Rel_D",49],["Rel_Left",50],["Rel_L",50],["Rel_Right",51],["Rel_R",51],["Rel_Back",52],["RelIndex",53],["UpdateElementStyle",54],["UpdateRelStyle",55],["UpdateLayoutConfig",56]]),ve=[/.*direction\s+TB[^\n]*/y,/.*direction\s+BT[^\n]*/y,/.*direction\s+RL[^\n]*/y,/.*direction\s+LR[^\n]*/y],Ae=/[\n\r\u2028\u2029]/g;function Rt(e){let t=e.length,r=[],o=[],s=[],n=0,h=9,a=0,i=!1,f=-2,p=-1,y=0,_=(d,l,u)=>{r.push(d),o.push(l),s.push(u),a=u},S=d=>{for(;d<t&&xe(e.charCodeAt(d));)d++;return d},T=(d,l)=>{let u=e.indexOf(d,l);return u===-1?t:u},c=(d,l)=>{let u=a+d.length;if(!e.startsWith(d,a)||!xe(e.charCodeAt(u)))return!1;let g=++u;for(;u<t;){let b=e.charCodeAt(u);if(b===35||b===10||b===59)break;u++}return u===g?!1:(_(l,a,u),!0)};for(;;){if(i){_(0,t,t);break}a>=t&&(i=!0);let d=e.charCodeAt(a);if(n===0){if(a>=t){_(64,t,t);continue}if(f!==-1&&a>=y&&(f<a&&(f=e.indexOf("direction",a)),f!==-1&&(p<a&&(Ae.lastIndex=a,p=Ae.test(e)?Ae.lastIndex-1:t),f<p))){let l=!1;for(let u=0;u<4&&!l;u++)ve[u].lastIndex=a,ve[u].test(e)&&(_(2+u,a,ve[u].lastIndex),l=!0);if(l)continue;y=p}if(d===116&&c("title",6))continue;if(d===97){if(c("accDescription",7))continue;let l=e.startsWith("accTitle",a);if(l||e.startsWith("accDescr",a)){let u=S(a+8),g=e.charCodeAt(u);if(g===58){_(l?8:10,a,S(u+1)),h=l?9:11,n=7;continue}if(g===123&&!l){a=S(u+1),n=8;continue}}}if(d===37&&e.charCodeAt(a+1)===37){let l=T(`
|
|
3
|
+
`,a+2);for(;l<t&&(e.charCodeAt(l)===10||e.charCodeAt(l)===13);)l++;a=l;continue}if(xe(d)){let l=a,u=-1;for(;l<t;){let g=e.charCodeAt(l);if(!xe(g))break;g===10&&(u=l),l++}u!==-1?_(13,a,u+1):a=l;continue}if(d===123){_(62,a,a+1);continue}if(d===125){_(63,a,a+1);continue}if(ze(d)){let l=a+1;for(;l<t&&ze(e.charCodeAt(l));)l++;let u=l-a<=19?Nt.get(e.slice(a,l)):void 0;if(u!==void 0){u>18&&(n=1),_(u,a,l);continue}}_(1,a,a);break}if(n===1){if(a>=t)_(57,t,t);else if(d===40){let l=a+1;for(;e.charCodeAt(l)===32;)l++;e.charCodeAt(l)===44?_(58,a,l+1):a++,n=2}else if(d===41)a++,n=0;else{_(1,a,a);break}continue}if(n===2){if(a>=t)continue;if(d===41)a++,n=0;else if(d===44)e.charCodeAt(a+1)===44?_(58,a,a+2):a++;else{let l=a;for(;e.charCodeAt(l)===32;)l++;let u=e.charCodeAt(l);u===34?e.charCodeAt(l+1)===34?_(58,a,l+2):(a=l+1,n=3):u===36?(a=l+1,n=4):_(59,a,T(",",a))}continue}if(n===3){d===34?(a++,n=2):_(59,a,T('"',a));continue}if(n===4){_(60,a,T("=",a)),n=5;continue}if(n===5){if(a>=t)continue;let l=a+1;if(d===61)for(;e.charCodeAt(l)===32;)l++;if(d!==61||e.charCodeAt(l)!==34){_(1,a,a);break}a=l+1,n=6;continue}if(n===6){if(a>=t)continue;d===34?(a++,n=2):_(61,a,T('"',a));continue}if(n===7){_(h,a,T(`
|
|
4
|
+
`,a)),n=0;continue}d===125?(a++,n=0):_(12,a,T("}",a))}return{types:r,starts:o,ends:s}}var Se=["person","external_person","system","system_db","system_queue","external_system","external_system_db","external_system_queue","container","container_db","container_queue","external_container","external_container_db","external_container_queue","component","component_db","component_queue","external_component","external_component_db","external_component_queue"],vt=["rel","birel","rel_u","rel_d","rel_l","rel_r","rel_b","rel"],At=["node","nodeL","nodeR"],St="'direction_tb', 'direction_bt', 'direction_rl', 'direction_lr', 'C4_CONTEXT', 'C4_CONTAINER', 'C4_COMPONENT', 'C4_DYNAMIC', 'C4_DEPLOYMENT'",kt="'STR', 'STR_KEY', 'ATTRIBUTE', 'ATTRIBUTE_EMPTY'";function It(e){return e===6||e===7||e===8||e===10||e===12}function je(e){return e>=19&&e<=56}function Dt(e,t){let{types:r,starts:o,ends:s}=Rt(e),n=0,h=c=>e.slice(o[c],s[c]),a=c=>{let d=r[n];throw d===1?Fe("c4",e,o[n],"",!0):Fe("c4",e,o[n],`Expecting ${c}, got '${Ve[d]}'`)},i=c=>{r[n]!==c&&a(`'${Ve[c]}'`),n++},f=()=>{let c=[];for(;;){let d=r[n];if(d===59)c.push(h(n++).trim());else if(d===58)c.push(""),n++;else if(d===60)n++,r[n]!==61&&a("'STR_VALUE'"),c.push({key:h(n-1).trim(),value:h(n).trim()}),n++;else break}return c.length===0&&a(kt),c},p=c=>{c===6?t.setTitle(h(n++).substring(6)):c===7?t.setAccDescription(h(n++).substring(15)):c===12?t.setAccDescription(h(n++).trim()):(n++,c===8?(r[n]!==9&&a("'acc_title_value'"),t.setTitle(h(n++).trim())):(r[n]!==11&&a("'acc_descr_value'"),t.setAccDescription(h(n++).trim())))},y=c=>{n++;let d=f();if(c<=26)t.addPersonOrSystem(Se[c-19],d);else if(c<=32)t.addContainer(Se[c-19],d);else if(c<=38)t.addComponent(Se[c-19],d);else{if(c<=45)return c===39?d.splice(2,0,"ENTERPRISE"):c===40?d.splice(2,0,"SYSTEM"):c===42&&d.splice(2,0,"CONTAINER"),c>=43?t.addDeploymentNode(At[c-43],d):c===42?t.addContainerBoundary(d):t.addPersonOrSystemBoundary(d),r[n]===62?(n++,i(13)):r[n]===13?(n++,i(62),r[n]===13&&n++):a("'NEWLINE', 'LBRACE'"),!0;c<=53?(c===53&&d.splice(0,1),t.addRel(vt[c-46],d)):c===54?t.updateElStyle("update_el_style",d):c===55?t.updateRelStyle("update_rel_style",d):t.updateLayoutConfig("update_layout_config",d)}return!1},_=r[n];(_<14||_>18)&&a(St),n++,i(13);let S=0,T=0;for(;;){let c=r[n];if(T===3||T===4){if(c===13){n++,T=2;continue}if(T===3&&je(c)){T=1;continue}}else if(je(c)){y(c)?(S++,T=1):T=4;continue}else if(It(c)&&T!==1){p(c),T=3;continue}else T!==2&&a("'title', 'accDescription', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'PERSON', 'REL'");if(S>0)c!==63&&a("'NEWLINE', 'RBRACE'"),n++,t.popBoundaryParseStack(),S--,T=4;else{c!==64&&a("'NEWLINE', 'EOF'"),n++,i(0),t.setC4Type(h(0));return}}}var ie=28,pe=20,at=7,Lt=8,Ot=30,Oe=88,be=160,Ye=26,nt=e=>Math.min(12,Math.max(6,e/14)),ot=e=>Math.min(12,e/4);function oe(e,t,r,o,s,n,h,a){let i=0,f=1;if(h===0){if(s<e||s>r)return 1/0}else{let p=(e-s)/h,y=(r-s)/h;i=Math.max(i,Math.min(p,y)),f=Math.min(f,Math.max(p,y))}if(a===0){if(n<t||n>o)return 1/0}else{let p=(t-n)/a,y=(o-n)/a;i=Math.max(i,Math.min(p,y)),f=Math.min(f,Math.max(p,y))}return i<=f?i:1/0}function fe(e,t,r,o,s,n,h,a){let i=h/r,f=a/o,p=(s-e)/r,y=(n-t)/o,_=i*i+f*f,S=2*(i*p+f*y),T=p*p+y*y-1,c=S*S-4*_*T;if(_===0||c<0)return 1/0;let d=(-S-Math.sqrt(c))/(2*_);return d>=0&&d<=1?d:T<=0?0:1/0}function q(e,t,r,o,s){let{x:n,y:h,w:a,h:i}=e,f=o-t,p=s-r;if(e.form==="person")return Math.min(oe(n,h+Ye,n+a,h+i,t,r,f,p),fe(n+a/2,h+14,13,13,t,r,f,p));if(e.form==="cyl"){let y=nt(a);return Math.min(oe(n,h+y,n+a,h+i-y,t,r,f,p),fe(n+a/2,h+y,a/2,y,t,r,f,p),fe(n+a/2,h+i-y,a/2,y,t,r,f,p))}if(e.form==="h-cyl"){let y=ot(i);return Math.min(oe(n+y,h,n+a-y,h+i,t,r,f,p),fe(n+y,h+i/2,y,i/2,t,r,f,p),fe(n+a-y,h+i/2,y,i/2,t,r,f,p))}return oe(n,h,n+a,h+i,t,r,f,p)}function lt(e,t,r,o,s){for(let n=2;n<e.length;n+=2){let h=e[n-2],a=e[n-1];if(oe(t,r,o,s,h,a,e[n]-h,e[n+1]-a)<=1)return!0}return!1}function Ce(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.w>=t.x+t.w&&e.y+e.h>=t.y+t.h}function Bt(e,t,r){let o=e.x+e.w/2,s=e.y+e.h/2,n=t.x+t.w/2,h=t.y+t.h/2,a=Ce(e,t);if(a||Ce(t,e)){let M=a?e:t,v=a?t:e,P=v.x+v.w/2,B=v.y+v.h/2,Q=v.x-M.x,I=M.x+M.w-v.x-v.w,K=v.y-M.y,F=M.y+M.h-v.y-v.h,Y=Math.min(Q,I,K,F),U=Y===Q?M.x:Y===I?M.x+M.w:P,X=Y===Q||Y===I?B:Y===F?M.y+M.h:M.y,H=Math.min(q(v,U,X,P,B),1),J=U+(P-U)*H,Z=X+(B-X)*H;return a?[U,X,J,Z]:[J,Z,U,X]}let i=o,f=s,p=n,y=h,_=Math.max(e.x,t.x),S=Math.min(e.x+e.w,t.x+t.w),T=Math.max(e.y,t.y),c=Math.min(e.y+e.h,t.y+t.h);_<S?i=p=(_+S)/2:T<c&&(f=y=(T+c)/2);let d=Math.hypot(p-i,y-f)||1,l=-(y-f)/d*r,u=(p-i)/d*r,g=q(e,p+l,y+u,i+l,f+u),b=q(t,i+l,f+u,p+l,y+u);return g<=1&&b<=1?(i+=l,f+=u,p+=l,y+=u):(i=o,f=s,p=n,y=h,g=Math.min(q(e,p,y,i,f),1),b=Math.min(q(t,i,f,p,y),1)),[p+(i-p)*g,y+(f-y)*g,i+(p-i)*b,f+(y-f)*b]}var Be=6,Ut=3,Ge=12,Pt=class{constructor(){L(this,"upright",[]);L(this,"level",[]);L(this,"frames",[[],[]]);L(this,"taken",new Map);L(this,"squeezed",0)}free(e,t,r,o){let s=Math.min(r,o),n=Math.max(r,o),h=(a,i)=>{for(let f=0;f<a.length;f+=3)if(Math.abs(a[f]-t)<i&&a[f+1]<n&&a[f+2]>s)return!0;return!1};return!h(e?this.upright:this.level,Be)&&!h(this.frames[e?0:1],Ut)}crossings(e){let t=0;for(let r=2;r<e.length;r+=2){let o=e[r]===e[r-2],s=o?e[r]:e[r+1],n=Math.min(o?e[r-1]:e[r-2],o?e[r+1]:e[r]),h=Math.max(o?e[r-1]:e[r-2],o?e[r+1]:e[r]),a=o?this.level:this.upright;for(let i=0;i<a.length;i+=3)a[i]>n&&a[i]<h&&a[i+1]<s&&a[i+2]>s&&t++}return t}frame(e){this.frames[0].push(e.x,e.y,e.y+e.h,e.x+e.w,e.y,e.y+e.h),this.frames[1].push(e.y,e.x,e.x+e.w,e.y+e.h,e.x,e.x+e.w)}take(e){for(let t=2;t<e.length;t+=2)e[t]===e[t-2]?this.upright.push(e[t],Math.min(e[t-1],e[t+1]),Math.max(e[t-1],e[t+1])):e[t+1]===e[t-1]&&this.level.push(e[t+1],Math.min(e[t-2],e[t]),Math.max(e[t-2],e[t]))}ports(e,t,r,o,s){let n=this.taken.get(e)??[],h=[];for(let a=0;a<9&&h.length<4;a++){let i=r+(a&1?1:-1)*Math.ceil(a/2)*Ge;if(i<o||i>s)continue;let f=!0;for(let p=0;p<n.length;p+=2)n[p]===t&&Math.abs(n[p+1]-i)<Ge&&(f=!1);f&&h.push(i)}return h.length?h:[r]}claim(e,t,r){let o=this.taken.get(e);o?o.push(t,r):this.taken.set(e,[t,r])}};function Yt(e,t,r){let o=e.length,s=Math.sign(e[2]-e[0]),n=Math.sign(e[3]-e[1]),h=`M${A(e[0]+s*t)},${A(e[1]+n*t)}`;for(let f=2;f<o-2;f+=2){let p=e[f],y=e[f+1],_=Math.sign(p-e[f-2]),S=Math.sign(y-e[f-1]),T=Math.sign(e[f+2]-p),c=Math.sign(e[f+3]-y),d=Math.min(Lt,Math.abs(p-e[f-2]+y-e[f-1])/2,Math.abs(e[f+2]-p+e[f+3]-y)/2);h+=`${_?"H"+A(p-_*d):"V"+A(y-S*d)}Q${A(p)},${A(y)} ${A(p+T*d)},${A(y+c*d)}`}let a=Math.sign(e[o-2]-e[o-4]),i=Math.sign(e[o-1]-e[o-3]);return h+(a?"H"+A(e[o-2]-a*r):"V"+A(e[o-1]-i*r))}function it(e,t,r,o){for(let s of t)if(s!==r&&s!==o&<(e,s.x,s.y,s.x+s.w,s.y+s.h))return!1;return!0}function st(e,t,r,o,s){let n=e.length;return{d:Yt(e,r,o),sx:e[0],sy:e[1],sdx:-Math.sign(e[2]-e[0]),sdy:-Math.sign(e[3]-e[1]),ex:e[n-2],ey:e[n-1],edx:Math.sign(e[n-2]-e[n-4]),edy:Math.sign(e[n-1]-e[n-3]),x0:e[t],y0:e[t+1],x1:e[t+2],y1:e[t+3],nx:0,ny:0,lean:0,room:be,...s,points:e}}function Je(e,t){let r=[],o=(e+t)/2,s=Math.max(at,(t-e)/4);for(let n=0;n<9;n++){let h=o+(n&1?1:-1)*Math.ceil(n/2)*s;h>=e+Be&&h<=t-Be&&r.push(h)}return r}function Wt(e,t,r,o,s,n){let h=e.x+e.w/2,a=e.y+e.h/2,i=t.x+t.w/2,f=t.y+t.h/2,p,y=(c,d,l)=>{if(!it(c,r,e,t))return;for(let g=2;g<c.length;g+=2){let b=c[g]===c[g-2];if(!o.free(b,b?c[g]:c[g+1],b?c[g-1]:c[g-2],b?c[g+1]:c[g]))return}let u=o.crossings(c)*1e6;for(let g=2;g<c.length;g+=2)u+=Math.abs(c[g]-c[g-2])+Math.abs(c[g+1]-c[g-1]);(!p||u<p.cost)&&(p={points:c,cost:u,upright:d,sides:l})};if(e.x+e.w<=t.x||t.x+t.w<=e.x){let c=i>h,d=Math.sign(f-a),l=c?[1,0]:[0,1],u=Je(c?e.x+e.w:t.x+t.w,c?t.x:e.x);e:for(let g of o.ports(e,l[0],a+d*e.h/4,e.y+8,e.y+e.h-8))for(let b of o.ports(t,l[1],f-d*t.h/4,t.y+8,t.y+t.h-8))for(let M of u){let v=M+(h-M)*Math.min(q(e,M,g,h,g),1),P=M+(i-M)*Math.min(q(t,M,b,i,b),1),B=p;if(y([v,g,M,g,M,b,P,b],!0,l),p!==B)break e}}if(e.y+e.h<=t.y||t.y+t.h<=e.y){let c=f>a,d=Math.sign(i-h),l=c?[3,2]:[2,3],u=Je(c?e.y+e.h:t.y+t.h,c?t.y:e.y);e:for(let g of o.ports(e,l[0],h+d*e.w/4,e.x+8,e.x+e.w-8))for(let b of o.ports(t,l[1],i-d*t.w/4,t.x+8,t.x+t.w-8))for(let M of u){let v=M+(a-M)*Math.min(q(e,g,M,g,a),1),P=M+(f-M)*Math.min(q(t,b,M,b,f),1),B=p;if(y([g,v,g,M,b,M,b,P],!1,l),p!==B)break e}}if(!p)return;let{points:_,upright:S,sides:T}=p;return o.take(_),o.claim(e,T[0],S?_[1]:_[0]),o.claim(t,T[1],S?_[7]:_[6]),st(_,2,s,n,{room:S?Oe:be})}function Qt(e,t,r,o,s,n,h){if(e===t){let d=Math.min(e.h/2-4,10),l=Math.hypot(ie,d),u=e.x+e.w,g=e.y+e.h/2,b=ie/l,M=d/l;return{d:`M${A(u+b*n)},${A(g-d-M*n)}C${A(u+ie)},${A(g-d*2)} ${A(u+ie)},${A(g+d*2)} ${A(u+b*h)},${A(g+d+M*h)}`,sx:u,sy:g-d,sdx:-b,sdy:M,ex:u,ey:g+d,edx:-b,edy:-M,x0:u+ie+4,y0:g,x1:u+ie+4,y1:g,nx:1,ny:0,lean:0,room:64,points:[]}}let[a,i,f,p]=Bt(e,t,r),y=a===f,_=!1;if(o&&!Ce(e,t)&&!Ce(t,e))for(let d of o)d!==e&&d!==t&&oe(d.x,d.y,d.x+d.w,d.y+d.h,a,i,f-a,p-i)<=1&&(_=!0);if(o&&_&&!y&&i!==p){let d=Wt(e,t,o,s,n,h);if(d)return d;s.squeezed++}if(o&&_&&(y||i===p)){let d=x=>{let w=x?-1/0:1/0,m=E=>{let $=y?E.x:E.y;w=x?Math.max(w,$+(y?E.w:E.h)):Math.min(w,$)};m(e),m(t);for(let E of o)E!==e&&E!==t&&oe(E.x,E.y,E.x+E.w,E.y+E.h,a,i,f-a,p-i)<=1&&m(E);return w},l=y?Math.min(e.y,t.y):Math.min(e.x,t.x),u=y?Math.max(e.y+e.h,t.y+t.h):Math.max(e.x+e.w,t.x+t.w),g=(x,w)=>{for(let m of o){if(m===e||m===t)continue;let E=y?m.y<u&&m.y+m.h>l:m.x<u&&m.x+m.w>l,$=y?m.x:m.y,N=$+(y?m.w:m.h);if(E&&(x?N>w:$<w))return!1}return!0},b=e.x+e.w/2,M=e.y+e.h/2,v=t.x+t.w/2,P=t.y+t.h/2,B=Math.sign(y?P-M:v-b),Q=x=>{let w=d(x),m=x?1:-1,E=y?x?1:0:x?3:2,$=y?s.ports(e,E,M+B*e.h/4,e.y+8,e.y+e.h-8)[0]:s.ports(e,E,b+B*e.w/4,e.x+8,e.x+e.w-8)[0],N=y?s.ports(t,E,P-B*t.h/4,t.y+8,t.y+t.h-8)[0]:s.ports(t,E,v-B*t.w/4,t.x+8,t.x+t.w-8)[0],D=R=>{if(y){let V=R+(b-R)*Math.min(q(e,R,$,b,$),1),G=R+(v-R)*Math.min(q(t,R,N,v,N),1);return[V,$,R,$,R,N,G,N]}let C=R+(M-R)*Math.min(q(e,$,R,$,M),1),W=R+(P-R)*Math.min(q(t,N,R,N,P),1);return[$,C,$,R,N,R,N,W]},O=D(w+m*pe);for(let R=0;R<=4;R++){let C=w+m*(pe+R*at),W=D(C);if(it(W,o,e,t)&&(O=W,s.free(y,C,$,N)))return{points:O,side:E,p0:$,p1:N,step:R}}return{points:O,side:E,p0:$,p1:N,step:5}},I=y?p>i:f<a,K=g(I,d(I)),F=g(!I,d(!I)),Y=Q(I),U=K===F?Q(!I):void 0,X=x=>s.crossings(x.points)*8+x.step,H=F&&!K||U&&X(U)<X(Y)?!I:I,{points:J,side:Z,p0:se,p1:ue,step:Ee}=H===I?Y:U??Q(!I),we=H?1:-1;return Ee>4&&s.squeezed++,s.take(J),s.claim(e,Z,se),s.claim(t,Z,ue),st(J,2,n,h,y?{nx:we,lean:Ot,room:Oe}:{room:be})}let S=Math.hypot(f-a,p-i)||1,T=(f-a)/S,c=(p-i)/S;return(y||i===p)&&s.take([a,i,f,p]),{d:`M${A(a+T*n)},${A(i+c*n)}L${A(f-T*h)},${A(p-c*h)}`,sx:a,sy:i,sdx:-T,sdy:-c,ex:f,ey:p,edx:T,edy:c,x0:a,y0:i,x1:f,y1:p,nx:r?-c:0,ny:r?T:0,lean:0,room:Math.abs(T)>Math.abs(c)?Oe:be,points:[a,i,f,p]}}var Ue=216,Xt=64,Ze=14,qt=12,zt=100,Ft=88,et=pe+8,me=48,ce=16,Pe=10,ke=new Map([["person","person"],["box","rect"],["rounded","rect"],["component","rect"],["cylinder","cyl"],["database","cyl"],["db","cyl"],["queue","h-cyl"],["pipe","h-cyl"]]);function Ht(e){let t=ke.get((e.shape??"").toLowerCase())??ke.get((e.sprite??"").toLowerCase());if(t)return t;if(e.tags)for(let o of e.tags.split(",")){let s=ke.get(o.trim().toLowerCase());if(s)return s}let r=e.kind;return r.endsWith("person")?"person":r.endsWith("_db")?"cyl":r.endsWith("_queue")?"h-cyl":"rect"}function Kt(e,t,r,o,s=Ue){let n=Ht(e),h=n==="h-cyl"?36:0,a=n==="person"?Ye:n==="cyl"?24:0,i=s-2*Ze-h,f=[j("«"+e.kind.replace(/_/g," ")+"»",!1,t,o-1,i),j(e.label,!1,t,r,i,1),j(e.techn?`[${e.techn}]`:void 0,!1,t,o,i),j(e.descr,!1,t,o,i)],p=0,y=f[3].height>0?4:0;for(let _ of f)p=Math.max(p,_.width),y+=_.height;return{shape:e,form:n,labels:f,textH:y,x:0,y:0,w:Math.max(s,p+2*Ze+h),h:Math.max(Xt,y+2*qt+a)}}function tt(e,t,r,o,s){let n=0,h=0;for(let a=0;a<e.length;a+=t){let i=Math.min(e.length,a+t),f=0,p=0;for(let y=a;y<i;y++)p=Math.max(p,e[y].h);for(let y=a;y<i;y++){let _=e[y];_.x=f,_.y=h,s&&(_.h=p),f+=_.w+r}n=Math.max(n,f-r),h+=p+o}return[n,e.length>0?h-o:0]}function Vt(e,t,r,o,s,n){var c,d;let h=s===void 0?et:12,a=new Map;for(let l of e.boundaries){let u=s===void 0?4e3:Math.max(80,s-2*ce-2*et*2),g=l.parent?[j(l.label,!1,t,r,u,1),j(l.type?`[${l.type}]`:void 0,!1,t,o,u),j(l.descr,!1,t,o,u)]:[],b=0,M=0;for(let v of g)b+=v.height,M=Math.max(M,v.width);a.set(l,{boundary:l,kids:[],nodes:[],labels:g,head:b>0?b+Pe+6+pe:h,headW:M,headX:ce,x:0,y:0,w:0,h:0,form:"rect"})}let i=a.get(e.boundaries[0]);for(let l of a.values()){let u=l.boundary.parent;u&&((c=a.get(u))==null||c.kids.push(l))}let f=[i],p=new Map([[i.boundary,0]]);for(let l=0;l<f.length;l++)for(let u of f[l].kids)p.set(u.boundary,p.get(f[l].boundary)+1),f.push(u);for(let l of e.shapes)if(l.parent){let u=p.get(l.parent)??0,g=s===void 0?Ue:Math.max(100,Math.min(Ue,s-2*u*h-32));(d=a.get(l.parent))==null||d.nodes.push(Kt(l,t,r,o,g))}let y=Math.max(1,e.shapeInRow),_=Math.max(1,e.boundaryInRow),S=new Map;for(let l=f.length-1;l>=0;l--){let u=f[l],g=s===void 0?zt:n,b=(K,F,Y)=>{if(s===void 0)return F;let U=1;for(let X of K)U=Math.max(U,X.w);return Math.max(1,Math.min(F,Math.floor((s+Y-2*h)/(U+Y))))},[M,v]=tt(u.nodes,b(u.nodes,y,g),g,Ft,!0),[P,B]=tt(u.kids,b(u.kids,_,me),me,me,!1),Q=v>0&&B>0?me:0,I=u===i?0:h;S.set(u,v+Q),u.w=Math.max(M,P,u.headW+2*ce-2*I)+2*I,u.h=(I&&u.head)+v+Q+B+I}let T=new Map;for(let l of f){let u=l.x+(l===i?0:h),g=l.y+(l===i?0:l.head);for(let b of l.nodes)b.x+=u,b.y+=g,T.set(b.shape,b);for(let b of l.kids)b.x+=u,b.y+=g+S.get(l);l!==i&&T.set(l.boundary,l)}return{order:f,boxes:T}}var jt=7,Me=36,Ie=24,rt=2e3,ge=8,Gt=[.5,.4,.6,.3,.7,.2,.8],Jt=2e6;function _e(e,t,r){let o=[];return e&&o.push("fill:"+e),t&&o.push("stroke:"+t),r&&o.push("color:"+r),Et(o)}function De(e,t,r,o,s){return t?ct(e,pt(t.includes("¶ß")?t.replace(/\ufb02\u00b0\u00b0?/g,"#").replace(/\u00b6\u00df/g,";"):t),r,o,s):e}function Zt(e,t,r){return mt(r,o=>{if(!o)return Le(e,t,r,!1)[0];let[s,n]=Le(e,t,r,!0,Me);for(let h=Me+Ie;n>0&&h<=Me+3*Ie;h+=Ie){let[a,i]=Le(e,t,r,!0,h);i<n&&([s,n]=[a,i])}return s})}function Le(e,t,r,o,s=Me){let n=r.fontSize??16,h=Math.round(n*.8125),a=r.measurer??yt(r.fontFamily),i=r.padding??8,f=[],{order:p,boxes:y}=Vt(e,a,n,h,o?Math.max(80,(r.maxWidth??320)-2*i):void 0,s),_=p[0],S=0,T=0,c=_.w,d=_.h,l=(x,w,m,E)=>{S=Math.min(S,x),T=Math.min(T,w),c=Math.max(c,m),d=Math.max(d,E)},u=[],g=new Map;for(let x of e.rels){let w=x.fromAttr?void 0:e.getC4Shape(x.from),m=x.toAttr?void 0:e.getC4Shape(x.to),E=w&&y.get(w),$=m&&y.get(m);if(!E||!$)throw new xt(`C4 rel "${x.from}" -> "${x.to}" references an unknown shape or boundary`,"semantic",{type:"c4"});u.push(E,$);let N=g.get(E);N||g.set(E,N=new Set),N.add($)}let b=[],M=[];for(let x of p)for(let w of x.nodes)b.push(w),M.push(w.x+ge,w.y+ge,w.x+w.w-ge,w.y+w.h-ge);let v=e.rels.length*(b.length+p.length+3*e.rels.length)<=Jt,P=(x,w,m,E)=>{let $=0;for(let N=0;N<M.length;N+=4){let D=Math.min(m,M[N+2])-Math.max(x,M[N]);if(D<=0)continue;let O=Math.min(E,M[N+3])-Math.max(w,M[N+1]);O>0&&($+=D*O)}return $},B=x=>x?Math.max(-rt,Math.min(rt,x)):0,Q="",I=_t("arrow_point"),K=new Pt;for(let x of p)x!==_&&K.frame(x);let F=e.rels.map((x,w)=>{var W;let m=u[w*2],E=u[w*2+1],$=_e(void 0,x.lineColor,void 0),N=$.stroke?Mt($.stroke):"var(--_l)",D=x.type==="birel"||x.type==="rel_b",O=x.type!=="rel_b",R=m!==E&&((W=g.get(E))==null?void 0:W.has(m))===!0,C=Qt(m,E,R?jt:0,v?b:void 0,K,D?I:0,O?I:0);return l(Math.min(C.x0,C.x1),Math.min(C.y0,C.y1),Math.max(C.x0,C.x1),Math.max(C.y0,C.y1)),D&&v&&M.push(C.sx-te,C.sy-te,C.sx+te,C.sy+te),O&&v&&M.push(C.ex-te,C.ey-te,C.ex+te,C.ey+te),Q+=`<g class="pele-edge" data-id="${he(x.from+"-"+x.to)}"${$.line}><path d="${C.d}"/>`+(D?He("arrow_point",C.sx,C.sy,C.sdx,C.sdy,N):"")+(O?He("arrow_point",C.ex,C.ey,C.edx,C.edy,N):"")+"</g>",C});for(let x of p){if(!v||x.headW===0)continue;let w=x.y+Pe,m=x.y+x.head-pe,E=1/0;for(let $ of[ce,(x.w-x.headW)/2,x.w-ce-x.headW]){let N=0;for(let D of F)lt(D.points,x.x+$-4,w,x.x+$+x.headW+4,m)&&N++;if(N<E&&(E=N,x.headX=$),N===0)break}M.push(x.x+x.headX-4,w,x.x+x.headX+x.headW+4,m)}let Y="";e.rels.forEach((x,w)=>{let m=F[w],E=x.from+"-"+x.to,$=_e(void 0,void 0,x.textColor),N=(e.c4Type==="C4Dynamic"?w+1+": ":"")+x.label,D=j(N,!1,a,h,m.room),O=j(x.techn?`[${x.techn}]`:void 0,!1,a,h,m.room,2),R=Math.max(D.width,O.width)+8,C=D.height+O.height;if(C===0)return;let W=Math.abs(m.nx)*(R/2)+Math.abs(m.ny)*(C/2)+2,V=m.lean?Math.max(0,Math.min(m.lean,W-14)):W,G=m.nx*V+(o?0:B(x.offsetX)),z=m.ny*V+(o?0:B(x.offsetY)),ee=.5;if(v){let $e=1/0,ht=G!==m.nx*V||z!==m.ny*V;for(let ye=0;ye<(ht?2:1)&&$e>0;ye++){let We=ye?m.nx*V:G,Qe=ye?m.ny*V:z;for(let Te of Gt){let Xe=m.x0+(m.x1-m.x0)*Te+We,qe=m.y0+(m.y1-m.y0)*Te+Qe,Ne=P(Xe-R/2,qe-C/2,Xe+R/2,qe+C/2);if(Ne<$e&&($e=Ne,ee=Te,G=We,z=Qe),Ne===0)break}}}let re=m.x0+(m.x1-m.x0)*ee+G,ae=m.y0+(m.y1-m.y0)*ee+z-C/2;v&&M.push(re-R/2,ae,re+R/2,ae+C),l(re-R/2,ae,re+R/2,ae+C),Y+=`<g class="pele-edge-label" data-id="${he(E)}">`+(x.descr?`<title>${he(x.descr)}</title>`:"")+`<rect x="${A(re-R/2)}" y="${A(ae)}" width="${A(R)}" height="${A(C)}" rx="3" fill="var(--_bg)"/>`+De(ne(D,re,ae+D.height/2,$.text)+ne(O,re,ae+D.height+O.height/2,` class="pele-c4-techn" fill="var(--_m)"${$.text}`),x.link,E,f,r)+"</g>"});let U="",X="";for(let x of p){if(x!==_){let w=x.boundary,m=_e(w.bgColor,w.borderColor,w.fontColor),E=x.x+x.headX,$=x.y+Pe,N=Re(x.labels[0],E,$,` class="pele-cluster-label" font-weight="var(--_hw)"${m.text}`);$+=x.labels[0].height,N+=Re(x.labels[1],E,$,` class="pele-c4-type" font-size="${h}" fill="var(--_m)"${m.text}`),$+=x.labels[1].height,N+=Re(x.labels[2],E,$,` class="pele-c4-descr" font-size="${h}" fill="var(--_m)"${m.text}`),U+=`<g class="pele-cluster pele-c4-${w.nodeType?"node":"boundary"}" data-id="${he(w.alias)}"><rect x="${A(x.x)}" y="${A(x.y)}" width="${A(x.w)}" height="${A(x.h)}" rx="${bt}" fill="none" stroke="var(--_b)"${w.nodeType?"":' stroke-dasharray="6 4"'}${m.shape}/>`+De(N,w.link,w.alias,f,r)+"</g>"}for(let w of x.nodes){let m=w.shape,E=m.kind.startsWith("external"),$=_e(m.bgColor,m.borderColor,m.fontColor),N=' stroke="var(--_b)"'+(E?' stroke-dasharray="4 3"':""),{w:D,h:O,form:R,labels:C}=w,W=R==="h-cyl"?-ot(O)/2:0,V=R==="person"?Ye/2:R==="cyl"?nt(D)/2:0,G=` fill="var(--_m)"${$.text}`,z=V-w.textH/2,ee=ne(C[0],W,z+C[0].height/2,` class="pele-c4-type" font-size="${h-1}"${G}`);z+=C[0].height,ee+=ne(C[1],W,z+C[1].height/2,` class="pele-label" font-weight="var(--_hw)"${$.text}`),z+=C[1].height,ee+=ne(C[2],W,z+C[2].height/2,` class="pele-c4-techn" font-size="${h}"${G}`),z+=C[2].height+4,ee+=ne(C[3],W,z+C[3].height/2,` class="pele-c4-descr" font-size="${h}"${$.text}`),X+=`<g class="pele-node pele-shape-${R} pele-c4-${m.kind}${E?" pele-c4-external":""}" data-id="${he(m.alias)}" transform="translate(${A(w.x+D/2)},${A(w.y+O/2)})">`+De(ut(R,D,O,` fill="var(${E?"--_bg":"--_s"})"${N}${$.shape}`,N+$.line)+ee,m.link,m.alias,f,r)+"</g>"}}let H=j(e.title,!1,a,n,o?gt(r):4e3,1),J=H.height>0?H.height+12:0,Z=Math.max(c-S,H.width),se=Math.ceil(Z+2*i),ue=Math.ceil(d-T+J+2*i),Ee=i-S+(Z-(c-S))/2,we=i+J-T;return[{svg:Ct("c4",se,ue,n,r,e,ne(H,se/2,i+H.height/2,' class="pele-title" font-weight="var(--_tw)"')+`<g transform="translate(${A(Ee)},${A(we)})">`+(U?`<g class="pele-clusters">${U}</g>`:"")+(Q?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${Q}</g>`:"")+(X?`<g class="pele-nodes">${X}</g>`:"")+(Y?`<g class="pele-edge-labels" font-size="${h}">${Y}</g>`:"")+"</g>"),width:se,height:ue,links:f},K.squeezed]}var hr={type:"c4",parse(e,t,r){let o=new Tt;return r&&(o.title=r),Dt(e,o),o},render:Zt};export{hr as c4};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var Ft=Object.defineProperty;var Yt=(t,i,a)=>i in t?Ft(t,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[i]=a;var w=(t,i,a)=>Yt(t,typeof i!="symbol"?i+"":i,a);import{s as Q}from"./RVARI57O-CXmrUIiS.js";import{H as $t,x as Ot,i as nt,e as bt,u as Et,t as lt,L as wt,o as zt}from"./lazy-CKqR1774.js";import{l as Kt}from"./DKTLEL5E-B7ILCVTH.js";import{_ as vt,a as jt,x as X,f as J,h as Gt,y as Vt,g as Jt,$ as Zt,m as te}from"./RZSVICHU-BiwjruZZ.js";import"./index-392ivruk.js";var ee=/^\d+$/,Rt=/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/,ie=/^\d+px$/;function ht(t,i,a){return new Ot(`value for ${t} ${i} is invalid, please use a valid ${a}`,"semantic",{type:"quadrantChart"})}function ae(t){let i=t.trim(),a=i.indexOf(":");if(a===-1)return[i,"undefined"];let l=i.slice(a+1).trimStart(),h=l.indexOf(":");return[i.slice(0,a).trimEnd(),h===-1?l:l.slice(0,h).trimEnd()]}function Ut(t){let i={};for(let a of t){let[l,h]=ae(a);if(l==="radius"){if(!ee.test(h))throw ht(l,h,"number");i.radius=parseInt(h)}else if(l==="color"){if(!Rt.test(h))throw ht(l,h,"hex code");i.color=h}else if(l==="stroke-color"){if(!Rt.test(h))throw ht(l,h,"hex code");i.strokeColor=h}else if(l==="stroke-width"){if(!ie.test(h))throw ht(l,h,"number of pixels (eg. 10px)");i.strokeWidth=h}else throw new Ot(`style named ${l} is not supported.`,"semantic",{type:"quadrantChart"})}return i}function B(t){return{text:t.text.trim(),type:t.type}}var re=class{constructor(){w(this,"type","quadrantChart");w(this,"title");w(this,"accTitle");w(this,"accDescr");w(this,"quadrants",[void 0,void 0,void 0,void 0]);w(this,"xAxisLeft");w(this,"xAxisRight");w(this,"yAxisBottom");w(this,"yAxisTop");w(this,"points",[]);w(this,"classes",new Map)}setQuadrant1Text(t){this.quadrants[0]=B(t)}setQuadrant2Text(t){this.quadrants[1]=B(t)}setQuadrant3Text(t){this.quadrants[2]=B(t)}setQuadrant4Text(t){this.quadrants[3]=B(t)}setXAxisLeftText(t){this.xAxisLeft=B(t)}setXAxisRightText(t){this.xAxisRight=B(t)}setYAxisBottomText(t){this.yAxisBottom=B(t)}setYAxisTopText(t){this.yAxisTop=B(t)}addPoint(t,i,a,l,h){this.points.push({x:Number(a),y:Number(l),text:B(t),className:i,...Ut(h)})}addClass(t,i){this.classes.set(t,Ut(i))}setDiagramTitle(t){this.title=t}setAccTitle(t){this.accTitle=t.replace(/^\s+/g,"")}setAccDescription(t){this.accDescr=t.replace(/\n\s+/g,`
|
|
2
|
+
`)}},Dt=["$end","INVALID","NEWLINE","title","title_value","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","X-AXIS","Y-AXIS","AXIS-TEXT-DELIMITER","QUADRANT_1","QUADRANT_2","QUADRANT_3","QUADRANT_4","CLASSDEF","MD_STR","STR","class_name","point_start","point_x","point_y","QUADRANT","ALPHA","UNICODE_TEXT","COLON","PLUS","COMMA","EQUALS","MULT","BRKT","UNDERSCORE","DOT","AMP","MINUS","NUM","SPACE","SEMI","PUNCTUATION","EOF"],ft=[41,4,6,8,9,19],xt=new Uint8Array(128);for(let[t,i]of[[":",27],["+",28],[",",29],["=",30],["*",31],["#",32],["_",33],[".",34],["&",35],["-",36],[" \v\f",38],[";",39],["!$%'`?\\/",40]])for(let a=0;a<t.length;a++)xt[t.charCodeAt(a)]=i;function se(t){let i=t.length,a=[],l=[],h=[],s=[],M=0,e=0,k=0,b=0,v=0,c=0,x=0,N=0,R=0,U=0,A=(o,C,y)=>{a.push(o),l.push(t.slice(C,y)),h.push(C),e=y},D=o=>{s.push(M),M=o},q=()=>{s.length>0&&(M=s.pop())},j=o=>{let C=t.indexOf(`
|
|
3
|
+
`,o);return C===-1?i:C},G=o=>{for(;t.charCodeAt(o)===32;)o++;return o},E=o=>{for(;o<i&&bt(t.charCodeAt(o));)o++;return o},F=o=>{let C=t.charCodeAt(o);if(C===49)return o+1;if(C!==48)return-1;let y=o+1;if(y<i&&!zt(t.charCodeAt(y))&<(t.charCodeAt(y+1)))for(y+=2;lt(t.charCodeAt(y));)y++;return y};t:for(;e<i;){let o=t.charCodeAt(e),C=t.charCodeAt(e+1);switch(M){case 0:break;case 1:case 2:case 3:A(ft[M],e,j(e)),q();continue;case 4:if(o===125)e++,q();else{let r=t.indexOf("}",e);A(9,e,r===-1?i:r)}continue;case 5:if(o===34)e++,q();else{let r=t.indexOf('"',e);A(19,e,r===-1?i:r)}continue;case 6:if(o===96&&C===34){e+=2,q();continue}if(o!==96&&o!==34){let r=e+1;for(let d=t.charCodeAt(r);r<i&&d!==96&&d!==34;d=t.charCodeAt(++r));A(18,e,r);continue}break t;case 7:if(nt(o)){let r=e+1;for(;nt(t.charCodeAt(r));)r++;A(20,e,r),q();continue}break t;case 8:{let r=F(e);if(r!==-1){A(22,e,r),D(9);continue}let d=E(e);if(t.charCodeAt(d)===93){e=G(d+1),q();continue}break t}case 9:{let r=E(e);if(t.charCodeAt(r)===44){e=E(r+1),M=10;continue}break t}case 10:{let r=F(e);if(r!==-1){A(23,e,r),q();continue}break t}}if(o===37&&C===37){e=j(e+2);continue}if(o!==125&&C===37&&t.charCodeAt(e+2)===37){e=j(e+3);continue}if(o===10||o===13){let r=e+1;for(let d=t.charCodeAt(r);d===10||d===13;d=t.charCodeAt(++r));A(2,e,r);continue}let y=o|32;if(y===116&&Q(t,e,"title")&&!nt(t.charCodeAt(e+5))){A(3,e,e+5),D(1);continue}if(y===97&&Q(t,e,"acc")){let r=Q(t,e+3,"descr");if(r||Q(t,e+3,"title")){let d=E(e+8),_=t.charCodeAt(d);if(_===58){A(r?7:5,e,E(d+1)),D(r?3:2);continue}if(_===123&&r){e=E(d+1),D(4);continue}}}let p=e;o===32&&((e<k||e>=b)&&(k=e,b=G(e)),p=b);let Y=t.charCodeAt(p),$=Y|32,L=0,P=0;if($===120&&Q(t,p,"x-axis"))L=10,P=p+6;else if($===121&&Q(t,p,"y-axis"))L=11,P=p+6;else if(Y===45){if(p<v||p>=c)for(v=p,c=p;t.charCodeAt(c)===45;)c++;c-p>=2&&t.charCodeAt(c)===62&&(L=12,P=c+1)}else if($===113&&Q(t,p,"quadrant")){let r=t.charCodeAt(p+9);t.charCodeAt(p+8)===45&&r>=49&&r<=52?(L=13+r-49,P=p+10):Q(t,p+8,"chart")&&(L=24,P=p+13)}if(L!==0){A(L,e,G(P));continue}if(y===99&&Q(t,e,"classdef")&&!nt(t.charCodeAt(e+8))){A(17,e,e+8);continue}if(o===34){C===96?(e+=2,D(6)):(e++,D(5));continue}if(o===58&&C===58&&t.charCodeAt(e+2)===58){e+=3,D(7);continue}if(o===58||bt(o)){let r=e;if(o!==58&&((e<x||e>=N)&&(x=e,N=E(e)),r=N),t.charCodeAt(r)===58&&((r+1<R||r+1>=U)&&(R=r+1,U=E(r+1)),t.charCodeAt(U)===91)){A(21,e,E(U+1)),D(8);continue}}if(Et(o)){let r=e+1;for(;Et(t.charCodeAt(r));)r++;A(25,e,r);continue}if(o>=128){let r=e+1;for(;t.charCodeAt(r)>=128;)r++;A(26,e,r);continue}if(lt(o)){let r=e+1;for(;lt(t.charCodeAt(r));)r++;A(37,e,r);continue}if(xt[o]!==0){A(xt[o],e,e+1);continue}break}return e<i?(a.push(1),l.push(""),h.push(e),{types:a,texts:l,starts:h}):(M<ft.length&&(a.push(ft[M]),l.push(""),h.push(i)),a.push(0),l.push(""),h.push(i),{types:a,texts:l,starts:h})}function ct(...t){let i=new Uint8Array(42);for(let a of t)i[a]=1;return i}var Lt=ct(40,35,37,25,29,28,30,31,34,32,33,26),St=ct(25,37,36,29,27,35,32,31,26),ut=ct(25,37,27,38,32,36),qt=ct(2,39,41),oe=["setQuadrant1Text","setQuadrant2Text","setQuadrant3Text","setQuadrant4Text"],ne="'STR', 'MD_STR', 'ALPHA', 'NUM', 'UNICODE_TEXT', 'PUNCTUATION'";function le(t,i){let{types:a,texts:l,starts:h}=se(t),s=0,M=c=>{let x=a[s];throw x===1?wt("quadrantChart",t,h[s],"",!0):wt("quadrantChart",t,h[s],`Expecting ${c}, got '${Dt[x]}'`)},e=c=>(a[s]!==c&&M(`'${Dt[c]}'`),l[s++]),k=c=>c===19||c===18||Lt[c]===1,b=()=>{let c=a[s];k(c)||M(ne);let x=l[s++];for(;Lt[a[s]]===1||a[s]===38||a[s]===36;)x+=l[s++];return{text:x,type:c===18?"markdown":"text"}},v=()=>{let c=[];for(;;){ut[a[s]]===0&&M("'ALPHA', 'NUM', 'COLON', 'SPACE', 'BRKT', 'MINUS'");let x=l[s++];for(;ut[a[s]]===1;)x+=l[s++];if(c.push(x.trim()),a[s]!==29)return c;s++}};for(;qt[a[s]]===1||a[s]===38;)s++;for(e(24);a[s]!==0;){for(;a[s]===38;)s++;let c=a[s];switch(c){case 17:{s++,e(38),St[a[s]]===0&&M("'ALPHA', 'NUM', 'UNICODE_TEXT'");let x=l[s++];for(;St[a[s]]===1;)x+=l[s++];e(38),i.addClass(x,v());break}case 10:case 11:{s++;let x=b(),N;a[s]===12&&(s++,k(a[s])?N=b():x.text+=" ⟶ "),c===10?(i.setXAxisLeftText(x),N&&i.setXAxisRightText(N)):(i.setYAxisBottomText(x),N&&i.setYAxisTopText(N));break}case 13:case 14:case 15:case 16:s++,i[oe[c-13]](b());break;case 3:s++,i.setDiagramTitle(e(4).trim());break;case 5:s++,i.setAccTitle(e(6).trim());break;case 7:s++,i.setAccDescription(e(8).trim());break;case 9:i.setAccDescription(l[s++].trim());break;default:if(k(c)){let x=b(),N=a[s]===20?l[s++]:"";e(21);let R=e(22),U=e(23);i.addPoint(x,N,R,U,ut[a[s]]===1?v():[])}}qt[a[s]]===0&&M("'NEWLINE', 'SEMI', 'EOF'"),s++}}var Pt=4,he=300;function At(t,i){var a;return(a=t.quadrantChart)==null?void 0:a[i]}function H(t,i,a,l){let h=At(t,i);return typeof h=="number"&&h>=0?Math.min(h,l):a}function It(t){return t.startsWith("#")?t:"#"+t}function ce(t,i,a){var Ct,yt,Mt,_t;let l=a.fontSize??16,h=Math.round(l*.875),s=Math.round(l*.75),M=a.measurer??$t(a.fontFamily),e=Math.round(Math.max(100,H(i,"chartWidth",500,4e3))),k=Math.round(Kt(a,e,280)),b=Math.round(Math.max(100,H(i,"chartHeight",500,4e3))*k/e),v=H(i,"quadrantPadding",a.padding??8,200),c=H(i,"xAxisLabelPadding",5,200),x=H(i,"yAxisLabelPadding",5,200),N=t.points.length>0,R=(n,f,g)=>vt(n==null?void 0:n.text,(n==null?void 0:n.type)==="markdown",M,f,Math.max(g,40)),U=vt(t.title,!1,M,l,Math.max(k-2*v,40),1),A=H(i,"titlePadding",10,200),D=U.height>0?U.height+A:0,q=!!((Ct=t.xAxisLeft)!=null&&Ct.text||(yt=t.xAxisRight)!=null&&yt.text),j=!!((Mt=t.yAxisBottom)!=null&&Mt.text||(_t=t.yAxisTop)!=null&&_t.text),G=N||At(i,"xAxisPosition")==="bottom",E=At(i,"yAxisPosition")==="right",F=k-2*v,o=R(t.xAxisLeft,h,t.xAxisRight?F/2-16:F),C=R(t.xAxisRight,h,F/2-16),y=Math.max(o.height,C.height),p=q?y+c:0,Y=b-2*v-D-p,$=R(t.yAxisBottom,h,t.yAxisTop?Y/2-16:Y),L=R(t.yAxisTop,h,Y/2-16),P=Math.max($.height,L.height),r=j?P+x:0,d=v+(E?0:r),_=v+D+(G?0:p),S=Math.max(0,F-r),I=Math.max(0,Y),V=Math.max(0,(S-Pt)/2),Z=Math.max(0,(I-Pt)/2),W=[d+V,_,d+S-V,_+I,d,_+Z,d+S,_+I-Z],Qt=(n,f,g,m,T)=>{for(let u=n;u<W.length;u+=4)if(f<W[u+2]&&m>W[u]&&g<W[u+3]&&T>W[u+1])return!1;return!0},Xt=H(i,"quadrantTextTopPadding",5,200),pt="";for(let n=0;n<4;n++){let f=n===0||n===3?d+S-V:d,g=n<2?_:_+I-Z,m=R(t.quadrants[n],l,V-16),T=f+V/2,u=N?g+Xt+m.height/2:g+Z/2;W.push(T-m.width/2,u-m.height/2,T+m.width/2,u+m.height/2),pt+=`<g class="pele-quadrant" data-id="${n+1}"><rect x="${X(f)}" y="${X(g)}" width="${X(V)}" height="${X(Z)}" rx="${jt}"/>`+J(m,T,u,' class="pele-label" fill="var(--_fg)" stroke="none"')+"</g>"}let at="";if(q){let n=G?_+I+c+y/2:_-c-y/2;at+=J(o,C.height>0?d+S/4:d+o.width/2,n,"")+J(C,d+S*3/4,n,"")}if(j){let n=E?d+S+x+P/2:d-x-P/2,f=(g,m)=>g.height>0?`<g transform="translate(${X(n)},${X(m)}) rotate(-90)">${J(g,0,0,"")}</g>`:"";at+=f($,L.height>0?_+I*3/4:_+I-$.width/2)+f(L,_+I/4)}let Bt=H(i,"pointRadius",5,200),Ht=H(i,"pointTextPadding",5,200),gt=te(0),tt=[],mt=[];for(let n of t.points){if(!(n.x>=0&&n.x<=1&&n.y>=0&&n.y<=1))continue;let f=t.classes.get(n.className),g=Math.min(n.radius??(f==null?void 0:f.radius)??Bt,2e3),m=n.color??(f==null?void 0:f.color),T=n.strokeColor??(f==null?void 0:f.strokeColor),u=n.strokeWidth??(f==null?void 0:f.strokeWidth),O=[];m&&O.push("fill:"+It(m)),u&&(T&&O.push("stroke:"+It(T)),O.push("stroke-width:"+u));let z=d+n.x*S,K=_+(1-n.y)*I;tt.push({cx:z,cy:K,reach:g+(u?Math.min(parseInt(u),400)/2:0),text:R(n.text,s,200)}),mt.push(`<circle class="pele-point${Gt(n.className)}" data-id="${Vt(n.text.text)}" cx="${X(z)}" cy="${X(K)}" r="${X(g)}"${u&&!T?` stroke="${gt}"`:""}${Jt(O).shape}/>`)}let dt=tt.length<=he;if(dt)for(let{cx:n,cy:f,reach:g}of tt)W.push(n-g,f-g,n+g,f+g);let Tt="";for(let{cx:n,cy:f,reach:g,text:m}of tt){let T=m.width/2,u=m.size*.6+(m.height-m.lineHeight)/2,O=g+Ht,z=[n,f+O+u,n,f-O-u,n+O+T,f,n-O-T,f],K=n,rt=z[1],Nt=!1;for(let st=0;st<16;st+=2){let ot=st%8,et=ot<4&&m.width<S?Math.min(Math.max(z[ot],d+T),d+S-T):z[ot],it=z[ot+1];if(et-T<d||et+T>d+S||it-u<_||it+u>_+I)continue;let kt=!dt||Qt(st<8?0:8,et-T,it-u,et+T,it+u);if((!Nt||kt)&&(K=et,rt=it,Nt=!0),kt)break}dt&&W.push(K-T,rt-u,K+T,rt+u),Tt+=J(m,K,rt,' class="pele-label"')}let Wt=J(U,k/2,A/2+U.height/2,' class="pele-title" font-weight="var(--_tw)"')+`<g class="pele-quadrants" fill="var(--_s)" stroke="var(--_b)">${pt}</g>`+(at?`<g class="pele-axis-labels" font-size="${h}" fill="var(--_m)">${at}</g>`:"")+(tt.length>0?`<g class="pele-points" fill="${gt}">${mt.reverse().join("")}</g><g class="pele-point-labels" font-size="${s}">${Tt}</g>`:"");return{svg:Zt("quadrantChart",k,b,l,a,t,Wt),width:k,height:b,links:[]}}var ge={type:"quadrantChart",parse(t,i,a){let l=new re;return l.title=a,le(t,l),l},render:ce};export{ge as quadrantChart};
|