@agent-link/server 0.1.538 → 0.1.540
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -3
- package/web/dist/assets/{abnfDiagram-VRR7QNED-v8zWrjoC.js → abnfDiagram-VRR7QNED-D1hyJ-hn.js} +1 -1
- package/web/dist/assets/{arc-B5GKGWbC.js → arc-BuJJgjYt.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-Dbl9Ux9-.js → architectureDiagram-ZJ3FMSHR-A9THC2Cc.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-1YKIFOf1.js → blockDiagram-677ZJIJ3-De9_CtWv.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-BFjLi3Aq.js → c4Diagram-LMCZKHZV-DeZVA52a.js} +1 -1
- package/web/dist/assets/channel-D0HU8H5o.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-DgdTCY8R.js → chunk-2Q5K7J3B-DlDecKcs.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-C_Sdh-Gb.js → chunk-32BRIVSS-BhpTBz4U.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-ClYZJ82b.js → chunk-5VM5RSS4-DE8R6mLs.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-CgTjRsVI.js → chunk-EX3LRPZG-t_9lUdF-.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-Dvi-x4dH.js → chunk-JWPE2WC7-D8olqveE.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-iK74YNWs.js → chunk-MOJQB5TN-qQmIJLhN.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-BpEM4XKm.js → chunk-RYQCIY6F-o8VHYTB2.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-p6jkX0pp.js → chunk-V7JOEXUC-DGpoi6XB.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-CdmfUGnI.js → chunk-VR4S4FIN-BjtiAe03.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-jQHvtf7Y.js → chunk-XXDRQBXY-Bf9B2FsN.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-DQaRrb-b.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-DQaRrb-b.js +1 -0
- package/web/dist/assets/{cose-bilkent-JH36ORCC-CYU7uAdH.js → cose-bilkent-JH36ORCC-CUu8D0Zk.js} +1 -1
- package/web/dist/assets/{cssMode-CkeIamVF.js → cssMode-BBGTtP8x.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-CuE8IoQA.js → cynefin-VYW2F7L2-DVyQShfu.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-Bk3IY4v3.js → cynefinDiagram-TSTJHNR4-5-G2jXgr.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-EJGJ8Unh.js → dagre-VKFMJZFB-BVIWNamr.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-B7-x7ujW.js → diagram-FQU43EPY-DB_8HU4p.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-CjVYgbBC.js → diagram-G47NLZAW-BuC9KdPo.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-DOBiygSk.js → diagram-NH7WQ7WH-DEjdAGik.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-BeqAsIvC.js → diagram-OA4YK3LP-CpUMGDrP.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-Dz5ycNiE.js → diagram-WEI45ONY-CD-UVma6.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-Bcnqidg3.js → ebnfDiagram-CCIWWBDH-Crk2X-Xr.js} +1 -1
- package/web/dist/assets/{editor.main-CgHXuI1T.js → editor.main-DX1kz8I2.js} +3 -3
- package/web/dist/assets/{erDiagram-Q63AITRT-BwaD538T.js → erDiagram-Q63AITRT-POwYozga.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-DBywwy14.js → flowDiagram-23GEKE2U-5jmZ5k5e.js} +1 -1
- package/web/dist/assets/{freemarker2-attQ6DKC.js → freemarker2-mDrCFxI5.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-CJg1vCCC.js → ganttDiagram-NO4QXBWP-B9Mdj-u5.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-Jx5rHBs_.js → gitGraphDiagram-IHSO6WYX-CNPSE7ls.js} +1 -1
- package/web/dist/assets/{handlebars-B-ygpenC.js → handlebars--G4a_6Oo.js} +1 -1
- package/web/dist/assets/{html-ndi3wy_l.js → html-tA32frga.js} +1 -1
- package/web/dist/assets/{htmlMode-qTuZCS19.js → htmlMode-CggNnIWF.js} +1 -1
- package/web/dist/assets/{index-DyV-bHVC.js → index-AdB8XHXv.js} +6 -6
- package/web/dist/assets/index-D5K63qug.css +32 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-BEFhMUXj.js → infoDiagram-FWYZ7A6U-CyB7Vvcb.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-DExRNEBC.js → ishikawaDiagram-FXEZZL3T-DLMZ7H1X.js} +1 -1
- package/web/dist/assets/{javascript-FEz7WVb9.js → javascript-DMkX6-SC.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-DIlSMYx4.js → journeyDiagram-5HDEW3XC-_nk1wTqH.js} +1 -1
- package/web/dist/assets/{jsonMode-DiW0WmnW.js → jsonMode-BatVhCGs.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-DOKCAcBv.js → kanban-definition-HUTT4EX6-Cz1JY0qx.js} +1 -1
- package/web/dist/assets/{linear-eZ6eIIvZ.js → linear-DkQS0EVl.js} +1 -1
- package/web/dist/assets/{liquid-D8KsZQoZ.js → liquid-JdcJe3Mn.js} +1 -1
- package/web/dist/assets/{lspLanguageFeatures-BQKUKUbx.js → lspLanguageFeatures-BDC0ynk1.js} +1 -1
- package/web/dist/assets/{mdx-GD_GAPZ8.js → mdx-C0s6E9Ya.js} +1 -1
- package/web/dist/assets/{mermaid.core-C4a3RQhj.js → mermaid.core-DQSlETG7.js} +2 -2
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-CKYYKk1-.js → mindmap-definition-LN4V7U3C-oNTOwQOU.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-CQhG4kxD.js → pegDiagram-2B236MQR-8BmSEVOy.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-dKij5CVx.js → pieDiagram-ENE6RG2P-DRIltoVc.js} +1 -1
- package/web/dist/assets/{python-YGKRPDiw.js → python-DQKjtSgN.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-v1_PVyp0.js → quadrantDiagram-ABIIQ3AL-BJfMAp1Q.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-DN_GgX6f.js → railroadDiagram-RFXS5EU6-Dj9-wyZY.js} +1 -1
- package/web/dist/assets/{razor-BCW3GQAg.js → razor-CL-fmDzS.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-0DyHcCcr.js → requirementDiagram-TGXJPOKE-fPYOczdV.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-C67sJXlQ.js → sankeyDiagram-HTMAVEWB-DyjpctG7.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-DiC-QboR.js → sequenceDiagram-DBY2YBRQ-RaZs5E3b.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-c8srD5kT.js → sizeCapture-X5ZJPWSS-BfOA5cbO.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-BOc1ntS6.js → stateDiagram-2N3HPSRC-CdxgHSfH.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-vTVKrqt9.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-CFgMT0Er.js → swimlanes-5IMT3BWC-B19jLFc4.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-CbIyNKp1.js +1 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-DgmH37q0.js → timeline-definition-FHXFAJF6-CYSSTJjP.js} +1 -1
- package/web/dist/assets/{tsMode-M3wbPnMH.js → tsMode-I7W52vRp.js} +1 -1
- package/web/dist/assets/{typescript-DZfPfOgw.js → typescript-BkUlxSfm.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-BcPfgqMW.js → vennDiagram-L72KCM5P-CJ5m4qeA.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-B8KESZXV.js → wardleyDiagram-EHGQE667-CpaSYOZD.js} +1 -1
- package/web/dist/assets/{xml-CwVvpm39.js → xml-B6uP1aJC.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-QYcDNHiO.js → xychartDiagram-FW5EYKEG-EqZ9r0f-.js} +1 -1
- package/web/dist/assets/{yaml-GszwldOD.js → yaml-BzfObSCH.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/channel-BqcAGGR5.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-BISqOfze.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-BISqOfze.js +0 -1
- package/web/dist/assets/index-DXanOGbR.css +0 -32
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-BBBUTIt4.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BIw8cOLQ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r,s as t}from"./flowDiagram-23GEKE2U-5jmZ5k5e.js";import{_ as o}from"./mermaid.core-DQSlETG7.js";import"./chunk-5VM5RSS4-DE8R6mLs.js";import"./chunk-XXDRQBXY-Bf9B2FsN.js";import"./chunk-VR4S4FIN-BjtiAe03.js";import"./chunk-32BRIVSS-BhpTBz4U.js";import"./index-AdB8XHXv.js";import"./channel-D0HU8H5o.js";var s=r({defaultLayout:"swimlane",styles:o(r=>`${t(r)}\n .swimlane.cluster rect {\n stroke: ${r.clusterBorder} !important;\n }\n [data-look="neo"].cluster rect {\n filter: none;\n }\n`,"getStyles")});export{s as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,z as e,a9 as n,aa as i,ab as r,c as a,l as s,F as o,a1 as l,ac as c,d as h,u as d,ad as u,q as p}from"./mermaid.core-C4a3RQhj.js";import{d as g}from"./arc-B5GKGWbC.js";import"./index-DyV-bHVC.js";var y=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[6,11,13,14,15,17,19,20,23,24],i=[1,12],r=[1,13],a=[1,14],s=[1,15],o=[1,16],l=[1,19],c=[1,20],h={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 1:return a[o-1];case 3:i.setDirection("LR");break;case 4:i.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:a[o-1].push(a[o]),this.$=a[o-1];break;case 7:case 8:this.$=a[o];break;case 11:i.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 12:this.$=a[o].trim(),i.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[o].trim(),i.getCommonDb().setAccDescription(this.$);break;case 15:i.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 18:i.addTask(a[o],0,""),this.$=a[o];break;case 19:i.addEvent(a[o].substr(2)),this.$=a[o]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(n,[2,5],{5:6}),e(n,[2,2]),e(n,[2,3]),e(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:l,24:c},e(n,[2,10],{1:[2,1]}),e(n,[2,6]),{12:21,14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:l,24:c},e(n,[2,8]),e(n,[2,9]),e(n,[2,11]),{16:[1,22]},{18:[1,23]},e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,7]),e(n,[2,12]),e(n,[2,13])],defaultActions:{},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],r=[],a=[null],s=[],o=this.table,l="",c=0,h=0,d=s.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);u.setInput(e,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var y=u.yylloc;s.push(y);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=r.pop()||u.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,a.length=a.length-t,s.length=s.length-t},"popStack"),t(m,"lex");for(var x,b,k,w,_,v,$,S,E={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==x&&(x=m()),k=o[b]&&o[b][x]),void 0===k||!k.length||!k[0]){var T="";for(_ in S=[],o[b])this.terminals_[_]&&_>2&&S.push("'"+this.terminals_[_]+"'");T=u.showPosition?"Parse error on line "+(c+1)+":\n"+u.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(T,{text:u.match,token:this.terminals_[x]||x,line:u.yylineno,loc:y,expected:S})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+x);switch(k[0]){case 1:i.push(x),a.push(u.yytext),s.push(u.yylloc),i.push(k[1]),x=null,h=u.yyleng,l=u.yytext,c=u.yylineno,y=u.yylloc;break;case 2:if(v=this.productions_[k[1]][1],E.$=a[a.length-v],E._$={first_line:s[s.length-(v||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(v||1)].first_column,last_column:s[s.length-1].last_column},f&&(E._$.range=[s[s.length-(v||1)].range[0],s[s.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[l,h,c,p.yy,k[1],a,s].concat(d))))return w;v&&(i=i.slice(0,-1*v*2),a=a.slice(0,-1*v),s=s.slice(0,-1*v)),i.push(this.productions_[k[1]][0]),a.push(E.$),s.push(E._$),$=o[i[i.length-2]][i[i.length-1]],i.push($);break;case 3:return!0}}return!0},"parse")},d=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;a<r.length;a++)if((n=this._input.match(this.rules[r[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var t=this.next();return t||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}}();function u(){this.yy={}}return h.lexer=d,t(u,"Parser"),u.prototype=h,h.Parser=u,new u}();y.parser=y;var f=y,m={};d(m,{addEvent:()=>L,addSection:()=>I,addTask:()=>C,addTaskOrg:()=>N,clear:()=>S,default:()=>O,getCommonDb:()=>$,getDirection:()=>T,getSections:()=>M,getTasks:()=>H,setDirection:()=>E});var x="",b=0,k="LR",w=[],_=[],v=[],$=t(()=>u,"getCommonDb"),S=t(function(){w.length=0,_.length=0,x="",v.length=0,k="LR",p()},"clear"),E=t(function(t){k=t},"setDirection"),T=t(function(){return k},"getDirection"),I=t(function(t){x=t,w.push(t)},"addSection"),M=t(function(){return w},"getSections"),H=t(function(){let t=D();let e=0;for(;!t&&e<100;)t=D(),e++;return _.push(...v),_},"getTasks"),C=t(function(t,e,n){const i={id:b++,section:x,type:x,task:t,score:e||0,events:n?[n]:[]};v.push(i)},"addTask"),L=t(function(t){v.find(t=>t.id===b-1).events.push(t)},"addEvent"),N=t(function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)},"addTaskOrg"),D=t(function(){const e=t(function(t){return v[t].processed},"compileTask");let n=!0;for(const[t,i]of v.entries())e(t),n=n&&i.processed;return n},"compileTasks"),O={clear:S,getCommonDb:$,getDirection:T,setDirection:E,addSection:I,getSections:M,getTasks:H,addTask:C,addTaskOrg:N,addEvent:L},A=0,B=t(function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},"drawRect"),R=t(function(e,n){const i=15,r=e.append("circle").attr("cx",n.cx).attr("cy",n.cy).attr("class","face").attr("r",i).attr("stroke-width",2).attr("overflow","visible"),a=e.append("g");function s(t){const e=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(i/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+2)+")")}function o(t){const e=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(i/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+7)+")")}function l(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",n.cx-5).attr("y1",n.cy+7).attr("x2",n.cx+5).attr("y2",n.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return a.append("circle").attr("cx",n.cx-5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),a.append("circle").attr("cx",n.cx+5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),t(s,"smile"),t(o,"sad"),t(l,"ambivalent"),n.score>3?s(a):n.score<3?o(a):l(a),r},"drawFace"),P=t(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),j=t(function(t,e){const n=e.text.replace(/<br\s*\/?>/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),void 0!==e.class&&i.attr("class",e.class);const r=i.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(n),i},"drawText"),W=t(function(e,n){function i(t,e,n,i,r){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-r)+" "+(t+n-1.2*r)+","+(e+i)+" "+t+","+(e+i)}t(i,"genPoints");const r=e.append("polygon");r.attr("points",i(n.x,n.y,50,20,7)),r.attr("class","labelBox"),n.y=n.y+n.labelMargin,n.x=n.x+.5*n.labelMargin,j(e,n)},"drawLabel"),F=t(function(t,e,n){const i=t.append("g"),r=U();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,B(i,r),Z(n)(e.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},n,e.colour)},"drawSection"),z=-1,V=t(function(t,e,n,i){const r=e.x+n.width/2,a=t.append("g");z++;a.append("line").attr("id",i+"-task"+z).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),R(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const s=U();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=n.width,s.height=n.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,B(a,s),Z(n)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},n,e.colour)},"drawTask"),G=t(function(t,e){B(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),q=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),U=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Z=function(){function e(t,e,n,i,a,s,o,l){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function n(t,e,n,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:d}=l,u=t.split(/<br\s*\/?>/gi);for(let p=0;p<u.length;p++){const t=p*h-h*(u.length-1)/2,l=e.append("text").attr("x",n+a/2).attr("y",i).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",d);l.append("tspan").attr("x",n+a/2).attr("dy",t).text(u[p]),l.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(l,o)}}function i(t,e,i,a,s,o,l,c){const h=e.append("switch"),d=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),n(t,h,i,a,s,o,l,c),r(d,l)}function r(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return t(e,"byText"),t(n,"byTspan"),t(i,"byFo"),t(r,"_setTextAttrs"),function(t){return"fo"===t.textPlacement?i:"old"===t.textPlacement?e:n}}(),Y=t(function(t,e){A=0,z=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function X(t,e){t.each(function(){var t,n=h(this),i=n.text().split(/(\s+|<br>)/).reverse(),r=[],a=n.attr("y"),s=parseFloat(n.attr("dy")),o=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let l=0;l<i.length;l++)t=i[i.length-1-l],r.push(t),o.text(r.join(" ").trim()),(o.node().getComputedTextLength()>e||"<br>"===t)&&(r.pop(),o.text(r.join(" ").trim()),r="<br>"===t?[""]:[t],o=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))})}t(X,"wrap");var J=t(function(t,e,n,i,r,a=!1){var s,o,l;const{theme:c,look:d}=i,u=null==c?void 0:c.includes("redux"),p=n%((null==(s=null==i?void 0:i.themeVariables)?void 0:s.THEME_COLOR_LIMIT)??12)-1,g=t.append("g");e.section=p,g.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+p);const y=g.append("g"),f=g.append("g"),m=f.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,e.width).node().getBBox(),x=(null==(o=i.fontSize)?void 0:o.replace)?i.fontSize.replace("px",""):i.fontSize;if(e.height=m.height+1.1*x*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,f.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),u&&f.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),Q(y,e,p,r,i),"neo"===d&&(g.attr("data-look","neo"),u)){const e=c.includes("dark"),n=(null==(l=t.node())?void 0:l.ownerSVGElement)??t.node(),i=h(n),r=i.attr("id")??"",a=r?`${r}-drop-shadow`:"drop-shadow";if(i.select(`#${a}`).empty()){const t=i.select("defs");(t.empty()?i.append("defs"):t).append("filter").attr("id",a).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",e?"0.2":"0.06").attr("flood-color",e?"#FFFFFF":"#000000")}}return e},"drawNode"),K=t(function(t,e,n){var i;const r=t.append("g"),a=r.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,e.width).node().getBBox(),s=(null==(i=n.fontSize)?void 0:i.replace)?n.fontSize.replace("px",""):n.fontSize;return r.remove(),a.height+1.1*s*.5+e.padding},"getVirtualNodeHeight"),Q=t(function(t,e,n,i,r){const{theme:a}=r,s=(null==a?void 0:a.includes("redux"))?0:5,o=s>0?`M0 ${e.height-5} v${10-e.height} q0,-${s},${s},-${s} h${e.width-10} q${s},0,${s},${s} v${e.height-5} H0 Z`:`M0 ${e.height-5} v${-(e.height-5)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",i+"-node-"+A++).attr("class","node-bkg node-"+e.type).attr("d",o),(null==a?void 0:a.includes("redux"))||t.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),tt={drawRect:B,drawCircle:P,drawSection:F,drawText:j,drawLabel:W,drawTask:V,drawBackgroundRect:G,getTextObj:q,getNoteRect:U,initGraphics:Y,drawNode:J,getVirtualNodeHeight:K},et=t(function(t,e,n,i){var r,o,l;const d=a(),{look:u,theme:p,themeVariables:g}=d,{useGradient:y,gradientStart:f,gradientStop:m}=g,x=(null==(r=d.timeline)?void 0:r.leftMargin)??50;s.debug("timeline",i.db);const b=d.securityLevel;let k;"sandbox"===b&&(k=h("#i"+e));const w=h("sandbox"===b?k.nodes()[0].contentDocument.body:"body").select("#"+e);w.append("g");const _=i.db.getTasks(),v=i.db.getCommonDb().getDiagramTitle();s.debug("task",_),tt.initGraphics(w,e);const $=i.db.getSections();s.debug("sections",$);let S=0,E=0,T=0,I=0,M=50+x,H=50;I=50;let C=0,L=!0;$.forEach(function(t){const e={number:C,descr:t,section:C,width:150,padding:20,maxHeight:S},n=tt.getVirtualNodeHeight(w,e,d);s.debug("sectionHeight before draw",n),S=Math.max(S,n+20)});let N=0,D=0;s.debug("tasks.length",_.length);for(const[a,c]of _.entries()){const t={number:a,descr:c,section:c.section,width:150,padding:20,maxHeight:E},e=tt.getVirtualNodeHeight(w,t,d);s.debug("taskHeight before draw",e),E=Math.max(E,e+20),N=Math.max(N,c.events.length);let n=0;for(const i of c.events){const t={descr:i,section:c.section,number:c.section,width:150,padding:20,maxHeight:50};n+=tt.getVirtualNodeHeight(w,t,d)}c.events.length>0&&(n+=10*(c.events.length-1)),D=Math.max(D,n)}s.debug("maxSectionHeight before draw",S),s.debug("maxTaskHeight before draw",E),$&&$.length>0?$.forEach(t=>{const n=_.filter(e=>e.section===t),i={number:C,descr:t,section:C,width:200*Math.max(n.length,1)-50,padding:20,maxHeight:S};s.debug("sectionNode",i);const r=w.append("g"),a=tt.drawNode(r,i,C,d,e);s.debug("sectionNode output",a),r.attr("transform",`translate(${M}, 50)`),H+=S+50,n.length>0&&nt(w,n,C,M,H,E,d,N,D,S,!1,e),M+=200*Math.max(n.length,1),H=50,C++}):(L=!1,nt(w,_,C,M,H,E,d,N,D,S,!0,e));const O=w.node().getBBox();s.debug("bounds",O),v&&w.append("text").text(v).attr("x","neo"===u?2*O.x+x:O.width/2-x).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),T=L?S+E+150:E+100;if(w.append("g").attr("class","lineWrapper").append("line").attr("x1",x).attr("y1",T).attr("x2",O.width+3*x).attr("y2",T).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),"neo"===u&&y&&"neutral"!==p){const t=w.select("defs"),e=(t.empty()?w.append("defs"):t).append("linearGradient").attr("id",w.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("stop").attr("offset","0%").attr("stop-color",f).attr("stop-opacity",1),e.append("stop").attr("offset","100%").attr("stop-color",m).attr("stop-opacity",1)}c(void 0,w,(null==(o=d.timeline)?void 0:o.padding)??50,(null==(l=d.timeline)?void 0:l.useMaxWidth)??!1)},"draw"),nt=t(function(t,e,n,i,r,a,o,l,c,h,d,u){var p;for(const g of e){const e={descr:g.task,section:n,number:n,width:150,padding:20,maxHeight:a};s.debug("taskNode",e);const l=t.append("g").attr("class","taskWrapper"),h=tt.drawNode(l,e,n,o,u).height;if(s.debug("taskHeight after draw",h),l.attr("transform",`translate(${i}, ${r})`),a=Math.max(a,h),g.events){const e=t.append("g").attr("class","lineWrapper");let s=a;r+=100,s+=it(t,g.events,n,i,r,o,u),r-=100,e.append("line").attr("x1",i+95).attr("y1",r+a).attr("x2",i+95).attr("y2",r+a+100+c+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${u}-arrowhead)`).attr("stroke-dasharray","5,5")}i+=200,d&&!(null==(p=o.timeline)?void 0:p.disableMulticolor)&&n++}r-=10},"drawTasks"),it=t(function(t,e,n,i,r,a,o){let l=0;const c=r;r+=100;for(const h of e){const e={descr:h,section:n,number:n,width:150,padding:20,maxHeight:50};s.debug("eventNode",e);const c=t.append("g").attr("class","eventWrapper"),d=tt.drawNode(c,e,n,a,o,!0).height;l+=d,c.attr("transform",`translate(${i}, ${r})`),r=r+10+d}return r=c,l},"drawEvents"),rt={setConf:t(()=>{},"setConf"),draw:et},at=200,st=t(function(t,e,n,i){var r,h,d,u,p;const g=a(),y=(null==(r=g.timeline)?void 0:r.leftMargin)??50;s.debug("timeline",i.db);const f=o(e);f.append("g");const m=i.db.getTasks(),x=i.db.getCommonDb().getDiagramTitle();s.debug("task",m),tt.initGraphics(f);const b=i.db.getSections();s.debug("sections",b);let k=0,w=0;const _=50+y;let v=50;const $=v,S=230,E=_+S;let T=0;const I=b&&b.length>0,M=I?E:_+S,H=Math.max(50,580);b.forEach(function(t){const e={number:T,descr:t,section:T,width:H,padding:5,maxHeight:k},n=tt.getVirtualNodeHeight(f,e,g);s.debug("sectionHeight before draw",n),k=Math.max(k,n)});let C=0;s.debug("tasks.length",m.length);for(const[a,o]of m.entries()){const t={number:a,descr:o,section:o.section,width:at,padding:5,maxHeight:w},e=tt.getVirtualNodeHeight(f,t,g);s.debug("taskHeight before draw",e),w=Math.max(w,e);let n=0;for(const i of o.events){const t={descr:i,section:o.section,number:o.section,width:300,padding:5,maxHeight:50};n+=tt.getVirtualNodeHeight(f,t,g)}o.events.length>0&&(n+=10*(o.events.length-1)),C=Math.max(C,n)+0}s.debug("maxSectionHeight before draw",k),s.debug("maxTaskHeight before draw",w);const L=Math.max(w,C)+30;I?b.forEach(t=>{const e=m.filter(e=>e.section===t),n={number:T,descr:t,section:T,width:H,padding:5,maxHeight:k};s.debug("sectionNode",n);const i=f.append("g"),r=tt.drawNode(i,n,T,g);s.debug("sectionNode output",r);const a=M-S;i.attr("transform",`translate(${a}, ${v})`);const o=v+r.height+20;e.length>0&&ot(f,e,T,M,o,w,g,L,!1);const l=e.length,c=r.height+20+L*Math.max(l,1)-(l>0?60:0);v+=c,T++}):ot(f,m,T,M,v,w,g,L,!0);let N=null==(h=f.node())?void 0:h.getBBox();if(!N)throw new Error("bbox not found");if(s.debug("bounds",N),x){if(f.append("text").text(x).attr("x",N.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),N=null==(d=f.node())?void 0:d.getBBox(),!N)throw new Error("bbox not found");s.debug("bounds after title",N)}const[D]=l(g.fontSize),O=2*(D??16),A=.5*(D??16)+20,B=f.append("g").attr("class","lineWrapper");B.append("line").attr("x1",M).attr("y1",$-O).attr("x2",M).attr("y2",N.y+N.height+A).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),B.lower(),c(void 0,f,(null==(u=g.timeline)?void 0:u.padding)??50,(null==(p=g.timeline)?void 0:p.useMaxWidth)??!1)},"draw"),ot=t(function(t,e,n,i,r,a,o,l,c){var h;for(const d of e){const e={descr:d.task,section:n,number:n,width:at,padding:5,maxHeight:a};s.debug("taskNode",e);const u=t.append("g").attr("class","taskWrapper"),p=tt.drawNode(u,e,n,o),g=p.height;s.debug("taskHeight after draw",g);const y=i-20-p.width;if(u.attr("transform",`translate(${y}, ${r})`),a=Math.max(a,g),d.events&&d.events.length>0){const e=r,a=i+50;lt(t,d.events,n,i,a,e,o)}r+=l,c&&!(null==(h=o.timeline)?void 0:h.disableMulticolor)&&n++}},"drawTasks"),lt=t(function(t,e,n,i,r,a,o){let l=a;for(const c of e){const e={descr:c,section:n,number:n,width:300,padding:5,maxHeight:0};s.debug("eventNode",e);const a=t.append("g").attr("class","eventWrapper"),h=tt.drawNode(a,e,n,o).height;a.attr("transform",`translate(${r}, ${l})`);const d=l+h/2;t.append("g").attr("class","lineWrapper").append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),l=l+h+10}return l-a},"drawEvents"),ct={setConf:t(()=>{},"setConf"),draw:st},ht=t(t=>{var n;const{theme:i}=e(),r=null==i?void 0:i.includes("dark"),a=null==i?void 0:i.includes("color"),s=(null==(n=t.svgId)?void 0:n.replace(/^#/,""))??"",o=s?`url(#${s}-drop-shadow)`:t.dropShadow??"none";let l="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++){const n=""+(17-3*e),i=a?t.borderColorArray[e]:t.mainBkg,s=a?t.borderColorArray[e]:t.nodeBorder;l+=`\n .section-${e-1} rect,\n .section-${e-1} path,\n .section-${e-1} circle {\n fill: ${r&&a?t.mainBkg:i};\n stroke: ${s};\n stroke-width: ${t.strokeWidth};\n filter: ${o};\n }\n\n .section-${e-1} text {\n fill: ${t.nodeBorder};\n font-weight: ${t.fontWeight}\n }\n\n .node-icon-${e-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+e]};\n }\n\n .section-edge-${e-1} {\n stroke: ${t["cScale"+e]};\n }\n\n .edge-depth-${e-1} {\n stroke-width: ${n};\n }\n\n .section-${e-1} line {\n stroke: ${t["cScaleInv"+e]};\n stroke-width: 3;\n }\n\n .lineWrapper line {\n stroke: ${t.nodeBorder};\n stroke-width:${t.strokeWidth}\n }\n\n .disabled,\n .disabled circle,\n .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return l},"genReduxSections"),dt=t(t=>{let e="";for(let a=0;a<t.THEME_COLOR_LIMIT;a++)t["lineColor"+a]=t["lineColor"+a]||t["cScaleInv"+a],n(t["lineColor"+a])?t["lineColor"+a]=i(t["lineColor"+a],20):t["lineColor"+a]=r(t["lineColor"+a],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);e+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {\n fill: ${t["cScale"+n]};\n }\n .section-${n-1} text {\n fill: ${t["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${t["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${i};\n }\n .section-${n-1} line {\n stroke: ${t["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+n]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return e},"genSections"),ut=t(t=>{var n;const{theme:i}=e(),r=null==i?void 0:i.includes("redux"),a="neutral"===i,s=(null==(n=t.svgId)?void 0:n.replace(/^#/,""))??"";let o="";if(t.useGradient&&s&&t.THEME_COLOR_LIMIT&&!a)for(let e=0;e<t.THEME_COLOR_LIMIT;e++)o+=`\n .section-${e-1}[data-look="neo"] rect,\n .section-${e-1}[data-look="neo"] path,\n .section-${e-1}[data-look="neo"] circle {\n fill: ${t.mainBkg};\n stroke: url(#${s}-gradient);\n stroke-width: 2;\n }\n .section-${e-1}[data-look="neo"] line {\n stroke: url(#${s}-gradient);\n stroke-width: 2;\n }`;return`\n .edge {\n stroke-width: 3;\n }\n ${r?ht(t):dt(t)}\n ${o}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`},"getStyles"),pt={db:m,renderer:{setConf:t(()=>{},"setConf"),draw:t((t,e,n,i)=>{var r,a;return"TD"===((null==(a=null==(r=null==i?void 0:i.db)?void 0:r.getDirection)?void 0:a.call(r))??"LR")?ct.draw(t,e,n,i):rt.draw(t,e,n,i)},"draw")},parser:f,styles:ut};export{pt as diagram};
|
|
1
|
+
import{_ as t,z as e,a9 as n,aa as i,ab as r,c as a,l as s,F as o,a1 as l,ac as c,d as h,u as d,ad as u,q as p}from"./mermaid.core-DQSlETG7.js";import{d as g}from"./arc-BuJJgjYt.js";import"./index-AdB8XHXv.js";var y=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[6,11,13,14,15,17,19,20,23,24],i=[1,12],r=[1,13],a=[1,14],s=[1,15],o=[1,16],l=[1,19],c=[1,20],h={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 1:return a[o-1];case 3:i.setDirection("LR");break;case 4:i.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:a[o-1].push(a[o]),this.$=a[o-1];break;case 7:case 8:this.$=a[o];break;case 11:i.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 12:this.$=a[o].trim(),i.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[o].trim(),i.getCommonDb().setAccDescription(this.$);break;case 15:i.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 18:i.addTask(a[o],0,""),this.$=a[o];break;case 19:i.addEvent(a[o].substr(2)),this.$=a[o]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(n,[2,5],{5:6}),e(n,[2,2]),e(n,[2,3]),e(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:l,24:c},e(n,[2,10],{1:[2,1]}),e(n,[2,6]),{12:21,14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:l,24:c},e(n,[2,8]),e(n,[2,9]),e(n,[2,11]),{16:[1,22]},{18:[1,23]},e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,7]),e(n,[2,12]),e(n,[2,13])],defaultActions:{},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],r=[],a=[null],s=[],o=this.table,l="",c=0,h=0,d=s.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);u.setInput(e,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var y=u.yylloc;s.push(y);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=r.pop()||u.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,a.length=a.length-t,s.length=s.length-t},"popStack"),t(m,"lex");for(var x,b,k,w,_,v,$,S,E={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==x&&(x=m()),k=o[b]&&o[b][x]),void 0===k||!k.length||!k[0]){var T="";for(_ in S=[],o[b])this.terminals_[_]&&_>2&&S.push("'"+this.terminals_[_]+"'");T=u.showPosition?"Parse error on line "+(c+1)+":\n"+u.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(T,{text:u.match,token:this.terminals_[x]||x,line:u.yylineno,loc:y,expected:S})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+x);switch(k[0]){case 1:i.push(x),a.push(u.yytext),s.push(u.yylloc),i.push(k[1]),x=null,h=u.yyleng,l=u.yytext,c=u.yylineno,y=u.yylloc;break;case 2:if(v=this.productions_[k[1]][1],E.$=a[a.length-v],E._$={first_line:s[s.length-(v||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(v||1)].first_column,last_column:s[s.length-1].last_column},f&&(E._$.range=[s[s.length-(v||1)].range[0],s[s.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[l,h,c,p.yy,k[1],a,s].concat(d))))return w;v&&(i=i.slice(0,-1*v*2),a=a.slice(0,-1*v),s=s.slice(0,-1*v)),i.push(this.productions_[k[1]][0]),a.push(E.$),s.push(E._$),$=o[i[i.length-2]][i[i.length-1]],i.push($);break;case 3:return!0}}return!0},"parse")},d=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;a<r.length;a++)if((n=this._input.match(this.rules[r[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var t=this.next();return t||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}}();function u(){this.yy={}}return h.lexer=d,t(u,"Parser"),u.prototype=h,h.Parser=u,new u}();y.parser=y;var f=y,m={};d(m,{addEvent:()=>L,addSection:()=>I,addTask:()=>C,addTaskOrg:()=>N,clear:()=>S,default:()=>O,getCommonDb:()=>$,getDirection:()=>T,getSections:()=>M,getTasks:()=>H,setDirection:()=>E});var x="",b=0,k="LR",w=[],_=[],v=[],$=t(()=>u,"getCommonDb"),S=t(function(){w.length=0,_.length=0,x="",v.length=0,k="LR",p()},"clear"),E=t(function(t){k=t},"setDirection"),T=t(function(){return k},"getDirection"),I=t(function(t){x=t,w.push(t)},"addSection"),M=t(function(){return w},"getSections"),H=t(function(){let t=D();let e=0;for(;!t&&e<100;)t=D(),e++;return _.push(...v),_},"getTasks"),C=t(function(t,e,n){const i={id:b++,section:x,type:x,task:t,score:e||0,events:n?[n]:[]};v.push(i)},"addTask"),L=t(function(t){v.find(t=>t.id===b-1).events.push(t)},"addEvent"),N=t(function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)},"addTaskOrg"),D=t(function(){const e=t(function(t){return v[t].processed},"compileTask");let n=!0;for(const[t,i]of v.entries())e(t),n=n&&i.processed;return n},"compileTasks"),O={clear:S,getCommonDb:$,getDirection:T,setDirection:E,addSection:I,getSections:M,getTasks:H,addTask:C,addTaskOrg:N,addEvent:L},A=0,B=t(function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},"drawRect"),R=t(function(e,n){const i=15,r=e.append("circle").attr("cx",n.cx).attr("cy",n.cy).attr("class","face").attr("r",i).attr("stroke-width",2).attr("overflow","visible"),a=e.append("g");function s(t){const e=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(i/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+2)+")")}function o(t){const e=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(i/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+7)+")")}function l(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",n.cx-5).attr("y1",n.cy+7).attr("x2",n.cx+5).attr("y2",n.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return a.append("circle").attr("cx",n.cx-5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),a.append("circle").attr("cx",n.cx+5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),t(s,"smile"),t(o,"sad"),t(l,"ambivalent"),n.score>3?s(a):n.score<3?o(a):l(a),r},"drawFace"),P=t(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),j=t(function(t,e){const n=e.text.replace(/<br\s*\/?>/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),void 0!==e.class&&i.attr("class",e.class);const r=i.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(n),i},"drawText"),W=t(function(e,n){function i(t,e,n,i,r){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-r)+" "+(t+n-1.2*r)+","+(e+i)+" "+t+","+(e+i)}t(i,"genPoints");const r=e.append("polygon");r.attr("points",i(n.x,n.y,50,20,7)),r.attr("class","labelBox"),n.y=n.y+n.labelMargin,n.x=n.x+.5*n.labelMargin,j(e,n)},"drawLabel"),F=t(function(t,e,n){const i=t.append("g"),r=U();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,B(i,r),Z(n)(e.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},n,e.colour)},"drawSection"),z=-1,V=t(function(t,e,n,i){const r=e.x+n.width/2,a=t.append("g");z++;a.append("line").attr("id",i+"-task"+z).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),R(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const s=U();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=n.width,s.height=n.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,B(a,s),Z(n)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},n,e.colour)},"drawTask"),G=t(function(t,e){B(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),q=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),U=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Z=function(){function e(t,e,n,i,a,s,o,l){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function n(t,e,n,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:d}=l,u=t.split(/<br\s*\/?>/gi);for(let p=0;p<u.length;p++){const t=p*h-h*(u.length-1)/2,l=e.append("text").attr("x",n+a/2).attr("y",i).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",d);l.append("tspan").attr("x",n+a/2).attr("dy",t).text(u[p]),l.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(l,o)}}function i(t,e,i,a,s,o,l,c){const h=e.append("switch"),d=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),n(t,h,i,a,s,o,l,c),r(d,l)}function r(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return t(e,"byText"),t(n,"byTspan"),t(i,"byFo"),t(r,"_setTextAttrs"),function(t){return"fo"===t.textPlacement?i:"old"===t.textPlacement?e:n}}(),Y=t(function(t,e){A=0,z=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function X(t,e){t.each(function(){var t,n=h(this),i=n.text().split(/(\s+|<br>)/).reverse(),r=[],a=n.attr("y"),s=parseFloat(n.attr("dy")),o=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let l=0;l<i.length;l++)t=i[i.length-1-l],r.push(t),o.text(r.join(" ").trim()),(o.node().getComputedTextLength()>e||"<br>"===t)&&(r.pop(),o.text(r.join(" ").trim()),r="<br>"===t?[""]:[t],o=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))})}t(X,"wrap");var J=t(function(t,e,n,i,r,a=!1){var s,o,l;const{theme:c,look:d}=i,u=null==c?void 0:c.includes("redux"),p=n%((null==(s=null==i?void 0:i.themeVariables)?void 0:s.THEME_COLOR_LIMIT)??12)-1,g=t.append("g");e.section=p,g.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+p);const y=g.append("g"),f=g.append("g"),m=f.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,e.width).node().getBBox(),x=(null==(o=i.fontSize)?void 0:o.replace)?i.fontSize.replace("px",""):i.fontSize;if(e.height=m.height+1.1*x*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,f.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),u&&f.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),Q(y,e,p,r,i),"neo"===d&&(g.attr("data-look","neo"),u)){const e=c.includes("dark"),n=(null==(l=t.node())?void 0:l.ownerSVGElement)??t.node(),i=h(n),r=i.attr("id")??"",a=r?`${r}-drop-shadow`:"drop-shadow";if(i.select(`#${a}`).empty()){const t=i.select("defs");(t.empty()?i.append("defs"):t).append("filter").attr("id",a).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",e?"0.2":"0.06").attr("flood-color",e?"#FFFFFF":"#000000")}}return e},"drawNode"),K=t(function(t,e,n){var i;const r=t.append("g"),a=r.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,e.width).node().getBBox(),s=(null==(i=n.fontSize)?void 0:i.replace)?n.fontSize.replace("px",""):n.fontSize;return r.remove(),a.height+1.1*s*.5+e.padding},"getVirtualNodeHeight"),Q=t(function(t,e,n,i,r){const{theme:a}=r,s=(null==a?void 0:a.includes("redux"))?0:5,o=s>0?`M0 ${e.height-5} v${10-e.height} q0,-${s},${s},-${s} h${e.width-10} q${s},0,${s},${s} v${e.height-5} H0 Z`:`M0 ${e.height-5} v${-(e.height-5)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",i+"-node-"+A++).attr("class","node-bkg node-"+e.type).attr("d",o),(null==a?void 0:a.includes("redux"))||t.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),tt={drawRect:B,drawCircle:P,drawSection:F,drawText:j,drawLabel:W,drawTask:V,drawBackgroundRect:G,getTextObj:q,getNoteRect:U,initGraphics:Y,drawNode:J,getVirtualNodeHeight:K},et=t(function(t,e,n,i){var r,o,l;const d=a(),{look:u,theme:p,themeVariables:g}=d,{useGradient:y,gradientStart:f,gradientStop:m}=g,x=(null==(r=d.timeline)?void 0:r.leftMargin)??50;s.debug("timeline",i.db);const b=d.securityLevel;let k;"sandbox"===b&&(k=h("#i"+e));const w=h("sandbox"===b?k.nodes()[0].contentDocument.body:"body").select("#"+e);w.append("g");const _=i.db.getTasks(),v=i.db.getCommonDb().getDiagramTitle();s.debug("task",_),tt.initGraphics(w,e);const $=i.db.getSections();s.debug("sections",$);let S=0,E=0,T=0,I=0,M=50+x,H=50;I=50;let C=0,L=!0;$.forEach(function(t){const e={number:C,descr:t,section:C,width:150,padding:20,maxHeight:S},n=tt.getVirtualNodeHeight(w,e,d);s.debug("sectionHeight before draw",n),S=Math.max(S,n+20)});let N=0,D=0;s.debug("tasks.length",_.length);for(const[a,c]of _.entries()){const t={number:a,descr:c,section:c.section,width:150,padding:20,maxHeight:E},e=tt.getVirtualNodeHeight(w,t,d);s.debug("taskHeight before draw",e),E=Math.max(E,e+20),N=Math.max(N,c.events.length);let n=0;for(const i of c.events){const t={descr:i,section:c.section,number:c.section,width:150,padding:20,maxHeight:50};n+=tt.getVirtualNodeHeight(w,t,d)}c.events.length>0&&(n+=10*(c.events.length-1)),D=Math.max(D,n)}s.debug("maxSectionHeight before draw",S),s.debug("maxTaskHeight before draw",E),$&&$.length>0?$.forEach(t=>{const n=_.filter(e=>e.section===t),i={number:C,descr:t,section:C,width:200*Math.max(n.length,1)-50,padding:20,maxHeight:S};s.debug("sectionNode",i);const r=w.append("g"),a=tt.drawNode(r,i,C,d,e);s.debug("sectionNode output",a),r.attr("transform",`translate(${M}, 50)`),H+=S+50,n.length>0&&nt(w,n,C,M,H,E,d,N,D,S,!1,e),M+=200*Math.max(n.length,1),H=50,C++}):(L=!1,nt(w,_,C,M,H,E,d,N,D,S,!0,e));const O=w.node().getBBox();s.debug("bounds",O),v&&w.append("text").text(v).attr("x","neo"===u?2*O.x+x:O.width/2-x).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),T=L?S+E+150:E+100;if(w.append("g").attr("class","lineWrapper").append("line").attr("x1",x).attr("y1",T).attr("x2",O.width+3*x).attr("y2",T).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),"neo"===u&&y&&"neutral"!==p){const t=w.select("defs"),e=(t.empty()?w.append("defs"):t).append("linearGradient").attr("id",w.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("stop").attr("offset","0%").attr("stop-color",f).attr("stop-opacity",1),e.append("stop").attr("offset","100%").attr("stop-color",m).attr("stop-opacity",1)}c(void 0,w,(null==(o=d.timeline)?void 0:o.padding)??50,(null==(l=d.timeline)?void 0:l.useMaxWidth)??!1)},"draw"),nt=t(function(t,e,n,i,r,a,o,l,c,h,d,u){var p;for(const g of e){const e={descr:g.task,section:n,number:n,width:150,padding:20,maxHeight:a};s.debug("taskNode",e);const l=t.append("g").attr("class","taskWrapper"),h=tt.drawNode(l,e,n,o,u).height;if(s.debug("taskHeight after draw",h),l.attr("transform",`translate(${i}, ${r})`),a=Math.max(a,h),g.events){const e=t.append("g").attr("class","lineWrapper");let s=a;r+=100,s+=it(t,g.events,n,i,r,o,u),r-=100,e.append("line").attr("x1",i+95).attr("y1",r+a).attr("x2",i+95).attr("y2",r+a+100+c+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${u}-arrowhead)`).attr("stroke-dasharray","5,5")}i+=200,d&&!(null==(p=o.timeline)?void 0:p.disableMulticolor)&&n++}r-=10},"drawTasks"),it=t(function(t,e,n,i,r,a,o){let l=0;const c=r;r+=100;for(const h of e){const e={descr:h,section:n,number:n,width:150,padding:20,maxHeight:50};s.debug("eventNode",e);const c=t.append("g").attr("class","eventWrapper"),d=tt.drawNode(c,e,n,a,o,!0).height;l+=d,c.attr("transform",`translate(${i}, ${r})`),r=r+10+d}return r=c,l},"drawEvents"),rt={setConf:t(()=>{},"setConf"),draw:et},at=200,st=t(function(t,e,n,i){var r,h,d,u,p;const g=a(),y=(null==(r=g.timeline)?void 0:r.leftMargin)??50;s.debug("timeline",i.db);const f=o(e);f.append("g");const m=i.db.getTasks(),x=i.db.getCommonDb().getDiagramTitle();s.debug("task",m),tt.initGraphics(f);const b=i.db.getSections();s.debug("sections",b);let k=0,w=0;const _=50+y;let v=50;const $=v,S=230,E=_+S;let T=0;const I=b&&b.length>0,M=I?E:_+S,H=Math.max(50,580);b.forEach(function(t){const e={number:T,descr:t,section:T,width:H,padding:5,maxHeight:k},n=tt.getVirtualNodeHeight(f,e,g);s.debug("sectionHeight before draw",n),k=Math.max(k,n)});let C=0;s.debug("tasks.length",m.length);for(const[a,o]of m.entries()){const t={number:a,descr:o,section:o.section,width:at,padding:5,maxHeight:w},e=tt.getVirtualNodeHeight(f,t,g);s.debug("taskHeight before draw",e),w=Math.max(w,e);let n=0;for(const i of o.events){const t={descr:i,section:o.section,number:o.section,width:300,padding:5,maxHeight:50};n+=tt.getVirtualNodeHeight(f,t,g)}o.events.length>0&&(n+=10*(o.events.length-1)),C=Math.max(C,n)+0}s.debug("maxSectionHeight before draw",k),s.debug("maxTaskHeight before draw",w);const L=Math.max(w,C)+30;I?b.forEach(t=>{const e=m.filter(e=>e.section===t),n={number:T,descr:t,section:T,width:H,padding:5,maxHeight:k};s.debug("sectionNode",n);const i=f.append("g"),r=tt.drawNode(i,n,T,g);s.debug("sectionNode output",r);const a=M-S;i.attr("transform",`translate(${a}, ${v})`);const o=v+r.height+20;e.length>0&&ot(f,e,T,M,o,w,g,L,!1);const l=e.length,c=r.height+20+L*Math.max(l,1)-(l>0?60:0);v+=c,T++}):ot(f,m,T,M,v,w,g,L,!0);let N=null==(h=f.node())?void 0:h.getBBox();if(!N)throw new Error("bbox not found");if(s.debug("bounds",N),x){if(f.append("text").text(x).attr("x",N.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),N=null==(d=f.node())?void 0:d.getBBox(),!N)throw new Error("bbox not found");s.debug("bounds after title",N)}const[D]=l(g.fontSize),O=2*(D??16),A=.5*(D??16)+20,B=f.append("g").attr("class","lineWrapper");B.append("line").attr("x1",M).attr("y1",$-O).attr("x2",M).attr("y2",N.y+N.height+A).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),B.lower(),c(void 0,f,(null==(u=g.timeline)?void 0:u.padding)??50,(null==(p=g.timeline)?void 0:p.useMaxWidth)??!1)},"draw"),ot=t(function(t,e,n,i,r,a,o,l,c){var h;for(const d of e){const e={descr:d.task,section:n,number:n,width:at,padding:5,maxHeight:a};s.debug("taskNode",e);const u=t.append("g").attr("class","taskWrapper"),p=tt.drawNode(u,e,n,o),g=p.height;s.debug("taskHeight after draw",g);const y=i-20-p.width;if(u.attr("transform",`translate(${y}, ${r})`),a=Math.max(a,g),d.events&&d.events.length>0){const e=r,a=i+50;lt(t,d.events,n,i,a,e,o)}r+=l,c&&!(null==(h=o.timeline)?void 0:h.disableMulticolor)&&n++}},"drawTasks"),lt=t(function(t,e,n,i,r,a,o){let l=a;for(const c of e){const e={descr:c,section:n,number:n,width:300,padding:5,maxHeight:0};s.debug("eventNode",e);const a=t.append("g").attr("class","eventWrapper"),h=tt.drawNode(a,e,n,o).height;a.attr("transform",`translate(${r}, ${l})`);const d=l+h/2;t.append("g").attr("class","lineWrapper").append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),l=l+h+10}return l-a},"drawEvents"),ct={setConf:t(()=>{},"setConf"),draw:st},ht=t(t=>{var n;const{theme:i}=e(),r=null==i?void 0:i.includes("dark"),a=null==i?void 0:i.includes("color"),s=(null==(n=t.svgId)?void 0:n.replace(/^#/,""))??"",o=s?`url(#${s}-drop-shadow)`:t.dropShadow??"none";let l="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++){const n=""+(17-3*e),i=a?t.borderColorArray[e]:t.mainBkg,s=a?t.borderColorArray[e]:t.nodeBorder;l+=`\n .section-${e-1} rect,\n .section-${e-1} path,\n .section-${e-1} circle {\n fill: ${r&&a?t.mainBkg:i};\n stroke: ${s};\n stroke-width: ${t.strokeWidth};\n filter: ${o};\n }\n\n .section-${e-1} text {\n fill: ${t.nodeBorder};\n font-weight: ${t.fontWeight}\n }\n\n .node-icon-${e-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+e]};\n }\n\n .section-edge-${e-1} {\n stroke: ${t["cScale"+e]};\n }\n\n .edge-depth-${e-1} {\n stroke-width: ${n};\n }\n\n .section-${e-1} line {\n stroke: ${t["cScaleInv"+e]};\n stroke-width: 3;\n }\n\n .lineWrapper line {\n stroke: ${t.nodeBorder};\n stroke-width:${t.strokeWidth}\n }\n\n .disabled,\n .disabled circle,\n .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return l},"genReduxSections"),dt=t(t=>{let e="";for(let a=0;a<t.THEME_COLOR_LIMIT;a++)t["lineColor"+a]=t["lineColor"+a]||t["cScaleInv"+a],n(t["lineColor"+a])?t["lineColor"+a]=i(t["lineColor"+a],20):t["lineColor"+a]=r(t["lineColor"+a],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);e+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {\n fill: ${t["cScale"+n]};\n }\n .section-${n-1} text {\n fill: ${t["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${t["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${i};\n }\n .section-${n-1} line {\n stroke: ${t["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+n]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return e},"genSections"),ut=t(t=>{var n;const{theme:i}=e(),r=null==i?void 0:i.includes("redux"),a="neutral"===i,s=(null==(n=t.svgId)?void 0:n.replace(/^#/,""))??"";let o="";if(t.useGradient&&s&&t.THEME_COLOR_LIMIT&&!a)for(let e=0;e<t.THEME_COLOR_LIMIT;e++)o+=`\n .section-${e-1}[data-look="neo"] rect,\n .section-${e-1}[data-look="neo"] path,\n .section-${e-1}[data-look="neo"] circle {\n fill: ${t.mainBkg};\n stroke: url(#${s}-gradient);\n stroke-width: 2;\n }\n .section-${e-1}[data-look="neo"] line {\n stroke: url(#${s}-gradient);\n stroke-width: 2;\n }`;return`\n .edge {\n stroke-width: 3;\n }\n ${r?ht(t):dt(t)}\n ${o}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`},"getStyles"),pt={db:m,renderer:{setConf:t(()=>{},"setConf"),draw:t((t,e,n,i)=>{var r,a;return"TD"===((null==(a=null==(r=null==i?void 0:i.db)?void 0:r.getDirection)?void 0:a.call(r))??"LR")?ct.draw(t,e,n,i):rt.draw(t,e,n,i)},"draw")},parser:f,styles:ut};export{pt as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,e as t,U as i,a as s,M as r,l as n,t as o,R as a}from"./editor.main-CgHXuI1T.js";import"./index-DyV-bHVC.js";class l{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;const e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||(this._client=(async()=>(this._worker=e({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL(""+new URL("ts.worker-BDx6ZyVY.js",import.meta.url).href,import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(t.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))()),this._client}async getLanguageServiceWorker(...e){const t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}}const c={};function d(e,t,i=0){if("string"==typeof e)return e;if(void 0===e)return"";let s="";if(i){s+=t;for(let e=0;e<i;e++)s+=" "}if(s+=e.messageText,i++,e.next)for(const r of e.next)s+=d(r,t,i);return s}function u(e){return e?e.map(e=>e.text).join(""):""}c["lib.d.ts"]=!0,c["lib.decorators.d.ts"]=!0,c["lib.decorators.legacy.d.ts"]=!0,c["lib.dom.asynciterable.d.ts"]=!0,c["lib.dom.d.ts"]=!0,c["lib.dom.iterable.d.ts"]=!0,c["lib.es2015.collection.d.ts"]=!0,c["lib.es2015.core.d.ts"]=!0,c["lib.es2015.d.ts"]=!0,c["lib.es2015.generator.d.ts"]=!0,c["lib.es2015.iterable.d.ts"]=!0,c["lib.es2015.promise.d.ts"]=!0,c["lib.es2015.proxy.d.ts"]=!0,c["lib.es2015.reflect.d.ts"]=!0,c["lib.es2015.symbol.d.ts"]=!0,c["lib.es2015.symbol.wellknown.d.ts"]=!0,c["lib.es2016.array.include.d.ts"]=!0,c["lib.es2016.d.ts"]=!0,c["lib.es2016.full.d.ts"]=!0,c["lib.es2016.intl.d.ts"]=!0,c["lib.es2017.arraybuffer.d.ts"]=!0,c["lib.es2017.d.ts"]=!0,c["lib.es2017.date.d.ts"]=!0,c["lib.es2017.full.d.ts"]=!0,c["lib.es2017.intl.d.ts"]=!0,c["lib.es2017.object.d.ts"]=!0,c["lib.es2017.sharedmemory.d.ts"]=!0,c["lib.es2017.string.d.ts"]=!0,c["lib.es2017.typedarrays.d.ts"]=!0,c["lib.es2018.asyncgenerator.d.ts"]=!0,c["lib.es2018.asynciterable.d.ts"]=!0,c["lib.es2018.d.ts"]=!0,c["lib.es2018.full.d.ts"]=!0,c["lib.es2018.intl.d.ts"]=!0,c["lib.es2018.promise.d.ts"]=!0,c["lib.es2018.regexp.d.ts"]=!0,c["lib.es2019.array.d.ts"]=!0,c["lib.es2019.d.ts"]=!0,c["lib.es2019.full.d.ts"]=!0,c["lib.es2019.intl.d.ts"]=!0,c["lib.es2019.object.d.ts"]=!0,c["lib.es2019.string.d.ts"]=!0,c["lib.es2019.symbol.d.ts"]=!0,c["lib.es2020.bigint.d.ts"]=!0,c["lib.es2020.d.ts"]=!0,c["lib.es2020.date.d.ts"]=!0,c["lib.es2020.full.d.ts"]=!0,c["lib.es2020.intl.d.ts"]=!0,c["lib.es2020.number.d.ts"]=!0,c["lib.es2020.promise.d.ts"]=!0,c["lib.es2020.sharedmemory.d.ts"]=!0,c["lib.es2020.string.d.ts"]=!0,c["lib.es2020.symbol.wellknown.d.ts"]=!0,c["lib.es2021.d.ts"]=!0,c["lib.es2021.full.d.ts"]=!0,c["lib.es2021.intl.d.ts"]=!0,c["lib.es2021.promise.d.ts"]=!0,c["lib.es2021.string.d.ts"]=!0,c["lib.es2021.weakref.d.ts"]=!0,c["lib.es2022.array.d.ts"]=!0,c["lib.es2022.d.ts"]=!0,c["lib.es2022.error.d.ts"]=!0,c["lib.es2022.full.d.ts"]=!0,c["lib.es2022.intl.d.ts"]=!0,c["lib.es2022.object.d.ts"]=!0,c["lib.es2022.regexp.d.ts"]=!0,c["lib.es2022.string.d.ts"]=!0,c["lib.es2023.array.d.ts"]=!0,c["lib.es2023.collection.d.ts"]=!0,c["lib.es2023.d.ts"]=!0,c["lib.es2023.full.d.ts"]=!0,c["lib.es2023.intl.d.ts"]=!0,c["lib.es2024.arraybuffer.d.ts"]=!0,c["lib.es2024.collection.d.ts"]=!0,c["lib.es2024.d.ts"]=!0,c["lib.es2024.full.d.ts"]=!0,c["lib.es2024.object.d.ts"]=!0,c["lib.es2024.promise.d.ts"]=!0,c["lib.es2024.regexp.d.ts"]=!0,c["lib.es2024.sharedmemory.d.ts"]=!0,c["lib.es2024.string.d.ts"]=!0,c["lib.es5.d.ts"]=!0,c["lib.es6.d.ts"]=!0,c["lib.esnext.array.d.ts"]=!0,c["lib.esnext.collection.d.ts"]=!0,c["lib.esnext.d.ts"]=!0,c["lib.esnext.decorators.d.ts"]=!0,c["lib.esnext.disposable.d.ts"]=!0,c["lib.esnext.error.d.ts"]=!0,c["lib.esnext.float16.d.ts"]=!0,c["lib.esnext.full.d.ts"]=!0,c["lib.esnext.intl.d.ts"]=!0,c["lib.esnext.iterator.d.ts"]=!0,c["lib.esnext.promise.d.ts"]=!0,c["lib.esnext.sharedmemory.d.ts"]=!0,c["lib.scripthost.d.ts"]=!0,c["lib.webworker.asynciterable.d.ts"]=!0,c["lib.webworker.d.ts"]=!0,c["lib.webworker.importscripts.d.ts"]=!0,c["lib.webworker.iterable.d.ts"]=!0;class p{constructor(e){this._worker=e}_textSpanToRange(e,t){let i=e.getPositionAt(t.start),s=e.getPositionAt(t.start+t.length),{lineNumber:r,column:n}=i,{lineNumber:o,column:a}=s;return{startLineNumber:r,startColumn:n,endLineNumber:o,endColumn:a}}}class m{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return!!e&&(0===e.path.indexOf("/lib.")&&!!c[e.path.slice(1)])}getOrCreateModel(e){const s=i.parse(e),r=t.getModel(s);if(r)return r;if(this.isLibFile(s)&&this._hasFetchedLibFiles)return t.createModel(this._libFiles[s.path.slice(1)],"typescript",s);const n=o.getExtraLibs()[e];return n?t.createModel(n.content,"typescript",s):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||(this._fetchLibFilesPromise=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e})),this._fetchLibFilesPromise}}class g extends p{constructor(e,i,s,r){super(r),this._libFiles=e,this._defaults=i,this._selector=s,this._disposables=[],this._listener=Object.create(null);const n=e=>{if(e.getLanguageId()!==s)return;const i=()=>{const{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)};let r;const n=e.onDidChangeContent(()=>{clearTimeout(r),r=window.setTimeout(i,500)}),o=e.onDidChangeAttached(()=>{const{onlyVisible:s}=this._defaults.getDiagnosticsOptions();s&&(e.isAttachedToEditor()?i():t.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){n.dispose(),o.dispose(),clearTimeout(r)}},i()},o=e=>{t.setModelMarkers(e,this._selector,[]);const i=e.uri.toString();this._listener[i]&&(this._listener[i].dispose(),delete this._listener[i])};this._disposables.push(t.onDidCreateModel(e=>n(e))),this._disposables.push(t.onWillDisposeModel(o)),this._disposables.push(t.onDidChangeModelLanguage(e=>{o(e.model),n(e.model)})),this._disposables.push({dispose(){for(const e of t.getModels())o(e)}});const a=()=>{for(const e of t.getModels())o(e),n(e)};this._disposables.push(this._defaults.onDidChange(a)),this._disposables.push(this._defaults.onDidExtraLibsChange(a)),t.getModels().forEach(e=>n(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){const s=await this._worker(e.uri);if(e.isDisposed())return;const r=[],{noSyntaxValidation:n,noSemanticValidation:o,noSuggestionDiagnostics:a}=this._defaults.getDiagnosticsOptions();n||r.push(s.getSyntacticDiagnostics(e.uri.toString())),o||r.push(s.getSemanticDiagnostics(e.uri.toString())),a||r.push(s.getSuggestionDiagnostics(e.uri.toString()));const l=await Promise.all(r);if(!l||e.isDisposed())return;const c=l.reduce((e,t)=>t.concat(e),[]).filter(e=>-1===(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)),d=c.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?i.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(d),e.isDisposed()||t.setModelMarkers(e,this._selector,c.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(e,t){const i=t.start||0,r=t.length||1,{lineNumber:n,column:o}=e.getPositionAt(i),{lineNumber:a,column:l}=e.getPositionAt(i+r),c=[];return t.reportsUnnecessary&&c.push(s.Unnecessary),t.reportsDeprecated&&c.push(s.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:n,startColumn:o,endLineNumber:a,endColumn:l,message:d(t.messageText,"\n"),code:t.code.toString(),tags:c,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];const i=[];return t.forEach(t=>{let s=e;if(t.file&&(s=this._libFiles.getOrCreateModel(t.file.fileName)),!s)return;const r=t.start||0,n=t.length||1,{lineNumber:o,column:a}=s.getPositionAt(r),{lineNumber:l,column:c}=s.getPositionAt(r+n);i.push({resource:s.uri,startLineNumber:o,startColumn:a,endLineNumber:l,endColumn:c,message:d(t.messageText,"\n")})}),i}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return r.Error;case 3:return r.Info;case 0:return r.Warning;case 2:return r.Hint}return r.Info}}class b extends p{get triggerCharacters(){return["."]}async provideCompletionItems(e,t,i,s){const r=e.getWordUntilPosition(t),o=new a(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn),l=e.uri,c=e.getOffsetAt(t),d=await this._worker(l);if(e.isDisposed())return;const u=await d.getCompletionsAtPosition(l.toString(),c);if(!u||e.isDisposed())return;return{suggestions:u.entries.map(i=>{let s=o;if(i.replacementSpan){const t=e.getPositionAt(i.replacementSpan.start),r=e.getPositionAt(i.replacementSpan.start+i.replacementSpan.length);s=new a(t.lineNumber,t.column,r.lineNumber,r.column)}const r=[];return void 0!==i.kindModifiers&&-1!==i.kindModifiers.indexOf("deprecated")&&r.push(n.CompletionItemTag.Deprecated),{uri:l,position:t,offset:c,range:s,label:i.name,insertText:i.name,sortText:i.sortText,kind:b.convertKind(i.kind),tags:r}})}}async resolveCompletionItem(e,t){const i=e,s=i.uri,r=i.position,n=i.offset,o=await this._worker(s),a=await o.getCompletionEntryDetails(s.toString(),n,i.label);return a?{uri:s,position:r,label:a.name,kind:b.convertKind(a.kind),detail:u(a.displayParts),documentation:{value:b.createDocumentationString(a)}}:i}static convertKind(e){switch(e){case k.primitiveType:case k.keyword:return n.CompletionItemKind.Keyword;case k.variable:case k.localVariable:return n.CompletionItemKind.Variable;case k.memberVariable:case k.memberGetAccessor:case k.memberSetAccessor:return n.CompletionItemKind.Field;case k.function:case k.memberFunction:case k.constructSignature:case k.callSignature:case k.indexSignature:return n.CompletionItemKind.Function;case k.enum:return n.CompletionItemKind.Enum;case k.module:return n.CompletionItemKind.Module;case k.class:return n.CompletionItemKind.Class;case k.interface:return n.CompletionItemKind.Interface;case k.warning:return n.CompletionItemKind.File}return n.CompletionItemKind.Property}static createDocumentationString(e){let t=u(e.documentation);if(e.tags)for(const i of e.tags)t+=`\n\n${h(i)}`;return t}}function h(e){let t=`*@${e.name}*`;if("param"===e.name&&e.text){const[i,...s]=e.text;t+=`\`${i.text}\``,s.length>0&&(t+=` — ${s.map(e=>e.text).join(" ")}`)}else Array.isArray(e.text)?t+=` — ${e.text.map(e=>e.text).join(" ")}`:e.text&&(t+=` — ${e.text}`);return t}class f extends p{constructor(){super(...arguments),this.signatureHelpTriggerCharacters=["(",","]}static _toSignatureHelpTriggerReason(e){switch(e.triggerKind){case n.SignatureHelpTriggerKind.TriggerCharacter:return e.triggerCharacter?e.isRetrigger?{kind:"retrigger",triggerCharacter:e.triggerCharacter}:{kind:"characterTyped",triggerCharacter:e.triggerCharacter}:{kind:"invoked"};case n.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case n.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}async provideSignatureHelp(e,t,i,s){const r=e.uri,n=e.getOffsetAt(t),o=await this._worker(r);if(e.isDisposed())return;const a=await o.getSignatureHelpItems(r.toString(),n,{triggerReason:f._toSignatureHelpTriggerReason(s)});if(!a||e.isDisposed())return;const l={activeSignature:a.selectedItemIndex,activeParameter:a.argumentIndex,signatures:[]};return a.items.forEach(e=>{const t={label:"",parameters:[]};t.documentation={value:u(e.documentation)},t.label+=u(e.prefixDisplayParts),e.parameters.forEach((i,s,r)=>{const n=u(i.displayParts),o={label:n,documentation:{value:u(i.documentation)}};t.label+=n,t.parameters.push(o),s<r.length-1&&(t.label+=u(e.separatorDisplayParts))}),t.label+=u(e.suffixDisplayParts),l.signatures.push(t)}),{value:l,dispose(){}}}}class _ extends p{async provideHover(e,t,i){const s=e.uri,r=e.getOffsetAt(t),n=await this._worker(s);if(e.isDisposed())return;const o=await n.getQuickInfoAtPosition(s.toString(),r);if(!o||e.isDisposed())return;const a=u(o.documentation),l=o.tags?o.tags.map(e=>h(e)).join(" \n\n"):"",c=u(o.displayParts);return{range:this._textSpanToRange(e,o.textSpan),contents:[{value:"```typescript\n"+c+"\n```\n"},{value:a+(l?"\n\n"+l:"")}]}}}class y extends p{async provideDocumentHighlights(e,t,i){const s=e.uri,r=e.getOffsetAt(t),o=await this._worker(s);if(e.isDisposed())return;const a=await o.getDocumentHighlights(s.toString(),r,[s.toString()]);return a&&!e.isDisposed()?a.flatMap(t=>t.highlightSpans.map(t=>({range:this._textSpanToRange(e,t.textSpan),kind:"writtenReference"===t.kind?n.DocumentHighlightKind.Write:n.DocumentHighlightKind.Text}))):void 0}}class w extends p{constructor(e,t){super(t),this._libFiles=e}async provideDefinition(e,t,s){const r=e.uri,n=e.getOffsetAt(t),o=await this._worker(r);if(e.isDisposed())return;const a=await o.getDefinitionAtPosition(r.toString(),n);if(!a||e.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(a.map(e=>i.parse(e.fileName))),e.isDisposed())return;const l=[];for(let i of a){const e=this._libFiles.getOrCreateModel(i.fileName);e&&l.push({uri:e.uri,range:this._textSpanToRange(e,i.textSpan)})}return l}}class x extends p{constructor(e,t){super(t),this._libFiles=e}async provideReferences(e,t,s,r){const n=e.uri,o=e.getOffsetAt(t),a=await this._worker(n);if(e.isDisposed())return;const l=await a.getReferencesAtPosition(n.toString(),o);if(!l||e.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(l.map(e=>i.parse(e.fileName))),e.isDisposed())return;const c=[];for(let i of l){const e=this._libFiles.getOrCreateModel(i.fileName);e&&c.push({uri:e.uri,range:this._textSpanToRange(e,i.textSpan)})}return c}}class S extends p{async provideDocumentSymbols(e,t){const i=e.uri,s=await this._worker(i);if(e.isDisposed())return;const r=await s.getNavigationTree(i.toString());if(!r||e.isDisposed())return;const o=(t,i)=>{var s;return{name:t.text,detail:"",kind:D[t.kind]||n.SymbolKind.Variable,range:this._textSpanToRange(e,t.spans[0]),selectionRange:this._textSpanToRange(e,t.spans[0]),tags:[],children:null==(s=t.childItems)?void 0:s.map(e=>o(e,t.text)),containerName:i}};return r.childItems?r.childItems.map(e=>o(e)):[]}}class k{}k.unknown="",k.keyword="keyword",k.script="script",k.module="module",k.class="class",k.interface="interface",k.type="type",k.enum="enum",k.variable="var",k.localVariable="local var",k.function="function",k.localFunction="local function",k.memberFunction="method",k.memberGetAccessor="getter",k.memberSetAccessor="setter",k.memberVariable="property",k.constructorImplementation="constructor",k.callSignature="call",k.indexSignature="index",k.constructSignature="construct",k.parameter="parameter",k.typeParameter="type parameter",k.primitiveType="primitive type",k.label="label",k.alias="alias",k.const="const",k.let="let",k.warning="warning";let v,C,D=Object.create(null);D[k.module]=n.SymbolKind.Module,D[k.class]=n.SymbolKind.Class,D[k.enum]=n.SymbolKind.Enum,D[k.interface]=n.SymbolKind.Interface,D[k.memberFunction]=n.SymbolKind.Method,D[k.memberVariable]=n.SymbolKind.Property,D[k.memberGetAccessor]=n.SymbolKind.Property,D[k.memberSetAccessor]=n.SymbolKind.Property,D[k.variable]=n.SymbolKind.Variable,D[k.const]=n.SymbolKind.Variable,D[k.localVariable]=n.SymbolKind.Variable,D[k.variable]=n.SymbolKind.Variable,D[k.function]=n.SymbolKind.Function,D[k.localFunction]=n.SymbolKind.Function;class F extends p{static _convertOptions(e){return{ConvertTabsToSpaces:e.insertSpaces,TabSize:e.tabSize,IndentSize:e.tabSize,IndentStyle:2,NewLineCharacter:"\n",InsertSpaceAfterCommaDelimiter:!0,InsertSpaceAfterSemicolonInForStatements:!0,InsertSpaceBeforeAndAfterBinaryOperators:!0,InsertSpaceAfterKeywordsInControlFlowStatements:!0,InsertSpaceAfterFunctionKeywordForAnonymousFunctions:!0,InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,PlaceOpenBraceOnNewLineForControlBlocks:!1,PlaceOpenBraceOnNewLineForFunctions:!1}}_convertTextChanges(e,t){return{text:t.newText,range:this._textSpanToRange(e,t.span)}}}class I extends F{constructor(){super(...arguments),this.canFormatMultipleRanges=!1}async provideDocumentRangeFormattingEdits(e,t,i,s){const r=e.uri,n=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),a=await this._worker(r);if(e.isDisposed())return;const l=await a.getFormattingEditsForRange(r.toString(),n,o,F._convertOptions(i));return l&&!e.isDisposed()?l.map(t=>this._convertTextChanges(e,t)):void 0}}class A extends F{get autoFormatTriggerCharacters(){return[";","}","\n"]}async provideOnTypeFormattingEdits(e,t,i,s,r){const n=e.uri,o=e.getOffsetAt(t),a=await this._worker(n);if(e.isDisposed())return;const l=await a.getFormattingEditsAfterKeystroke(n.toString(),o,i,F._convertOptions(s));return l&&!e.isDisposed()?l.map(t=>this._convertTextChanges(e,t)):void 0}}class L extends F{async provideCodeActions(e,t,i,s){const r=e.uri,n=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),a=F._convertOptions(e.getOptions()),l=i.markers.filter(e=>e.code).map(e=>e.code).map(Number),c=await this._worker(r);if(e.isDisposed())return;const d=await c.getCodeFixesAtPosition(r.toString(),n,o,l,a);if(!d||e.isDisposed())return{actions:[],dispose:()=>{}};return{actions:d.filter(e=>0===e.changes.filter(e=>e.isNewFile).length).map(t=>this._tsCodeFixActionToMonacoCodeAction(e,i,t)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(e,t,i){const s=[];for(const r of i.changes)for(const t of r.textChanges)s.push({resource:e.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(e,t.span),text:t.newText}});return{title:i.description,edit:{edits:s},diagnostics:t.markers,kind:"quickfix"}}}class T extends p{constructor(e,t){super(t),this._libFiles=e}async provideRenameEdits(e,t,i,s){const r=e.uri,n=r.toString(),o=e.getOffsetAt(t),a=await this._worker(r);if(e.isDisposed())return;const l=await a.getRenameInfo(n,o,{allowRenameOfImportPath:!1});if(!1===l.canRename)return{edits:[],rejectReason:l.localizedErrorMessage};if(void 0!==l.fileToRename)throw new Error("Renaming files is not supported.");const c=await a.findRenameLocations(n,o,!1,!1,!1);if(!c||e.isDisposed())return;const d=[];for(const u of c){const e=this._libFiles.getOrCreateModel(u.fileName);if(!e)throw new Error(`Unknown file ${u.fileName}.`);d.push({resource:e.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(e,u.textSpan),text:i}})}return{edits:d}}}class P extends p{async provideInlayHints(e,t,i){const s=e.uri,r=s.toString(),n=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),a=await this._worker(s);if(e.isDisposed())return null;return{hints:(await a.provideInlayHints(r,n,o)).map(t=>({...t,label:t.text,position:e.getPositionAt(t.position),kind:this._convertHintKind(t.kind)})),dispose:()=>{}}}_convertHintKind(e){return"Parameter"===e?n.InlayHintKind.Parameter:n.InlayHintKind.Type}}function N(e){C=E(e,"typescript")}function O(e){v=E(e,"javascript")}function K(){return new Promise((e,t)=>{if(!v)return t("JavaScript not registered!");e(v)})}function R(){return new Promise((e,t)=>{if(!C)return t("TypeScript not registered!");e(C)})}function E(e,t){const i=[],s=new l(t,e),r=(...e)=>s.getLanguageServiceWorker(...e),o=new m(r);return function(){const{modeConfiguration:s}=e;!function(e){for(;e.length;)e.pop().dispose()}(i),s.completionItems&&i.push(n.registerCompletionItemProvider(t,new b(r))),s.signatureHelp&&i.push(n.registerSignatureHelpProvider(t,new f(r))),s.hovers&&i.push(n.registerHoverProvider(t,new _(r))),s.documentHighlights&&i.push(n.registerDocumentHighlightProvider(t,new y(r))),s.definitions&&i.push(n.registerDefinitionProvider(t,new w(o,r))),s.references&&i.push(n.registerReferenceProvider(t,new x(o,r))),s.documentSymbols&&i.push(n.registerDocumentSymbolProvider(t,new S(r))),s.rename&&i.push(n.registerRenameProvider(t,new T(o,r))),s.documentRangeFormattingEdits&&i.push(n.registerDocumentRangeFormattingEditProvider(t,new I(r))),s.onTypeFormattingEdits&&i.push(n.registerOnTypeFormattingEditProvider(t,new A(r))),s.codeActions&&i.push(n.registerCodeActionProvider(t,new L(r))),s.inlayHints&&i.push(n.registerInlayHintsProvider(t,new P(r))),s.diagnostics&&i.push(new g(o,e,t,r))}(),r}export{p as Adapter,L as CodeActionAdaptor,w as DefinitionAdapter,g as DiagnosticsAdapter,y as DocumentHighlightAdapter,I as FormatAdapter,F as FormatHelper,A as FormatOnTypeAdapter,P as InlayHintsAdapter,k as Kind,m as LibFiles,S as OutlineAdapter,_ as QuickInfoAdapter,x as ReferenceAdapter,T as RenameAdapter,f as SignatureHelpAdapter,b as SuggestAdapter,l as WorkerManager,d as flattenDiagnosticMessageText,K as getJavaScriptWorker,R as getTypeScriptWorker,O as setupJavaScript,N as setupTypeScript};
|
|
1
|
+
import{c as e,e as t,U as i,a as s,M as r,l as n,t as o,R as a}from"./editor.main-DX1kz8I2.js";import"./index-AdB8XHXv.js";class l{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;const e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||(this._client=(async()=>(this._worker=e({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL(""+new URL("ts.worker-BDx6ZyVY.js",import.meta.url).href,import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(t.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))()),this._client}async getLanguageServiceWorker(...e){const t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}}const c={};function d(e,t,i=0){if("string"==typeof e)return e;if(void 0===e)return"";let s="";if(i){s+=t;for(let e=0;e<i;e++)s+=" "}if(s+=e.messageText,i++,e.next)for(const r of e.next)s+=d(r,t,i);return s}function u(e){return e?e.map(e=>e.text).join(""):""}c["lib.d.ts"]=!0,c["lib.decorators.d.ts"]=!0,c["lib.decorators.legacy.d.ts"]=!0,c["lib.dom.asynciterable.d.ts"]=!0,c["lib.dom.d.ts"]=!0,c["lib.dom.iterable.d.ts"]=!0,c["lib.es2015.collection.d.ts"]=!0,c["lib.es2015.core.d.ts"]=!0,c["lib.es2015.d.ts"]=!0,c["lib.es2015.generator.d.ts"]=!0,c["lib.es2015.iterable.d.ts"]=!0,c["lib.es2015.promise.d.ts"]=!0,c["lib.es2015.proxy.d.ts"]=!0,c["lib.es2015.reflect.d.ts"]=!0,c["lib.es2015.symbol.d.ts"]=!0,c["lib.es2015.symbol.wellknown.d.ts"]=!0,c["lib.es2016.array.include.d.ts"]=!0,c["lib.es2016.d.ts"]=!0,c["lib.es2016.full.d.ts"]=!0,c["lib.es2016.intl.d.ts"]=!0,c["lib.es2017.arraybuffer.d.ts"]=!0,c["lib.es2017.d.ts"]=!0,c["lib.es2017.date.d.ts"]=!0,c["lib.es2017.full.d.ts"]=!0,c["lib.es2017.intl.d.ts"]=!0,c["lib.es2017.object.d.ts"]=!0,c["lib.es2017.sharedmemory.d.ts"]=!0,c["lib.es2017.string.d.ts"]=!0,c["lib.es2017.typedarrays.d.ts"]=!0,c["lib.es2018.asyncgenerator.d.ts"]=!0,c["lib.es2018.asynciterable.d.ts"]=!0,c["lib.es2018.d.ts"]=!0,c["lib.es2018.full.d.ts"]=!0,c["lib.es2018.intl.d.ts"]=!0,c["lib.es2018.promise.d.ts"]=!0,c["lib.es2018.regexp.d.ts"]=!0,c["lib.es2019.array.d.ts"]=!0,c["lib.es2019.d.ts"]=!0,c["lib.es2019.full.d.ts"]=!0,c["lib.es2019.intl.d.ts"]=!0,c["lib.es2019.object.d.ts"]=!0,c["lib.es2019.string.d.ts"]=!0,c["lib.es2019.symbol.d.ts"]=!0,c["lib.es2020.bigint.d.ts"]=!0,c["lib.es2020.d.ts"]=!0,c["lib.es2020.date.d.ts"]=!0,c["lib.es2020.full.d.ts"]=!0,c["lib.es2020.intl.d.ts"]=!0,c["lib.es2020.number.d.ts"]=!0,c["lib.es2020.promise.d.ts"]=!0,c["lib.es2020.sharedmemory.d.ts"]=!0,c["lib.es2020.string.d.ts"]=!0,c["lib.es2020.symbol.wellknown.d.ts"]=!0,c["lib.es2021.d.ts"]=!0,c["lib.es2021.full.d.ts"]=!0,c["lib.es2021.intl.d.ts"]=!0,c["lib.es2021.promise.d.ts"]=!0,c["lib.es2021.string.d.ts"]=!0,c["lib.es2021.weakref.d.ts"]=!0,c["lib.es2022.array.d.ts"]=!0,c["lib.es2022.d.ts"]=!0,c["lib.es2022.error.d.ts"]=!0,c["lib.es2022.full.d.ts"]=!0,c["lib.es2022.intl.d.ts"]=!0,c["lib.es2022.object.d.ts"]=!0,c["lib.es2022.regexp.d.ts"]=!0,c["lib.es2022.string.d.ts"]=!0,c["lib.es2023.array.d.ts"]=!0,c["lib.es2023.collection.d.ts"]=!0,c["lib.es2023.d.ts"]=!0,c["lib.es2023.full.d.ts"]=!0,c["lib.es2023.intl.d.ts"]=!0,c["lib.es2024.arraybuffer.d.ts"]=!0,c["lib.es2024.collection.d.ts"]=!0,c["lib.es2024.d.ts"]=!0,c["lib.es2024.full.d.ts"]=!0,c["lib.es2024.object.d.ts"]=!0,c["lib.es2024.promise.d.ts"]=!0,c["lib.es2024.regexp.d.ts"]=!0,c["lib.es2024.sharedmemory.d.ts"]=!0,c["lib.es2024.string.d.ts"]=!0,c["lib.es5.d.ts"]=!0,c["lib.es6.d.ts"]=!0,c["lib.esnext.array.d.ts"]=!0,c["lib.esnext.collection.d.ts"]=!0,c["lib.esnext.d.ts"]=!0,c["lib.esnext.decorators.d.ts"]=!0,c["lib.esnext.disposable.d.ts"]=!0,c["lib.esnext.error.d.ts"]=!0,c["lib.esnext.float16.d.ts"]=!0,c["lib.esnext.full.d.ts"]=!0,c["lib.esnext.intl.d.ts"]=!0,c["lib.esnext.iterator.d.ts"]=!0,c["lib.esnext.promise.d.ts"]=!0,c["lib.esnext.sharedmemory.d.ts"]=!0,c["lib.scripthost.d.ts"]=!0,c["lib.webworker.asynciterable.d.ts"]=!0,c["lib.webworker.d.ts"]=!0,c["lib.webworker.importscripts.d.ts"]=!0,c["lib.webworker.iterable.d.ts"]=!0;class p{constructor(e){this._worker=e}_textSpanToRange(e,t){let i=e.getPositionAt(t.start),s=e.getPositionAt(t.start+t.length),{lineNumber:r,column:n}=i,{lineNumber:o,column:a}=s;return{startLineNumber:r,startColumn:n,endLineNumber:o,endColumn:a}}}class m{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return!!e&&(0===e.path.indexOf("/lib.")&&!!c[e.path.slice(1)])}getOrCreateModel(e){const s=i.parse(e),r=t.getModel(s);if(r)return r;if(this.isLibFile(s)&&this._hasFetchedLibFiles)return t.createModel(this._libFiles[s.path.slice(1)],"typescript",s);const n=o.getExtraLibs()[e];return n?t.createModel(n.content,"typescript",s):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||(this._fetchLibFilesPromise=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e})),this._fetchLibFilesPromise}}class g extends p{constructor(e,i,s,r){super(r),this._libFiles=e,this._defaults=i,this._selector=s,this._disposables=[],this._listener=Object.create(null);const n=e=>{if(e.getLanguageId()!==s)return;const i=()=>{const{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)};let r;const n=e.onDidChangeContent(()=>{clearTimeout(r),r=window.setTimeout(i,500)}),o=e.onDidChangeAttached(()=>{const{onlyVisible:s}=this._defaults.getDiagnosticsOptions();s&&(e.isAttachedToEditor()?i():t.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){n.dispose(),o.dispose(),clearTimeout(r)}},i()},o=e=>{t.setModelMarkers(e,this._selector,[]);const i=e.uri.toString();this._listener[i]&&(this._listener[i].dispose(),delete this._listener[i])};this._disposables.push(t.onDidCreateModel(e=>n(e))),this._disposables.push(t.onWillDisposeModel(o)),this._disposables.push(t.onDidChangeModelLanguage(e=>{o(e.model),n(e.model)})),this._disposables.push({dispose(){for(const e of t.getModels())o(e)}});const a=()=>{for(const e of t.getModels())o(e),n(e)};this._disposables.push(this._defaults.onDidChange(a)),this._disposables.push(this._defaults.onDidExtraLibsChange(a)),t.getModels().forEach(e=>n(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){const s=await this._worker(e.uri);if(e.isDisposed())return;const r=[],{noSyntaxValidation:n,noSemanticValidation:o,noSuggestionDiagnostics:a}=this._defaults.getDiagnosticsOptions();n||r.push(s.getSyntacticDiagnostics(e.uri.toString())),o||r.push(s.getSemanticDiagnostics(e.uri.toString())),a||r.push(s.getSuggestionDiagnostics(e.uri.toString()));const l=await Promise.all(r);if(!l||e.isDisposed())return;const c=l.reduce((e,t)=>t.concat(e),[]).filter(e=>-1===(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)),d=c.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?i.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(d),e.isDisposed()||t.setModelMarkers(e,this._selector,c.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(e,t){const i=t.start||0,r=t.length||1,{lineNumber:n,column:o}=e.getPositionAt(i),{lineNumber:a,column:l}=e.getPositionAt(i+r),c=[];return t.reportsUnnecessary&&c.push(s.Unnecessary),t.reportsDeprecated&&c.push(s.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:n,startColumn:o,endLineNumber:a,endColumn:l,message:d(t.messageText,"\n"),code:t.code.toString(),tags:c,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];const i=[];return t.forEach(t=>{let s=e;if(t.file&&(s=this._libFiles.getOrCreateModel(t.file.fileName)),!s)return;const r=t.start||0,n=t.length||1,{lineNumber:o,column:a}=s.getPositionAt(r),{lineNumber:l,column:c}=s.getPositionAt(r+n);i.push({resource:s.uri,startLineNumber:o,startColumn:a,endLineNumber:l,endColumn:c,message:d(t.messageText,"\n")})}),i}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return r.Error;case 3:return r.Info;case 0:return r.Warning;case 2:return r.Hint}return r.Info}}class b extends p{get triggerCharacters(){return["."]}async provideCompletionItems(e,t,i,s){const r=e.getWordUntilPosition(t),o=new a(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn),l=e.uri,c=e.getOffsetAt(t),d=await this._worker(l);if(e.isDisposed())return;const u=await d.getCompletionsAtPosition(l.toString(),c);if(!u||e.isDisposed())return;return{suggestions:u.entries.map(i=>{let s=o;if(i.replacementSpan){const t=e.getPositionAt(i.replacementSpan.start),r=e.getPositionAt(i.replacementSpan.start+i.replacementSpan.length);s=new a(t.lineNumber,t.column,r.lineNumber,r.column)}const r=[];return void 0!==i.kindModifiers&&-1!==i.kindModifiers.indexOf("deprecated")&&r.push(n.CompletionItemTag.Deprecated),{uri:l,position:t,offset:c,range:s,label:i.name,insertText:i.name,sortText:i.sortText,kind:b.convertKind(i.kind),tags:r}})}}async resolveCompletionItem(e,t){const i=e,s=i.uri,r=i.position,n=i.offset,o=await this._worker(s),a=await o.getCompletionEntryDetails(s.toString(),n,i.label);return a?{uri:s,position:r,label:a.name,kind:b.convertKind(a.kind),detail:u(a.displayParts),documentation:{value:b.createDocumentationString(a)}}:i}static convertKind(e){switch(e){case k.primitiveType:case k.keyword:return n.CompletionItemKind.Keyword;case k.variable:case k.localVariable:return n.CompletionItemKind.Variable;case k.memberVariable:case k.memberGetAccessor:case k.memberSetAccessor:return n.CompletionItemKind.Field;case k.function:case k.memberFunction:case k.constructSignature:case k.callSignature:case k.indexSignature:return n.CompletionItemKind.Function;case k.enum:return n.CompletionItemKind.Enum;case k.module:return n.CompletionItemKind.Module;case k.class:return n.CompletionItemKind.Class;case k.interface:return n.CompletionItemKind.Interface;case k.warning:return n.CompletionItemKind.File}return n.CompletionItemKind.Property}static createDocumentationString(e){let t=u(e.documentation);if(e.tags)for(const i of e.tags)t+=`\n\n${h(i)}`;return t}}function h(e){let t=`*@${e.name}*`;if("param"===e.name&&e.text){const[i,...s]=e.text;t+=`\`${i.text}\``,s.length>0&&(t+=` — ${s.map(e=>e.text).join(" ")}`)}else Array.isArray(e.text)?t+=` — ${e.text.map(e=>e.text).join(" ")}`:e.text&&(t+=` — ${e.text}`);return t}class f extends p{constructor(){super(...arguments),this.signatureHelpTriggerCharacters=["(",","]}static _toSignatureHelpTriggerReason(e){switch(e.triggerKind){case n.SignatureHelpTriggerKind.TriggerCharacter:return e.triggerCharacter?e.isRetrigger?{kind:"retrigger",triggerCharacter:e.triggerCharacter}:{kind:"characterTyped",triggerCharacter:e.triggerCharacter}:{kind:"invoked"};case n.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case n.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}async provideSignatureHelp(e,t,i,s){const r=e.uri,n=e.getOffsetAt(t),o=await this._worker(r);if(e.isDisposed())return;const a=await o.getSignatureHelpItems(r.toString(),n,{triggerReason:f._toSignatureHelpTriggerReason(s)});if(!a||e.isDisposed())return;const l={activeSignature:a.selectedItemIndex,activeParameter:a.argumentIndex,signatures:[]};return a.items.forEach(e=>{const t={label:"",parameters:[]};t.documentation={value:u(e.documentation)},t.label+=u(e.prefixDisplayParts),e.parameters.forEach((i,s,r)=>{const n=u(i.displayParts),o={label:n,documentation:{value:u(i.documentation)}};t.label+=n,t.parameters.push(o),s<r.length-1&&(t.label+=u(e.separatorDisplayParts))}),t.label+=u(e.suffixDisplayParts),l.signatures.push(t)}),{value:l,dispose(){}}}}class _ extends p{async provideHover(e,t,i){const s=e.uri,r=e.getOffsetAt(t),n=await this._worker(s);if(e.isDisposed())return;const o=await n.getQuickInfoAtPosition(s.toString(),r);if(!o||e.isDisposed())return;const a=u(o.documentation),l=o.tags?o.tags.map(e=>h(e)).join(" \n\n"):"",c=u(o.displayParts);return{range:this._textSpanToRange(e,o.textSpan),contents:[{value:"```typescript\n"+c+"\n```\n"},{value:a+(l?"\n\n"+l:"")}]}}}class y extends p{async provideDocumentHighlights(e,t,i){const s=e.uri,r=e.getOffsetAt(t),o=await this._worker(s);if(e.isDisposed())return;const a=await o.getDocumentHighlights(s.toString(),r,[s.toString()]);return a&&!e.isDisposed()?a.flatMap(t=>t.highlightSpans.map(t=>({range:this._textSpanToRange(e,t.textSpan),kind:"writtenReference"===t.kind?n.DocumentHighlightKind.Write:n.DocumentHighlightKind.Text}))):void 0}}class w extends p{constructor(e,t){super(t),this._libFiles=e}async provideDefinition(e,t,s){const r=e.uri,n=e.getOffsetAt(t),o=await this._worker(r);if(e.isDisposed())return;const a=await o.getDefinitionAtPosition(r.toString(),n);if(!a||e.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(a.map(e=>i.parse(e.fileName))),e.isDisposed())return;const l=[];for(let i of a){const e=this._libFiles.getOrCreateModel(i.fileName);e&&l.push({uri:e.uri,range:this._textSpanToRange(e,i.textSpan)})}return l}}class x extends p{constructor(e,t){super(t),this._libFiles=e}async provideReferences(e,t,s,r){const n=e.uri,o=e.getOffsetAt(t),a=await this._worker(n);if(e.isDisposed())return;const l=await a.getReferencesAtPosition(n.toString(),o);if(!l||e.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(l.map(e=>i.parse(e.fileName))),e.isDisposed())return;const c=[];for(let i of l){const e=this._libFiles.getOrCreateModel(i.fileName);e&&c.push({uri:e.uri,range:this._textSpanToRange(e,i.textSpan)})}return c}}class S extends p{async provideDocumentSymbols(e,t){const i=e.uri,s=await this._worker(i);if(e.isDisposed())return;const r=await s.getNavigationTree(i.toString());if(!r||e.isDisposed())return;const o=(t,i)=>{var s;return{name:t.text,detail:"",kind:D[t.kind]||n.SymbolKind.Variable,range:this._textSpanToRange(e,t.spans[0]),selectionRange:this._textSpanToRange(e,t.spans[0]),tags:[],children:null==(s=t.childItems)?void 0:s.map(e=>o(e,t.text)),containerName:i}};return r.childItems?r.childItems.map(e=>o(e)):[]}}class k{}k.unknown="",k.keyword="keyword",k.script="script",k.module="module",k.class="class",k.interface="interface",k.type="type",k.enum="enum",k.variable="var",k.localVariable="local var",k.function="function",k.localFunction="local function",k.memberFunction="method",k.memberGetAccessor="getter",k.memberSetAccessor="setter",k.memberVariable="property",k.constructorImplementation="constructor",k.callSignature="call",k.indexSignature="index",k.constructSignature="construct",k.parameter="parameter",k.typeParameter="type parameter",k.primitiveType="primitive type",k.label="label",k.alias="alias",k.const="const",k.let="let",k.warning="warning";let v,C,D=Object.create(null);D[k.module]=n.SymbolKind.Module,D[k.class]=n.SymbolKind.Class,D[k.enum]=n.SymbolKind.Enum,D[k.interface]=n.SymbolKind.Interface,D[k.memberFunction]=n.SymbolKind.Method,D[k.memberVariable]=n.SymbolKind.Property,D[k.memberGetAccessor]=n.SymbolKind.Property,D[k.memberSetAccessor]=n.SymbolKind.Property,D[k.variable]=n.SymbolKind.Variable,D[k.const]=n.SymbolKind.Variable,D[k.localVariable]=n.SymbolKind.Variable,D[k.variable]=n.SymbolKind.Variable,D[k.function]=n.SymbolKind.Function,D[k.localFunction]=n.SymbolKind.Function;class F extends p{static _convertOptions(e){return{ConvertTabsToSpaces:e.insertSpaces,TabSize:e.tabSize,IndentSize:e.tabSize,IndentStyle:2,NewLineCharacter:"\n",InsertSpaceAfterCommaDelimiter:!0,InsertSpaceAfterSemicolonInForStatements:!0,InsertSpaceBeforeAndAfterBinaryOperators:!0,InsertSpaceAfterKeywordsInControlFlowStatements:!0,InsertSpaceAfterFunctionKeywordForAnonymousFunctions:!0,InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,PlaceOpenBraceOnNewLineForControlBlocks:!1,PlaceOpenBraceOnNewLineForFunctions:!1}}_convertTextChanges(e,t){return{text:t.newText,range:this._textSpanToRange(e,t.span)}}}class I extends F{constructor(){super(...arguments),this.canFormatMultipleRanges=!1}async provideDocumentRangeFormattingEdits(e,t,i,s){const r=e.uri,n=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),a=await this._worker(r);if(e.isDisposed())return;const l=await a.getFormattingEditsForRange(r.toString(),n,o,F._convertOptions(i));return l&&!e.isDisposed()?l.map(t=>this._convertTextChanges(e,t)):void 0}}class A extends F{get autoFormatTriggerCharacters(){return[";","}","\n"]}async provideOnTypeFormattingEdits(e,t,i,s,r){const n=e.uri,o=e.getOffsetAt(t),a=await this._worker(n);if(e.isDisposed())return;const l=await a.getFormattingEditsAfterKeystroke(n.toString(),o,i,F._convertOptions(s));return l&&!e.isDisposed()?l.map(t=>this._convertTextChanges(e,t)):void 0}}class L extends F{async provideCodeActions(e,t,i,s){const r=e.uri,n=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),a=F._convertOptions(e.getOptions()),l=i.markers.filter(e=>e.code).map(e=>e.code).map(Number),c=await this._worker(r);if(e.isDisposed())return;const d=await c.getCodeFixesAtPosition(r.toString(),n,o,l,a);if(!d||e.isDisposed())return{actions:[],dispose:()=>{}};return{actions:d.filter(e=>0===e.changes.filter(e=>e.isNewFile).length).map(t=>this._tsCodeFixActionToMonacoCodeAction(e,i,t)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(e,t,i){const s=[];for(const r of i.changes)for(const t of r.textChanges)s.push({resource:e.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(e,t.span),text:t.newText}});return{title:i.description,edit:{edits:s},diagnostics:t.markers,kind:"quickfix"}}}class T extends p{constructor(e,t){super(t),this._libFiles=e}async provideRenameEdits(e,t,i,s){const r=e.uri,n=r.toString(),o=e.getOffsetAt(t),a=await this._worker(r);if(e.isDisposed())return;const l=await a.getRenameInfo(n,o,{allowRenameOfImportPath:!1});if(!1===l.canRename)return{edits:[],rejectReason:l.localizedErrorMessage};if(void 0!==l.fileToRename)throw new Error("Renaming files is not supported.");const c=await a.findRenameLocations(n,o,!1,!1,!1);if(!c||e.isDisposed())return;const d=[];for(const u of c){const e=this._libFiles.getOrCreateModel(u.fileName);if(!e)throw new Error(`Unknown file ${u.fileName}.`);d.push({resource:e.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(e,u.textSpan),text:i}})}return{edits:d}}}class P extends p{async provideInlayHints(e,t,i){const s=e.uri,r=s.toString(),n=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),a=await this._worker(s);if(e.isDisposed())return null;return{hints:(await a.provideInlayHints(r,n,o)).map(t=>({...t,label:t.text,position:e.getPositionAt(t.position),kind:this._convertHintKind(t.kind)})),dispose:()=>{}}}_convertHintKind(e){return"Parameter"===e?n.InlayHintKind.Parameter:n.InlayHintKind.Type}}function N(e){C=E(e,"typescript")}function O(e){v=E(e,"javascript")}function K(){return new Promise((e,t)=>{if(!v)return t("JavaScript not registered!");e(v)})}function R(){return new Promise((e,t)=>{if(!C)return t("TypeScript not registered!");e(C)})}function E(e,t){const i=[],s=new l(t,e),r=(...e)=>s.getLanguageServiceWorker(...e),o=new m(r);return function(){const{modeConfiguration:s}=e;!function(e){for(;e.length;)e.pop().dispose()}(i),s.completionItems&&i.push(n.registerCompletionItemProvider(t,new b(r))),s.signatureHelp&&i.push(n.registerSignatureHelpProvider(t,new f(r))),s.hovers&&i.push(n.registerHoverProvider(t,new _(r))),s.documentHighlights&&i.push(n.registerDocumentHighlightProvider(t,new y(r))),s.definitions&&i.push(n.registerDefinitionProvider(t,new w(o,r))),s.references&&i.push(n.registerReferenceProvider(t,new x(o,r))),s.documentSymbols&&i.push(n.registerDocumentSymbolProvider(t,new S(r))),s.rename&&i.push(n.registerRenameProvider(t,new T(o,r))),s.documentRangeFormattingEdits&&i.push(n.registerDocumentRangeFormattingEditProvider(t,new I(r))),s.onTypeFormattingEdits&&i.push(n.registerOnTypeFormattingEditProvider(t,new A(r))),s.codeActions&&i.push(n.registerCodeActionProvider(t,new L(r))),s.inlayHints&&i.push(n.registerInlayHintsProvider(t,new P(r))),s.diagnostics&&i.push(new g(o,e,t,r))}(),r}export{p as Adapter,L as CodeActionAdaptor,w as DefinitionAdapter,g as DiagnosticsAdapter,y as DocumentHighlightAdapter,I as FormatAdapter,F as FormatHelper,A as FormatOnTypeAdapter,P as InlayHintsAdapter,k as Kind,m as LibFiles,S as OutlineAdapter,_ as QuickInfoAdapter,x as ReferenceAdapter,T as RenameAdapter,f as SignatureHelpAdapter,b as SuggestAdapter,l as WorkerManager,d as flattenDiagnosticMessageText,K as getJavaScriptWorker,R as getTypeScriptWorker,O as setupJavaScript,N as setupTypeScript};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./editor.main-
|
|
1
|
+
import{l as e}from"./editor.main-DX1kz8I2.js";import"./index-AdB8XHXv.js";const t={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:e.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:e.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:e.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:e.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},n={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","out","package","private","protected","public","override","readonly","require","global","return","satisfies","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<","</",">>",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,"delimiter.bracket"],{include:"common"}],common:[[/#?[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/[A-Z][\w\$]*/,"type.identifier"],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([dgimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}};export{t as conf,n as language};
|
package/web/dist/assets/{vennDiagram-L72KCM5P-BcPfgqMW.js → vennDiagram-L72KCM5P-CJ5m4qeA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b3 as t,s as e,g as n,p as s,o as i,a as r,b as o,_ as a,z as l,F as c,d as h,ak as u,a9 as f,aa as d,ab as y,e as g,q as x,B as p,D as m}from"./mermaid.core-C4a3RQhj.js";import"./index-DyV-bHVC.js";const v=(e,n)=>t(e,"a",-n),b=1e-10;function I(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let s=n+1;s<t.length;++s){const i=_(t[n],t[s]);for(const t of i)t.parentIndex=[n,s],e.push(t)}return e}(t),s=n.filter(e=>function(t,e){return e.every(e=>k(t,e)<e.radius+b)}(e,t));let i=0,r=0;const o=[];if(s.length>1){const e=S(s);for(let t=0;t<s.length;++t){const n=s[t];n.angle=Math.atan2(n.x-e.x,n.y-e.y)}s.sort((t,e)=>e.angle-t.angle);let n=s[s.length-1];for(let a=0;a<s.length;++a){const e=s[a];r+=(n.x+e.x)*(e.y-n.y);const l={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let c=null;for(let s=0;s<e.parentIndex.length;++s)if(n.parentIndex.includes(e.parentIndex[s])){const i=t[e.parentIndex[s]],r=Math.atan2(e.x-i.x,e.y-i.y),o=Math.atan2(n.x-i.x,n.y-i.y);let a=o-r;a<0&&(a+=2*Math.PI);const h=o-a/2;let u=k(l,{x:i.x+i.radius*Math.sin(h),y:i.y+i.radius*Math.cos(h)});u>2*i.radius&&(u=2*i.radius),(null==c||c.width>u)&&(c={circle:i,width:u,p1:e,p2:n,large:u>i.radius,sweep:!0})}null!=c&&(o.push(c),i+=M(c.circle.radius,c.width),n=e)}}else{let e=t[0];for(let s=1;s<t.length;++s)t[s].radius<e.radius&&(e=t[s]);let n=!1;for(let s=0;s<t.length;++s)if(k(t[s],e)>Math.abs(e.radius-t[s].radius)){n=!0;break}n?i=r=0:(i=e.radius*e.radius*Math.PI,o.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-b,y:e.y+e.radius},width:2*e.radius,large:!0,sweep:!0}))}return r/=2,e&&(e.area=i+r,e.arcArea=i,e.polygonArea=r,e.arcs=o,e.innerPoints=s,e.intersectionPoints=n),i+r}function M(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function k(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function w(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(n*n-t*t+e*e)/(2*n);return M(t,t-(n*n-e*e+t*t)/(2*n))+M(e,s)}function _(t,e){const n=k(t,e),s=t.radius,i=e.radius;if(n>=s+i||n<=Math.abs(s-i))return[];const r=(s*s-i*i+n*n)/(2*n),o=Math.sqrt(s*s-r*r),a=t.x+r*(e.x-t.x)/n,l=t.y+r*(e.y-t.y)/n,c=-(e.y-t.y)*(o/n),h=-(e.x-t.x)*(o/n);return[{x:a+c,y:l-h},{x:a-c,y:l+h}]}function S(t){const e={x:0,y:0};for(const n of t)e.x+=n.x,e.y+=n.y;return e.x/=t.length,e.y/=t.length,e}function E(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function T(t,e){return E(t).map(()=>E(e))}function z(t,e){let n=0;for(let s=0;s<t.length;++s)n+=t[s]*e[s];return n}function A(t){return Math.sqrt(z(t,t))}function R(t,e,n){for(let s=0;s<e.length;++s)t[s]=e[s]*n}function D(t,e,n,s,i){for(let r=0;r<t.length;++r)t[r]=e*n[r]+s*i[r]}function N(t,e,n){const s=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,r=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,a=n.minErrorDelta||1e-5,l=void 0!==n.rho?n.rho:1,c=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,u=void 0!==n.sigma?n.sigma:.5;let f;const d=e.length,y=new Array(d+1);y[0]=e,y[0].fx=t(e),y[0].id=0;for(let I=0;I<d;++I){const n=e.slice();n[I]=n[I]?n[I]*i:r,y[I+1]=n,y[I+1].fx=t(n),y[I+1].id=I+1}function g(t){for(let e=0;e<t.length;e++)y[d][e]=t[e];y[d].fx=t.fx}const x=(t,e)=>t.fx-e.fx,p=e.slice(),m=e.slice(),v=e.slice(),b=e.slice();for(let I=0;I<s;++I){if(y.sort(x),n.history){const t=y.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:y[0].slice(),fx:y[0].fx,simplex:t})}f=0;for(let t=0;t<d;++t)f=Math.max(f,Math.abs(y[0][t]-y[1][t]));if(Math.abs(y[0].fx-y[d].fx)<o&&f<a)break;for(let t=0;t<d;++t){p[t]=0;for(let e=0;e<d;++e)p[t]+=y[e][t];p[t]/=d}const e=y[d];if(D(m,1+l,p,-l,e),m.fx=t(m),m.fx<y[0].fx)D(b,1+c,p,-c,e),b.fx=t(b),b.fx<m.fx?g(b):g(m);else if(m.fx>=y[d-1].fx){let n=!1;if(m.fx>e.fx?(D(v,1+h,p,-h,e),v.fx=t(v),v.fx<e.fx?g(v):n=!0):(D(v,1-h*l,p,h*l,e),v.fx=t(v),v.fx<m.fx?g(v):n=!0),n){if(u>=1)break;for(let e=1;e<y.length;++e)D(y[e],1-u,y[0],u,y[e]),y[e].fx=t(y[e])}}else g(m)}return y.sort(x),{fx:y[0].fx,x:y[0]}}function O(t,e,n,s,i,r,o){const a=n.fx,l=z(n.fxprime,e);let c=a,h=a,u=l,f=0;function d(h,f,d){for(let y=0;y<16;++y)if(i=(h+f)/2,D(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=z(s.fxprime,e),c>a+r*i*l||c>=d)f=i;else{if(Math.abs(u)<=-o*l)return i;u*(f-h)>=0&&(f=h),h=i,d=c}return 0}i=i||1,r=r||1e-6,o=o||.1;for(let y=0;y<10;++y){if(D(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=z(s.fxprime,e),c>a+r*i*l||y&&c>=h)return d(f,i,h);if(Math.abs(u)<=-o*l)return i;if(u>=0)return d(i,f,c);h=c,f=i,i*=2}return i}function F(t,e,n){let s={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let o,a,l,c=1;l=(n=n||{}).maxIterations||20*e.length,s.fx=t(s.x,s.fxprime),o=s.fxprime.slice(),R(o,s.fxprime,-1);for(let h=0;h<l;++h){if(c=O(t,o,s,i,c),n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),c){D(r,1,i.fxprime,-1,s.fxprime);const t=z(s.fxprime,s.fxprime);D(o,Math.max(0,z(r,i.fxprime)/t),o,-1,i.fxprime),a=s,s=i,i=a}else R(o,s.fxprime,-1);if(A(s.fxprime)<=1e-5)break}return n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),s}function C(t,e={}){e.maxIterations=e.maxIterations||500;const n=e.initialLayout||P,s=e.lossFunction||L,i=function(t,e={}){const n=e.distinct,s=t.map(t=>Object.assign({},t));function i(t){return t.join(";")}if(n){const t=new Map;for(const e of s)for(let n=0;n<e.sets.length;n++){const s=String(e.sets[n]);t.set(s,e.size+(t.get(s)||0));for(let i=n+1;i<e.sets.length;i++){const n=String(e.sets[i]),r=`${s};${n}`,o=`${n};${s}`;t.set(r,e.size+(t.get(r)||0)),t.set(o,e.size+(t.get(o)||0))}}for(const e of s)e.sets.length<3&&(e.size=t.get(i(e.sets)))}const r=[],o=new Set;for(const a of s)if(1===a.sets.length)r.push(a.sets[0]);else if(2===a.sets.length){const t=a.sets[0],e=a.sets[1];o.add(i(a.sets)),o.add(i([e,t]))}r.sort((t,e)=>t===e?0:t<e?-1:1);for(let a=0;a<r.length;++a){const t=r[a];for(let e=a+1;e<r.length;++e){const n=r[e];o.has(i([t,n]))||s.push({sets:[t,n],size:0})}}return s}(t,e),r=n(i,e),o=Object.keys(r),a=[];for(const c of o)a.push(r[c].x),a.push(r[c].y);const l=N(t=>{const e={};for(let n=0;n<o.length;++n){const s=o[n];e[s]={x:t[2*n],y:t[2*n+1],radius:r[s].radius}}return s(e,i)},a,e).x;for(let c=0;c<o.length;++c){const t=o[c];r[t].x=l[2*c],r[t].y=l[2*c+1]}return r}const $=1e-10;function j(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+$?Math.abs(t-e):function(t,e,n,s){const i=(s=s||{}).maxIterations||100,r=s.tolerance||1e-10,o=t(e),a=t(n);let l=n-e;if(o*a>0)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===a)return n;for(let c=0;c<i;++c){l/=2;const n=e+l,s=t(n);if(s*o>=0&&(e=n),Math.abs(l)<r||0===s)return n}return e+l}(s=>w(t,e,s)-n,0,t+e)}function P(t,e={}){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:L,s={},i={};for(const u of t)if(1===u.sets.length){const t=u.sets[0];s[t]={x:1e10,y:1e10,rowid:s.length,size:u.size,radius:Math.sqrt(u.size/Math.PI)},i[t]=[]}t=t.filter(t=>2===t.sets.length);for(const u of t){let t=null!=u.weight?u.weight:1;const e=u.sets[0],n=u.sets[1];u.size+$>=Math.min(s[e].size,s[n].size)&&(t=0),i[e].push({set:n,size:u.size,weight:t}),i[n].push({set:e,size:u.size,weight:t})}const r=[];function o(t,e){return e.size-t.size}Object.keys(i).forEach(t=>{let e=0;for(let n=0;n<i[t].length;++n)e+=i[t][n].size*i[t][n].weight;r.push({set:t,size:e})}),r.sort(o);const a={};function l(t){return t.set in a}function c(t,e){s[e].x=t.x,s[e].y=t.y,a[e]=!0}c({x:0,y:0},r[0].set);for(let u=1;u<r.length;++u){const e=r[u].set,a=i[e].filter(l),f=s[e];if(a.sort(o),0===a.length)throw"ERROR: missing pairwise overlap information";const d=[];for(var h=0;h<a.length;++h){const t=s[a[h].set],e=j(f.radius,t.radius,a[h].size);d.push({x:t.x+e,y:t.y}),d.push({x:t.x-e,y:t.y}),d.push({y:t.y+e,x:t.x}),d.push({y:t.y-e,x:t.x});for(let n=h+1;n<a.length;++n){const i=s[a[n].set],r=j(f.radius,i.radius,a[n].size),o=_({x:t.x,y:t.y,radius:e},{x:i.x,y:i.y,radius:r});d.push(...o)}}let y=1e50,g=d[0];for(const i of d){s[e].x=i.x,s[e].y=i.y;const r=n(s,t);r<y&&(y=r,g=i)}c(g,e)}return s}(t,e);const s=e.lossFunction||L;if(t.length>=8){const i=function(t,e={}){const n=e.restarts||10,s=[],i={};for(const f of t)1===f.sets.length&&(i[f.sets[0]]=s.length,s.push(f));let{distances:r,constraints:o}=function(t,e,n){const s=T(e.length,e.length),i=T(e.length,e.length);return t.filter(t=>2===t.sets.length).forEach(t=>{const r=n[t.sets[0]],o=n[t.sets[1]],a=j(Math.sqrt(e[r].size/Math.PI),Math.sqrt(e[o].size/Math.PI),t.size);s[r][o]=s[o][r]=a;let l=0;t.size+1e-10>=Math.min(e[r].size,e[o].size)?l=1:t.size<=1e-10&&(l=-1),i[r][o]=i[o][r]=l}),{distances:s,constraints:i}}(t,s,i);const a=A(r.map(A))/r.length;r=r.map(t=>t.map(t=>t/a));const l=(t,e)=>function(t,e,n,s){for(let r=0;r<e.length;++r)e[r]=0;let i=0;for(let r=0;r<n.length;++r){const o=t[2*r],a=t[2*r+1];for(let l=r+1;l<n.length;++l){const c=t[2*l],h=t[2*l+1],u=n[r][l],f=s[r][l],d=(c-o)*(c-o)+(h-a)*(h-a),y=Math.sqrt(d),g=d-u*u;f>0&&y<=u||f<0&&y>=u||(i+=2*g*g,e[2*r]+=4*g*(o-c),e[2*r+1]+=4*g*(a-h),e[2*l]+=4*g*(c-o),e[2*l+1]+=4*g*(h-a))}}return i}(t,e,r,o);let c=null;for(let f=0;f<n;++f){const t=F(l,E(2*r.length).map(Math.random),e);(!c||t.fx<c.fx)&&(c=t)}const h=c.x,u={};for(let f=0;f<s.length;++f){const t=s[f];u[t.sets[0]]={x:h[2*f]*a,y:h[2*f+1]*a,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(const f of e.history)R(f.x,a);return u}(t,e);s(i,t)+1e-8<s(n,t)&&(n=i)}return n}function L(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=w(n.radius,i.radius,k(n,i))}else e=I(s.sets.map(e=>t[e]));n+=(null!=s.weight?s.weight:1)*(e-s.size)*(e-s.size)}return n}function q(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=w(n.radius,i.radius,k(n,i))}else e=I(s.sets.map(e=>t[e]));const i=null!=s.weight?s.weight:1,r=Math.log((e+1)/(s.size+1));n+=i*r*r}return n}function U(t,e,n){if(null==n?t.sort((t,e)=>e.radius-t.radius):t.sort(n),t.length>0){const e=t[0].x,n=t[0].y;for(const s of t)s.x-=e,s.y-=n}if(2===t.length){k(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y)}if(t.length>1){const n=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(n),i=Math.sin(n);for(const e of t){const t=e.x,n=e.y;e.x=s*t-i*n,e.y=i*t+s*n}}if(t.length>2){let n=Math.atan2(t[2].x,t[2].y)-e;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(const n of t){var s=(n.x+e*n.y)/(1+e*e);n.x=2*s-n.x,n.y=2*s*e-n.y}}}}function B(t){const e=e=>({max:t.reduce((t,n)=>Math.max(t,n[e]+n.radius),Number.NEGATIVE_INFINITY),min:t.reduce((t,n)=>Math.min(t,n[e]-n.radius),Number.POSITIVE_INFINITY)});return{xRange:e("x"),yRange:e("y")}}function G(t,e,n){null==e&&(e=Math.PI/2);let s=X(t).map(t=>Object.assign({},t));const i=function(t){function e(t){return t.parent!==t&&(t.parent=e(t.parent)),t.parent}function n(t,n){const s=e(t),i=e(n);s.parent=i}t.forEach(t=>{t.parent=t});for(let i=0;i<t.length;++i)for(let e=i+1;e<t.length;++e){const s=t[i].radius+t[e].radius;k(t[i],t[e])+1e-10<s&&n(t[e],t[i])}const s=new Map;for(let i=0;i<t.length;++i){const n=e(t[i]).parent.setid;s.has(n)||s.set(n,[]),s.get(n).push(t[i])}return t.forEach(t=>{delete t.parent}),Array.from(s.values())}(s);for(const c of i){U(c,e,n);const t=B(c);c.size=(t.xRange.max-t.xRange.min)*(t.yRange.max-t.yRange.min),c.bounds=t}i.sort((t,e)=>e.size-t.size),s=i[0];let r=s.bounds;const o=(r.xRange.max-r.xRange.min)/50;function a(t,e,n){if(!t)return;const i=t.bounds;let a,l;if(e)a=r.xRange.max-i.xRange.min+o;else{a=r.xRange.max-i.xRange.max;const t=(i.xRange.max-i.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;t<0&&(a+=t)}if(n)l=r.yRange.max-i.yRange.min+o;else{l=r.yRange.max-i.yRange.max;const t=(i.yRange.max-i.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;t<0&&(l+=t)}for(const r of t)r.x+=a,r.y+=l,s.push(r)}let l=1;for(;l<i.length;)a(i[l],!0,!1),a(i[l+1],!1,!0),a(i[l+2],!0,!0),l+=3,r=B(s);return W(s)}function V(t,e,n,s,i){const r=X(t);e-=2*s,n-=2*s;const{xRange:o,yRange:a}=B(r);if(o.max===o.min||a.max===a.min)return t;let l,c;if(i){const t=2*Math.sqrt(i/Math.PI);l=e/t,c=n/t}else l=e/(o.max-o.min),c=n/(a.max-a.min);const h=Math.min(c,l),u=(e-(o.max-o.min)*h)/2,f=(n-(a.max-a.min)*h)/2;return W(r.map(t=>({radius:h*t.radius,x:s+u+(t.x-o.min)*h,y:s+f+(t.y-a.min)*h,setid:t.setid})))}function W(t){const e={};for(const n of t)e[n.setid]=n;return e}function X(t){return Object.keys(t).map(e=>Object.assign(t[e],{setid:e}))}function Y(t={}){let e=!1,n=600,s=350,i=15,r=1e3,o=Math.PI/2,a=!0,l=null,c=!0,h=!0,u=null,f=null,d=!1,y=null,g=!(!t||!t.symmetricalTextCentre)&&t.symmetricalTextCentre,x={},p=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],m=0,v=function(t){if(t in x)return x[t];var e=x[t]=p[m];return m+=1,m>=p.length&&(m=0),e},b=C,I=L;function M(x){let p=x.datum();const m=new Set;p.forEach(t=>{0==t.size&&1==t.sets.length&&m.add(t.sets[0])}),p=p.filter(t=>!t.sets.some(t=>m.has(t)));let M={},k={};if(p.length>0){let t=b(p,{lossFunction:I,distinct:d});a&&(t=G(t,o,f)),M=V(t,n,s,i,l),k=J(M,p,g)}const w={};function _(t){return t.sets in w?w[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}p.forEach(t=>{t.label&&(w[t.sets]=t.label)}),x.selectAll("svg").data([M]).enter().append("svg");const S=x.select("svg");e?S.attr("viewBox",`0 0 ${n} ${s}`):S.attr("width",n).attr("height",s);const E={};let T=!1;function z(t){return e=>et(t.sets.map(t=>{let i=E[t],r=M[t];return i||(i={x:n/2,y:s/2,radius:1}),r||(r={x:n/2,y:s/2,radius:1}),{x:i.x*(1-e)+r.x*e,y:i.y*(1-e)+r.y*e,radius:i.radius*(1-e)+r.radius*e}}),y)}S.selectAll(".venn-area path").each(function(t){const e=this.getAttribute("d");1==t.sets.length&&e&&!d&&(T=!0,E[t.sets[0]]=function(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}(e))});const A=S.selectAll(".venn-area").data(p,t=>t.sets),R=A.enter().append("g").attr("class",t=>`venn-area venn-${1==t.sets.length?"circle":"intersection"}${t.colour||t.color?" venn-coloured":""}`).attr("data-venn-sets",t=>t.sets.join("_")),D=R.append("path"),N=R.append("text").attr("class","label").text(t=>_(t)).attr("text-anchor","middle").attr("dy",".35em").attr("x",n/2).attr("y",s/2);function O(t){return"function"==typeof t.transition?t.transition("venn").duration(r):t}h&&(D.style("fill-opacity","0").filter(t=>1==t.sets.length).style("fill",t=>t.colour?t.colour:t.color?t.color:v(t.sets)).style("fill-opacity",".25"),N.style("fill",e=>e.colour||e.color?"#FFF":t.textFill?t.textFill:1==e.sets.length?v(e.sets):"#444"));let F=x;T&&"function"==typeof F.transition?(F=O(x),F.selectAll("path").attrTween("d",z)):F.selectAll("path").attr("d",t=>et(t.sets.map(t=>M[t])),y);const C=F.selectAll("text").filter(t=>t.sets in k).text(t=>_(t)).attr("x",t=>Math.floor(k[t.sets].x)).attr("y",t=>Math.floor(k[t.sets].y));c&&(T?"on"in C?C.on("end",K(M,_)):C.each("end",K(M,_)):C.each(K(M,_)));const $=O(A.exit()).remove();"function"==typeof A.transition&&$.selectAll("path").attrTween("d",z);const j=$.selectAll("text").attr("x",n/2).attr("y",s/2);return null!==u&&(N.style("font-size","0px"),C.style("font-size",u),j.style("font-size","0px")),{circles:M,textCentres:k,nodes:A,enter:R,update:F,exit:$}}return M.wrap=function(t){return arguments.length?(c=t,M):c},M.useViewBox=function(){return e=!0,M},M.width=function(t){return arguments.length?(n=t,M):n},M.height=function(t){return arguments.length?(s=t,M):s},M.padding=function(t){return arguments.length?(i=t,M):i},M.distinct=function(t){return arguments.length?(d=t,M):d},M.colours=function(t){return arguments.length?(v=t,M):v},M.colors=function(t){return arguments.length?(v=t,M):v},M.fontSize=function(t){return arguments.length?(u=t,M):u},M.round=function(t){return arguments.length?(y=t,M):y},M.duration=function(t){return arguments.length?(r=t,M):r},M.layoutFunction=function(t){return arguments.length?(b=t,M):b},M.normalize=function(t){return arguments.length?(a=t,M):a},M.scaleToFit=function(t){return arguments.length?(l=t,M):l},M.styled=function(t){return arguments.length?(h=t,M):h},M.orientation=function(t){return arguments.length?(o=t,M):o},M.orientationOrder=function(t){return arguments.length?(f=t,M):f},M.lossFunction=function(t){return arguments.length?(I="default"===t?L:"logRatio"===t?q:t,M):I},M}function K(t,e){return function(n){const s=this,i=t[n.sets[0]].radius||50,r=e(n)||"",o=r.split(/\s+/).reverse(),a=(r.length+o.length)/3;let l=o.pop(),c=[l],h=0;s.textContent=null;const u=[];function f(t){const e=s.ownerDocument.createElementNS(s.namespaceURI,"tspan");return e.textContent=t,u.push(e),s.append(e),e}let d=f(l);for(;l=o.pop(),l;){c.push(l);const t=c.join(" ");d.textContent=t,t.length>a&&d.getComputedTextLength()>i&&(c.pop(),d.textContent=c.join(" "),c=[l],d=f(l),h++)}const y=.35-1.1*h/2,g=s.getAttribute("x"),x=s.getAttribute("y");u.forEach((t,e)=>{t.setAttribute("x",g),t.setAttribute("y",x),t.setAttribute("dy",`${y+1.1*e}em`)})}}function Z(t,e,n){let s=e[0].radius-k(e[0],t);for(let i=1;i<e.length;++i){const n=e[i].radius-k(e[i],t);n<=s&&(s=n)}for(let i=0;i<n.length;++i){const e=k(n[i],t)-n[i].radius;e<=s&&(s=e)}return s}function H(t,e,n){const s=[];for(const h of t)s.push({x:h.x,y:h.y}),s.push({x:h.x+h.radius/2,y:h.y}),s.push({x:h.x-h.radius/2,y:h.y}),s.push({x:h.x,y:h.y+h.radius/2}),s.push({x:h.x,y:h.y-h.radius/2});let i=s[0],r=Z(s[0],t,e);for(let h=1;h<s.length;++h){const n=Z(s[h],t,e);n>=r&&(i=s[h],r=n)}const o=N(n=>-1*Z({x:n[0],y:n[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,a={x:n?0:o[0],y:o[1]};let l=!0;for(const h of t)if(k(a,h)>h.radius){l=!1;break}for(const h of e)if(k(a,h)<h.radius){l=!1;break}if(l)return a;if(1==t.length)return{x:t[0].x,y:t[0].y};const c={};return I(t,c),0===c.arcs.length?{x:0,y:-1e3,disjoint:!0}:1==c.arcs.length?{x:c.arcs[0].circle.x,y:c.arcs[0].circle.y}:e.length?H(t,[]):S(c.arcs.map(t=>t.p1))}function J(t,e,n){const s={},i=function(t){const e={},n=Object.keys(t);for(const s of n)e[s]=[];for(let s=0;s<n.length;s++){const i=n[s],r=t[i];for(let o=s+1;o<n.length;++o){const s=n[o],a=t[s],l=k(r,a);l+a.radius<=r.radius+1e-10?e[s].push(i):l+r.radius<=a.radius+1e-10&&e[i].push(s)}}return e}(t);for(let r=0;r<e.length;++r){const o=e[r].sets,a={},l={};for(let t=0;t<o.length;++t){a[o[t]]=!0;const e=i[o[t]];for(let t=0;t<e.length;++t)l[e[t]]=!0}const c=[],h=[];for(let e in t)e in a?c.push(t[e]):e in l||h.push(t[e]);const u=H(c,h,n);s[o]=u,u.disjoint&&e[r].size}return s}function Q(t){if(0===t.length)return[];const e={};return I(t,e),e.arcs}function tt(t,e){if(0===t.length)return"M 0 0";const n=Math.pow(10,e||0),s=null!=e?t=>Math.round(t*n)/n:t=>t;if(1==t.length){const e=t[0].circle;return function(t,e,n){const s=[];return s.push("\nM",t,e),s.push("\nm",-n,0),s.push("\na",n,n,0,1,0,2*n,0),s.push("\na",n,n,0,1,0,2*-n,0),s.join(" ")}(s(e.x),s(e.y),s(e.radius))}const i=["\nM",s(t[0].p2.x),s(t[0].p2.y)];for(const r of t){const t=s(r.circle.radius);i.push("\nA",t,t,0,r.large?1:0,r.sweep?1:0,s(r.p1.x),s(r.p1.y))}return i.join(" ")}function et(t,e){return tt(Q(t),e)}var nt=function(){var t=a(function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},"o"),e=[5,8],n=[7,8,11,12,17,19,22,24],s=[1,17],i=[1,18],r=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],o=[1,31],l=[1,39],c=[7,8,11,12,17,19,22,24,27],h=[1,57],u=[1,56],f=[1,58],d=[1,59],y=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],x={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:a(function(t,e,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return r[a-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:r[a-1].push(r[a]),this.$=r[a-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=r[a];break;case 8:s.setDiagramTitle(r[a].substr(6)),this.$=r[a].substr(6);break;case 9:s.addSubsetData([r[a]],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 10:s.addSubsetData([r[a-1]],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 11:s.addSubsetData([r[a-2]],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 12:s.addSubsetData([r[a-3]],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 13:if(r[a].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a]),s.addSubsetData(r[a],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 14:if(r[a-1].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-1]),s.addSubsetData(r[a-1],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 15:if(r[a-2].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-2]),s.addSubsetData(r[a-2],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 16:if(r[a-3].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-3]),s.addSubsetData(r[a-3],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 17:case 18:case 19:s.addTextData(r[a-1],r[a],void 0);break;case 20:case 21:s.addTextData(r[a-2],r[a-1],r[a]);break;case 23:s.addStyleData(r[a-1],r[a]);break;case 24:case 25:case 26:if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a],void 0);break;case 27:case 28:var l;if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a-1],r[a]);break;case 29:case 41:case 34:this.$=[r[a]];break;case 30:case 42:this.$=[...r[a-2],r[a]];break;case 31:this.$=[r[a-2],r[a]];break;case 33:this.$=r[a].join(" ")}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(n,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(n,[2,5]),t(n,[2,6]),t(n,[2,7]),t(n,[2,8]),{13:16,20:s,21:i},{13:20,18:19,20:s,21:i},{13:20,18:21,20:s,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:s,21:i},t(n,[2,9],{14:[1,27],15:[1,28]}),t(r,[2,43]),t(r,[2,44]),t(n,[2,13],{14:[1,29],15:[1,30],27:o}),t(r,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:o},t(n,[2,22]),t(n,[2,24],{14:[1,35]}),t(n,[2,25],{14:[1,36]}),t(n,[2,26]),{20:l,25:37,26:38,27:o},t(n,[2,10],{15:[1,40]}),{16:[1,41]},t(n,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:s,21:i},t(n,[2,17],{14:[1,45]}),t(n,[2,18],{14:[1,46]}),t(n,[2,19]),t(n,[2,27]),t(n,[2,28]),t(n,[2,23],{27:[1,47]}),t(c,[2,29]),{15:[1,48]},{16:[1,49]},t(n,[2,11]),{16:[1,50]},t(n,[2,15]),t(r,[2,42]),t(n,[2,20]),t(n,[2,21]),{20:l,26:51},{16:h,20:u,21:[1,53],28:52,29:54,30:55,31:f,32:d,33:y},t(n,[2,12]),t(n,[2,16]),t(c,[2,30]),t(c,[2,31]),t(c,[2,32]),t(c,[2,33],{30:61,16:h,20:u,31:f,32:d,33:y}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:a(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:a(function(t){var e=this,n=[0],s=[],i=[null],r=[],o=this.table,l="",c=0,h=0,u=r.slice.call(arguments,1),f=Object.create(this.lexer),d={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(d.yy[y]=this.yy[y]);f.setInput(t,d.yy),d.yy.lexer=f,d.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var g=f.yylloc;r.push(g);var x=f.options&&f.options.ranges;function p(){var t;return"number"!=typeof(t=s.pop()||f.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,a(function(t){n.length=n.length-2*t,i.length=i.length-t,r.length=r.length-t},"popStack"),a(p,"lex");for(var m,v,b,I,M,k,w,_,S={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==m&&(m=p()),b=o[v]&&o[v][m]),void 0===b||!b.length||!b[0]){var E="";for(M in _=[],o[v])this.terminals_[M]&&M>2&&_.push("'"+this.terminals_[M]+"'");E=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(E,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:g,expected:_})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+m);switch(b[0]){case 1:n.push(m),i.push(f.yytext),r.push(f.yylloc),n.push(b[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,g=f.yylloc;break;case 2:if(k=this.productions_[b[1]][1],S.$=i[i.length-k],S._$={first_line:r[r.length-(k||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(k||1)].first_column,last_column:r[r.length-1].last_column},x&&(S._$.range=[r[r.length-(k||1)].range[0],r[r.length-1].range[1]]),void 0!==(I=this.performAction.apply(S,[l,h,c,d.yy,b[1],i,r].concat(u))))return I;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),r=r.slice(0,-1*k)),n.push(this.productions_[b[1]][0]),i.push(S.$),r.push(S._$),w=o[n[n.length-2]][n[n.length-1]],n.push(w);break;case 3:return!0}}return!0},"parse")},p=function(){return{EOF:1,parseError:a(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:a(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:a(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:a(function(t){this.unput(this.match.slice(t))},"less"),pastInput:a(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:a(function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;var t,e,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((n=this._input.match(this.rules[i[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var t=this.next();return t||this.lex()},"lex"),begin:a(function(t){this.conditionStack.push(t)},"begin"),popState:a(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:a(function(t){this.begin(t)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(t,e,n,s){switch(n){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(t.getIndentMode&&t.getIndentMode())return t.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:t.setIndentMode&&t.setIndentMode(!1),this.begin("INITIAL"),this.unput(e.yytext);break;case 6:return this.begin("bol"),8;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(!t.consumeIndentText)return 19;t.consumeIndentText=!1;break;case 15:return 24;case 16:return e.yytext=e.yytext.slice(2,-2),14;case 17:return e.yytext=e.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}}}();function m(){this.yy={}}return x.lexer=p,a(m,"Parser"),m.prototype=x,x.Parser=m,new m}();nt.parser=nt;var st,it=nt,rt=[],ot=[],at=[],lt=new Set,ct=!1,ht=a((t,e,n)=>{const s=pt(t).sort(),i=n??10/Math.pow(t.length,2);st=s,1===s.length&<.add(s[0]),rt.push({sets:s,size:i,label:e?ft(e):void 0})},"addSubsetData"),ut=a(()=>rt,"getSubsetData"),ft=a(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),dt=a(t=>t?ft(t):t,"normalizeStyleValue"),yt=a((t,e,n)=>{const s=ft(e);ot.push({sets:pt(t).sort(),id:s,label:n?ft(n):void 0})},"addTextData"),gt=a((t,e)=>{const n=pt(t).sort(),s={};for(const[i,r]of e)s[i]=dt(r)??r;at.push({targets:n,styles:s})},"addStyleData"),xt=a(()=>at,"getStyleData"),pt=a(t=>t.map(t=>ft(t)),"normalizeIdentifierList"),mt=a(t=>{const e=pt(t).filter(t=>!lt.has(t));if(e.length>0)throw new Error(`unknown set identifier: ${e.join(", ")}`)},"validateUnionIdentifiers"),vt=a(()=>ot,"getTextData"),bt=a(()=>st,"getCurrentSets"),It=a(()=>ct,"getIndentMode"),Mt=a(t=>{ct=t},"setIndentMode"),kt=m.venn;function wt(){return p(kt,l().venn)}a(wt,"getConfig");var _t={getConfig:wt,clear:a(()=>{x(),rt.length=0,ot.length=0,at.length=0,lt.clear(),st=void 0,ct=!1},"customClear"),setAccTitle:o,getAccTitle:r,setDiagramTitle:i,getDiagramTitle:s,getAccDescription:n,setAccDescription:e,addSubsetData:ht,getSubsetData:ut,addTextData:yt,addStyleData:gt,validateUnionIdentifiers:mt,getTextData:vt,getStyleData:xt,getCurrentSets:bt,getIndentMode:It,setIndentMode:Mt},St=a(t=>`\n .venn-title {\n font-size: 32px;\n fill: ${t.vennTitleTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-circle text {\n font-size: 48px;\n font-family: ${t.fontFamily};\n }\n\n .venn-intersection text {\n font-size: 48px;\n fill: ${t.vennSetTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-text-node {\n font-family: ${t.fontFamily};\n color: ${t.vennSetTextColor};\n }\n`,"getStyles");function Et(t){const e=new Map;for(const n of t){const t=n.targets.join("|"),s=e.get(t);s?Object.assign(s,n.styles):e.set(t,{...n.styles})}return e}a(Et,"buildStyleByKey");var Tt=a((t,e,n,s)=>{var i,r,o;const a=s.db,x=null==(i=a.getConfig)?void 0:i.call(a),{themeVariables:p,look:m,handDrawnSeed:b}=l(),I="handDrawn"===m,M=[p.venn1,p.venn2,p.venn3,p.venn4,p.venn5,p.venn6,p.venn7,p.venn8].filter(Boolean),k=null==(r=a.getDiagramTitle)?void 0:r.call(a),w=a.getSubsetData(),_=a.getTextData(),S=Et(a.getStyleData()),E=Rt(w),T=(null==x?void 0:x.width)??800,z=(null==x?void 0:x.height)??450,A=T/1600,R=k?48*A:0,D=p.primaryTextColor??p.textColor,N=c(e);N.attr("viewBox",`0 0 ${T} ${z}`),k&&N.append("text").text(k).attr("class","venn-title").attr("font-size",32*A+"px").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*A).style("fill",p.vennTitleTextColor||p.titleColor);const O=h(document.createElement("div")),F=Y().width(T).height(z-R);O.datum(E).call(F);const $=I?u.svg(O.select("svg").node()):void 0,j=function(t,e={}){const{lossFunction:n,layoutFunction:s=C,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:a=600,height:l=350,padding:c=15,scaleToFit:h=!1,symmetricalTextCentre:u=!1,distinct:f,round:d=2}=e;let y=s(t,{lossFunction:"default"!==n&&n?"logRatio"===n?q:n:L,distinct:f});i&&(y=G(y,r,o));const g=V(y,a,l,c,h),x=J(g,t,u),p=new Map(Object.keys(g).map(t=>[t,{set:t,x:g[t].x,y:g[t].y,radius:g[t].radius}])),m=t.map(t=>{const e=t.sets.map(t=>p.get(t)),n=Q(e);return{circles:e,arcs:n,path:tt(n,d),area:t,has:new Set(t.sets)}});function v(t){let e="";for(const n of m)n.has.size>t.length&&t.every(t=>n.has.has(t))&&(e+=" "+n.path);return e}return m.map(({circles:t,arcs:e,path:n,area:s})=>({data:s,text:x[s.sets],circles:t,arcs:e,path:n,distinctPath:n+v(s.sets)}))}(E,{width:T,height:z-R,padding:(null==x?void 0:x.padding)??15}),P=new Map;for(const l of j){const t=zt([...l.data.sets].sort());P.set(t,l)}_.length>0&&At(x,P,O,_,A,S);const U=f(p.background||"#f4f4f4");O.selectAll(".venn-circle").each(function(t,e){var n;const s=h(this),i=zt([...t.sets].sort()),r=S.get(i),o=(null==r?void 0:r.fill)||M[e%M.length]||p.primaryColor;s.classed("venn-set-"+e%8,!0);const a=(null==r?void 0:r["fill-opacity"])??.1,l=(null==r?void 0:r.stroke)||o,c=(null==r?void 0:r["stroke-width"])||""+5*A;if(I&&$){const t=P.get(i);if(t&&t.circles.length>0){const i=t.circles[0],r=$.circle(i.x,i.y,2*i.radius,{roughness:.7,seed:b,fill:v(o,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:60*e-41,stroke:l,strokeWidth:parseFloat(String(c))});s.select("path").remove(),null==(n=s.node())||n.insertBefore(r,s.select("text").node())}}else s.select("path").style("fill",o).style("fill-opacity",a).style("stroke",l).style("stroke-width",c).style("stroke-opacity",.95);const u=(null==r?void 0:r.color)||(U?d(o,30):y(o,30));s.select("text").style("font-size",48*A+"px").style("fill",u)}),I&&$?O.selectAll(".venn-intersection").each(function(t){var e;const n=h(this),s=zt([...t.sets].sort()),i=S.get(s),r=null==i?void 0:i.fill;if(r){const t=n.select("path"),s=t.attr("d");if(s){const n=$.path(s,{roughness:.7,seed:b,fill:v(r,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),i=t.node();null==(e=null==i?void 0:i.parentNode)||e.insertBefore(n,i),t.remove()}}else n.select("path").style("fill-opacity",0);n.select("text").style("font-size",48*A+"px").style("fill",(null==i?void 0:i.color)??p.vennSetTextColor??D)}):(O.selectAll(".venn-intersection text").style("font-size",48*A+"px").style("fill",t=>{var e;const n=zt([...t.sets].sort());return(null==(e=S.get(n))?void 0:e.color)??p.vennSetTextColor??D}),O.selectAll(".venn-intersection path").style("fill-opacity",t=>{var e;const n=zt([...t.sets].sort());return(null==(e=S.get(n))?void 0:e.fill)?1:0}).style("fill",t=>{var e;const n=zt([...t.sets].sort());return(null==(e=S.get(n))?void 0:e.fill)??"transparent"}));const B=N.append("g").attr("transform",`translate(0, ${R})`),W=O.select("svg").node();if(W&&"childNodes"in W)for(const l of[...W.childNodes])null==(o=B.node())||o.appendChild(l);g(N,z,T,(null==x?void 0:x.useMaxWidth)??!0)},"draw");function zt(t){return t.join("|")}function At(t,e,n,s,i,r){var o;const a=(null==t?void 0:t.useDebugLayout)??!1,l=n.select("svg").append("g").attr("class","venn-text-nodes"),c=new Map;for(const h of s){const t=zt(h.sets),e=c.get(t);e?e.push(h):c.set(t,[h])}for(const[h,u]of c.entries()){const t=e.get(h);if(!(null==t?void 0:t.text))continue;const n=t.text.x,s=t.text.y,c=Math.min(...t.circles.map(t=>t.radius)),f=Math.min(...t.circles.map(t=>t.radius-Math.hypot(n-t.x,s-t.y)));let d=Number.isFinite(f)?Math.max(0,f):0;0===d&&Number.isFinite(c)&&(d=.6*c);const y=l.append("g").attr("class","venn-text-area").attr("font-size",40*i+"px");a&&y.append("circle").attr("class","venn-text-debug-circle").attr("cx",n).attr("cy",s).attr("r",d).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const g=Math.max(80*i,2*d*.95),x=Math.max(60*i,2*d*.95),p=(t.data.label&&t.data.label.length>0?Math.min(32*i,.25*d):0)+(u.length<=2?30*i:0),m=n-g/2,v=s-x/2+p,b=Math.max(1,Math.ceil(Math.sqrt(u.length))),I=g/b,M=x/Math.max(1,Math.ceil(u.length/b));for(const[e,l]of u.entries()){const t=e%b,n=Math.floor(e/b),s=m+I*(t+.5),c=v+M*(n+.5);a&&y.append("rect").attr("class","venn-text-debug-cell").attr("x",m+I*t).attr("y",v+M*n).attr("width",I).attr("height",M).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const h=.9*I,u=.9*M,f=y.append("foreignObject").attr("class","venn-text-node-fo").attr("width",h).attr("height",u).attr("x",s-h/2).attr("y",c-u/2).attr("overflow","visible"),d=null==(o=r.get(l.id))?void 0:o.color,g=f.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(l.label??l.id);d&&g.style("color",d)}}}function Rt(t){const e=new Set(t.map(t=>[...t.sets].sort().join("|"))),n=new Map(t.filter(t=>1===t.sets.length&&void 0!==t.size).map(t=>[t.sets[0],t.size])),s=[];for(const i of t){if(i.sets.length<3)continue;const t=[...i.sets].sort();for(let i=0;i<t.length-1;i++)for(let r=i+1;r<t.length;r++){const o=[t[i],t[r]],a=o.join("|");if(!e.has(a)){e.add(a);const t=n.get(o[0]),i=n.get(o[1]),r=void 0!==t&&void 0!==i?Math.min(t,i)/4:2.5;s.push({sets:o,size:r,label:""})}}}return s.length>0?[...t,...s]:t}a(zt,"stableSetsKey"),a(At,"renderTextNodes"),a(Rt,"ensurePairwiseSubsets");var Dt={parser:it,db:_t,renderer:{draw:Tt},styles:St};export{Dt as diagram};
|
|
1
|
+
import{b3 as t,s as e,g as n,p as s,o as i,a as r,b as o,_ as a,z as l,F as c,d as h,ak as u,a9 as f,aa as d,ab as y,e as g,q as x,B as p,D as m}from"./mermaid.core-DQSlETG7.js";import"./index-AdB8XHXv.js";const v=(e,n)=>t(e,"a",-n),b=1e-10;function I(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let s=n+1;s<t.length;++s){const i=_(t[n],t[s]);for(const t of i)t.parentIndex=[n,s],e.push(t)}return e}(t),s=n.filter(e=>function(t,e){return e.every(e=>k(t,e)<e.radius+b)}(e,t));let i=0,r=0;const o=[];if(s.length>1){const e=S(s);for(let t=0;t<s.length;++t){const n=s[t];n.angle=Math.atan2(n.x-e.x,n.y-e.y)}s.sort((t,e)=>e.angle-t.angle);let n=s[s.length-1];for(let a=0;a<s.length;++a){const e=s[a];r+=(n.x+e.x)*(e.y-n.y);const l={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let c=null;for(let s=0;s<e.parentIndex.length;++s)if(n.parentIndex.includes(e.parentIndex[s])){const i=t[e.parentIndex[s]],r=Math.atan2(e.x-i.x,e.y-i.y),o=Math.atan2(n.x-i.x,n.y-i.y);let a=o-r;a<0&&(a+=2*Math.PI);const h=o-a/2;let u=k(l,{x:i.x+i.radius*Math.sin(h),y:i.y+i.radius*Math.cos(h)});u>2*i.radius&&(u=2*i.radius),(null==c||c.width>u)&&(c={circle:i,width:u,p1:e,p2:n,large:u>i.radius,sweep:!0})}null!=c&&(o.push(c),i+=M(c.circle.radius,c.width),n=e)}}else{let e=t[0];for(let s=1;s<t.length;++s)t[s].radius<e.radius&&(e=t[s]);let n=!1;for(let s=0;s<t.length;++s)if(k(t[s],e)>Math.abs(e.radius-t[s].radius)){n=!0;break}n?i=r=0:(i=e.radius*e.radius*Math.PI,o.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-b,y:e.y+e.radius},width:2*e.radius,large:!0,sweep:!0}))}return r/=2,e&&(e.area=i+r,e.arcArea=i,e.polygonArea=r,e.arcs=o,e.innerPoints=s,e.intersectionPoints=n),i+r}function M(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function k(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function w(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(n*n-t*t+e*e)/(2*n);return M(t,t-(n*n-e*e+t*t)/(2*n))+M(e,s)}function _(t,e){const n=k(t,e),s=t.radius,i=e.radius;if(n>=s+i||n<=Math.abs(s-i))return[];const r=(s*s-i*i+n*n)/(2*n),o=Math.sqrt(s*s-r*r),a=t.x+r*(e.x-t.x)/n,l=t.y+r*(e.y-t.y)/n,c=-(e.y-t.y)*(o/n),h=-(e.x-t.x)*(o/n);return[{x:a+c,y:l-h},{x:a-c,y:l+h}]}function S(t){const e={x:0,y:0};for(const n of t)e.x+=n.x,e.y+=n.y;return e.x/=t.length,e.y/=t.length,e}function E(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function T(t,e){return E(t).map(()=>E(e))}function z(t,e){let n=0;for(let s=0;s<t.length;++s)n+=t[s]*e[s];return n}function A(t){return Math.sqrt(z(t,t))}function R(t,e,n){for(let s=0;s<e.length;++s)t[s]=e[s]*n}function D(t,e,n,s,i){for(let r=0;r<t.length;++r)t[r]=e*n[r]+s*i[r]}function N(t,e,n){const s=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,r=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,a=n.minErrorDelta||1e-5,l=void 0!==n.rho?n.rho:1,c=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,u=void 0!==n.sigma?n.sigma:.5;let f;const d=e.length,y=new Array(d+1);y[0]=e,y[0].fx=t(e),y[0].id=0;for(let I=0;I<d;++I){const n=e.slice();n[I]=n[I]?n[I]*i:r,y[I+1]=n,y[I+1].fx=t(n),y[I+1].id=I+1}function g(t){for(let e=0;e<t.length;e++)y[d][e]=t[e];y[d].fx=t.fx}const x=(t,e)=>t.fx-e.fx,p=e.slice(),m=e.slice(),v=e.slice(),b=e.slice();for(let I=0;I<s;++I){if(y.sort(x),n.history){const t=y.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:y[0].slice(),fx:y[0].fx,simplex:t})}f=0;for(let t=0;t<d;++t)f=Math.max(f,Math.abs(y[0][t]-y[1][t]));if(Math.abs(y[0].fx-y[d].fx)<o&&f<a)break;for(let t=0;t<d;++t){p[t]=0;for(let e=0;e<d;++e)p[t]+=y[e][t];p[t]/=d}const e=y[d];if(D(m,1+l,p,-l,e),m.fx=t(m),m.fx<y[0].fx)D(b,1+c,p,-c,e),b.fx=t(b),b.fx<m.fx?g(b):g(m);else if(m.fx>=y[d-1].fx){let n=!1;if(m.fx>e.fx?(D(v,1+h,p,-h,e),v.fx=t(v),v.fx<e.fx?g(v):n=!0):(D(v,1-h*l,p,h*l,e),v.fx=t(v),v.fx<m.fx?g(v):n=!0),n){if(u>=1)break;for(let e=1;e<y.length;++e)D(y[e],1-u,y[0],u,y[e]),y[e].fx=t(y[e])}}else g(m)}return y.sort(x),{fx:y[0].fx,x:y[0]}}function O(t,e,n,s,i,r,o){const a=n.fx,l=z(n.fxprime,e);let c=a,h=a,u=l,f=0;function d(h,f,d){for(let y=0;y<16;++y)if(i=(h+f)/2,D(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=z(s.fxprime,e),c>a+r*i*l||c>=d)f=i;else{if(Math.abs(u)<=-o*l)return i;u*(f-h)>=0&&(f=h),h=i,d=c}return 0}i=i||1,r=r||1e-6,o=o||.1;for(let y=0;y<10;++y){if(D(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=z(s.fxprime,e),c>a+r*i*l||y&&c>=h)return d(f,i,h);if(Math.abs(u)<=-o*l)return i;if(u>=0)return d(i,f,c);h=c,f=i,i*=2}return i}function F(t,e,n){let s={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let o,a,l,c=1;l=(n=n||{}).maxIterations||20*e.length,s.fx=t(s.x,s.fxprime),o=s.fxprime.slice(),R(o,s.fxprime,-1);for(let h=0;h<l;++h){if(c=O(t,o,s,i,c),n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),c){D(r,1,i.fxprime,-1,s.fxprime);const t=z(s.fxprime,s.fxprime);D(o,Math.max(0,z(r,i.fxprime)/t),o,-1,i.fxprime),a=s,s=i,i=a}else R(o,s.fxprime,-1);if(A(s.fxprime)<=1e-5)break}return n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),s}function C(t,e={}){e.maxIterations=e.maxIterations||500;const n=e.initialLayout||P,s=e.lossFunction||L,i=function(t,e={}){const n=e.distinct,s=t.map(t=>Object.assign({},t));function i(t){return t.join(";")}if(n){const t=new Map;for(const e of s)for(let n=0;n<e.sets.length;n++){const s=String(e.sets[n]);t.set(s,e.size+(t.get(s)||0));for(let i=n+1;i<e.sets.length;i++){const n=String(e.sets[i]),r=`${s};${n}`,o=`${n};${s}`;t.set(r,e.size+(t.get(r)||0)),t.set(o,e.size+(t.get(o)||0))}}for(const e of s)e.sets.length<3&&(e.size=t.get(i(e.sets)))}const r=[],o=new Set;for(const a of s)if(1===a.sets.length)r.push(a.sets[0]);else if(2===a.sets.length){const t=a.sets[0],e=a.sets[1];o.add(i(a.sets)),o.add(i([e,t]))}r.sort((t,e)=>t===e?0:t<e?-1:1);for(let a=0;a<r.length;++a){const t=r[a];for(let e=a+1;e<r.length;++e){const n=r[e];o.has(i([t,n]))||s.push({sets:[t,n],size:0})}}return s}(t,e),r=n(i,e),o=Object.keys(r),a=[];for(const c of o)a.push(r[c].x),a.push(r[c].y);const l=N(t=>{const e={};for(let n=0;n<o.length;++n){const s=o[n];e[s]={x:t[2*n],y:t[2*n+1],radius:r[s].radius}}return s(e,i)},a,e).x;for(let c=0;c<o.length;++c){const t=o[c];r[t].x=l[2*c],r[t].y=l[2*c+1]}return r}const $=1e-10;function j(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+$?Math.abs(t-e):function(t,e,n,s){const i=(s=s||{}).maxIterations||100,r=s.tolerance||1e-10,o=t(e),a=t(n);let l=n-e;if(o*a>0)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===a)return n;for(let c=0;c<i;++c){l/=2;const n=e+l,s=t(n);if(s*o>=0&&(e=n),Math.abs(l)<r||0===s)return n}return e+l}(s=>w(t,e,s)-n,0,t+e)}function P(t,e={}){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:L,s={},i={};for(const u of t)if(1===u.sets.length){const t=u.sets[0];s[t]={x:1e10,y:1e10,rowid:s.length,size:u.size,radius:Math.sqrt(u.size/Math.PI)},i[t]=[]}t=t.filter(t=>2===t.sets.length);for(const u of t){let t=null!=u.weight?u.weight:1;const e=u.sets[0],n=u.sets[1];u.size+$>=Math.min(s[e].size,s[n].size)&&(t=0),i[e].push({set:n,size:u.size,weight:t}),i[n].push({set:e,size:u.size,weight:t})}const r=[];function o(t,e){return e.size-t.size}Object.keys(i).forEach(t=>{let e=0;for(let n=0;n<i[t].length;++n)e+=i[t][n].size*i[t][n].weight;r.push({set:t,size:e})}),r.sort(o);const a={};function l(t){return t.set in a}function c(t,e){s[e].x=t.x,s[e].y=t.y,a[e]=!0}c({x:0,y:0},r[0].set);for(let u=1;u<r.length;++u){const e=r[u].set,a=i[e].filter(l),f=s[e];if(a.sort(o),0===a.length)throw"ERROR: missing pairwise overlap information";const d=[];for(var h=0;h<a.length;++h){const t=s[a[h].set],e=j(f.radius,t.radius,a[h].size);d.push({x:t.x+e,y:t.y}),d.push({x:t.x-e,y:t.y}),d.push({y:t.y+e,x:t.x}),d.push({y:t.y-e,x:t.x});for(let n=h+1;n<a.length;++n){const i=s[a[n].set],r=j(f.radius,i.radius,a[n].size),o=_({x:t.x,y:t.y,radius:e},{x:i.x,y:i.y,radius:r});d.push(...o)}}let y=1e50,g=d[0];for(const i of d){s[e].x=i.x,s[e].y=i.y;const r=n(s,t);r<y&&(y=r,g=i)}c(g,e)}return s}(t,e);const s=e.lossFunction||L;if(t.length>=8){const i=function(t,e={}){const n=e.restarts||10,s=[],i={};for(const f of t)1===f.sets.length&&(i[f.sets[0]]=s.length,s.push(f));let{distances:r,constraints:o}=function(t,e,n){const s=T(e.length,e.length),i=T(e.length,e.length);return t.filter(t=>2===t.sets.length).forEach(t=>{const r=n[t.sets[0]],o=n[t.sets[1]],a=j(Math.sqrt(e[r].size/Math.PI),Math.sqrt(e[o].size/Math.PI),t.size);s[r][o]=s[o][r]=a;let l=0;t.size+1e-10>=Math.min(e[r].size,e[o].size)?l=1:t.size<=1e-10&&(l=-1),i[r][o]=i[o][r]=l}),{distances:s,constraints:i}}(t,s,i);const a=A(r.map(A))/r.length;r=r.map(t=>t.map(t=>t/a));const l=(t,e)=>function(t,e,n,s){for(let r=0;r<e.length;++r)e[r]=0;let i=0;for(let r=0;r<n.length;++r){const o=t[2*r],a=t[2*r+1];for(let l=r+1;l<n.length;++l){const c=t[2*l],h=t[2*l+1],u=n[r][l],f=s[r][l],d=(c-o)*(c-o)+(h-a)*(h-a),y=Math.sqrt(d),g=d-u*u;f>0&&y<=u||f<0&&y>=u||(i+=2*g*g,e[2*r]+=4*g*(o-c),e[2*r+1]+=4*g*(a-h),e[2*l]+=4*g*(c-o),e[2*l+1]+=4*g*(h-a))}}return i}(t,e,r,o);let c=null;for(let f=0;f<n;++f){const t=F(l,E(2*r.length).map(Math.random),e);(!c||t.fx<c.fx)&&(c=t)}const h=c.x,u={};for(let f=0;f<s.length;++f){const t=s[f];u[t.sets[0]]={x:h[2*f]*a,y:h[2*f+1]*a,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(const f of e.history)R(f.x,a);return u}(t,e);s(i,t)+1e-8<s(n,t)&&(n=i)}return n}function L(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=w(n.radius,i.radius,k(n,i))}else e=I(s.sets.map(e=>t[e]));n+=(null!=s.weight?s.weight:1)*(e-s.size)*(e-s.size)}return n}function q(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=w(n.radius,i.radius,k(n,i))}else e=I(s.sets.map(e=>t[e]));const i=null!=s.weight?s.weight:1,r=Math.log((e+1)/(s.size+1));n+=i*r*r}return n}function U(t,e,n){if(null==n?t.sort((t,e)=>e.radius-t.radius):t.sort(n),t.length>0){const e=t[0].x,n=t[0].y;for(const s of t)s.x-=e,s.y-=n}if(2===t.length){k(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y)}if(t.length>1){const n=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(n),i=Math.sin(n);for(const e of t){const t=e.x,n=e.y;e.x=s*t-i*n,e.y=i*t+s*n}}if(t.length>2){let n=Math.atan2(t[2].x,t[2].y)-e;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(const n of t){var s=(n.x+e*n.y)/(1+e*e);n.x=2*s-n.x,n.y=2*s*e-n.y}}}}function B(t){const e=e=>({max:t.reduce((t,n)=>Math.max(t,n[e]+n.radius),Number.NEGATIVE_INFINITY),min:t.reduce((t,n)=>Math.min(t,n[e]-n.radius),Number.POSITIVE_INFINITY)});return{xRange:e("x"),yRange:e("y")}}function G(t,e,n){null==e&&(e=Math.PI/2);let s=X(t).map(t=>Object.assign({},t));const i=function(t){function e(t){return t.parent!==t&&(t.parent=e(t.parent)),t.parent}function n(t,n){const s=e(t),i=e(n);s.parent=i}t.forEach(t=>{t.parent=t});for(let i=0;i<t.length;++i)for(let e=i+1;e<t.length;++e){const s=t[i].radius+t[e].radius;k(t[i],t[e])+1e-10<s&&n(t[e],t[i])}const s=new Map;for(let i=0;i<t.length;++i){const n=e(t[i]).parent.setid;s.has(n)||s.set(n,[]),s.get(n).push(t[i])}return t.forEach(t=>{delete t.parent}),Array.from(s.values())}(s);for(const c of i){U(c,e,n);const t=B(c);c.size=(t.xRange.max-t.xRange.min)*(t.yRange.max-t.yRange.min),c.bounds=t}i.sort((t,e)=>e.size-t.size),s=i[0];let r=s.bounds;const o=(r.xRange.max-r.xRange.min)/50;function a(t,e,n){if(!t)return;const i=t.bounds;let a,l;if(e)a=r.xRange.max-i.xRange.min+o;else{a=r.xRange.max-i.xRange.max;const t=(i.xRange.max-i.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;t<0&&(a+=t)}if(n)l=r.yRange.max-i.yRange.min+o;else{l=r.yRange.max-i.yRange.max;const t=(i.yRange.max-i.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;t<0&&(l+=t)}for(const r of t)r.x+=a,r.y+=l,s.push(r)}let l=1;for(;l<i.length;)a(i[l],!0,!1),a(i[l+1],!1,!0),a(i[l+2],!0,!0),l+=3,r=B(s);return W(s)}function V(t,e,n,s,i){const r=X(t);e-=2*s,n-=2*s;const{xRange:o,yRange:a}=B(r);if(o.max===o.min||a.max===a.min)return t;let l,c;if(i){const t=2*Math.sqrt(i/Math.PI);l=e/t,c=n/t}else l=e/(o.max-o.min),c=n/(a.max-a.min);const h=Math.min(c,l),u=(e-(o.max-o.min)*h)/2,f=(n-(a.max-a.min)*h)/2;return W(r.map(t=>({radius:h*t.radius,x:s+u+(t.x-o.min)*h,y:s+f+(t.y-a.min)*h,setid:t.setid})))}function W(t){const e={};for(const n of t)e[n.setid]=n;return e}function X(t){return Object.keys(t).map(e=>Object.assign(t[e],{setid:e}))}function Y(t={}){let e=!1,n=600,s=350,i=15,r=1e3,o=Math.PI/2,a=!0,l=null,c=!0,h=!0,u=null,f=null,d=!1,y=null,g=!(!t||!t.symmetricalTextCentre)&&t.symmetricalTextCentre,x={},p=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],m=0,v=function(t){if(t in x)return x[t];var e=x[t]=p[m];return m+=1,m>=p.length&&(m=0),e},b=C,I=L;function M(x){let p=x.datum();const m=new Set;p.forEach(t=>{0==t.size&&1==t.sets.length&&m.add(t.sets[0])}),p=p.filter(t=>!t.sets.some(t=>m.has(t)));let M={},k={};if(p.length>0){let t=b(p,{lossFunction:I,distinct:d});a&&(t=G(t,o,f)),M=V(t,n,s,i,l),k=J(M,p,g)}const w={};function _(t){return t.sets in w?w[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}p.forEach(t=>{t.label&&(w[t.sets]=t.label)}),x.selectAll("svg").data([M]).enter().append("svg");const S=x.select("svg");e?S.attr("viewBox",`0 0 ${n} ${s}`):S.attr("width",n).attr("height",s);const E={};let T=!1;function z(t){return e=>et(t.sets.map(t=>{let i=E[t],r=M[t];return i||(i={x:n/2,y:s/2,radius:1}),r||(r={x:n/2,y:s/2,radius:1}),{x:i.x*(1-e)+r.x*e,y:i.y*(1-e)+r.y*e,radius:i.radius*(1-e)+r.radius*e}}),y)}S.selectAll(".venn-area path").each(function(t){const e=this.getAttribute("d");1==t.sets.length&&e&&!d&&(T=!0,E[t.sets[0]]=function(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}(e))});const A=S.selectAll(".venn-area").data(p,t=>t.sets),R=A.enter().append("g").attr("class",t=>`venn-area venn-${1==t.sets.length?"circle":"intersection"}${t.colour||t.color?" venn-coloured":""}`).attr("data-venn-sets",t=>t.sets.join("_")),D=R.append("path"),N=R.append("text").attr("class","label").text(t=>_(t)).attr("text-anchor","middle").attr("dy",".35em").attr("x",n/2).attr("y",s/2);function O(t){return"function"==typeof t.transition?t.transition("venn").duration(r):t}h&&(D.style("fill-opacity","0").filter(t=>1==t.sets.length).style("fill",t=>t.colour?t.colour:t.color?t.color:v(t.sets)).style("fill-opacity",".25"),N.style("fill",e=>e.colour||e.color?"#FFF":t.textFill?t.textFill:1==e.sets.length?v(e.sets):"#444"));let F=x;T&&"function"==typeof F.transition?(F=O(x),F.selectAll("path").attrTween("d",z)):F.selectAll("path").attr("d",t=>et(t.sets.map(t=>M[t])),y);const C=F.selectAll("text").filter(t=>t.sets in k).text(t=>_(t)).attr("x",t=>Math.floor(k[t.sets].x)).attr("y",t=>Math.floor(k[t.sets].y));c&&(T?"on"in C?C.on("end",K(M,_)):C.each("end",K(M,_)):C.each(K(M,_)));const $=O(A.exit()).remove();"function"==typeof A.transition&&$.selectAll("path").attrTween("d",z);const j=$.selectAll("text").attr("x",n/2).attr("y",s/2);return null!==u&&(N.style("font-size","0px"),C.style("font-size",u),j.style("font-size","0px")),{circles:M,textCentres:k,nodes:A,enter:R,update:F,exit:$}}return M.wrap=function(t){return arguments.length?(c=t,M):c},M.useViewBox=function(){return e=!0,M},M.width=function(t){return arguments.length?(n=t,M):n},M.height=function(t){return arguments.length?(s=t,M):s},M.padding=function(t){return arguments.length?(i=t,M):i},M.distinct=function(t){return arguments.length?(d=t,M):d},M.colours=function(t){return arguments.length?(v=t,M):v},M.colors=function(t){return arguments.length?(v=t,M):v},M.fontSize=function(t){return arguments.length?(u=t,M):u},M.round=function(t){return arguments.length?(y=t,M):y},M.duration=function(t){return arguments.length?(r=t,M):r},M.layoutFunction=function(t){return arguments.length?(b=t,M):b},M.normalize=function(t){return arguments.length?(a=t,M):a},M.scaleToFit=function(t){return arguments.length?(l=t,M):l},M.styled=function(t){return arguments.length?(h=t,M):h},M.orientation=function(t){return arguments.length?(o=t,M):o},M.orientationOrder=function(t){return arguments.length?(f=t,M):f},M.lossFunction=function(t){return arguments.length?(I="default"===t?L:"logRatio"===t?q:t,M):I},M}function K(t,e){return function(n){const s=this,i=t[n.sets[0]].radius||50,r=e(n)||"",o=r.split(/\s+/).reverse(),a=(r.length+o.length)/3;let l=o.pop(),c=[l],h=0;s.textContent=null;const u=[];function f(t){const e=s.ownerDocument.createElementNS(s.namespaceURI,"tspan");return e.textContent=t,u.push(e),s.append(e),e}let d=f(l);for(;l=o.pop(),l;){c.push(l);const t=c.join(" ");d.textContent=t,t.length>a&&d.getComputedTextLength()>i&&(c.pop(),d.textContent=c.join(" "),c=[l],d=f(l),h++)}const y=.35-1.1*h/2,g=s.getAttribute("x"),x=s.getAttribute("y");u.forEach((t,e)=>{t.setAttribute("x",g),t.setAttribute("y",x),t.setAttribute("dy",`${y+1.1*e}em`)})}}function Z(t,e,n){let s=e[0].radius-k(e[0],t);for(let i=1;i<e.length;++i){const n=e[i].radius-k(e[i],t);n<=s&&(s=n)}for(let i=0;i<n.length;++i){const e=k(n[i],t)-n[i].radius;e<=s&&(s=e)}return s}function H(t,e,n){const s=[];for(const h of t)s.push({x:h.x,y:h.y}),s.push({x:h.x+h.radius/2,y:h.y}),s.push({x:h.x-h.radius/2,y:h.y}),s.push({x:h.x,y:h.y+h.radius/2}),s.push({x:h.x,y:h.y-h.radius/2});let i=s[0],r=Z(s[0],t,e);for(let h=1;h<s.length;++h){const n=Z(s[h],t,e);n>=r&&(i=s[h],r=n)}const o=N(n=>-1*Z({x:n[0],y:n[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,a={x:n?0:o[0],y:o[1]};let l=!0;for(const h of t)if(k(a,h)>h.radius){l=!1;break}for(const h of e)if(k(a,h)<h.radius){l=!1;break}if(l)return a;if(1==t.length)return{x:t[0].x,y:t[0].y};const c={};return I(t,c),0===c.arcs.length?{x:0,y:-1e3,disjoint:!0}:1==c.arcs.length?{x:c.arcs[0].circle.x,y:c.arcs[0].circle.y}:e.length?H(t,[]):S(c.arcs.map(t=>t.p1))}function J(t,e,n){const s={},i=function(t){const e={},n=Object.keys(t);for(const s of n)e[s]=[];for(let s=0;s<n.length;s++){const i=n[s],r=t[i];for(let o=s+1;o<n.length;++o){const s=n[o],a=t[s],l=k(r,a);l+a.radius<=r.radius+1e-10?e[s].push(i):l+r.radius<=a.radius+1e-10&&e[i].push(s)}}return e}(t);for(let r=0;r<e.length;++r){const o=e[r].sets,a={},l={};for(let t=0;t<o.length;++t){a[o[t]]=!0;const e=i[o[t]];for(let t=0;t<e.length;++t)l[e[t]]=!0}const c=[],h=[];for(let e in t)e in a?c.push(t[e]):e in l||h.push(t[e]);const u=H(c,h,n);s[o]=u,u.disjoint&&e[r].size}return s}function Q(t){if(0===t.length)return[];const e={};return I(t,e),e.arcs}function tt(t,e){if(0===t.length)return"M 0 0";const n=Math.pow(10,e||0),s=null!=e?t=>Math.round(t*n)/n:t=>t;if(1==t.length){const e=t[0].circle;return function(t,e,n){const s=[];return s.push("\nM",t,e),s.push("\nm",-n,0),s.push("\na",n,n,0,1,0,2*n,0),s.push("\na",n,n,0,1,0,2*-n,0),s.join(" ")}(s(e.x),s(e.y),s(e.radius))}const i=["\nM",s(t[0].p2.x),s(t[0].p2.y)];for(const r of t){const t=s(r.circle.radius);i.push("\nA",t,t,0,r.large?1:0,r.sweep?1:0,s(r.p1.x),s(r.p1.y))}return i.join(" ")}function et(t,e){return tt(Q(t),e)}var nt=function(){var t=a(function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},"o"),e=[5,8],n=[7,8,11,12,17,19,22,24],s=[1,17],i=[1,18],r=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],o=[1,31],l=[1,39],c=[7,8,11,12,17,19,22,24,27],h=[1,57],u=[1,56],f=[1,58],d=[1,59],y=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],x={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:a(function(t,e,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return r[a-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:r[a-1].push(r[a]),this.$=r[a-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=r[a];break;case 8:s.setDiagramTitle(r[a].substr(6)),this.$=r[a].substr(6);break;case 9:s.addSubsetData([r[a]],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 10:s.addSubsetData([r[a-1]],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 11:s.addSubsetData([r[a-2]],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 12:s.addSubsetData([r[a-3]],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 13:if(r[a].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a]),s.addSubsetData(r[a],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 14:if(r[a-1].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-1]),s.addSubsetData(r[a-1],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 15:if(r[a-2].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-2]),s.addSubsetData(r[a-2],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 16:if(r[a-3].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-3]),s.addSubsetData(r[a-3],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 17:case 18:case 19:s.addTextData(r[a-1],r[a],void 0);break;case 20:case 21:s.addTextData(r[a-2],r[a-1],r[a]);break;case 23:s.addStyleData(r[a-1],r[a]);break;case 24:case 25:case 26:if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a],void 0);break;case 27:case 28:var l;if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a-1],r[a]);break;case 29:case 41:case 34:this.$=[r[a]];break;case 30:case 42:this.$=[...r[a-2],r[a]];break;case 31:this.$=[r[a-2],r[a]];break;case 33:this.$=r[a].join(" ")}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(n,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(n,[2,5]),t(n,[2,6]),t(n,[2,7]),t(n,[2,8]),{13:16,20:s,21:i},{13:20,18:19,20:s,21:i},{13:20,18:21,20:s,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:s,21:i},t(n,[2,9],{14:[1,27],15:[1,28]}),t(r,[2,43]),t(r,[2,44]),t(n,[2,13],{14:[1,29],15:[1,30],27:o}),t(r,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:o},t(n,[2,22]),t(n,[2,24],{14:[1,35]}),t(n,[2,25],{14:[1,36]}),t(n,[2,26]),{20:l,25:37,26:38,27:o},t(n,[2,10],{15:[1,40]}),{16:[1,41]},t(n,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:s,21:i},t(n,[2,17],{14:[1,45]}),t(n,[2,18],{14:[1,46]}),t(n,[2,19]),t(n,[2,27]),t(n,[2,28]),t(n,[2,23],{27:[1,47]}),t(c,[2,29]),{15:[1,48]},{16:[1,49]},t(n,[2,11]),{16:[1,50]},t(n,[2,15]),t(r,[2,42]),t(n,[2,20]),t(n,[2,21]),{20:l,26:51},{16:h,20:u,21:[1,53],28:52,29:54,30:55,31:f,32:d,33:y},t(n,[2,12]),t(n,[2,16]),t(c,[2,30]),t(c,[2,31]),t(c,[2,32]),t(c,[2,33],{30:61,16:h,20:u,31:f,32:d,33:y}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:a(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:a(function(t){var e=this,n=[0],s=[],i=[null],r=[],o=this.table,l="",c=0,h=0,u=r.slice.call(arguments,1),f=Object.create(this.lexer),d={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(d.yy[y]=this.yy[y]);f.setInput(t,d.yy),d.yy.lexer=f,d.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var g=f.yylloc;r.push(g);var x=f.options&&f.options.ranges;function p(){var t;return"number"!=typeof(t=s.pop()||f.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,a(function(t){n.length=n.length-2*t,i.length=i.length-t,r.length=r.length-t},"popStack"),a(p,"lex");for(var m,v,b,I,M,k,w,_,S={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==m&&(m=p()),b=o[v]&&o[v][m]),void 0===b||!b.length||!b[0]){var E="";for(M in _=[],o[v])this.terminals_[M]&&M>2&&_.push("'"+this.terminals_[M]+"'");E=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(E,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:g,expected:_})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+m);switch(b[0]){case 1:n.push(m),i.push(f.yytext),r.push(f.yylloc),n.push(b[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,g=f.yylloc;break;case 2:if(k=this.productions_[b[1]][1],S.$=i[i.length-k],S._$={first_line:r[r.length-(k||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(k||1)].first_column,last_column:r[r.length-1].last_column},x&&(S._$.range=[r[r.length-(k||1)].range[0],r[r.length-1].range[1]]),void 0!==(I=this.performAction.apply(S,[l,h,c,d.yy,b[1],i,r].concat(u))))return I;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),r=r.slice(0,-1*k)),n.push(this.productions_[b[1]][0]),i.push(S.$),r.push(S._$),w=o[n[n.length-2]][n[n.length-1]],n.push(w);break;case 3:return!0}}return!0},"parse")},p=function(){return{EOF:1,parseError:a(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:a(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:a(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:a(function(t){this.unput(this.match.slice(t))},"less"),pastInput:a(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:a(function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;var t,e,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((n=this._input.match(this.rules[i[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var t=this.next();return t||this.lex()},"lex"),begin:a(function(t){this.conditionStack.push(t)},"begin"),popState:a(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:a(function(t){this.begin(t)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(t,e,n,s){switch(n){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(t.getIndentMode&&t.getIndentMode())return t.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:t.setIndentMode&&t.setIndentMode(!1),this.begin("INITIAL"),this.unput(e.yytext);break;case 6:return this.begin("bol"),8;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(!t.consumeIndentText)return 19;t.consumeIndentText=!1;break;case 15:return 24;case 16:return e.yytext=e.yytext.slice(2,-2),14;case 17:return e.yytext=e.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}}}();function m(){this.yy={}}return x.lexer=p,a(m,"Parser"),m.prototype=x,x.Parser=m,new m}();nt.parser=nt;var st,it=nt,rt=[],ot=[],at=[],lt=new Set,ct=!1,ht=a((t,e,n)=>{const s=pt(t).sort(),i=n??10/Math.pow(t.length,2);st=s,1===s.length&<.add(s[0]),rt.push({sets:s,size:i,label:e?ft(e):void 0})},"addSubsetData"),ut=a(()=>rt,"getSubsetData"),ft=a(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),dt=a(t=>t?ft(t):t,"normalizeStyleValue"),yt=a((t,e,n)=>{const s=ft(e);ot.push({sets:pt(t).sort(),id:s,label:n?ft(n):void 0})},"addTextData"),gt=a((t,e)=>{const n=pt(t).sort(),s={};for(const[i,r]of e)s[i]=dt(r)??r;at.push({targets:n,styles:s})},"addStyleData"),xt=a(()=>at,"getStyleData"),pt=a(t=>t.map(t=>ft(t)),"normalizeIdentifierList"),mt=a(t=>{const e=pt(t).filter(t=>!lt.has(t));if(e.length>0)throw new Error(`unknown set identifier: ${e.join(", ")}`)},"validateUnionIdentifiers"),vt=a(()=>ot,"getTextData"),bt=a(()=>st,"getCurrentSets"),It=a(()=>ct,"getIndentMode"),Mt=a(t=>{ct=t},"setIndentMode"),kt=m.venn;function wt(){return p(kt,l().venn)}a(wt,"getConfig");var _t={getConfig:wt,clear:a(()=>{x(),rt.length=0,ot.length=0,at.length=0,lt.clear(),st=void 0,ct=!1},"customClear"),setAccTitle:o,getAccTitle:r,setDiagramTitle:i,getDiagramTitle:s,getAccDescription:n,setAccDescription:e,addSubsetData:ht,getSubsetData:ut,addTextData:yt,addStyleData:gt,validateUnionIdentifiers:mt,getTextData:vt,getStyleData:xt,getCurrentSets:bt,getIndentMode:It,setIndentMode:Mt},St=a(t=>`\n .venn-title {\n font-size: 32px;\n fill: ${t.vennTitleTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-circle text {\n font-size: 48px;\n font-family: ${t.fontFamily};\n }\n\n .venn-intersection text {\n font-size: 48px;\n fill: ${t.vennSetTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-text-node {\n font-family: ${t.fontFamily};\n color: ${t.vennSetTextColor};\n }\n`,"getStyles");function Et(t){const e=new Map;for(const n of t){const t=n.targets.join("|"),s=e.get(t);s?Object.assign(s,n.styles):e.set(t,{...n.styles})}return e}a(Et,"buildStyleByKey");var Tt=a((t,e,n,s)=>{var i,r,o;const a=s.db,x=null==(i=a.getConfig)?void 0:i.call(a),{themeVariables:p,look:m,handDrawnSeed:b}=l(),I="handDrawn"===m,M=[p.venn1,p.venn2,p.venn3,p.venn4,p.venn5,p.venn6,p.venn7,p.venn8].filter(Boolean),k=null==(r=a.getDiagramTitle)?void 0:r.call(a),w=a.getSubsetData(),_=a.getTextData(),S=Et(a.getStyleData()),E=Rt(w),T=(null==x?void 0:x.width)??800,z=(null==x?void 0:x.height)??450,A=T/1600,R=k?48*A:0,D=p.primaryTextColor??p.textColor,N=c(e);N.attr("viewBox",`0 0 ${T} ${z}`),k&&N.append("text").text(k).attr("class","venn-title").attr("font-size",32*A+"px").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*A).style("fill",p.vennTitleTextColor||p.titleColor);const O=h(document.createElement("div")),F=Y().width(T).height(z-R);O.datum(E).call(F);const $=I?u.svg(O.select("svg").node()):void 0,j=function(t,e={}){const{lossFunction:n,layoutFunction:s=C,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:a=600,height:l=350,padding:c=15,scaleToFit:h=!1,symmetricalTextCentre:u=!1,distinct:f,round:d=2}=e;let y=s(t,{lossFunction:"default"!==n&&n?"logRatio"===n?q:n:L,distinct:f});i&&(y=G(y,r,o));const g=V(y,a,l,c,h),x=J(g,t,u),p=new Map(Object.keys(g).map(t=>[t,{set:t,x:g[t].x,y:g[t].y,radius:g[t].radius}])),m=t.map(t=>{const e=t.sets.map(t=>p.get(t)),n=Q(e);return{circles:e,arcs:n,path:tt(n,d),area:t,has:new Set(t.sets)}});function v(t){let e="";for(const n of m)n.has.size>t.length&&t.every(t=>n.has.has(t))&&(e+=" "+n.path);return e}return m.map(({circles:t,arcs:e,path:n,area:s})=>({data:s,text:x[s.sets],circles:t,arcs:e,path:n,distinctPath:n+v(s.sets)}))}(E,{width:T,height:z-R,padding:(null==x?void 0:x.padding)??15}),P=new Map;for(const l of j){const t=zt([...l.data.sets].sort());P.set(t,l)}_.length>0&&At(x,P,O,_,A,S);const U=f(p.background||"#f4f4f4");O.selectAll(".venn-circle").each(function(t,e){var n;const s=h(this),i=zt([...t.sets].sort()),r=S.get(i),o=(null==r?void 0:r.fill)||M[e%M.length]||p.primaryColor;s.classed("venn-set-"+e%8,!0);const a=(null==r?void 0:r["fill-opacity"])??.1,l=(null==r?void 0:r.stroke)||o,c=(null==r?void 0:r["stroke-width"])||""+5*A;if(I&&$){const t=P.get(i);if(t&&t.circles.length>0){const i=t.circles[0],r=$.circle(i.x,i.y,2*i.radius,{roughness:.7,seed:b,fill:v(o,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:60*e-41,stroke:l,strokeWidth:parseFloat(String(c))});s.select("path").remove(),null==(n=s.node())||n.insertBefore(r,s.select("text").node())}}else s.select("path").style("fill",o).style("fill-opacity",a).style("stroke",l).style("stroke-width",c).style("stroke-opacity",.95);const u=(null==r?void 0:r.color)||(U?d(o,30):y(o,30));s.select("text").style("font-size",48*A+"px").style("fill",u)}),I&&$?O.selectAll(".venn-intersection").each(function(t){var e;const n=h(this),s=zt([...t.sets].sort()),i=S.get(s),r=null==i?void 0:i.fill;if(r){const t=n.select("path"),s=t.attr("d");if(s){const n=$.path(s,{roughness:.7,seed:b,fill:v(r,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),i=t.node();null==(e=null==i?void 0:i.parentNode)||e.insertBefore(n,i),t.remove()}}else n.select("path").style("fill-opacity",0);n.select("text").style("font-size",48*A+"px").style("fill",(null==i?void 0:i.color)??p.vennSetTextColor??D)}):(O.selectAll(".venn-intersection text").style("font-size",48*A+"px").style("fill",t=>{var e;const n=zt([...t.sets].sort());return(null==(e=S.get(n))?void 0:e.color)??p.vennSetTextColor??D}),O.selectAll(".venn-intersection path").style("fill-opacity",t=>{var e;const n=zt([...t.sets].sort());return(null==(e=S.get(n))?void 0:e.fill)?1:0}).style("fill",t=>{var e;const n=zt([...t.sets].sort());return(null==(e=S.get(n))?void 0:e.fill)??"transparent"}));const B=N.append("g").attr("transform",`translate(0, ${R})`),W=O.select("svg").node();if(W&&"childNodes"in W)for(const l of[...W.childNodes])null==(o=B.node())||o.appendChild(l);g(N,z,T,(null==x?void 0:x.useMaxWidth)??!0)},"draw");function zt(t){return t.join("|")}function At(t,e,n,s,i,r){var o;const a=(null==t?void 0:t.useDebugLayout)??!1,l=n.select("svg").append("g").attr("class","venn-text-nodes"),c=new Map;for(const h of s){const t=zt(h.sets),e=c.get(t);e?e.push(h):c.set(t,[h])}for(const[h,u]of c.entries()){const t=e.get(h);if(!(null==t?void 0:t.text))continue;const n=t.text.x,s=t.text.y,c=Math.min(...t.circles.map(t=>t.radius)),f=Math.min(...t.circles.map(t=>t.radius-Math.hypot(n-t.x,s-t.y)));let d=Number.isFinite(f)?Math.max(0,f):0;0===d&&Number.isFinite(c)&&(d=.6*c);const y=l.append("g").attr("class","venn-text-area").attr("font-size",40*i+"px");a&&y.append("circle").attr("class","venn-text-debug-circle").attr("cx",n).attr("cy",s).attr("r",d).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const g=Math.max(80*i,2*d*.95),x=Math.max(60*i,2*d*.95),p=(t.data.label&&t.data.label.length>0?Math.min(32*i,.25*d):0)+(u.length<=2?30*i:0),m=n-g/2,v=s-x/2+p,b=Math.max(1,Math.ceil(Math.sqrt(u.length))),I=g/b,M=x/Math.max(1,Math.ceil(u.length/b));for(const[e,l]of u.entries()){const t=e%b,n=Math.floor(e/b),s=m+I*(t+.5),c=v+M*(n+.5);a&&y.append("rect").attr("class","venn-text-debug-cell").attr("x",m+I*t).attr("y",v+M*n).attr("width",I).attr("height",M).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const h=.9*I,u=.9*M,f=y.append("foreignObject").attr("class","venn-text-node-fo").attr("width",h).attr("height",u).attr("x",s-h/2).attr("y",c-u/2).attr("overflow","visible"),d=null==(o=r.get(l.id))?void 0:o.color,g=f.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(l.label??l.id);d&&g.style("color",d)}}}function Rt(t){const e=new Set(t.map(t=>[...t.sets].sort().join("|"))),n=new Map(t.filter(t=>1===t.sets.length&&void 0!==t.size).map(t=>[t.sets[0],t.size])),s=[];for(const i of t){if(i.sets.length<3)continue;const t=[...i.sets].sort();for(let i=0;i<t.length-1;i++)for(let r=i+1;r<t.length;r++){const o=[t[i],t[r]],a=o.join("|");if(!e.has(a)){e.add(a);const t=n.get(o[0]),i=n.get(o[1]),r=void 0!==t&&void 0!==i?Math.min(t,i)/4:2.5;s.push({sets:o,size:r,label:""})}}}return s.length>0?[...t,...s]:t}a(zt,"stableSetsKey"),a(At,"renderTextNodes"),a(Rt,"ensurePairwiseSubsets");var Dt={parser:it,db:_t,renderer:{draw:Tt},styles:St};export{Dt as diagram};
|