@lyhue1991/pi-web 0.8.6 → 0.8.7
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/required-server-files.js +3 -2
- package/.next/required-server-files.json +3 -2
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +2 -2
- package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/page.js +3 -3
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/3397.js +1 -1
- package/.next/server/chunks/358.js +1 -1
- package/.next/server/chunks/4365.js +1 -1
- package/.next/server/chunks/4407.js +1 -1
- package/.next/server/chunks/5414.js +1 -1
- package/.next/server/chunks/5460.js +2 -2
- package/.next/server/chunks/5737.js +1 -1
- package/.next/server/chunks/5985.js +1 -1
- package/.next/server/chunks/6073.js +1 -1
- package/.next/server/chunks/7702.js +1 -1
- package/.next/server/chunks/8360.js +1 -1
- package/.next/server/chunks/8469.js +1 -1
- package/.next/server/chunks/8704.js +1 -1
- package/.next/server/chunks/9963.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/webpack-runtime.js +1 -1
- package/.next/static/chunks/app/{layout-ca97634a96114a03.js → layout-91584a19e4ccf9ed.js} +1 -1
- package/.next/static/chunks/app/{page-4be55877df86a39c.js → page-b3407109c4aa0f5a.js} +2 -2
- package/.next/trace +6 -37
- package/.next/trace-build +1 -1
- package/next.config.ts +4 -0
- package/package.json +1 -1
- package/.next/server/chunks/1309.js +0 -14
- package/.next/server/chunks/2715.js +0 -1
- package/.next/server/chunks/4893.js +0 -1
- package/.next/server/chunks/7424.js +0 -4
- package/.next/server/chunks/7635.js +0 -1
- package/.next/server/chunks/static/media/macos-trash.6c01a2a6 +0 -0
- package/.next/server/chunks/static/media/windows-trash.2b7fe177.exe +0 -0
- /package/.next/static/{JpAkqjRvCHtp3M_ChE6_B → X-p5oTeavB3wT75VEcMAa}/_buildManifest.js +0 -0
- /package/.next/static/{JpAkqjRvCHtp3M_ChE6_B → X-p5oTeavB3wT75VEcMAa}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"18382":{"*":{"id":"
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"18382":{"*":{"id":"2013","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"39247":{"*":{"id":"55100","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"35421","name":"*","chunks":[],"async":false}},"57788":{"*":{"id":"19102","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"60440","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"82265","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"61335","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"84342","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"74661","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"70664","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/liangyun/Codes/pi-web/node_modules/next/dist/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/esm/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/esm/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/esm/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/liangyun/Codes/pi-web/components/PwaRegistration.tsx":{"id":57788,"name":"*","chunks":["7177","static/chunks/app/layout-91584a19e4ccf9ed.js"],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/next/font/google/target.css?{\"path\":\"app/layout.tsx\",\"import\":\"Noto_Sans_Mono\",\"arguments\":[{\"subsets\":[\"latin\",\"cyrillic\"],\"variable\":\"--font-noto-mono\",\"display\":\"swap\"}],\"variableName\":\"notoSansMono\"}":{"id":83683,"name":"*","chunks":["7177","static/chunks/app/layout-91584a19e4ccf9ed.js"],"async":false},"/Users/liangyun/Codes/pi-web/node_modules/katex/dist/katex.min.css":{"id":84559,"name":"*","chunks":["7177","static/chunks/app/layout-91584a19e4ccf9ed.js"],"async":false},"/Users/liangyun/Codes/pi-web/app/globals.css":{"id":66872,"name":"*","chunks":["7177","static/chunks/app/layout-91584a19e4ccf9ed.js"],"async":false},"/Users/liangyun/Codes/pi-web/components/AppShell.tsx":{"id":18382,"name":"*","chunks":["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","8311","static/chunks/8311-95813758da2b283c.js","8974","static/chunks/app/page-b3407109c4aa0f5a.js"],"async":false},"/Users/liangyun/Codes/pi-web/hooks/useI18n.tsx":{"id":39247,"name":"*","chunks":["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","8311","static/chunks/8311-95813758da2b283c.js","8974","static/chunks/app/page-b3407109c4aa0f5a.js"],"async":false}},"entryCSSFiles":{"/Users/liangyun/Codes/pi-web/":[],"/Users/liangyun/Codes/pi-web/app/layout":[{"inlined":false,"path":"static/css/88714c00e109ce28.css"},{"inlined":false,"path":"static/css/03c139a692325b4b.css"}],"/Users/liangyun/Codes/pi-web/app/page":[{"inlined":false,"path":"static/css/121a2cf33104c046.css"}]},"rscModuleMapping":{"18382":{"*":{"id":"35790","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"39247":{"*":{"id":"73884","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"98099","name":"*","chunks":[],"async":false}},"57788":{"*":{"id":"81276","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"15098","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"33859","name":"*","chunks":[],"async":false}},"66872":{"*":{"id":"82704","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"16237","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"47644","name":"*","chunks":[],"async":false}},"84559":{"*":{"id":"25319","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"36675","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.id=3397,exports.ids=[3397],exports.modules={13397:(a,b,c)=>{c.d(b,{diagram:()=>A});var d=c(
|
|
1
|
+
"use strict";exports.id=3397,exports.ids=[3397],exports.modules={13397:(a,b,c)=>{c.d(b,{diagram:()=>A});var d=c(25215),e=c(93273),f=c(40684),g=c(46629),h=c(21143),i=c(92325),j=c(69085),k=g.UI.pie,l={sections:new Map,showData:!1,config:k},m=l.sections,n=l.showData,o=structuredClone(k),p=(0,h.K2)(()=>structuredClone(o),"getConfig"),q=(0,h.K2)(()=>{m=new Map,n=l.showData,(0,g.IU)()},"clear"),r=(0,h.K2)(({label:a,value:b})=>{if(b<0)throw Error(`"${a}" has invalid value: ${b}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);m.has(a)||(m.set(a,b),h.Rm.debug(`added new section: ${a}, with value: ${b}`))},"addSection"),s=(0,h.K2)(()=>m,"getSections"),t=(0,h.K2)(a=>{n=a},"setShowData"),u=(0,h.K2)(()=>n,"getShowData"),v={getConfig:p,clear:q,setDiagramTitle:g.ke,getDiagramTitle:g.ab,setAccTitle:g.SV,getAccTitle:g.iN,setAccDescription:g.EI,getAccDescription:g.m7,addSection:r,getSections:s,setShowData:t,getShowData:u},w=(0,h.K2)((a,b)=>{(0,e.S)(a,b),b.setShowData(a.showData),a.sections.map(b.addSection)},"populateDb"),x={parse:(0,h.K2)(async a=>{let b=await (0,i.qg)("pie",a);h.Rm.debug(b),w(b,v)},"parse")},y=(0,h.K2)(a=>`
|
|
2
2
|
.pieCircle{
|
|
3
3
|
stroke: ${a.pieStrokeColor};
|
|
4
4
|
stroke-width : ${a.pieStrokeWidth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.id=358,exports.ids=[358],exports.modules={50358:(a,b,c)=>{c.d(b,{diagram:()=>K});var d=c(47596),e=c(93273),f=c(46629),g=c(21143),h=c(92325),i=(0,g.K2)((a,b)=>{let c=a<=1?100*a:a;if(c<0||c>100)throw Error(`${b} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return c},"toPercent"),j=(0,g.K2)((a,b,c)=>({x:i(b,`${c} evolution`),y:i(a,`${c} visibility`)}),"toCoordinates"),k=(0,g.K2)(a=>{if(a){if("+<>"===a)return"bidirectional";if("+<"===a)return"backward";if("+>"===a)return"forward"}},"getFlowFromPort"),l=(0,g.K2)(a=>{if(!a?.startsWith("+"))return{};let b=/^\+'([^']*)'/.exec(a),c=b?.[1];return a.includes("<>")?{flow:"bidirectional",label:c}:a.includes("<")?{flow:"backward",label:c}:a.includes(">")?{flow:"forward",label:c}:{label:c}},"extractFlowFromArrow"),m=(0,g.K2)((a,b)=>{if((0,e.S)(a,b),a.size&&b.setSize(a.size.width,a.size.height),a.evolution){let c=a.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),d=a.evolution.stages.filter(a=>void 0!==a.boundary).map(a=>a.boundary);b.updateAxes({stages:c,stageBoundaries:d})}if(a.anchors.forEach(a=>{let c=j(a.visibility,a.evolution,`Anchor "${a.name}"`);b.addNode(a.name,a.name,c.x,c.y,"anchor")}),a.components.forEach(a=>{let c=j(a.visibility,a.evolution,`Component "${a.name}"`),d=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,e=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,f=a.decorator?.strategy;b.addNode(a.name,a.name,c.x,c.y,"component",d,e,a.inertia,f)}),a.notes.forEach(a=>{let c=j(a.visibility,a.evolution,`Note "${a.text}"`);b.addNote(a.text,c.x,c.y)}),a.pipelines.forEach(a=>{let c=b.getNode(a.parent);if(!c||"number"!=typeof c.y)throw Error(`Pipeline "${a.parent}" must reference an existing component with coordinates.`);let d=c.y;b.startPipeline(a.parent),a.components.forEach(c=>{let e=`${a.parent}_${c.name}`,f=c.label?(c.label.negX?-1:1)*c.label.offsetX:void 0,g=c.label?(c.label.negY?-1:1)*c.label.offsetY:void 0,h=i(c.evolution,`Pipeline component "${c.name}" evolution`);b.addNode(e,c.name,h,d,"pipeline-component",f,g),b.addPipelineComponent(a.parent,e)})}),a.links.forEach(a=>{let c=!!a.arrow&&(a.arrow.includes("-.->")||a.arrow.includes(".-.")),d=k(a.fromPort)??k(a.toPort),{flow:e,label:f}=l(a.arrow);!d&&e&&(d=e);let g=a.linkLabel;b.addLink(a.from,a.to,c,f??g,d)}),a.evolves.forEach(a=>{let c=b.getNode(a.component);if(c?.y!==void 0){let d=i(a.target,`Evolve target for "${a.component}"`);b.addTrend(a.component,d,c.y)}}),a.annotations.length>0){let c=a.annotations[0],d=j(c.x,c.y,"Annotations box");b.setAnnotationsBox(d.x,d.y)}a.annotation.forEach(a=>{let c=j(a.x,a.y,`Annotation ${a.number}`);b.addAnnotation(a.number,[{x:c.x,y:c.y}],a.text)}),a.accelerators.forEach(a=>{let c=j(a.x,a.y,`Accelerator "${a.name}"`);b.addAccelerator(a.name,c.x,c.y)}),a.deaccelerators.forEach(a=>{let c=j(a.x,a.y,`Deaccelerator "${a.name}"`);b.addDeaccelerator(a.name,c.x,c.y)})},"populateDb"),n={parser:{yy:void 0},parse:(0,g.K2)(async a=>{let b=await (0,h.qg)("wardley",a);g.Rm.debug(b);let c=n.parser?.yy;if(!c||"function"!=typeof c.addNode)throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m(b,c)},"parse")},o=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{(0,g.K2)(this,"WardleyBuilder")}addNode(a){let b=this.nodes.get(a.id)??{id:a.id,label:a.label},c={...b,...a,className:a.className??b.className,labelOffsetX:a.labelOffsetX??b.labelOffsetX,labelOffsetY:a.labelOffsetY??b.labelOffsetY};this.nodes.set(a.id,c)}addLink(a){this.links.push(a)}addTrend(a){this.trends.set(a.nodeId,a)}startPipeline(a){this.pipelines.set(a,{nodeId:a,componentIds:[]});let b=this.nodes.get(a);b&&(b.isPipelineParent=!0)}addPipelineComponent(a,b){let c=this.pipelines.get(a);c&&c.componentIds.push(b);let d=this.nodes.get(b);d&&(d.inPipeline=!0)}addAnnotation(a){this.annotations.push(a)}addNote(a){this.notes.push(a)}addAccelerator(a){this.accelerators.push(a)}addDeaccelerator(a){this.deaccelerators.push(a)}setAnnotationsBox(a,b){this.annotationsBox={x:a,y:b}}setAxes(a){this.axes={...this.axes,...a}}setSize(a,b){this.size={width:a,height:b}}getNode(a){return this.nodes.get(a)}build(){let a=[];for(let b of this.nodes.values()){if("number"!=typeof b.x||"number"!=typeof b.y)throw Error(`Node "${b.label}" is missing coordinates`);a.push(b)}return{nodes:a,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function p(a){let b=(0,f.D7)();return(0,f.jZ)(a.trim(),b)}function q(){return(0,f.D7)()["wardley-beta"]}function r(a,b,c,d,e,f,g,h,i){o.addNode({id:a,label:p(b),x:c,y:d,className:e,labelOffsetX:f,labelOffsetY:g,inertia:h,sourceStrategy:i})}function s(a,b,c=!1,d,e){o.addLink({source:a,target:b,dashed:c,label:d,flow:e})}function t(a,b,c){o.addTrend({nodeId:a,targetX:b,targetY:c})}function u(a,b,c){o.addAnnotation({number:a,coordinates:b,text:c?p(c):void 0})}function v(a,b,c){o.addNote({text:p(a),x:b,y:c})}function w(a,b,c){o.addAccelerator({name:p(a),x:b,y:c})}function x(a,b,c){o.addDeaccelerator({name:p(a),x:b,y:c})}function y(a,b){o.setAnnotationsBox(a,b)}function z(a,b){o.setSize(a,b)}function A(a){o.startPipeline(a)}function B(a,b){o.addPipelineComponent(a,b)}function C(a){let b={};a.xLabel&&(b.xLabel=p(a.xLabel)),a.yLabel&&(b.yLabel=p(a.yLabel)),a.stages&&(b.stages=a.stages.map(a=>p(a))),a.stageBoundaries&&(b.stageBoundaries=a.stageBoundaries),o.setAxes(b)}function D(a){return o.getNode(a)}function E(){return o.build()}function F(){o.clear(),(0,f.IU)()}(0,g.K2)(p,"textSanitizer"),(0,g.K2)(q,"getConfig"),(0,g.K2)(r,"addNode"),(0,g.K2)(s,"addLink"),(0,g.K2)(t,"addTrend"),(0,g.K2)(u,"addAnnotation"),(0,g.K2)(v,"addNote"),(0,g.K2)(w,"addAccelerator"),(0,g.K2)(x,"addDeaccelerator"),(0,g.K2)(y,"setAnnotationsBox"),(0,g.K2)(z,"setSize"),(0,g.K2)(A,"startPipeline"),(0,g.K2)(B,"addPipelineComponent"),(0,g.K2)(C,"updateAxes"),(0,g.K2)(D,"getNode"),(0,g.K2)(E,"getWardleyData"),(0,g.K2)(F,"clear");var G={getConfig:q,addNode:r,addLink:s,addTrend:t,addAnnotation:u,addNote:v,addAccelerator:w,addDeaccelerator:x,setAnnotationsBox:y,setSize:z,startPipeline:A,addPipelineComponent:B,updateAxes:C,getNode:D,getWardleyData:E,clear:F,setAccTitle:f.SV,getAccTitle:f.iN,setDiagramTitle:f.ke,getDiagramTitle:f.ab,getAccDescription:f.m7,setAccDescription:f.EI},H=["Genesis","Custom Built","Product","Commodity"],I=(0,g.K2)(()=>{let{themeVariables:a}=(0,f.D7)();return{backgroundColor:a.wardley?.backgroundColor??a.background??"#fff",axisColor:a.wardley?.axisColor??"#000",axisTextColor:a.wardley?.axisTextColor??a.primaryTextColor??"#222",gridColor:a.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:a.wardley?.componentFill??"#fff",componentStroke:a.wardley?.componentStroke??"#000",componentLabelColor:a.wardley?.componentLabelColor??a.primaryTextColor??"#222",linkStroke:a.wardley?.linkStroke??"#000",evolutionStroke:a.wardley?.evolutionStroke??"#dc3545",annotationStroke:a.wardley?.annotationStroke??"#000",annotationTextColor:a.wardley?.annotationTextColor??a.primaryTextColor??"#222",annotationFill:a.wardley?.annotationFill??a.background??"#fff"}},"getTheme"),J=(0,g.K2)(()=>{let a=(0,f.D7)()["wardley-beta"];return{width:a?.width??900,height:a?.height??600,padding:a?.padding??48,nodeRadius:a?.nodeRadius??6,nodeLabelOffset:a?.nodeLabelOffset??8,axisFontSize:a?.axisFontSize??12,labelFontSize:a?.labelFontSize??10,showGrid:a?.showGrid??!1,useMaxWidth:a?.useMaxWidth??!0}},"getConfigValues"),K={parser:n,db:G,renderer:{draw:(0,g.K2)((a,b,c,e)=>{g.Rm.debug("Rendering Wardley map\n"+a);let h=J(),i=I(),j=1.6*h.nodeRadius,k=e.db,l=k.getWardleyData(),m=k.getDiagramTitle(),n=l.size?.width??h.width,o=l.size?.height??h.height,p=(0,d.D)(b);p.selectAll("*").remove(),(0,f.a$)(p,o,n,h.useMaxWidth),p.attr("viewBox",`0 0 ${n} ${o}`);let q=p.append("g").attr("class","wardley-map"),r=p.append("defs");r.append("marker").attr("id",`arrow-${b}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",i.evolutionStroke).attr("stroke","none"),r.append("marker").attr("id",`link-arrow-end-${b}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",i.linkStroke).attr("stroke","none"),r.append("marker").attr("id",`link-arrow-start-${b}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",i.linkStroke).attr("stroke","none"),q.append("rect").attr("class","wardley-background").attr("width",n).attr("height",o).attr("fill",i.backgroundColor);let s=n-2*h.padding,t=o-2*h.padding;m&&q.append("text").attr("class","wardley-title").attr("x",n/2).attr("y",h.padding/2).attr("fill",i.axisTextColor).attr("font-size",1.05*h.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(m);let u=(0,g.K2)(a=>h.padding+a/100*s,"projectX"),v=(0,g.K2)(a=>o-h.padding-a/100*t,"projectY"),w=q.append("g").attr("class","wardley-axes");w.append("line").attr("x1",h.padding).attr("x2",n-h.padding).attr("y1",o-h.padding).attr("y2",o-h.padding).attr("stroke",i.axisColor).attr("stroke-width",1),w.append("line").attr("x1",h.padding).attr("x2",h.padding).attr("y1",h.padding).attr("y2",o-h.padding).attr("stroke",i.axisColor).attr("stroke-width",1);let x=l.axes.xLabel??"Evolution",y=l.axes.yLabel??"Visibility";w.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",h.padding+s/2).attr("y",o-h.padding/4).attr("fill",i.axisTextColor).attr("font-size",h.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(x),w.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",h.padding/3).attr("y",h.padding+t/2).attr("fill",i.axisTextColor).attr("font-size",h.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${h.padding/3} ${h.padding+t/2})`).text(y);let z=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:H;if(z.length>0){let a=q.append("g").attr("class","wardley-stages"),b=l.axes.stageBoundaries,c=[];if(b&&b.length===z.length){let a=0;b.forEach(b=>{c.push({start:a,end:b}),a=b})}else{let a=1/z.length;z.forEach((b,d)=>{c.push({start:d*a,end:(d+1)*a})})}z.forEach((b,d)=>{let e=c[d],f=h.padding+e.start*s,g=(f+(h.padding+e.end*s))/2;d>0&&a.append("line").attr("x1",f).attr("x2",f).attr("y1",h.padding).attr("y2",o-h.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),a.append("text").attr("class","wardley-stage-label").attr("x",g).attr("y",o-h.padding/1.5).attr("fill",i.axisTextColor).attr("font-size",h.axisFontSize-2).attr("text-anchor","middle").text(b)})}if(h.showGrid){let a=q.append("g").attr("class","wardley-grid");for(let b=1;b<4;b++){let c=b/4,d=h.padding+s*c;a.append("line").attr("x1",d).attr("x2",d).attr("y1",h.padding).attr("y2",o-h.padding).attr("stroke",i.gridColor).attr("stroke-dasharray","2 6"),a.append("line").attr("x1",h.padding).attr("x2",n-h.padding).attr("y1",o-h.padding-t*c).attr("y2",o-h.padding-t*c).attr("stroke",i.gridColor).attr("stroke-dasharray","2 6")}}let A=new Map;if(l.nodes.forEach(a=>{A.set(a.id,{x:u(a.x),y:v(a.y),node:a})}),l.pipelines.length>0){let a=q.append("g").attr("class","wardley-pipelines"),b=q.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(c=>{if(0===c.componentIds.length)return;let d=c.componentIds.map(a=>({id:a,pos:A.get(a),node:l.nodes.find(b=>b.id===a)})).filter(a=>a.pos&&a.node).sort((a,b)=>a.node.x-b.node.x);for(let a=0;a<d.length-1;a++){let c=d[a],e=d[a+1];b.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",c.pos.x).attr("y1",c.pos.y).attr("x2",e.pos.x).attr("y2",e.pos.y).attr("stroke",i.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let e=1/0,f=-1/0,g=0;if(c.componentIds.forEach(a=>{let b=A.get(a);b&&(e=Math.min(e,b.x),f=Math.max(f,b.x),g=b.y)}),e!==1/0&&f!==-1/0){let b=4*h.nodeRadius,d=g-b/2,k=A.get(c.nodeId);k&&(k.x=(e+f)/2,k.y=d-j/6),a.append("rect").attr("class","wardley-pipeline-box").attr("x",e-15).attr("y",d).attr("width",f-e+30).attr("height",b).attr("fill","none").attr("stroke",i.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let B=q.append("g").attr("class","wardley-links"),C=new Map;l.pipelines.forEach(a=>{C.set(a.nodeId,new Set(a.componentIds))});let D=l.links.filter(a=>{if(!A.has(a.source)||!A.has(a.target))return!1;let b=C.get(a.target);return!b?.has(a.source)});B.selectAll("line").data(D).enter().append("line").attr("class",a=>`wardley-link${a.dashed?" wardley-link--dashed":""}`).attr("x1",a=>{let b=A.get(a.source),c=A.get(a.target),d=l.nodes.find(b=>b.id===a.source).isPipelineParent?j/Math.sqrt(2):h.nodeRadius,e=c.x-b.x,f=c.y-b.y,g=Math.sqrt(e*e+f*f);return b.x+e/g*d}).attr("y1",a=>{let b=A.get(a.source),c=A.get(a.target),d=l.nodes.find(b=>b.id===a.source).isPipelineParent?j/Math.sqrt(2):h.nodeRadius,e=c.x-b.x,f=c.y-b.y,g=Math.sqrt(e*e+f*f);return b.y+f/g*d}).attr("x2",a=>{let b=A.get(a.source),c=A.get(a.target),d=l.nodes.find(b=>b.id===a.target).isPipelineParent?j/Math.sqrt(2):h.nodeRadius,e=b.x-c.x,f=b.y-c.y,g=Math.sqrt(e*e+f*f);return c.x+e/g*d}).attr("y2",a=>{let b=A.get(a.source),c=A.get(a.target),d=l.nodes.find(b=>b.id===a.target).isPipelineParent?j/Math.sqrt(2):h.nodeRadius,e=b.x-c.x,f=b.y-c.y,g=Math.sqrt(e*e+f*f);return c.y+f/g*d}).attr("stroke",i.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",a=>a.dashed?"6 6":null).attr("marker-end",a=>"forward"===a.flow||"bidirectional"===a.flow?`url(#link-arrow-end-${b})`:null).attr("marker-start",a=>"backward"===a.flow||"bidirectional"===a.flow?`url(#link-arrow-start-${b})`:null),B.selectAll("text").data(D.filter(a=>a.label)).enter().append("text").attr("class","wardley-link-label").attr("x",a=>{let b=A.get(a.source),c=A.get(a.target),d=(b.x+c.x)/2,e=c.y-b.y,f=c.x-b.x,g=Math.sqrt(f*f+e*e);return d+e/g*8}).attr("y",a=>{let b=A.get(a.source),c=A.get(a.target),d=(b.y+c.y)/2,e=c.x-b.x,f=c.y-b.y,g=Math.sqrt(e*e+f*f);return d+-e/g*8}).attr("fill",i.axisTextColor).attr("font-size",h.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",a=>{let b=A.get(a.source),c=A.get(a.target),d=(b.x+c.x)/2,e=(b.y+c.y)/2,f=c.x-b.x,g=c.y-b.y,h=Math.sqrt(f*f+g*g),i=180*Math.atan2(g,f)/Math.PI;return(i>90||i<-90)&&(i+=180),`rotate(${i} ${d+g/h*8} ${e+-f/h*8})`}).text(a=>a.label);let E=q.append("g").attr("class","wardley-trends"),F=l.trends.map(a=>{let b=A.get(a.nodeId);if(!b)return null;let c=u(a.targetX),d=v(a.targetY),e=c-b.x,f=d-b.y,g=Math.sqrt(e*e+f*f),i=h.nodeRadius+2;return{origin:b,targetX:c,targetY:d,adjustedX2:g>i?c-e/g*i:c,adjustedY2:g>i?d-f/g*i:d}}).filter(a=>null!==a);E.selectAll("line").data(F).enter().append("line").attr("class","wardley-trend").attr("x1",a=>a.origin.x).attr("y1",a=>a.origin.y).attr("x2",a=>a.adjustedX2).attr("y2",a=>a.adjustedY2).attr("stroke",i.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${b})`);let G=q.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",a=>["wardley-node",a.className?`wardley-node--${a.className}`:""].filter(Boolean).join(" "));G.filter(a=>"outsource"===a.sourceStrategy).append("circle").attr("class","wardley-outsource-overlay").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",2*h.nodeRadius).attr("fill","#666").attr("stroke",i.componentStroke).attr("stroke-width",1),G.filter(a=>"buy"===a.sourceStrategy).append("circle").attr("class","wardley-buy-overlay").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",2*h.nodeRadius).attr("fill","#ccc").attr("stroke",i.componentStroke).attr("stroke-width",1),G.filter(a=>"build"===a.sourceStrategy).append("circle").attr("class","wardley-build-overlay").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",2*h.nodeRadius).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let K=G.filter(a=>"market"===a.sourceStrategy);K.append("circle").attr("class","wardley-market-overlay").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",2*h.nodeRadius).attr("fill","white").attr("stroke",i.componentStroke).attr("stroke-width",1),G.filter(a=>!a.isPipelineParent&&"market"!==a.sourceStrategy&&"anchor"!==a.className).append("circle").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",h.nodeRadius).attr("fill",i.componentFill).attr("stroke",i.componentStroke).attr("stroke-width",1);let L=.7*h.nodeRadius,M=1.2*h.nodeRadius;if(K.append("line").attr("class","wardley-market-line").attr("x1",a=>A.get(a.id).x).attr("y1",a=>A.get(a.id).y-M).attr("x2",a=>A.get(a.id).x-M*Math.cos(Math.PI/6)).attr("y2",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("stroke",i.componentStroke).attr("stroke-width",1),K.append("line").attr("class","wardley-market-line").attr("x1",a=>A.get(a.id).x-M*Math.cos(Math.PI/6)).attr("y1",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("x2",a=>A.get(a.id).x+M*Math.cos(Math.PI/6)).attr("y2",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("stroke",i.componentStroke).attr("stroke-width",1),K.append("line").attr("class","wardley-market-line").attr("x1",a=>A.get(a.id).x+M*Math.cos(Math.PI/6)).attr("y1",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("x2",a=>A.get(a.id).x).attr("y2",a=>A.get(a.id).y-M).attr("stroke",i.componentStroke).attr("stroke-width",1),K.append("circle").attr("class","wardley-market-dot").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y-M).attr("r",L).attr("fill","white").attr("stroke",i.componentStroke).attr("stroke-width",2),K.append("circle").attr("class","wardley-market-dot").attr("cx",a=>A.get(a.id).x-M*Math.cos(Math.PI/6)).attr("cy",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("r",L).attr("fill","white").attr("stroke",i.componentStroke).attr("stroke-width",2),K.append("circle").attr("class","wardley-market-dot").attr("cx",a=>A.get(a.id).x+M*Math.cos(Math.PI/6)).attr("cy",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("r",L).attr("fill","white").attr("stroke",i.componentStroke).attr("stroke-width",2),G.filter(a=>!0===a.isPipelineParent).append("rect").attr("x",a=>A.get(a.id).x-j/2).attr("y",a=>A.get(a.id).y-j/2).attr("width",j).attr("height",j).attr("fill",i.componentFill).attr("stroke",i.componentStroke).attr("stroke-width",1),G.filter(a=>!0===a.inertia).append("line").attr("class","wardley-inertia").attr("x1",a=>{let b=A.get(a.id),c=a.isPipelineParent?j/2+15:h.nodeRadius+15;return a.sourceStrategy&&(c+=h.nodeRadius+10),b.x+c}).attr("y1",a=>{let b=A.get(a.id),c=a.isPipelineParent?j:2*h.nodeRadius;return b.y-c/2}).attr("x2",a=>{let b=A.get(a.id),c=a.isPipelineParent?j/2+15:h.nodeRadius+15;return a.sourceStrategy&&(c+=h.nodeRadius+10),b.x+c}).attr("y2",a=>{let b=A.get(a.id),c=a.isPipelineParent?j:2*h.nodeRadius;return b.y+c/2}).attr("stroke",i.componentStroke).attr("stroke-width",6),G.append("text").attr("x",a=>{let b=A.get(a.id);if("anchor"===a.className)return void 0!==a.labelOffsetX?b.x+a.labelOffsetX:b.x;let c=h.nodeLabelOffset;a.sourceStrategy&&void 0===a.labelOffsetX&&(c+=10);let d=a.labelOffsetX??c;return b.x+d}).attr("y",a=>{let b=A.get(a.id);if("anchor"===a.className)return void 0!==a.labelOffsetY?b.y+a.labelOffsetY:b.y-3;let c=-h.nodeLabelOffset;a.sourceStrategy&&void 0===a.labelOffsetY&&(c-=10);let d=a.labelOffsetY??c;return b.y+d}).attr("class","wardley-node-label").attr("fill",a=>"evolved"===a.className?i.evolutionStroke:"anchor"===a.className?"#000":i.componentLabelColor).attr("font-size",h.labelFontSize).attr("font-weight",a=>"anchor"===a.className?"bold":"normal").attr("text-anchor",a=>"anchor"===a.className?"middle":"start").attr("dominant-baseline",a=>"anchor"===a.className?"middle":"auto").text(a=>a.label),l.annotations.length>0){let a=q.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(b=>{let c=b.coordinates.map(a=>({x:u(a.x),y:v(a.y)}));if(c.length>1)for(let b=0;b<c.length-1;b++)a.append("line").attr("class","wardley-annotation-line").attr("x1",c[b].x).attr("y1",c[b].y).attr("x2",c[b+1].x).attr("y2",c[b+1].y).attr("stroke",i.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");c.forEach(c=>{let d=a.append("g").attr("class","wardley-annotation");d.append("circle").attr("cx",c.x).attr("cy",c.y).attr("r",10).attr("fill","white").attr("stroke",i.axisColor).attr("stroke-width",1.5),d.append("text").attr("x",c.x).attr("y",c.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",i.axisTextColor).attr("font-weight","bold").text(b.number)})}),l.annotationsBox){let b=u(l.annotationsBox.x),c=v(l.annotationsBox.y),d=a.append("g").attr("class","wardley-annotations-box"),e=[...l.annotations].filter(a=>a.text).sort((a,b)=>a.number-b.number),f=[];if(e.forEach((a,e)=>{let g=d.append("text").attr("x",b+10).attr("y",c+10+(e+1)*16).attr("font-size",11).attr("fill",i.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${a.number}. ${a.text}`);f.push(g)}),f.length>0){let a=0,g=0;f.forEach(b=>{let c=b.node(),d=c.getComputedTextLength();a=Math.max(a,d);let e=c.getBBox();g=Math.max(g,e.height)});let j=a+20+105,k=16*e.length+20+g/2,l=h.padding,m=n-h.padding-j,p=h.padding,q=o-h.padding-k;b=Math.max(l,Math.min(b,m)),c=Math.max(p,Math.min(c,q)),f.forEach((a,d)=>{a.attr("x",b+10).attr("y",c+10+(d+1)*16)}),d.insert("rect","text").attr("x",b).attr("y",c).attr("width",j).attr("height",k).attr("fill","white").attr("stroke",i.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){let a=q.append("g").attr("class","wardley-notes");l.notes.forEach(b=>{let c=u(b.x),d=v(b.y);a.append("text").attr("x",c).attr("y",d).attr("text-anchor","start").attr("font-size",11).attr("fill",i.axisTextColor).attr("font-weight","bold").text(b.text)})}if(l.accelerators.length>0){let a=q.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(b=>{let c=u(b.x),d=v(b.y),e=`
|
|
1
|
+
"use strict";exports.id=358,exports.ids=[358],exports.modules={50358:(a,b,c)=>{c.d(b,{diagram:()=>K});var d=c(25215),e=c(93273),f=c(46629),g=c(21143),h=c(92325),i=(0,g.K2)((a,b)=>{let c=a<=1?100*a:a;if(c<0||c>100)throw Error(`${b} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return c},"toPercent"),j=(0,g.K2)((a,b,c)=>({x:i(b,`${c} evolution`),y:i(a,`${c} visibility`)}),"toCoordinates"),k=(0,g.K2)(a=>{if(a){if("+<>"===a)return"bidirectional";if("+<"===a)return"backward";if("+>"===a)return"forward"}},"getFlowFromPort"),l=(0,g.K2)(a=>{if(!a?.startsWith("+"))return{};let b=/^\+'([^']*)'/.exec(a),c=b?.[1];return a.includes("<>")?{flow:"bidirectional",label:c}:a.includes("<")?{flow:"backward",label:c}:a.includes(">")?{flow:"forward",label:c}:{label:c}},"extractFlowFromArrow"),m=(0,g.K2)((a,b)=>{if((0,e.S)(a,b),a.size&&b.setSize(a.size.width,a.size.height),a.evolution){let c=a.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),d=a.evolution.stages.filter(a=>void 0!==a.boundary).map(a=>a.boundary);b.updateAxes({stages:c,stageBoundaries:d})}if(a.anchors.forEach(a=>{let c=j(a.visibility,a.evolution,`Anchor "${a.name}"`);b.addNode(a.name,a.name,c.x,c.y,"anchor")}),a.components.forEach(a=>{let c=j(a.visibility,a.evolution,`Component "${a.name}"`),d=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,e=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,f=a.decorator?.strategy;b.addNode(a.name,a.name,c.x,c.y,"component",d,e,a.inertia,f)}),a.notes.forEach(a=>{let c=j(a.visibility,a.evolution,`Note "${a.text}"`);b.addNote(a.text,c.x,c.y)}),a.pipelines.forEach(a=>{let c=b.getNode(a.parent);if(!c||"number"!=typeof c.y)throw Error(`Pipeline "${a.parent}" must reference an existing component with coordinates.`);let d=c.y;b.startPipeline(a.parent),a.components.forEach(c=>{let e=`${a.parent}_${c.name}`,f=c.label?(c.label.negX?-1:1)*c.label.offsetX:void 0,g=c.label?(c.label.negY?-1:1)*c.label.offsetY:void 0,h=i(c.evolution,`Pipeline component "${c.name}" evolution`);b.addNode(e,c.name,h,d,"pipeline-component",f,g),b.addPipelineComponent(a.parent,e)})}),a.links.forEach(a=>{let c=!!a.arrow&&(a.arrow.includes("-.->")||a.arrow.includes(".-.")),d=k(a.fromPort)??k(a.toPort),{flow:e,label:f}=l(a.arrow);!d&&e&&(d=e);let g=a.linkLabel;b.addLink(a.from,a.to,c,f??g,d)}),a.evolves.forEach(a=>{let c=b.getNode(a.component);if(c?.y!==void 0){let d=i(a.target,`Evolve target for "${a.component}"`);b.addTrend(a.component,d,c.y)}}),a.annotations.length>0){let c=a.annotations[0],d=j(c.x,c.y,"Annotations box");b.setAnnotationsBox(d.x,d.y)}a.annotation.forEach(a=>{let c=j(a.x,a.y,`Annotation ${a.number}`);b.addAnnotation(a.number,[{x:c.x,y:c.y}],a.text)}),a.accelerators.forEach(a=>{let c=j(a.x,a.y,`Accelerator "${a.name}"`);b.addAccelerator(a.name,c.x,c.y)}),a.deaccelerators.forEach(a=>{let c=j(a.x,a.y,`Deaccelerator "${a.name}"`);b.addDeaccelerator(a.name,c.x,c.y)})},"populateDb"),n={parser:{yy:void 0},parse:(0,g.K2)(async a=>{let b=await (0,h.qg)("wardley",a);g.Rm.debug(b);let c=n.parser?.yy;if(!c||"function"!=typeof c.addNode)throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m(b,c)},"parse")},o=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{(0,g.K2)(this,"WardleyBuilder")}addNode(a){let b=this.nodes.get(a.id)??{id:a.id,label:a.label},c={...b,...a,className:a.className??b.className,labelOffsetX:a.labelOffsetX??b.labelOffsetX,labelOffsetY:a.labelOffsetY??b.labelOffsetY};this.nodes.set(a.id,c)}addLink(a){this.links.push(a)}addTrend(a){this.trends.set(a.nodeId,a)}startPipeline(a){this.pipelines.set(a,{nodeId:a,componentIds:[]});let b=this.nodes.get(a);b&&(b.isPipelineParent=!0)}addPipelineComponent(a,b){let c=this.pipelines.get(a);c&&c.componentIds.push(b);let d=this.nodes.get(b);d&&(d.inPipeline=!0)}addAnnotation(a){this.annotations.push(a)}addNote(a){this.notes.push(a)}addAccelerator(a){this.accelerators.push(a)}addDeaccelerator(a){this.deaccelerators.push(a)}setAnnotationsBox(a,b){this.annotationsBox={x:a,y:b}}setAxes(a){this.axes={...this.axes,...a}}setSize(a,b){this.size={width:a,height:b}}getNode(a){return this.nodes.get(a)}build(){let a=[];for(let b of this.nodes.values()){if("number"!=typeof b.x||"number"!=typeof b.y)throw Error(`Node "${b.label}" is missing coordinates`);a.push(b)}return{nodes:a,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function p(a){let b=(0,f.D7)();return(0,f.jZ)(a.trim(),b)}function q(){return(0,f.D7)()["wardley-beta"]}function r(a,b,c,d,e,f,g,h,i){o.addNode({id:a,label:p(b),x:c,y:d,className:e,labelOffsetX:f,labelOffsetY:g,inertia:h,sourceStrategy:i})}function s(a,b,c=!1,d,e){o.addLink({source:a,target:b,dashed:c,label:d,flow:e})}function t(a,b,c){o.addTrend({nodeId:a,targetX:b,targetY:c})}function u(a,b,c){o.addAnnotation({number:a,coordinates:b,text:c?p(c):void 0})}function v(a,b,c){o.addNote({text:p(a),x:b,y:c})}function w(a,b,c){o.addAccelerator({name:p(a),x:b,y:c})}function x(a,b,c){o.addDeaccelerator({name:p(a),x:b,y:c})}function y(a,b){o.setAnnotationsBox(a,b)}function z(a,b){o.setSize(a,b)}function A(a){o.startPipeline(a)}function B(a,b){o.addPipelineComponent(a,b)}function C(a){let b={};a.xLabel&&(b.xLabel=p(a.xLabel)),a.yLabel&&(b.yLabel=p(a.yLabel)),a.stages&&(b.stages=a.stages.map(a=>p(a))),a.stageBoundaries&&(b.stageBoundaries=a.stageBoundaries),o.setAxes(b)}function D(a){return o.getNode(a)}function E(){return o.build()}function F(){o.clear(),(0,f.IU)()}(0,g.K2)(p,"textSanitizer"),(0,g.K2)(q,"getConfig"),(0,g.K2)(r,"addNode"),(0,g.K2)(s,"addLink"),(0,g.K2)(t,"addTrend"),(0,g.K2)(u,"addAnnotation"),(0,g.K2)(v,"addNote"),(0,g.K2)(w,"addAccelerator"),(0,g.K2)(x,"addDeaccelerator"),(0,g.K2)(y,"setAnnotationsBox"),(0,g.K2)(z,"setSize"),(0,g.K2)(A,"startPipeline"),(0,g.K2)(B,"addPipelineComponent"),(0,g.K2)(C,"updateAxes"),(0,g.K2)(D,"getNode"),(0,g.K2)(E,"getWardleyData"),(0,g.K2)(F,"clear");var G={getConfig:q,addNode:r,addLink:s,addTrend:t,addAnnotation:u,addNote:v,addAccelerator:w,addDeaccelerator:x,setAnnotationsBox:y,setSize:z,startPipeline:A,addPipelineComponent:B,updateAxes:C,getNode:D,getWardleyData:E,clear:F,setAccTitle:f.SV,getAccTitle:f.iN,setDiagramTitle:f.ke,getDiagramTitle:f.ab,getAccDescription:f.m7,setAccDescription:f.EI},H=["Genesis","Custom Built","Product","Commodity"],I=(0,g.K2)(()=>{let{themeVariables:a}=(0,f.D7)();return{backgroundColor:a.wardley?.backgroundColor??a.background??"#fff",axisColor:a.wardley?.axisColor??"#000",axisTextColor:a.wardley?.axisTextColor??a.primaryTextColor??"#222",gridColor:a.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:a.wardley?.componentFill??"#fff",componentStroke:a.wardley?.componentStroke??"#000",componentLabelColor:a.wardley?.componentLabelColor??a.primaryTextColor??"#222",linkStroke:a.wardley?.linkStroke??"#000",evolutionStroke:a.wardley?.evolutionStroke??"#dc3545",annotationStroke:a.wardley?.annotationStroke??"#000",annotationTextColor:a.wardley?.annotationTextColor??a.primaryTextColor??"#222",annotationFill:a.wardley?.annotationFill??a.background??"#fff"}},"getTheme"),J=(0,g.K2)(()=>{let a=(0,f.D7)()["wardley-beta"];return{width:a?.width??900,height:a?.height??600,padding:a?.padding??48,nodeRadius:a?.nodeRadius??6,nodeLabelOffset:a?.nodeLabelOffset??8,axisFontSize:a?.axisFontSize??12,labelFontSize:a?.labelFontSize??10,showGrid:a?.showGrid??!1,useMaxWidth:a?.useMaxWidth??!0}},"getConfigValues"),K={parser:n,db:G,renderer:{draw:(0,g.K2)((a,b,c,e)=>{g.Rm.debug("Rendering Wardley map\n"+a);let h=J(),i=I(),j=1.6*h.nodeRadius,k=e.db,l=k.getWardleyData(),m=k.getDiagramTitle(),n=l.size?.width??h.width,o=l.size?.height??h.height,p=(0,d.D)(b);p.selectAll("*").remove(),(0,f.a$)(p,o,n,h.useMaxWidth),p.attr("viewBox",`0 0 ${n} ${o}`);let q=p.append("g").attr("class","wardley-map"),r=p.append("defs");r.append("marker").attr("id",`arrow-${b}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",i.evolutionStroke).attr("stroke","none"),r.append("marker").attr("id",`link-arrow-end-${b}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",i.linkStroke).attr("stroke","none"),r.append("marker").attr("id",`link-arrow-start-${b}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",i.linkStroke).attr("stroke","none"),q.append("rect").attr("class","wardley-background").attr("width",n).attr("height",o).attr("fill",i.backgroundColor);let s=n-2*h.padding,t=o-2*h.padding;m&&q.append("text").attr("class","wardley-title").attr("x",n/2).attr("y",h.padding/2).attr("fill",i.axisTextColor).attr("font-size",1.05*h.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(m);let u=(0,g.K2)(a=>h.padding+a/100*s,"projectX"),v=(0,g.K2)(a=>o-h.padding-a/100*t,"projectY"),w=q.append("g").attr("class","wardley-axes");w.append("line").attr("x1",h.padding).attr("x2",n-h.padding).attr("y1",o-h.padding).attr("y2",o-h.padding).attr("stroke",i.axisColor).attr("stroke-width",1),w.append("line").attr("x1",h.padding).attr("x2",h.padding).attr("y1",h.padding).attr("y2",o-h.padding).attr("stroke",i.axisColor).attr("stroke-width",1);let x=l.axes.xLabel??"Evolution",y=l.axes.yLabel??"Visibility";w.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",h.padding+s/2).attr("y",o-h.padding/4).attr("fill",i.axisTextColor).attr("font-size",h.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(x),w.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",h.padding/3).attr("y",h.padding+t/2).attr("fill",i.axisTextColor).attr("font-size",h.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${h.padding/3} ${h.padding+t/2})`).text(y);let z=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:H;if(z.length>0){let a=q.append("g").attr("class","wardley-stages"),b=l.axes.stageBoundaries,c=[];if(b&&b.length===z.length){let a=0;b.forEach(b=>{c.push({start:a,end:b}),a=b})}else{let a=1/z.length;z.forEach((b,d)=>{c.push({start:d*a,end:(d+1)*a})})}z.forEach((b,d)=>{let e=c[d],f=h.padding+e.start*s,g=(f+(h.padding+e.end*s))/2;d>0&&a.append("line").attr("x1",f).attr("x2",f).attr("y1",h.padding).attr("y2",o-h.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),a.append("text").attr("class","wardley-stage-label").attr("x",g).attr("y",o-h.padding/1.5).attr("fill",i.axisTextColor).attr("font-size",h.axisFontSize-2).attr("text-anchor","middle").text(b)})}if(h.showGrid){let a=q.append("g").attr("class","wardley-grid");for(let b=1;b<4;b++){let c=b/4,d=h.padding+s*c;a.append("line").attr("x1",d).attr("x2",d).attr("y1",h.padding).attr("y2",o-h.padding).attr("stroke",i.gridColor).attr("stroke-dasharray","2 6"),a.append("line").attr("x1",h.padding).attr("x2",n-h.padding).attr("y1",o-h.padding-t*c).attr("y2",o-h.padding-t*c).attr("stroke",i.gridColor).attr("stroke-dasharray","2 6")}}let A=new Map;if(l.nodes.forEach(a=>{A.set(a.id,{x:u(a.x),y:v(a.y),node:a})}),l.pipelines.length>0){let a=q.append("g").attr("class","wardley-pipelines"),b=q.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(c=>{if(0===c.componentIds.length)return;let d=c.componentIds.map(a=>({id:a,pos:A.get(a),node:l.nodes.find(b=>b.id===a)})).filter(a=>a.pos&&a.node).sort((a,b)=>a.node.x-b.node.x);for(let a=0;a<d.length-1;a++){let c=d[a],e=d[a+1];b.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",c.pos.x).attr("y1",c.pos.y).attr("x2",e.pos.x).attr("y2",e.pos.y).attr("stroke",i.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let e=1/0,f=-1/0,g=0;if(c.componentIds.forEach(a=>{let b=A.get(a);b&&(e=Math.min(e,b.x),f=Math.max(f,b.x),g=b.y)}),e!==1/0&&f!==-1/0){let b=4*h.nodeRadius,d=g-b/2,k=A.get(c.nodeId);k&&(k.x=(e+f)/2,k.y=d-j/6),a.append("rect").attr("class","wardley-pipeline-box").attr("x",e-15).attr("y",d).attr("width",f-e+30).attr("height",b).attr("fill","none").attr("stroke",i.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let B=q.append("g").attr("class","wardley-links"),C=new Map;l.pipelines.forEach(a=>{C.set(a.nodeId,new Set(a.componentIds))});let D=l.links.filter(a=>{if(!A.has(a.source)||!A.has(a.target))return!1;let b=C.get(a.target);return!b?.has(a.source)});B.selectAll("line").data(D).enter().append("line").attr("class",a=>`wardley-link${a.dashed?" wardley-link--dashed":""}`).attr("x1",a=>{let b=A.get(a.source),c=A.get(a.target),d=l.nodes.find(b=>b.id===a.source).isPipelineParent?j/Math.sqrt(2):h.nodeRadius,e=c.x-b.x,f=c.y-b.y,g=Math.sqrt(e*e+f*f);return b.x+e/g*d}).attr("y1",a=>{let b=A.get(a.source),c=A.get(a.target),d=l.nodes.find(b=>b.id===a.source).isPipelineParent?j/Math.sqrt(2):h.nodeRadius,e=c.x-b.x,f=c.y-b.y,g=Math.sqrt(e*e+f*f);return b.y+f/g*d}).attr("x2",a=>{let b=A.get(a.source),c=A.get(a.target),d=l.nodes.find(b=>b.id===a.target).isPipelineParent?j/Math.sqrt(2):h.nodeRadius,e=b.x-c.x,f=b.y-c.y,g=Math.sqrt(e*e+f*f);return c.x+e/g*d}).attr("y2",a=>{let b=A.get(a.source),c=A.get(a.target),d=l.nodes.find(b=>b.id===a.target).isPipelineParent?j/Math.sqrt(2):h.nodeRadius,e=b.x-c.x,f=b.y-c.y,g=Math.sqrt(e*e+f*f);return c.y+f/g*d}).attr("stroke",i.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",a=>a.dashed?"6 6":null).attr("marker-end",a=>"forward"===a.flow||"bidirectional"===a.flow?`url(#link-arrow-end-${b})`:null).attr("marker-start",a=>"backward"===a.flow||"bidirectional"===a.flow?`url(#link-arrow-start-${b})`:null),B.selectAll("text").data(D.filter(a=>a.label)).enter().append("text").attr("class","wardley-link-label").attr("x",a=>{let b=A.get(a.source),c=A.get(a.target),d=(b.x+c.x)/2,e=c.y-b.y,f=c.x-b.x,g=Math.sqrt(f*f+e*e);return d+e/g*8}).attr("y",a=>{let b=A.get(a.source),c=A.get(a.target),d=(b.y+c.y)/2,e=c.x-b.x,f=c.y-b.y,g=Math.sqrt(e*e+f*f);return d+-e/g*8}).attr("fill",i.axisTextColor).attr("font-size",h.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",a=>{let b=A.get(a.source),c=A.get(a.target),d=(b.x+c.x)/2,e=(b.y+c.y)/2,f=c.x-b.x,g=c.y-b.y,h=Math.sqrt(f*f+g*g),i=180*Math.atan2(g,f)/Math.PI;return(i>90||i<-90)&&(i+=180),`rotate(${i} ${d+g/h*8} ${e+-f/h*8})`}).text(a=>a.label);let E=q.append("g").attr("class","wardley-trends"),F=l.trends.map(a=>{let b=A.get(a.nodeId);if(!b)return null;let c=u(a.targetX),d=v(a.targetY),e=c-b.x,f=d-b.y,g=Math.sqrt(e*e+f*f),i=h.nodeRadius+2;return{origin:b,targetX:c,targetY:d,adjustedX2:g>i?c-e/g*i:c,adjustedY2:g>i?d-f/g*i:d}}).filter(a=>null!==a);E.selectAll("line").data(F).enter().append("line").attr("class","wardley-trend").attr("x1",a=>a.origin.x).attr("y1",a=>a.origin.y).attr("x2",a=>a.adjustedX2).attr("y2",a=>a.adjustedY2).attr("stroke",i.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${b})`);let G=q.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",a=>["wardley-node",a.className?`wardley-node--${a.className}`:""].filter(Boolean).join(" "));G.filter(a=>"outsource"===a.sourceStrategy).append("circle").attr("class","wardley-outsource-overlay").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",2*h.nodeRadius).attr("fill","#666").attr("stroke",i.componentStroke).attr("stroke-width",1),G.filter(a=>"buy"===a.sourceStrategy).append("circle").attr("class","wardley-buy-overlay").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",2*h.nodeRadius).attr("fill","#ccc").attr("stroke",i.componentStroke).attr("stroke-width",1),G.filter(a=>"build"===a.sourceStrategy).append("circle").attr("class","wardley-build-overlay").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",2*h.nodeRadius).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let K=G.filter(a=>"market"===a.sourceStrategy);K.append("circle").attr("class","wardley-market-overlay").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",2*h.nodeRadius).attr("fill","white").attr("stroke",i.componentStroke).attr("stroke-width",1),G.filter(a=>!a.isPipelineParent&&"market"!==a.sourceStrategy&&"anchor"!==a.className).append("circle").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y).attr("r",h.nodeRadius).attr("fill",i.componentFill).attr("stroke",i.componentStroke).attr("stroke-width",1);let L=.7*h.nodeRadius,M=1.2*h.nodeRadius;if(K.append("line").attr("class","wardley-market-line").attr("x1",a=>A.get(a.id).x).attr("y1",a=>A.get(a.id).y-M).attr("x2",a=>A.get(a.id).x-M*Math.cos(Math.PI/6)).attr("y2",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("stroke",i.componentStroke).attr("stroke-width",1),K.append("line").attr("class","wardley-market-line").attr("x1",a=>A.get(a.id).x-M*Math.cos(Math.PI/6)).attr("y1",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("x2",a=>A.get(a.id).x+M*Math.cos(Math.PI/6)).attr("y2",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("stroke",i.componentStroke).attr("stroke-width",1),K.append("line").attr("class","wardley-market-line").attr("x1",a=>A.get(a.id).x+M*Math.cos(Math.PI/6)).attr("y1",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("x2",a=>A.get(a.id).x).attr("y2",a=>A.get(a.id).y-M).attr("stroke",i.componentStroke).attr("stroke-width",1),K.append("circle").attr("class","wardley-market-dot").attr("cx",a=>A.get(a.id).x).attr("cy",a=>A.get(a.id).y-M).attr("r",L).attr("fill","white").attr("stroke",i.componentStroke).attr("stroke-width",2),K.append("circle").attr("class","wardley-market-dot").attr("cx",a=>A.get(a.id).x-M*Math.cos(Math.PI/6)).attr("cy",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("r",L).attr("fill","white").attr("stroke",i.componentStroke).attr("stroke-width",2),K.append("circle").attr("class","wardley-market-dot").attr("cx",a=>A.get(a.id).x+M*Math.cos(Math.PI/6)).attr("cy",a=>A.get(a.id).y+M*Math.sin(Math.PI/6)).attr("r",L).attr("fill","white").attr("stroke",i.componentStroke).attr("stroke-width",2),G.filter(a=>!0===a.isPipelineParent).append("rect").attr("x",a=>A.get(a.id).x-j/2).attr("y",a=>A.get(a.id).y-j/2).attr("width",j).attr("height",j).attr("fill",i.componentFill).attr("stroke",i.componentStroke).attr("stroke-width",1),G.filter(a=>!0===a.inertia).append("line").attr("class","wardley-inertia").attr("x1",a=>{let b=A.get(a.id),c=a.isPipelineParent?j/2+15:h.nodeRadius+15;return a.sourceStrategy&&(c+=h.nodeRadius+10),b.x+c}).attr("y1",a=>{let b=A.get(a.id),c=a.isPipelineParent?j:2*h.nodeRadius;return b.y-c/2}).attr("x2",a=>{let b=A.get(a.id),c=a.isPipelineParent?j/2+15:h.nodeRadius+15;return a.sourceStrategy&&(c+=h.nodeRadius+10),b.x+c}).attr("y2",a=>{let b=A.get(a.id),c=a.isPipelineParent?j:2*h.nodeRadius;return b.y+c/2}).attr("stroke",i.componentStroke).attr("stroke-width",6),G.append("text").attr("x",a=>{let b=A.get(a.id);if("anchor"===a.className)return void 0!==a.labelOffsetX?b.x+a.labelOffsetX:b.x;let c=h.nodeLabelOffset;a.sourceStrategy&&void 0===a.labelOffsetX&&(c+=10);let d=a.labelOffsetX??c;return b.x+d}).attr("y",a=>{let b=A.get(a.id);if("anchor"===a.className)return void 0!==a.labelOffsetY?b.y+a.labelOffsetY:b.y-3;let c=-h.nodeLabelOffset;a.sourceStrategy&&void 0===a.labelOffsetY&&(c-=10);let d=a.labelOffsetY??c;return b.y+d}).attr("class","wardley-node-label").attr("fill",a=>"evolved"===a.className?i.evolutionStroke:"anchor"===a.className?"#000":i.componentLabelColor).attr("font-size",h.labelFontSize).attr("font-weight",a=>"anchor"===a.className?"bold":"normal").attr("text-anchor",a=>"anchor"===a.className?"middle":"start").attr("dominant-baseline",a=>"anchor"===a.className?"middle":"auto").text(a=>a.label),l.annotations.length>0){let a=q.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(b=>{let c=b.coordinates.map(a=>({x:u(a.x),y:v(a.y)}));if(c.length>1)for(let b=0;b<c.length-1;b++)a.append("line").attr("class","wardley-annotation-line").attr("x1",c[b].x).attr("y1",c[b].y).attr("x2",c[b+1].x).attr("y2",c[b+1].y).attr("stroke",i.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");c.forEach(c=>{let d=a.append("g").attr("class","wardley-annotation");d.append("circle").attr("cx",c.x).attr("cy",c.y).attr("r",10).attr("fill","white").attr("stroke",i.axisColor).attr("stroke-width",1.5),d.append("text").attr("x",c.x).attr("y",c.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",i.axisTextColor).attr("font-weight","bold").text(b.number)})}),l.annotationsBox){let b=u(l.annotationsBox.x),c=v(l.annotationsBox.y),d=a.append("g").attr("class","wardley-annotations-box"),e=[...l.annotations].filter(a=>a.text).sort((a,b)=>a.number-b.number),f=[];if(e.forEach((a,e)=>{let g=d.append("text").attr("x",b+10).attr("y",c+10+(e+1)*16).attr("font-size",11).attr("fill",i.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${a.number}. ${a.text}`);f.push(g)}),f.length>0){let a=0,g=0;f.forEach(b=>{let c=b.node(),d=c.getComputedTextLength();a=Math.max(a,d);let e=c.getBBox();g=Math.max(g,e.height)});let j=a+20+105,k=16*e.length+20+g/2,l=h.padding,m=n-h.padding-j,p=h.padding,q=o-h.padding-k;b=Math.max(l,Math.min(b,m)),c=Math.max(p,Math.min(c,q)),f.forEach((a,d)=>{a.attr("x",b+10).attr("y",c+10+(d+1)*16)}),d.insert("rect","text").attr("x",b).attr("y",c).attr("width",j).attr("height",k).attr("fill","white").attr("stroke",i.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){let a=q.append("g").attr("class","wardley-notes");l.notes.forEach(b=>{let c=u(b.x),d=v(b.y);a.append("text").attr("x",c).attr("y",d).attr("text-anchor","start").attr("font-size",11).attr("fill",i.axisTextColor).attr("font-weight","bold").text(b.text)})}if(l.accelerators.length>0){let a=q.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(b=>{let c=u(b.x),d=v(b.y),e=`
|
|
2
2
|
M ${c} ${d-15}
|
|
3
3
|
L ${c+60-20} ${d-15}
|
|
4
4
|
L ${c+60-20} ${d-15-8}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.id=4365,exports.ids=[4365],exports.modules={93273:(a,b,c)=>{function d(a,b){a.accDescr&&b.setAccDescription?.(a.accDescr),a.accTitle&&b.setAccTitle?.(a.accTitle),a.title&&b.setDiagramTitle?.(a.title)}c.d(b,{S:()=>d}),(0,c(21143).K2)(d,"populateCommonDb")},94365:(a,b,c)=>{c.d(b,{diagram:()=>H});var d=c(
|
|
1
|
+
"use strict";exports.id=4365,exports.ids=[4365],exports.modules={93273:(a,b,c)=>{function d(a,b){a.accDescr&&b.setAccDescription?.(a.accDescr),a.accTitle&&b.setAccTitle?.(a.accTitle),a.title&&b.setDiagramTitle?.(a.title)}c.d(b,{S:()=>d}),(0,c(21143).K2)(d,"populateCommonDb")},94365:(a,b,c)=>{c.d(b,{diagram:()=>H});var d=c(25215),e=c(93273),f=c(40684),g=c(46629),h=c(21143),i=c(92325),j={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},k={axes:[],curves:[],options:j},l=structuredClone(k),m=g.UI.radar,n=(0,h.K2)(()=>(0,f.$t)({...m,...(0,g.zj)().radar}),"getConfig"),o=(0,h.K2)(()=>l.axes,"getAxes"),p=(0,h.K2)(()=>l.curves,"getCurves"),q=(0,h.K2)(()=>l.options,"getOptions"),r=(0,h.K2)(a=>{l.axes=a.map(a=>({name:a.name,label:a.label??a.name}))},"setAxes"),s=(0,h.K2)(a=>{l.curves=a.map(a=>({name:a.name,label:a.label??a.name,entries:t(a.entries)}))},"setCurves"),t=(0,h.K2)(a=>{if(void 0==a[0].axis)return a.map(a=>a.value);let b=o();if(0===b.length)throw Error("Axes must be populated before curves for reference entries");return b.map(b=>{let c=a.find(a=>a.axis?.$refText===b.name);if(void 0===c)throw Error("Missing entry for axis "+b.label);return c.value})},"computeCurveEntries"),u={getAxes:o,getCurves:p,getOptions:q,setAxes:r,setCurves:s,setOptions:(0,h.K2)(a=>{let b=a.reduce((a,b)=>(a[b.name]=b,a),{});l.options={showLegend:b.showLegend?.value??j.showLegend,ticks:b.ticks?.value??j.ticks,max:b.max?.value??j.max,min:b.min?.value??j.min,graticule:b.graticule?.value??j.graticule}},"setOptions"),getConfig:n,clear:(0,h.K2)(()=>{(0,g.IU)(),l=structuredClone(k)},"clear"),setAccTitle:g.SV,getAccTitle:g.iN,setDiagramTitle:g.ke,getDiagramTitle:g.ab,getAccDescription:g.m7,setAccDescription:g.EI},v=(0,h.K2)(a=>{(0,e.S)(a,u);let{axes:b,curves:c,options:d}=a;u.setAxes(b),u.setCurves(c),u.setOptions(d)},"populate"),w={parse:(0,h.K2)(async a=>{let b=await (0,i.qg)("radar",a);h.Rm.debug(b),v(b)},"parse")},x=(0,h.K2)((a,b,c,e)=>{let f=e.db,g=f.getAxes(),h=f.getCurves(),i=f.getOptions(),j=f.getConfig(),k=f.getDiagramTitle(),l=y((0,d.D)(b),j),m=i.max??Math.max(...h.map(a=>Math.max(...a.entries))),n=i.min,o=Math.min(j.width,j.height)/2;z(l,g,o,i.ticks,i.graticule),A(l,g,o,j),B(l,g,h,n,m,i.graticule,j),E(l,h,i.showLegend,j),l.append("text").attr("class","radarTitle").text(k).attr("x",0).attr("y",-j.height/2-j.marginTop)},"draw"),y=(0,h.K2)((a,b)=>{let c=b.width+b.marginLeft+b.marginRight,d=b.height+b.marginTop+b.marginBottom,e={x:b.marginLeft+b.width/2,y:b.marginTop+b.height/2};return(0,g.a$)(a,d,c,b.useMaxWidth??!0),a.attr("viewBox",`0 0 ${c} ${d}`),a.append("g").attr("transform",`translate(${e.x}, ${e.y})`)},"drawFrame"),z=(0,h.K2)((a,b,c,d,e)=>{if("circle"===e)for(let b=0;b<d;b++){let e=c*(b+1)/d;a.append("circle").attr("r",e).attr("class","radarGraticule")}else if("polygon"===e){let e=b.length;for(let f=0;f<d;f++){let g=c*(f+1)/d,h=b.map((a,b)=>{let c=2*b*Math.PI/e-Math.PI/2,d=g*Math.cos(c),f=g*Math.sin(c);return`${d},${f}`}).join(" ");a.append("polygon").attr("points",h).attr("class","radarGraticule")}}},"drawGraticule"),A=(0,h.K2)((a,b,c,d)=>{let e=b.length;for(let f=0;f<e;f++){let g=b[f].label,h=2*f*Math.PI/e-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",c*d.axisScaleFactor*Math.cos(h)).attr("y2",c*d.axisScaleFactor*Math.sin(h)).attr("class","radarAxisLine"),a.append("text").text(g).attr("x",c*d.axisLabelFactor*Math.cos(h)).attr("y",c*d.axisLabelFactor*Math.sin(h)).attr("class","radarAxisLabel")}},"drawAxes");function B(a,b,c,d,e,f,g){let h=b.length,i=Math.min(g.width,g.height)/2;c.forEach((b,c)=>{if(b.entries.length!==h)return;let j=b.entries.map((a,b)=>{let c=2*Math.PI*b/h-Math.PI/2,f=C(a,d,e,i);return{x:f*Math.cos(c),y:f*Math.sin(c)}});"circle"===f?a.append("path").attr("d",D(j,g.curveTension)).attr("class",`radarCurve-${c}`):"polygon"===f&&a.append("polygon").attr("points",j.map(a=>`${a.x},${a.y}`).join(" ")).attr("class",`radarCurve-${c}`)})}function C(a,b,c,d){return d*(Math.min(Math.max(a,b),c)-b)/(c-b)}function D(a,b){let c=a.length,d=`M${a[0].x},${a[0].y}`;for(let e=0;e<c;e++){let f=a[(e-1+c)%c],g=a[e],h=a[(e+1)%c],i=a[(e+2)%c],j={x:g.x+(h.x-f.x)*b,y:g.y+(h.y-f.y)*b},k={x:h.x-(i.x-g.x)*b,y:h.y-(i.y-g.y)*b};d+=` C${j.x},${j.y} ${k.x},${k.y} ${h.x},${h.y}`}return`${d} Z`}function E(a,b,c,d){if(!c)return;let e=(d.width/2+d.marginRight)*3/4,f=-(3*(d.height/2+d.marginTop))/4;b.forEach((b,c)=>{let d=a.append("g").attr("transform",`translate(${e}, ${f+20*c})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(b.label)})}(0,h.K2)(B,"drawCurves"),(0,h.K2)(C,"relativeRadius"),(0,h.K2)(D,"closedRoundCurve"),(0,h.K2)(E,"drawLegend");var F=(0,h.K2)((a,b)=>{let c="";for(let d=0;d<a.THEME_COLOR_LIMIT;d++){let e=a[`cScale${d}`];c+=`
|
|
2
2
|
.radarCurve-${d} {
|
|
3
3
|
color: ${e};
|
|
4
4
|
fill: ${e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.id=4407,exports.ids=[4407],exports.modules={44407:(a,b,c)=>{c.d(b,{diagram:()=>aq});var d,e=c(47596),f=c(40684),g=c(46629),h=c(21143),i=c(69085),j=c(67821),k=c(57689);let l=(a,b)=>(0,k.A)(a,"a",-b);var m=c(61255),n=c(30089);function o(a,b){let c=function(a){let b=[];for(let c=0;c<a.length;++c)for(let d=c+1;d<a.length;++d)for(let e of s(a[c],a[d]))e.parentIndex=[c,d],b.push(e);return b}(a),d=c.filter(b=>{var c;return c=b,a.every(a=>q(c,a)<a.radius+1e-10)}),e=0,f=0,g=[];if(d.length>1){let b=t(d);for(let a=0;a<d.length;++a){let c=d[a];c.angle=Math.atan2(c.x-b.x,c.y-b.y)}d.sort((a,b)=>b.angle-a.angle);let c=d[d.length-1];for(let b=0;b<d.length;++b){let h=d[b];f+=(c.x+h.x)*(h.y-c.y);let i={x:(h.x+c.x)/2,y:(h.y+c.y)/2},j=null;for(let b=0;b<h.parentIndex.length;++b)if(c.parentIndex.includes(h.parentIndex[b])){let d=a[h.parentIndex[b]],e=Math.atan2(h.x-d.x,h.y-d.y),f=Math.atan2(c.x-d.x,c.y-d.y),g=f-e;g<0&&(g+=2*Math.PI);let k=f-g/2,l=q(i,{x:d.x+d.radius*Math.sin(k),y:d.y+d.radius*Math.cos(k)});l>2*d.radius&&(l=2*d.radius),(null==j||j.width>l)&&(j={circle:d,width:l,p1:h,p2:c,large:l>d.radius,sweep:!0})}null!=j&&(g.push(j),e+=p(j.circle.radius,j.width),c=h)}}else{let b=a[0];for(let c=1;c<a.length;++c)a[c].radius<b.radius&&(b=a[c]);let c=!1;for(let d=0;d<a.length;++d)if(q(a[d],b)>Math.abs(b.radius-a[d].radius)){c=!0;break}c?e=f=0:(e=b.radius*b.radius*Math.PI,g.push({circle:b,p1:{x:b.x,y:b.y+b.radius},p2:{x:b.x-1e-10,y:b.y+b.radius},width:2*b.radius,large:!0,sweep:!0}))}return f/=2,b&&(b.area=e+f,b.arcArea=e,b.polygonArea=f,b.arcs=g,b.innerPoints=d,b.intersectionPoints=c),e+f}function p(a,b){return a*a*Math.acos(1-b/a)-(a-b)*Math.sqrt(b*(2*a-b))}function q(a,b){return Math.sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y))}function r(a,b,c){return c>=a+b?0:c<=Math.abs(a-b)?Math.PI*Math.min(a,b)*Math.min(a,b):p(a,a-(c*c-b*b+a*a)/(2*c))+p(b,b-(c*c-a*a+b*b)/(2*c))}function s(a,b){let c=q(a,b),d=a.radius,e=b.radius;if(c>=d+e||c<=Math.abs(d-e))return[];let f=(d*d-e*e+c*c)/(2*c),g=Math.sqrt(d*d-f*f),h=a.x+f*(b.x-a.x)/c,i=a.y+f*(b.y-a.y)/c,j=-(b.y-a.y)*(g/c),k=-(b.x-a.x)*(g/c);return[{x:h+j,y:i-k},{x:h-j,y:i+k}]}function t(a){let b={x:0,y:0};for(let c of a)b.x+=c.x,b.y+=c.y;return b.x/=a.length,b.y/=a.length,b}function u(a){let b=Array(a);for(let c=0;c<a;++c)b[c]=0;return b}function v(a,b){return u(a).map(()=>u(b))}function w(a,b){let c=0;for(let d=0;d<a.length;++d)c+=a[d]*b[d];return c}function x(a){return Math.sqrt(w(a,a))}function y(a,b,c){for(let d=0;d<b.length;++d)a[d]=b[d]*c}function z(a,b,c,d,e){for(let f=0;f<a.length;++f)a[f]=b*c[f]+d*e[f]}function A(a,b,c){let d,e=(c=c||{}).maxIterations||200*b.length,f=c.nonZeroDelta||1.05,g=c.zeroDelta||.001,h=c.minErrorDelta||1e-6,i=c.minErrorDelta||1e-5,j=void 0!==c.rho?c.rho:1,k=void 0!==c.chi?c.chi:2,l=void 0!==c.psi?c.psi:-.5,m=void 0!==c.sigma?c.sigma:.5,n=b.length,o=Array(n+1);o[0]=b,o[0].fx=a(b),o[0].id=0;for(let c=0;c<n;++c){let d=b.slice();d[c]=d[c]?d[c]*f:g,o[c+1]=d,o[c+1].fx=a(d),o[c+1].id=c+1}function p(a){for(let b=0;b<a.length;b++)o[n][b]=a[b];o[n].fx=a.fx}let q=(a,b)=>a.fx-b.fx,r=b.slice(),s=b.slice(),t=b.slice(),u=b.slice();for(let b=0;b<e;++b){if(o.sort(q),c.history){let a=o.map(a=>{let b=a.slice();return b.fx=a.fx,b.id=a.id,b});a.sort((a,b)=>a.id-b.id),c.history.push({x:o[0].slice(),fx:o[0].fx,simplex:a})}d=0;for(let a=0;a<n;++a)d=Math.max(d,Math.abs(o[0][a]-o[1][a]));if(Math.abs(o[0].fx-o[n].fx)<h&&d<i)break;for(let a=0;a<n;++a){r[a]=0;for(let b=0;b<n;++b)r[a]+=o[b][a];r[a]/=n}let b=o[n];if(z(s,1+j,r,-j,b),s.fx=a(s),s.fx<o[0].fx)z(u,1+k,r,-k,b),u.fx=a(u),p(u.fx<s.fx?u:s);else if(s.fx>=o[n-1].fx){let c=!1;if(s.fx>b.fx?(z(t,1+l,r,-l,b),t.fx=a(t),t.fx<b.fx?p(t):c=!0):(z(t,1-l*j,r,l*j,b),t.fx=a(t),t.fx<s.fx?p(t):c=!0),c){if(m>=1)break;for(let b=1;b<o.length;++b)z(o[b],1-m,o[0],m,o[b]),o[b].fx=a(o[b])}}else p(s)}return o.sort(q),{fx:o[0].fx,x:o[0]}}function B(a,b={}){b.maxIterations=b.maxIterations||500;let c=b.initialLayout||D,d=b.lossFunction||E,e=function(a,b={}){let c=b.distinct,d=a.map(a=>Object.assign({},a));function e(a){return a.join(";")}if(c){let a=new Map;for(let b of d)for(let c=0;c<b.sets.length;c++){let d=String(b.sets[c]);a.set(d,b.size+(a.get(d)||0));for(let e=c+1;e<b.sets.length;e++){let c=String(b.sets[e]),f=`${d};${c}`,g=`${c};${d}`;a.set(f,b.size+(a.get(f)||0)),a.set(g,b.size+(a.get(g)||0))}}for(let b of d)b.sets.length<3&&(b.size=a.get(e(b.sets)))}let f=[],g=new Set;for(let a of d)if(1===a.sets.length)f.push(a.sets[0]);else if(2===a.sets.length){let b=a.sets[0],c=a.sets[1];g.add(e(a.sets)),g.add(e([c,b]))}f.sort((a,b)=>a===b?0:a<b?-1:1);for(let a=0;a<f.length;++a){let b=f[a];for(let c=a+1;c<f.length;++c){let a=f[c];g.has(e([b,a]))||d.push({sets:[b,a],size:0})}}return d}(a,b),f=c(e,b),g=Object.keys(f),h=[];for(let a of g)h.push(f[a].x),h.push(f[a].y);let i=A(a=>{let b={};for(let c=0;c<g.length;++c){let d=g[c];b[d]={x:a[2*c],y:a[2*c+1],radius:f[d].radius}}return d(b,e)},h,b).x;for(let a=0;a<g.length;++a){let b=g[a];f[b].x=i[2*a],f[b].y=i[2*a+1]}return f}function C(a,b,c){return Math.min(a,b)*Math.min(a,b)*Math.PI<=c+1e-10?Math.abs(a-b):function(a,b,c,d){let e=(d=d||{}).maxIterations||100,f=d.tolerance||1e-10,g=a(b),h=a(c),i=c-b;if(g*h>0)throw"Initial bisect points must have opposite signs";if(0===g)return b;if(0===h)return c;for(let c=0;c<e;++c){let c=b+(i/=2),d=a(c);if(d*g>=0&&(b=c),Math.abs(i)<f||0===d)return c}return b+i}(d=>r(a,b,d)-c,0,a+b)}function D(a,b={}){let c=function(a,b){let c=b&&b.lossFunction?b.lossFunction:E,d={},e={};for(let b of a)if(1===b.sets.length){let a=b.sets[0];d[a]={x:1e10,y:1e10,rowid:d.length,size:b.size,radius:Math.sqrt(b.size/Math.PI)},e[a]=[]}for(let b of a=a.filter(a=>2===a.sets.length)){let a=null!=b.weight?b.weight:1,c=b.sets[0],f=b.sets[1];b.size+1e-10>=Math.min(d[c].size,d[f].size)&&(a=0),e[c].push({set:f,size:b.size,weight:a}),e[f].push({set:c,size:b.size,weight:a})}let f=[];function g(a,b){return b.size-a.size}Object.keys(e).forEach(a=>{let b=0;for(let c=0;c<e[a].length;++c)b+=e[a][c].size*e[a][c].weight;f.push({set:a,size:b})}),f.sort(g);let h={};function i(a){return a.set in h}function j(a,b){d[b].x=a.x,d[b].y=a.y,h[b]=!0}j({x:0,y:0},f[0].set);for(let b=1;b<f.length;++b){let h=f[b].set,l=e[h].filter(i),m=d[h];if(l.sort(g),0===l.length)throw"ERROR: missing pairwise overlap information";let n=[];for(var k=0;k<l.length;++k){let a=d[l[k].set],b=C(m.radius,a.radius,l[k].size);n.push({x:a.x+b,y:a.y}),n.push({x:a.x-b,y:a.y}),n.push({y:a.y+b,x:a.x}),n.push({y:a.y-b,x:a.x});for(let c=k+1;c<l.length;++c){let e=d[l[c].set],f=C(m.radius,e.radius,l[c].size),g=s({x:a.x,y:a.y,radius:b},{x:e.x,y:e.y,radius:f});n.push(...g)}}let o=1e50,p=n[0];for(let b of n){d[h].x=b.x,d[h].y=b.y;let e=c(d,a);e<o&&(o=e,p=b)}j(p,h)}return d}(a,b),d=b.lossFunction||E;if(a.length>=8){let e=function(a,b={}){let c,d,e=b.restarts||10,f=[],g={};for(let b of a)1===b.sets.length&&(g[b.sets[0]]=f.length,f.push(b));let{distances:h,constraints:i}=(c=v(f.length,f.length),d=v(f.length,f.length),a.filter(a=>2===a.sets.length).forEach(a=>{let b=g[a.sets[0]],e=g[a.sets[1]],h=C(Math.sqrt(f[b].size/Math.PI),Math.sqrt(f[e].size/Math.PI),a.size);c[b][e]=c[e][b]=h;let i=0;a.size+1e-10>=Math.min(f[b].size,f[e].size)?i=1:a.size<=1e-10&&(i=-1),d[b][e]=d[e][b]=i}),{distances:c,constraints:d}),j=x(h.map(x))/h.length;h=h.map(a=>a.map(a=>a/j));let k=(a,b)=>(function(a,b,c,d){for(let a=0;a<b.length;++a)b[a]=0;let e=0;for(let f=0;f<c.length;++f){let g=a[2*f],h=a[2*f+1];for(let i=f+1;i<c.length;++i){let j=a[2*i],k=a[2*i+1],l=c[f][i],m=d[f][i],n=(j-g)*(j-g)+(k-h)*(k-h),o=Math.sqrt(n),p=n-l*l;m>0&&o<=l||m<0&&o>=l||(e+=2*p*p,b[2*f]+=4*p*(g-j),b[2*f+1]+=4*p*(h-k),b[2*i]+=4*p*(j-g),b[2*i+1]+=4*p*(k-h))}}return e})(a,b,h,i),l=null;for(let a=0;a<e;++a){let a=function(a,b,c){let d,e,f,g={x:b.slice(),fx:0,fxprime:b.slice()},h={x:b.slice(),fx:0,fxprime:b.slice()},i=b.slice(),j=1;f=(c=c||{}).maxIterations||20*b.length,g.fx=a(g.x,g.fxprime),y(d=g.fxprime.slice(),g.fxprime,-1);for(let b=0;b<f;++b){if(j=function(a,b,c,d,e,f,g){let h=c.fx,i=w(c.fxprime,b),j=h,k=h,l=i,m=0;function n(k,m,n){for(let o=0;o<16;++o)if(e=(k+m)/2,z(d.x,1,c.x,e,b),j=d.fx=a(d.x,d.fxprime),l=w(d.fxprime,b),j>h+f*e*i||j>=n)m=e;else{if(Math.abs(l)<=-g*i)return e;l*(m-k)>=0&&(m=k),k=e,n=j}return 0}e=e||1,f=f||1e-6,g=g||.1;for(let o=0;o<10;++o){if(z(d.x,1,c.x,e,b),j=d.fx=a(d.x,d.fxprime),l=w(d.fxprime,b),j>h+f*e*i||o&&j>=k)return n(m,e,k);if(Math.abs(l)<=-g*i)break;if(l>=0)return n(e,m,j);k=j,m=e,e*=2}return e}(a,d,g,h,j),c.history&&c.history.push({x:g.x.slice(),fx:g.fx,fxprime:g.fxprime.slice(),alpha:j}),j){z(i,1,h.fxprime,-1,g.fxprime);let a=w(g.fxprime,g.fxprime);z(d,Math.max(0,w(i,h.fxprime)/a),d,-1,h.fxprime),e=g,g=h,h=e}else y(d,g.fxprime,-1);if(1e-5>=x(g.fxprime))break}return c.history&&c.history.push({x:g.x.slice(),fx:g.fx,fxprime:g.fxprime.slice(),alpha:j}),g}(k,u(2*h.length).map(Math.random),b);(!l||a.fx<l.fx)&&(l=a)}let m=l.x,n={};for(let a=0;a<f.length;++a){let b=f[a];n[b.sets[0]]={x:m[2*a]*j,y:m[2*a+1]*j,radius:Math.sqrt(b.size/Math.PI)}}if(b.history)for(let a of b.history)y(a.x,j);return n}(a,b);d(e,a)+1e-8<d(c,a)&&(c=e)}return c}function E(a,b){let c=0;for(let d of b){let b;if(1!==d.sets.length){if(2===d.sets.length){let c=a[d.sets[0]],e=a[d.sets[1]];b=r(c.radius,e.radius,q(c,e))}else b=o(d.sets.map(b=>a[b]));c+=(null!=d.weight?d.weight:1)*(b-d.size)*(b-d.size)}}return c}function F(a,b){let c=0;for(let d of b){let b;if(1===d.sets.length)continue;if(2===d.sets.length){let c=a[d.sets[0]],e=a[d.sets[1]];b=r(c.radius,e.radius,q(c,e))}else b=o(d.sets.map(b=>a[b]));let e=null!=d.weight?d.weight:1,f=Math.log((b+1)/(d.size+1));c+=e*f*f}return c}function G(a){let b=b=>({max:a.reduce((a,c)=>Math.max(a,c[b]+c.radius),-1/0),min:a.reduce((a,c)=>Math.min(a,c[b]-c.radius),1/0)});return{xRange:b("x"),yRange:b("y")}}function H(a,b,c){null==b&&(b=Math.PI/2);let d=K(a).map(a=>Object.assign({},a)),e=function(a){function b(a){return a.parent!==a&&(a.parent=b(a.parent)),a.parent}a.forEach(a=>{a.parent=a});for(let e=0;e<a.length;++e)for(let f=e+1;f<a.length;++f){var c,d;let g=a[e].radius+a[f].radius;q(a[e],a[f])+1e-10<g&&(c=a[f],d=a[e],b(c).parent=b(d))}let e=new Map;for(let c=0;c<a.length;++c){let d=b(a[c]).parent.setid;e.has(d)||e.set(d,[]),e.get(d).push(a[c])}return a.forEach(a=>{delete a.parent}),Array.from(e.values())}(d);for(let a of e){!function(a,b,c){if(null==c?a.sort((a,b)=>b.radius-a.radius):a.sort(c),a.length>0){let b=a[0].x,c=a[0].y;for(let d of a)d.x-=b,d.y-=c}if(2===a.length&&q(a[0],a[1])<Math.abs(a[1].radius-a[0].radius)&&(a[1].x=a[0].x+a[0].radius-a[1].radius-1e-10,a[1].y=a[0].y),a.length>1){let c=Math.atan2(a[1].x,a[1].y)-b,d=Math.cos(c),e=Math.sin(c);for(let b of a){let a=b.x,c=b.y;b.x=d*a-e*c,b.y=e*a+d*c}}if(a.length>2){let c=Math.atan2(a[2].x,a[2].y)-b;for(;c<0;)c+=2*Math.PI;for(;c>2*Math.PI;)c-=2*Math.PI;if(c>Math.PI){let b=a[1].y/(1e-10+a[1].x);for(let c of a){var d=(c.x+b*c.y)/(1+b*b);c.x=2*d-c.x,c.y=2*d*b-c.y}}}}(a,b,c);let d=G(a);a.size=(d.xRange.max-d.xRange.min)*(d.yRange.max-d.yRange.min),a.bounds=d}e.sort((a,b)=>b.size-a.size);let f=(d=e[0]).bounds,g=(f.xRange.max-f.xRange.min)/50;function h(a,b,c){let e,h;if(!a)return;let i=a.bounds;if(b)e=f.xRange.max-i.xRange.min+g;else{e=f.xRange.max-i.xRange.max;let a=(i.xRange.max-i.xRange.min)/2-(f.xRange.max-f.xRange.min)/2;a<0&&(e+=a)}if(c)h=f.yRange.max-i.yRange.min+g;else{h=f.yRange.max-i.yRange.max;let a=(i.yRange.max-i.yRange.min)/2-(f.yRange.max-f.yRange.min)/2;a<0&&(h+=a)}for(let b of a)b.x+=e,b.y+=h,d.push(b)}let i=1;for(;i<e.length;)h(e[i],!0,!1),h(e[i+1],!1,!0),h(e[i+2],!0,!0),i+=3,f=G(d);return J(d)}function I(a,b,c,d,e){let f,g,h=K(a);b-=2*d,c-=2*d;let{xRange:i,yRange:j}=G(h);if(i.max===i.min||j.max===j.min)return console.log("not scaling solution: zero size detected"),a;if(e){let a=2*Math.sqrt(e/Math.PI);f=b/a,g=c/a}else f=b/(i.max-i.min),g=c/(j.max-j.min);let k=Math.min(g,f),l=(b-(i.max-i.min)*k)/2,m=(c-(j.max-j.min)*k)/2;return J(h.map(a=>({radius:k*a.radius,x:d+l+(a.x-i.min)*k,y:d+m+(a.y-j.min)*k,setid:a.setid})))}function J(a){let b={};for(let c of a)b[c.setid]=c;return b}function K(a){return Object.keys(a).map(b=>Object.assign(a[b],{setid:b}))}function L(a,b){return function(c){let d=this,e=a[c.sets[0]].radius||50,f=b(c)||"",g=f.split(/\s+/).reverse(),h=(f.length+g.length)/3,i=g.pop(),j=[i],k=0;d.textContent=null;let l=[];function m(a){let b=d.ownerDocument.createElementNS(d.namespaceURI,"tspan");return b.textContent=a,l.push(b),d.append(b),b}let n=m(i);for(;i=g.pop();){j.push(i);let a=j.join(" ");n.textContent=a,a.length>h&&n.getComputedTextLength()>e&&(j.pop(),n.textContent=j.join(" "),j=[i],n=m(i),k++)}let o=.35-1.1*k/2,p=d.getAttribute("x"),q=d.getAttribute("y");l.forEach((a,b)=>{a.setAttribute("x",p),a.setAttribute("y",q),a.setAttribute("dy",`${o+1.1*b}em`)})}}function M(a,b,c){let d=b[0].radius-q(b[0],a);for(let c=1;c<b.length;++c){let e=b[c].radius-q(b[c],a);e<=d&&(d=e)}for(let b=0;b<c.length;++b){let e=q(c[b],a)-c[b].radius;e<=d&&(d=e)}return d}function N(a,b,c){let d={},e=function(a){let b={},c=Object.keys(a);for(let a of c)b[a]=[];for(let d=0;d<c.length;d++){let e=c[d],f=a[e];for(let g=d+1;g<c.length;++g){let d=c[g],h=a[d],i=q(f,h);i+h.radius<=f.radius+1e-10?b[d].push(e):i+f.radius<=h.radius+1e-10&&b[e].push(d)}}return b}(a);for(let f=0;f<b.length;++f){let g=b[f].sets,h={},i={};for(let a=0;a<g.length;++a){h[g[a]]=!0;let b=e[g[a]];for(let a=0;a<b.length;++a)i[b[a]]=!0}let j=[],k=[];for(let b in a)b in h?j.push(a[b]):b in i||k.push(a[b]);let l=function a(b,c,d){let e=[];for(let a of b)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let f=e[0],g=M(e[0],b,c);for(let a=1;a<e.length;++a){let d=M(e[a],b,c);d>=g&&(f=e[a],g=d)}let h=A(a=>-1*M({x:a[0],y:a[1]},b,c),[f.x,f.y],{maxIterations:500,minErrorDelta:1e-10}).x,i={x:d?0:h[0],y:h[1]},j=!0;for(let a of b)if(q(i,a)>a.radius){j=!1;break}for(let a of c)if(q(i,a)<a.radius){j=!1;break}if(j)return i;if(1==b.length)return{x:b[0].x,y:b[0].y};let k={};return(o(b,k),0===k.arcs.length)?{x:0,y:-1e3,disjoint:!0}:1==k.arcs.length?{x:k.arcs[0].circle.x,y:k.arcs[0].circle.y}:c.length?a(b,[]):t(k.arcs.map(a=>a.p1))}(j,k,c);d[g]=l,l.disjoint&&b[f].size>0&&console.log("WARNING: area "+g+" not represented on screen")}return d}function O(a){if(0===a.length)return[];let b={};return o(a,b),b.arcs}function P(a,b){if(0===a.length)return"M 0 0";let c=Math.pow(10,b||0),d=null!=b?a=>Math.round(a*c)/c:a=>a;if(1==a.length){var e,f,g;let b,c=a[0].circle;return e=d(c.x),f=d(c.y),g=d(c.radius),(b=[]).push("\nM",e,f),b.push("\nm",-g,0),b.push("\na",g,g,0,1,0,2*g,0),b.push("\na",g,g,0,1,0,-(2*g),0),b.join(" ")}let h=["\nM",d(a[0].p2.x),d(a[0].p2.y)];for(let b of a){let a=d(b.circle.radius);h.push("\nA",a,a,0,+!!b.large,+!!b.sweep,d(b.p1.x),d(b.p1.y))}return h.join(" ")}var Q=c(81509),R=function(){var a=(0,h.K2)(function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},"o"),b=[5,8],c=[7,8,11,12,17,19,22,24],d=[1,17],e=[1,18],f=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],g=[1,31],i=[1,39],j=[7,8,11,12,17,19,22,24,27],k=[1,57],l=[1,56],m=[1,58],n=[1,59],o=[1,60],p=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],q={trace:(0,h.K2)(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:(0,h.K2)(function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:f[h-1].push(f[h]),this.$=f[h-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=f[h];break;case 8:d.setDiagramTitle(f[h].substr(6)),this.$=f[h].substr(6);break;case 9:d.addSubsetData([f[h]],void 0,void 0),d.setIndentMode&&d.setIndentMode(!0);break;case 10:d.addSubsetData([f[h-1]],f[h],void 0),d.setIndentMode&&d.setIndentMode(!0);break;case 11:d.addSubsetData([f[h-2]],void 0,parseFloat(f[h])),d.setIndentMode&&d.setIndentMode(!0);break;case 12:d.addSubsetData([f[h-3]],f[h-2],parseFloat(f[h])),d.setIndentMode&&d.setIndentMode(!0);break;case 13:if(f[h].length<2)throw Error("union requires multiple identifiers");d.validateUnionIdentifiers&&d.validateUnionIdentifiers(f[h]),d.addSubsetData(f[h],void 0,void 0),d.setIndentMode&&d.setIndentMode(!0);break;case 14:if(f[h-1].length<2)throw Error("union requires multiple identifiers");d.validateUnionIdentifiers&&d.validateUnionIdentifiers(f[h-1]),d.addSubsetData(f[h-1],f[h],void 0),d.setIndentMode&&d.setIndentMode(!0);break;case 15:if(f[h-2].length<2)throw Error("union requires multiple identifiers");d.validateUnionIdentifiers&&d.validateUnionIdentifiers(f[h-2]),d.addSubsetData(f[h-2],void 0,parseFloat(f[h])),d.setIndentMode&&d.setIndentMode(!0);break;case 16:if(f[h-3].length<2)throw Error("union requires multiple identifiers");d.validateUnionIdentifiers&&d.validateUnionIdentifiers(f[h-3]),d.addSubsetData(f[h-3],f[h-2],parseFloat(f[h])),d.setIndentMode&&d.setIndentMode(!0);break;case 17:case 18:case 19:d.addTextData(f[h-1],f[h],void 0);break;case 20:case 21:d.addTextData(f[h-2],f[h-1],f[h]);break;case 23:d.addStyleData(f[h-1],f[h]);break;case 24:case 25:case 26:var i=d.getCurrentSets();if(!i)throw Error("text requires set");d.addTextData(i,f[h],void 0);break;case 27:case 28:var i=d.getCurrentSets();if(!i)throw Error("text requires set");d.addTextData(i,f[h-1],f[h]);break;case 29:case 41:case 34:this.$=[f[h]];break;case 30:case 42:this.$=[...f[h-2],f[h]];break;case 31:this.$=[f[h-2],f[h]];break;case 33:this.$=f[h].join(" ")}},"anonymous"),table:[a(b,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},a(c,[2,4],{6:5}),a(b,[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]},a(c,[2,5]),a(c,[2,6]),a(c,[2,7]),a(c,[2,8]),{13:16,20:d,21:e},{13:20,18:19,20:d,21:e},{13:20,18:21,20:d,21:e},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:d,21:e},a(c,[2,9],{14:[1,27],15:[1,28]}),a(f,[2,43]),a(f,[2,44]),a(c,[2,13],{14:[1,29],15:[1,30],27:g}),a(f,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:g},a(c,[2,22]),a(c,[2,24],{14:[1,35]}),a(c,[2,25],{14:[1,36]}),a(c,[2,26]),{20:i,25:37,26:38,27:g},a(c,[2,10],{15:[1,40]}),{16:[1,41]},a(c,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:d,21:e},a(c,[2,17],{14:[1,45]}),a(c,[2,18],{14:[1,46]}),a(c,[2,19]),a(c,[2,27]),a(c,[2,28]),a(c,[2,23],{27:[1,47]}),a(j,[2,29]),{15:[1,48]},{16:[1,49]},a(c,[2,11]),{16:[1,50]},a(c,[2,15]),a(f,[2,42]),a(c,[2,20]),a(c,[2,21]),{20:i,26:51},{16:k,20:l,21:[1,53],28:52,29:54,30:55,31:m,32:n,33:o},a(c,[2,12]),a(c,[2,16]),a(j,[2,30]),a(j,[2,31]),a(j,[2,32]),a(j,[2,33],{30:61,16:k,20:l,31:m,32:n,33:o}),a(p,[2,34]),a(p,[2,36]),a(p,[2,37]),a(p,[2,38]),a(p,[2,39]),a(p,[2,40]),a(p,[2,35])],defaultActions:{6:[2,1]},parseError:(0,h.K2)(function(a,b){if(b.recoverable)this.trace(a);else{var c=Error(a);throw c.hash=b,c}},"parseError"),parse:(0,h.K2)(function(a){var b=this,c=[0],d=[],e=[null],f=[],g=this.table,i="",j=0,k=0,l=0,m=f.slice.call(arguments,1),n=Object.create(this.lexer),o={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o[p]=this.yy[p]);n.setInput(a,o),o.lexer=n,o.parser=this,void 0===n.yylloc&&(n.yylloc={});var q=n.yylloc;f.push(q);var r=n.options&&n.options.ranges;function s(){var a;return"number"!=typeof(a=d.pop()||n.lex()||1)&&(a instanceof Array&&(a=(d=a).pop()),a=b.symbols_[a]||a),a}"function"==typeof o.parseError?this.parseError=o.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,h.K2)(function(a){c.length=c.length-2*a,e.length=e.length-a,f.length=f.length-a},"popStack"),(0,h.K2)(s,"lex");for(var t,u,v,w,x,y,z,A,B,C={};;){if(v=c[c.length-1],this.defaultActions[v]?w=this.defaultActions[v]:(null==t&&(t=s()),w=g[v]&&g[v][t]),void 0===w||!w.length||!w[0]){var D="";for(y in B=[],g[v])this.terminals_[y]&&y>2&&B.push("'"+this.terminals_[y]+"'");D=n.showPosition?"Parse error on line "+(j+1)+":\n"+n.showPosition()+"\nExpecting "+B.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[t]||t,line:n.yylineno,loc:q,expected:B})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+v+", token: "+t);switch(w[0]){case 1:c.push(t),e.push(n.yytext),f.push(n.yylloc),c.push(w[1]),t=null,u?(t=u,u=null):(k=n.yyleng,i=n.yytext,j=n.yylineno,q=n.yylloc,l>0&&l--);break;case 2:if(z=this.productions_[w[1]][1],C.$=e[e.length-z],C._$={first_line:f[f.length-(z||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(z||1)].first_column,last_column:f[f.length-1].last_column},r&&(C._$.range=[f[f.length-(z||1)].range[0],f[f.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[i,k,j,o,w[1],e,f].concat(m))))return x;z&&(c=c.slice(0,-1*z*2),e=e.slice(0,-1*z),f=f.slice(0,-1*z)),c.push(this.productions_[w[1]][0]),e.push(C.$),f.push(C._$),A=g[c[c.length-2]][c[c.length-1]],c.push(A);break;case 3:return!0}}return!0},"parse")};function r(){this.yy={}}return q.lexer={EOF:1,parseError:(0,h.K2)(function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a)},"parseError"),setInput:(0,h.K2)(function(a,b){return this.yy=b||this.yy||{},this._input=a,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:(0,h.K2)(function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.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),a},"input"),unput:(0,h.K2)(function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=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),c.length-1&&(this.yylineno-=c.length-1);var e=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:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:(0,h.K2)(function(){return this._more=!0,this},"more"),reject:(0,h.K2)(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:(0,h.K2)(function(a){this.unput(this.match.slice(a))},"less"),pastInput:(0,h.K2)(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,h.K2)(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,h.K2)(function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},"showPosition"),test_match:(0,h.K2)(function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={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&&(e.yylloc.range=this.yylloc.range.slice(0))),(d=a[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack)for(var f in e)this[f]=e[f];return!1},"test_match"),next:(0,h.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a,b,c,d,e=this._currentRules(),f=0;f<e.length;f++)if((c=this._input.match(this.rules[e[f]]))&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(!this._backtrack)return!1;b=!1;continue}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===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:(0,h.K2)(function(){var a=this.next();return a||this.lex()},"lex"),begin:(0,h.K2)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,h.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,h.K2)(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:(0,h.K2)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,h.K2)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,h.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,h.K2)(function(a,b,c,d){switch(c){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(a.getIndentMode&&a.getIndentMode())return a.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:a.setIndentMode&&a.setIndentMode(!1),this.begin("INITIAL"),this.unput(b.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(!a.consumeIndentText)return 19;a.consumeIndentText=!1;break;case 15:return 24;case 16:return b.yytext=b.yytext.slice(2,-2),14;case 17:return b.yytext=b.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}}},(0,h.K2)(r,"Parser"),r.prototype=q,q.Parser=r,new r}();R.parser=R;var S=[],T=[],U=[],V=new Set,W=!1,X=(0,h.K2)((a,b,c)=>{let e=ac(a).sort(),f=c??10/Math.pow(a.length,2);d=e,1===e.length&&V.add(e[0]),S.push({sets:e,size:f,label:b?Z(b):void 0})},"addSubsetData"),Y=(0,h.K2)(()=>S,"getSubsetData"),Z=(0,h.K2)(a=>{let b=a.trim();return b.length>=2&&b.startsWith('"')&&b.endsWith('"')?b.slice(1,-1):b},"normalizeText"),$=(0,h.K2)(a=>a?Z(a):a,"normalizeStyleValue"),_=(0,h.K2)((a,b,c)=>{let d=Z(b);T.push({sets:ac(a).sort(),id:d,label:c?Z(c):void 0})},"addTextData"),aa=(0,h.K2)((a,b)=>{let c=ac(a).sort(),d={};for(let[a,c]of b)d[a]=$(c)??c;U.push({targets:c,styles:d})},"addStyleData"),ab=(0,h.K2)(()=>U,"getStyleData"),ac=(0,h.K2)(a=>a.map(a=>Z(a)),"normalizeIdentifierList"),ad=(0,h.K2)(a=>{let b=ac(a).filter(a=>!V.has(a));if(b.length>0)throw Error(`unknown set identifier: ${b.join(", ")}`)},"validateUnionIdentifiers"),ae=(0,h.K2)(()=>T,"getTextData"),af=(0,h.K2)(()=>d,"getCurrentSets"),ag=(0,h.K2)(()=>W,"getIndentMode"),ah=(0,h.K2)(a=>{W=a},"setIndentMode"),ai=g.UI.venn;function aj(){return(0,f.$t)(ai,(0,g.zj)().venn)}(0,h.K2)(aj,"getConfig");var ak={getConfig:aj,clear:(0,h.K2)(()=>{(0,g.IU)(),S.length=0,T.length=0,U.length=0,V.clear(),d=void 0,W=!1},"customClear"),setAccTitle:g.SV,getAccTitle:g.iN,setDiagramTitle:g.ke,getDiagramTitle:g.ab,getAccDescription:g.m7,setAccDescription:g.EI,addSubsetData:X,getSubsetData:Y,addTextData:_,addStyleData:aa,validateUnionIdentifiers:ad,getTextData:ae,getStyleData:ab,getCurrentSets:af,getIndentMode:ag,setIndentMode:ah},al=(0,h.K2)(a=>`
|
|
1
|
+
"use strict";exports.id=4407,exports.ids=[4407],exports.modules={44407:(a,b,c)=>{c.d(b,{diagram:()=>aq});var d,e=c(25215),f=c(40684),g=c(46629),h=c(21143),i=c(69085),j=c(67821),k=c(57689);let l=(a,b)=>(0,k.A)(a,"a",-b);var m=c(61255),n=c(30089);function o(a,b){let c=function(a){let b=[];for(let c=0;c<a.length;++c)for(let d=c+1;d<a.length;++d)for(let e of s(a[c],a[d]))e.parentIndex=[c,d],b.push(e);return b}(a),d=c.filter(b=>{var c;return c=b,a.every(a=>q(c,a)<a.radius+1e-10)}),e=0,f=0,g=[];if(d.length>1){let b=t(d);for(let a=0;a<d.length;++a){let c=d[a];c.angle=Math.atan2(c.x-b.x,c.y-b.y)}d.sort((a,b)=>b.angle-a.angle);let c=d[d.length-1];for(let b=0;b<d.length;++b){let h=d[b];f+=(c.x+h.x)*(h.y-c.y);let i={x:(h.x+c.x)/2,y:(h.y+c.y)/2},j=null;for(let b=0;b<h.parentIndex.length;++b)if(c.parentIndex.includes(h.parentIndex[b])){let d=a[h.parentIndex[b]],e=Math.atan2(h.x-d.x,h.y-d.y),f=Math.atan2(c.x-d.x,c.y-d.y),g=f-e;g<0&&(g+=2*Math.PI);let k=f-g/2,l=q(i,{x:d.x+d.radius*Math.sin(k),y:d.y+d.radius*Math.cos(k)});l>2*d.radius&&(l=2*d.radius),(null==j||j.width>l)&&(j={circle:d,width:l,p1:h,p2:c,large:l>d.radius,sweep:!0})}null!=j&&(g.push(j),e+=p(j.circle.radius,j.width),c=h)}}else{let b=a[0];for(let c=1;c<a.length;++c)a[c].radius<b.radius&&(b=a[c]);let c=!1;for(let d=0;d<a.length;++d)if(q(a[d],b)>Math.abs(b.radius-a[d].radius)){c=!0;break}c?e=f=0:(e=b.radius*b.radius*Math.PI,g.push({circle:b,p1:{x:b.x,y:b.y+b.radius},p2:{x:b.x-1e-10,y:b.y+b.radius},width:2*b.radius,large:!0,sweep:!0}))}return f/=2,b&&(b.area=e+f,b.arcArea=e,b.polygonArea=f,b.arcs=g,b.innerPoints=d,b.intersectionPoints=c),e+f}function p(a,b){return a*a*Math.acos(1-b/a)-(a-b)*Math.sqrt(b*(2*a-b))}function q(a,b){return Math.sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y))}function r(a,b,c){return c>=a+b?0:c<=Math.abs(a-b)?Math.PI*Math.min(a,b)*Math.min(a,b):p(a,a-(c*c-b*b+a*a)/(2*c))+p(b,b-(c*c-a*a+b*b)/(2*c))}function s(a,b){let c=q(a,b),d=a.radius,e=b.radius;if(c>=d+e||c<=Math.abs(d-e))return[];let f=(d*d-e*e+c*c)/(2*c),g=Math.sqrt(d*d-f*f),h=a.x+f*(b.x-a.x)/c,i=a.y+f*(b.y-a.y)/c,j=-(b.y-a.y)*(g/c),k=-(b.x-a.x)*(g/c);return[{x:h+j,y:i-k},{x:h-j,y:i+k}]}function t(a){let b={x:0,y:0};for(let c of a)b.x+=c.x,b.y+=c.y;return b.x/=a.length,b.y/=a.length,b}function u(a){let b=Array(a);for(let c=0;c<a;++c)b[c]=0;return b}function v(a,b){return u(a).map(()=>u(b))}function w(a,b){let c=0;for(let d=0;d<a.length;++d)c+=a[d]*b[d];return c}function x(a){return Math.sqrt(w(a,a))}function y(a,b,c){for(let d=0;d<b.length;++d)a[d]=b[d]*c}function z(a,b,c,d,e){for(let f=0;f<a.length;++f)a[f]=b*c[f]+d*e[f]}function A(a,b,c){let d,e=(c=c||{}).maxIterations||200*b.length,f=c.nonZeroDelta||1.05,g=c.zeroDelta||.001,h=c.minErrorDelta||1e-6,i=c.minErrorDelta||1e-5,j=void 0!==c.rho?c.rho:1,k=void 0!==c.chi?c.chi:2,l=void 0!==c.psi?c.psi:-.5,m=void 0!==c.sigma?c.sigma:.5,n=b.length,o=Array(n+1);o[0]=b,o[0].fx=a(b),o[0].id=0;for(let c=0;c<n;++c){let d=b.slice();d[c]=d[c]?d[c]*f:g,o[c+1]=d,o[c+1].fx=a(d),o[c+1].id=c+1}function p(a){for(let b=0;b<a.length;b++)o[n][b]=a[b];o[n].fx=a.fx}let q=(a,b)=>a.fx-b.fx,r=b.slice(),s=b.slice(),t=b.slice(),u=b.slice();for(let b=0;b<e;++b){if(o.sort(q),c.history){let a=o.map(a=>{let b=a.slice();return b.fx=a.fx,b.id=a.id,b});a.sort((a,b)=>a.id-b.id),c.history.push({x:o[0].slice(),fx:o[0].fx,simplex:a})}d=0;for(let a=0;a<n;++a)d=Math.max(d,Math.abs(o[0][a]-o[1][a]));if(Math.abs(o[0].fx-o[n].fx)<h&&d<i)break;for(let a=0;a<n;++a){r[a]=0;for(let b=0;b<n;++b)r[a]+=o[b][a];r[a]/=n}let b=o[n];if(z(s,1+j,r,-j,b),s.fx=a(s),s.fx<o[0].fx)z(u,1+k,r,-k,b),u.fx=a(u),p(u.fx<s.fx?u:s);else if(s.fx>=o[n-1].fx){let c=!1;if(s.fx>b.fx?(z(t,1+l,r,-l,b),t.fx=a(t),t.fx<b.fx?p(t):c=!0):(z(t,1-l*j,r,l*j,b),t.fx=a(t),t.fx<s.fx?p(t):c=!0),c){if(m>=1)break;for(let b=1;b<o.length;++b)z(o[b],1-m,o[0],m,o[b]),o[b].fx=a(o[b])}}else p(s)}return o.sort(q),{fx:o[0].fx,x:o[0]}}function B(a,b={}){b.maxIterations=b.maxIterations||500;let c=b.initialLayout||D,d=b.lossFunction||E,e=function(a,b={}){let c=b.distinct,d=a.map(a=>Object.assign({},a));function e(a){return a.join(";")}if(c){let a=new Map;for(let b of d)for(let c=0;c<b.sets.length;c++){let d=String(b.sets[c]);a.set(d,b.size+(a.get(d)||0));for(let e=c+1;e<b.sets.length;e++){let c=String(b.sets[e]),f=`${d};${c}`,g=`${c};${d}`;a.set(f,b.size+(a.get(f)||0)),a.set(g,b.size+(a.get(g)||0))}}for(let b of d)b.sets.length<3&&(b.size=a.get(e(b.sets)))}let f=[],g=new Set;for(let a of d)if(1===a.sets.length)f.push(a.sets[0]);else if(2===a.sets.length){let b=a.sets[0],c=a.sets[1];g.add(e(a.sets)),g.add(e([c,b]))}f.sort((a,b)=>a===b?0:a<b?-1:1);for(let a=0;a<f.length;++a){let b=f[a];for(let c=a+1;c<f.length;++c){let a=f[c];g.has(e([b,a]))||d.push({sets:[b,a],size:0})}}return d}(a,b),f=c(e,b),g=Object.keys(f),h=[];for(let a of g)h.push(f[a].x),h.push(f[a].y);let i=A(a=>{let b={};for(let c=0;c<g.length;++c){let d=g[c];b[d]={x:a[2*c],y:a[2*c+1],radius:f[d].radius}}return d(b,e)},h,b).x;for(let a=0;a<g.length;++a){let b=g[a];f[b].x=i[2*a],f[b].y=i[2*a+1]}return f}function C(a,b,c){return Math.min(a,b)*Math.min(a,b)*Math.PI<=c+1e-10?Math.abs(a-b):function(a,b,c,d){let e=(d=d||{}).maxIterations||100,f=d.tolerance||1e-10,g=a(b),h=a(c),i=c-b;if(g*h>0)throw"Initial bisect points must have opposite signs";if(0===g)return b;if(0===h)return c;for(let c=0;c<e;++c){let c=b+(i/=2),d=a(c);if(d*g>=0&&(b=c),Math.abs(i)<f||0===d)return c}return b+i}(d=>r(a,b,d)-c,0,a+b)}function D(a,b={}){let c=function(a,b){let c=b&&b.lossFunction?b.lossFunction:E,d={},e={};for(let b of a)if(1===b.sets.length){let a=b.sets[0];d[a]={x:1e10,y:1e10,rowid:d.length,size:b.size,radius:Math.sqrt(b.size/Math.PI)},e[a]=[]}for(let b of a=a.filter(a=>2===a.sets.length)){let a=null!=b.weight?b.weight:1,c=b.sets[0],f=b.sets[1];b.size+1e-10>=Math.min(d[c].size,d[f].size)&&(a=0),e[c].push({set:f,size:b.size,weight:a}),e[f].push({set:c,size:b.size,weight:a})}let f=[];function g(a,b){return b.size-a.size}Object.keys(e).forEach(a=>{let b=0;for(let c=0;c<e[a].length;++c)b+=e[a][c].size*e[a][c].weight;f.push({set:a,size:b})}),f.sort(g);let h={};function i(a){return a.set in h}function j(a,b){d[b].x=a.x,d[b].y=a.y,h[b]=!0}j({x:0,y:0},f[0].set);for(let b=1;b<f.length;++b){let h=f[b].set,l=e[h].filter(i),m=d[h];if(l.sort(g),0===l.length)throw"ERROR: missing pairwise overlap information";let n=[];for(var k=0;k<l.length;++k){let a=d[l[k].set],b=C(m.radius,a.radius,l[k].size);n.push({x:a.x+b,y:a.y}),n.push({x:a.x-b,y:a.y}),n.push({y:a.y+b,x:a.x}),n.push({y:a.y-b,x:a.x});for(let c=k+1;c<l.length;++c){let e=d[l[c].set],f=C(m.radius,e.radius,l[c].size),g=s({x:a.x,y:a.y,radius:b},{x:e.x,y:e.y,radius:f});n.push(...g)}}let o=1e50,p=n[0];for(let b of n){d[h].x=b.x,d[h].y=b.y;let e=c(d,a);e<o&&(o=e,p=b)}j(p,h)}return d}(a,b),d=b.lossFunction||E;if(a.length>=8){let e=function(a,b={}){let c,d,e=b.restarts||10,f=[],g={};for(let b of a)1===b.sets.length&&(g[b.sets[0]]=f.length,f.push(b));let{distances:h,constraints:i}=(c=v(f.length,f.length),d=v(f.length,f.length),a.filter(a=>2===a.sets.length).forEach(a=>{let b=g[a.sets[0]],e=g[a.sets[1]],h=C(Math.sqrt(f[b].size/Math.PI),Math.sqrt(f[e].size/Math.PI),a.size);c[b][e]=c[e][b]=h;let i=0;a.size+1e-10>=Math.min(f[b].size,f[e].size)?i=1:a.size<=1e-10&&(i=-1),d[b][e]=d[e][b]=i}),{distances:c,constraints:d}),j=x(h.map(x))/h.length;h=h.map(a=>a.map(a=>a/j));let k=(a,b)=>(function(a,b,c,d){for(let a=0;a<b.length;++a)b[a]=0;let e=0;for(let f=0;f<c.length;++f){let g=a[2*f],h=a[2*f+1];for(let i=f+1;i<c.length;++i){let j=a[2*i],k=a[2*i+1],l=c[f][i],m=d[f][i],n=(j-g)*(j-g)+(k-h)*(k-h),o=Math.sqrt(n),p=n-l*l;m>0&&o<=l||m<0&&o>=l||(e+=2*p*p,b[2*f]+=4*p*(g-j),b[2*f+1]+=4*p*(h-k),b[2*i]+=4*p*(j-g),b[2*i+1]+=4*p*(k-h))}}return e})(a,b,h,i),l=null;for(let a=0;a<e;++a){let a=function(a,b,c){let d,e,f,g={x:b.slice(),fx:0,fxprime:b.slice()},h={x:b.slice(),fx:0,fxprime:b.slice()},i=b.slice(),j=1;f=(c=c||{}).maxIterations||20*b.length,g.fx=a(g.x,g.fxprime),y(d=g.fxprime.slice(),g.fxprime,-1);for(let b=0;b<f;++b){if(j=function(a,b,c,d,e,f,g){let h=c.fx,i=w(c.fxprime,b),j=h,k=h,l=i,m=0;function n(k,m,n){for(let o=0;o<16;++o)if(e=(k+m)/2,z(d.x,1,c.x,e,b),j=d.fx=a(d.x,d.fxprime),l=w(d.fxprime,b),j>h+f*e*i||j>=n)m=e;else{if(Math.abs(l)<=-g*i)return e;l*(m-k)>=0&&(m=k),k=e,n=j}return 0}e=e||1,f=f||1e-6,g=g||.1;for(let o=0;o<10;++o){if(z(d.x,1,c.x,e,b),j=d.fx=a(d.x,d.fxprime),l=w(d.fxprime,b),j>h+f*e*i||o&&j>=k)return n(m,e,k);if(Math.abs(l)<=-g*i)break;if(l>=0)return n(e,m,j);k=j,m=e,e*=2}return e}(a,d,g,h,j),c.history&&c.history.push({x:g.x.slice(),fx:g.fx,fxprime:g.fxprime.slice(),alpha:j}),j){z(i,1,h.fxprime,-1,g.fxprime);let a=w(g.fxprime,g.fxprime);z(d,Math.max(0,w(i,h.fxprime)/a),d,-1,h.fxprime),e=g,g=h,h=e}else y(d,g.fxprime,-1);if(1e-5>=x(g.fxprime))break}return c.history&&c.history.push({x:g.x.slice(),fx:g.fx,fxprime:g.fxprime.slice(),alpha:j}),g}(k,u(2*h.length).map(Math.random),b);(!l||a.fx<l.fx)&&(l=a)}let m=l.x,n={};for(let a=0;a<f.length;++a){let b=f[a];n[b.sets[0]]={x:m[2*a]*j,y:m[2*a+1]*j,radius:Math.sqrt(b.size/Math.PI)}}if(b.history)for(let a of b.history)y(a.x,j);return n}(a,b);d(e,a)+1e-8<d(c,a)&&(c=e)}return c}function E(a,b){let c=0;for(let d of b){let b;if(1!==d.sets.length){if(2===d.sets.length){let c=a[d.sets[0]],e=a[d.sets[1]];b=r(c.radius,e.radius,q(c,e))}else b=o(d.sets.map(b=>a[b]));c+=(null!=d.weight?d.weight:1)*(b-d.size)*(b-d.size)}}return c}function F(a,b){let c=0;for(let d of b){let b;if(1===d.sets.length)continue;if(2===d.sets.length){let c=a[d.sets[0]],e=a[d.sets[1]];b=r(c.radius,e.radius,q(c,e))}else b=o(d.sets.map(b=>a[b]));let e=null!=d.weight?d.weight:1,f=Math.log((b+1)/(d.size+1));c+=e*f*f}return c}function G(a){let b=b=>({max:a.reduce((a,c)=>Math.max(a,c[b]+c.radius),-1/0),min:a.reduce((a,c)=>Math.min(a,c[b]-c.radius),1/0)});return{xRange:b("x"),yRange:b("y")}}function H(a,b,c){null==b&&(b=Math.PI/2);let d=K(a).map(a=>Object.assign({},a)),e=function(a){function b(a){return a.parent!==a&&(a.parent=b(a.parent)),a.parent}a.forEach(a=>{a.parent=a});for(let e=0;e<a.length;++e)for(let f=e+1;f<a.length;++f){var c,d;let g=a[e].radius+a[f].radius;q(a[e],a[f])+1e-10<g&&(c=a[f],d=a[e],b(c).parent=b(d))}let e=new Map;for(let c=0;c<a.length;++c){let d=b(a[c]).parent.setid;e.has(d)||e.set(d,[]),e.get(d).push(a[c])}return a.forEach(a=>{delete a.parent}),Array.from(e.values())}(d);for(let a of e){!function(a,b,c){if(null==c?a.sort((a,b)=>b.radius-a.radius):a.sort(c),a.length>0){let b=a[0].x,c=a[0].y;for(let d of a)d.x-=b,d.y-=c}if(2===a.length&&q(a[0],a[1])<Math.abs(a[1].radius-a[0].radius)&&(a[1].x=a[0].x+a[0].radius-a[1].radius-1e-10,a[1].y=a[0].y),a.length>1){let c=Math.atan2(a[1].x,a[1].y)-b,d=Math.cos(c),e=Math.sin(c);for(let b of a){let a=b.x,c=b.y;b.x=d*a-e*c,b.y=e*a+d*c}}if(a.length>2){let c=Math.atan2(a[2].x,a[2].y)-b;for(;c<0;)c+=2*Math.PI;for(;c>2*Math.PI;)c-=2*Math.PI;if(c>Math.PI){let b=a[1].y/(1e-10+a[1].x);for(let c of a){var d=(c.x+b*c.y)/(1+b*b);c.x=2*d-c.x,c.y=2*d*b-c.y}}}}(a,b,c);let d=G(a);a.size=(d.xRange.max-d.xRange.min)*(d.yRange.max-d.yRange.min),a.bounds=d}e.sort((a,b)=>b.size-a.size);let f=(d=e[0]).bounds,g=(f.xRange.max-f.xRange.min)/50;function h(a,b,c){let e,h;if(!a)return;let i=a.bounds;if(b)e=f.xRange.max-i.xRange.min+g;else{e=f.xRange.max-i.xRange.max;let a=(i.xRange.max-i.xRange.min)/2-(f.xRange.max-f.xRange.min)/2;a<0&&(e+=a)}if(c)h=f.yRange.max-i.yRange.min+g;else{h=f.yRange.max-i.yRange.max;let a=(i.yRange.max-i.yRange.min)/2-(f.yRange.max-f.yRange.min)/2;a<0&&(h+=a)}for(let b of a)b.x+=e,b.y+=h,d.push(b)}let i=1;for(;i<e.length;)h(e[i],!0,!1),h(e[i+1],!1,!0),h(e[i+2],!0,!0),i+=3,f=G(d);return J(d)}function I(a,b,c,d,e){let f,g,h=K(a);b-=2*d,c-=2*d;let{xRange:i,yRange:j}=G(h);if(i.max===i.min||j.max===j.min)return console.log("not scaling solution: zero size detected"),a;if(e){let a=2*Math.sqrt(e/Math.PI);f=b/a,g=c/a}else f=b/(i.max-i.min),g=c/(j.max-j.min);let k=Math.min(g,f),l=(b-(i.max-i.min)*k)/2,m=(c-(j.max-j.min)*k)/2;return J(h.map(a=>({radius:k*a.radius,x:d+l+(a.x-i.min)*k,y:d+m+(a.y-j.min)*k,setid:a.setid})))}function J(a){let b={};for(let c of a)b[c.setid]=c;return b}function K(a){return Object.keys(a).map(b=>Object.assign(a[b],{setid:b}))}function L(a,b){return function(c){let d=this,e=a[c.sets[0]].radius||50,f=b(c)||"",g=f.split(/\s+/).reverse(),h=(f.length+g.length)/3,i=g.pop(),j=[i],k=0;d.textContent=null;let l=[];function m(a){let b=d.ownerDocument.createElementNS(d.namespaceURI,"tspan");return b.textContent=a,l.push(b),d.append(b),b}let n=m(i);for(;i=g.pop();){j.push(i);let a=j.join(" ");n.textContent=a,a.length>h&&n.getComputedTextLength()>e&&(j.pop(),n.textContent=j.join(" "),j=[i],n=m(i),k++)}let o=.35-1.1*k/2,p=d.getAttribute("x"),q=d.getAttribute("y");l.forEach((a,b)=>{a.setAttribute("x",p),a.setAttribute("y",q),a.setAttribute("dy",`${o+1.1*b}em`)})}}function M(a,b,c){let d=b[0].radius-q(b[0],a);for(let c=1;c<b.length;++c){let e=b[c].radius-q(b[c],a);e<=d&&(d=e)}for(let b=0;b<c.length;++b){let e=q(c[b],a)-c[b].radius;e<=d&&(d=e)}return d}function N(a,b,c){let d={},e=function(a){let b={},c=Object.keys(a);for(let a of c)b[a]=[];for(let d=0;d<c.length;d++){let e=c[d],f=a[e];for(let g=d+1;g<c.length;++g){let d=c[g],h=a[d],i=q(f,h);i+h.radius<=f.radius+1e-10?b[d].push(e):i+f.radius<=h.radius+1e-10&&b[e].push(d)}}return b}(a);for(let f=0;f<b.length;++f){let g=b[f].sets,h={},i={};for(let a=0;a<g.length;++a){h[g[a]]=!0;let b=e[g[a]];for(let a=0;a<b.length;++a)i[b[a]]=!0}let j=[],k=[];for(let b in a)b in h?j.push(a[b]):b in i||k.push(a[b]);let l=function a(b,c,d){let e=[];for(let a of b)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let f=e[0],g=M(e[0],b,c);for(let a=1;a<e.length;++a){let d=M(e[a],b,c);d>=g&&(f=e[a],g=d)}let h=A(a=>-1*M({x:a[0],y:a[1]},b,c),[f.x,f.y],{maxIterations:500,minErrorDelta:1e-10}).x,i={x:d?0:h[0],y:h[1]},j=!0;for(let a of b)if(q(i,a)>a.radius){j=!1;break}for(let a of c)if(q(i,a)<a.radius){j=!1;break}if(j)return i;if(1==b.length)return{x:b[0].x,y:b[0].y};let k={};return(o(b,k),0===k.arcs.length)?{x:0,y:-1e3,disjoint:!0}:1==k.arcs.length?{x:k.arcs[0].circle.x,y:k.arcs[0].circle.y}:c.length?a(b,[]):t(k.arcs.map(a=>a.p1))}(j,k,c);d[g]=l,l.disjoint&&b[f].size>0&&console.log("WARNING: area "+g+" not represented on screen")}return d}function O(a){if(0===a.length)return[];let b={};return o(a,b),b.arcs}function P(a,b){if(0===a.length)return"M 0 0";let c=Math.pow(10,b||0),d=null!=b?a=>Math.round(a*c)/c:a=>a;if(1==a.length){var e,f,g;let b,c=a[0].circle;return e=d(c.x),f=d(c.y),g=d(c.radius),(b=[]).push("\nM",e,f),b.push("\nm",-g,0),b.push("\na",g,g,0,1,0,2*g,0),b.push("\na",g,g,0,1,0,-(2*g),0),b.join(" ")}let h=["\nM",d(a[0].p2.x),d(a[0].p2.y)];for(let b of a){let a=d(b.circle.radius);h.push("\nA",a,a,0,+!!b.large,+!!b.sweep,d(b.p1.x),d(b.p1.y))}return h.join(" ")}var Q=c(81509),R=function(){var a=(0,h.K2)(function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},"o"),b=[5,8],c=[7,8,11,12,17,19,22,24],d=[1,17],e=[1,18],f=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],g=[1,31],i=[1,39],j=[7,8,11,12,17,19,22,24,27],k=[1,57],l=[1,56],m=[1,58],n=[1,59],o=[1,60],p=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],q={trace:(0,h.K2)(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:(0,h.K2)(function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:f[h-1].push(f[h]),this.$=f[h-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=f[h];break;case 8:d.setDiagramTitle(f[h].substr(6)),this.$=f[h].substr(6);break;case 9:d.addSubsetData([f[h]],void 0,void 0),d.setIndentMode&&d.setIndentMode(!0);break;case 10:d.addSubsetData([f[h-1]],f[h],void 0),d.setIndentMode&&d.setIndentMode(!0);break;case 11:d.addSubsetData([f[h-2]],void 0,parseFloat(f[h])),d.setIndentMode&&d.setIndentMode(!0);break;case 12:d.addSubsetData([f[h-3]],f[h-2],parseFloat(f[h])),d.setIndentMode&&d.setIndentMode(!0);break;case 13:if(f[h].length<2)throw Error("union requires multiple identifiers");d.validateUnionIdentifiers&&d.validateUnionIdentifiers(f[h]),d.addSubsetData(f[h],void 0,void 0),d.setIndentMode&&d.setIndentMode(!0);break;case 14:if(f[h-1].length<2)throw Error("union requires multiple identifiers");d.validateUnionIdentifiers&&d.validateUnionIdentifiers(f[h-1]),d.addSubsetData(f[h-1],f[h],void 0),d.setIndentMode&&d.setIndentMode(!0);break;case 15:if(f[h-2].length<2)throw Error("union requires multiple identifiers");d.validateUnionIdentifiers&&d.validateUnionIdentifiers(f[h-2]),d.addSubsetData(f[h-2],void 0,parseFloat(f[h])),d.setIndentMode&&d.setIndentMode(!0);break;case 16:if(f[h-3].length<2)throw Error("union requires multiple identifiers");d.validateUnionIdentifiers&&d.validateUnionIdentifiers(f[h-3]),d.addSubsetData(f[h-3],f[h-2],parseFloat(f[h])),d.setIndentMode&&d.setIndentMode(!0);break;case 17:case 18:case 19:d.addTextData(f[h-1],f[h],void 0);break;case 20:case 21:d.addTextData(f[h-2],f[h-1],f[h]);break;case 23:d.addStyleData(f[h-1],f[h]);break;case 24:case 25:case 26:var i=d.getCurrentSets();if(!i)throw Error("text requires set");d.addTextData(i,f[h],void 0);break;case 27:case 28:var i=d.getCurrentSets();if(!i)throw Error("text requires set");d.addTextData(i,f[h-1],f[h]);break;case 29:case 41:case 34:this.$=[f[h]];break;case 30:case 42:this.$=[...f[h-2],f[h]];break;case 31:this.$=[f[h-2],f[h]];break;case 33:this.$=f[h].join(" ")}},"anonymous"),table:[a(b,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},a(c,[2,4],{6:5}),a(b,[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]},a(c,[2,5]),a(c,[2,6]),a(c,[2,7]),a(c,[2,8]),{13:16,20:d,21:e},{13:20,18:19,20:d,21:e},{13:20,18:21,20:d,21:e},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:d,21:e},a(c,[2,9],{14:[1,27],15:[1,28]}),a(f,[2,43]),a(f,[2,44]),a(c,[2,13],{14:[1,29],15:[1,30],27:g}),a(f,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:g},a(c,[2,22]),a(c,[2,24],{14:[1,35]}),a(c,[2,25],{14:[1,36]}),a(c,[2,26]),{20:i,25:37,26:38,27:g},a(c,[2,10],{15:[1,40]}),{16:[1,41]},a(c,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:d,21:e},a(c,[2,17],{14:[1,45]}),a(c,[2,18],{14:[1,46]}),a(c,[2,19]),a(c,[2,27]),a(c,[2,28]),a(c,[2,23],{27:[1,47]}),a(j,[2,29]),{15:[1,48]},{16:[1,49]},a(c,[2,11]),{16:[1,50]},a(c,[2,15]),a(f,[2,42]),a(c,[2,20]),a(c,[2,21]),{20:i,26:51},{16:k,20:l,21:[1,53],28:52,29:54,30:55,31:m,32:n,33:o},a(c,[2,12]),a(c,[2,16]),a(j,[2,30]),a(j,[2,31]),a(j,[2,32]),a(j,[2,33],{30:61,16:k,20:l,31:m,32:n,33:o}),a(p,[2,34]),a(p,[2,36]),a(p,[2,37]),a(p,[2,38]),a(p,[2,39]),a(p,[2,40]),a(p,[2,35])],defaultActions:{6:[2,1]},parseError:(0,h.K2)(function(a,b){if(b.recoverable)this.trace(a);else{var c=Error(a);throw c.hash=b,c}},"parseError"),parse:(0,h.K2)(function(a){var b=this,c=[0],d=[],e=[null],f=[],g=this.table,i="",j=0,k=0,l=0,m=f.slice.call(arguments,1),n=Object.create(this.lexer),o={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o[p]=this.yy[p]);n.setInput(a,o),o.lexer=n,o.parser=this,void 0===n.yylloc&&(n.yylloc={});var q=n.yylloc;f.push(q);var r=n.options&&n.options.ranges;function s(){var a;return"number"!=typeof(a=d.pop()||n.lex()||1)&&(a instanceof Array&&(a=(d=a).pop()),a=b.symbols_[a]||a),a}"function"==typeof o.parseError?this.parseError=o.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,h.K2)(function(a){c.length=c.length-2*a,e.length=e.length-a,f.length=f.length-a},"popStack"),(0,h.K2)(s,"lex");for(var t,u,v,w,x,y,z,A,B,C={};;){if(v=c[c.length-1],this.defaultActions[v]?w=this.defaultActions[v]:(null==t&&(t=s()),w=g[v]&&g[v][t]),void 0===w||!w.length||!w[0]){var D="";for(y in B=[],g[v])this.terminals_[y]&&y>2&&B.push("'"+this.terminals_[y]+"'");D=n.showPosition?"Parse error on line "+(j+1)+":\n"+n.showPosition()+"\nExpecting "+B.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[t]||t,line:n.yylineno,loc:q,expected:B})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+v+", token: "+t);switch(w[0]){case 1:c.push(t),e.push(n.yytext),f.push(n.yylloc),c.push(w[1]),t=null,u?(t=u,u=null):(k=n.yyleng,i=n.yytext,j=n.yylineno,q=n.yylloc,l>0&&l--);break;case 2:if(z=this.productions_[w[1]][1],C.$=e[e.length-z],C._$={first_line:f[f.length-(z||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(z||1)].first_column,last_column:f[f.length-1].last_column},r&&(C._$.range=[f[f.length-(z||1)].range[0],f[f.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[i,k,j,o,w[1],e,f].concat(m))))return x;z&&(c=c.slice(0,-1*z*2),e=e.slice(0,-1*z),f=f.slice(0,-1*z)),c.push(this.productions_[w[1]][0]),e.push(C.$),f.push(C._$),A=g[c[c.length-2]][c[c.length-1]],c.push(A);break;case 3:return!0}}return!0},"parse")};function r(){this.yy={}}return q.lexer={EOF:1,parseError:(0,h.K2)(function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a)},"parseError"),setInput:(0,h.K2)(function(a,b){return this.yy=b||this.yy||{},this._input=a,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:(0,h.K2)(function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.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),a},"input"),unput:(0,h.K2)(function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=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),c.length-1&&(this.yylineno-=c.length-1);var e=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:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:(0,h.K2)(function(){return this._more=!0,this},"more"),reject:(0,h.K2)(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:(0,h.K2)(function(a){this.unput(this.match.slice(a))},"less"),pastInput:(0,h.K2)(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,h.K2)(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,h.K2)(function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},"showPosition"),test_match:(0,h.K2)(function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={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&&(e.yylloc.range=this.yylloc.range.slice(0))),(d=a[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack)for(var f in e)this[f]=e[f];return!1},"test_match"),next:(0,h.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a,b,c,d,e=this._currentRules(),f=0;f<e.length;f++)if((c=this._input.match(this.rules[e[f]]))&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(!this._backtrack)return!1;b=!1;continue}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===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:(0,h.K2)(function(){var a=this.next();return a||this.lex()},"lex"),begin:(0,h.K2)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,h.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,h.K2)(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:(0,h.K2)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,h.K2)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,h.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,h.K2)(function(a,b,c,d){switch(c){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(a.getIndentMode&&a.getIndentMode())return a.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:a.setIndentMode&&a.setIndentMode(!1),this.begin("INITIAL"),this.unput(b.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(!a.consumeIndentText)return 19;a.consumeIndentText=!1;break;case 15:return 24;case 16:return b.yytext=b.yytext.slice(2,-2),14;case 17:return b.yytext=b.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}}},(0,h.K2)(r,"Parser"),r.prototype=q,q.Parser=r,new r}();R.parser=R;var S=[],T=[],U=[],V=new Set,W=!1,X=(0,h.K2)((a,b,c)=>{let e=ac(a).sort(),f=c??10/Math.pow(a.length,2);d=e,1===e.length&&V.add(e[0]),S.push({sets:e,size:f,label:b?Z(b):void 0})},"addSubsetData"),Y=(0,h.K2)(()=>S,"getSubsetData"),Z=(0,h.K2)(a=>{let b=a.trim();return b.length>=2&&b.startsWith('"')&&b.endsWith('"')?b.slice(1,-1):b},"normalizeText"),$=(0,h.K2)(a=>a?Z(a):a,"normalizeStyleValue"),_=(0,h.K2)((a,b,c)=>{let d=Z(b);T.push({sets:ac(a).sort(),id:d,label:c?Z(c):void 0})},"addTextData"),aa=(0,h.K2)((a,b)=>{let c=ac(a).sort(),d={};for(let[a,c]of b)d[a]=$(c)??c;U.push({targets:c,styles:d})},"addStyleData"),ab=(0,h.K2)(()=>U,"getStyleData"),ac=(0,h.K2)(a=>a.map(a=>Z(a)),"normalizeIdentifierList"),ad=(0,h.K2)(a=>{let b=ac(a).filter(a=>!V.has(a));if(b.length>0)throw Error(`unknown set identifier: ${b.join(", ")}`)},"validateUnionIdentifiers"),ae=(0,h.K2)(()=>T,"getTextData"),af=(0,h.K2)(()=>d,"getCurrentSets"),ag=(0,h.K2)(()=>W,"getIndentMode"),ah=(0,h.K2)(a=>{W=a},"setIndentMode"),ai=g.UI.venn;function aj(){return(0,f.$t)(ai,(0,g.zj)().venn)}(0,h.K2)(aj,"getConfig");var ak={getConfig:aj,clear:(0,h.K2)(()=>{(0,g.IU)(),S.length=0,T.length=0,U.length=0,V.clear(),d=void 0,W=!1},"customClear"),setAccTitle:g.SV,getAccTitle:g.iN,setDiagramTitle:g.ke,getDiagramTitle:g.ab,getAccDescription:g.m7,setAccDescription:g.EI,addSubsetData:X,getSubsetData:Y,addTextData:_,addStyleData:aa,validateUnionIdentifiers:ad,getTextData:ae,getStyleData:ab,getCurrentSets:af,getIndentMode:ag,setIndentMode:ah},al=(0,h.K2)(a=>`
|
|
2
2
|
.venn-title {
|
|
3
3
|
font-size: 32px;
|
|
4
4
|
fill: ${a.vennTitleTextColor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=5414,exports.ids=[5414],exports.modules={25414:(a,b,c)=>{c.d(b,{diagram:()=>j});var d=c(
|
|
1
|
+
"use strict";exports.id=5414,exports.ids=[5414],exports.modules={25414:(a,b,c)=>{c.d(b,{diagram:()=>j});var d=c(25215),e=c(46629),f=c(21143),g=c(92325),h={parse:(0,f.K2)(async a=>{let b=await (0,g.qg)("info",a);f.Rm.debug(b)},"parse")},i=(0,f.K2)(()=>"11.14.0","getVersion"),j={parser:h,db:{getVersion:i},renderer:{draw:(0,f.K2)((a,b,c)=>{f.Rm.debug("rendering info diagram\n"+a);let g=(0,d.D)(b);(0,e.a$)(g,100,400,!0),g.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${c}`)},"draw")}}}};
|