From d10ebb24ee2d64228dc49907a010c3c8cad660fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Moitti=C3=A9?= Date: Thu, 8 Aug 2024 16:17:54 +0200 Subject: [PATCH] Release version 0.27.3 --- changelog.md | 7 +++++++ dist/leto-modelizer-plugin-core.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 657e4f64..0c2ff6d8 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) +## [0.27.3] - 2024/08/08 + +## Fixed + +- Fix publishing on npm workflow. + ## [0.27.2] - 2024/08/08 ### Changed @@ -580,6 +586,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add new classes LetoObjectNode, LetoTypeNode, LetoAttribute, LetoLink. - Add function renderString for SVG template. +[0.27.3]: https://github.com/ditrit/leto-modelizer-plugin-core/blob/0.27.3/changelog.md [0.27.2]: https://github.com/ditrit/leto-modelizer-plugin-core/blob/0.27.2/changelog.md [0.27.1]: https://github.com/ditrit/leto-modelizer-plugin-core/blob/0.27.1/changelog.md [0.27.0]: https://github.com/ditrit/leto-modelizer-plugin-core/blob/0.27.0/changelog.md diff --git a/dist/leto-modelizer-plugin-core.js b/dist/leto-modelizer-plugin-core.js index fdf0da69..b0be5311 100644 --- a/dist/leto-modelizer-plugin-core.js +++ b/dist/leto-modelizer-plugin-core.js @@ -1,2 +1,2 @@ /*! For license information please see leto-modelizer-plugin-core.js.LICENSE.txt */ -(()=>{var t={326:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){"use strict";var r=Array.prototype,i=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},a=/[&"'<>\\]/g;function u(t,e){return i.hasOwnProperty.call(t,e)}function c(t){return o[t]}function s(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,s.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var a=Object.getOwnPropertyDescriptor(i,"stack");(o=a&&(a.get||function(){return a.value}))||(o=function(){return i.stack})}else{var u=new Error(t).stack;o=function(){return u}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function l(t){return"[object Function]"===i.toString.call(t)}function f(t){return"[object Array]"===i.toString.call(t)}function h(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)a=i.slice(0,t.length),i.slice(a.length,s).forEach((function(t,n){n2?i-2:0),a=2;a0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:c,Root:f,NodeList:l,Value:s,Literal:h,Symbol:p,Group:d,Array:y,Pair:v,Dict:m,Output:z,Capture:U,TemplateData:$,If:b,IfAsync:_,InlineIf:w,For:x,AsyncEach:k,AsyncAll:E,Macro:S,Caller:O,Import:T,FromImport:A,FunCall:M,Filter:P,FilterAsync:C,KeywordArgs:j,Block:N,Super:L,Extends:R,Include:D,Set:I,Switch:B,Case:F,LookupVal:g,BinOp:Y,In:q,Is:V,Or:H,And:W,Not:G,Add:X,Concat:Z,Sub:Q,Mul:J,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:at,CompareOperand:ut,CallExtension:ct,CallExtensionAsync:st,printNodes:function t(e,n){if(n=n||0,lt(e.typename+": ",n),e instanceof l)lt("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ct)lt(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof c?r.push([e,t]):(i=i||{})[e]=t})),i?lt(JSON.stringify(i,null,2)+"\n",null,!0):lt("\n"),r.forEach((function(e){var r=e[0],i=e[1];lt("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),a=n(3),u=n(0).TemplateError,c=n(2).Frame,s=n(1).Obj,l={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},f=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new u(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,a.Literal,a.Symbol,a.Group,a.Array,a.Dict,a.FunCall,a.Caller,a.Filter,a.LookupVal,a.Compare,a.InlineIf,a.In,a.Is,a.And,a.Or,a.Not,a.Add,a.Concat,a.Sub,a.Mul,a.Div,a.FloorDiv,a.Mod,a.Pow,a.Neg,a.Pos,a.Compare,a.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var c=this._tmpid();this._emitLine(", "+this._makeCallback(c)),this._emitLine(this.buffer+" += runtime.suppressValue("+c+", "+u+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+u+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof a.Symbol?n=new a.Literal(n.lineno,n.colno,n.value):n instanceof a.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+l[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,a.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,a.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof a.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,a){var u=n._tmpid();n._emitLine("var "+u+" = "+o+"["+r+"]["+a+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+a+"]);"),e.set(t.name.children[a].value,u)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var u=t.name.children,c=u[0],s=u[1],l=this._tmpid(),f=this._tmpid();e.set(c.value,l),e.set(s.value,f),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+l+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+f+" = "+o+"["+l+"];"),this._emitLine('frame.set("'+c.value+'", '+l+");"),this._emitLine('frame.set("'+s.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var h=this._tmpid();e.set(t.name.value,h),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+h+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),u=this._tmpid(),c=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+u+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof a.Array){var s=t.name.children.length;this._emit("runtime."+c+"("+u+", "+s+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var l=t.name.value;this._emitLine("runtime."+c+"("+u+", 1, function("+l+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+l+'", '+l+");"),e.set(l,l)}this._emitLoopBindings(t,u,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var f=this._tmpid();this._emitLine("}, "+this._makeCallback(f)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+f+";"),t.else_&&(this._emitLine("if (!"+u+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),u=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof a.Dict?i=e:(n.assertType(e,a.Symbol),r.push(e))}));var s,l=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),f=r.map((function(t){return'"'+t.value+'"'})),h=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));s=u?e.push(!0):new c,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+l.join(", ")+") {","var callerFrame = frame;","frame = "+(u?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),s.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,s),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,s)})),this._emitLine("frame = "+(u?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),a=this._makeCallback(i),u=n?"true":"false",c=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+u+", "+o+", "+c+", "+a),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,u=n._tmpid();t instanceof a.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+u+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,u),e.parent?n._emitLine('frame.set("'+o+'", '+u+");"):n._emitLine('context.setVariable("'+o+'", '+u+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof a.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new c,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(a.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new c;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(s);t.exports={compile:function(t,e,n,r,a){void 0===a&&(a={});var u=new f(r,a.throwOnUndefined),c=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return u.compile(o.transform(i.parse(c,n,a),e,r)),u.getCode()},Compiler:f}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var a=o.prototype;return a.resolve=function(t,e){return i.resolve(i.dirname(t),e)},a.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),a=n(15),u=n(0),c=n(5),s=n(18),l=n(10),f=l.FileSystemLoader,h=l.WebLoader,p=l.PrecompiledLoader,d=n(20),y=n(21),v=n(1),m=v.Obj,g=v.EmitterObj,b=n(2),_=b.handleError,w=b.Frame,x=n(22);function k(t,e,n){o((function(){t(e,n)}))}var E={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(_(t,null,null))}}}},S=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=u.isArray(t)?t:[t]:f?this.loaders=[new f("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=y(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],u._entries(s).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),u._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=u.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,a=this,c=this,s=null;if(t&&t.raw&&(t=t.raw),u.isFunction(n)&&(i=n,n=null,e=e||!1),u.isFunction(e)&&(i=e,e=!1),t instanceof T)s=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var l=0;l0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var u=this.parsePrimary();if("_"===u.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",u.lineno,u.colno),this.skipSymbol("as")){var c=this.parsePrimary();r.addChild(new o.Pair(u.lineno,u.colno,u,c))}else r.addChild(u);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},c.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},c.parseExtends=function(){var t="extends",e=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var n=new o.Extends(e.lineno,e.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n},c.parseInclude=function(){var t="include",e=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var n=new o.Include(e.lineno,e.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),n},c.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},c.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},c.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var a=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var u,c=this.peekToken(),s=[];do{this.skipSymbol(n);var l=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);s.push(new o.Case(c.line,c.col,l,f)),c=this.peekToken()}while(c&&c.value===n);switch(c.value){case r:this.advanceAfterBlockEnd(),u=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,a,s,u)},c.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==u.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var c=a[0],s=a[1],l=a[2];l===t?r+=1:l===e&&(r-=1),0===r?(i+=s,this.tokens.backN(c.length-s.length)):i+=c}return new o.Output(u.lineno,u.colno,[new o.TemplateData(u.lineno,u.colno,i)])},c.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},c.parseExpression=function(){return this.parseInlineIf()},c.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},c.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},c.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},c.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},c.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},c.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},c.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},c.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},c.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},c.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},c.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},c.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},c.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},c.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},c.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},c.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},c.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},c.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},c.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},c.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var a=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,a))}else{var u=this.parseExpression();t.addChild(u)}}return t},c.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),a=new o.KeywordArgs(n.lineno,n.colno),u=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(u&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var c=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?a.addChild(new o.Pair(c.lineno,c.colno,c,this.parseExpression())):r.addChild(c)}u=!0}return a.children.length&&r.addChild(a),r},c.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],I=C+this.current();switch(-1!==r.indexOf(D,I)&&(this.forward(),C=I,-1!==r.indexOf(D,I+this.current())&&(C=I+this.current(),this.forward())),C){case"(":R=d;break;case")":R=y;break;case"[":R=v;break;case"]":R=m;break;case"{":R=g;break;case"}":R=b;break;case",":R=w;break;case":":R=x;break;case"~":R=k;break;case"|":R=E;break;default:R=_}return P(R,C,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return P(S,t+"."+B,e,n)}return P("int",t,e,n)}if(t.match(/^(true|false)$/))return P(O,t,e,n);if("none"===t)return P(T,t,e,n);if("null"===t)return P(T,t,e,n);if(t)return P(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,z=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,P(s,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,P(f,t,e,n);t="";var U=!1;for(this._matches(this.tags.COMMENT_START)&&(U=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil(z));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!U){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var $=t.slice(-this.colno);if(/^\s+$/.test($)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!U)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&U)throw new Error("expected end of comment, got end of file");return P(U?p:c,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,u=c,console&&console.warn&&console.warn(u)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(a=e[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)o(c,this,e);else{var s=c.length,l=v(c,s);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},u.prototype.listeners=function(t){return d(this,t,!0)},u.prototype.rawListeners=function(t){return d(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):y.call(t,e)},u.prototype.listenerCount=y,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function a(){return"hole_"+o++}function u(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,a=r.repeat(" ",n/2-n%2),u=r.repeat(" ",n/2);return i.copySafeness(t,a+t+u)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var a in t)o.push([a,t[a]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],a=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(a)&&(a=a.toUpperCase())),o>a?1:o===a?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var a=t.split("\n"),u=r.repeat(" ",e),c=a.map((function(t,e){return 0!==e||n?""+u+t:t})).join("\n");return i.copySafeness(t,c)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=c,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=s(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=s(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var a="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return a=n+t.split("").join(n)+n,i.copySafeness(t,a);var u=t.indexOf(e);if(0===r||-1===u)return t;for(var c=0,s=0;u>-1&&(-1===r||s=i&&l.push(n),o.push(l)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,a=r.map(t,(function(t){return t})),u=r.getAttrGetter(i);return a.sort((function(t,a){var c=i?u(t):t,s=i?u(a):a;if(o.env.opts.throwOnUndefined&&i&&(void 0===c||void 0===s))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(c)&&r.isString(s)&&(c=c.toLowerCase(),s=s.toLowerCase()),cs?e?-1:1:0})),a})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=l((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return u(t)}));return i.copySafeness(t,e.join(" "))},e.trim=l,e.truncate=function(t,e,n,r){var a=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var u=t.lastIndexOf(" ",e);-1===u&&(u=e),t=t.substring(0,u)}return t+=null!=r?r:"...",i.copySafeness(a,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,y=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){a(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(f),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":h.test(i)?''+i+"":y.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return a(n)?e:n};var v=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return a(r)?e:r}));e.int=v,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,a=n(5),u=n(7).Environment,c=n(24);function s(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function l(t,e){(e=e||{}).isString=!0;var n=e.env||new u([]),r=e.wrapper||c;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([f(t,e.name,n)],e)}function f(t,e,n){var r,i=(n=n||new u([])).asyncFilters,c=n.extensionsList;e=e.replace(/\\/g,"/");try{r=a.compile(t,i,c,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new u([]),o=e.wrapper||c;if(e.isString)return l(t,e);var a=r.existsSync(t)&&r.statSync(t),h=[],p=[];if(a.isFile())h.push(f(r.readFileSync(t,"utf-8"),e.name||t,n));else if(a.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(a){var u=i.join(o,a),c=u.substr(i.join(t,"/").length),l=r.statSync(u);l&&l.isDirectory()?s(c+="/",e.exclude)||n(u):s(c,e.include)&&p.push(u)}))}(t);for(var d=0;dt.length||i>0&&a>=r||i<0&&a<=r);a+=i)o.push(n.memberLookup(t,a));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Component:()=>L,ComponentAttribute:()=>d,ComponentAttributeDefinition:()=>W,ComponentDefinition:()=>z,ComponentDrawOption:()=>S,ComponentLink:()=>et,ComponentLinkDefinition:()=>ut,ComponentRenderer:()=>vM,DefaultConfiguration:()=>BP,DefaultData:()=>MP,DefaultDrawer:()=>VM,DefaultMetadata:()=>ZM,DefaultParser:()=>nP,DefaultPlugin:()=>KP,DefaultRender:()=>uP,FileInformation:()=>b,FileInput:()=>dt,LinkRenderer:()=>wM,ParserLog:()=>s,Tag:()=>GP,Variable:()=>nC});var t={};function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){for(var n=0;nUt,Delaunay:()=>us,FormatSpecifier:()=>Of,InternMap:()=>Yt,InternSet:()=>qt,Node:()=>Xv,Path:()=>ku,Voronoi:()=>es,ZoomTransform:()=>oT,active:()=>Aa,arc:()=>KE,area:()=>ZE,areaRadial:()=>aS,ascending:()=>yt,autoType:()=>zs,axisBottom:()=>jn,axisLeft:()=>Nn,axisRight:()=>Cn,axisTop:()=>Pn,bin:()=>Se,bisect:()=>Et,bisectCenter:()=>kt,bisectLeft:()=>xt,bisectRight:()=>wt,bisector:()=>mt,blob:()=>Ml,blur:()=>St,blur2:()=>Ot,blurImage:()=>Tt,brush:()=>ru,brushSelection:()=>tu,brushX:()=>eu,brushY:()=>nu,buffer:()=>Cl,chord:()=>du,chordDirected:()=>vu,chordTranspose:()=>yu,cluster:()=>Kv,color:()=>Ei,contourDensity:()=>jc,contours:()=>Ec,count:()=>jt,create:()=>mE,creator:()=>Fr,cross:()=>Dt,csv:()=>Dl,csvFormat:()=>Ts,csvFormatBody:()=>As,csvFormatRow:()=>Ps,csvFormatRows:()=>Ms,csvFormatValue:()=>Cs,csvParse:()=>Ss,csvParseRows:()=>Os,cubehelix:()=>dc,cumsum:()=>It,curveBasis:()=>XS,curveBasisClosed:()=>QS,curveBasisOpen:()=>tO,curveBumpX:()=>lS,curveBumpY:()=>fS,curveBundle:()=>nO,curveCardinal:()=>oO,curveCardinalClosed:()=>uO,curveCardinalOpen:()=>sO,curveCatmullRom:()=>hO,curveCatmullRomClosed:()=>dO,curveCatmullRomOpen:()=>vO,curveLinear:()=>HE,curveLinearClosed:()=>gO,curveMonotoneX:()=>OO,curveMonotoneY:()=>TO,curveNatural:()=>PO,curveStep:()=>jO,curveStepAfter:()=>LO,curveStepBefore:()=>NO,descending:()=>vt,deviation:()=>Ft,difference:()=>ln,disjoint:()=>fn,dispatch:()=>Fn,drag:()=>ds,dragDisable:()=>ii,dragEnable:()=>oi,dsv:()=>Rl,dsvFormat:()=>ks,easeBack:()=>kl,easeBackIn:()=>wl,easeBackInOut:()=>kl,easeBackOut:()=>xl,easeBounce:()=>gl,easeBounceIn:()=>ml,easeBounceInOut:()=>bl,easeBounceOut:()=>gl,easeCircle:()=>al,easeCircleIn:()=>il,easeCircleInOut:()=>al,easeCircleOut:()=>ol,easeCubic:()=>Ea,easeCubicIn:()=>xa,easeCubicInOut:()=>Ea,easeCubicOut:()=>ka,easeElastic:()=>Ol,easeElasticIn:()=>Sl,easeElasticInOut:()=>Tl,easeElasticOut:()=>Ol,easeExp:()=>rl,easeExpIn:()=>el,easeExpInOut:()=>rl,easeExpOut:()=>nl,easeLinear:()=>$s,easePoly:()=>Ws,easePolyIn:()=>Vs,easePolyInOut:()=>Ws,easePolyOut:()=>Hs,easeQuad:()=>qs,easeQuadIn:()=>Ks,easeQuadInOut:()=>qs,easeQuadOut:()=>Ys,easeSin:()=>Js,easeSinIn:()=>Zs,easeSinInOut:()=>Js,easeSinOut:()=>Qs,every:()=>rn,extent:()=>zt,fcumsum:()=>Kt,filter:()=>an,flatGroup:()=>te,flatRollup:()=>ee,forceCenter:()=>ql,forceCollide:()=>of,forceLink:()=>cf,forceManyBody:()=>mf,forceRadial:()=>gf,forceSimulation:()=>vf,forceX:()=>bf,forceY:()=>_f,format:()=>Cf,formatDefaultLocale:()=>Df,formatLocale:()=>Rf,formatPrefix:()=>jf,formatSpecifier:()=>Sf,fsum:()=>$t,geoAlbers:()=>iv,geoAlbersUsa:()=>ov,geoArea:()=>zh,geoAzimuthalEqualArea:()=>sv,geoAzimuthalEqualAreaRaw:()=>cv,geoAzimuthalEquidistant:()=>fv,geoAzimuthalEquidistantRaw:()=>lv,geoBounds:()=>wp,geoCentroid:()=>Np,geoCircle:()=>Yp,geoClipAntimeridian:()=>ed,geoClipCircle:()=>nd,geoClipExtent:()=>ld,geoClipRectangle:()=>sd,geoConicConformal:()=>mv,geoConicConformalRaw:()=>vv,geoConicEqualArea:()=>rv,geoConicEqualAreaRaw:()=>nv,geoConicEquidistant:()=>wv,geoConicEquidistantRaw:()=>_v,geoContains:()=>Td,geoDistance:()=>gd,geoEqualEarth:()=>Av,geoEqualEarthRaw:()=>Tv,geoEquirectangular:()=>bv,geoEquirectangularRaw:()=>gv,geoGnomonic:()=>Pv,geoGnomonicRaw:()=>Mv,geoGraticule:()=>Pd,geoGraticule10:()=>Cd,geoIdentity:()=>Cv,geoInterpolate:()=>jd,geoLength:()=>yd,geoMercator:()=>pv,geoMercatorRaw:()=>hv,geoNaturalEarth1:()=>Nv,geoNaturalEarth1Raw:()=>jv,geoOrthographic:()=>Rv,geoOrthographicRaw:()=>Lv,geoPath:()=>Fy,geoProjection:()=>Jy,geoProjectionMutator:()=>tv,geoRotation:()=>Up,geoStereographic:()=>Iv,geoStereographicRaw:()=>Dv,geoStream:()=>vh,geoTransform:()=>zy,geoTransverseMercator:()=>Fv,geoTransverseMercatorRaw:()=>Bv,gray:()=>Wu,greatest:()=>je,greatestIndex:()=>Ge,group:()=>Zt,groupSort:()=>he,groups:()=>Qt,hcl:()=>rc,hierarchy:()=>qv,histogram:()=>Se,hsl:()=>Ii,html:()=>Kl,image:()=>Bl,index:()=>ie,indexes:()=>oe,interpolate:()=>so,interpolateArray:()=>eo,interpolateBasis:()=>Ki,interpolateBasisClosed:()=>Yi,interpolateBlues:()=>Yk,interpolateBrBG:()=>nk,interpolateBuGn:()=>_k,interpolateBuPu:()=>xk,interpolateCividis:()=>eE,interpolateCool:()=>iE,interpolateCubehelix:()=>lg,interpolateCubehelixDefault:()=>nE,interpolateCubehelixLong:()=>fg,interpolateDate:()=>ro,interpolateDiscrete:()=>Zm,interpolateGnBu:()=>Ek,interpolateGreens:()=>Vk,interpolateGreys:()=>Wk,interpolateHcl:()=>ug,interpolateHclLong:()=>cg,interpolateHsl:()=>rg,interpolateHslLong:()=>ig,interpolateHue:()=>Qm,interpolateInferno:()=>yE,interpolateLab:()=>og,interpolateMagma:()=>dE,interpolateNumber:()=>io,interpolateNumberArray:()=>Ji,interpolateObject:()=>oo,interpolateOrRd:()=>Ok,interpolateOranges:()=>tE,interpolatePRGn:()=>ik,interpolatePiYG:()=>ak,interpolatePlasma:()=>vE,interpolatePuBu:()=>Pk,interpolatePuBuGn:()=>Ak,interpolatePuOr:()=>ck,interpolatePuRd:()=>jk,interpolatePurples:()=>Xk,interpolateRainbow:()=>aE,interpolateRdBu:()=>lk,interpolateRdGy:()=>hk,interpolateRdPu:()=>Lk,interpolateRdYlBu:()=>dk,interpolateRdYlGn:()=>vk,interpolateReds:()=>Qk,interpolateRgb:()=>Gi,interpolateRgbBasis:()=>Zi,interpolateRgbBasisClosed:()=>Qi,interpolateRound:()=>Jm,interpolateSinebow:()=>lE,interpolateSpectral:()=>gk,interpolateString:()=>co,interpolateTransformCss:()=>Zo,interpolateTransformSvg:()=>Qo,interpolateTurbo:()=>fE,interpolateViridis:()=>pE,interpolateWarm:()=>rE,interpolateYlGn:()=>Bk,interpolateYlGnBu:()=>Dk,interpolateYlOrBr:()=>zk,interpolateYlOrRd:()=>$k,interpolateZoom:()=>eg,interrupt:()=>qo,intersection:()=>hn,interval:()=>nT,isoFormat:()=>JO,isoParse:()=>eT,json:()=>zl,lab:()=>Gu,lch:()=>nc,least:()=>He,leastIndex:()=>We,line:()=>XE,lineRadial:()=>oS,link:()=>yS,linkHorizontal:()=>vS,linkRadial:()=>gS,linkVertical:()=>mS,local:()=>bE,map:()=>un,matcher:()=>qn,max:()=>Oe,maxIndex:()=>Te,mean:()=>Be,median:()=>Fe,medianIndex:()=>ze,merge:()=>Ue,min:()=>Ae,minIndex:()=>Me,mode:()=>$e,namespace:()=>ar,namespaces:()=>or,nice:()=>ke,now:()=>Eo,pack:()=>wm,packEnclose:()=>om,packSiblings:()=>bm,pairs:()=>Ke,partition:()=>Tm,path:()=>Eu,pathRound:()=>Su,permute:()=>ce,pie:()=>tS,piecewise:()=>hg,pointRadial:()=>uS,pointer:()=>fo,pointers:()=>wE,polygonArea:()=>dg,polygonCentroid:()=>yg,polygonContains:()=>_g,polygonHull:()=>bg,polygonLength:()=>wg,precisionFixed:()=>If,precisionPrefix:()=>Bf,precisionRound:()=>Ff,quadtree:()=>Xl,quantile:()=>Ne,quantileIndex:()=>Re,quantileSorted:()=>Le,quantize:()=>pg,quickselect:()=>Pe,radialArea:()=>aS,radialLine:()=>oS,randomBates:()=>Ag,randomBernoulli:()=>Cg,randomBeta:()=>Lg,randomBinomial:()=>Rg,randomCauchy:()=>Ig,randomExponential:()=>Mg,randomGamma:()=>Ng,randomGeometric:()=>jg,randomInt:()=>Eg,randomIrwinHall:()=>Tg,randomLcg:()=>Kg,randomLogNormal:()=>Og,randomLogistic:()=>Bg,randomNormal:()=>Sg,randomPareto:()=>Pg,randomPoisson:()=>Fg,randomUniform:()=>kg,randomWeibull:()=>Dg,range:()=>qe,rank:()=>Ve,reduce:()=>cn,reverse:()=>sn,rgb:()=>Ai,ribbon:()=>Du,ribbonArrow:()=>Iu,rollup:()=>ne,rollups:()=>re,scaleBand:()=>Wg,scaleDiverging:()=>Ix,scaleDivergingLog:()=>Bx,scaleDivergingPow:()=>zx,scaleDivergingSqrt:()=>Ux,scaleDivergingSymlog:()=>Fx,scaleIdentity:()=>sb,scaleImplicit:()=>Vg,scaleLinear:()=>cb,scaleLog:()=>gb,scaleOrdinal:()=>Hg,scalePoint:()=>Xg,scalePow:()=>Tb,scaleQuantile:()=>Cb,scaleQuantize:()=>jb,scaleRadial:()=>Pb,scaleSequential:()=>Px,scaleSequentialLog:()=>Cx,scaleSequentialPow:()=>Nx,scaleSequentialQuantile:()=>Rx,scaleSequentialSqrt:()=>Lx,scaleSequentialSymlog:()=>jx,scaleSqrt:()=>Ab,scaleSymlog:()=>xb,scaleThreshold:()=>Nb,scaleTime:()=>Ox,scaleUtc:()=>Tx,scan:()=>Xe,schemeAccent:()=>Yx,schemeBlues:()=>Kk,schemeBrBG:()=>ek,schemeBuGn:()=>bk,schemeBuPu:()=>wk,schemeCategory10:()=>Kx,schemeDark2:()=>qx,schemeGnBu:()=>kk,schemeGreens:()=>qk,schemeGreys:()=>Hk,schemeObservable10:()=>Vx,schemeOrRd:()=>Sk,schemeOranges:()=>Jk,schemePRGn:()=>rk,schemePaired:()=>Hx,schemePastel1:()=>Wx,schemePastel2:()=>Gx,schemePiYG:()=>ok,schemePuBu:()=>Mk,schemePuBuGn:()=>Tk,schemePuOr:()=>uk,schemePuRd:()=>Ck,schemePurples:()=>Gk,schemeRdBu:()=>sk,schemeRdGy:()=>fk,schemeRdPu:()=>Nk,schemeRdYlBu:()=>pk,schemeRdYlGn:()=>yk,schemeReds:()=>Zk,schemeSet1:()=>Xx,schemeSet2:()=>Zx,schemeSet3:()=>Qx,schemeSpectral:()=>mk,schemeTableau10:()=>Jx,schemeYlGn:()=>Ik,schemeYlGnBu:()=>Rk,schemeYlOrBr:()=>Fk,schemeYlOrRd:()=>Uk,select:()=>Jr,selectAll:()=>xE,selection:()=>Qr,selector:()=>Un,selectorAll:()=>Yn,shuffle:()=>Ze,shuffler:()=>Qe,some:()=>on,sort:()=>se,stack:()=>FO,stackOffsetDiverging:()=>UO,stackOffsetExpand:()=>zO,stackOffsetNone:()=>RO,stackOffsetSilhouette:()=>$O,stackOffsetWiggle:()=>KO,stackOrderAppearance:()=>YO,stackOrderAscending:()=>VO,stackOrderDescending:()=>WO,stackOrderInsideOut:()=>GO,stackOrderNone:()=>DO,stackOrderReverse:()=>XO,stratify:()=>Nm,style:()=>mr,subset:()=>vn,sum:()=>Je,superset:()=>dn,svg:()=>Yl,symbol:()=>VS,symbolAsterisk:()=>_S,symbolCircle:()=>wS,symbolCross:()=>xS,symbolDiamond:()=>SS,symbolDiamond2:()=>OS,symbolPlus:()=>TS,symbolSquare:()=>AS,symbolSquare2:()=>MS,symbolStar:()=>NS,symbolTimes:()=>KS,symbolTriangle:()=>RS,symbolTriangle2:()=>IS,symbolWye:()=>$S,symbolX:()=>KS,symbols:()=>YS,symbolsFill:()=>YS,symbolsStroke:()=>qS,text:()=>Nl,thresholdFreedmanDiaconis:()=>De,thresholdScott:()=>Ie,thresholdSturges:()=>Ee,tickFormat:()=>ab,tickIncrement:()=>we,tickStep:()=>xe,ticks:()=>_e,timeDay:()=>e_,timeDays:()=>n_,timeFormat:()=>ew,timeFormatDefaultLocale:()=>xx,timeFormatLocale:()=>J_,timeFriday:()=>p_,timeFridays:()=>__,timeHour:()=>Zb,timeHours:()=>Qb,timeInterval:()=>$b,timeMillisecond:()=>Kb,timeMilliseconds:()=>Yb,timeMinute:()=>Hb,timeMinutes:()=>Wb,timeMonday:()=>s_,timeMondays:()=>v_,timeMonth:()=>I_,timeMonths:()=>B_,timeParse:()=>nw,timeSaturday:()=>d_,timeSaturdays:()=>w_,timeSecond:()=>qb,timeSeconds:()=>Vb,timeSunday:()=>c_,timeSundays:()=>y_,timeThursday:()=>h_,timeThursdays:()=>b_,timeTickInterval:()=>G_,timeTicks:()=>W_,timeTuesday:()=>l_,timeTuesdays:()=>m_,timeWednesday:()=>f_,timeWednesdays:()=>g_,timeWeek:()=>c_,timeWeeks:()=>y_,timeYear:()=>U_,timeYears:()=>$_,timeout:()=>jo,timer:()=>To,timerFlush:()=>Ao,transition:()=>ba,transpose:()=>tn,tree:()=>$m,treemap:()=>Hm,treemapBinary:()=>Wm,treemapDice:()=>Om,treemapResquarify:()=>Xm,treemapSlice:()=>Km,treemapSliceDice:()=>Gm,treemapSquarify:()=>Vm,tsv:()=>Il,tsvFormat:()=>Rs,tsvFormatBody:()=>Ds,tsvFormatRow:()=>Bs,tsvFormatRows:()=>Is,tsvFormatValue:()=>Fs,tsvParse:()=>Ns,tsvParseRows:()=>Ls,union:()=>mn,unixDay:()=>o_,unixDays:()=>a_,utcDay:()=>r_,utcDays:()=>i_,utcFormat:()=>rw,utcFriday:()=>A_,utcFridays:()=>R_,utcHour:()=>Jb,utcHours:()=>t_,utcMillisecond:()=>Kb,utcMilliseconds:()=>Yb,utcMinute:()=>Gb,utcMinutes:()=>Xb,utcMonday:()=>E_,utcMondays:()=>C_,utcMonth:()=>F_,utcMonths:()=>z_,utcParse:()=>iw,utcSaturday:()=>M_,utcSaturdays:()=>D_,utcSecond:()=>qb,utcSeconds:()=>Vb,utcSunday:()=>k_,utcSundays:()=>P_,utcThursday:()=>T_,utcThursdays:()=>L_,utcTickInterval:()=>H_,utcTicks:()=>V_,utcTuesday:()=>S_,utcTuesdays:()=>j_,utcWednesday:()=>O_,utcWednesdays:()=>N_,utcWeek:()=>k_,utcWeeks:()=>P_,utcYear:()=>K_,utcYears:()=>Y_,variance:()=>Bt,window:()=>pr,xml:()=>$l,zip:()=>nn,zoom:()=>vT,zoomIdentity:()=>aT,zoomTransform:()=>uT});var c=o((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,severity:null,startLineNumber:null,startColumn:null,endLineNumber:null,endColumn:null,message:null,initialErrorMessage:null,componentId:null,attribute:null,extraData:""};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path,r=e.severity,i=e.startLineNumber,o=e.startColumn,a=e.endLineNumber,u=e.endColumn,c=e.message,s=e.initialErrorMessage,l=e.componentId,f=e.attribute,h=e.extraData;this.path=null!=n?n:null,this.severity=null!=r?r:t.SEVERITY_HINT,this.startLineNumber=null!=i?i:null,this.startColumn=null!=o?o:null,this.endLineNumber=null!=a?a:null,this.endColumn=null!=u?u:null,this.message=null!=c?c:null,this.initialErrorMessage=null!=s?s:null,this.componentId=null!=l?l:null,this.attribute=null!=f?f:null,this.extraData=null!=h?h:""}));a(c,"SEVERITY_HINT",1),a(c,"SEVERITY_INFO",2),a(c,"SEVERITY_WARNING",4),a(c,"SEVERITY_ERROR",8);const s=c;function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{name:null,value:null,type:null,definition:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.value,i=e.type,o=e.definition;this.name=n||null,this.value=null!=r?r:null,this.type=i||null,this.definition=o||null},e=[{key:"isVariable",get:function(){return!1}},{key:"getErrors",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.validateDefinitionType(e,r),this.validateType(e,r),this.validateRuleMinMax(e,r),this.validateRuleValues(e,r),this.validateRuleRegex(e,r),this.validateRequiredAttributes(e,r),n&&"Object"===(null===(t=this.definition)||void 0===t?void 0:t.type)&&Array.isArray(this.value)&&this.value.forEach((function(t){return t.getErrors(e,!0,r)})),e}},{key:"validateDefinitionType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null===this.definition?t:"Link"===this.definition.type&&"Array"!==this.type?(t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.invalidLinkType",attribute:this.name})),t):"Reference"===this.definition.type&&"String"!==this.type?(t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.invalidReferenceType",attribute:this.name})),t):("Reference"!==this.definition.type&&"Link"!==this.definition.type&&this.definition.type!==this.type&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.not".concat(this.definition.type),attribute:this.name})),t)}},{key:"validateType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null===this.value?t:"Boolean"===this.type?("boolean"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notBoolean",attribute:this.name})),t):"String"===this.type?("string"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notString",attribute:this.name})),t):"Number"===this.type?("number"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notNumber",attribute:this.name})),t):(Array.isArray(this.value)||t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.not".concat(this.type),attribute:this.name})),t)}},{key:"validateRuleMinMax",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("Boolean"===this.type||"Object"===this.type||null===(t=this.definition)||void 0===t||!t.rules)return n;var i="number"==typeof this.value?this.value:(null===(e=this.value)||void 0===e?void 0:e.length)||0;return null!==this.definition.rules.min&&ithis.definition.rules.max&&n.push(new s({componentId:r,severity:s.SEVERITY_ERROR,message:"parser.error.max".concat(this.definition.type),attribute:this.name,extraData:this.definition.rules.max})),n}},{key:"validateRuleValues",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this.definition||0===this.definition.rules.values.length)return e;var r=Array.isArray(this.value);return(r&&this.value.some((function(e){return!t.definition.rules.values.includes(e)}))||!r&&!this.definition.rules.values.includes(this.value))&&e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:"parser.error.invalidValue",attribute:this.name,extraData:this.definition.rules.values.join(", ")})),e}},{key:"validateRuleRegex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==(t=this.definition)&&void 0!==t&&t.rules.regex&&null!==this.value?(new RegExp(this.definition.rules.regex).test(this.value)||e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:this.definition.rules.regexMessage||"parser.error.regex",attribute:this.name})),e):e}},{key:"validateRequiredAttributes",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.definition&&"Object"===this.definition.type?(this.definition.definedAttributes.forEach((function(r){var i=t.value.find((function(t){return t.name===r.name}));!r.required||i&&null!==i.value||e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:"parser.error.required",attribute:r.name}))})),e):e}}],e&&f(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const d=p;function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function v(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{path:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path;this.path=null!=n?n:null},(e=[{key:"fileName",get:function(){return this.path?this.path.replace(/^.*[\\/]/,""):null}}])&&v(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const b=g;function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function w(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{x:null,y:null,width:null,height:null,hide:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.x,r=e.y,i=e.width,o=e.height,a=e.hide;this.x=n||null,this.y=r||null,this.width=i||null,this.height=o||null,this.hide=a||!1}));const S=E;function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function T(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,externalId:null,name:null,definition:null,drawOption:null,attributes:[]};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=M(this,e,[n]);var r=n.id,i=n.externalId,o=n.name,a=n.definition,u=n.drawOption,c=n.attributes;return t.__class="Component",t.id=r||null,t.externalId=i||t.id,t.name=o||null,t.definition=a||null,t.drawOption=u||new S,t.attributes=c||[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&j(t,e)}(e,t),n=e,r=[{key:"setExternalId",value:function(t){this.externalId=t}},{key:"getConfigurationKey",value:function(){return this.id}},{key:"setReferenceAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.containerRef===t.definition.type}));if(e){var n=this.attributes.filter((function(t){var n=t.definition;return(null==n?void 0:n.name)===e.name}));n.length>0?n.forEach((function(e){e.value=t.id})):this.attributes.push(this.createAttribute({name:e.name,value:t.id,type:"String",definition:e}))}}},{key:"__createNestedAttributes",value:function(t){var e=this,n=this.attributes;return t.slice().reverse().forEach((function(t){var r=n.find((function(e){return e.definition.name===t.name}));r||(r=e.createAttribute({name:t.name,definition:t,type:"Object",value:[]}),n.push(r)),n=r.value})),n}},{key:"createAttribute",value:function(t){return new d(t)}},{key:"removeAllReferenceAttributes",value:function(t){this.attributes=t?this.attributes.filter((function(e){return!("Reference"===e.definition.type&&e.definition.containerRef===t.definition.type&&e.value===t.id)})):this.attributes.filter((function(t){return"Reference"!==t.definition.type}))}},{key:"setLinkAttribute",value:function(t){var e=[],n=this.__getLinkAttribute(e,this.definition.definedAttributes,t),r=this.__createNestedAttributes(e),i=r.find((function(t){return t.definition.name===n.name}));i||(i=this.createAttribute({name:n.name,definition:n,type:"Array",value:[]}),r.push(i)),i.value.includes(t.target)||i.value.push(t.target)}},{key:"__getLinkAttribute",value:function(t,e,n){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;this.__removeLinkAttribute(this.attributes,t,e)}},{key:"__removeLinkAttribute",value:function(t,e,n){var r=this;t.forEach((function(t){var i;if("Object"===t.type&&r.__removeLinkAttribute(t.value,e,n),"Link"===(null===(i=t.definition)||void 0===i?void 0:i.type)&&(!n||t.name===n)){var o=t.value.findIndex((function(t){return t===e}));o>=0&&t.value.splice(o,1)}}))}},{key:"getAttributeByName",value:function(t){return this.__getAttributeByName(this.attributes,t)}},{key:"__getAttributeByName",value:function(t,e){for(var n=0;n3?i-3:0),a=3;a2?n-2:0),i=2;i0&&void 0!==arguments[0]?arguments[0]:[];return this.validateDefinition(e),this.validateRequiredAttributes(e),this.attributes.forEach((function(n){return n.getErrors(e,!0,t.id)})),e}},{key:"validateRequiredAttributes",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.definition?(this.definition.definedAttributes.forEach((function(n){var r=t.attributes.find((function(t){return t.name===n.name}));!n.required||r&&null!==r.value||e.push(new s({componentId:t.id,severity:s.SEVERITY_ERROR,message:"parser.error.required",attribute:n.name}))})),e):e}},{key:"validateDefinition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null===this.definition&&t.push(new s({componentId:this.id,severity:s.SEVERITY_WARNING,message:"parser.warning.noComponentDefinition"})),t}},{key:"getDefinedAttributesByType",value:function(t){var e=[];return this.__setDefinedAttributesByType(e,this.definition.definedAttributes,t),e}},{key:"__setDefinedAttributesByType",value:function(t,e,n){var r=this;e.forEach((function(e){"Object"===e.type&&r.__setDefinedAttributesByType(t,e.definedAttributes,n),e.type===n&&t.push(e)}))}},{key:"canContain",value:function(t){return this.definition.isContainer&&this.definition.childrenTypes.includes(t)}}],r&&T(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(b);const L=N;function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function D(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,icon:null,model:null,displayName:null,description:null,categories:[],tags:[],url:null,parentTypes:[],childrenTypes:[],definedAttributes:[],isContainer:!1,displayType:null,workflowDirection:null,linkModel:null,defaultWidth:0,defaultHeight:0,minWidth:0,minHeight:0,reservedWidth:0,reservedHeight:0,margin:10,gap:30};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.icon,i=e.model,o=e.displayName,a=e.description,u=e.categories,c=e.tags,s=e.url,l=e.parentTypes,f=e.childrenTypes,h=e.definedAttributes,p=e.isContainer,d=e.displayType,y=e.workflowDirection,v=e.linkModel,m=e.defaultWidth,g=e.defaultHeight,b=e.minWidth,_=e.minHeight,w=e.reservedWidth,x=e.reservedHeight,k=e.margin,E=e.gap;this.type=n||null,this.icon=r||null,this.model=i||null,this.displayName=o||null,this.description=a||null,this.categories=u||[],this.tags=c||[],this.url=s||null,this.parentTypes=l||[],this.childrenTypes=f||[],this.definedAttributes=h||[],this.isContainer=void 0!==p&&p,this.displayType=d||null,this.workflowDirection=y||"horizontal",this.linkModel=v||null,this.defaultWidth=m||0,this.defaultHeight=g||0,this.minWidth=b||0,this.minHeight=_||0,this.reservedWidth=w||0,this.reservedHeight=x||0,this.margin=k||10,this.gap=E||30}));const z=F;function U(t){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U(t)}function $(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function K(t,e,n){return(e=V(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,displayName:null,description:null,tags:[],url:null,linkType:null,linkRef:[],linkModel:null,containerRef:null,required:!1,definedAttributes:[],rules:{values:[],min:null,max:null,regex:null,regexMessage:null}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.type,i=e.displayName,o=e.description,a=e.tags,u=e.url,c=e.linkType,s=e.linkRef,l=e.linkModel,f=e.containerRef,h=e.definedAttributes,p=e.required,d=e.rules;this.name=n||null,this.type=r||null,this.displayName=i||null,this.description=o||null,this.tags=a||[],this.url=u||null,this.linkType=c||null,this.linkRef=s||[],this.linkModel=l||null,this.containerRef=f||null,this.definedAttributes=h||[],this.required=p||!1,this.rules=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{source:null,target:null,name:null,definition:null,isReverse:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=X(this,e);var r=n.source,i=n.target,o=n.name,a=n.definition,u=n.isReverse;return t.__class="Link",t.source=r||null,t.target=i||null,t.name=o||null,t.definition=a||null,t.isReverse=!!u,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&J(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(b);const et=tt;function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function rt(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{attributeRef:null,sourceRef:null,targetRef:null,type:null,model:null,isTemporary:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.attributeRef,r=e.sourceRef,i=e.targetRef,o=e.type,a=e.model,u=e.isTemporary;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null,this.model=a||null,this.isTemporary=!!u}));const ut=at;function ct(t){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(t)}function st(t,e,n){return e=ft(e),function(t,e){if(e&&("object"==ct(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,lt()?Reflect.construct(e,n||[],ft(t).constructor):e.apply(t,n))}function lt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(lt=function(){return!!t})()}function ft(t){return ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ft(t)}function ht(t,e){return ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ht(t,e)}var pt=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,name:null,content:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=st(this,e,[n]);var r=n.content;return t.content=r||null,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ht(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(b);const dt=pt;function yt(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function vt(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function mt(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<0?i=e+1:o=e}while(iyt(t(e),n),r=(e,n)=>t(e)-n):(e=t===yt||t===vt?t:gt,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<=0?i=e+1:o=e}while(i=0))throw new RangeError("invalid r");let n=t.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!e)return t;const r=Ct(e),i=t.slice();return r(t,i,0,n,1),r(i,t,0,n,1),r(t,i,0,n,1),t}const Ot=At(Ct),Tt=At((function(t){const e=Ct(t);return(t,n,r,i,o)=>{e(t,n,0+(r<<=2),0+(i<<=2),o<<=2),e(t,n,r+1,i+1,o),e(t,n,r+2,i+2,o),e(t,n,r+3,i+3,o)}}));function At(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=e;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(void 0!==a?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return e;const u=n&&t(n),c=r&&t(r),s=i.slice();return u&&c?(Mt(u,s,i,o,a),Mt(u,i,s,o,a),Mt(u,s,i,o,a),Pt(c,i,s,o,a),Pt(c,s,i,o,a),Pt(c,i,s,o,a)):u?(Mt(u,i,s,o,a),Mt(u,s,i,o,a),Mt(u,i,s,o,a)):c&&(Pt(c,i,s,o,a),Pt(c,s,i,o,a),Pt(c,i,s,o,a)),e}}function Mt(t,e,n,r,i){for(let o=0,a=r*i;o{if(!((o-=a)>=i))return;let u=t*r[i];const c=a*t;for(let t=i,e=i+c;t{if(!((a-=u)>=o))return;let c=e*i[o];const s=u*e,l=s+u;for(let t=o,e=o+s;t=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function Nt(t){return 0|t.length}function Lt(t){return!(t>0)}function Rt(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function Dt(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(Rt)).map(Nt),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(Lt))return o;for(;;){o.push(i.map(((e,n)=>t[n][e])));let a=r;for(;++i[a]===n[a];){if(0===a)return e?o.map(e):o;i[a--]=0}}}function It(t,e){var n=0,r=0;return Float64Array.from(t,void 0===e?t=>n+=+t||0:i=>n+=+e(i,r++,t)||0)}function Bt(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let u of t)null!=(u=e(u,++a,t))&&(u=+u)>=u&&(n=u-i,i+=n/++r,o+=n*(u-i))}if(r>1)return o/(r-1)}function Ft(t,e){const n=Bt(t,e);return n?Math.sqrt(n):n}function zt(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r=o&&(n=r=o):(n>o&&(n=o),r0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}function $t(t,e){const n=new Ut;if(void 0===e)for(let e of t)(e=+e)&&n.add(e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function Kt(t,e){const n=new Ut;let r=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):i=>n.add(+e(i,++r,t)||0))}class Yt extends Map{constructor(t,e=Gt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Vt(this,t))}has(t){return super.has(Vt(this,t))}set(t,e){return super.set(Ht(this,t),e)}delete(t){return super.delete(Wt(this,t))}}class qt extends Set{constructor(t,e=Gt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(Vt(this,t))}add(t){return super.add(Ht(this,t))}delete(t){return super.delete(Wt(this,t))}}function Vt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ht({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Wt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Gt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Xt(t){return t}function Zt(t,...e){return ue(t,Xt,Xt,e)}function Qt(t,...e){return ue(t,Array.from,Xt,e)}function Jt(t,e){for(let n=1,r=e.length;nt.pop().map((([e,n])=>[...t,e,n]))));return t}function te(t,...e){return Jt(Qt(t,...e),e)}function ee(t,e,...n){return Jt(re(t,e,...n),n)}function ne(t,e,...n){return ue(t,Xt,e,n)}function re(t,e,...n){return ue(t,Array.from,e,n)}function ie(t,...e){return ue(t,Xt,ae,e)}function oe(t,...e){return ue(t,Array.from,ae,e)}function ae(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function ue(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Yt,u=r[o++];let c=-1;for(const t of i){const e=u(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function ce(t,e){return Array.from(e,(e=>t[e]))}function se(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=fe(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>fe(n[t],n[e])))),ce(t,r)}return t.sort(le(n))}function le(t=yt){if(t===yt)return fe;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function fe(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function he(t,e,n){return(2!==e.length?se(ne(t,e,n),(([t,e],[n,r])=>yt(e,r)||yt(t,n))):se(Zt(t,n),(([t,n],[r,i])=>e(n,i)||yt(t,r)))).map((([t])=>t))}var pe=Array.prototype,de=pe.slice;function ye(t){return()=>t}pe.map;const ve=Math.sqrt(50),me=Math.sqrt(10),ge=Math.sqrt(2);function be(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=ve?10:o>=me?5:o>=ge?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/a,u=Math.round(t*s),c=Math.round(e*s),u/se&&--c,s=-s):(s=Math.pow(10,i)*a,u=Math.round(t/s),c=Math.round(e/s),u*se&&--c),c0))return[];if((t=+t)==(e=+e))return[t];const r=e=i))return[];const u=o-i+1,c=new Array(u);if(r)if(a<0)for(let t=0;t0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function Ee(t){return Math.max(1,Math.ceil(Math.log(jt(t))/Math.LN2)+1)}function Se(){var t=Xt,e=zt,n=Ee;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,u=r.length,c=new Array(u);for(i=0;i=f)if(t>=f&&e===zt){const t=we(l,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var p=h.length,d=0,y=p;h[d]<=l;)++d;for(;h[y-1]>f;)--y;(d||y0?h[i-1]:l,v.x1=i0)for(i=0;i=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}function Te(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n=o)&&(n=o,r=i);return r}function Ae(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Me(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Pe(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?fe:le(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,u=Math.log(o),c=.5*Math.exp(2*u/3),s=.5*Math.sqrt(u*c*(o-c)/o)*(a-o/2<0?-1:1);Pe(t,e,Math.max(n,Math.floor(e-a*c/o+s)),Math.min(r,Math.floor(e+(o-a)*c/o+s)),i)}const o=t[e];let a=n,u=r;for(Ce(t,n,e),i(t[r],o)>0&&Ce(t,n,r);a0;)--u}0===i(t[n],o)?Ce(t,n,u):(++u,Ce(t,u,r)),u<=e&&(n=u+1),e<=u&&(r=u-1)}return t}function Ce(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function je(t,e=yt){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?yt(t,i)>0:0===yt(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}function Ne(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return Ae(t);if(e>=1)return Oe(t);var r,i=(r-1)*e,o=Math.floor(i),a=Oe(Pe(t,o).subarray(0,o+1));return a+(Ae(t.subarray(o+1))-a)*(i-o)}}function Le(t,e,n=bt){if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function Re(t,e,n=bt){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>bt(n(t[r],r,t)))),e<=0)return Me(r);if(e>=1)return Te(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return Pe(i,a,0,o,((t,e)=>fe(r[t],r[e]))),(a=je(i.subarray(0,a+1),(t=>r[t])))>=0?a:-1}}function De(t,e,n){const r=jt(t),i=Ne(t,.75)-Ne(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function Ie(t,e,n){const r=jt(t),i=Ft(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function Be(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function Fe(t,e){return Ne(t,.5,e)}function ze(t,e){return Re(t,.5,e)}function Ue(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function $e(t,e){const n=new Yt;if(void 0===e)for(let e of t)null!=e&&e>=e&&n.set(e,(n.get(e)||0)+1);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&i>=i&&n.set(i,(n.get(i)||0)+1)}let r,i=0;for(const[t,e]of n)e>i&&(i=e,r=t);return r}function Ke(t,e=Ye){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function Ye(t,e){return[t,e]}function qe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++re(n[t],n[r]);let o,a;return t=Uint32Array.from(n,((t,e)=>e)),t.sort(e===yt?(t,e)=>fe(n[t],n[e]):le(i)),t.forEach(((t,e)=>{const n=i(t,void 0===o?t:o);n>=0?((void 0===o||n>0)&&(o=t,a=e),r[t]=a):r[t]=NaN})),r}function He(t,e=yt){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?yt(t,i)<0:0===yt(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)<0:0===e(i,i))&&(n=i,r=!0);return n}function We(t,e=yt){if(1===e.length)return Me(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?0===e(o,o):e(o,n)<0)&&(n=o,r=i);return r}function Ge(t,e=yt){if(1===e.length)return Te(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?0===e(o,o):e(o,n)>0)&&(n=o,r=i);return r}function Xe(t,e){const n=We(t,e);return n<0?void 0:n}const Ze=Qe(Math.random);function Qe(t){return function(e,n=0,r=e.length){let i=r-(n=+n);for(;i;){const r=t()*i--|0,o=e[i+n];e[i+n]=e[r+n],e[r+n]=o}return e}}function Je(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function tn(t){if(!(i=t.length))return[];for(var e=-1,n=Ae(t,en),r=new Array(n);++ee(n,r,t)))}function cn(t,e,n){if("function"!=typeof e)throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if(({done:i,value:n}=r.next()),i)return;++a}for(;({done:i,value:o}=r.next()),!i;)n=e(n,o,++a,t);return n}function sn(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function ln(t,...e){t=new qt(t);for(const n of e)for(const e of n)t.delete(e);return t}function fn(t,e){const n=e[Symbol.iterator](),r=new qt;for(const e of t){if(r.has(e))return!1;let t,i;for(;({value:t,done:i}=n.next())&&!i;){if(Object.is(e,t))return!1;r.add(t)}}return!0}function hn(t,...e){t=new qt(t),e=e.map(pn);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function pn(t){return t instanceof qt?t:new qt(t)}function dn(t,e){const n=t[Symbol.iterator](),r=new Set;for(const t of e){const e=yn(t);if(r.has(e))continue;let i,o;for(;({value:i,done:o}=n.next());){if(o)return!1;const t=yn(i);if(r.add(t),Object.is(e,t))break}}return!0}function yn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function vn(t,e){return dn(e,t)}function mn(...t){const e=new qt;for(const n of t)for(const t of n)e.add(t);return e}function gn(t){return t}var bn=1,_n=2,wn=3,xn=4,kn=1e-6;function En(t){return"translate("+t+",0)"}function Sn(t){return"translate(0,"+t+")"}function On(t){return e=>+t(e)}function Tn(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function An(){return!this.__axis}function Mn(t,e){var n=[],r=null,i=null,o=6,a=6,u=3,c="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,s=t===bn||t===xn?-1:1,l=t===xn||t===_n?"x":"y",f=t===bn||t===wn?En:Sn;function h(h){var p=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,d=null==i?e.tickFormat?e.tickFormat.apply(e,n):gn:i,y=Math.max(o,0)+u,v=e.range(),m=+v[0]+c,g=+v[v.length-1]+c,b=(e.bandwidth?Tn:On)(e.copy(),c),_=h.selection?h.selection():h,w=_.selectAll(".domain").data([null]),x=_.selectAll(".tick").data(p,e).order(),k=x.exit(),E=x.enter().append("g").attr("class","tick"),S=x.select("line"),O=x.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(E),S=S.merge(E.append("line").attr("stroke","currentColor").attr(l+"2",s*o)),O=O.merge(E.append("text").attr("fill","currentColor").attr(l,s*y).attr("dy",t===bn?"0em":t===wn?"0.71em":"0.32em")),h!==_&&(w=w.transition(h),x=x.transition(h),S=S.transition(h),O=O.transition(h),k=k.transition(h).attr("opacity",kn).attr("transform",(function(t){return isFinite(t=b(t))?f(t+c):this.getAttribute("transform")})),E.attr("opacity",kn).attr("transform",(function(t){var e=this.parentNode.__axis;return f((e&&isFinite(e=e(t))?e:b(t))+c)}))),k.remove(),w.attr("d",t===xn||t===_n?a?"M"+s*a+","+m+"H"+c+"V"+g+"H"+s*a:"M"+c+","+m+"V"+g:a?"M"+m+","+s*a+"V"+c+"H"+g+"V"+s*a:"M"+m+","+c+"H"+g),x.attr("opacity",1).attr("transform",(function(t){return f(b(t)+c)})),S.attr(l+"2",s*o),O.attr(l,s*y).text(d),_.filter(An).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===_n?"start":t===xn?"end":"middle"),_.each((function(){this.__axis=b}))}return h.scale=function(t){return arguments.length?(e=t,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),h):n.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(u=+t,h):u},h.offset=function(t){return arguments.length?(c=+t,h):c},h}function Pn(t){return Mn(bn,t)}function Cn(t){return Mn(_n,t)}function jn(t){return Mn(wn,t)}function Nn(t){return Mn(xn,t)}var Ln={value:()=>{}};function Rn(){for(var t,e=0,n=arguments.length,r={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,r,i=new Array(n),o=0;oe?1:t>=e?0:NaN}Qn.prototype={constructor:Qn,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var ir="http://www.w3.org/1999/xhtml";const or={svg:"http://www.w3.org/2000/svg",xhtml:ir,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ar(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),or.hasOwnProperty(e)?{space:or[e],local:t}:t}function ur(t){return function(){this.removeAttribute(t)}}function cr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sr(t,e){return function(){this.setAttribute(t,e)}}function lr(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function fr(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function hr(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function pr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function dr(t){return function(){this.style.removeProperty(t)}}function yr(t,e,n){return function(){this.style.setProperty(t,e,n)}}function vr(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function mr(t,e){return t.style.getPropertyValue(e)||pr(t).getComputedStyle(t,null).getPropertyValue(e)}function gr(t){return function(){delete this[t]}}function br(t,e){return function(){this[t]=e}}function _r(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function wr(t){return t.trim().split(/^|\s+/)}function xr(t){return t.classList||new kr(t)}function kr(t){this._node=t,this._names=wr(t.getAttribute("class")||"")}function Er(t,e){for(var n=xr(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Gr=[null];function Xr(t,e){this._groups=t,this._parents=e}function Zr(){return new Xr([[document.documentElement]],Gr)}Xr.prototype=Zr.prototype={constructor:Xr,select:function(t){"function"!=typeof t&&(t=Un(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=w&&(w=_+1);!(b=m[w])&&++w=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=rr);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?dr:"function"==typeof e?vr:yr)(t,e,null==n?"":n)):mr(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?gr:"function"==typeof e?_r:br)(t,e)):this.node()[t]},classed:function(t,e){var n=wr(t+"");if(arguments.length<2){for(var r=xr(this.node()),i=-1,o=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=e?qr:Yr,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Oi(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Oi(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=yi.exec(t))?new Mi(e[1],e[2],e[3],1):(e=vi.exec(t))?new Mi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=mi.exec(t))?Oi(e[1],e[2],e[3],e[4]):(e=gi.exec(t))?Oi(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=bi.exec(t))?Ri(e[1],e[2]/100,e[3]/100,1):(e=_i.exec(t))?Ri(e[1],e[2]/100,e[3]/100,e[4]):wi.hasOwnProperty(t)?Si(wi[t]):"transparent"===t?new Mi(NaN,NaN,NaN,0):null}function Si(t){return new Mi(t>>16&255,t>>8&255,255&t,1)}function Oi(t,e,n,r){return r<=0&&(t=e=n=NaN),new Mi(t,e,n,r)}function Ti(t){return t instanceof ci||(t=Ei(t)),t?new Mi((t=t.rgb()).r,t.g,t.b,t.opacity):new Mi}function Ai(t,e,n,r){return 1===arguments.length?Ti(t):new Mi(t,e,n,null==r?1:r)}function Mi(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Pi(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}`}function Ci(){const t=ji(this.opacity);return`${1===t?"rgb(":"rgba("}${Ni(this.r)}, ${Ni(this.g)}, ${Ni(this.b)}${1===t?")":`, ${t})`}`}function ji(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ni(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Li(t){return((t=Ni(t))<16?"0":"")+t.toString(16)}function Ri(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Bi(t,e,n,r)}function Di(t){if(t instanceof Bi)return new Bi(t.h,t.s,t.l,t.opacity);if(t instanceof ci||(t=Ei(t)),!t)return new Bi;if(t instanceof Bi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n0&&c<1?0:a,new Bi(a,u,c,t.opacity)}function Ii(t,e,n,r){return 1===arguments.length?Di(t):new Bi(t,e,n,null==r?1:r)}function Bi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Fi(t){return(t=(t||0)%360)<0?t+360:t}function zi(t){return Math.max(0,Math.min(1,t||0))}function Ui(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function $i(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function Ki(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r=240?t-240:t+120,i,r),Ui(t,i,r),Ui(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Bi(Fi(this.h),zi(this.s),zi(this.l),ji(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ji(this.opacity);return`${1===t?"hsl(":"hsla("}${Fi(this.h)}, ${100*zi(this.s)}%, ${100*zi(this.l)}%${1===t?")":`, ${t})`}`}}));const qi=t=>()=>t;function Vi(t,e){return function(n){return t+n*e}}function Hi(t,e){var n=e-t;return n?Vi(t,n>180||n<-180?n-360*Math.round(n/360):n):qi(isNaN(t)?e:t)}function Wi(t,e){var n=e-t;return n?Vi(t,n):qi(isNaN(t)?e:t)}const Gi=function t(e){var n=function(t){return 1==(t=+t)?Wi:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):qi(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Ai(t)).r,(e=Ai(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Wi(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Xi(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),u=new Array(i);for(n=0;no&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:io(n,r)})),o=uo.lastIndex;return o=0&&e._call.call(void 0,t),e=e._next;--yo}function Mo(){_o=(bo=xo.now())+wo,yo=vo=0;try{Ao()}finally{yo=0,function(){for(var t,e,n=ho,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ho=e);po=t,Co(r)}(),_o=0}}function Po(){var t=xo.now(),e=t-bo;e>go&&(wo-=e,bo=t)}function Co(t){yo||(vo&&(vo=clearTimeout(vo)),t-_o>24?(t<1/0&&(vo=setTimeout(Mo,t-xo.now()-wo)),mo&&(mo=clearInterval(mo))):(mo||(bo=xo.now(),mo=setInterval(Po,go)),yo=1,ko(Mo)))}function jo(t,e,n){var r=new Oo;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Oo.prototype=To.prototype={constructor:Oo,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Eo():+n)+(null==e?0:+e),this._next||po===this||(po?po._next=this:ho=this,po=this),this._call=t,this._time=n,Co()},stop:function(){this._call&&(this._call=null,this._time=1/0,Co())}};var No=Fn("start","end","cancel","interrupt"),Lo=[],Ro=0,Do=1,Io=2,Bo=3,Fo=5,zo=6;function Uo(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(c){var s,l,f,h;if(n.state!==Do)return u();for(s in i)if((h=i[s]).name===n.name){if(h.state===Bo)return jo(o);4===h.state?(h.state=zo,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[s]):+sRo)throw new Error("too late; already scheduled");return n}function Ko(t,e){var n=Yo(t,e);if(n.state>Bo)throw new Error("too late; already running");return n}function Yo(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function qo(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>Io&&n.state180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:io(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,c),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:io(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,c),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:io(t,n)},{i:u-2,x:io(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var e,n=-1,r=c.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?$o:Ko;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=ar(t),r="transform"===n?Qo:na;return this.attrTween(t,"function"==typeof e?(n.local?ca:ua)(n,r,ea(this,"attr."+t,e)):null==e?(n.local?ia:ra)(n):(n.local?aa:oa)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=ar(t);return this.tween(n,(r.local?sa:la)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Zo:na;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=mr(this,t),a=(this.style.removeProperty(t),mr(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,va(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=mr(this,t),u=n(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=mr(this,t)),a===c?null:a===r&&c===i?o:(i=c,o=e(r=a,u))}}(t,r,ea(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,u="end."+a;return function(){var c=Ko(this,t),s=c.on,l=null==c.value[a]?o||(o=va(e)):void 0;s===n&&i===l||(r=(n=s).copy()).on(u,i=l),c.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=mr(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ea(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=Yo(this.node(),n).tween,o=0,a=i.length;oDo&&n.name===e)return new ga([[t]],Ta,e,+r);return null}const Ma=t=>()=>t;function Pa(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Ca(t){t.preventDefault(),t.stopImmediatePropagation()}var ja={name:"drag"},Na={name:"space"},La={name:"handle"},Ra={name:"center"};const{abs:Da,max:Ia,min:Ba}=Math;function Fa(t){return[+t[0],+t[1]]}function za(t){return[Fa(t[0]),Fa(t[1])]}var Ua={name:"x",handles:["w","e"].map(Ga),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},$a={name:"y",handles:["n","s"].map(Ga),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Ka={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ga),input:function(t){return null==t?null:za(t)},output:function(t){return t}},Ya={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},qa={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Va={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ha={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Wa={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ga(t){return{type:t}}function Xa(t){return!t.ctrlKey&&!t.button}function Za(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Qa(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ja(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function tu(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function eu(){return iu(Ua)}function nu(){return iu($a)}function ru(){return iu(Ka)}function iu(t){var e,n=Za,r=Xa,i=Qa,o=!0,a=Fn("start","brush","end"),u=6;function c(e){var n=e.property("__brush",y).selectAll(".overlay").data([Ga("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Ya.overlay).merge(n).each((function(){var t=Ja(this).extent;Jr(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([Ga("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Ya.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Ya[t.type]})),e.each(s).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function s(){var t=Jr(this),e=Ja(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-u/2:e[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-u/2:e[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){var r=t.__brush.emitter;return!r||n&&r.clean?new f(t,e,n):r}function f(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function h(n){if((!e||n.touches)&&r.apply(this,arguments)){var i,a,u,c,f,h,p,d,y,v,m,g=this,b=n.target.__data__.type,_="selection"===(o&&n.metaKey?b="overlay":b)?ja:o&&n.altKey?Ra:La,w=t===$a?null:Ha[b],x=t===Ua?null:Wa[b],k=Ja(g),E=k.extent,S=k.selection,O=E[0][0],T=E[0][1],A=E[1][0],M=E[1][1],P=0,C=0,j=w&&x&&o&&n.shiftKey,N=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=fo(t,g)).point0=t.slice(),t.identifier=e,t}));qo(g);var L=l(g,arguments,!0).beforestart();if("overlay"===b){S&&(y=!0);const e=[N[0],N[1]||N[0]];k.selection=S=[[i=t===$a?O:Ba(e[0][0],e[1][0]),u=t===Ua?T:Ba(e[0][1],e[1][1])],[f=t===$a?A:Ia(e[0][0],e[1][0]),p=t===Ua?M:Ia(e[0][1],e[1][1])]],N.length>1&&F(n)}else i=S[0][0],u=S[0][1],f=S[1][0],p=S[1][1];a=i,c=u,h=f,d=p;var R=Jr(g).attr("pointer-events","none"),D=R.selectAll(".overlay").attr("cursor",Ya[b]);if(n.touches)L.moved=B,L.ended=z;else{var I=Jr(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",z,!0);o&&I.on("keydown.brush",(function(t){switch(t.keyCode){case 16:j=w&&x;break;case 18:_===La&&(w&&(f=h-P*w,i=a+P*w),x&&(p=d-C*x,u=c+C*x),_=Ra,F(t));break;case 32:_!==La&&_!==Ra||(w<0?f=h-P:w>0&&(i=a-P),x<0?p=d-C:x>0&&(u=c-C),_=Na,D.attr("cursor",Ya.selection),F(t));break;default:return}Ca(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:j&&(v=m=j=!1,F(t));break;case 18:_===Ra&&(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(u=c),_=La,F(t));break;case 32:_===Na&&(t.altKey?(w&&(f=h-P*w,i=a+P*w),x&&(p=d-C*x,u=c+C*x),_=Ra):(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(u=c),_=La),D.attr("cursor",Ya[b]),F(t));break;default:return}Ca(t)}),!0),ii(n.view)}s.call(g),L.start(n,_.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of N)t.identifier===e.identifier&&(t.cur=fo(e,g));if(j&&!v&&!m&&1===N.length){const t=N[0];Da(t.cur[0]-t[0])>Da(t.cur[1]-t[1])?m=!0:v=!0}for(const t of N)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);y=!0,Ca(t),F(t)}function F(t){const e=N[0],n=e.point0;var r;switch(P=e[0]-n[0],C=e[1]-n[1],_){case Na:case ja:w&&(P=Ia(O-i,Ba(A-f,P)),a=i+P,h=f+P),x&&(C=Ia(T-u,Ba(M-p,C)),c=u+C,d=p+C);break;case La:N[1]?(w&&(a=Ia(O,Ba(A,N[0][0])),h=Ia(O,Ba(A,N[1][0])),w=1),x&&(c=Ia(T,Ba(M,N[0][1])),d=Ia(T,Ba(M,N[1][1])),x=1)):(w<0?(P=Ia(O-i,Ba(A-i,P)),a=i+P,h=f):w>0&&(P=Ia(O-f,Ba(A-f,P)),a=i,h=f+P),x<0?(C=Ia(T-u,Ba(M-u,C)),c=u+C,d=p):x>0&&(C=Ia(T-p,Ba(M-p,C)),c=u,d=p+C));break;case Ra:w&&(a=Ia(O,Ba(A,i-P*w)),h=Ia(O,Ba(A,f+P*w))),x&&(c=Ia(T,Ba(M,u-C*x)),d=Ia(T,Ba(M,p+C*x)))}ht+n))}function du(){return mu(!1,!1)}function yu(){return mu(!1,!0)}function vu(){return mu(!0,!1)}function mu(t,e){var n=0,r=null,i=null,o=null;function a(a){var u,c=a.length,s=new Array(c),l=pu(0,c),f=new Array(c*c),h=new Array(c),p=0;a=Float64Array.from({length:c*c},e?(t,e)=>a[e%c][e/c|0]:(t,e)=>a[e/c|0][e%c]);for(let e=0;er(s[t],s[e])));for(const n of l){const r=e;if(t){const t=pu(1+~c,c).filter((t=>t<0?a[~t*c+n]:a[n*c+t]));i&&t.sort(((t,e)=>i(t<0?-a[~t*c+n]:a[n*c+t],e<0?-a[~e*c+n]:a[n*c+e])));for(const r of t)r<0?(f[~r*c+n]||(f[~r*c+n]={source:null,target:null})).target={index:n,startAngle:e,endAngle:e+=a[~r*c+n]*p,value:a[~r*c+n]}:(f[n*c+r]||(f[n*c+r]={source:null,target:null})).source={index:n,startAngle:e,endAngle:e+=a[n*c+r]*p,value:a[n*c+r]};h[n]={index:n,startAngle:r,endAngle:e,value:s[n]}}else{const t=pu(0,c).filter((t=>a[n*c+t]||a[t*c+n]));i&&t.sort(((t,e)=>i(a[n*c+t],a[n*c+e])));for(const r of t){let t;if(n=0))throw new Error(`invalid digits: ${t}`);if(e>15)return xu;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e_u)if(Math.abs(l*u-c*s)>_u&&i){let h=n-o,p=r-a,d=u*u+c*c,y=h*h+p*p,v=Math.sqrt(d),m=Math.sqrt(f),g=i*Math.tan((gu-Math.acos((d+f-y)/(2*v*m)))/2),b=g/m,_=g/v;Math.abs(b-1)>_u&&this._append`L${t+b*s},${e+b*l}`,this._append`A${i},${i},0,0,${+(l*h>s*p)},${this._x1=t+_*u},${this._y1=e+_*c}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),u=n*Math.sin(r),c=t+a,s=e+u,l=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${s}`:(Math.abs(this._x1-c)>_u||Math.abs(this._y1-s)>_u)&&this._append`L${c},${s}`,n&&(f<0&&(f=f%bu+bu),f>wu?this._append`A${n},${n},0,1,${l},${t-a},${e-u}A${n},${n},0,1,${l},${this._x1=c},${this._y1=s}`:f>_u&&this._append`A${n},${n},0,${+(f>=gu)},${l},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Eu(){return new ku}function Su(t=3){return new ku(+t)}Eu.prototype=ku.prototype;var Ou=Array.prototype.slice;function Tu(t){return function(){return t}}function Au(t){return t.source}function Mu(t){return t.target}function Pu(t){return t.radius}function Cu(t){return t.startAngle}function ju(t){return t.endAngle}function Nu(){return 0}function Lu(){return 10}function Ru(t){var e=Au,n=Mu,r=Pu,i=Pu,o=Cu,a=ju,u=Nu,c=null;function s(){var s,l=e.apply(this,arguments),f=n.apply(this,arguments),h=u.apply(this,arguments)/2,p=Ou.call(arguments),d=+r.apply(this,(p[0]=l,p)),y=o.apply(this,p)-su,v=a.apply(this,p)-su,m=+i.apply(this,(p[0]=f,p)),g=o.apply(this,p)-su,b=a.apply(this,p)-su;if(c||(c=s=Eu()),h>hu&&(ou(v-y)>2*h+hu?v>y?(y+=h,v-=h):(y-=h,v+=h):y=v=(y+v)/2,ou(b-g)>2*h+hu?b>g?(g+=h,b-=h):(g-=h,b+=h):g=b=(g+b)/2),c.moveTo(d*au(y),d*uu(y)),c.arc(0,0,d,y,v),y!==g||v!==b)if(t){var _=m-+t.apply(this,arguments),w=(g+b)/2;c.quadraticCurveTo(0,0,_*au(g),_*uu(g)),c.lineTo(m*au(w),m*uu(w)),c.lineTo(_*au(b),_*uu(b))}else c.quadraticCurveTo(0,0,m*au(g),m*uu(g)),c.arc(0,0,m,g,b);if(c.quadraticCurveTo(0,0,d*au(y),d*uu(y)),c.closePath(),s)return c=null,s+""||null}return t&&(s.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:Tu(+e),s):t}),s.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:Tu(+t),s):r},s.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:Tu(+t),s):r},s.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:Tu(+t),s):i},s.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Tu(+t),s):o},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Tu(+t),s):a},s.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:Tu(+t),s):u},s.source=function(t){return arguments.length?(e=t,s):e},s.target=function(t){return arguments.length?(n=t,s):n},s.context=function(t){return arguments.length?(c=null==t?null:t,s):c},s}function Du(){return Ru()}function Iu(){return Ru(Lu)}const Bu=Math.PI/180,Fu=180/Math.PI,zu=.96422,Uu=1,$u=.82521,Ku=4/29,Yu=6/29,qu=3*Yu*Yu,Vu=Yu*Yu*Yu;function Hu(t){if(t instanceof Xu)return new Xu(t.l,t.a,t.b,t.opacity);if(t instanceof ic)return oc(t);t instanceof Mi||(t=Ti(t));var e,n,r=tc(t.r),i=tc(t.g),o=tc(t.b),a=Zu((.2225045*r+.7168786*i+.0606169*o)/Uu);return r===i&&i===o?e=n=a:(e=Zu((.4360747*r+.3850649*i+.1430804*o)/zu),n=Zu((.0139322*r+.0971045*i+.7141733*o)/$u)),new Xu(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Wu(t,e){return new Xu(t,0,0,null==e?1:e)}function Gu(t,e,n,r){return 1===arguments.length?Hu(t):new Xu(t,e,n,null==r?1:r)}function Xu(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Zu(t){return t>Vu?Math.pow(t,1/3):t/qu+Ku}function Qu(t){return t>Yu?t*t*t:qu*(t-Ku)}function Ju(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function tc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ec(t){if(t instanceof ic)return new ic(t.h,t.c,t.l,t.opacity);if(t instanceof Xu||(t=Hu(t)),0===t.a&&0===t.b)return new ic(NaN,0()=>t;function bc(t,e){for(var n,r=-1,i=e.length;++rr!=p>r&&n<(h-s)*(r-l)/(p-l)+s&&(i=-i)}return i}function wc(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function xc(){}var kc=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Ec(){var t=1,e=1,n=Ee,r=u;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(mc);else{const n=zt(t,Sc);for(e=_e(...ke(n[0],n[1],e),e);e[e.length-1]>=n[1];)e.pop();for(;e[1]o(t,e)))}function o(n,i){const o=null==i?NaN:+i;if(isNaN(o))throw new Error(`invalid value: ${i}`);var u=[],c=[];return function(n,r,i){var o,u,c,s,l,f,h=new Array,p=new Array;for(o=u=-1,s=Oc(n[0],r),kc[s<<1].forEach(d);++o=r,kc[l<<2].forEach(d);++o0?u.push([t]):c.push(t)})),c.forEach((function(t){for(var e,n=0,r=u.length;n0&&o0&&a=0&&o>=0))throw new Error("invalid size");return t=r,e=o,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?gc(vc.call(t)):gc(t),i):n},i.smooth=function(t){return arguments.length?(r=t?u:xc,i):r===u},i}function Sc(t){return isFinite(t)?t:NaN}function Oc(t,e){return null!=t&&+t>=e}function Tc(t){return null==t||isNaN(t=+t)?-1/0:t}function Ac(t,e,n,r){const i=r-e,o=n-e,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function Mc(t){return t[0]}function Pc(t){return t[1]}function Cc(){return 1}function jc(){var t=Mc,e=Pc,n=Cc,r=960,i=500,o=20,a=2,u=3*o,c=r+2*u>>a,s=i+2*u>>a,l=gc(20);function f(r){var i=new Float32Array(c*s),l=Math.pow(2,-a),f=-1;for(const o of r){var h=(t(o,++f,r)+u)*l,p=(e(o,f,r)+u)*l,d=+n(o,f,r);if(d&&h>=0&&h=0&&pt*r)))(e).map(((t,e)=>(t.value=+n[e],p(t))))}function p(t){return t.coordinates.forEach(d),t}function d(t){t.forEach(y)}function y(t){t.forEach(v)}function v(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function m(){return c=r+2*(u=3*o)>>a,s=i+2*u>>a,h}return h.contours=function(t){var e=f(t),n=Ec().size([c,s]),r=Math.pow(2,2*a),i=t=>{t=+t;var i=p(n.contour(e,t*r));return i.value=t,i};return Object.defineProperty(i,"max",{get:()=>Oe(e)/r}),i},h.x=function(e){return arguments.length?(t="function"==typeof e?e:gc(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:gc(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:gc(+t),h):n},h.size=function(t){if(!arguments.length)return[r,i];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))throw new Error("invalid size");return r=e,i=n,m()},h.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),m()},h.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?gc(vc.call(t)):gc(t),h):l},h.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*t*t+1)-1)/2,m()},h}const Nc=134217729;function Lc(t,e,n,r,i){let o,a,u,c,s=e[0],l=r[0],f=0,h=0;l>s==l>-s?(o=s,s=e[++f]):(o=l,l=r[++h]);let p=0;if(fs==l>-s?(a=s+o,u=o-(a-s),s=e[++f]):(a=l+o,u=o-(a-l),l=r[++h]),o=a,0!==u&&(i[p++]=u);fs==l>-s?(a=o+s,c=a-o,u=o-(a-c)+(s-c),s=e[++f]):(a=o+l,c=a-o,u=o-(a-c)+(l-c),l=r[++h]),o=a,0!==u&&(i[p++]=u);for(;f=33306690738754716e-32*s?c:-function(t,e,n,r,i,o,a){let u,c,s,l,f,h,p,d,y,v,m,g,b,_,w,x,k,E;const S=t-i,O=n-i,T=e-o,A=r-o;_=S*A,h=Nc*S,p=h-(h-S),d=S-p,h=Nc*A,y=h-(h-A),v=A-y,w=d*v-(_-p*y-d*y-p*v),x=T*O,h=Nc*T,p=h-(h-T),d=T-p,h=Nc*O,y=h-(h-O),v=O-y,k=d*v-(x-p*y-d*y-p*v),m=w-k,f=w-m,Dc[0]=w-(m+f)+(f-k),g=_+m,f=g-_,b=_-(g-f)+(m-f),m=b-x,f=b-m,Dc[1]=b-(m+f)+(f-x),E=g+m,f=E-g,Dc[2]=g-(E-f)+(m-f),Dc[3]=E;let M=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,Dc),P=22204460492503146e-32*a;if(M>=P||-M>=P)return M;if(f=t-S,u=t-(S+f)+(f-i),f=n-O,s=n-(O+f)+(f-i),f=e-T,c=e-(T+f)+(f-o),f=r-A,l=r-(A+f)+(f-o),0===u&&0===c&&0===s&&0===l)return M;if(P=11093356479670487e-47*a+33306690738754706e-32*Math.abs(M),M+=S*l+A*u-(T*s+O*c),M>=P||-M>=P)return M;_=u*A,h=Nc*u,p=h-(h-u),d=u-p,h=Nc*A,y=h-(h-A),v=A-y,w=d*v-(_-p*y-d*y-p*v),x=c*O,h=Nc*c,p=h-(h-c),d=c-p,h=Nc*O,y=h-(h-O),v=O-y,k=d*v-(x-p*y-d*y-p*v),m=w-k,f=w-m,zc[0]=w-(m+f)+(f-k),g=_+m,f=g-_,b=_-(g-f)+(m-f),m=b-x,f=b-m,zc[1]=b-(m+f)+(f-x),E=g+m,f=E-g,zc[2]=g-(E-f)+(m-f),zc[3]=E;const C=Lc(4,Dc,4,zc,Ic);_=S*l,h=Nc*S,p=h-(h-S),d=S-p,h=Nc*l,y=h-(h-l),v=l-y,w=d*v-(_-p*y-d*y-p*v),x=T*s,h=Nc*T,p=h-(h-T),d=T-p,h=Nc*s,y=h-(h-s),v=s-y,k=d*v-(x-p*y-d*y-p*v),m=w-k,f=w-m,zc[0]=w-(m+f)+(f-k),g=_+m,f=g-_,b=_-(g-f)+(m-f),m=b-x,f=b-m,zc[1]=b-(m+f)+(f-x),E=g+m,f=E-g,zc[2]=g-(E-f)+(m-f),zc[3]=E;const j=Lc(C,Ic,4,zc,Bc);_=u*l,h=Nc*u,p=h-(h-u),d=u-p,h=Nc*l,y=h-(h-l),v=l-y,w=d*v-(_-p*y-d*y-p*v),x=c*s,h=Nc*c,p=h-(h-c),d=c-p,h=Nc*s,y=h-(h-s),v=s-y,k=d*v-(x-p*y-d*y-p*v),m=w-k,f=w-m,zc[0]=w-(m+f)+(f-k),g=_+m,f=g-_,b=_-(g-f)+(m-f),m=b-x,f=b-m,zc[1]=b-(m+f)+(f-x),E=g+m,f=E-g,zc[2]=g-(E-f)+(m-f),zc[3]=E;const N=Lc(j,Bc,4,zc,Fc);return Fc[N-1]}(t,e,n,r,i,o,s)}Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(8),Rc(8),Rc(8),Rc(4),Rc(8),Rc(8),Rc(8),Rc(12),Rc(192),Rc(192),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(4),Rc(4),Rc(4),Rc(8),Rc(16),Rc(16),Rc(16),Rc(32),Rc(32),Rc(48),Rc(64),Rc(1152),Rc(1152),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(1152),Rc(1152),Rc(1152),Rc(1152),Rc(1152),Rc(2304),Rc(2304),Rc(3456),Rc(5760),Rc(8),Rc(8),Rc(8),Rc(16),Rc(24),Rc(48),Rc(48),Rc(96),Rc(192),Rc(384),Rc(384),Rc(384),Rc(768),Rc(96),Rc(96),Rc(96),Rc(1152);const $c=Math.pow(2,-52),Kc=new Uint32Array(512);class Yc{static from(t,e=Xc,n=Zc){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,c=-1/0,s=-1/0;for(let e=0;ec&&(c=n),r>s&&(s=r),this._ids[e]=e}const l=(a+c)/2,f=(u+s)/2;let h,p,d;for(let e=0,n=1/0;e0&&(p=e,n=r)}let m=t[2*p],g=t[2*p+1],b=1/0;for(let e=0;er&&(e[n++]=i,r=o)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Uc(y,v,m,g,_,w)<0){const t=p,e=m,n=g;p=d,m=_,g=w,d=t,_=e,w=n}const x=function(t,e,n,r,i,o){const a=n-t,u=r-e,c=i-t,s=o-e,l=a*a+u*u,f=c*c+s*s,h=.5/(a*s-u*c);return{x:t+(s*l-u*f)*h,y:e+(a*f-c*l)*h}}(y,v,m,g,_,w);this._cx=x.x,this._cy=x.y;for(let e=0;e0&&Math.abs(s-o)<=$c&&Math.abs(l-a)<=$c)continue;if(o=s,a=l,c===h||c===p||c===d)continue;let f=0;for(let t=0,e=this._hashKey(s,l);t=0;)if(v=y,v===f){v=-1;break}if(-1===v)continue;let m=this._addTriangle(v,c,n[v],-1,-1,r[v]);r[c]=this._legalize(m+2),r[v]=m,k++;let g=n[v];for(;y=n[g],Uc(s,l,t[2*g],t[2*g+1],t[2*y],t[2*y+1])<0;)m=this._addTriangle(g,c,y,r[c],-1,r[g]),r[c]=this._legalize(m+2),n[g]=g,k--,g=y;if(v===f)for(;y=e[v],Uc(s,l,t[2*y],t[2*y+1],t[2*v],t[2*v+1])<0;)m=this._addTriangle(y,c,v,-1,r[v],r[y]),this._legalize(m+2),r[y]=m,n[v]=v,k--,v=y;this._hullStart=e[c]=v,n[v]=e[g]=c,n[c]=g,i[this._hashKey(s,l)]=c,i[this._hashKey(t[2*v],t[2*v+1])]=v}this.hull=new Uint32Array(k);for(let t=0,e=this._hullStart;t0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=Kc[--i];continue}const c=a-a%3,s=u+(t+1)%3,l=c+(a+2)%3,f=e[o],h=e[t],p=e[s],d=e[l];if(Vc(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*d],r[2*d+1])){e[t]=d,e[a]=f;const r=n[l];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===l){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,l);const u=c+(a+1)%3;i=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;Gc(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Gc(t,n,r),e[t[i]]>e[t[r]]&&Gc(t,i,r),e[t[n]]>e[t[i]]&&Gc(t,n,i);const a=t[i],u=e[a];for(;;){do{i++}while(e[t[i]]u);if(o=o-n?(Wc(t,e,i,r),Wc(t,e,n,o-1)):(Wc(t,e,n,o-1),Wc(t,e,i,r))}}function Gc(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Xc(t){return t[0]}function Zc(t){return t[1]}const Qc=1e-6;class Jc{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Qc||Math.abs(this._y1-i)>Qc)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class ts{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class es{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,u,c=0,s=0,l=n.length;c1;)i-=2;for(let t=2;t0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new es(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:c}=this;if(-1===r[t]||!c.length)return(t+1)%(c.length>>1);let s=t,l=rs(e-c[2*t],2)+rs(n-c[2*t+1],2);const f=r[t];let h=f;do{let r=u[h];const f=rs(e-c[2*r],2)+rs(n-c[2*r+1],2);if(f()=>t;function ss(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:u,dx:c,dy:s,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:s,enumerable:!0,configurable:!0},_:{value:l}})}function ls(t){return!t.ctrlKey&&!t.button}function fs(){return this.parentNode}function hs(t,e){return null==e?{x:t.x,y:t.y}:e}function ps(){return navigator.maxTouchPoints||"ontouchstart"in this}function ds(){var t,e,n,r,i=ls,o=fs,a=hs,u=ps,c={},s=Fn("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",p).filter(u).on("touchstart.drag",v).on("touchmove.drag",m,ti).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,u){if(!r&&i.call(this,a,u)){var c=b(this,o.call(this,a,u),a,u,"mouse");c&&(Jr(a.view).on("mousemove.drag",d,ei).on("mouseup.drag",y,ei),ii(a.view),ni(a),n=!1,t=a.clientX,e=a.clientY,c("start",a))}}function d(r){if(ri(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}c.mouse("drag",r)}function y(t){Jr(t.view).on("mousemove.drag mouseup.drag",null),oi(t.view,n),ri(t),c.mouse("end",t)}function v(t,e){if(i.call(this,t,e)){var n,r,a=t.changedTouches,u=o.call(this,t,e),c=a.length;for(n=0;n=o?c=!0:(r=t.charCodeAt(a++))===gs?s=!0:r===bs&&(s=!0,t.charCodeAt(a)===gs&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+xs(e,6):xs(e,4))+"-"+xs(t.getUTCMonth()+1,2)+"-"+xs(t.getUTCDate(),2)+(o?"T"+xs(n,2)+":"+xs(r,2)+":"+xs(i,2)+"."+xs(o,3)+"Z":i?"T"+xs(n,2)+":"+xs(r,2)+":"+xs(i,2)+"Z":r||n?"T"+xs(n,2)+":"+xs(r,2)+"Z":"")}(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=_s(t);return function(r,i){return e(n(r),i,t)}}(t,e):_s(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=ws(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=ws(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var Es=ks(","),Ss=Es.parse,Os=Es.parseRows,Ts=Es.format,As=Es.formatBody,Ms=Es.formatRows,Ps=Es.formatRow,Cs=Es.formatValue,js=ks("\t"),Ns=js.parse,Ls=js.parseRows,Rs=js.format,Ds=js.formatBody,Is=js.formatRows,Bs=js.formatRow,Fs=js.formatValue;function zs(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;Us&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const Us=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),$s=t=>+t;function Ks(t){return t*t}function Ys(t){return t*(2-t)}function qs(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var Vs=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),Hs=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Ws=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),Gs=Math.PI,Xs=Gs/2;function Zs(t){return 1==+t?1:1-Math.cos(t*Xs)}function Qs(t){return Math.sin(t*Xs)}function Js(t){return(1-Math.cos(Gs*t))/2}function tl(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function el(t){return tl(1-+t)}function nl(t){return 1-tl(t)}function rl(t){return((t*=2)<=1?tl(1-t):2-tl(t-1))/2}function il(t){return 1-Math.sqrt(1-t*t)}function ol(t){return Math.sqrt(1- --t*t)}function al(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var ul=4/11,cl=6/11,sl=8/11,ll=3/4,fl=9/11,hl=10/11,pl=15/16,dl=21/22,yl=63/64,vl=1/ul/ul;function ml(t){return 1-gl(1-t)}function gl(t){return(t=+t)Nl(e,n).then((e=>(new DOMParser).parseFromString(e,t)))}const $l=Ul("application/xml");var Kl=Ul("text/html"),Yl=Ul("image/svg+xml");function ql(t,e){var n,r=1;function i(){var i,o,a=n.length,u=0,c=0;for(i=0;i=(o=(y+m)/2))?y=o:m=o,(l=n>=(a=(v+g)/2))?v=a:g=a,i=p,!(p=p[f=l<<1|s]))return i[f]=d,t;if(u=+t._x.call(null,p.data),c=+t._y.call(null,p.data),e===u&&n===c)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(s=e>=(o=(y+m)/2))?y=o:m=o,(l=n>=(a=(v+g)/2))?v=a:g=a}while((f=l<<1|s)==(h=(c>=a)<<1|u>=o));return i[h]=p,i[f]=d,t}function Hl(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Wl(t){return t[0]}function Gl(t){return t[1]}function Xl(t,e,n){var r=new Zl(null==e?Wl:e,null==n?Gl:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Zl(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Ql(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Jl=Xl.prototype=Zl.prototype;function tf(t){return function(){return t}}function ef(t){return 1e-6*(t()-.5)}function nf(t){return t.x+t.vx}function rf(t){return t.y+t.vy}function of(t){var e,n,r,i=1,o=1;function a(){for(var t,a,c,s,l,f,h,p=e.length,d=0;ds+d||ol+d||ac.index){var y=s-u.x-u.vx,v=l-u.y-u.vy,m=y*y+v*v;mt.r&&(t.r=t[e].r)}function c(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r[u(t,e,r),t])));for(a=0,i=new Array(s);al&&(l=r),if&&(f=i));if(c>l||s>f)return this;for(this.cover(c,s).cover(l,f),n=0;nt||t>=i||r>e||e>=o;)switch(u=(eh||(o=c.y0)>p||(a=c.x1)=m)<<1|t>=v)&&(c=d[d.length-1],d[d.length-1]=d[d.length-1-s],d[d.length-1-s]=c)}else{var g=t-+this._x.call(null,y.data),b=e-+this._y.call(null,y.data),_=g*g+b*b;if(_=(u=(d+v)/2))?d=u:v=u,(l=a>=(c=(y+m)/2))?y=c:m=c,e=p,!(p=p[f=l<<1|s]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[h]=p:this._root=p),this):(this._root=i,this)},Jl.removeAll=function(t){for(var e=0,n=t.length;e(t=(sf*t+lf)%ff)/ff}();function f(){h(),s.call("tick",e),n1?(null==n?u.delete(t):u.set(t,d(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,u,c,s=0,l=t.length;for(null==r?r=1/0:r*=r,s=0;s1?(s.on(t,n),e):s.on(t)}}}function mf(){var t,e,n,r,i,o=tf(-30),a=1,u=1/0,c=.81;function s(n){var i,o=t.length,a=Xl(t,hf,pf).visitAfter(f);for(r=n,i=0;i=u)){(t.data!==e||t.next)&&(0===f&&(d+=(f=ef(n))*f),0===h&&(d+=(h=ef(n))*h),d1?r[0]+r.slice(2):r,+t.slice(n+1)]}function xf(t){return(t=wf(Math.abs(t)))?t[1]:NaN}var kf,Ef=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Sf(t){if(!(e=Ef.exec(t)))throw new Error("invalid format: "+t);var e;return new Of({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Of(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Tf(t,e){var n=wf(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Sf.prototype=Of.prototype,Of.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Af={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Tf(100*t,e),r:Tf,s:function(t,e){var n=wf(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(kf=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+wf(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Mf(t){return t}var Pf,Cf,jf,Nf=Array.prototype.map,Lf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rf(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Mf:(e=Nf.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Mf:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Nf.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",s=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Sf(t)).fill,n=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,y=t.comma,v=t.precision,m=t.trim,g=t.type;"n"===g?(y=!0,g="g"):Af[g]||(void 0===v&&(v=12),m=!0,g="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",_="$"===h?o:/[%p]/.test(g)?c:"",w=Af[g],x=/[defgprs%]/.test(g);function k(t){var i,o,c,h=b,k=_;if("c"===g)k=w(t)+k,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:w(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==f&&(E=!1),h=(E?"("===f?f:s:"-"===f||"("===f?"":f)+h,k=("s"===g?Lf[8+kf/3]:"")+k+(E&&"("===f?")":""),x)for(i=-1,o=t.length;++i(c=t.charCodeAt(i))||c>57){k=(46===c?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}y&&!p&&(t=r(t,1/0));var S=h.length+t.length+k.length,O=S>1)+h+t+k+O.slice(S);break;default:t=O+h+t+k}return u(t)}return v=void 0===v?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=Sf(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(xf(e)/3))),i=Math.pow(10,-r),o=Lf[8+r/3];return function(t){return n(i*t)+o}}}}function Df(t){return Pf=Rf(t),Cf=Pf.format,jf=Pf.formatPrefix,Pf}function If(t){return Math.max(0,-xf(Math.abs(t)))}function Bf(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(xf(e)/3)))-xf(Math.abs(t)))}function Ff(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,xf(e)-xf(t))+1}Df({thousands:",",grouping:[3],currency:["$",""]});var zf=1e-6,Uf=1e-12,$f=Math.PI,Kf=$f/2,Yf=$f/4,qf=2*$f,Vf=180/$f,Hf=$f/180,Wf=Math.abs,Gf=Math.atan,Xf=Math.atan2,Zf=Math.cos,Qf=Math.ceil,Jf=Math.exp,th=(Math.floor,Math.hypot),eh=Math.log,nh=Math.pow,rh=Math.sin,ih=Math.sign||function(t){return t>0?1:t<0?-1:0},oh=Math.sqrt,ah=Math.tan;function uh(t){return t>1?0:t<-1?$f:Math.acos(t)}function ch(t){return t>1?Kf:t<-1?-Kf:Math.asin(t)}function sh(t){return(t=rh(t/2))*t}function lh(){}function fh(t,e){t&&ph.hasOwnProperty(t.type)&&ph[t.type](t,e)}var hh={Feature:function(t,e){fh(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Zf(e=(e*=Hf)/2+Yf),a=rh(e),u=wh*a,c=_h*o+u*Zf(i),s=u*r*rh(i);Nh.add(Xf(s,c)),bh=t,_h=o,wh=a}function zh(t){return Lh=new Ut,vh(t,Rh),2*Lh}function Uh(t){return[Xf(t[1],t[0]),ch(t[2])]}function $h(t){var e=t[0],n=t[1],r=Zf(n);return[r*Zf(e),r*rh(e),rh(n)]}function Kh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Yh(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function qh(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Vh(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Hh(t){var e=oh(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Wh,Gh,Xh,Zh,Qh,Jh,tp,ep,np,rp,ip,op,ap,up,cp,sp,lp={point:fp,lineStart:pp,lineEnd:dp,polygonStart:function(){lp.point=yp,lp.lineStart=vp,lp.lineEnd=mp,Ph=new Ut,Rh.polygonStart()},polygonEnd:function(){Rh.polygonEnd(),lp.point=fp,lp.lineStart=pp,lp.lineEnd=dp,Nh<0?(xh=-(Eh=180),kh=-(Sh=90)):Ph>zf?Sh=90:Ph<-zf&&(kh=-90),jh[0]=xh,jh[1]=Eh},sphere:function(){xh=-(Eh=180),kh=-(Sh=90)}};function fp(t,e){Ch.push(jh=[xh=t,Eh=t]),eSh&&(Sh=e)}function hp(t,e){var n=$h([t*Hf,e*Hf]);if(Mh){var r=Yh(Mh,n),i=Yh([r[1],-r[0],0],r);Hh(i),i=Uh(i);var o,a=t-Oh,u=a>0?1:-1,c=i[0]*Vf*u,s=Wf(a)>180;s^(u*OhSh&&(Sh=o):s^(u*Oh<(c=(c+360)%360-180)&&cSh&&(Sh=e)),s?tgp(xh,Eh)&&(Eh=t):gp(t,Eh)>gp(xh,Eh)&&(xh=t):Eh>=xh?(tEh&&(Eh=t)):t>Oh?gp(xh,t)>gp(xh,Eh)&&(Eh=t):gp(t,Eh)>gp(xh,Eh)&&(xh=t)}else Ch.push(jh=[xh=t,Eh=t]);eSh&&(Sh=e),Mh=n,Oh=t}function pp(){lp.point=hp}function dp(){jh[0]=xh,jh[1]=Eh,lp.point=fp,Mh=null}function yp(t,e){if(Mh){var n=t-Oh;Ph.add(Wf(n)>180?n+(n>0?360:-360):n)}else Th=t,Ah=e;Rh.point(t,e),hp(t,e)}function vp(){Rh.lineStart()}function mp(){yp(Th,Ah),Rh.lineEnd(),Wf(Ph)>zf&&(xh=-(Eh=180)),jh[0]=xh,jh[1]=Eh,Mh=null}function gp(t,e){return(e-=t)<0?e+360:e}function bp(t,e){return t[0]-e[0]}function _p(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:egp(r[0],r[1])&&(r[1]=i[1]),gp(i[0],r[1])>gp(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(u=gp(r[1],i[0]))>a&&(a=u,xh=i[0],Eh=r[1])}return Ch=jh=null,xh===1/0||kh===1/0?[[NaN,NaN],[NaN,NaN]]:[[xh,kh],[Eh,Sh]]}var xp={sphere:lh,point:kp,lineStart:Sp,lineEnd:Ap,polygonStart:function(){xp.lineStart=Mp,xp.lineEnd=Pp},polygonEnd:function(){xp.lineStart=Sp,xp.lineEnd=Ap}};function kp(t,e){t*=Hf;var n=Zf(e*=Hf);Ep(n*Zf(t),n*rh(t),rh(e))}function Ep(t,e,n){++Wh,Xh+=(t-Xh)/Wh,Zh+=(e-Zh)/Wh,Qh+=(n-Qh)/Wh}function Sp(){xp.point=Op}function Op(t,e){t*=Hf;var n=Zf(e*=Hf);up=n*Zf(t),cp=n*rh(t),sp=rh(e),xp.point=Tp,Ep(up,cp,sp)}function Tp(t,e){t*=Hf;var n=Zf(e*=Hf),r=n*Zf(t),i=n*rh(t),o=rh(e),a=Xf(oh((a=cp*o-sp*i)*a+(a=sp*r-up*o)*a+(a=up*i-cp*r)*a),up*r+cp*i+sp*o);Gh+=a,Jh+=a*(up+(up=r)),tp+=a*(cp+(cp=i)),ep+=a*(sp+(sp=o)),Ep(up,cp,sp)}function Ap(){xp.point=kp}function Mp(){xp.point=Cp}function Pp(){jp(op,ap),xp.point=kp}function Cp(t,e){op=t,ap=e,t*=Hf,e*=Hf,xp.point=jp;var n=Zf(e);up=n*Zf(t),cp=n*rh(t),sp=rh(e),Ep(up,cp,sp)}function jp(t,e){t*=Hf;var n=Zf(e*=Hf),r=n*Zf(t),i=n*rh(t),o=rh(e),a=cp*o-sp*i,u=sp*r-up*o,c=up*i-cp*r,s=th(a,u,c),l=ch(s),f=s&&-l/s;np.add(f*a),rp.add(f*u),ip.add(f*c),Gh+=l,Jh+=l*(up+(up=r)),tp+=l*(cp+(cp=i)),ep+=l*(sp+(sp=o)),Ep(up,cp,sp)}function Np(t){Wh=Gh=Xh=Zh=Qh=Jh=tp=ep=0,np=new Ut,rp=new Ut,ip=new Ut,vh(t,xp);var e=+np,n=+rp,r=+ip,i=th(e,n,r);return i$f&&(t-=Math.round(t/qf)*qf),[t,e]}function Ip(t,e,n){return(t%=qf)?e||n?Rp(Fp(t),zp(e,n)):Fp(t):e||n?zp(e,n):Dp}function Bp(t){return function(e,n){return Wf(e+=t)>$f&&(e-=Math.round(e/qf)*qf),[e,n]}}function Fp(t){var e=Bp(t);return e.invert=Bp(-t),e}function zp(t,e){var n=Zf(t),r=rh(t),i=Zf(e),o=rh(e);function a(t,e){var a=Zf(e),u=Zf(t)*a,c=rh(t)*a,s=rh(e),l=s*n+u*r;return[Xf(c*i-l*o,u*n-s*r),ch(l*i+c*o)]}return a.invert=function(t,e){var a=Zf(e),u=Zf(t)*a,c=rh(t)*a,s=rh(e),l=s*i-c*o;return[Xf(c*i+s*o,u*n+l*r),ch(l*n-u*r)]},a}function Up(t){function e(e){return(e=t(e[0]*Hf,e[1]*Hf))[0]*=Vf,e[1]*=Vf,e}return t=Ip(t[0]*Hf,t[1]*Hf,t.length>2?t[2]*Hf:0),e.invert=function(e){return(e=t.invert(e[0]*Hf,e[1]*Hf))[0]*=Vf,e[1]*=Vf,e},e}function $p(t,e,n,r,i,o){if(n){var a=Zf(e),u=rh(e),c=r*n;null==i?(i=e+r*qf,o=e-c/2):(i=Kp(a,i),o=Kp(a,o),(r>0?io)&&(i+=r*qf));for(var s,l=i;r>0?l>o:l1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Vp(t,e){return Wf(t[0]-e[0])=0;--o)i.point((l=s[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}s=(h=h.o).z,p=!p}while(!h.v);i.lineEnd()}}}function Gp(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,O=S*E,T=O>$f,A=v*x;if(c.add(Xf(A*S*rh(O),m*k+A*Zf(O))),a+=T?E+S*qf:E,T^d>=n^_>=n){var M=Yh($h(p),$h(b));Hh(M);var P=Yh(o,M);Hh(P);var C=(T^E>=0?-1:1)*ch(P[2]);(r>C||r===C&&(M[0]||M[1]))&&(u+=T^E>=0?1:-1)}}return(a<-zf||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Jp))}return h}}function Jp(t){return t.length>1}function td(t,e){return((t=t.x)[0]<0?t[1]-Kf-zf:Kf-t[1])-((e=e.x)[0]<0?e[1]-Kf-zf:Kf-e[1])}Dp.invert=Dp;const ed=Qp((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var u=o>0?$f:-$f,c=Wf(o-n);Wf(c-$f)0?Kf:-Kf),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),e=0):i!==u&&c>=$f&&(Wf(n-i)zf?Gf((rh(e)*(o=Zf(r))*rh(n)-rh(r)*(i=Zf(e))*rh(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=o,r=a),i=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Kf,r.point(-$f,i),r.point(0,i),r.point($f,i),r.point($f,0),r.point($f,-i),r.point(0,-i),r.point(-$f,-i),r.point(-$f,0),r.point(-$f,i);else if(Wf(t[0]-e[0])>zf){var o=t[0]0,i=Wf(e)>zf;function o(t,n){return Zf(t)*Zf(n)>e}function a(t,n,r){var i=[1,0,0],o=Yh($h(t),$h(n)),a=Kh(o,o),u=o[0],c=a-u*u;if(!c)return!r&&t;var s=e*a/c,l=-e*u/c,f=Yh(i,o),h=Vh(i,s);qh(h,Vh(o,l));var p=f,d=Kh(h,p),y=Kh(p,p),v=d*d-y*(Kh(h,h)-1);if(!(v<0)){var m=oh(v),g=Vh(p,(-d-m)/y);if(qh(g,h),g=Uh(g),!r)return g;var b,_=t[0],w=n[0],x=t[1],k=n[1];w<_&&(b=_,_=w,w=b);var E=w-_,S=Wf(E-$f)0^g[1]<(Wf(g[0]-_)$f^(_<=g[0]&&g[0]<=w)){var O=Vh(p,(-d+m)/y);return qh(O,h),[g,Uh(O)]}}}function u(e,n){var i=r?t:$f-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Qp(o,(function(t){var e,n,c,s,l;return{lineStart:function(){s=c=!1,l=1},point:function(f,h){var p,d=[f,h],y=o(f,h),v=r?y?0:u(f,h):y?u(f+(f<0?$f:-$f),h):0;if(!e&&(s=c=y)&&t.lineStart(),y!==c&&(!(p=a(e,d))||Vp(e,p)||Vp(d,p))&&(d[2]=1),y!==c)l=0,y?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(i&&e&&r^y){var m;v&n||!(m=a(d,e,!0))||(l=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!y||e&&Vp(e,d)||t.point(d[0],d[1]),e=d,c=y,n=v},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return l|(s&&c)<<1}}}),(function(e,r,i,o){$p(o,t,n,i,e,r)}),r?[0,-t]:[-$f,t-$f])}var rd,id,od,ad,ud=1e9,cd=-ud;function sd(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,u,s){var l=0,f=0;if(null==i||(l=a(i,u))!==(f=a(o,u))||c(i,o)<0^u>0)do{s.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+u+4)%4)!==f);else s.point(o[0],o[1])}function a(r,i){return Wf(r[0]-t)0?0:3:Wf(r[0]-n)0?2:1:Wf(r[1]-e)0?1:0:i>0?3:2}function u(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,s,l,f,h,p,d,y,v,m,g,b=a,_=qp(),w={point:x,lineStart:function(){w.point=k,s&&s.push(l=[]),m=!0,v=!1,d=y=NaN},lineEnd:function(){c&&(k(f,h),p&&v&&_.rejoin(),c.push(_.result())),w.point=x,v&&b.lineEnd()},polygonStart:function(){b=_,c=[],s=[],g=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=s.length;nr&&(h-o)*(r-a)>(p-a)*(t-o)&&++e:p<=r&&(h-o)*(r-a)<(p-a)*(t-o)&&--e;return e}(),n=g&&e,i=(c=Ue(c)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Wp(c,u,e,o,a),a.polygonEnd()),b=a,c=s=l=null}};function x(t,e){i(t,e)&&b.point(t,e)}function k(o,a){var u=i(o,a);if(s&&l.push([o,a]),m)f=o,h=a,p=u,m=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&v)b.point(o,a);else{var c=[d=Math.max(cd,Math.min(ud,d)),y=Math.max(cd,Math.min(ud,y))],_=[o=Math.max(cd,Math.min(ud,o)),a=Math.max(cd,Math.min(ud,a))];!function(t,e,n,r,i,o){var a,u=t[0],c=t[1],s=0,l=1,f=e[0]-u,h=e[1]-c;if(a=n-u,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>l)return;a>s&&(s=a)}if(a=i-u,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>s&&(s=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>l)return;a>s&&(s=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>s&&(s=a)}else if(h>0){if(a0&&(t[0]=u+s*f,t[1]=c+s*h),l<1&&(e[0]=u+l*f,e[1]=c+l*h),!0}}}}}(c,_,t,e,n,r)?u&&(b.lineStart(),b.point(o,a),g=!1):(v||(b.lineStart(),b.point(c[0],c[1])),b.point(_[0],_[1]),u||b.lineEnd(),g=!1)}d=o,y=a,v=u}return w}}function ld(){var t,e,n,r=0,i=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=sd(r,i,o,a)(e=n)},extent:function(u){return arguments.length?(r=+u[0][0],i=+u[0][1],o=+u[1][0],a=+u[1][1],t=e=null,n):[[r,i],[o,a]]}}}var fd={sphere:lh,point:lh,lineStart:function(){fd.point=pd,fd.lineEnd=hd},lineEnd:lh,polygonStart:lh,polygonEnd:lh};function hd(){fd.point=fd.lineEnd=lh}function pd(t,e){id=t*=Hf,od=rh(e*=Hf),ad=Zf(e),fd.point=dd}function dd(t,e){t*=Hf;var n=rh(e*=Hf),r=Zf(e),i=Wf(t-id),o=Zf(i),a=r*rh(i),u=ad*n-od*r*o,c=od*n+ad*r*o;rd.add(Xf(oh(a*a+u*u),c)),id=t,od=n,ad=r}function yd(t){return rd=new Ut,vh(t,fd),+rd}var vd=[null,null],md={type:"LineString",coordinates:vd};function gd(t,e){return vd[0]=t,vd[1]=e,yd(md)}var bd={Feature:function(t,e){return wd(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=gd(t[o],t[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))zf})).map(c)).concat(qe(Qf(o/p)*p,i,p).filter((function(t){return Wf(t%y)>zf})).map(s))}return m.lines=function(){return g().map((function(t){return{type:"LineString",coordinates:t}}))},m.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(n).reverse().slice(1),f(u).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],u=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),u>a&&(t=u,u=a,a=t),m.precision(v)):[[r,u],[n,a]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),m.precision(v)):[[e,o],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(d=+t[0],y=+t[1],m):[d,y]},m.stepMinor=function(t){return arguments.length?(h=+t[0],p=+t[1],m):[h,p]},m.precision=function(h){return arguments.length?(v=+h,c=Ad(o,i,90),s=Md(e,t,v),l=Ad(u,a,90),f=Md(r,n,v),m):v},m.extentMajor([[-180,-90+zf],[180,90-zf]]).extentMinor([[-180,-80-zf],[180,80+zf]])}function Cd(){return Pd()()}function jd(t,e){var n=t[0]*Hf,r=t[1]*Hf,i=e[0]*Hf,o=e[1]*Hf,a=Zf(r),u=rh(r),c=Zf(o),s=rh(o),l=a*Zf(n),f=a*rh(n),h=c*Zf(i),p=c*rh(i),d=2*ch(oh(sh(o-r)+a*c*sh(i-n))),y=rh(d),v=d?function(t){var e=rh(t*=d)/y,n=rh(d-t)/y,r=n*l+e*h,i=n*f+e*p,o=n*u+e*s;return[Xf(i,r)*Vf,Xf(o,oh(r*r+i*i))*Vf]}:function(){return[n*Vf,r*Vf]};return v.distance=d,v}const Nd=t=>t;var Ld,Rd,Dd,Id,Bd=new Ut,Fd=new Ut,zd={point:lh,lineStart:lh,lineEnd:lh,polygonStart:function(){zd.lineStart=Ud,zd.lineEnd=Yd},polygonEnd:function(){zd.lineStart=zd.lineEnd=zd.point=lh,Bd.add(Wf(Fd)),Fd=new Ut},result:function(){var t=Bd/2;return Bd=new Ut,t}};function Ud(){zd.point=$d}function $d(t,e){zd.point=Kd,Ld=Dd=t,Rd=Id=e}function Kd(t,e){Fd.add(Id*t-Dd*e),Dd=t,Id=e}function Yd(){Kd(Ld,Rd)}const qd=zd;var Vd=1/0,Hd=Vd,Wd=-Vd,Gd=Wd,Xd={point:function(t,e){tWd&&(Wd=t),eGd&&(Gd=e)},lineStart:lh,lineEnd:lh,polygonStart:lh,polygonEnd:lh,result:function(){var t=[[Vd,Hd],[Wd,Gd]];return Wd=Gd=-(Hd=Vd=1/0),t}};const Zd=Xd;var Qd,Jd,ty,ey,ny=0,ry=0,iy=0,oy=0,ay=0,uy=0,cy=0,sy=0,ly=0,fy={point:hy,lineStart:py,lineEnd:vy,polygonStart:function(){fy.lineStart=my,fy.lineEnd=gy},polygonEnd:function(){fy.point=hy,fy.lineStart=py,fy.lineEnd=vy},result:function(){var t=ly?[cy/ly,sy/ly]:uy?[oy/uy,ay/uy]:iy?[ny/iy,ry/iy]:[NaN,NaN];return ny=ry=iy=oy=ay=uy=cy=sy=ly=0,t}};function hy(t,e){ny+=t,ry+=e,++iy}function py(){fy.point=dy}function dy(t,e){fy.point=yy,hy(ty=t,ey=e)}function yy(t,e){var n=t-ty,r=e-ey,i=oh(n*n+r*r);oy+=i*(ty+t)/2,ay+=i*(ey+e)/2,uy+=i,hy(ty=t,ey=e)}function vy(){fy.point=hy}function my(){fy.point=by}function gy(){_y(Qd,Jd)}function by(t,e){fy.point=_y,hy(Qd=ty=t,Jd=ey=e)}function _y(t,e){var n=t-ty,r=e-ey,i=oh(n*n+r*r);oy+=i*(ty+t)/2,ay+=i*(ey+e)/2,uy+=i,cy+=(i=ey*t-ty*e)*(ty+t),sy+=i*(ey+e),ly+=3*i,hy(ty=t,ey=e)}const wy=fy;function xy(t){this._context=t}xy.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,qf)}},result:lh};var ky,Ey,Sy,Oy,Ty,Ay=new Ut,My={point:lh,lineStart:function(){My.point=Py},lineEnd:function(){ky&&Cy(Ey,Sy),My.point=lh},polygonStart:function(){ky=!0},polygonEnd:function(){ky=null},result:function(){var t=+Ay;return Ay=new Ut,t}};function Py(t,e){My.point=Cy,Ey=Oy=t,Sy=Ty=e}function Cy(t,e){Oy-=t,Ty-=e,Ay.add(oh(Oy*Oy+Ty*Ty)),Oy=t,Ty=e}const jy=My;let Ny,Ly,Ry,Dy;class Iy{constructor(t){this._append=null==t?By:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return By;if(e!==Ny){const t=10**e;Ny=e,Ly=function(e){let n=1;this._+=e[0];for(const r=e.length;n=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new Iy(i)),a},a.projection(t).digits(i).context(e)}function zy(t){return{stream:Uy(t)}}function Uy(t){return function(e){var n=new $y;for(var r in t)n[r]=t[r];return n.stream=e,n}}function $y(){}function Ky(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),vh(n,t.stream(Zd)),e(Zd.result()),null!=r&&t.clipExtent(r),t}function Yy(t,e,n){return Ky(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,u])}),n)}function qy(t,e,n){return Yy(t,[[0,0],e],n)}function Vy(t,e,n){return Ky(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function Hy(t,e,n){return Ky(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}$y.prototype={constructor:$y,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Wy=16,Gy=Zf(30*Hf);function Xy(t,e){return+e?function(t,e){function n(r,i,o,a,u,c,s,l,f,h,p,d,y,v){var m=s-r,g=l-i,b=m*m+g*g;if(b>4*e&&y--){var _=a+h,w=u+p,x=c+d,k=oh(_*_+w*w+x*x),E=ch(x/=k),S=Wf(Wf(x)-1)e||Wf((m*M+g*P)/b-.5)>.3||a*h+u*p+c*d2?t[2]%360*Hf:0,M()):[v*Vf,m*Vf,g*Vf]},T.angle=function(t){return arguments.length?(b=t%360*Hf,M()):b*Vf},T.reflectX=function(t){return arguments.length?(_=t?-1:1,M()):_<0},T.reflectY=function(t){return arguments.length?(w=t?-1:1,M()):w<0},T.precision=function(t){return arguments.length?(a=Xy(u,O=t*t),P()):oh(O)},T.fitExtent=function(t,e){return Yy(T,t,e)},T.fitSize=function(t,e){return qy(T,t,e)},T.fitWidth=function(t,e){return Vy(T,t,e)},T.fitHeight=function(t,e){return Hy(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&A,M()}}function ev(t){var e=0,n=$f/3,r=tv(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Hf,n=t[1]*Hf):[e*Vf,n*Vf]},i}function nv(t,e){var n=rh(t),r=(n+rh(e))/2;if(Wf(r)=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),u.stream(n),c.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<-Kf+zf&&(e=-Kf+zf):e>Kf-zf&&(e=Kf-zf);var n=i/nh(yv(e),r);return[n*rh(r*t),i-n*Zf(r*t)]}return o.invert=function(t,e){var n=i-e,o=ih(r)*oh(t*t+n*n),a=Xf(t,Wf(n))*ih(n);return n*r<0&&(a-=$f*ih(t)*ih(n)),[a/r,2*Gf(nh(i/o,1/r))-Kf]},o}function mv(){return ev(vv).scale(109.5).parallels([30,30])}function gv(t,e){return[t,e]}function bv(){return Jy(gv).scale(152.63)}function _v(t,e){var n=Zf(t),r=t===e?rh(t):(n-Zf(e))/(e-t),i=n/r+t;if(Wf(r)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function zv(t,e){return t.parent===e.parent?1:2}function Uv(t,e){return t+e.x}function $v(t,e){return Math.max(t,e.y)}function Kv(){var t=zv,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(Uv,0)/t.length}(n),e.y=function(t){return 1+t.reduce($v,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var u=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),s=u.x-t(u,c)/2,l=c.x+t(c,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-s)/(l-s)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function Yv(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function qv(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Hv)):void 0===e&&(e=Vv);for(var n,r,i,o,a,u=new Xv(t),c=[u];n=c.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new Xv(i[o])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(Gv)}function Vv(t){return t.children}function Hv(t){return Array.isArray(t)?t[1]:null}function Wv(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Gv(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Xv(t){this.data=t,this.depth=this.height=0,this.parent=null}function Zv(t){return null==t?null:Qv(t)}function Qv(t){if("function"!=typeof t)throw new Error;return t}function Jv(){return 0}function tm(t){return function(){return t}}Tv.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(xv+kv*i+o*(Ev+Sv*i))-e)/(xv+3*kv*i+o*(7*Ev+9*Sv*i)))*r)*i*i,!(Wf(n)zf&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},Lv.invert=uv(ch),Dv.invert=uv((function(t){return 2*Gf(t)})),Bv.invert=function(t,e){return[-e,2*Gf(Jf(t))-Kf]},Xv.prototype=qv.prototype={constructor:Xv,count:function(){return this.eachAfter(Yv)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],u=[],c=-1;o=a.pop();)if(u.push(o),n=o.children)for(r=0,i=n.length;r=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return qv(this).eachBefore(Wv)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n(t=(em*t+nm)%rm)/rm}function om(t){return am(t,im())}function am(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i0&&n*n>r*r+i*i}function lm(t,e){for(var n=0;n1e-6?(T+Math.sqrt(T*T-4*O*A))/(2*O):A/T);return{x:r+x+k*M,y:i+E+S*M,r:M}}function dm(t,e,n){var r,i,o,a,u=t.x-e.x,c=t.y-e.y,s=u*u+c*c;s?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(s+a-i)/(2*s),o=Math.sqrt(Math.max(0,a/s-r*r)),n.x=t.x-r*u-o*c,n.y=t.y-r*c+o*u):(r=(s+i-a)/(2*s),o=Math.sqrt(Math.max(0,i/s-r*r)),n.x=e.x+r*u-o*c,n.y=e.y+r*c+o*u)):(n.x=e.x+n.r,n.y=e.y)}function ym(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function vm(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function mm(t){this._=t,this.next=null,this.previous=null}function gm(t,e){if(!(a=(n=t,t="object"==typeof n&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,o,a,u,c,s,l,f,h,p;if((r=t[0]).x=0,r.y=0,!(a>1))return r.r;if(i=t[1],r.x=-i.r,i.x=r.r,i.y=0,!(a>2))return r.r+i.r;dm(i,r,o=t[2]),r=new mm(r),i=new mm(i),o=new mm(o),r.next=o.previous=i,i.next=r.previous=o,o.next=i.previous=r;t:for(s=3;sfunction(t){let e=(t=`${t}`).length;return Rm(t,e-1)&&!Rm(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(Lm),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(Lm(t)),h.push(Pm));p=(t,n)=>e[n],d=(t,e)=>n[e]}for(a=0,i=h.length;a=0&&(s=h[t]).data===Pm;--t)s.data=null}if(u.parent=Am,u.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Gv),u.parent=null,i>0)throw new Error("cycle");return u}return r.id=function(t){return arguments.length?(e=Zv(t),r):e},r.parentId=function(t){return arguments.length?(n=Zv(t),r):n},r.path=function(e){return arguments.length?(t=Zv(e),r):t},r}function Lm(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Rm(t,e););return t.slice(0,e)}function Rm(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function Dm(t,e){return t.parent===e.parent?1:2}function Im(t){var e=t.children;return e?e[0]:t.t}function Bm(t){var e=t.children;return e?e[e.length-1]:t.t}function Fm(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function zm(t,e,n){return t.a.parent===e.parent?t.a:n}function Um(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function $m(){var t=Dm,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new Um(t,0),u=[a];e=u.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(n=e.children[i]=new Um(r[i],i)),n.parent=e;return(a.parent=new Um(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var s=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=s===l?1:t(s,l)/2,p=h-s.x,d=e/(l.x+h+p),y=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*y}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,u=n,c=o.parent.children[0],s=o.m,l=a.m,f=u.m,h=c.m;u=Bm(u),o=Im(o),u&&o;)c=Im(c),(a=Bm(a)).a=e,(i=u.z+f-o.z-s+t(u._,o._))>0&&(Fm(zm(u,e,r),e,i),s+=i,l+=i),f+=u.m,s+=o.m,h+=c.m,l+=a.m;u&&!Bm(a)&&(a.t=u,a.m+=f-l),o&&!Im(c)&&(c.t=o,c.m+=s-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function Km(t,e,n,r,i){for(var o,a=t.children,u=-1,c=a.length,s=t.value&&(i-n)/t.value;++uh&&(h=u),v=l*l*y,(p=Math.max(h/v,v/f))>d){l-=u;break}d=p}m.push(a={value:l,dice:c1?e:1)},n}(Ym);function Hm(){var t=Vm,e=!1,n=1,r=1,i=[0],o=Jv,a=Jv,u=Jv,c=Jv,s=Jv;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(Sm),t}function f(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,f=e.x1-n,h=e.y1-n;f=n-1){var l=u[e];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=c)}for(var f=s[e],h=r/2+f,p=e+1,d=n-1;p>>1;s[y]c-o){var g=r?(i*m+a*v)/r:a;t(e,p,v,i,o,g,c),t(p,n,m,g,o,a,c)}else{var b=r?(o*m+c*v)/r:c;t(e,p,v,i,o,a,b),t(p,n,m,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function Gm(t,e,n,r,i){(1&t.depth?Km:Om)(t,e,n,r,i)}const Xm=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,u,c,s,l,f=-1,h=a.length,p=t.value;++f1?e:1)},n}(Ym);function Zm(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function Qm(t,e){var n=Hi(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}function Jm(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function tg(t){return((t=Math.exp(t))+1/t)/2}const eg=function t(e,n,r){function i(t,i){var o,a,u=t[0],c=t[1],s=t[2],l=i[0],f=i[1],h=i[2],p=l-u,d=f-c,y=p*p+d*d;if(y<1e-12)a=Math.log(h/s)/e,o=function(t){return[u+t*p,c+t*d,s*Math.exp(e*t*a)]};else{var v=Math.sqrt(y),m=(h*h-s*s+r*y)/(2*s*n*v),g=(h*h-s*s-r*y)/(2*h*n*v),b=Math.log(Math.sqrt(m*m+1)-m),_=Math.log(Math.sqrt(g*g+1)-g);a=(_-b)/e,o=function(t){var r,i=t*a,o=tg(b),l=s/(n*v)*(o*(r=e*i+b,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[u+l*p,c+l*d,s*o/tg(e*i+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function ng(t){return function(e,n){var r=t((e=Ii(e)).h,(n=Ii(n)).h),i=Wi(e.s,n.s),o=Wi(e.l,n.l),a=Wi(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const rg=ng(Hi);var ig=ng(Wi);function og(t,e){var n=Wi((t=Gu(t)).l,(e=Gu(e)).l),r=Wi(t.a,e.a),i=Wi(t.b,e.b),o=Wi(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function ag(t){return function(e,n){var r=t((e=rc(e)).h,(n=rc(n)).h),i=Wi(e.c,n.c),o=Wi(e.l,n.l),a=Wi(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const ug=ag(Hi);var cg=ag(Wi);function sg(t){return function e(n){function r(e,r){var i=t((e=dc(e)).h,(r=dc(r)).h),o=Wi(e.s,r.s),a=Wi(e.l,r.l),u=Wi(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=u(t),e+""}}return n=+n,r.gamma=e,r}(1)}const lg=sg(Hi);var fg=sg(Wi);function hg(t,e){void 0===e&&(e=t,t=so);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n1&&vg(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function bg(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e=0;--e)s.push(t[r[o[e]][2]]);for(e=+u;eu!=s>u&&a<(c-n)*(u-r)/(s-r)+n&&(l=!l),c=n,s=r;return l}function wg(t){for(var e,n,r=-1,i=t.length,o=t[i-1],a=o[0],u=o[1],c=0;++r1);return t+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(xg),Og=function t(e){var n=Sg.source(e);function r(){var t=n.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(xg),Tg=function t(e){function n(t){return(t=+t)<=0?()=>0:function(){for(var n=0,r=t;r>1;--r)n+=e();return n+r*e()}}return n.source=t,n}(xg),Ag=function t(e){var n=Tg.source(e);function r(t){if(0==(t=+t))return e;var r=n(t);return function(){return r()/t}}return r.source=t,r}(xg),Mg=function t(e){function n(t){return function(){return-Math.log1p(-e())/t}}return n.source=t,n}(xg),Pg=function t(e){function n(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-e(),t)}}return n.source=t,n}(xg),Cg=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(e()+t)}}return n.source=t,n}(xg),jg=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-e())/t)})}return n.source=t,n}(xg),Ng=function t(e){var n=Sg.source(e)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-e())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(e(),1/t):()=>1;return function(){do{do{var t=n(),u=1+o*t}while(u<=0);u*=u*u;var c=1-e()}while(c>=1-.0331*t*t*t*t&&Math.log(c)>=.5*t*t+i*(1-u+Math.log(u)));return i*u*a()*r}}return r.source=t,r}(xg),Lg=function t(e){var n=Ng.source(e);function r(t,e){var r=n(t),i=n(e);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(xg),Rg=function t(e){var n=jg.source(e),r=Lg.source(e);function i(t,e){return t=+t,(e=+e)>=1?()=>t:e<=0?()=>0:function(){for(var i=0,o=t,a=e;o*a>16&&o*(1-a)>16;){var u=Math.floor((o+1)*a),c=r(u,o-u+1)();c<=a?(i+=u,o-=u,a=(a-c)/(1-c)):(o=u-1,a/=c)}for(var s=a<.5,l=n(s?a:1-a),f=l(),h=0;f<=o;++h)f+=l();return i+(s?h:o-h)}}return i.source=t,i}(xg),Dg=function t(e){function n(t,n,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=e=>Math.pow(e,t)),n=null==n?0:+n,r=null==r?1:+r,function(){return n+r*i(-Math.log1p(-e()))}}return n.source=t,n}(xg),Ig=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){return t+n*Math.tan(Math.PI*e())}}return n.source=t,n}(xg),Bg=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){var r=e();return t+n*Math.log(r/(1-r))}}return n.source=t,n}(xg),Fg=function t(e){var n=Ng.source(e),r=Rg.source(e);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),u=n(a)();if(u>o)return i+r(a-1,o/u)();i+=a,o-=u}for(var c=-Math.log1p(-e()),s=0;c<=o;++s)c-=Math.log1p(-e());return i+s}}return i.source=t,i}(xg),zg=1664525,Ug=1013904223,$g=1/4294967296;function Kg(t=Math.random()){let e=0|(0<=t&&t<1?t/$g:Math.abs(t));return()=>(e=zg*e+Ug|0,$g*(e>>>0))}function Yg(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function qg(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Vg=Symbol("implicit");function Hg(){var t=new Yt,e=[],n=[],r=Vg;function i(i){let o=t.get(i);if(void 0===o){if(r!==Vg)return r;t.set(i,o=e.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Yt;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Hg(e,n).unknown(r)},Yg.apply(i,arguments),i}function Wg(){var t,e,n=Hg().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,u=!1,c=0,s=0,l=.5;function f(){var n=r().length,f=ae&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?nb:eb,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),u,c)))(t(s(e)))}return f.invert=function(n){return s(e((o||(o=r(u,a.map(t),io)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Zg),l()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),l()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),c=Jm,l()},f.clamp=function(t){return arguments.length?(s=!!t||Jg,l()):s!==Jg},f.interpolate=function(t){return arguments.length?(c=t,l()):c},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function ob(){return ib()(Jg,Jg)}function ab(t,e,n,r){var i,o=xe(t,e,n);switch((r=Sf(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=Bf(o,a))||(r.precision=i),jf(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Ff(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=If(o))||(r.precision=i-2*("%"===r.type))}return Cf(r)}function ub(t){var e=t.domain;return t.ticks=function(t){var n=e();return _e(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return ab(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,u=o.length-1,c=o[a],s=o[u],l=10;for(s0;){if((i=we(c,s,n))===r)return o[a]=c,o[u]=s,e(o);if(i>0)c=Math.floor(c/i)*i,s=Math.ceil(s/i)*i;else{if(!(i<0))break;c=Math.ceil(c*i)/i,s=Math.floor(s*i)/i}r=i}return t},t}function cb(){var t=ob();return t.copy=function(){return rb(t,cb())},Yg.apply(t,arguments),ub(t)}function sb(t){var e;function n(t){return null==t||isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,Zg),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return sb(t).unknown(e)},t=arguments.length?Array.from(t,Zg):[0,1],ub(n)}function lb(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-e,n)}function mb(t){const e=t(fb,hb),n=e.domain;let r,i,o=10;function a(){return r=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),i=function(t){return 10===t?yb:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=vb(r),i=vb(i),t(pb,db)):t(fb,hb),e}return e.base=function(t){return arguments.length?(o=+t,a()):o},e.domain=function(t){return arguments.length?(n(t),a()):n()},e.ticks=t=>{const e=n();let a=e[0],u=e[e.length-1];const c=u0){for(;f<=h;++f)for(s=1;su)break;d.push(l)}}else for(;f<=h;++f)for(s=o-1;s>=1;--s)if(l=f>0?s/i(-f):s*i(f),!(lu)break;d.push(l)}2*d.length{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=Sf(n)).precision||(n.trim=!0),n=Cf(n)),t===1/0)return n;const a=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/i(Math.round(r(t)));return e*on(lb(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function gb(){const t=mb(ib()).domain([1,10]);return t.copy=()=>rb(t,gb()).base(t.base()),Yg.apply(t,arguments),t}function bb(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function _b(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function wb(t){var e=1,n=t(bb(e),_b(e));return n.constant=function(n){return arguments.length?t(bb(e=+n),_b(e)):e},ub(n)}function xb(){var t=wb(ib());return t.copy=function(){return rb(t,xb()).constant(t.constant())},Yg.apply(t,arguments)}function kb(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Eb(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Sb(t){return t<0?-t*t:t*t}function Ob(t){var e=t(Jg,Jg),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(Jg,Jg):.5===n?t(Eb,Sb):t(kb(n),kb(1/n)):n},ub(e)}function Tb(){var t=Ob(ib());return t.copy=function(){return rb(t,Tb()).exponent(t.exponent())},Yg.apply(t,arguments),t}function Ab(){return Tb.apply(null,arguments).exponent(.5)}function Mb(t){return Math.sign(t)*t*t}function Pb(){var t,e=ob(),n=[0,1],r=!1;function i(n){var i=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(n));return isNaN(i)?t:r?Math.round(i):i}return i.invert=function(t){return e.invert(Mb(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(t){return arguments.length?(e.range((n=Array.from(t,Zg)).map(Mb)),i):n.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(r=!!t,i):r},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Pb(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},Yg.apply(i,arguments),ub(i)}function Cb(){var t,e=[],n=[],r=[];function i(){var t=0,i=Math.max(1,n.length);for(r=new Array(i-1);++t0?r[i-1]:e[0],i=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return jb().domain([e,n]).range(o).unknown(t)},Yg.apply(ub(a),arguments)}function Nb(){var t,e=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[Et(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=Array.from(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Nb().domain(e).range(n).unknown(t)},Yg.apply(i,arguments)}const Lb=1e3,Rb=6e4,Db=36e5,Ib=864e5,Bb=6048e5,Fb=31536e6,zb=new Date,Ub=new Date;function $b(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n0))return a;let u;do{a.push(u=new Date(+n)),e(n,o),t(n)}while(u$b((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(zb.setTime(+e),Ub.setTime(+r),t(zb),t(Ub),Math.floor(n(zb,Ub))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}const Kb=$b((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Kb.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?$b((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Kb:null);const Yb=Kb.range,qb=$b((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*Lb)}),((t,e)=>(e-t)/Lb),(t=>t.getUTCSeconds())),Vb=qb.range,Hb=$b((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Lb)}),((t,e)=>{t.setTime(+t+e*Rb)}),((t,e)=>(e-t)/Rb),(t=>t.getMinutes())),Wb=Hb.range,Gb=$b((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*Rb)}),((t,e)=>(e-t)/Rb),(t=>t.getUTCMinutes())),Xb=Gb.range,Zb=$b((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Lb-t.getMinutes()*Rb)}),((t,e)=>{t.setTime(+t+e*Db)}),((t,e)=>(e-t)/Db),(t=>t.getHours())),Qb=Zb.range,Jb=$b((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*Db)}),((t,e)=>(e-t)/Db),(t=>t.getUTCHours())),t_=Jb.range,e_=$b((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Rb)/Ib),(t=>t.getDate()-1)),n_=e_.range,r_=$b((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Ib),(t=>t.getUTCDate()-1)),i_=r_.range,o_=$b((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Ib),(t=>Math.floor(t/Ib))),a_=o_.range;function u_(t){return $b((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Rb)/Bb))}const c_=u_(0),s_=u_(1),l_=u_(2),f_=u_(3),h_=u_(4),p_=u_(5),d_=u_(6),y_=c_.range,v_=s_.range,m_=l_.range,g_=f_.range,b_=h_.range,__=p_.range,w_=d_.range;function x_(t){return $b((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/Bb))}const k_=x_(0),E_=x_(1),S_=x_(2),O_=x_(3),T_=x_(4),A_=x_(5),M_=x_(6),P_=k_.range,C_=E_.range,j_=S_.range,N_=O_.range,L_=T_.range,R_=A_.range,D_=M_.range,I_=$b((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth())),B_=I_.range,F_=$b((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth())),z_=F_.range,U_=$b((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));U_.every=t=>isFinite(t=Math.floor(t))&&t>0?$b((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null;const $_=U_.range,K_=$b((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));K_.every=t=>isFinite(t=Math.floor(t))&&t>0?$b((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null;const Y_=K_.range;function q_(t,e,n,r,i,o){const a=[[qb,1,Lb],[qb,5,5e3],[qb,15,15e3],[qb,30,3e4],[o,1,Rb],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,Db],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,Ib],[r,2,1728e5],[n,1,Bb],[e,1,2592e6],[e,3,7776e6],[t,1,Fb]];function u(e,n,r){const i=Math.abs(n-e)/r,o=mt((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(xe(e/Fb,n/Fb,r));if(0===o)return Kb.every(Math.max(xe(e,n,r),1));const[u,c]=a[i/a[o-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:_x,s:wx,S:Uw,u:$w,U:Kw,V:qw,w:Vw,W:Hw,x:null,X:null,y:Ww,Y:Xw,Z:Qw,"%":bx},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Jw,e:Jw,f:ix,g:yx,G:mx,H:tx,I:ex,j:nx,L:rx,m:ox,M:ax,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:_x,s:wx,S:ux,u:cx,U:sx,V:fx,w:hx,W:px,x:null,X:null,y:dx,Y:vx,Z:gx,"%":bx},w={a:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:kw,e:kw,f:Mw,g:bw,G:gw,H:Sw,I:Sw,j:Ew,L:Aw,m:xw,M:Ow,p:function(t,e,n){var r=s.exec(e.slice(n));return r?(t.p=l.get(r[0].toLowerCase()),n+r[0].length):-1},q:ww,Q:Cw,s:jw,S:Tw,u:dw,U:yw,V:vw,w:pw,W:mw,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:bw,Y:gw,Z:_w,"%":Pw};function x(t,e){return function(n){var r,i,o,a=[],u=-1,c=0,s=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Z_(Q_(o.y,0,1))).getUTCDay(),r=i>4||0===i?E_.ceil(r):E_(r),r=r_.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=X_(Q_(o.y,0,1))).getDay(),r=i>4||0===i?s_.ceil(r):s_(r),r=e_.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Z_(Q_(o.y,0,1)).getUTCDay():X_(Q_(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Z_(o)):X_(o)}}function E(t,e,n,r){for(var i,o,a=0,u=e.length,c=n.length;a=c)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=w[i in ow?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=x(n,b),b.X=x(r,b),b.c=x(e,b),_.x=x(n,_),_.X=x(r,_),_.c=x(e,_),{format:function(t){var e=x(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",_);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var tw,ew,nw,rw,iw,ow={"-":"",_:" ",0:"0"},aw=/^\s*\d+/,uw=/^%/,cw=/[\\^$*+?|[\]().{}]/g;function sw(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function pw(t,e,n){var r=aw.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function dw(t,e,n){var r=aw.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function yw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function vw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function mw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function gw(t,e,n){var r=aw.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function bw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function _w(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ww(t,e,n){var r=aw.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function xw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function kw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Ew(t,e,n){var r=aw.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Sw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Ow(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Tw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Aw(t,e,n){var r=aw.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Mw(t,e,n){var r=aw.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pw(t,e,n){var r=uw.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Cw(t,e,n){var r=aw.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jw(t,e,n){var r=aw.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Nw(t,e){return sw(t.getDate(),e,2)}function Lw(t,e){return sw(t.getHours(),e,2)}function Rw(t,e){return sw(t.getHours()%12||12,e,2)}function Dw(t,e){return sw(1+e_.count(U_(t),t),e,3)}function Iw(t,e){return sw(t.getMilliseconds(),e,3)}function Bw(t,e){return Iw(t,e)+"000"}function Fw(t,e){return sw(t.getMonth()+1,e,2)}function zw(t,e){return sw(t.getMinutes(),e,2)}function Uw(t,e){return sw(t.getSeconds(),e,2)}function $w(t){var e=t.getDay();return 0===e?7:e}function Kw(t,e){return sw(c_.count(U_(t)-1,t),e,2)}function Yw(t){var e=t.getDay();return e>=4||0===e?h_(t):h_.ceil(t)}function qw(t,e){return t=Yw(t),sw(h_.count(U_(t),t)+(4===U_(t).getDay()),e,2)}function Vw(t){return t.getDay()}function Hw(t,e){return sw(s_.count(U_(t)-1,t),e,2)}function Ww(t,e){return sw(t.getFullYear()%100,e,2)}function Gw(t,e){return sw((t=Yw(t)).getFullYear()%100,e,2)}function Xw(t,e){return sw(t.getFullYear()%1e4,e,4)}function Zw(t,e){var n=t.getDay();return sw((t=n>=4||0===n?h_(t):h_.ceil(t)).getFullYear()%1e4,e,4)}function Qw(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+sw(e/60|0,"0",2)+sw(e%60,"0",2)}function Jw(t,e){return sw(t.getUTCDate(),e,2)}function tx(t,e){return sw(t.getUTCHours(),e,2)}function ex(t,e){return sw(t.getUTCHours()%12||12,e,2)}function nx(t,e){return sw(1+r_.count(K_(t),t),e,3)}function rx(t,e){return sw(t.getUTCMilliseconds(),e,3)}function ix(t,e){return rx(t,e)+"000"}function ox(t,e){return sw(t.getUTCMonth()+1,e,2)}function ax(t,e){return sw(t.getUTCMinutes(),e,2)}function ux(t,e){return sw(t.getUTCSeconds(),e,2)}function cx(t){var e=t.getUTCDay();return 0===e?7:e}function sx(t,e){return sw(k_.count(K_(t)-1,t),e,2)}function lx(t){var e=t.getUTCDay();return e>=4||0===e?T_(t):T_.ceil(t)}function fx(t,e){return t=lx(t),sw(T_.count(K_(t),t)+(4===K_(t).getUTCDay()),e,2)}function hx(t){return t.getUTCDay()}function px(t,e){return sw(E_.count(K_(t)-1,t),e,2)}function dx(t,e){return sw(t.getUTCFullYear()%100,e,2)}function yx(t,e){return sw((t=lx(t)).getUTCFullYear()%100,e,2)}function vx(t,e){return sw(t.getUTCFullYear()%1e4,e,4)}function mx(t,e){var n=t.getUTCDay();return sw((t=n>=4||0===n?T_(t):T_.ceil(t)).getUTCFullYear()%1e4,e,4)}function gx(){return"+0000"}function bx(){return"%"}function _x(t){return+t}function wx(t){return Math.floor(+t/1e3)}function xx(t){return tw=J_(t),ew=tw.format,nw=tw.parse,rw=tw.utcFormat,iw=tw.utcParse,tw}function kx(t){return new Date(t)}function Ex(t){return t instanceof Date?+t:+new Date(+t)}function Sx(t,e,n,r,i,o,a,u,c,s){var l=ob(),f=l.invert,h=l.domain,p=s(".%L"),d=s(":%S"),y=s("%I:%M"),v=s("%I %p"),m=s("%a %d"),g=s("%b %d"),b=s("%B"),_=s("%Y");function w(t){return(c(t)e(r/(t.length-1))))},n.quantiles=function(e){return Array.from({length:e+1},((n,r)=>Ne(t,r/e)))},n.copy=function(){return Rx(e).domain(t)},qg.apply(n,arguments)}function Dx(){var t,e,n,r,i,o,a,u=0,c=.5,s=1,l=1,f=Jg,h=!1;function p(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*tZi(t[t.length-1]);var ek=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map($x);const nk=tk(ek);var rk=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map($x);const ik=tk(rk);var ok=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map($x);const ak=tk(ok);var uk=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map($x);const ck=tk(uk);var sk=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map($x);const lk=tk(sk);var fk=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map($x);const hk=tk(fk);var pk=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map($x);const dk=tk(pk);var yk=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map($x);const vk=tk(yk);var mk=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map($x);const gk=tk(mk);var bk=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map($x);const _k=tk(bk);var wk=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map($x);const xk=tk(wk);var kk=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map($x);const Ek=tk(kk);var Sk=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map($x);const Ok=tk(Sk);var Tk=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map($x);const Ak=tk(Tk);var Mk=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map($x);const Pk=tk(Mk);var Ck=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map($x);const jk=tk(Ck);var Nk=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map($x);const Lk=tk(Nk);var Rk=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map($x);const Dk=tk(Rk);var Ik=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map($x);const Bk=tk(Ik);var Fk=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map($x);const zk=tk(Fk);var Uk=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map($x);const $k=tk(Uk);var Kk=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map($x);const Yk=tk(Kk);var qk=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map($x);const Vk=tk(qk);var Hk=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map($x);const Wk=tk(Hk);var Gk=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map($x);const Xk=tk(Gk);var Zk=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map($x);const Qk=tk(Zk);var Jk=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map($x);const tE=tk(Jk);function eE(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"}const nE=fg(dc(300,.5,0),dc(-240,.5,1));var rE=fg(dc(-100,.75,.35),dc(80,1.5,.8)),iE=fg(dc(260,.75,.35),dc(80,1.5,.8)),oE=dc();function aE(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return oE.h=360*t-100,oE.s=1.5-1.5*e,oE.l=.8-.9*e,oE+""}var uE=Ai(),cE=Math.PI/3,sE=2*Math.PI/3;function lE(t){var e;return t=(.5-t)*Math.PI,uE.r=255*(e=Math.sin(t))*e,uE.g=255*(e=Math.sin(t+cE))*e,uE.b=255*(e=Math.sin(t+sE))*e,uE+""}function fE(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}function hE(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const pE=hE($x("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var dE=hE($x("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),yE=hE($x("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),vE=hE($x("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function mE(t){return Jr(Fr(t).call(document.documentElement))}var gE=0;function bE(){return new _E}function _E(){this._="@"+(++gE).toString(36)}function wE(t,e){return t.target&&(t=lo(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>fo(t,e)))}function xE(t){return"string"==typeof t?new Xr([document.querySelectorAll(t)],[document.documentElement]):new Xr([$n(t)],Gr)}function kE(t){return function(){return t}}_E.prototype=bE.prototype={constructor:_E,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};const EE=Math.abs,SE=Math.atan2,OE=Math.cos,TE=Math.max,AE=Math.min,ME=Math.sin,PE=Math.sqrt,CE=1e-12,jE=Math.PI,NE=jE/2,LE=2*jE;function RE(t){return t>=1?NE:t<=-1?-NE:Math.asin(t)}function DE(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new ku(e)}function IE(t){return t.innerRadius}function BE(t){return t.outerRadius}function FE(t){return t.startAngle}function zE(t){return t.endAngle}function UE(t){return t&&t.padAngle}function $E(t,e,n,r,i,o,a){var u=t-n,c=e-r,s=(a?o:-o)/PE(u*u+c*c),l=s*c,f=-s*u,h=t+l,p=e+f,d=n+l,y=r+f,v=(h+d)/2,m=(p+y)/2,g=d-h,b=y-p,_=g*g+b*b,w=i-o,x=h*y-d*p,k=(b<0?-1:1)*PE(TE(0,w*w*_-x*x)),E=(x*b-g*k)/_,S=(-x*g-b*k)/_,O=(x*b+g*k)/_,T=(-x*g+b*k)/_,A=E-v,M=S-m,P=O-v,C=T-m;return A*A+M*M>P*P+C*C&&(E=O,S=T),{cx:E,cy:S,x01:-l,y01:-f,x11:E*(i/w-1),y11:S*(i/w-1)}}function KE(){var t=IE,e=BE,n=kE(0),r=null,i=FE,o=zE,a=UE,u=null,c=DE(s);function s(){var s,l,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-NE,y=o.apply(this,arguments)-NE,v=EE(y-d),m=y>d;if(u||(u=s=c()),pCE)if(v>LE-CE)u.moveTo(p*OE(d),p*ME(d)),u.arc(0,0,p,d,y,!m),h>CE&&(u.moveTo(h*OE(y),h*ME(y)),u.arc(0,0,h,y,d,m));else{var g,b,_=d,w=y,x=d,k=y,E=v,S=v,O=a.apply(this,arguments)/2,T=O>CE&&(r?+r.apply(this,arguments):PE(h*h+p*p)),A=AE(EE(p-h)/2,+n.apply(this,arguments)),M=A,P=A;if(T>CE){var C=RE(T/h*ME(O)),j=RE(T/p*ME(O));(E-=2*C)>CE?(x+=C*=m?1:-1,k-=C):(E=0,x=k=(d+y)/2),(S-=2*j)>CE?(_+=j*=m?1:-1,w-=j):(S=0,_=w=(d+y)/2)}var N=p*OE(_),L=p*ME(_),R=h*OE(k),D=h*ME(k);if(A>CE){var I,B=p*OE(w),F=p*ME(w),z=h*OE(x),U=h*ME(x);if(v1?0:f<-1?jE:Math.acos(f))/2),H=PE(I[0]*I[0]+I[1]*I[1]);M=AE(A,(h-H)/(V-1)),P=AE(A,(p-H)/(V+1))}else M=P=0}S>CE?P>CE?(g=$E(z,U,N,L,p,P,m),b=$E(B,F,R,D,p,P,m),u.moveTo(g.cx+g.x01,g.cy+g.y01),PCE&&E>CE?M>CE?(g=$E(R,D,B,F,h,-M,m),b=$E(N,L,z,U,h,-M,m),u.lineTo(g.cx+g.x01,g.cy+g.y01),M=f;--h)u.point(m[h],g[h]);u.lineEnd(),u.areaEnd()}v&&(m[l]=+t(p,l,s),g[l]=+e(p,l,s),u.point(r?+r(p,l,s):m[l],n?+n(p,l,s):g[l]))}if(d)return u=null,d+""||null}function l(){return XE().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?WE:kE(+t),e="function"==typeof e?e:kE(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?GE:kE(+n),s.x=function(e){return arguments.length?(t="function"==typeof e?e:kE(+e),r=null,s):t},s.x0=function(e){return arguments.length?(t="function"==typeof e?e:kE(+e),s):t},s.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:kE(+t),s):r},s.y=function(t){return arguments.length?(e="function"==typeof t?t:kE(+t),n=null,s):e},s.y0=function(t){return arguments.length?(e="function"==typeof t?t:kE(+t),s):e},s.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:kE(+t),s):n},s.lineX0=s.lineY0=function(){return l().x(t).y(e)},s.lineY1=function(){return l().x(t).y(n)},s.lineX1=function(){return l().x(r).y(e)},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:kE(!!t),s):i},s.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),s):a},s.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),s):o},s}function QE(t,e){return et?1:e>=t?0:NaN}function JE(t){return t}function tS(){var t=JE,e=QE,n=null,r=kE(0),i=kE(LE),o=kE(0);function a(a){var u,c,s,l,f,h=(a=qE(a)).length,p=0,d=new Array(h),y=new Array(h),v=+r.apply(this,arguments),m=Math.min(LE,Math.max(-LE,i.apply(this,arguments)-v)),g=Math.min(Math.abs(m)/h,o.apply(this,arguments)),b=g*(m<0?-1:1);for(u=0;u0&&(p+=f);for(null!=e?d.sort((function(t,n){return e(y[t],y[n])})):null!=n&&d.sort((function(t,e){return n(a[t],a[e])})),u=0,s=p?(m-h*b)/p:0;u0?f*s:0)+b,y[c]={data:a[c],index:u,value:f,startAngle:v,endAngle:l,padAngle:g};return y}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:kE(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:kE(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:kE(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:kE(+t),a):o},a}VE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var eS=rS(HE);function nS(t){this._curve=t}function rS(t){function e(e){return new nS(t(e))}return e._curve=t,e}function iS(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(rS(t)):e()._curve},t}function oS(){return iS(XE().curve(eS))}function aS(){var t=ZE().curve(eS),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return iS(n())},delete t.lineX0,t.lineEndAngle=function(){return iS(r())},delete t.lineX1,t.lineInnerRadius=function(){return iS(i())},delete t.lineY0,t.lineOuterRadius=function(){return iS(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(rS(t)):e()._curve},t}function uS(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}nS.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};class cS{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}class sS{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,e){if(t=+t,e=+e,0===this._point)this._point=1;else{const n=uS(this._x0,this._y0),r=uS(this._x0,this._y0=(this._y0+e)/2),i=uS(t,this._y0),o=uS(t,e);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...i,...o)}this._x0=t,this._y0=e}}function lS(t){return new cS(t,!0)}function fS(t){return new cS(t,!1)}function hS(t){return new sS(t)}function pS(t){return t.source}function dS(t){return t.target}function yS(t){let e=pS,n=dS,r=WE,i=GE,o=null,a=null,u=DE(c);function c(){let c;const s=YE.call(arguments),l=e.apply(this,s),f=n.apply(this,s);if(null==o&&(a=t(c=u())),a.lineStart(),s[0]=l,a.point(+r.apply(this,s),+i.apply(this,s)),s[0]=f,a.point(+r.apply(this,s),+i.apply(this,s)),a.lineEnd(),c)return a=null,c+""||null}return c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.x=function(t){return arguments.length?(r="function"==typeof t?t:kE(+t),c):r},c.y=function(t){return arguments.length?(i="function"==typeof t?t:kE(+t),c):i},c.context=function(e){return arguments.length?(null==e?o=a=null:a=t(o=e),c):o},c}function vS(){return yS(lS)}function mS(){return yS(fS)}function gS(){const t=yS(hS);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const bS=PE(3),_S={draw(t,e){const n=.59436*PE(e+AE(e/28,.75)),r=n/2,i=r*bS;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},wS={draw(t,e){const n=PE(e/jE);t.moveTo(n,0),t.arc(0,0,n,0,LE)}},xS={draw(t,e){const n=PE(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},kS=PE(1/3),ES=2*kS,SS={draw(t,e){const n=PE(e/ES),r=n*kS;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},OS={draw(t,e){const n=.62625*PE(e);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},TS={draw(t,e){const n=.87559*PE(e-AE(e/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},AS={draw(t,e){const n=PE(e),r=-n/2;t.rect(r,r,n,n)}},MS={draw(t,e){const n=.4431*PE(e);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},PS=ME(jE/10)/ME(7*jE/10),CS=ME(LE/10)*PS,jS=-OE(LE/10)*PS,NS={draw(t,e){const n=PE(.8908130915292852*e),r=CS*n,i=jS*n;t.moveTo(0,-n),t.lineTo(r,i);for(let e=1;e<5;++e){const o=LE*e/5,a=OE(o),u=ME(o);t.lineTo(u*n,-a*n),t.lineTo(a*r-u*i,u*r+a*i)}t.closePath()}},LS=PE(3),RS={draw(t,e){const n=-PE(e/(3*LS));t.moveTo(0,2*n),t.lineTo(-LS*n,-n),t.lineTo(LS*n,-n),t.closePath()}},DS=PE(3),IS={draw(t,e){const n=.6824*PE(e),r=n/2,i=n*DS/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},BS=-.5,FS=PE(3)/2,zS=1/PE(12),US=3*(zS/2+1),$S={draw(t,e){const n=PE(e/US),r=n/2,i=n*zS,o=r,a=n*zS+n,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(BS*r-FS*i,FS*r+BS*i),t.lineTo(BS*o-FS*a,FS*o+BS*a),t.lineTo(BS*u-FS*c,FS*u+BS*c),t.lineTo(BS*r+FS*i,BS*i-FS*r),t.lineTo(BS*o+FS*a,BS*a-FS*o),t.lineTo(BS*u+FS*c,BS*c-FS*u),t.closePath()}},KS={draw(t,e){const n=.6189*PE(e-AE(e/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},YS=[wS,xS,SS,AS,NS,RS,$S],qS=[wS,TS,KS,IS,_S,MS,OS];function VS(t,e){let n=null,r=DE(i);function i(){let i;if(n||(n=i=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return t="function"==typeof t?t:kE(t||wS),e="function"==typeof e?e:kE(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:kE(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:kE(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function HS(){}function WS(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function GS(t){this._context=t}function XS(t){return new GS(t)}function ZS(t){this._context=t}function QS(t){return new ZS(t)}function JS(t){this._context=t}function tO(t){return new JS(t)}function eO(t,e){this._basis=new GS(t),this._beta=e}GS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:WS(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:WS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ZS.prototype={areaStart:HS,areaEnd:HS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:WS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},JS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:WS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},eO.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,u=e[n]-o,c=-1;++c<=n;)r=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*e[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const nO=function t(e){function n(t){return 1===e?new GS(t):new eO(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function rO(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function iO(t,e){this._context=t,this._k=(1-e)/6}iO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:rO(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:rO(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const oO=function t(e){function n(t){return new iO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function aO(t,e){this._context=t,this._k=(1-e)/6}aO.prototype={areaStart:HS,areaEnd:HS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:rO(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const uO=function t(e){function n(t){return new aO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function cO(t,e){this._context=t,this._k=(1-e)/6}cO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:rO(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const sO=function t(e){function n(t){return new cO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function lO(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>CE){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>CE){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*s+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function fO(t,e){this._context=t,this._alpha=e}fO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:lO(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const hO=function t(e){function n(t){return e?new fO(t,e):new iO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function pO(t,e){this._context=t,this._alpha=e}pO.prototype={areaStart:HS,areaEnd:HS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:lO(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const dO=function t(e){function n(t){return e?new pO(t,e):new aO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function yO(t,e){this._context=t,this._alpha=e}yO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:lO(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const vO=function t(e){function n(t){return e?new yO(t,e):new cO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function mO(t){this._context=t}function gO(t){return new mO(t)}function bO(t){return t<0?-1:1}function _O(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(bO(o)+bO(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function wO(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function xO(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*e,o-u,a-u*n,o,a)}function kO(t){this._context=t}function EO(t){this._context=new SO(t)}function SO(t){this._context=t}function OO(t){return new kO(t)}function TO(t){return new EO(t)}function AO(t){this._context=t}function MO(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e1)for(var n,r,i,o=1,a=t[e[0]],u=a.length;o=0;)n[e]=e;return n}function IO(t,e){return t[e]}function BO(t){const e=[];return e.key=t,e}function FO(){var t=kE([]),e=DO,n=RO,r=IO;function i(i){var o,a,u=Array.from(t.apply(this,arguments),BO),c=u.length,s=-1;for(const t of i)for(o=0,++s;o0){for(var n,r,i,o=0,a=t[0].length;o0)for(var n,r,i,o,a,u,c=0,s=t[e[0]].length;c0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)}function $O(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],o=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,o=0,a=1;ao&&(o=e,r=n);return r}function VO(t){var e=t.map(HO);return DO(t).sort((function(t,n){return e[t]-e[n]}))}function HO(t){for(var e,n=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var ZO="%Y-%m-%dT%H:%M:%S.%LZ",QO=Date.prototype.toISOString?function(t){return t.toISOString()}:rw(ZO);const JO=QO;var tT=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:iw(ZO);const eT=tT;function nT(t,e,n){var r=new Oo,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?Eo():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}const rT=t=>()=>t;function iT(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function oT(t,e,n){this.k=t,this.x=e,this.y=n}oT.prototype={constructor:oT,scale:function(t){return 1===t?this:new oT(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new oT(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var aT=new oT(1,0,0);function uT(t){for(;!t.__zoom;)if(!(t=t.parentNode))return aT;return t.__zoom}function cT(t){t.stopImmediatePropagation()}function sT(t){t.preventDefault(),t.stopImmediatePropagation()}function lT(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function fT(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function hT(){return this.__zoom||aT}function pT(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function dT(){return navigator.maxTouchPoints||"ontouchstart"in this}function yT(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function vT(){var t,e,n,r=lT,i=fT,o=yT,a=pT,u=dT,c=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,f=eg,h=Fn("start","zoom","end"),p=500,d=150,y=0,v=10;function m(t){t.property("__zoom",hT).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",O).filter(u).on("touchstart.zoom",T).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(c[0],Math.min(c[1],e)))===t.k?t:new oT(e,t.x,t.y)}function b(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new oT(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=x(t,o).event(r),u=i.apply(t,o),c=null==n?_(u):"function"==typeof n?n.apply(t,o):n,s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,o):e,p=f(l.invert(c).concat(s/l.k),h.invert(c).concat(s/h.k));return function(t){if(1===t)t=h;else{var e=p(t),n=s/e[2];t=new oT(n,c[0]-e[0]*n,c[1]-e[1]*n)}a.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new k(t,e)}function k(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function E(t,...e){if(r.apply(this,arguments)){var n=x(this,e).event(t),i=this.__zoom,u=Math.max(c[0],Math.min(c[1],i.k*Math.pow(2,a.apply(this,arguments)))),l=fo(t);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=i.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(i.k===u)return;n.mouse=[l,i.invert(l)],qo(this),n.start()}sT(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(g(i,u),n.mouse[0],n.mouse[1]),n.extent,s))}}function S(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=x(this,e,!0).event(t),u=Jr(t.view).on("mousemove.zoom",(function(t){if(sT(t),!a.moved){var e=t.clientX-l,n=t.clientY-f;a.moved=e*e+n*n>y}a.event(t).zoom("mouse",o(b(a.that.__zoom,a.mouse[0]=fo(t,i),a.mouse[1]),a.extent,s))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),oi(t.view,a.moved),sT(t),a.event(t).end()}),!0),c=fo(t,i),l=t.clientX,f=t.clientY;ii(t.view),cT(t),a.mouse=[c,this.__zoom.invert(c)],qo(this),a.start()}}function O(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=fo(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),c=n.k*(t.shiftKey?.5:2),f=o(b(g(n,c),a,u),i.apply(this,e),s);sT(t),l>0?Jr(this).transition().duration(l).call(w,f,a,t):Jr(this).call(m.transform,f,a,t)}}function T(n,...i){if(r.apply(this,arguments)){var o,a,u,c,s=n.touches,l=s.length,f=x(this,i,n.changedTouches.length===l).event(n);for(cT(n),a=0;a g").attr("transform","".concat(i," ").concat(o))}},{key:"getSourcesId",value:function(t){return this.pluginData.scene.selection.includes(t.subject.datum().data.id)?this.pluginData.scene.selection:[t.subject.datum().data.id]}},{key:"getSourcePosition",value:function(t){var e=this.viewport.select(".".concat(t," .model"));return{x:parseFloat(e.attr("x")),y:parseFloat(e.attr("y"))}}},{key:"getTargetsByDepth",value:function(t){var e=this,n=t.subject.datum().data.id,r=t.sourceEvent,i=r.clientX,o=r.clientY,a=[];return this.viewport.selectAll("g.component.container:not(.".concat(n,")")).each((function(t){var n=e.viewport.select(".".concat(t.data.id," .background")).node().getBoundingClientRect(),r=n.x,u=n.y,c=n.width,s=n.height;if(i>=r&&i<=r+c&&o>=u&&o<=u+s){for(var l=parseInt(e.viewport.select(".".concat(t.data.id)).attr("depth"),10)-1;a.length<=l;)a.push([]);a[l].push(t.data.id)}})),a}},{key:"getTargetsId",value:function(t){return this.getTargetsByDepth(t).flat().reverse()}},{key:"getTargetId",value:function(t){return this.getTargetsId(t)[0]}},{key:"getTransform",value:function(t,e){var n=this.viewport.select(t).node().getBoundingClientRect(),r=n.x,i=n.y,o=this.viewport.select(e).node().getBoundingClientRect();return{dx:r-o.x,dy:i-o.y}}}],e&&gT(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const wT=_T;function xT(t){return xT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xT(t)}function kT(t,e){for(var n=0;nf?p:f),r.attr("height",d>h?d:h);var y=this.viewport.select(".".concat(e.data.id," .components-background")),v=y.node().getBoundingClientRect();return f=Math.max((a-v.x)/n,e.data.definition.minWidth-e.data.definition.reservedWidth),h=Math.max((u-v.y)/n,e.data.definition.minHeight-e.data.definition.reservedHeight),p=(s-v.x)/n,d=(l-v.y)/n,y.attr("width",p>f?p:f),y.attr("height",d>h?d:h),!1}},{key:"finalize",value:function(t){var e=t.subject.datum().data.id,n=this.viewport.select(".".concat(e," .model")),r=this.pluginData.getComponentById(e);return r.drawOption.width=parseFloat(n.attr("width")),r.drawOption.height=parseFloat(n.attr("height")),this.pluginData.emitEvent({components:[e],type:"Drawer",action:"resize",status:"success"}),!0}},{key:"getMaxPosition",value:function(t){var e=this,n=this.pluginData.getComponentById(t),r=0,i=0;return this.pluginData.getChildren(t).forEach((function(t){var o=e.viewport.select(".".concat(t.id," .model")).node().getBoundingClientRect(),a=o.x,u=o.y,c=o.width,s=o.height;r=Math.max(r,a+c+n.definition.margin),i=Math.max(i,u+s+n.definition.margin)})),{x:r,y:i}}}],r&&dA(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(wT);const wA=_A;function xA(t){return xA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xA(t)}function kA(t){return function(t){if(Array.isArray(t))return EA(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return EA(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?EA(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n0,hasWarning:r>0,numberOfErrors:n,numberOfWarnings:r,hasX:!!t.drawOption.x,hasY:!!t.drawOption.y,isSelected:this.pluginData.scene.selection.includes(t.id),getIcon:function(t){return e.pluginData.resources.icons[t]},canHaveLink:this.pluginData.canHaveLink(t.definition.type),getAttribute:function(e){return t.attributes.find((function(t){return t.name===e}))}})}}],e&&pM(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const vM=yM;function mM(t){return mM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mM(t)}function gM(t,e){for(var n=0;n0&&this.pluginData.emitEvent({components:o,type:"Drawer",action:"move",status:"success"}),a.length>0&&this.pluginData.emitEvent({components:a,type:"Drawer",action:"resize",status:"success"}),!0}},{key:"getNodes",value:function(){var t=this,e={id:"root",parent:null,children:[],depth:0,type:"default",isContainer:!0,margin:this.pluginData.configuration.rootContainer.margin,gap:this.pluginData.configuration.rootContainer.gap},n=new Map(this.pluginData.components.map((function(e){return[e.id,t.createNode(e)]})));return n.set("root",e),n.forEach((function(t){if(t.parent){var e=n.get(t.parent);t.parent=e,e.children.push(t)}})),n}},{key:"createNode",value:function(t){return{id:t.id,parent:t.getContainerId()||"root",type:t.definition.displayType||"default",direction:t.definition.workflowDirection,children:[],depth:this.pluginData.getComponentDepth(t.id)+1,isContainer:t.definition.isContainer,width:t.definition.defaultWidth,height:t.definition.defaultHeight,minWidth:t.definition.minWidth,minHeight:t.definition.minHeight,reservedWidth:t.definition.reservedWidth,reservedHeight:t.definition.reservedHeight,margin:t.definition.margin,gap:t.definition.gap,x:t.drawOption.x,y:t.drawOption.y}}},{key:"generateLayout",value:function(t,e,n){var r=this;e.children.forEach((function(e){r.generateLayout(t,e,n)})),e.isContainer&&"default"===e.type?this.generateDefaultLayout(e,n):e.isContainer&&this.generateWorkflowLayout(t,e)}},{key:"generateDefaultLayout",value:function(t,e){this.text=0;var n=[],r=[],i=t.margin,o=t.gap,a=t.minWidth,u=t.minHeight,c=t.reservedWidth,s=t.reservedHeight,l=0,f=0;t.children.forEach((function(t){t.x&&t.y&&e?(n.push(t),l=Math.max(t.x+t.width,l),f=Math.max(t.y+t.height,f)):r.push(t)}));for(var h,p=0,d=0,y=this.getPoints(p,i,o);r.length>0;)h||(h=r[0]),0===y.length&&(d=0,p+=1,y=this.getPoints(p,i,o)),y.length>0&&this.canBePlaced(n,h,y[d])&&(h.x=y[d].x,h.y=y[d].y,l=Math.max(h.x+h.width,l),f=Math.max(h.y+h.height,f),n.push(h),r.shift(),h=null),(d+=1)>=y.length&&(d=0,p+=1,y=this.getPoints(p,i,o));t.width=Math.max(l+i+c,a),t.height=Math.max(f+i+s,u)}},{key:"canBePlaced",value:function(t,e,n){return t.every((function(t){var r=t.x,i=t.y,o=t.width,a=t.height,u=n.x+e.widthr+o,s=n.y+e.heighti+a;return u||c||s||l}))}},{key:"getPoints",value:function(t,e,n){if(0===t)return[{x:e,y:e}];for(var r=e+n*t,i=e+n*t,o=[],a=e,u=e;u<=r&&(u!==r||i!==a);)o.push({x:u,y:i}),u+=n,o.push({x:r,y:a}),a+=n;return o.push({x:r,y:i}),o}},{key:"generateWorkflowLayout",value:function(t,e){"vertical"===e.direction?this.generateVerticalWorkflowLayout(t,e):this.generateHorizontalWorkflowLayout(t,e)}},{key:"generateHorizontalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,u=e.reservedHeight,c=n,s=0;e.children.forEach((function(t){t.x=c,t.y=n,c=t.x+t.width+r,t.height>s&&(s=t.height)})),e.width=Math.max(c-r+n+a,i),e.height=Math.max(s+2*n+u,o)}},{key:"generateVerticalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,u=e.reservedHeight,c=n,s=0;e.children.forEach((function(t){t.x=n,t.y=c,c=t.y+t.height+r,t.width>s&&(s=t.width)})),e.width=Math.max(s+2*n+a,i),e.height=Math.max(c-r+n+u,o)}},{key:"resize",value:function(t){var e=this.pluginData.getComponentById(t);if(!e.definition.isContainer)return!1;var n=0,r=0;this.pluginData.getChildren(t).forEach((function(t){var e=t.drawOption.x+t.drawOption.width,i=t.drawOption.y+t.drawOption.height;e>n&&(n=e),i>r&&(r=i)}));var i=e.definition,o=i.minWidth,a=i.minHeight,u=i.reservedWidth,c=i.reservedHeight,s=i.margin,l=Math.max(n+2*s+u,o),f=Math.max(r+2*s+c,a);return l===e.drawOption.width&&f===e.drawOption.height||(e.drawOption.width=l,e.drawOption.height=f,this.pluginData.emitEvent({components:[t],type:"Drawer",action:"resize",status:"success"})),!0}}],r&&TM(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(SM);const LM=NM;function RM(t){return RM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},RM(t)}function DM(t){return function(t){if(Array.isArray(t))return IM(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return IM(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IM(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IM(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;M(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function $M(t,e,n,r,i,o,a){try{var u=t[o](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,i)}function KM(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];this.d3.select("#".concat(t)).selectAll(null).remove(),this.d3.select("#".concat(t)).html(""),this.viewport=this.d3.select("#".concat(t)),this.componentRenderer=this.initComponentRenderer(e),this.linkRenderer=this.initLinkRenderer(e),this.layout=new LM(this.pluginData,this.viewport),this.readOnly=e,this.clearActions(),this.readOnly&&(this.pluginData.scene.x=0,this.pluginData.scene.y=0,this.pluginData.scene.zoom=1),this.initActions(),this.initScene()}},{key:"initComponentRenderer",value:function(t){return new vM(this.pluginData,this.viewport,t)}},{key:"initLinkRenderer",value:function(t){return new wM(this.pluginData,this.viewport,t)}},{key:"clearActions",value:function(){this.actions.deleteAction=null,this.actions.dragComponent=null,this.actions.dragScene=null,this.actions.menuAction=null,this.actions.resizeComponent=null,this.actions.toggleSelection=null,this.actions.selectionAll=null,this.actions.deselectionAll=null,this.actions.zoom=null,this.viewport.on("wheel",null),this.d3.select("body").on("keydown",null).on("keyup",null),this.viewport.on(".drag",null)}},{key:"initActions",value:function(){var t=this;this.actions.selectionAll=new QA(this.pluginData,this.viewport,this.layout),this.actions.deleteAction=new PT(this.pluginData,this.viewport,this.layout),this.actions.dragScene=new WT(this.pluginData,this.viewport,this.layout),this.actions.menuAction=new hA(this.pluginData,this.viewport,this.layout),this.actions.link=new rA(this.pluginData,this.viewport,this.layout),this.actions.zoom=new uM(this.pluginData,this.viewport,this.layout),this.actions.dragComponent=new FT(this.pluginData,this.viewport,this.layout),this.actions.resizeComponent=new wA(this.pluginData,this.viewport,this.layout),this.actions.toggleSelection=new jA(this.pluginData,this.viewport,this.layout),this.actions.deselectionAll=new UA(this.pluginData,this.viewport,this.layout),this.viewport.on("wheel",(function(e){t.actions.zoom.execute(e)&&t.draw()})),this.readOnly||this.d3.select("body").on("keydown",(function(e){var n=!1;t.pluginData.configuration.keysBinding.selection.includes(e.key)&&(t.states.selection=!0),t.pluginData.configuration.keysBinding.deleteObject.includes(e.key)&&(n=t.actions.deleteAction.execute(e)),t.pluginData.configuration.keysBinding.selectAll.includes(e.key)&&(n=t.actions.selectionAll.execute(e)),t.pluginData.configuration.keysBinding.deselectAll.includes(e.key)&&(n=t.actions.deselectionAll.execute(e)),n&&t.draw()})).on("keyup",(function(e){var n=!1;t.pluginData.configuration.keysBinding.selection.includes(e.key)&&(t.states.selection=!1),t.pluginData.configuration.keysBinding.deleteObject.includes(e.key)&&(n=t.actions.deleteAction.finalize(e)),t.pluginData.configuration.keysBinding.selectAll.includes(e.key)&&(n=t.actions.selectionAll.finalize(e)),t.pluginData.configuration.keysBinding.deselectAll.includes(e.key)&&(n=t.actions.deselectionAll.finalize(e)),n&&t.draw()}));var e=this.d3.drag().subject((function(e){var n=e.sourceEvent.target.closest(".component");if(t.states.resizing=!!e.sourceEvent.target.closest(".resize-button"),t.states.menuOpening=!!e.sourceEvent.target.closest(".menu-button"),!n)return t.scene;var r=t.viewport.select(Array.from(n.classList).map((function(t){return".".concat(t)})).join(""));return t.states.linking=!!e.sourceEvent.target.closest(".anchor")&&t.pluginData.canHaveLink(r.datum().data.definition.type),r})).on("drag",(function(e){t.states.moving=!0;var n="scene"===e.subject.datum().data.id,r=!1;t.readOnly?t.actions.dragScene.execute(e):(n?r=t.actions.dragScene.execute(e):t.states.linking?(r=t.actions.link.execute(e),t.linkRenderer.render()):t.states.resizing?(r=t.actions.resizeComponent.execute(e),t.linkRenderer.render()):(r=t.actions.dragComponent.execute(e),t.linkRenderer.render()),r&&t.draw())})).on("end",function(){var e,n=(e=UM().mark((function e(n){var r,i,o,a,u,c,s;return UM().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.states.moving,i=t.states.selection,o=t.states.menuOpening,a=t.states.resizing,u=t.states.linking,c="scene"===n.subject.datum().data.id,s=!1,!t.readOnly){e.next=10;break}return c&&r&&t.actions.dragScene.finalize(n),e.abrupt("return");case 10:u?s=t.actions.link.finalize(n):r&&c?s=t.actions.dragScene.finalize(n):a?s=t.actions.resizeComponent.finalize(n):r&&!c?s=t.actions.dragComponent.finalize(n):!r&&o?s=t.actions.menuAction.finalize(n):r||c||!i||(s=t.actions.toggleSelection.finalize(n)),s&&t.draw(),t.states.moving=!1;case 13:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){$M(o,r,i,a,u,"next",t)}function u(t){$M(o,r,i,a,u,"throw",t)}a(void 0)}))});return function(t){return n.apply(this,arguments)}}());this.viewport.call(e)}},{key:"getScene",value:function(){return this.viewport.selectAll(".scene").data(this.getSceneData()).join("svg").attr("class","scene").attr("width","100%").attr("height","100%")}},{key:"initScene",value:function(){var t=this;this.viewport.append("style").text(this.pluginData.resources.style),this.scene=this.getScene(),this.scene.attr("version","1.1"),this.scene.attr("xmlns","http://www.w3.org/2000/svg"),this.scene.append("defs").html(Object.keys(this.pluginData.resources.markers).map((function(e){return t.pluginData.resources.markers[e]})).join(""));var e=this.pluginData.scene,n=e.x,r=e.y,i=e.zoom,o="translate(".concat(n," ").concat(r,") scale(").concat(i,")");this.scene.append("g").attr("class","components").attr("transform",o),this.scene.append("g").attr("class","links").attr("transform",o)}},{key:"draw",value:function(){if(this.scene=this.getScene(),this.componentRenderer.render("scene"),this.linkRenderer.render("scene"),this.readOnly){for(var t=this.viewport.node().getBoundingClientRect(),e=t.width,n=t.height,r=this.viewport.select(".scene .components").node().getBBox(),i=r.width,o=r.height,a=r.x,u=r.y,c=e/ic;)s*=.9;this.scene.attr("viewBox","".concat(a-15," ").concat(u-15," ").concat(i+a+15," ").concat(o+u+15)),this.pluginData.scene.zoom=s}}},{key:"arrangeComponentsPosition",value:function(t,e){this.layout.generateComponentsLayout(t,e)}},{key:"resize",value:function(t){this.layout.resize(t)}},{key:"getSceneData",value:function(){var t=this;return[this.d3.hierarchy(FM({id:"scene",name:"",children:DM(this.pluginData.components.filter((function(t){return null===t.getContainerId()})))},this.pluginData.scene),(function(e){return"scene"===e.id?e.children:t.pluginData.getChildren(e.id)}))]}},{key:"dropComponent",value:function(t,e){var n=e.target.closest(".component");if(t.drawOption.width=t.definition.width,t.drawOption.height=t.definition.height,!n){var r=this.viewport.select(".scene").node().getBoundingClientRect(),i=r.x,o=r.y;return t.drawOption.x=(e.clientX-i-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,void(t.drawOption.y=(e.clientY-o-this.pluginData.scene.y)/this.pluginData.scene.zoom-t.definition.defaultHeight/2)}if(n.canContain(t.definition.type)){var a=this.viewport.select(".".concat(t.id,".container")).node().getBoundingClientRect(),u=a.x,c=a.y;t.drawOption.x=(e.clientX-u-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,t.drawOption.y=(e.clientY-c-this.pluginData.scene.y)/this.pluginData.scene.zoom-t.definition.defaultHeight/2}}},{key:"exportSvg",value:function(t){return this.viewport.selectAll(".scene > g").attr("transform",""),document.querySelector("#".concat(t," .scene")).outerHTML}}],n&&KM(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();const VM=qM;function HM(t){return HM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HM(t)}function WM(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return t.path}))}},{key:"parseConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[e.path],data:{global:!1}});if(null!=e.content){var o=JSON.parse(e.content);o[t.path]?o[t.path][this.pluginData.name]?(Object.keys(o[t.path][this.pluginData.name]).forEach((function(e){var r=n.pluginData.getComponentByConfigurationKey(e);r&&o[t.path][n.pluginData.name][e]&&(r.drawOption=new S(o[t.path][n.pluginData.name][e]))})),this.pluginData.emitEvent({id:i,status:"success"})):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_plugin_content",global:!1}}):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_diagram_content",global:!1}})}else this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_content",global:!1}})}},{key:"isParsable",value:function(t){return null!=t}}],e&&JM(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const nP=eP;function rP(t){return rP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rP(t)}function iP(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e){return t[e.path]="",t}),{});return this.renderFiles(t).forEach((function(t){e[t.path]=t.content})),Object.keys(e).map((function(t){return new dt({path:t,content:e[t]})}))}},{key:"renderFiles",value:function(){return[]}},{key:"renderConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[e.path],data:{global:!1}}),o=JSON.parse(e.content)||{};o[t.path]||(o[t.path]={}),o[t.path][this.pluginData.name]={},this.pluginData.components.filter((function(t){return t.drawOption})).forEach((function(e){var r=e.getConfigurationKey();o[t.path][n.pluginData.name][r]=e.drawOption})),e.content=JSON.stringify(o,(function(t,e){return null===e?void 0:e}),2),this.pluginData.emitEvent({id:i,status:"success"})}}],e&&iP(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const uP=aP;function cP(t){return cP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cP(t)}function sP(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,parentId:null,files:null,components:null,links:null,type:null,action:null,status:null,data:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.id,r=e.parentId,i=e.files,o=e.components,a=e.links,u=e.type,c=e.action,s=e.status,l=e.data;this.id=n||null,this.parentId=r||null,this.startDate=null,this.endDate=null,this.files=i||null,this.components=o||null,this.links=a||null,this.type=u||null,this.action=c||null,this.status=s||null,this.data=l||null}));const pP=hP;function dP(t){return dP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dP(t)}function yP(t,e,n){return e=mP(e),function(t,e){if(e&&("object"==dP(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,vP()?Reflect.construct(e,n||[],mP(t).constructor):e.apply(t,n))}function vP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(vP=function(){return!!t})()}function mP(t){return mP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mP(t)}function gP(t,e){return gP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gP(t,e)}var bP=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{anchorName:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=yP(this,e,[n])).anchorName=n.anchorName||null,t.endX=null,t.endY=null,t.isTemporary=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gP(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(et);const _P=bP;function wP(t){return wP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wP(t)}function xP(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:{name:null,version:null,components:[],variables:[],definitions:{components:[],links:[]},parseLogs:[],resources:{},scene:{x:0,y:0,zoom:1,selection:[],selectionRef:null}},y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=d.name||null,this.version=d.version||null,this.components=d.components||[],this.scene={x:(null===(n=d.scene)||void 0===n?void 0:n.x)||0,y:(null===(r=d.scene)||void 0===r?void 0:r.y)||0,zoom:(null===(i=d.scene)||void 0===i?void 0:i.zoom)||1,selection:(null===(o=d.scene)||void 0===o?void 0:o.selection)||[],selectionRef:(null===(a=d.scene)||void 0===a?void 0:a.selectionRef)||null},this.variables=d.variables||[],this.definitions={components:(null===(u=d.definitions)||void 0===u?void 0:u.components)||[],links:(null===(c=d.definitions)||void 0===c?void 0:c.links)||[]},this.parseLogs=d.parseLogs||[],this.__eventIndex=0,this.eventManager=y,this.eventLogs=[],this.configuration=e,this.resources={icons:EP({},null===(s=d.resources)||void 0===s?void 0:s.icons),markers:EP({},null===(l=d.resources)||void 0===l?void 0:l.markers),links:EP({},null===(f=d.resources)||void 0===f?void 0:f.links),models:EP({},null===(h=d.resources)||void 0===h?void 0:h.models),style:(null===(p=d.resources)||void 0===p?void 0:p.style)||""},this.temporaryLink=null},e=[{key:"coreVersion",get:function(){return"0.27.2"}},{key:"getComponentById",value:function(t){return this.components.find((function(e){return e.id===t}))||null}},{key:"getComponentDepth",value:function(t){var e=this.getComponentById(t).getContainerId();return e?this.getComponentDepth(e)+1:0}},{key:"getComponentByConfigurationKey",value:function(t){return this.getComponentById(t)}},{key:"renameComponentExternalId",value:function(t,e){this.getComponentById(t).setExternalId(e)}},{key:"getComponentsByType",value:function(t){return this.components.filter((function(e){var n=e.definition;return n&&n.type===t}))}},{key:"addComponent",value:function(t,e){var n=this.generateComponentId();return this.components.push(new L({id:n,name:n,definition:t,path:e})),n}},{key:"generateComponentId",value:function(){var t=this.components.map((function(t){return t.id})).filter((function(t){return new RegExp("".concat("id_","\\d+")).test(t)})).map((function(t){return parseInt(t.substring(3),10)})),e=0===t.length?1:Math.max.apply(Math,function(t){return function(t){if(Array.isArray(t))return xP(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return xP(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xP(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t))+1;return"".concat("id_").concat(e)}},{key:"removeComponentById",value:function(t){var e=this;this.getChildren(t).forEach((function(t){return e.removeComponentById(t.id)})),this.components=this.components.filter((function(e){return e.id!==t})),this.components.forEach((function(e){e.removeLinkAttribute(t)}))}},{key:"removeLink",value:function(t){var e=t.source,n=t.target,r=t.definition.attributeRef;this.getComponentById(e).removeLinkAttribute(n,r)}},{key:"getLinks",value:function(){var t=this,e=[];return this.definitions.links.forEach((function(n){t.getComponentsByType(n.sourceRef).forEach((function(r){var i=r.getAttributeByName(n.attributeRef);i&&t.getLinkedComponentsIds(i).forEach((function(t){return e.push(new et({definition:n,source:r.id,target:t,isReverse:"Reverse"===i.definition.linkType}))}))}))})),this.temporaryLink&&e.push(this.temporaryLink),e.concat(this.getWorkflowLinks())}},{key:"getAttributeValue",value:function(t){return t.isVariable?this.getVariableValue(t.value):t.value}},{key:"getLinkedComponentsIds",value:function(t){var e=this.getAttributeValue(t);return null===e?[]:Array.isArray(e)?e:[e]}},{key:"getVariableValue",value:function(t){var e;return(null===(e=this.variables.find((function(e){return e.name===t})))||void 0===e?void 0:e.value)||null}},{key:"setVariableValue",value:function(t,e){var n=this.variables.find((function(e){return e.name===t}));n&&(n.value=e)}},{key:"getComponentIdFromValue",value:function(t){return t}},{key:"canHaveLink",value:function(t){return this.definitions.links.some((function(e){return e.sourceRef===t}))}},{key:"canBeLinked",value:function(t,e){return this.definitions.links.some((function(n){var r=n.sourceRef,i=n.targetRef;return r===t&&i===e}))}},{key:"createTemporaryLink",value:function(t,e){this.temporaryLink=new _P({anchorName:e,source:t,definition:this.definitions.links.find((function(t){return t.isTemporary}))})}},{key:"getWorkflowLinks",value:function(){var t=this;return this.components.filter((function(t){var e;return null===(e=t.definition.displayType)||void 0===e?void 0:e.match("workflow")})).reduce((function(e,n){var r=t.getChildren(n.id);if(r.length>1)for(var i=0;in,this.components.splice(i,0,r),this.components.splice(n+(it}))}},{key:"emitEvent",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.id;return r?(e=this.getEventLogById(r),Object.keys(n).forEach((function(t){e[t]=n[t]}))):(this.__eventIndex+=1,r=this.__eventIndex,(e=new pP(EP(EP({},n),{},{id:r}))).startDate=Date.now(),this.eventLogs.push(e)),["success","warning","error"].includes(e.status)&&(e.endDate=Date.now()),null!==(t=this.eventManager)&&void 0!==t&&t.next&&this.eventManager.next({plugin:this.name,event:EP({},e)}),r}}],e&&OP(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const MP=AP;function PP(t){return PP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},PP(t)}function CP(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function jP(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{editor:{syntax:null},restrictiveFolder:null,defaultFileName:null,defaultFileExtension:null,tags:[],isFolderTypeDiagram:!0,extraResources:[],rootContainer:{margin:30,gap:50},container:{margin:30,gap:50},keysBinding:{},i18n:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editor=jP({syntax:null},a.editor),this.restrictiveFolder=a.restrictiveFolder||null,this.defaultFileName=a.defaultFileName||null,this.defaultFileExtension=a.defaultFileExtension||null,this.tags=a.tags||[],this.isFolderTypeDiagram=null===(e=a.isFolderTypeDiagram)||void 0===e||e,this.extraResources=a.extraResources||[],this.rootContainer={margin:(null===(n=a.rootContainer)||void 0===n?void 0:n.margin)||30,gap:(null===(r=a.rootContainer)||void 0===r?void 0:r.gap)||50},this.container={margin:(null===(i=a.container)||void 0===i?void 0:i.margin)||30,gap:(null===(o=a.container)||void 0===o?void 0:o.gap)||50},this.keysBinding=jP({moveSceneUp:["ArrowUp"],moveSceneDown:["ArrowDown"],moveSceneLeft:["ArrowLeft"],moveSceneRight:["ArrowRight"],moveComponentUp:[],moveComponentDown:[],moveComponentLeft:[],moveComponentRight:[],zoomIn:["+"],zoomOut:["-"],deleteObject:["Delete"],editComponent:[",","?"],selection:["Shift"],selectAll:["A"],deselectAll:["D"]},a.keysBinding),this.i18n=a.i18n||{}}));const BP=IP;function FP(t){return FP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},FP(t)}function zP(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{event:null,configuration:null,pluginData:null,pluginDrawer:null,pluginMetadata:null,pluginParser:null,pluginRenderer:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.configuration=e.configuration||new BP,this.data=e.pluginData||new MP(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new VM(this.data),this.__metadata=e.pluginMetadata||new ZM(this.data),this.__parser=e.pluginParser||new nP(this.data),this.__renderer=e.pluginRenderer||new uP(this.data)},e=[{key:"init",value:function(){var t=this.data.emitEvent({type:"Plugin",action:"init",status:"running"});this.__metadata.parse(t),this.data.initLinkDefinitions(t),this.data.emitEvent({id:t,status:"success"})}},{key:"initResources",value:function(t){this.data.resources=t}},{key:"initDrawer",value:function(t,e){this.__drawer.init(t,e)}},{key:"draw",value:function(){this.__drawer.draw()}},{key:"parse",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Parser",action:"read",status:"running",files:n.map((function(t){return t.path})).concat(null==e?void 0:e.path),data:{global:!0}});this.__parser.parse(t,n,r),this.__parser.parseConfiguration(t,e,r),this.data.emitEvent({id:r,status:"success"})}},{key:"isParsable",value:function(t){return this.__parser.isParsable(t)}},{key:"getModels",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.__parser.getModels(e.filter((function(e){return t.isParsable(e)})))}},{key:"render",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Render",action:"write",status:"running",files:n.map((function(t){return t.path})).concat(e.path),data:{global:!0}});this.__renderer.renderConfiguration(t,e,r);var i=this.__renderer.render(n,r).concat(e);return this.data.emitEvent({id:r,status:"success"}),i}},{key:"arrangeComponentsPosition",value:function(t,e){this.__drawer.arrangeComponentsPosition(t,e)}},{key:"resize",value:function(t){this.__drawer.resize(t)}},{key:"exportSvg",value:function(t){this.__drawer.init(t,!0),this.draw();var e=this.__drawer.exportSvg(t);return this.__drawer.init(t,!1),this.draw(),e}},{key:"getComponentPosition",value:function(t,e){var n=e.x,r=e.y,i=this.__drawer.actions.zoom,o=i.scale,a=i.translate,u=document.querySelector("#".concat(t)).getBoundingClientRect(),c=u.left,s=u.top;return{x:(n-c-a.x)/o,y:(r-s-a.y)/o}}},{key:"addComponent",value:function(t,e,n,r){var i=this.data.addComponent(e,n),o=this.data.getComponentById(i);if(t){var a=this.data.getComponentById(t);o.setReferenceAttribute(a)}return r&&this.__drawer.dropComponent(o,r),i}}],e&&zP(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const KP=$P;function YP(t){return YP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},YP(t)}function qP(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,value:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.value;this.type=n||null,this.value=r||null}));const GP=WP;function XP(t){return XP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},XP(t)}function ZP(t,e,n){return e=JP(e),function(t,e){if(e&&("object"==XP(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,QP()?Reflect.construct(e,n||[],JP(t).constructor):e.apply(t,n))}function QP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(QP=function(){return!!t})()}function JP(t){return JP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},JP(t)}function tC(t,e){return tC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tC(t,e)}var eC=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,value:null,category:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=ZP(this,e,[n]);var r=n.name,i=n.type,o=n.value,a=n.category;return t.__class="Variable",t.name=r||null,t.type=i||null,t.value=o||null,t.category=a||null,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tC(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(b);const nC=eC})();var i=exports;for(var o in r)i[o]=r[o];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var t={326:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){"use strict";var r=Array.prototype,i=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},a=/[&"'<>\\]/g;function u(t,e){return i.hasOwnProperty.call(t,e)}function c(t){return o[t]}function s(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,s.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var a=Object.getOwnPropertyDescriptor(i,"stack");(o=a&&(a.get||function(){return a.value}))||(o=function(){return i.stack})}else{var u=new Error(t).stack;o=function(){return u}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function l(t){return"[object Function]"===i.toString.call(t)}function f(t){return"[object Array]"===i.toString.call(t)}function h(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)a=i.slice(0,t.length),i.slice(a.length,s).forEach((function(t,n){n2?i-2:0),a=2;a0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:c,Root:f,NodeList:l,Value:s,Literal:h,Symbol:p,Group:d,Array:y,Pair:v,Dict:m,Output:z,Capture:U,TemplateData:$,If:b,IfAsync:_,InlineIf:w,For:x,AsyncEach:k,AsyncAll:E,Macro:S,Caller:O,Import:T,FromImport:A,FunCall:M,Filter:P,FilterAsync:C,KeywordArgs:j,Block:N,Super:L,Extends:R,Include:D,Set:I,Switch:B,Case:F,LookupVal:g,BinOp:Y,In:q,Is:V,Or:H,And:W,Not:G,Add:X,Concat:Z,Sub:Q,Mul:J,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:at,CompareOperand:ut,CallExtension:ct,CallExtensionAsync:st,printNodes:function t(e,n){if(n=n||0,lt(e.typename+": ",n),e instanceof l)lt("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ct)lt(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof c?r.push([e,t]):(i=i||{})[e]=t})),i?lt(JSON.stringify(i,null,2)+"\n",null,!0):lt("\n"),r.forEach((function(e){var r=e[0],i=e[1];lt("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),a=n(3),u=n(0).TemplateError,c=n(2).Frame,s=n(1).Obj,l={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},f=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new u(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,a.Literal,a.Symbol,a.Group,a.Array,a.Dict,a.FunCall,a.Caller,a.Filter,a.LookupVal,a.Compare,a.InlineIf,a.In,a.Is,a.And,a.Or,a.Not,a.Add,a.Concat,a.Sub,a.Mul,a.Div,a.FloorDiv,a.Mod,a.Pow,a.Neg,a.Pos,a.Compare,a.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var c=this._tmpid();this._emitLine(", "+this._makeCallback(c)),this._emitLine(this.buffer+" += runtime.suppressValue("+c+", "+u+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+u+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof a.Symbol?n=new a.Literal(n.lineno,n.colno,n.value):n instanceof a.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+l[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,a.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,a.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof a.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,a){var u=n._tmpid();n._emitLine("var "+u+" = "+o+"["+r+"]["+a+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+a+"]);"),e.set(t.name.children[a].value,u)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var u=t.name.children,c=u[0],s=u[1],l=this._tmpid(),f=this._tmpid();e.set(c.value,l),e.set(s.value,f),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+l+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+f+" = "+o+"["+l+"];"),this._emitLine('frame.set("'+c.value+'", '+l+");"),this._emitLine('frame.set("'+s.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var h=this._tmpid();e.set(t.name.value,h),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+h+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),u=this._tmpid(),c=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+u+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof a.Array){var s=t.name.children.length;this._emit("runtime."+c+"("+u+", "+s+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var l=t.name.value;this._emitLine("runtime."+c+"("+u+", 1, function("+l+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+l+'", '+l+");"),e.set(l,l)}this._emitLoopBindings(t,u,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var f=this._tmpid();this._emitLine("}, "+this._makeCallback(f)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+f+";"),t.else_&&(this._emitLine("if (!"+u+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),u=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof a.Dict?i=e:(n.assertType(e,a.Symbol),r.push(e))}));var s,l=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),f=r.map((function(t){return'"'+t.value+'"'})),h=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));s=u?e.push(!0):new c,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+l.join(", ")+") {","var callerFrame = frame;","frame = "+(u?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),s.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,s),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,s)})),this._emitLine("frame = "+(u?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),a=this._makeCallback(i),u=n?"true":"false",c=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+u+", "+o+", "+c+", "+a),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,u=n._tmpid();t instanceof a.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+u+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,u),e.parent?n._emitLine('frame.set("'+o+'", '+u+");"):n._emitLine('context.setVariable("'+o+'", '+u+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof a.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new c,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(a.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new c;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(s);t.exports={compile:function(t,e,n,r,a){void 0===a&&(a={});var u=new f(r,a.throwOnUndefined),c=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return u.compile(o.transform(i.parse(c,n,a),e,r)),u.getCode()},Compiler:f}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var a=o.prototype;return a.resolve=function(t,e){return i.resolve(i.dirname(t),e)},a.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),a=n(15),u=n(0),c=n(5),s=n(18),l=n(10),f=l.FileSystemLoader,h=l.WebLoader,p=l.PrecompiledLoader,d=n(20),y=n(21),v=n(1),m=v.Obj,g=v.EmitterObj,b=n(2),_=b.handleError,w=b.Frame,x=n(22);function k(t,e,n){o((function(){t(e,n)}))}var E={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(_(t,null,null))}}}},S=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=u.isArray(t)?t:[t]:f?this.loaders=[new f("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=y(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],u._entries(s).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),u._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=u.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,a=this,c=this,s=null;if(t&&t.raw&&(t=t.raw),u.isFunction(n)&&(i=n,n=null,e=e||!1),u.isFunction(e)&&(i=e,e=!1),t instanceof T)s=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var l=0;l0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var u=this.parsePrimary();if("_"===u.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",u.lineno,u.colno),this.skipSymbol("as")){var c=this.parsePrimary();r.addChild(new o.Pair(u.lineno,u.colno,u,c))}else r.addChild(u);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},c.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},c.parseExtends=function(){var t="extends",e=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var n=new o.Extends(e.lineno,e.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n},c.parseInclude=function(){var t="include",e=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var n=new o.Include(e.lineno,e.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),n},c.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},c.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},c.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var a=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var u,c=this.peekToken(),s=[];do{this.skipSymbol(n);var l=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);s.push(new o.Case(c.line,c.col,l,f)),c=this.peekToken()}while(c&&c.value===n);switch(c.value){case r:this.advanceAfterBlockEnd(),u=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,a,s,u)},c.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==u.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var c=a[0],s=a[1],l=a[2];l===t?r+=1:l===e&&(r-=1),0===r?(i+=s,this.tokens.backN(c.length-s.length)):i+=c}return new o.Output(u.lineno,u.colno,[new o.TemplateData(u.lineno,u.colno,i)])},c.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},c.parseExpression=function(){return this.parseInlineIf()},c.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},c.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},c.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},c.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},c.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},c.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},c.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},c.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},c.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},c.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},c.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},c.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},c.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},c.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},c.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},c.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},c.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},c.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},c.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},c.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var a=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,a))}else{var u=this.parseExpression();t.addChild(u)}}return t},c.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),a=new o.KeywordArgs(n.lineno,n.colno),u=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(u&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var c=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?a.addChild(new o.Pair(c.lineno,c.colno,c,this.parseExpression())):r.addChild(c)}u=!0}return a.children.length&&r.addChild(a),r},c.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],I=C+this.current();switch(-1!==r.indexOf(D,I)&&(this.forward(),C=I,-1!==r.indexOf(D,I+this.current())&&(C=I+this.current(),this.forward())),C){case"(":R=d;break;case")":R=y;break;case"[":R=v;break;case"]":R=m;break;case"{":R=g;break;case"}":R=b;break;case",":R=w;break;case":":R=x;break;case"~":R=k;break;case"|":R=E;break;default:R=_}return P(R,C,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return P(S,t+"."+B,e,n)}return P("int",t,e,n)}if(t.match(/^(true|false)$/))return P(O,t,e,n);if("none"===t)return P(T,t,e,n);if("null"===t)return P(T,t,e,n);if(t)return P(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,z=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,P(s,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,P(f,t,e,n);t="";var U=!1;for(this._matches(this.tags.COMMENT_START)&&(U=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil(z));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!U){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var $=t.slice(-this.colno);if(/^\s+$/.test($)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!U)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&U)throw new Error("expected end of comment, got end of file");return P(U?p:c,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,u=c,console&&console.warn&&console.warn(u)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(a=e[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)o(c,this,e);else{var s=c.length,l=v(c,s);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},u.prototype.listeners=function(t){return d(this,t,!0)},u.prototype.rawListeners=function(t){return d(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):y.call(t,e)},u.prototype.listenerCount=y,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function a(){return"hole_"+o++}function u(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,a=r.repeat(" ",n/2-n%2),u=r.repeat(" ",n/2);return i.copySafeness(t,a+t+u)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var a in t)o.push([a,t[a]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],a=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(a)&&(a=a.toUpperCase())),o>a?1:o===a?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var a=t.split("\n"),u=r.repeat(" ",e),c=a.map((function(t,e){return 0!==e||n?""+u+t:t})).join("\n");return i.copySafeness(t,c)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=c,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=s(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=s(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var a="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return a=n+t.split("").join(n)+n,i.copySafeness(t,a);var u=t.indexOf(e);if(0===r||-1===u)return t;for(var c=0,s=0;u>-1&&(-1===r||s=i&&l.push(n),o.push(l)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,a=r.map(t,(function(t){return t})),u=r.getAttrGetter(i);return a.sort((function(t,a){var c=i?u(t):t,s=i?u(a):a;if(o.env.opts.throwOnUndefined&&i&&(void 0===c||void 0===s))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(c)&&r.isString(s)&&(c=c.toLowerCase(),s=s.toLowerCase()),cs?e?-1:1:0})),a})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=l((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return u(t)}));return i.copySafeness(t,e.join(" "))},e.trim=l,e.truncate=function(t,e,n,r){var a=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var u=t.lastIndexOf(" ",e);-1===u&&(u=e),t=t.substring(0,u)}return t+=null!=r?r:"...",i.copySafeness(a,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,y=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){a(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(f),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":h.test(i)?''+i+"":y.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return a(n)?e:n};var v=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return a(r)?e:r}));e.int=v,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,a=n(5),u=n(7).Environment,c=n(24);function s(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function l(t,e){(e=e||{}).isString=!0;var n=e.env||new u([]),r=e.wrapper||c;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([f(t,e.name,n)],e)}function f(t,e,n){var r,i=(n=n||new u([])).asyncFilters,c=n.extensionsList;e=e.replace(/\\/g,"/");try{r=a.compile(t,i,c,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new u([]),o=e.wrapper||c;if(e.isString)return l(t,e);var a=r.existsSync(t)&&r.statSync(t),h=[],p=[];if(a.isFile())h.push(f(r.readFileSync(t,"utf-8"),e.name||t,n));else if(a.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(a){var u=i.join(o,a),c=u.substr(i.join(t,"/").length),l=r.statSync(u);l&&l.isDirectory()?s(c+="/",e.exclude)||n(u):s(c,e.include)&&p.push(u)}))}(t);for(var d=0;dt.length||i>0&&a>=r||i<0&&a<=r);a+=i)o.push(n.memberLookup(t,a));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Component:()=>L,ComponentAttribute:()=>d,ComponentAttributeDefinition:()=>W,ComponentDefinition:()=>z,ComponentDrawOption:()=>S,ComponentLink:()=>et,ComponentLinkDefinition:()=>ut,ComponentRenderer:()=>vM,DefaultConfiguration:()=>BP,DefaultData:()=>MP,DefaultDrawer:()=>VM,DefaultMetadata:()=>ZM,DefaultParser:()=>nP,DefaultPlugin:()=>KP,DefaultRender:()=>uP,FileInformation:()=>b,FileInput:()=>dt,LinkRenderer:()=>wM,ParserLog:()=>s,Tag:()=>GP,Variable:()=>nC});var t={};function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){for(var n=0;nUt,Delaunay:()=>us,FormatSpecifier:()=>Of,InternMap:()=>Yt,InternSet:()=>qt,Node:()=>Xv,Path:()=>ku,Voronoi:()=>es,ZoomTransform:()=>oT,active:()=>Aa,arc:()=>KE,area:()=>ZE,areaRadial:()=>aS,ascending:()=>yt,autoType:()=>zs,axisBottom:()=>jn,axisLeft:()=>Nn,axisRight:()=>Cn,axisTop:()=>Pn,bin:()=>Se,bisect:()=>Et,bisectCenter:()=>kt,bisectLeft:()=>xt,bisectRight:()=>wt,bisector:()=>mt,blob:()=>Ml,blur:()=>St,blur2:()=>Ot,blurImage:()=>Tt,brush:()=>ru,brushSelection:()=>tu,brushX:()=>eu,brushY:()=>nu,buffer:()=>Cl,chord:()=>du,chordDirected:()=>vu,chordTranspose:()=>yu,cluster:()=>Kv,color:()=>Ei,contourDensity:()=>jc,contours:()=>Ec,count:()=>jt,create:()=>mE,creator:()=>Fr,cross:()=>Dt,csv:()=>Dl,csvFormat:()=>Ts,csvFormatBody:()=>As,csvFormatRow:()=>Ps,csvFormatRows:()=>Ms,csvFormatValue:()=>Cs,csvParse:()=>Ss,csvParseRows:()=>Os,cubehelix:()=>dc,cumsum:()=>It,curveBasis:()=>XS,curveBasisClosed:()=>QS,curveBasisOpen:()=>tO,curveBumpX:()=>lS,curveBumpY:()=>fS,curveBundle:()=>nO,curveCardinal:()=>oO,curveCardinalClosed:()=>uO,curveCardinalOpen:()=>sO,curveCatmullRom:()=>hO,curveCatmullRomClosed:()=>dO,curveCatmullRomOpen:()=>vO,curveLinear:()=>HE,curveLinearClosed:()=>gO,curveMonotoneX:()=>OO,curveMonotoneY:()=>TO,curveNatural:()=>PO,curveStep:()=>jO,curveStepAfter:()=>LO,curveStepBefore:()=>NO,descending:()=>vt,deviation:()=>Ft,difference:()=>ln,disjoint:()=>fn,dispatch:()=>Fn,drag:()=>ds,dragDisable:()=>ii,dragEnable:()=>oi,dsv:()=>Rl,dsvFormat:()=>ks,easeBack:()=>kl,easeBackIn:()=>wl,easeBackInOut:()=>kl,easeBackOut:()=>xl,easeBounce:()=>gl,easeBounceIn:()=>ml,easeBounceInOut:()=>bl,easeBounceOut:()=>gl,easeCircle:()=>al,easeCircleIn:()=>il,easeCircleInOut:()=>al,easeCircleOut:()=>ol,easeCubic:()=>Ea,easeCubicIn:()=>xa,easeCubicInOut:()=>Ea,easeCubicOut:()=>ka,easeElastic:()=>Ol,easeElasticIn:()=>Sl,easeElasticInOut:()=>Tl,easeElasticOut:()=>Ol,easeExp:()=>rl,easeExpIn:()=>el,easeExpInOut:()=>rl,easeExpOut:()=>nl,easeLinear:()=>$s,easePoly:()=>Ws,easePolyIn:()=>Vs,easePolyInOut:()=>Ws,easePolyOut:()=>Hs,easeQuad:()=>qs,easeQuadIn:()=>Ks,easeQuadInOut:()=>qs,easeQuadOut:()=>Ys,easeSin:()=>Js,easeSinIn:()=>Zs,easeSinInOut:()=>Js,easeSinOut:()=>Qs,every:()=>rn,extent:()=>zt,fcumsum:()=>Kt,filter:()=>an,flatGroup:()=>te,flatRollup:()=>ee,forceCenter:()=>ql,forceCollide:()=>of,forceLink:()=>cf,forceManyBody:()=>mf,forceRadial:()=>gf,forceSimulation:()=>vf,forceX:()=>bf,forceY:()=>_f,format:()=>Cf,formatDefaultLocale:()=>Df,formatLocale:()=>Rf,formatPrefix:()=>jf,formatSpecifier:()=>Sf,fsum:()=>$t,geoAlbers:()=>iv,geoAlbersUsa:()=>ov,geoArea:()=>zh,geoAzimuthalEqualArea:()=>sv,geoAzimuthalEqualAreaRaw:()=>cv,geoAzimuthalEquidistant:()=>fv,geoAzimuthalEquidistantRaw:()=>lv,geoBounds:()=>wp,geoCentroid:()=>Np,geoCircle:()=>Yp,geoClipAntimeridian:()=>ed,geoClipCircle:()=>nd,geoClipExtent:()=>ld,geoClipRectangle:()=>sd,geoConicConformal:()=>mv,geoConicConformalRaw:()=>vv,geoConicEqualArea:()=>rv,geoConicEqualAreaRaw:()=>nv,geoConicEquidistant:()=>wv,geoConicEquidistantRaw:()=>_v,geoContains:()=>Td,geoDistance:()=>gd,geoEqualEarth:()=>Av,geoEqualEarthRaw:()=>Tv,geoEquirectangular:()=>bv,geoEquirectangularRaw:()=>gv,geoGnomonic:()=>Pv,geoGnomonicRaw:()=>Mv,geoGraticule:()=>Pd,geoGraticule10:()=>Cd,geoIdentity:()=>Cv,geoInterpolate:()=>jd,geoLength:()=>yd,geoMercator:()=>pv,geoMercatorRaw:()=>hv,geoNaturalEarth1:()=>Nv,geoNaturalEarth1Raw:()=>jv,geoOrthographic:()=>Rv,geoOrthographicRaw:()=>Lv,geoPath:()=>Fy,geoProjection:()=>Jy,geoProjectionMutator:()=>tv,geoRotation:()=>Up,geoStereographic:()=>Iv,geoStereographicRaw:()=>Dv,geoStream:()=>vh,geoTransform:()=>zy,geoTransverseMercator:()=>Fv,geoTransverseMercatorRaw:()=>Bv,gray:()=>Wu,greatest:()=>je,greatestIndex:()=>Ge,group:()=>Zt,groupSort:()=>he,groups:()=>Qt,hcl:()=>rc,hierarchy:()=>qv,histogram:()=>Se,hsl:()=>Ii,html:()=>Kl,image:()=>Bl,index:()=>ie,indexes:()=>oe,interpolate:()=>so,interpolateArray:()=>eo,interpolateBasis:()=>Ki,interpolateBasisClosed:()=>Yi,interpolateBlues:()=>Yk,interpolateBrBG:()=>nk,interpolateBuGn:()=>_k,interpolateBuPu:()=>xk,interpolateCividis:()=>eE,interpolateCool:()=>iE,interpolateCubehelix:()=>lg,interpolateCubehelixDefault:()=>nE,interpolateCubehelixLong:()=>fg,interpolateDate:()=>ro,interpolateDiscrete:()=>Zm,interpolateGnBu:()=>Ek,interpolateGreens:()=>Vk,interpolateGreys:()=>Wk,interpolateHcl:()=>ug,interpolateHclLong:()=>cg,interpolateHsl:()=>rg,interpolateHslLong:()=>ig,interpolateHue:()=>Qm,interpolateInferno:()=>yE,interpolateLab:()=>og,interpolateMagma:()=>dE,interpolateNumber:()=>io,interpolateNumberArray:()=>Ji,interpolateObject:()=>oo,interpolateOrRd:()=>Ok,interpolateOranges:()=>tE,interpolatePRGn:()=>ik,interpolatePiYG:()=>ak,interpolatePlasma:()=>vE,interpolatePuBu:()=>Pk,interpolatePuBuGn:()=>Ak,interpolatePuOr:()=>ck,interpolatePuRd:()=>jk,interpolatePurples:()=>Xk,interpolateRainbow:()=>aE,interpolateRdBu:()=>lk,interpolateRdGy:()=>hk,interpolateRdPu:()=>Lk,interpolateRdYlBu:()=>dk,interpolateRdYlGn:()=>vk,interpolateReds:()=>Qk,interpolateRgb:()=>Gi,interpolateRgbBasis:()=>Zi,interpolateRgbBasisClosed:()=>Qi,interpolateRound:()=>Jm,interpolateSinebow:()=>lE,interpolateSpectral:()=>gk,interpolateString:()=>co,interpolateTransformCss:()=>Zo,interpolateTransformSvg:()=>Qo,interpolateTurbo:()=>fE,interpolateViridis:()=>pE,interpolateWarm:()=>rE,interpolateYlGn:()=>Bk,interpolateYlGnBu:()=>Dk,interpolateYlOrBr:()=>zk,interpolateYlOrRd:()=>$k,interpolateZoom:()=>eg,interrupt:()=>qo,intersection:()=>hn,interval:()=>nT,isoFormat:()=>JO,isoParse:()=>eT,json:()=>zl,lab:()=>Gu,lch:()=>nc,least:()=>He,leastIndex:()=>We,line:()=>XE,lineRadial:()=>oS,link:()=>yS,linkHorizontal:()=>vS,linkRadial:()=>gS,linkVertical:()=>mS,local:()=>bE,map:()=>un,matcher:()=>qn,max:()=>Oe,maxIndex:()=>Te,mean:()=>Be,median:()=>Fe,medianIndex:()=>ze,merge:()=>Ue,min:()=>Ae,minIndex:()=>Me,mode:()=>$e,namespace:()=>ar,namespaces:()=>or,nice:()=>ke,now:()=>Eo,pack:()=>wm,packEnclose:()=>om,packSiblings:()=>bm,pairs:()=>Ke,partition:()=>Tm,path:()=>Eu,pathRound:()=>Su,permute:()=>ce,pie:()=>tS,piecewise:()=>hg,pointRadial:()=>uS,pointer:()=>fo,pointers:()=>wE,polygonArea:()=>dg,polygonCentroid:()=>yg,polygonContains:()=>_g,polygonHull:()=>bg,polygonLength:()=>wg,precisionFixed:()=>If,precisionPrefix:()=>Bf,precisionRound:()=>Ff,quadtree:()=>Xl,quantile:()=>Ne,quantileIndex:()=>Re,quantileSorted:()=>Le,quantize:()=>pg,quickselect:()=>Pe,radialArea:()=>aS,radialLine:()=>oS,randomBates:()=>Ag,randomBernoulli:()=>Cg,randomBeta:()=>Lg,randomBinomial:()=>Rg,randomCauchy:()=>Ig,randomExponential:()=>Mg,randomGamma:()=>Ng,randomGeometric:()=>jg,randomInt:()=>Eg,randomIrwinHall:()=>Tg,randomLcg:()=>Kg,randomLogNormal:()=>Og,randomLogistic:()=>Bg,randomNormal:()=>Sg,randomPareto:()=>Pg,randomPoisson:()=>Fg,randomUniform:()=>kg,randomWeibull:()=>Dg,range:()=>qe,rank:()=>Ve,reduce:()=>cn,reverse:()=>sn,rgb:()=>Ai,ribbon:()=>Du,ribbonArrow:()=>Iu,rollup:()=>ne,rollups:()=>re,scaleBand:()=>Wg,scaleDiverging:()=>Ix,scaleDivergingLog:()=>Bx,scaleDivergingPow:()=>zx,scaleDivergingSqrt:()=>Ux,scaleDivergingSymlog:()=>Fx,scaleIdentity:()=>sb,scaleImplicit:()=>Vg,scaleLinear:()=>cb,scaleLog:()=>gb,scaleOrdinal:()=>Hg,scalePoint:()=>Xg,scalePow:()=>Tb,scaleQuantile:()=>Cb,scaleQuantize:()=>jb,scaleRadial:()=>Pb,scaleSequential:()=>Px,scaleSequentialLog:()=>Cx,scaleSequentialPow:()=>Nx,scaleSequentialQuantile:()=>Rx,scaleSequentialSqrt:()=>Lx,scaleSequentialSymlog:()=>jx,scaleSqrt:()=>Ab,scaleSymlog:()=>xb,scaleThreshold:()=>Nb,scaleTime:()=>Ox,scaleUtc:()=>Tx,scan:()=>Xe,schemeAccent:()=>Yx,schemeBlues:()=>Kk,schemeBrBG:()=>ek,schemeBuGn:()=>bk,schemeBuPu:()=>wk,schemeCategory10:()=>Kx,schemeDark2:()=>qx,schemeGnBu:()=>kk,schemeGreens:()=>qk,schemeGreys:()=>Hk,schemeObservable10:()=>Vx,schemeOrRd:()=>Sk,schemeOranges:()=>Jk,schemePRGn:()=>rk,schemePaired:()=>Hx,schemePastel1:()=>Wx,schemePastel2:()=>Gx,schemePiYG:()=>ok,schemePuBu:()=>Mk,schemePuBuGn:()=>Tk,schemePuOr:()=>uk,schemePuRd:()=>Ck,schemePurples:()=>Gk,schemeRdBu:()=>sk,schemeRdGy:()=>fk,schemeRdPu:()=>Nk,schemeRdYlBu:()=>pk,schemeRdYlGn:()=>yk,schemeReds:()=>Zk,schemeSet1:()=>Xx,schemeSet2:()=>Zx,schemeSet3:()=>Qx,schemeSpectral:()=>mk,schemeTableau10:()=>Jx,schemeYlGn:()=>Ik,schemeYlGnBu:()=>Rk,schemeYlOrBr:()=>Fk,schemeYlOrRd:()=>Uk,select:()=>Jr,selectAll:()=>xE,selection:()=>Qr,selector:()=>Un,selectorAll:()=>Yn,shuffle:()=>Ze,shuffler:()=>Qe,some:()=>on,sort:()=>se,stack:()=>FO,stackOffsetDiverging:()=>UO,stackOffsetExpand:()=>zO,stackOffsetNone:()=>RO,stackOffsetSilhouette:()=>$O,stackOffsetWiggle:()=>KO,stackOrderAppearance:()=>YO,stackOrderAscending:()=>VO,stackOrderDescending:()=>WO,stackOrderInsideOut:()=>GO,stackOrderNone:()=>DO,stackOrderReverse:()=>XO,stratify:()=>Nm,style:()=>mr,subset:()=>vn,sum:()=>Je,superset:()=>dn,svg:()=>Yl,symbol:()=>VS,symbolAsterisk:()=>_S,symbolCircle:()=>wS,symbolCross:()=>xS,symbolDiamond:()=>SS,symbolDiamond2:()=>OS,symbolPlus:()=>TS,symbolSquare:()=>AS,symbolSquare2:()=>MS,symbolStar:()=>NS,symbolTimes:()=>KS,symbolTriangle:()=>RS,symbolTriangle2:()=>IS,symbolWye:()=>$S,symbolX:()=>KS,symbols:()=>YS,symbolsFill:()=>YS,symbolsStroke:()=>qS,text:()=>Nl,thresholdFreedmanDiaconis:()=>De,thresholdScott:()=>Ie,thresholdSturges:()=>Ee,tickFormat:()=>ab,tickIncrement:()=>we,tickStep:()=>xe,ticks:()=>_e,timeDay:()=>e_,timeDays:()=>n_,timeFormat:()=>ew,timeFormatDefaultLocale:()=>xx,timeFormatLocale:()=>J_,timeFriday:()=>p_,timeFridays:()=>__,timeHour:()=>Zb,timeHours:()=>Qb,timeInterval:()=>$b,timeMillisecond:()=>Kb,timeMilliseconds:()=>Yb,timeMinute:()=>Hb,timeMinutes:()=>Wb,timeMonday:()=>s_,timeMondays:()=>v_,timeMonth:()=>I_,timeMonths:()=>B_,timeParse:()=>nw,timeSaturday:()=>d_,timeSaturdays:()=>w_,timeSecond:()=>qb,timeSeconds:()=>Vb,timeSunday:()=>c_,timeSundays:()=>y_,timeThursday:()=>h_,timeThursdays:()=>b_,timeTickInterval:()=>G_,timeTicks:()=>W_,timeTuesday:()=>l_,timeTuesdays:()=>m_,timeWednesday:()=>f_,timeWednesdays:()=>g_,timeWeek:()=>c_,timeWeeks:()=>y_,timeYear:()=>U_,timeYears:()=>$_,timeout:()=>jo,timer:()=>To,timerFlush:()=>Ao,transition:()=>ba,transpose:()=>tn,tree:()=>$m,treemap:()=>Hm,treemapBinary:()=>Wm,treemapDice:()=>Om,treemapResquarify:()=>Xm,treemapSlice:()=>Km,treemapSliceDice:()=>Gm,treemapSquarify:()=>Vm,tsv:()=>Il,tsvFormat:()=>Rs,tsvFormatBody:()=>Ds,tsvFormatRow:()=>Bs,tsvFormatRows:()=>Is,tsvFormatValue:()=>Fs,tsvParse:()=>Ns,tsvParseRows:()=>Ls,union:()=>mn,unixDay:()=>o_,unixDays:()=>a_,utcDay:()=>r_,utcDays:()=>i_,utcFormat:()=>rw,utcFriday:()=>A_,utcFridays:()=>R_,utcHour:()=>Jb,utcHours:()=>t_,utcMillisecond:()=>Kb,utcMilliseconds:()=>Yb,utcMinute:()=>Gb,utcMinutes:()=>Xb,utcMonday:()=>E_,utcMondays:()=>C_,utcMonth:()=>F_,utcMonths:()=>z_,utcParse:()=>iw,utcSaturday:()=>M_,utcSaturdays:()=>D_,utcSecond:()=>qb,utcSeconds:()=>Vb,utcSunday:()=>k_,utcSundays:()=>P_,utcThursday:()=>T_,utcThursdays:()=>L_,utcTickInterval:()=>H_,utcTicks:()=>V_,utcTuesday:()=>S_,utcTuesdays:()=>j_,utcWednesday:()=>O_,utcWednesdays:()=>N_,utcWeek:()=>k_,utcWeeks:()=>P_,utcYear:()=>K_,utcYears:()=>Y_,variance:()=>Bt,window:()=>pr,xml:()=>$l,zip:()=>nn,zoom:()=>vT,zoomIdentity:()=>aT,zoomTransform:()=>uT});var c=o((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,severity:null,startLineNumber:null,startColumn:null,endLineNumber:null,endColumn:null,message:null,initialErrorMessage:null,componentId:null,attribute:null,extraData:""};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path,r=e.severity,i=e.startLineNumber,o=e.startColumn,a=e.endLineNumber,u=e.endColumn,c=e.message,s=e.initialErrorMessage,l=e.componentId,f=e.attribute,h=e.extraData;this.path=null!=n?n:null,this.severity=null!=r?r:t.SEVERITY_HINT,this.startLineNumber=null!=i?i:null,this.startColumn=null!=o?o:null,this.endLineNumber=null!=a?a:null,this.endColumn=null!=u?u:null,this.message=null!=c?c:null,this.initialErrorMessage=null!=s?s:null,this.componentId=null!=l?l:null,this.attribute=null!=f?f:null,this.extraData=null!=h?h:""}));a(c,"SEVERITY_HINT",1),a(c,"SEVERITY_INFO",2),a(c,"SEVERITY_WARNING",4),a(c,"SEVERITY_ERROR",8);const s=c;function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{name:null,value:null,type:null,definition:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.value,i=e.type,o=e.definition;this.name=n||null,this.value=null!=r?r:null,this.type=i||null,this.definition=o||null},e=[{key:"isVariable",get:function(){return!1}},{key:"getErrors",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.validateDefinitionType(e,r),this.validateType(e,r),this.validateRuleMinMax(e,r),this.validateRuleValues(e,r),this.validateRuleRegex(e,r),this.validateRequiredAttributes(e,r),n&&"Object"===(null===(t=this.definition)||void 0===t?void 0:t.type)&&Array.isArray(this.value)&&this.value.forEach((function(t){return t.getErrors(e,!0,r)})),e}},{key:"validateDefinitionType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null===this.definition?t:"Link"===this.definition.type&&"Array"!==this.type?(t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.invalidLinkType",attribute:this.name})),t):"Reference"===this.definition.type&&"String"!==this.type?(t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.invalidReferenceType",attribute:this.name})),t):("Reference"!==this.definition.type&&"Link"!==this.definition.type&&this.definition.type!==this.type&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.not".concat(this.definition.type),attribute:this.name})),t)}},{key:"validateType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null===this.value?t:"Boolean"===this.type?("boolean"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notBoolean",attribute:this.name})),t):"String"===this.type?("string"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notString",attribute:this.name})),t):"Number"===this.type?("number"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notNumber",attribute:this.name})),t):(Array.isArray(this.value)||t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.not".concat(this.type),attribute:this.name})),t)}},{key:"validateRuleMinMax",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("Boolean"===this.type||"Object"===this.type||null===(t=this.definition)||void 0===t||!t.rules)return n;var i="number"==typeof this.value?this.value:(null===(e=this.value)||void 0===e?void 0:e.length)||0;return null!==this.definition.rules.min&&ithis.definition.rules.max&&n.push(new s({componentId:r,severity:s.SEVERITY_ERROR,message:"parser.error.max".concat(this.definition.type),attribute:this.name,extraData:this.definition.rules.max})),n}},{key:"validateRuleValues",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this.definition||0===this.definition.rules.values.length)return e;var r=Array.isArray(this.value);return(r&&this.value.some((function(e){return!t.definition.rules.values.includes(e)}))||!r&&!this.definition.rules.values.includes(this.value))&&e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:"parser.error.invalidValue",attribute:this.name,extraData:this.definition.rules.values.join(", ")})),e}},{key:"validateRuleRegex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==(t=this.definition)&&void 0!==t&&t.rules.regex&&null!==this.value?(new RegExp(this.definition.rules.regex).test(this.value)||e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:this.definition.rules.regexMessage||"parser.error.regex",attribute:this.name})),e):e}},{key:"validateRequiredAttributes",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.definition&&"Object"===this.definition.type?(this.definition.definedAttributes.forEach((function(r){var i=t.value.find((function(t){return t.name===r.name}));!r.required||i&&null!==i.value||e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:"parser.error.required",attribute:r.name}))})),e):e}}],e&&f(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const d=p;function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function v(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{path:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path;this.path=null!=n?n:null},(e=[{key:"fileName",get:function(){return this.path?this.path.replace(/^.*[\\/]/,""):null}}])&&v(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const b=g;function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function w(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{x:null,y:null,width:null,height:null,hide:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.x,r=e.y,i=e.width,o=e.height,a=e.hide;this.x=n||null,this.y=r||null,this.width=i||null,this.height=o||null,this.hide=a||!1}));const S=E;function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function T(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,externalId:null,name:null,definition:null,drawOption:null,attributes:[]};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=M(this,e,[n]);var r=n.id,i=n.externalId,o=n.name,a=n.definition,u=n.drawOption,c=n.attributes;return t.__class="Component",t.id=r||null,t.externalId=i||t.id,t.name=o||null,t.definition=a||null,t.drawOption=u||new S,t.attributes=c||[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&j(t,e)}(e,t),n=e,r=[{key:"setExternalId",value:function(t){this.externalId=t}},{key:"getConfigurationKey",value:function(){return this.id}},{key:"setReferenceAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.containerRef===t.definition.type}));if(e){var n=this.attributes.filter((function(t){var n=t.definition;return(null==n?void 0:n.name)===e.name}));n.length>0?n.forEach((function(e){e.value=t.id})):this.attributes.push(this.createAttribute({name:e.name,value:t.id,type:"String",definition:e}))}}},{key:"__createNestedAttributes",value:function(t){var e=this,n=this.attributes;return t.slice().reverse().forEach((function(t){var r=n.find((function(e){return e.definition.name===t.name}));r||(r=e.createAttribute({name:t.name,definition:t,type:"Object",value:[]}),n.push(r)),n=r.value})),n}},{key:"createAttribute",value:function(t){return new d(t)}},{key:"removeAllReferenceAttributes",value:function(t){this.attributes=t?this.attributes.filter((function(e){return!("Reference"===e.definition.type&&e.definition.containerRef===t.definition.type&&e.value===t.id)})):this.attributes.filter((function(t){return"Reference"!==t.definition.type}))}},{key:"setLinkAttribute",value:function(t){var e=[],n=this.__getLinkAttribute(e,this.definition.definedAttributes,t),r=this.__createNestedAttributes(e),i=r.find((function(t){return t.definition.name===n.name}));i||(i=this.createAttribute({name:n.name,definition:n,type:"Array",value:[]}),r.push(i)),i.value.includes(t.target)||i.value.push(t.target)}},{key:"__getLinkAttribute",value:function(t,e,n){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;this.__removeLinkAttribute(this.attributes,t,e)}},{key:"__removeLinkAttribute",value:function(t,e,n){var r=this;t.forEach((function(t){var i;if("Object"===t.type&&r.__removeLinkAttribute(t.value,e,n),"Link"===(null===(i=t.definition)||void 0===i?void 0:i.type)&&(!n||t.name===n)){var o=t.value.findIndex((function(t){return t===e}));o>=0&&t.value.splice(o,1)}}))}},{key:"getAttributeByName",value:function(t){return this.__getAttributeByName(this.attributes,t)}},{key:"__getAttributeByName",value:function(t,e){for(var n=0;n3?i-3:0),a=3;a2?n-2:0),i=2;i0&&void 0!==arguments[0]?arguments[0]:[];return this.validateDefinition(e),this.validateRequiredAttributes(e),this.attributes.forEach((function(n){return n.getErrors(e,!0,t.id)})),e}},{key:"validateRequiredAttributes",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.definition?(this.definition.definedAttributes.forEach((function(n){var r=t.attributes.find((function(t){return t.name===n.name}));!n.required||r&&null!==r.value||e.push(new s({componentId:t.id,severity:s.SEVERITY_ERROR,message:"parser.error.required",attribute:n.name}))})),e):e}},{key:"validateDefinition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null===this.definition&&t.push(new s({componentId:this.id,severity:s.SEVERITY_WARNING,message:"parser.warning.noComponentDefinition"})),t}},{key:"getDefinedAttributesByType",value:function(t){var e=[];return this.__setDefinedAttributesByType(e,this.definition.definedAttributes,t),e}},{key:"__setDefinedAttributesByType",value:function(t,e,n){var r=this;e.forEach((function(e){"Object"===e.type&&r.__setDefinedAttributesByType(t,e.definedAttributes,n),e.type===n&&t.push(e)}))}},{key:"canContain",value:function(t){return this.definition.isContainer&&this.definition.childrenTypes.includes(t)}}],r&&T(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(b);const L=N;function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function D(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,icon:null,model:null,displayName:null,description:null,categories:[],tags:[],url:null,parentTypes:[],childrenTypes:[],definedAttributes:[],isContainer:!1,displayType:null,workflowDirection:null,linkModel:null,defaultWidth:0,defaultHeight:0,minWidth:0,minHeight:0,reservedWidth:0,reservedHeight:0,margin:10,gap:30};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.icon,i=e.model,o=e.displayName,a=e.description,u=e.categories,c=e.tags,s=e.url,l=e.parentTypes,f=e.childrenTypes,h=e.definedAttributes,p=e.isContainer,d=e.displayType,y=e.workflowDirection,v=e.linkModel,m=e.defaultWidth,g=e.defaultHeight,b=e.minWidth,_=e.minHeight,w=e.reservedWidth,x=e.reservedHeight,k=e.margin,E=e.gap;this.type=n||null,this.icon=r||null,this.model=i||null,this.displayName=o||null,this.description=a||null,this.categories=u||[],this.tags=c||[],this.url=s||null,this.parentTypes=l||[],this.childrenTypes=f||[],this.definedAttributes=h||[],this.isContainer=void 0!==p&&p,this.displayType=d||null,this.workflowDirection=y||"horizontal",this.linkModel=v||null,this.defaultWidth=m||0,this.defaultHeight=g||0,this.minWidth=b||0,this.minHeight=_||0,this.reservedWidth=w||0,this.reservedHeight=x||0,this.margin=k||10,this.gap=E||30}));const z=F;function U(t){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U(t)}function $(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function K(t,e,n){return(e=V(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,displayName:null,description:null,tags:[],url:null,linkType:null,linkRef:[],linkModel:null,containerRef:null,required:!1,definedAttributes:[],rules:{values:[],min:null,max:null,regex:null,regexMessage:null}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.type,i=e.displayName,o=e.description,a=e.tags,u=e.url,c=e.linkType,s=e.linkRef,l=e.linkModel,f=e.containerRef,h=e.definedAttributes,p=e.required,d=e.rules;this.name=n||null,this.type=r||null,this.displayName=i||null,this.description=o||null,this.tags=a||[],this.url=u||null,this.linkType=c||null,this.linkRef=s||[],this.linkModel=l||null,this.containerRef=f||null,this.definedAttributes=h||[],this.required=p||!1,this.rules=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{source:null,target:null,name:null,definition:null,isReverse:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=X(this,e);var r=n.source,i=n.target,o=n.name,a=n.definition,u=n.isReverse;return t.__class="Link",t.source=r||null,t.target=i||null,t.name=o||null,t.definition=a||null,t.isReverse=!!u,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&J(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(b);const et=tt;function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function rt(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{attributeRef:null,sourceRef:null,targetRef:null,type:null,model:null,isTemporary:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.attributeRef,r=e.sourceRef,i=e.targetRef,o=e.type,a=e.model,u=e.isTemporary;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null,this.model=a||null,this.isTemporary=!!u}));const ut=at;function ct(t){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(t)}function st(t,e,n){return e=ft(e),function(t,e){if(e&&("object"==ct(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,lt()?Reflect.construct(e,n||[],ft(t).constructor):e.apply(t,n))}function lt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(lt=function(){return!!t})()}function ft(t){return ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ft(t)}function ht(t,e){return ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ht(t,e)}var pt=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,name:null,content:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=st(this,e,[n]);var r=n.content;return t.content=r||null,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ht(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(b);const dt=pt;function yt(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function vt(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function mt(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<0?i=e+1:o=e}while(iyt(t(e),n),r=(e,n)=>t(e)-n):(e=t===yt||t===vt?t:gt,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<=0?i=e+1:o=e}while(i=0))throw new RangeError("invalid r");let n=t.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!e)return t;const r=Ct(e),i=t.slice();return r(t,i,0,n,1),r(i,t,0,n,1),r(t,i,0,n,1),t}const Ot=At(Ct),Tt=At((function(t){const e=Ct(t);return(t,n,r,i,o)=>{e(t,n,0+(r<<=2),0+(i<<=2),o<<=2),e(t,n,r+1,i+1,o),e(t,n,r+2,i+2,o),e(t,n,r+3,i+3,o)}}));function At(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=e;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(void 0!==a?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return e;const u=n&&t(n),c=r&&t(r),s=i.slice();return u&&c?(Mt(u,s,i,o,a),Mt(u,i,s,o,a),Mt(u,s,i,o,a),Pt(c,i,s,o,a),Pt(c,s,i,o,a),Pt(c,i,s,o,a)):u?(Mt(u,i,s,o,a),Mt(u,s,i,o,a),Mt(u,i,s,o,a)):c&&(Pt(c,i,s,o,a),Pt(c,s,i,o,a),Pt(c,i,s,o,a)),e}}function Mt(t,e,n,r,i){for(let o=0,a=r*i;o{if(!((o-=a)>=i))return;let u=t*r[i];const c=a*t;for(let t=i,e=i+c;t{if(!((a-=u)>=o))return;let c=e*i[o];const s=u*e,l=s+u;for(let t=o,e=o+s;t=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function Nt(t){return 0|t.length}function Lt(t){return!(t>0)}function Rt(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function Dt(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(Rt)).map(Nt),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(Lt))return o;for(;;){o.push(i.map(((e,n)=>t[n][e])));let a=r;for(;++i[a]===n[a];){if(0===a)return e?o.map(e):o;i[a--]=0}}}function It(t,e){var n=0,r=0;return Float64Array.from(t,void 0===e?t=>n+=+t||0:i=>n+=+e(i,r++,t)||0)}function Bt(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let u of t)null!=(u=e(u,++a,t))&&(u=+u)>=u&&(n=u-i,i+=n/++r,o+=n*(u-i))}if(r>1)return o/(r-1)}function Ft(t,e){const n=Bt(t,e);return n?Math.sqrt(n):n}function zt(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r=o&&(n=r=o):(n>o&&(n=o),r0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}function $t(t,e){const n=new Ut;if(void 0===e)for(let e of t)(e=+e)&&n.add(e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function Kt(t,e){const n=new Ut;let r=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):i=>n.add(+e(i,++r,t)||0))}class Yt extends Map{constructor(t,e=Gt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Vt(this,t))}has(t){return super.has(Vt(this,t))}set(t,e){return super.set(Ht(this,t),e)}delete(t){return super.delete(Wt(this,t))}}class qt extends Set{constructor(t,e=Gt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(Vt(this,t))}add(t){return super.add(Ht(this,t))}delete(t){return super.delete(Wt(this,t))}}function Vt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ht({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Wt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Gt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Xt(t){return t}function Zt(t,...e){return ue(t,Xt,Xt,e)}function Qt(t,...e){return ue(t,Array.from,Xt,e)}function Jt(t,e){for(let n=1,r=e.length;nt.pop().map((([e,n])=>[...t,e,n]))));return t}function te(t,...e){return Jt(Qt(t,...e),e)}function ee(t,e,...n){return Jt(re(t,e,...n),n)}function ne(t,e,...n){return ue(t,Xt,e,n)}function re(t,e,...n){return ue(t,Array.from,e,n)}function ie(t,...e){return ue(t,Xt,ae,e)}function oe(t,...e){return ue(t,Array.from,ae,e)}function ae(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function ue(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Yt,u=r[o++];let c=-1;for(const t of i){const e=u(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function ce(t,e){return Array.from(e,(e=>t[e]))}function se(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=fe(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>fe(n[t],n[e])))),ce(t,r)}return t.sort(le(n))}function le(t=yt){if(t===yt)return fe;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function fe(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function he(t,e,n){return(2!==e.length?se(ne(t,e,n),(([t,e],[n,r])=>yt(e,r)||yt(t,n))):se(Zt(t,n),(([t,n],[r,i])=>e(n,i)||yt(t,r)))).map((([t])=>t))}var pe=Array.prototype,de=pe.slice;function ye(t){return()=>t}pe.map;const ve=Math.sqrt(50),me=Math.sqrt(10),ge=Math.sqrt(2);function be(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=ve?10:o>=me?5:o>=ge?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/a,u=Math.round(t*s),c=Math.round(e*s),u/se&&--c,s=-s):(s=Math.pow(10,i)*a,u=Math.round(t/s),c=Math.round(e/s),u*se&&--c),c0))return[];if((t=+t)==(e=+e))return[t];const r=e=i))return[];const u=o-i+1,c=new Array(u);if(r)if(a<0)for(let t=0;t0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function Ee(t){return Math.max(1,Math.ceil(Math.log(jt(t))/Math.LN2)+1)}function Se(){var t=Xt,e=zt,n=Ee;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,u=r.length,c=new Array(u);for(i=0;i=f)if(t>=f&&e===zt){const t=we(l,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var p=h.length,d=0,y=p;h[d]<=l;)++d;for(;h[y-1]>f;)--y;(d||y0?h[i-1]:l,v.x1=i0)for(i=0;i=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}function Te(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n=o)&&(n=o,r=i);return r}function Ae(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Me(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Pe(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?fe:le(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,u=Math.log(o),c=.5*Math.exp(2*u/3),s=.5*Math.sqrt(u*c*(o-c)/o)*(a-o/2<0?-1:1);Pe(t,e,Math.max(n,Math.floor(e-a*c/o+s)),Math.min(r,Math.floor(e+(o-a)*c/o+s)),i)}const o=t[e];let a=n,u=r;for(Ce(t,n,e),i(t[r],o)>0&&Ce(t,n,r);a0;)--u}0===i(t[n],o)?Ce(t,n,u):(++u,Ce(t,u,r)),u<=e&&(n=u+1),e<=u&&(r=u-1)}return t}function Ce(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function je(t,e=yt){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?yt(t,i)>0:0===yt(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}function Ne(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return Ae(t);if(e>=1)return Oe(t);var r,i=(r-1)*e,o=Math.floor(i),a=Oe(Pe(t,o).subarray(0,o+1));return a+(Ae(t.subarray(o+1))-a)*(i-o)}}function Le(t,e,n=bt){if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function Re(t,e,n=bt){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>bt(n(t[r],r,t)))),e<=0)return Me(r);if(e>=1)return Te(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return Pe(i,a,0,o,((t,e)=>fe(r[t],r[e]))),(a=je(i.subarray(0,a+1),(t=>r[t])))>=0?a:-1}}function De(t,e,n){const r=jt(t),i=Ne(t,.75)-Ne(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function Ie(t,e,n){const r=jt(t),i=Ft(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function Be(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function Fe(t,e){return Ne(t,.5,e)}function ze(t,e){return Re(t,.5,e)}function Ue(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function $e(t,e){const n=new Yt;if(void 0===e)for(let e of t)null!=e&&e>=e&&n.set(e,(n.get(e)||0)+1);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&i>=i&&n.set(i,(n.get(i)||0)+1)}let r,i=0;for(const[t,e]of n)e>i&&(i=e,r=t);return r}function Ke(t,e=Ye){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function Ye(t,e){return[t,e]}function qe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++re(n[t],n[r]);let o,a;return t=Uint32Array.from(n,((t,e)=>e)),t.sort(e===yt?(t,e)=>fe(n[t],n[e]):le(i)),t.forEach(((t,e)=>{const n=i(t,void 0===o?t:o);n>=0?((void 0===o||n>0)&&(o=t,a=e),r[t]=a):r[t]=NaN})),r}function He(t,e=yt){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?yt(t,i)<0:0===yt(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)<0:0===e(i,i))&&(n=i,r=!0);return n}function We(t,e=yt){if(1===e.length)return Me(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?0===e(o,o):e(o,n)<0)&&(n=o,r=i);return r}function Ge(t,e=yt){if(1===e.length)return Te(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?0===e(o,o):e(o,n)>0)&&(n=o,r=i);return r}function Xe(t,e){const n=We(t,e);return n<0?void 0:n}const Ze=Qe(Math.random);function Qe(t){return function(e,n=0,r=e.length){let i=r-(n=+n);for(;i;){const r=t()*i--|0,o=e[i+n];e[i+n]=e[r+n],e[r+n]=o}return e}}function Je(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function tn(t){if(!(i=t.length))return[];for(var e=-1,n=Ae(t,en),r=new Array(n);++ee(n,r,t)))}function cn(t,e,n){if("function"!=typeof e)throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if(({done:i,value:n}=r.next()),i)return;++a}for(;({done:i,value:o}=r.next()),!i;)n=e(n,o,++a,t);return n}function sn(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function ln(t,...e){t=new qt(t);for(const n of e)for(const e of n)t.delete(e);return t}function fn(t,e){const n=e[Symbol.iterator](),r=new qt;for(const e of t){if(r.has(e))return!1;let t,i;for(;({value:t,done:i}=n.next())&&!i;){if(Object.is(e,t))return!1;r.add(t)}}return!0}function hn(t,...e){t=new qt(t),e=e.map(pn);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function pn(t){return t instanceof qt?t:new qt(t)}function dn(t,e){const n=t[Symbol.iterator](),r=new Set;for(const t of e){const e=yn(t);if(r.has(e))continue;let i,o;for(;({value:i,done:o}=n.next());){if(o)return!1;const t=yn(i);if(r.add(t),Object.is(e,t))break}}return!0}function yn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function vn(t,e){return dn(e,t)}function mn(...t){const e=new qt;for(const n of t)for(const t of n)e.add(t);return e}function gn(t){return t}var bn=1,_n=2,wn=3,xn=4,kn=1e-6;function En(t){return"translate("+t+",0)"}function Sn(t){return"translate(0,"+t+")"}function On(t){return e=>+t(e)}function Tn(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function An(){return!this.__axis}function Mn(t,e){var n=[],r=null,i=null,o=6,a=6,u=3,c="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,s=t===bn||t===xn?-1:1,l=t===xn||t===_n?"x":"y",f=t===bn||t===wn?En:Sn;function h(h){var p=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,d=null==i?e.tickFormat?e.tickFormat.apply(e,n):gn:i,y=Math.max(o,0)+u,v=e.range(),m=+v[0]+c,g=+v[v.length-1]+c,b=(e.bandwidth?Tn:On)(e.copy(),c),_=h.selection?h.selection():h,w=_.selectAll(".domain").data([null]),x=_.selectAll(".tick").data(p,e).order(),k=x.exit(),E=x.enter().append("g").attr("class","tick"),S=x.select("line"),O=x.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(E),S=S.merge(E.append("line").attr("stroke","currentColor").attr(l+"2",s*o)),O=O.merge(E.append("text").attr("fill","currentColor").attr(l,s*y).attr("dy",t===bn?"0em":t===wn?"0.71em":"0.32em")),h!==_&&(w=w.transition(h),x=x.transition(h),S=S.transition(h),O=O.transition(h),k=k.transition(h).attr("opacity",kn).attr("transform",(function(t){return isFinite(t=b(t))?f(t+c):this.getAttribute("transform")})),E.attr("opacity",kn).attr("transform",(function(t){var e=this.parentNode.__axis;return f((e&&isFinite(e=e(t))?e:b(t))+c)}))),k.remove(),w.attr("d",t===xn||t===_n?a?"M"+s*a+","+m+"H"+c+"V"+g+"H"+s*a:"M"+c+","+m+"V"+g:a?"M"+m+","+s*a+"V"+c+"H"+g+"V"+s*a:"M"+m+","+c+"H"+g),x.attr("opacity",1).attr("transform",(function(t){return f(b(t)+c)})),S.attr(l+"2",s*o),O.attr(l,s*y).text(d),_.filter(An).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===_n?"start":t===xn?"end":"middle"),_.each((function(){this.__axis=b}))}return h.scale=function(t){return arguments.length?(e=t,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),h):n.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(u=+t,h):u},h.offset=function(t){return arguments.length?(c=+t,h):c},h}function Pn(t){return Mn(bn,t)}function Cn(t){return Mn(_n,t)}function jn(t){return Mn(wn,t)}function Nn(t){return Mn(xn,t)}var Ln={value:()=>{}};function Rn(){for(var t,e=0,n=arguments.length,r={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,r,i=new Array(n),o=0;oe?1:t>=e?0:NaN}Qn.prototype={constructor:Qn,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var ir="http://www.w3.org/1999/xhtml";const or={svg:"http://www.w3.org/2000/svg",xhtml:ir,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ar(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),or.hasOwnProperty(e)?{space:or[e],local:t}:t}function ur(t){return function(){this.removeAttribute(t)}}function cr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sr(t,e){return function(){this.setAttribute(t,e)}}function lr(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function fr(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function hr(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function pr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function dr(t){return function(){this.style.removeProperty(t)}}function yr(t,e,n){return function(){this.style.setProperty(t,e,n)}}function vr(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function mr(t,e){return t.style.getPropertyValue(e)||pr(t).getComputedStyle(t,null).getPropertyValue(e)}function gr(t){return function(){delete this[t]}}function br(t,e){return function(){this[t]=e}}function _r(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function wr(t){return t.trim().split(/^|\s+/)}function xr(t){return t.classList||new kr(t)}function kr(t){this._node=t,this._names=wr(t.getAttribute("class")||"")}function Er(t,e){for(var n=xr(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Gr=[null];function Xr(t,e){this._groups=t,this._parents=e}function Zr(){return new Xr([[document.documentElement]],Gr)}Xr.prototype=Zr.prototype={constructor:Xr,select:function(t){"function"!=typeof t&&(t=Un(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=w&&(w=_+1);!(b=m[w])&&++w=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=rr);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?dr:"function"==typeof e?vr:yr)(t,e,null==n?"":n)):mr(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?gr:"function"==typeof e?_r:br)(t,e)):this.node()[t]},classed:function(t,e){var n=wr(t+"");if(arguments.length<2){for(var r=xr(this.node()),i=-1,o=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=e?qr:Yr,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Oi(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Oi(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=yi.exec(t))?new Mi(e[1],e[2],e[3],1):(e=vi.exec(t))?new Mi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=mi.exec(t))?Oi(e[1],e[2],e[3],e[4]):(e=gi.exec(t))?Oi(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=bi.exec(t))?Ri(e[1],e[2]/100,e[3]/100,1):(e=_i.exec(t))?Ri(e[1],e[2]/100,e[3]/100,e[4]):wi.hasOwnProperty(t)?Si(wi[t]):"transparent"===t?new Mi(NaN,NaN,NaN,0):null}function Si(t){return new Mi(t>>16&255,t>>8&255,255&t,1)}function Oi(t,e,n,r){return r<=0&&(t=e=n=NaN),new Mi(t,e,n,r)}function Ti(t){return t instanceof ci||(t=Ei(t)),t?new Mi((t=t.rgb()).r,t.g,t.b,t.opacity):new Mi}function Ai(t,e,n,r){return 1===arguments.length?Ti(t):new Mi(t,e,n,null==r?1:r)}function Mi(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Pi(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}`}function Ci(){const t=ji(this.opacity);return`${1===t?"rgb(":"rgba("}${Ni(this.r)}, ${Ni(this.g)}, ${Ni(this.b)}${1===t?")":`, ${t})`}`}function ji(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ni(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Li(t){return((t=Ni(t))<16?"0":"")+t.toString(16)}function Ri(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Bi(t,e,n,r)}function Di(t){if(t instanceof Bi)return new Bi(t.h,t.s,t.l,t.opacity);if(t instanceof ci||(t=Ei(t)),!t)return new Bi;if(t instanceof Bi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n0&&c<1?0:a,new Bi(a,u,c,t.opacity)}function Ii(t,e,n,r){return 1===arguments.length?Di(t):new Bi(t,e,n,null==r?1:r)}function Bi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Fi(t){return(t=(t||0)%360)<0?t+360:t}function zi(t){return Math.max(0,Math.min(1,t||0))}function Ui(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function $i(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function Ki(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r=240?t-240:t+120,i,r),Ui(t,i,r),Ui(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Bi(Fi(this.h),zi(this.s),zi(this.l),ji(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ji(this.opacity);return`${1===t?"hsl(":"hsla("}${Fi(this.h)}, ${100*zi(this.s)}%, ${100*zi(this.l)}%${1===t?")":`, ${t})`}`}}));const qi=t=>()=>t;function Vi(t,e){return function(n){return t+n*e}}function Hi(t,e){var n=e-t;return n?Vi(t,n>180||n<-180?n-360*Math.round(n/360):n):qi(isNaN(t)?e:t)}function Wi(t,e){var n=e-t;return n?Vi(t,n):qi(isNaN(t)?e:t)}const Gi=function t(e){var n=function(t){return 1==(t=+t)?Wi:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):qi(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Ai(t)).r,(e=Ai(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Wi(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Xi(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),u=new Array(i);for(n=0;no&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:io(n,r)})),o=uo.lastIndex;return o=0&&e._call.call(void 0,t),e=e._next;--yo}function Mo(){_o=(bo=xo.now())+wo,yo=vo=0;try{Ao()}finally{yo=0,function(){for(var t,e,n=ho,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ho=e);po=t,Co(r)}(),_o=0}}function Po(){var t=xo.now(),e=t-bo;e>go&&(wo-=e,bo=t)}function Co(t){yo||(vo&&(vo=clearTimeout(vo)),t-_o>24?(t<1/0&&(vo=setTimeout(Mo,t-xo.now()-wo)),mo&&(mo=clearInterval(mo))):(mo||(bo=xo.now(),mo=setInterval(Po,go)),yo=1,ko(Mo)))}function jo(t,e,n){var r=new Oo;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Oo.prototype=To.prototype={constructor:Oo,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Eo():+n)+(null==e?0:+e),this._next||po===this||(po?po._next=this:ho=this,po=this),this._call=t,this._time=n,Co()},stop:function(){this._call&&(this._call=null,this._time=1/0,Co())}};var No=Fn("start","end","cancel","interrupt"),Lo=[],Ro=0,Do=1,Io=2,Bo=3,Fo=5,zo=6;function Uo(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(c){var s,l,f,h;if(n.state!==Do)return u();for(s in i)if((h=i[s]).name===n.name){if(h.state===Bo)return jo(o);4===h.state?(h.state=zo,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[s]):+sRo)throw new Error("too late; already scheduled");return n}function Ko(t,e){var n=Yo(t,e);if(n.state>Bo)throw new Error("too late; already running");return n}function Yo(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function qo(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>Io&&n.state180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:io(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,c),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:io(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,c),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:io(t,n)},{i:u-2,x:io(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var e,n=-1,r=c.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?$o:Ko;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=ar(t),r="transform"===n?Qo:na;return this.attrTween(t,"function"==typeof e?(n.local?ca:ua)(n,r,ea(this,"attr."+t,e)):null==e?(n.local?ia:ra)(n):(n.local?aa:oa)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=ar(t);return this.tween(n,(r.local?sa:la)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Zo:na;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=mr(this,t),a=(this.style.removeProperty(t),mr(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,va(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=mr(this,t),u=n(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=mr(this,t)),a===c?null:a===r&&c===i?o:(i=c,o=e(r=a,u))}}(t,r,ea(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,u="end."+a;return function(){var c=Ko(this,t),s=c.on,l=null==c.value[a]?o||(o=va(e)):void 0;s===n&&i===l||(r=(n=s).copy()).on(u,i=l),c.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=mr(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ea(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=Yo(this.node(),n).tween,o=0,a=i.length;oDo&&n.name===e)return new ga([[t]],Ta,e,+r);return null}const Ma=t=>()=>t;function Pa(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Ca(t){t.preventDefault(),t.stopImmediatePropagation()}var ja={name:"drag"},Na={name:"space"},La={name:"handle"},Ra={name:"center"};const{abs:Da,max:Ia,min:Ba}=Math;function Fa(t){return[+t[0],+t[1]]}function za(t){return[Fa(t[0]),Fa(t[1])]}var Ua={name:"x",handles:["w","e"].map(Ga),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},$a={name:"y",handles:["n","s"].map(Ga),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Ka={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ga),input:function(t){return null==t?null:za(t)},output:function(t){return t}},Ya={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},qa={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Va={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ha={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Wa={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ga(t){return{type:t}}function Xa(t){return!t.ctrlKey&&!t.button}function Za(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Qa(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ja(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function tu(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function eu(){return iu(Ua)}function nu(){return iu($a)}function ru(){return iu(Ka)}function iu(t){var e,n=Za,r=Xa,i=Qa,o=!0,a=Fn("start","brush","end"),u=6;function c(e){var n=e.property("__brush",y).selectAll(".overlay").data([Ga("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Ya.overlay).merge(n).each((function(){var t=Ja(this).extent;Jr(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([Ga("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Ya.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Ya[t.type]})),e.each(s).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function s(){var t=Jr(this),e=Ja(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-u/2:e[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-u/2:e[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){var r=t.__brush.emitter;return!r||n&&r.clean?new f(t,e,n):r}function f(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function h(n){if((!e||n.touches)&&r.apply(this,arguments)){var i,a,u,c,f,h,p,d,y,v,m,g=this,b=n.target.__data__.type,_="selection"===(o&&n.metaKey?b="overlay":b)?ja:o&&n.altKey?Ra:La,w=t===$a?null:Ha[b],x=t===Ua?null:Wa[b],k=Ja(g),E=k.extent,S=k.selection,O=E[0][0],T=E[0][1],A=E[1][0],M=E[1][1],P=0,C=0,j=w&&x&&o&&n.shiftKey,N=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=fo(t,g)).point0=t.slice(),t.identifier=e,t}));qo(g);var L=l(g,arguments,!0).beforestart();if("overlay"===b){S&&(y=!0);const e=[N[0],N[1]||N[0]];k.selection=S=[[i=t===$a?O:Ba(e[0][0],e[1][0]),u=t===Ua?T:Ba(e[0][1],e[1][1])],[f=t===$a?A:Ia(e[0][0],e[1][0]),p=t===Ua?M:Ia(e[0][1],e[1][1])]],N.length>1&&F(n)}else i=S[0][0],u=S[0][1],f=S[1][0],p=S[1][1];a=i,c=u,h=f,d=p;var R=Jr(g).attr("pointer-events","none"),D=R.selectAll(".overlay").attr("cursor",Ya[b]);if(n.touches)L.moved=B,L.ended=z;else{var I=Jr(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",z,!0);o&&I.on("keydown.brush",(function(t){switch(t.keyCode){case 16:j=w&&x;break;case 18:_===La&&(w&&(f=h-P*w,i=a+P*w),x&&(p=d-C*x,u=c+C*x),_=Ra,F(t));break;case 32:_!==La&&_!==Ra||(w<0?f=h-P:w>0&&(i=a-P),x<0?p=d-C:x>0&&(u=c-C),_=Na,D.attr("cursor",Ya.selection),F(t));break;default:return}Ca(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:j&&(v=m=j=!1,F(t));break;case 18:_===Ra&&(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(u=c),_=La,F(t));break;case 32:_===Na&&(t.altKey?(w&&(f=h-P*w,i=a+P*w),x&&(p=d-C*x,u=c+C*x),_=Ra):(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(u=c),_=La),D.attr("cursor",Ya[b]),F(t));break;default:return}Ca(t)}),!0),ii(n.view)}s.call(g),L.start(n,_.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of N)t.identifier===e.identifier&&(t.cur=fo(e,g));if(j&&!v&&!m&&1===N.length){const t=N[0];Da(t.cur[0]-t[0])>Da(t.cur[1]-t[1])?m=!0:v=!0}for(const t of N)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);y=!0,Ca(t),F(t)}function F(t){const e=N[0],n=e.point0;var r;switch(P=e[0]-n[0],C=e[1]-n[1],_){case Na:case ja:w&&(P=Ia(O-i,Ba(A-f,P)),a=i+P,h=f+P),x&&(C=Ia(T-u,Ba(M-p,C)),c=u+C,d=p+C);break;case La:N[1]?(w&&(a=Ia(O,Ba(A,N[0][0])),h=Ia(O,Ba(A,N[1][0])),w=1),x&&(c=Ia(T,Ba(M,N[0][1])),d=Ia(T,Ba(M,N[1][1])),x=1)):(w<0?(P=Ia(O-i,Ba(A-i,P)),a=i+P,h=f):w>0&&(P=Ia(O-f,Ba(A-f,P)),a=i,h=f+P),x<0?(C=Ia(T-u,Ba(M-u,C)),c=u+C,d=p):x>0&&(C=Ia(T-p,Ba(M-p,C)),c=u,d=p+C));break;case Ra:w&&(a=Ia(O,Ba(A,i-P*w)),h=Ia(O,Ba(A,f+P*w))),x&&(c=Ia(T,Ba(M,u-C*x)),d=Ia(T,Ba(M,p+C*x)))}ht+n))}function du(){return mu(!1,!1)}function yu(){return mu(!1,!0)}function vu(){return mu(!0,!1)}function mu(t,e){var n=0,r=null,i=null,o=null;function a(a){var u,c=a.length,s=new Array(c),l=pu(0,c),f=new Array(c*c),h=new Array(c),p=0;a=Float64Array.from({length:c*c},e?(t,e)=>a[e%c][e/c|0]:(t,e)=>a[e/c|0][e%c]);for(let e=0;er(s[t],s[e])));for(const n of l){const r=e;if(t){const t=pu(1+~c,c).filter((t=>t<0?a[~t*c+n]:a[n*c+t]));i&&t.sort(((t,e)=>i(t<0?-a[~t*c+n]:a[n*c+t],e<0?-a[~e*c+n]:a[n*c+e])));for(const r of t)r<0?(f[~r*c+n]||(f[~r*c+n]={source:null,target:null})).target={index:n,startAngle:e,endAngle:e+=a[~r*c+n]*p,value:a[~r*c+n]}:(f[n*c+r]||(f[n*c+r]={source:null,target:null})).source={index:n,startAngle:e,endAngle:e+=a[n*c+r]*p,value:a[n*c+r]};h[n]={index:n,startAngle:r,endAngle:e,value:s[n]}}else{const t=pu(0,c).filter((t=>a[n*c+t]||a[t*c+n]));i&&t.sort(((t,e)=>i(a[n*c+t],a[n*c+e])));for(const r of t){let t;if(n=0))throw new Error(`invalid digits: ${t}`);if(e>15)return xu;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e_u)if(Math.abs(l*u-c*s)>_u&&i){let h=n-o,p=r-a,d=u*u+c*c,y=h*h+p*p,v=Math.sqrt(d),m=Math.sqrt(f),g=i*Math.tan((gu-Math.acos((d+f-y)/(2*v*m)))/2),b=g/m,_=g/v;Math.abs(b-1)>_u&&this._append`L${t+b*s},${e+b*l}`,this._append`A${i},${i},0,0,${+(l*h>s*p)},${this._x1=t+_*u},${this._y1=e+_*c}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),u=n*Math.sin(r),c=t+a,s=e+u,l=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${s}`:(Math.abs(this._x1-c)>_u||Math.abs(this._y1-s)>_u)&&this._append`L${c},${s}`,n&&(f<0&&(f=f%bu+bu),f>wu?this._append`A${n},${n},0,1,${l},${t-a},${e-u}A${n},${n},0,1,${l},${this._x1=c},${this._y1=s}`:f>_u&&this._append`A${n},${n},0,${+(f>=gu)},${l},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Eu(){return new ku}function Su(t=3){return new ku(+t)}Eu.prototype=ku.prototype;var Ou=Array.prototype.slice;function Tu(t){return function(){return t}}function Au(t){return t.source}function Mu(t){return t.target}function Pu(t){return t.radius}function Cu(t){return t.startAngle}function ju(t){return t.endAngle}function Nu(){return 0}function Lu(){return 10}function Ru(t){var e=Au,n=Mu,r=Pu,i=Pu,o=Cu,a=ju,u=Nu,c=null;function s(){var s,l=e.apply(this,arguments),f=n.apply(this,arguments),h=u.apply(this,arguments)/2,p=Ou.call(arguments),d=+r.apply(this,(p[0]=l,p)),y=o.apply(this,p)-su,v=a.apply(this,p)-su,m=+i.apply(this,(p[0]=f,p)),g=o.apply(this,p)-su,b=a.apply(this,p)-su;if(c||(c=s=Eu()),h>hu&&(ou(v-y)>2*h+hu?v>y?(y+=h,v-=h):(y-=h,v+=h):y=v=(y+v)/2,ou(b-g)>2*h+hu?b>g?(g+=h,b-=h):(g-=h,b+=h):g=b=(g+b)/2),c.moveTo(d*au(y),d*uu(y)),c.arc(0,0,d,y,v),y!==g||v!==b)if(t){var _=m-+t.apply(this,arguments),w=(g+b)/2;c.quadraticCurveTo(0,0,_*au(g),_*uu(g)),c.lineTo(m*au(w),m*uu(w)),c.lineTo(_*au(b),_*uu(b))}else c.quadraticCurveTo(0,0,m*au(g),m*uu(g)),c.arc(0,0,m,g,b);if(c.quadraticCurveTo(0,0,d*au(y),d*uu(y)),c.closePath(),s)return c=null,s+""||null}return t&&(s.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:Tu(+e),s):t}),s.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:Tu(+t),s):r},s.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:Tu(+t),s):r},s.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:Tu(+t),s):i},s.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Tu(+t),s):o},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Tu(+t),s):a},s.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:Tu(+t),s):u},s.source=function(t){return arguments.length?(e=t,s):e},s.target=function(t){return arguments.length?(n=t,s):n},s.context=function(t){return arguments.length?(c=null==t?null:t,s):c},s}function Du(){return Ru()}function Iu(){return Ru(Lu)}const Bu=Math.PI/180,Fu=180/Math.PI,zu=.96422,Uu=1,$u=.82521,Ku=4/29,Yu=6/29,qu=3*Yu*Yu,Vu=Yu*Yu*Yu;function Hu(t){if(t instanceof Xu)return new Xu(t.l,t.a,t.b,t.opacity);if(t instanceof ic)return oc(t);t instanceof Mi||(t=Ti(t));var e,n,r=tc(t.r),i=tc(t.g),o=tc(t.b),a=Zu((.2225045*r+.7168786*i+.0606169*o)/Uu);return r===i&&i===o?e=n=a:(e=Zu((.4360747*r+.3850649*i+.1430804*o)/zu),n=Zu((.0139322*r+.0971045*i+.7141733*o)/$u)),new Xu(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Wu(t,e){return new Xu(t,0,0,null==e?1:e)}function Gu(t,e,n,r){return 1===arguments.length?Hu(t):new Xu(t,e,n,null==r?1:r)}function Xu(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Zu(t){return t>Vu?Math.pow(t,1/3):t/qu+Ku}function Qu(t){return t>Yu?t*t*t:qu*(t-Ku)}function Ju(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function tc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ec(t){if(t instanceof ic)return new ic(t.h,t.c,t.l,t.opacity);if(t instanceof Xu||(t=Hu(t)),0===t.a&&0===t.b)return new ic(NaN,0()=>t;function bc(t,e){for(var n,r=-1,i=e.length;++rr!=p>r&&n<(h-s)*(r-l)/(p-l)+s&&(i=-i)}return i}function wc(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function xc(){}var kc=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Ec(){var t=1,e=1,n=Ee,r=u;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(mc);else{const n=zt(t,Sc);for(e=_e(...ke(n[0],n[1],e),e);e[e.length-1]>=n[1];)e.pop();for(;e[1]o(t,e)))}function o(n,i){const o=null==i?NaN:+i;if(isNaN(o))throw new Error(`invalid value: ${i}`);var u=[],c=[];return function(n,r,i){var o,u,c,s,l,f,h=new Array,p=new Array;for(o=u=-1,s=Oc(n[0],r),kc[s<<1].forEach(d);++o=r,kc[l<<2].forEach(d);++o0?u.push([t]):c.push(t)})),c.forEach((function(t){for(var e,n=0,r=u.length;n0&&o0&&a=0&&o>=0))throw new Error("invalid size");return t=r,e=o,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?gc(vc.call(t)):gc(t),i):n},i.smooth=function(t){return arguments.length?(r=t?u:xc,i):r===u},i}function Sc(t){return isFinite(t)?t:NaN}function Oc(t,e){return null!=t&&+t>=e}function Tc(t){return null==t||isNaN(t=+t)?-1/0:t}function Ac(t,e,n,r){const i=r-e,o=n-e,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function Mc(t){return t[0]}function Pc(t){return t[1]}function Cc(){return 1}function jc(){var t=Mc,e=Pc,n=Cc,r=960,i=500,o=20,a=2,u=3*o,c=r+2*u>>a,s=i+2*u>>a,l=gc(20);function f(r){var i=new Float32Array(c*s),l=Math.pow(2,-a),f=-1;for(const o of r){var h=(t(o,++f,r)+u)*l,p=(e(o,f,r)+u)*l,d=+n(o,f,r);if(d&&h>=0&&h=0&&pt*r)))(e).map(((t,e)=>(t.value=+n[e],p(t))))}function p(t){return t.coordinates.forEach(d),t}function d(t){t.forEach(y)}function y(t){t.forEach(v)}function v(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function m(){return c=r+2*(u=3*o)>>a,s=i+2*u>>a,h}return h.contours=function(t){var e=f(t),n=Ec().size([c,s]),r=Math.pow(2,2*a),i=t=>{t=+t;var i=p(n.contour(e,t*r));return i.value=t,i};return Object.defineProperty(i,"max",{get:()=>Oe(e)/r}),i},h.x=function(e){return arguments.length?(t="function"==typeof e?e:gc(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:gc(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:gc(+t),h):n},h.size=function(t){if(!arguments.length)return[r,i];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))throw new Error("invalid size");return r=e,i=n,m()},h.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),m()},h.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?gc(vc.call(t)):gc(t),h):l},h.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*t*t+1)-1)/2,m()},h}const Nc=134217729;function Lc(t,e,n,r,i){let o,a,u,c,s=e[0],l=r[0],f=0,h=0;l>s==l>-s?(o=s,s=e[++f]):(o=l,l=r[++h]);let p=0;if(fs==l>-s?(a=s+o,u=o-(a-s),s=e[++f]):(a=l+o,u=o-(a-l),l=r[++h]),o=a,0!==u&&(i[p++]=u);fs==l>-s?(a=o+s,c=a-o,u=o-(a-c)+(s-c),s=e[++f]):(a=o+l,c=a-o,u=o-(a-c)+(l-c),l=r[++h]),o=a,0!==u&&(i[p++]=u);for(;f=33306690738754716e-32*s?c:-function(t,e,n,r,i,o,a){let u,c,s,l,f,h,p,d,y,v,m,g,b,_,w,x,k,E;const S=t-i,O=n-i,T=e-o,A=r-o;_=S*A,h=Nc*S,p=h-(h-S),d=S-p,h=Nc*A,y=h-(h-A),v=A-y,w=d*v-(_-p*y-d*y-p*v),x=T*O,h=Nc*T,p=h-(h-T),d=T-p,h=Nc*O,y=h-(h-O),v=O-y,k=d*v-(x-p*y-d*y-p*v),m=w-k,f=w-m,Dc[0]=w-(m+f)+(f-k),g=_+m,f=g-_,b=_-(g-f)+(m-f),m=b-x,f=b-m,Dc[1]=b-(m+f)+(f-x),E=g+m,f=E-g,Dc[2]=g-(E-f)+(m-f),Dc[3]=E;let M=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,Dc),P=22204460492503146e-32*a;if(M>=P||-M>=P)return M;if(f=t-S,u=t-(S+f)+(f-i),f=n-O,s=n-(O+f)+(f-i),f=e-T,c=e-(T+f)+(f-o),f=r-A,l=r-(A+f)+(f-o),0===u&&0===c&&0===s&&0===l)return M;if(P=11093356479670487e-47*a+33306690738754706e-32*Math.abs(M),M+=S*l+A*u-(T*s+O*c),M>=P||-M>=P)return M;_=u*A,h=Nc*u,p=h-(h-u),d=u-p,h=Nc*A,y=h-(h-A),v=A-y,w=d*v-(_-p*y-d*y-p*v),x=c*O,h=Nc*c,p=h-(h-c),d=c-p,h=Nc*O,y=h-(h-O),v=O-y,k=d*v-(x-p*y-d*y-p*v),m=w-k,f=w-m,zc[0]=w-(m+f)+(f-k),g=_+m,f=g-_,b=_-(g-f)+(m-f),m=b-x,f=b-m,zc[1]=b-(m+f)+(f-x),E=g+m,f=E-g,zc[2]=g-(E-f)+(m-f),zc[3]=E;const C=Lc(4,Dc,4,zc,Ic);_=S*l,h=Nc*S,p=h-(h-S),d=S-p,h=Nc*l,y=h-(h-l),v=l-y,w=d*v-(_-p*y-d*y-p*v),x=T*s,h=Nc*T,p=h-(h-T),d=T-p,h=Nc*s,y=h-(h-s),v=s-y,k=d*v-(x-p*y-d*y-p*v),m=w-k,f=w-m,zc[0]=w-(m+f)+(f-k),g=_+m,f=g-_,b=_-(g-f)+(m-f),m=b-x,f=b-m,zc[1]=b-(m+f)+(f-x),E=g+m,f=E-g,zc[2]=g-(E-f)+(m-f),zc[3]=E;const j=Lc(C,Ic,4,zc,Bc);_=u*l,h=Nc*u,p=h-(h-u),d=u-p,h=Nc*l,y=h-(h-l),v=l-y,w=d*v-(_-p*y-d*y-p*v),x=c*s,h=Nc*c,p=h-(h-c),d=c-p,h=Nc*s,y=h-(h-s),v=s-y,k=d*v-(x-p*y-d*y-p*v),m=w-k,f=w-m,zc[0]=w-(m+f)+(f-k),g=_+m,f=g-_,b=_-(g-f)+(m-f),m=b-x,f=b-m,zc[1]=b-(m+f)+(f-x),E=g+m,f=E-g,zc[2]=g-(E-f)+(m-f),zc[3]=E;const N=Lc(j,Bc,4,zc,Fc);return Fc[N-1]}(t,e,n,r,i,o,s)}Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(8),Rc(8),Rc(8),Rc(4),Rc(8),Rc(8),Rc(8),Rc(12),Rc(192),Rc(192),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(8),Rc(4),Rc(4),Rc(4),Rc(8),Rc(16),Rc(16),Rc(16),Rc(32),Rc(32),Rc(48),Rc(64),Rc(1152),Rc(1152),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(4),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(24),Rc(1152),Rc(1152),Rc(1152),Rc(1152),Rc(1152),Rc(2304),Rc(2304),Rc(3456),Rc(5760),Rc(8),Rc(8),Rc(8),Rc(16),Rc(24),Rc(48),Rc(48),Rc(96),Rc(192),Rc(384),Rc(384),Rc(384),Rc(768),Rc(96),Rc(96),Rc(96),Rc(1152);const $c=Math.pow(2,-52),Kc=new Uint32Array(512);class Yc{static from(t,e=Xc,n=Zc){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,c=-1/0,s=-1/0;for(let e=0;ec&&(c=n),r>s&&(s=r),this._ids[e]=e}const l=(a+c)/2,f=(u+s)/2;let h,p,d;for(let e=0,n=1/0;e0&&(p=e,n=r)}let m=t[2*p],g=t[2*p+1],b=1/0;for(let e=0;er&&(e[n++]=i,r=o)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Uc(y,v,m,g,_,w)<0){const t=p,e=m,n=g;p=d,m=_,g=w,d=t,_=e,w=n}const x=function(t,e,n,r,i,o){const a=n-t,u=r-e,c=i-t,s=o-e,l=a*a+u*u,f=c*c+s*s,h=.5/(a*s-u*c);return{x:t+(s*l-u*f)*h,y:e+(a*f-c*l)*h}}(y,v,m,g,_,w);this._cx=x.x,this._cy=x.y;for(let e=0;e0&&Math.abs(s-o)<=$c&&Math.abs(l-a)<=$c)continue;if(o=s,a=l,c===h||c===p||c===d)continue;let f=0;for(let t=0,e=this._hashKey(s,l);t=0;)if(v=y,v===f){v=-1;break}if(-1===v)continue;let m=this._addTriangle(v,c,n[v],-1,-1,r[v]);r[c]=this._legalize(m+2),r[v]=m,k++;let g=n[v];for(;y=n[g],Uc(s,l,t[2*g],t[2*g+1],t[2*y],t[2*y+1])<0;)m=this._addTriangle(g,c,y,r[c],-1,r[g]),r[c]=this._legalize(m+2),n[g]=g,k--,g=y;if(v===f)for(;y=e[v],Uc(s,l,t[2*y],t[2*y+1],t[2*v],t[2*v+1])<0;)m=this._addTriangle(y,c,v,-1,r[v],r[y]),this._legalize(m+2),r[y]=m,n[v]=v,k--,v=y;this._hullStart=e[c]=v,n[v]=e[g]=c,n[c]=g,i[this._hashKey(s,l)]=c,i[this._hashKey(t[2*v],t[2*v+1])]=v}this.hull=new Uint32Array(k);for(let t=0,e=this._hullStart;t0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=Kc[--i];continue}const c=a-a%3,s=u+(t+1)%3,l=c+(a+2)%3,f=e[o],h=e[t],p=e[s],d=e[l];if(Vc(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*d],r[2*d+1])){e[t]=d,e[a]=f;const r=n[l];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===l){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,l);const u=c+(a+1)%3;i=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;Gc(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Gc(t,n,r),e[t[i]]>e[t[r]]&&Gc(t,i,r),e[t[n]]>e[t[i]]&&Gc(t,n,i);const a=t[i],u=e[a];for(;;){do{i++}while(e[t[i]]u);if(o=o-n?(Wc(t,e,i,r),Wc(t,e,n,o-1)):(Wc(t,e,n,o-1),Wc(t,e,i,r))}}function Gc(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Xc(t){return t[0]}function Zc(t){return t[1]}const Qc=1e-6;class Jc{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Qc||Math.abs(this._y1-i)>Qc)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class ts{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class es{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,u,c=0,s=0,l=n.length;c1;)i-=2;for(let t=2;t0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new es(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:c}=this;if(-1===r[t]||!c.length)return(t+1)%(c.length>>1);let s=t,l=rs(e-c[2*t],2)+rs(n-c[2*t+1],2);const f=r[t];let h=f;do{let r=u[h];const f=rs(e-c[2*r],2)+rs(n-c[2*r+1],2);if(f()=>t;function ss(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:u,dx:c,dy:s,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:s,enumerable:!0,configurable:!0},_:{value:l}})}function ls(t){return!t.ctrlKey&&!t.button}function fs(){return this.parentNode}function hs(t,e){return null==e?{x:t.x,y:t.y}:e}function ps(){return navigator.maxTouchPoints||"ontouchstart"in this}function ds(){var t,e,n,r,i=ls,o=fs,a=hs,u=ps,c={},s=Fn("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",p).filter(u).on("touchstart.drag",v).on("touchmove.drag",m,ti).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,u){if(!r&&i.call(this,a,u)){var c=b(this,o.call(this,a,u),a,u,"mouse");c&&(Jr(a.view).on("mousemove.drag",d,ei).on("mouseup.drag",y,ei),ii(a.view),ni(a),n=!1,t=a.clientX,e=a.clientY,c("start",a))}}function d(r){if(ri(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}c.mouse("drag",r)}function y(t){Jr(t.view).on("mousemove.drag mouseup.drag",null),oi(t.view,n),ri(t),c.mouse("end",t)}function v(t,e){if(i.call(this,t,e)){var n,r,a=t.changedTouches,u=o.call(this,t,e),c=a.length;for(n=0;n=o?c=!0:(r=t.charCodeAt(a++))===gs?s=!0:r===bs&&(s=!0,t.charCodeAt(a)===gs&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+xs(e,6):xs(e,4))+"-"+xs(t.getUTCMonth()+1,2)+"-"+xs(t.getUTCDate(),2)+(o?"T"+xs(n,2)+":"+xs(r,2)+":"+xs(i,2)+"."+xs(o,3)+"Z":i?"T"+xs(n,2)+":"+xs(r,2)+":"+xs(i,2)+"Z":r||n?"T"+xs(n,2)+":"+xs(r,2)+"Z":"")}(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=_s(t);return function(r,i){return e(n(r),i,t)}}(t,e):_s(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=ws(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=ws(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var Es=ks(","),Ss=Es.parse,Os=Es.parseRows,Ts=Es.format,As=Es.formatBody,Ms=Es.formatRows,Ps=Es.formatRow,Cs=Es.formatValue,js=ks("\t"),Ns=js.parse,Ls=js.parseRows,Rs=js.format,Ds=js.formatBody,Is=js.formatRows,Bs=js.formatRow,Fs=js.formatValue;function zs(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;Us&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const Us=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),$s=t=>+t;function Ks(t){return t*t}function Ys(t){return t*(2-t)}function qs(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var Vs=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),Hs=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Ws=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),Gs=Math.PI,Xs=Gs/2;function Zs(t){return 1==+t?1:1-Math.cos(t*Xs)}function Qs(t){return Math.sin(t*Xs)}function Js(t){return(1-Math.cos(Gs*t))/2}function tl(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function el(t){return tl(1-+t)}function nl(t){return 1-tl(t)}function rl(t){return((t*=2)<=1?tl(1-t):2-tl(t-1))/2}function il(t){return 1-Math.sqrt(1-t*t)}function ol(t){return Math.sqrt(1- --t*t)}function al(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var ul=4/11,cl=6/11,sl=8/11,ll=3/4,fl=9/11,hl=10/11,pl=15/16,dl=21/22,yl=63/64,vl=1/ul/ul;function ml(t){return 1-gl(1-t)}function gl(t){return(t=+t)Nl(e,n).then((e=>(new DOMParser).parseFromString(e,t)))}const $l=Ul("application/xml");var Kl=Ul("text/html"),Yl=Ul("image/svg+xml");function ql(t,e){var n,r=1;function i(){var i,o,a=n.length,u=0,c=0;for(i=0;i=(o=(y+m)/2))?y=o:m=o,(l=n>=(a=(v+g)/2))?v=a:g=a,i=p,!(p=p[f=l<<1|s]))return i[f]=d,t;if(u=+t._x.call(null,p.data),c=+t._y.call(null,p.data),e===u&&n===c)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(s=e>=(o=(y+m)/2))?y=o:m=o,(l=n>=(a=(v+g)/2))?v=a:g=a}while((f=l<<1|s)==(h=(c>=a)<<1|u>=o));return i[h]=p,i[f]=d,t}function Hl(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Wl(t){return t[0]}function Gl(t){return t[1]}function Xl(t,e,n){var r=new Zl(null==e?Wl:e,null==n?Gl:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Zl(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Ql(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Jl=Xl.prototype=Zl.prototype;function tf(t){return function(){return t}}function ef(t){return 1e-6*(t()-.5)}function nf(t){return t.x+t.vx}function rf(t){return t.y+t.vy}function of(t){var e,n,r,i=1,o=1;function a(){for(var t,a,c,s,l,f,h,p=e.length,d=0;ds+d||ol+d||ac.index){var y=s-u.x-u.vx,v=l-u.y-u.vy,m=y*y+v*v;mt.r&&(t.r=t[e].r)}function c(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r[u(t,e,r),t])));for(a=0,i=new Array(s);al&&(l=r),if&&(f=i));if(c>l||s>f)return this;for(this.cover(c,s).cover(l,f),n=0;nt||t>=i||r>e||e>=o;)switch(u=(eh||(o=c.y0)>p||(a=c.x1)=m)<<1|t>=v)&&(c=d[d.length-1],d[d.length-1]=d[d.length-1-s],d[d.length-1-s]=c)}else{var g=t-+this._x.call(null,y.data),b=e-+this._y.call(null,y.data),_=g*g+b*b;if(_=(u=(d+v)/2))?d=u:v=u,(l=a>=(c=(y+m)/2))?y=c:m=c,e=p,!(p=p[f=l<<1|s]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[h]=p:this._root=p),this):(this._root=i,this)},Jl.removeAll=function(t){for(var e=0,n=t.length;e(t=(sf*t+lf)%ff)/ff}();function f(){h(),s.call("tick",e),n1?(null==n?u.delete(t):u.set(t,d(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,u,c,s=0,l=t.length;for(null==r?r=1/0:r*=r,s=0;s1?(s.on(t,n),e):s.on(t)}}}function mf(){var t,e,n,r,i,o=tf(-30),a=1,u=1/0,c=.81;function s(n){var i,o=t.length,a=Xl(t,hf,pf).visitAfter(f);for(r=n,i=0;i=u)){(t.data!==e||t.next)&&(0===f&&(d+=(f=ef(n))*f),0===h&&(d+=(h=ef(n))*h),d1?r[0]+r.slice(2):r,+t.slice(n+1)]}function xf(t){return(t=wf(Math.abs(t)))?t[1]:NaN}var kf,Ef=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Sf(t){if(!(e=Ef.exec(t)))throw new Error("invalid format: "+t);var e;return new Of({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Of(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Tf(t,e){var n=wf(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Sf.prototype=Of.prototype,Of.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Af={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Tf(100*t,e),r:Tf,s:function(t,e){var n=wf(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(kf=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+wf(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Mf(t){return t}var Pf,Cf,jf,Nf=Array.prototype.map,Lf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rf(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Mf:(e=Nf.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Mf:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Nf.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",s=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Sf(t)).fill,n=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,y=t.comma,v=t.precision,m=t.trim,g=t.type;"n"===g?(y=!0,g="g"):Af[g]||(void 0===v&&(v=12),m=!0,g="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",_="$"===h?o:/[%p]/.test(g)?c:"",w=Af[g],x=/[defgprs%]/.test(g);function k(t){var i,o,c,h=b,k=_;if("c"===g)k=w(t)+k,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:w(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==f&&(E=!1),h=(E?"("===f?f:s:"-"===f||"("===f?"":f)+h,k=("s"===g?Lf[8+kf/3]:"")+k+(E&&"("===f?")":""),x)for(i=-1,o=t.length;++i(c=t.charCodeAt(i))||c>57){k=(46===c?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}y&&!p&&(t=r(t,1/0));var S=h.length+t.length+k.length,O=S>1)+h+t+k+O.slice(S);break;default:t=O+h+t+k}return u(t)}return v=void 0===v?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=Sf(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(xf(e)/3))),i=Math.pow(10,-r),o=Lf[8+r/3];return function(t){return n(i*t)+o}}}}function Df(t){return Pf=Rf(t),Cf=Pf.format,jf=Pf.formatPrefix,Pf}function If(t){return Math.max(0,-xf(Math.abs(t)))}function Bf(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(xf(e)/3)))-xf(Math.abs(t)))}function Ff(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,xf(e)-xf(t))+1}Df({thousands:",",grouping:[3],currency:["$",""]});var zf=1e-6,Uf=1e-12,$f=Math.PI,Kf=$f/2,Yf=$f/4,qf=2*$f,Vf=180/$f,Hf=$f/180,Wf=Math.abs,Gf=Math.atan,Xf=Math.atan2,Zf=Math.cos,Qf=Math.ceil,Jf=Math.exp,th=(Math.floor,Math.hypot),eh=Math.log,nh=Math.pow,rh=Math.sin,ih=Math.sign||function(t){return t>0?1:t<0?-1:0},oh=Math.sqrt,ah=Math.tan;function uh(t){return t>1?0:t<-1?$f:Math.acos(t)}function ch(t){return t>1?Kf:t<-1?-Kf:Math.asin(t)}function sh(t){return(t=rh(t/2))*t}function lh(){}function fh(t,e){t&&ph.hasOwnProperty(t.type)&&ph[t.type](t,e)}var hh={Feature:function(t,e){fh(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Zf(e=(e*=Hf)/2+Yf),a=rh(e),u=wh*a,c=_h*o+u*Zf(i),s=u*r*rh(i);Nh.add(Xf(s,c)),bh=t,_h=o,wh=a}function zh(t){return Lh=new Ut,vh(t,Rh),2*Lh}function Uh(t){return[Xf(t[1],t[0]),ch(t[2])]}function $h(t){var e=t[0],n=t[1],r=Zf(n);return[r*Zf(e),r*rh(e),rh(n)]}function Kh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Yh(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function qh(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Vh(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Hh(t){var e=oh(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Wh,Gh,Xh,Zh,Qh,Jh,tp,ep,np,rp,ip,op,ap,up,cp,sp,lp={point:fp,lineStart:pp,lineEnd:dp,polygonStart:function(){lp.point=yp,lp.lineStart=vp,lp.lineEnd=mp,Ph=new Ut,Rh.polygonStart()},polygonEnd:function(){Rh.polygonEnd(),lp.point=fp,lp.lineStart=pp,lp.lineEnd=dp,Nh<0?(xh=-(Eh=180),kh=-(Sh=90)):Ph>zf?Sh=90:Ph<-zf&&(kh=-90),jh[0]=xh,jh[1]=Eh},sphere:function(){xh=-(Eh=180),kh=-(Sh=90)}};function fp(t,e){Ch.push(jh=[xh=t,Eh=t]),eSh&&(Sh=e)}function hp(t,e){var n=$h([t*Hf,e*Hf]);if(Mh){var r=Yh(Mh,n),i=Yh([r[1],-r[0],0],r);Hh(i),i=Uh(i);var o,a=t-Oh,u=a>0?1:-1,c=i[0]*Vf*u,s=Wf(a)>180;s^(u*OhSh&&(Sh=o):s^(u*Oh<(c=(c+360)%360-180)&&cSh&&(Sh=e)),s?tgp(xh,Eh)&&(Eh=t):gp(t,Eh)>gp(xh,Eh)&&(xh=t):Eh>=xh?(tEh&&(Eh=t)):t>Oh?gp(xh,t)>gp(xh,Eh)&&(Eh=t):gp(t,Eh)>gp(xh,Eh)&&(xh=t)}else Ch.push(jh=[xh=t,Eh=t]);eSh&&(Sh=e),Mh=n,Oh=t}function pp(){lp.point=hp}function dp(){jh[0]=xh,jh[1]=Eh,lp.point=fp,Mh=null}function yp(t,e){if(Mh){var n=t-Oh;Ph.add(Wf(n)>180?n+(n>0?360:-360):n)}else Th=t,Ah=e;Rh.point(t,e),hp(t,e)}function vp(){Rh.lineStart()}function mp(){yp(Th,Ah),Rh.lineEnd(),Wf(Ph)>zf&&(xh=-(Eh=180)),jh[0]=xh,jh[1]=Eh,Mh=null}function gp(t,e){return(e-=t)<0?e+360:e}function bp(t,e){return t[0]-e[0]}function _p(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:egp(r[0],r[1])&&(r[1]=i[1]),gp(i[0],r[1])>gp(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(u=gp(r[1],i[0]))>a&&(a=u,xh=i[0],Eh=r[1])}return Ch=jh=null,xh===1/0||kh===1/0?[[NaN,NaN],[NaN,NaN]]:[[xh,kh],[Eh,Sh]]}var xp={sphere:lh,point:kp,lineStart:Sp,lineEnd:Ap,polygonStart:function(){xp.lineStart=Mp,xp.lineEnd=Pp},polygonEnd:function(){xp.lineStart=Sp,xp.lineEnd=Ap}};function kp(t,e){t*=Hf;var n=Zf(e*=Hf);Ep(n*Zf(t),n*rh(t),rh(e))}function Ep(t,e,n){++Wh,Xh+=(t-Xh)/Wh,Zh+=(e-Zh)/Wh,Qh+=(n-Qh)/Wh}function Sp(){xp.point=Op}function Op(t,e){t*=Hf;var n=Zf(e*=Hf);up=n*Zf(t),cp=n*rh(t),sp=rh(e),xp.point=Tp,Ep(up,cp,sp)}function Tp(t,e){t*=Hf;var n=Zf(e*=Hf),r=n*Zf(t),i=n*rh(t),o=rh(e),a=Xf(oh((a=cp*o-sp*i)*a+(a=sp*r-up*o)*a+(a=up*i-cp*r)*a),up*r+cp*i+sp*o);Gh+=a,Jh+=a*(up+(up=r)),tp+=a*(cp+(cp=i)),ep+=a*(sp+(sp=o)),Ep(up,cp,sp)}function Ap(){xp.point=kp}function Mp(){xp.point=Cp}function Pp(){jp(op,ap),xp.point=kp}function Cp(t,e){op=t,ap=e,t*=Hf,e*=Hf,xp.point=jp;var n=Zf(e);up=n*Zf(t),cp=n*rh(t),sp=rh(e),Ep(up,cp,sp)}function jp(t,e){t*=Hf;var n=Zf(e*=Hf),r=n*Zf(t),i=n*rh(t),o=rh(e),a=cp*o-sp*i,u=sp*r-up*o,c=up*i-cp*r,s=th(a,u,c),l=ch(s),f=s&&-l/s;np.add(f*a),rp.add(f*u),ip.add(f*c),Gh+=l,Jh+=l*(up+(up=r)),tp+=l*(cp+(cp=i)),ep+=l*(sp+(sp=o)),Ep(up,cp,sp)}function Np(t){Wh=Gh=Xh=Zh=Qh=Jh=tp=ep=0,np=new Ut,rp=new Ut,ip=new Ut,vh(t,xp);var e=+np,n=+rp,r=+ip,i=th(e,n,r);return i$f&&(t-=Math.round(t/qf)*qf),[t,e]}function Ip(t,e,n){return(t%=qf)?e||n?Rp(Fp(t),zp(e,n)):Fp(t):e||n?zp(e,n):Dp}function Bp(t){return function(e,n){return Wf(e+=t)>$f&&(e-=Math.round(e/qf)*qf),[e,n]}}function Fp(t){var e=Bp(t);return e.invert=Bp(-t),e}function zp(t,e){var n=Zf(t),r=rh(t),i=Zf(e),o=rh(e);function a(t,e){var a=Zf(e),u=Zf(t)*a,c=rh(t)*a,s=rh(e),l=s*n+u*r;return[Xf(c*i-l*o,u*n-s*r),ch(l*i+c*o)]}return a.invert=function(t,e){var a=Zf(e),u=Zf(t)*a,c=rh(t)*a,s=rh(e),l=s*i-c*o;return[Xf(c*i+s*o,u*n+l*r),ch(l*n-u*r)]},a}function Up(t){function e(e){return(e=t(e[0]*Hf,e[1]*Hf))[0]*=Vf,e[1]*=Vf,e}return t=Ip(t[0]*Hf,t[1]*Hf,t.length>2?t[2]*Hf:0),e.invert=function(e){return(e=t.invert(e[0]*Hf,e[1]*Hf))[0]*=Vf,e[1]*=Vf,e},e}function $p(t,e,n,r,i,o){if(n){var a=Zf(e),u=rh(e),c=r*n;null==i?(i=e+r*qf,o=e-c/2):(i=Kp(a,i),o=Kp(a,o),(r>0?io)&&(i+=r*qf));for(var s,l=i;r>0?l>o:l1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Vp(t,e){return Wf(t[0]-e[0])=0;--o)i.point((l=s[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}s=(h=h.o).z,p=!p}while(!h.v);i.lineEnd()}}}function Gp(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,O=S*E,T=O>$f,A=v*x;if(c.add(Xf(A*S*rh(O),m*k+A*Zf(O))),a+=T?E+S*qf:E,T^d>=n^_>=n){var M=Yh($h(p),$h(b));Hh(M);var P=Yh(o,M);Hh(P);var C=(T^E>=0?-1:1)*ch(P[2]);(r>C||r===C&&(M[0]||M[1]))&&(u+=T^E>=0?1:-1)}}return(a<-zf||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Jp))}return h}}function Jp(t){return t.length>1}function td(t,e){return((t=t.x)[0]<0?t[1]-Kf-zf:Kf-t[1])-((e=e.x)[0]<0?e[1]-Kf-zf:Kf-e[1])}Dp.invert=Dp;const ed=Qp((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var u=o>0?$f:-$f,c=Wf(o-n);Wf(c-$f)0?Kf:-Kf),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),e=0):i!==u&&c>=$f&&(Wf(n-i)zf?Gf((rh(e)*(o=Zf(r))*rh(n)-rh(r)*(i=Zf(e))*rh(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=o,r=a),i=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Kf,r.point(-$f,i),r.point(0,i),r.point($f,i),r.point($f,0),r.point($f,-i),r.point(0,-i),r.point(-$f,-i),r.point(-$f,0),r.point(-$f,i);else if(Wf(t[0]-e[0])>zf){var o=t[0]0,i=Wf(e)>zf;function o(t,n){return Zf(t)*Zf(n)>e}function a(t,n,r){var i=[1,0,0],o=Yh($h(t),$h(n)),a=Kh(o,o),u=o[0],c=a-u*u;if(!c)return!r&&t;var s=e*a/c,l=-e*u/c,f=Yh(i,o),h=Vh(i,s);qh(h,Vh(o,l));var p=f,d=Kh(h,p),y=Kh(p,p),v=d*d-y*(Kh(h,h)-1);if(!(v<0)){var m=oh(v),g=Vh(p,(-d-m)/y);if(qh(g,h),g=Uh(g),!r)return g;var b,_=t[0],w=n[0],x=t[1],k=n[1];w<_&&(b=_,_=w,w=b);var E=w-_,S=Wf(E-$f)0^g[1]<(Wf(g[0]-_)$f^(_<=g[0]&&g[0]<=w)){var O=Vh(p,(-d+m)/y);return qh(O,h),[g,Uh(O)]}}}function u(e,n){var i=r?t:$f-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Qp(o,(function(t){var e,n,c,s,l;return{lineStart:function(){s=c=!1,l=1},point:function(f,h){var p,d=[f,h],y=o(f,h),v=r?y?0:u(f,h):y?u(f+(f<0?$f:-$f),h):0;if(!e&&(s=c=y)&&t.lineStart(),y!==c&&(!(p=a(e,d))||Vp(e,p)||Vp(d,p))&&(d[2]=1),y!==c)l=0,y?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(i&&e&&r^y){var m;v&n||!(m=a(d,e,!0))||(l=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!y||e&&Vp(e,d)||t.point(d[0],d[1]),e=d,c=y,n=v},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return l|(s&&c)<<1}}}),(function(e,r,i,o){$p(o,t,n,i,e,r)}),r?[0,-t]:[-$f,t-$f])}var rd,id,od,ad,ud=1e9,cd=-ud;function sd(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,u,s){var l=0,f=0;if(null==i||(l=a(i,u))!==(f=a(o,u))||c(i,o)<0^u>0)do{s.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+u+4)%4)!==f);else s.point(o[0],o[1])}function a(r,i){return Wf(r[0]-t)0?0:3:Wf(r[0]-n)0?2:1:Wf(r[1]-e)0?1:0:i>0?3:2}function u(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,s,l,f,h,p,d,y,v,m,g,b=a,_=qp(),w={point:x,lineStart:function(){w.point=k,s&&s.push(l=[]),m=!0,v=!1,d=y=NaN},lineEnd:function(){c&&(k(f,h),p&&v&&_.rejoin(),c.push(_.result())),w.point=x,v&&b.lineEnd()},polygonStart:function(){b=_,c=[],s=[],g=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=s.length;nr&&(h-o)*(r-a)>(p-a)*(t-o)&&++e:p<=r&&(h-o)*(r-a)<(p-a)*(t-o)&&--e;return e}(),n=g&&e,i=(c=Ue(c)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Wp(c,u,e,o,a),a.polygonEnd()),b=a,c=s=l=null}};function x(t,e){i(t,e)&&b.point(t,e)}function k(o,a){var u=i(o,a);if(s&&l.push([o,a]),m)f=o,h=a,p=u,m=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&v)b.point(o,a);else{var c=[d=Math.max(cd,Math.min(ud,d)),y=Math.max(cd,Math.min(ud,y))],_=[o=Math.max(cd,Math.min(ud,o)),a=Math.max(cd,Math.min(ud,a))];!function(t,e,n,r,i,o){var a,u=t[0],c=t[1],s=0,l=1,f=e[0]-u,h=e[1]-c;if(a=n-u,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>l)return;a>s&&(s=a)}if(a=i-u,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>s&&(s=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>l)return;a>s&&(s=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>s&&(s=a)}else if(h>0){if(a0&&(t[0]=u+s*f,t[1]=c+s*h),l<1&&(e[0]=u+l*f,e[1]=c+l*h),!0}}}}}(c,_,t,e,n,r)?u&&(b.lineStart(),b.point(o,a),g=!1):(v||(b.lineStart(),b.point(c[0],c[1])),b.point(_[0],_[1]),u||b.lineEnd(),g=!1)}d=o,y=a,v=u}return w}}function ld(){var t,e,n,r=0,i=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=sd(r,i,o,a)(e=n)},extent:function(u){return arguments.length?(r=+u[0][0],i=+u[0][1],o=+u[1][0],a=+u[1][1],t=e=null,n):[[r,i],[o,a]]}}}var fd={sphere:lh,point:lh,lineStart:function(){fd.point=pd,fd.lineEnd=hd},lineEnd:lh,polygonStart:lh,polygonEnd:lh};function hd(){fd.point=fd.lineEnd=lh}function pd(t,e){id=t*=Hf,od=rh(e*=Hf),ad=Zf(e),fd.point=dd}function dd(t,e){t*=Hf;var n=rh(e*=Hf),r=Zf(e),i=Wf(t-id),o=Zf(i),a=r*rh(i),u=ad*n-od*r*o,c=od*n+ad*r*o;rd.add(Xf(oh(a*a+u*u),c)),id=t,od=n,ad=r}function yd(t){return rd=new Ut,vh(t,fd),+rd}var vd=[null,null],md={type:"LineString",coordinates:vd};function gd(t,e){return vd[0]=t,vd[1]=e,yd(md)}var bd={Feature:function(t,e){return wd(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=gd(t[o],t[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))zf})).map(c)).concat(qe(Qf(o/p)*p,i,p).filter((function(t){return Wf(t%y)>zf})).map(s))}return m.lines=function(){return g().map((function(t){return{type:"LineString",coordinates:t}}))},m.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(n).reverse().slice(1),f(u).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],u=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),u>a&&(t=u,u=a,a=t),m.precision(v)):[[r,u],[n,a]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),m.precision(v)):[[e,o],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(d=+t[0],y=+t[1],m):[d,y]},m.stepMinor=function(t){return arguments.length?(h=+t[0],p=+t[1],m):[h,p]},m.precision=function(h){return arguments.length?(v=+h,c=Ad(o,i,90),s=Md(e,t,v),l=Ad(u,a,90),f=Md(r,n,v),m):v},m.extentMajor([[-180,-90+zf],[180,90-zf]]).extentMinor([[-180,-80-zf],[180,80+zf]])}function Cd(){return Pd()()}function jd(t,e){var n=t[0]*Hf,r=t[1]*Hf,i=e[0]*Hf,o=e[1]*Hf,a=Zf(r),u=rh(r),c=Zf(o),s=rh(o),l=a*Zf(n),f=a*rh(n),h=c*Zf(i),p=c*rh(i),d=2*ch(oh(sh(o-r)+a*c*sh(i-n))),y=rh(d),v=d?function(t){var e=rh(t*=d)/y,n=rh(d-t)/y,r=n*l+e*h,i=n*f+e*p,o=n*u+e*s;return[Xf(i,r)*Vf,Xf(o,oh(r*r+i*i))*Vf]}:function(){return[n*Vf,r*Vf]};return v.distance=d,v}const Nd=t=>t;var Ld,Rd,Dd,Id,Bd=new Ut,Fd=new Ut,zd={point:lh,lineStart:lh,lineEnd:lh,polygonStart:function(){zd.lineStart=Ud,zd.lineEnd=Yd},polygonEnd:function(){zd.lineStart=zd.lineEnd=zd.point=lh,Bd.add(Wf(Fd)),Fd=new Ut},result:function(){var t=Bd/2;return Bd=new Ut,t}};function Ud(){zd.point=$d}function $d(t,e){zd.point=Kd,Ld=Dd=t,Rd=Id=e}function Kd(t,e){Fd.add(Id*t-Dd*e),Dd=t,Id=e}function Yd(){Kd(Ld,Rd)}const qd=zd;var Vd=1/0,Hd=Vd,Wd=-Vd,Gd=Wd,Xd={point:function(t,e){tWd&&(Wd=t),eGd&&(Gd=e)},lineStart:lh,lineEnd:lh,polygonStart:lh,polygonEnd:lh,result:function(){var t=[[Vd,Hd],[Wd,Gd]];return Wd=Gd=-(Hd=Vd=1/0),t}};const Zd=Xd;var Qd,Jd,ty,ey,ny=0,ry=0,iy=0,oy=0,ay=0,uy=0,cy=0,sy=0,ly=0,fy={point:hy,lineStart:py,lineEnd:vy,polygonStart:function(){fy.lineStart=my,fy.lineEnd=gy},polygonEnd:function(){fy.point=hy,fy.lineStart=py,fy.lineEnd=vy},result:function(){var t=ly?[cy/ly,sy/ly]:uy?[oy/uy,ay/uy]:iy?[ny/iy,ry/iy]:[NaN,NaN];return ny=ry=iy=oy=ay=uy=cy=sy=ly=0,t}};function hy(t,e){ny+=t,ry+=e,++iy}function py(){fy.point=dy}function dy(t,e){fy.point=yy,hy(ty=t,ey=e)}function yy(t,e){var n=t-ty,r=e-ey,i=oh(n*n+r*r);oy+=i*(ty+t)/2,ay+=i*(ey+e)/2,uy+=i,hy(ty=t,ey=e)}function vy(){fy.point=hy}function my(){fy.point=by}function gy(){_y(Qd,Jd)}function by(t,e){fy.point=_y,hy(Qd=ty=t,Jd=ey=e)}function _y(t,e){var n=t-ty,r=e-ey,i=oh(n*n+r*r);oy+=i*(ty+t)/2,ay+=i*(ey+e)/2,uy+=i,cy+=(i=ey*t-ty*e)*(ty+t),sy+=i*(ey+e),ly+=3*i,hy(ty=t,ey=e)}const wy=fy;function xy(t){this._context=t}xy.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,qf)}},result:lh};var ky,Ey,Sy,Oy,Ty,Ay=new Ut,My={point:lh,lineStart:function(){My.point=Py},lineEnd:function(){ky&&Cy(Ey,Sy),My.point=lh},polygonStart:function(){ky=!0},polygonEnd:function(){ky=null},result:function(){var t=+Ay;return Ay=new Ut,t}};function Py(t,e){My.point=Cy,Ey=Oy=t,Sy=Ty=e}function Cy(t,e){Oy-=t,Ty-=e,Ay.add(oh(Oy*Oy+Ty*Ty)),Oy=t,Ty=e}const jy=My;let Ny,Ly,Ry,Dy;class Iy{constructor(t){this._append=null==t?By:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return By;if(e!==Ny){const t=10**e;Ny=e,Ly=function(e){let n=1;this._+=e[0];for(const r=e.length;n=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new Iy(i)),a},a.projection(t).digits(i).context(e)}function zy(t){return{stream:Uy(t)}}function Uy(t){return function(e){var n=new $y;for(var r in t)n[r]=t[r];return n.stream=e,n}}function $y(){}function Ky(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),vh(n,t.stream(Zd)),e(Zd.result()),null!=r&&t.clipExtent(r),t}function Yy(t,e,n){return Ky(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,u])}),n)}function qy(t,e,n){return Yy(t,[[0,0],e],n)}function Vy(t,e,n){return Ky(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function Hy(t,e,n){return Ky(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}$y.prototype={constructor:$y,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Wy=16,Gy=Zf(30*Hf);function Xy(t,e){return+e?function(t,e){function n(r,i,o,a,u,c,s,l,f,h,p,d,y,v){var m=s-r,g=l-i,b=m*m+g*g;if(b>4*e&&y--){var _=a+h,w=u+p,x=c+d,k=oh(_*_+w*w+x*x),E=ch(x/=k),S=Wf(Wf(x)-1)e||Wf((m*M+g*P)/b-.5)>.3||a*h+u*p+c*d2?t[2]%360*Hf:0,M()):[v*Vf,m*Vf,g*Vf]},T.angle=function(t){return arguments.length?(b=t%360*Hf,M()):b*Vf},T.reflectX=function(t){return arguments.length?(_=t?-1:1,M()):_<0},T.reflectY=function(t){return arguments.length?(w=t?-1:1,M()):w<0},T.precision=function(t){return arguments.length?(a=Xy(u,O=t*t),P()):oh(O)},T.fitExtent=function(t,e){return Yy(T,t,e)},T.fitSize=function(t,e){return qy(T,t,e)},T.fitWidth=function(t,e){return Vy(T,t,e)},T.fitHeight=function(t,e){return Hy(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&A,M()}}function ev(t){var e=0,n=$f/3,r=tv(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Hf,n=t[1]*Hf):[e*Vf,n*Vf]},i}function nv(t,e){var n=rh(t),r=(n+rh(e))/2;if(Wf(r)=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),u.stream(n),c.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<-Kf+zf&&(e=-Kf+zf):e>Kf-zf&&(e=Kf-zf);var n=i/nh(yv(e),r);return[n*rh(r*t),i-n*Zf(r*t)]}return o.invert=function(t,e){var n=i-e,o=ih(r)*oh(t*t+n*n),a=Xf(t,Wf(n))*ih(n);return n*r<0&&(a-=$f*ih(t)*ih(n)),[a/r,2*Gf(nh(i/o,1/r))-Kf]},o}function mv(){return ev(vv).scale(109.5).parallels([30,30])}function gv(t,e){return[t,e]}function bv(){return Jy(gv).scale(152.63)}function _v(t,e){var n=Zf(t),r=t===e?rh(t):(n-Zf(e))/(e-t),i=n/r+t;if(Wf(r)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function zv(t,e){return t.parent===e.parent?1:2}function Uv(t,e){return t+e.x}function $v(t,e){return Math.max(t,e.y)}function Kv(){var t=zv,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(Uv,0)/t.length}(n),e.y=function(t){return 1+t.reduce($v,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var u=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),s=u.x-t(u,c)/2,l=c.x+t(c,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-s)/(l-s)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function Yv(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function qv(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Hv)):void 0===e&&(e=Vv);for(var n,r,i,o,a,u=new Xv(t),c=[u];n=c.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new Xv(i[o])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(Gv)}function Vv(t){return t.children}function Hv(t){return Array.isArray(t)?t[1]:null}function Wv(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Gv(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Xv(t){this.data=t,this.depth=this.height=0,this.parent=null}function Zv(t){return null==t?null:Qv(t)}function Qv(t){if("function"!=typeof t)throw new Error;return t}function Jv(){return 0}function tm(t){return function(){return t}}Tv.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(xv+kv*i+o*(Ev+Sv*i))-e)/(xv+3*kv*i+o*(7*Ev+9*Sv*i)))*r)*i*i,!(Wf(n)zf&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},Lv.invert=uv(ch),Dv.invert=uv((function(t){return 2*Gf(t)})),Bv.invert=function(t,e){return[-e,2*Gf(Jf(t))-Kf]},Xv.prototype=qv.prototype={constructor:Xv,count:function(){return this.eachAfter(Yv)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],u=[],c=-1;o=a.pop();)if(u.push(o),n=o.children)for(r=0,i=n.length;r=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return qv(this).eachBefore(Wv)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n(t=(em*t+nm)%rm)/rm}function om(t){return am(t,im())}function am(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i0&&n*n>r*r+i*i}function lm(t,e){for(var n=0;n1e-6?(T+Math.sqrt(T*T-4*O*A))/(2*O):A/T);return{x:r+x+k*M,y:i+E+S*M,r:M}}function dm(t,e,n){var r,i,o,a,u=t.x-e.x,c=t.y-e.y,s=u*u+c*c;s?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(s+a-i)/(2*s),o=Math.sqrt(Math.max(0,a/s-r*r)),n.x=t.x-r*u-o*c,n.y=t.y-r*c+o*u):(r=(s+i-a)/(2*s),o=Math.sqrt(Math.max(0,i/s-r*r)),n.x=e.x+r*u-o*c,n.y=e.y+r*c+o*u)):(n.x=e.x+n.r,n.y=e.y)}function ym(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function vm(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function mm(t){this._=t,this.next=null,this.previous=null}function gm(t,e){if(!(a=(n=t,t="object"==typeof n&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,o,a,u,c,s,l,f,h,p;if((r=t[0]).x=0,r.y=0,!(a>1))return r.r;if(i=t[1],r.x=-i.r,i.x=r.r,i.y=0,!(a>2))return r.r+i.r;dm(i,r,o=t[2]),r=new mm(r),i=new mm(i),o=new mm(o),r.next=o.previous=i,i.next=r.previous=o,o.next=i.previous=r;t:for(s=3;sfunction(t){let e=(t=`${t}`).length;return Rm(t,e-1)&&!Rm(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(Lm),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(Lm(t)),h.push(Pm));p=(t,n)=>e[n],d=(t,e)=>n[e]}for(a=0,i=h.length;a=0&&(s=h[t]).data===Pm;--t)s.data=null}if(u.parent=Am,u.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Gv),u.parent=null,i>0)throw new Error("cycle");return u}return r.id=function(t){return arguments.length?(e=Zv(t),r):e},r.parentId=function(t){return arguments.length?(n=Zv(t),r):n},r.path=function(e){return arguments.length?(t=Zv(e),r):t},r}function Lm(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Rm(t,e););return t.slice(0,e)}function Rm(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function Dm(t,e){return t.parent===e.parent?1:2}function Im(t){var e=t.children;return e?e[0]:t.t}function Bm(t){var e=t.children;return e?e[e.length-1]:t.t}function Fm(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function zm(t,e,n){return t.a.parent===e.parent?t.a:n}function Um(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function $m(){var t=Dm,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new Um(t,0),u=[a];e=u.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(n=e.children[i]=new Um(r[i],i)),n.parent=e;return(a.parent=new Um(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var s=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=s===l?1:t(s,l)/2,p=h-s.x,d=e/(l.x+h+p),y=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*y}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,u=n,c=o.parent.children[0],s=o.m,l=a.m,f=u.m,h=c.m;u=Bm(u),o=Im(o),u&&o;)c=Im(c),(a=Bm(a)).a=e,(i=u.z+f-o.z-s+t(u._,o._))>0&&(Fm(zm(u,e,r),e,i),s+=i,l+=i),f+=u.m,s+=o.m,h+=c.m,l+=a.m;u&&!Bm(a)&&(a.t=u,a.m+=f-l),o&&!Im(c)&&(c.t=o,c.m+=s-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function Km(t,e,n,r,i){for(var o,a=t.children,u=-1,c=a.length,s=t.value&&(i-n)/t.value;++uh&&(h=u),v=l*l*y,(p=Math.max(h/v,v/f))>d){l-=u;break}d=p}m.push(a={value:l,dice:c1?e:1)},n}(Ym);function Hm(){var t=Vm,e=!1,n=1,r=1,i=[0],o=Jv,a=Jv,u=Jv,c=Jv,s=Jv;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(Sm),t}function f(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,f=e.x1-n,h=e.y1-n;f=n-1){var l=u[e];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=c)}for(var f=s[e],h=r/2+f,p=e+1,d=n-1;p>>1;s[y]c-o){var g=r?(i*m+a*v)/r:a;t(e,p,v,i,o,g,c),t(p,n,m,g,o,a,c)}else{var b=r?(o*m+c*v)/r:c;t(e,p,v,i,o,a,b),t(p,n,m,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function Gm(t,e,n,r,i){(1&t.depth?Km:Om)(t,e,n,r,i)}const Xm=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,u,c,s,l,f=-1,h=a.length,p=t.value;++f1?e:1)},n}(Ym);function Zm(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function Qm(t,e){var n=Hi(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}function Jm(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function tg(t){return((t=Math.exp(t))+1/t)/2}const eg=function t(e,n,r){function i(t,i){var o,a,u=t[0],c=t[1],s=t[2],l=i[0],f=i[1],h=i[2],p=l-u,d=f-c,y=p*p+d*d;if(y<1e-12)a=Math.log(h/s)/e,o=function(t){return[u+t*p,c+t*d,s*Math.exp(e*t*a)]};else{var v=Math.sqrt(y),m=(h*h-s*s+r*y)/(2*s*n*v),g=(h*h-s*s-r*y)/(2*h*n*v),b=Math.log(Math.sqrt(m*m+1)-m),_=Math.log(Math.sqrt(g*g+1)-g);a=(_-b)/e,o=function(t){var r,i=t*a,o=tg(b),l=s/(n*v)*(o*(r=e*i+b,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[u+l*p,c+l*d,s*o/tg(e*i+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function ng(t){return function(e,n){var r=t((e=Ii(e)).h,(n=Ii(n)).h),i=Wi(e.s,n.s),o=Wi(e.l,n.l),a=Wi(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const rg=ng(Hi);var ig=ng(Wi);function og(t,e){var n=Wi((t=Gu(t)).l,(e=Gu(e)).l),r=Wi(t.a,e.a),i=Wi(t.b,e.b),o=Wi(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function ag(t){return function(e,n){var r=t((e=rc(e)).h,(n=rc(n)).h),i=Wi(e.c,n.c),o=Wi(e.l,n.l),a=Wi(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const ug=ag(Hi);var cg=ag(Wi);function sg(t){return function e(n){function r(e,r){var i=t((e=dc(e)).h,(r=dc(r)).h),o=Wi(e.s,r.s),a=Wi(e.l,r.l),u=Wi(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=u(t),e+""}}return n=+n,r.gamma=e,r}(1)}const lg=sg(Hi);var fg=sg(Wi);function hg(t,e){void 0===e&&(e=t,t=so);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n1&&vg(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function bg(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e=0;--e)s.push(t[r[o[e]][2]]);for(e=+u;eu!=s>u&&a<(c-n)*(u-r)/(s-r)+n&&(l=!l),c=n,s=r;return l}function wg(t){for(var e,n,r=-1,i=t.length,o=t[i-1],a=o[0],u=o[1],c=0;++r1);return t+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(xg),Og=function t(e){var n=Sg.source(e);function r(){var t=n.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(xg),Tg=function t(e){function n(t){return(t=+t)<=0?()=>0:function(){for(var n=0,r=t;r>1;--r)n+=e();return n+r*e()}}return n.source=t,n}(xg),Ag=function t(e){var n=Tg.source(e);function r(t){if(0==(t=+t))return e;var r=n(t);return function(){return r()/t}}return r.source=t,r}(xg),Mg=function t(e){function n(t){return function(){return-Math.log1p(-e())/t}}return n.source=t,n}(xg),Pg=function t(e){function n(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-e(),t)}}return n.source=t,n}(xg),Cg=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(e()+t)}}return n.source=t,n}(xg),jg=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-e())/t)})}return n.source=t,n}(xg),Ng=function t(e){var n=Sg.source(e)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-e())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(e(),1/t):()=>1;return function(){do{do{var t=n(),u=1+o*t}while(u<=0);u*=u*u;var c=1-e()}while(c>=1-.0331*t*t*t*t&&Math.log(c)>=.5*t*t+i*(1-u+Math.log(u)));return i*u*a()*r}}return r.source=t,r}(xg),Lg=function t(e){var n=Ng.source(e);function r(t,e){var r=n(t),i=n(e);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(xg),Rg=function t(e){var n=jg.source(e),r=Lg.source(e);function i(t,e){return t=+t,(e=+e)>=1?()=>t:e<=0?()=>0:function(){for(var i=0,o=t,a=e;o*a>16&&o*(1-a)>16;){var u=Math.floor((o+1)*a),c=r(u,o-u+1)();c<=a?(i+=u,o-=u,a=(a-c)/(1-c)):(o=u-1,a/=c)}for(var s=a<.5,l=n(s?a:1-a),f=l(),h=0;f<=o;++h)f+=l();return i+(s?h:o-h)}}return i.source=t,i}(xg),Dg=function t(e){function n(t,n,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=e=>Math.pow(e,t)),n=null==n?0:+n,r=null==r?1:+r,function(){return n+r*i(-Math.log1p(-e()))}}return n.source=t,n}(xg),Ig=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){return t+n*Math.tan(Math.PI*e())}}return n.source=t,n}(xg),Bg=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){var r=e();return t+n*Math.log(r/(1-r))}}return n.source=t,n}(xg),Fg=function t(e){var n=Ng.source(e),r=Rg.source(e);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),u=n(a)();if(u>o)return i+r(a-1,o/u)();i+=a,o-=u}for(var c=-Math.log1p(-e()),s=0;c<=o;++s)c-=Math.log1p(-e());return i+s}}return i.source=t,i}(xg),zg=1664525,Ug=1013904223,$g=1/4294967296;function Kg(t=Math.random()){let e=0|(0<=t&&t<1?t/$g:Math.abs(t));return()=>(e=zg*e+Ug|0,$g*(e>>>0))}function Yg(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function qg(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Vg=Symbol("implicit");function Hg(){var t=new Yt,e=[],n=[],r=Vg;function i(i){let o=t.get(i);if(void 0===o){if(r!==Vg)return r;t.set(i,o=e.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Yt;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Hg(e,n).unknown(r)},Yg.apply(i,arguments),i}function Wg(){var t,e,n=Hg().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,u=!1,c=0,s=0,l=.5;function f(){var n=r().length,f=ae&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?nb:eb,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),u,c)))(t(s(e)))}return f.invert=function(n){return s(e((o||(o=r(u,a.map(t),io)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Zg),l()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),l()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),c=Jm,l()},f.clamp=function(t){return arguments.length?(s=!!t||Jg,l()):s!==Jg},f.interpolate=function(t){return arguments.length?(c=t,l()):c},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function ob(){return ib()(Jg,Jg)}function ab(t,e,n,r){var i,o=xe(t,e,n);switch((r=Sf(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=Bf(o,a))||(r.precision=i),jf(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Ff(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=If(o))||(r.precision=i-2*("%"===r.type))}return Cf(r)}function ub(t){var e=t.domain;return t.ticks=function(t){var n=e();return _e(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return ab(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,u=o.length-1,c=o[a],s=o[u],l=10;for(s0;){if((i=we(c,s,n))===r)return o[a]=c,o[u]=s,e(o);if(i>0)c=Math.floor(c/i)*i,s=Math.ceil(s/i)*i;else{if(!(i<0))break;c=Math.ceil(c*i)/i,s=Math.floor(s*i)/i}r=i}return t},t}function cb(){var t=ob();return t.copy=function(){return rb(t,cb())},Yg.apply(t,arguments),ub(t)}function sb(t){var e;function n(t){return null==t||isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,Zg),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return sb(t).unknown(e)},t=arguments.length?Array.from(t,Zg):[0,1],ub(n)}function lb(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-e,n)}function mb(t){const e=t(fb,hb),n=e.domain;let r,i,o=10;function a(){return r=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),i=function(t){return 10===t?yb:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=vb(r),i=vb(i),t(pb,db)):t(fb,hb),e}return e.base=function(t){return arguments.length?(o=+t,a()):o},e.domain=function(t){return arguments.length?(n(t),a()):n()},e.ticks=t=>{const e=n();let a=e[0],u=e[e.length-1];const c=u0){for(;f<=h;++f)for(s=1;su)break;d.push(l)}}else for(;f<=h;++f)for(s=o-1;s>=1;--s)if(l=f>0?s/i(-f):s*i(f),!(lu)break;d.push(l)}2*d.length{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=Sf(n)).precision||(n.trim=!0),n=Cf(n)),t===1/0)return n;const a=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/i(Math.round(r(t)));return e*on(lb(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function gb(){const t=mb(ib()).domain([1,10]);return t.copy=()=>rb(t,gb()).base(t.base()),Yg.apply(t,arguments),t}function bb(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function _b(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function wb(t){var e=1,n=t(bb(e),_b(e));return n.constant=function(n){return arguments.length?t(bb(e=+n),_b(e)):e},ub(n)}function xb(){var t=wb(ib());return t.copy=function(){return rb(t,xb()).constant(t.constant())},Yg.apply(t,arguments)}function kb(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Eb(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Sb(t){return t<0?-t*t:t*t}function Ob(t){var e=t(Jg,Jg),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(Jg,Jg):.5===n?t(Eb,Sb):t(kb(n),kb(1/n)):n},ub(e)}function Tb(){var t=Ob(ib());return t.copy=function(){return rb(t,Tb()).exponent(t.exponent())},Yg.apply(t,arguments),t}function Ab(){return Tb.apply(null,arguments).exponent(.5)}function Mb(t){return Math.sign(t)*t*t}function Pb(){var t,e=ob(),n=[0,1],r=!1;function i(n){var i=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(n));return isNaN(i)?t:r?Math.round(i):i}return i.invert=function(t){return e.invert(Mb(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(t){return arguments.length?(e.range((n=Array.from(t,Zg)).map(Mb)),i):n.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(r=!!t,i):r},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Pb(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},Yg.apply(i,arguments),ub(i)}function Cb(){var t,e=[],n=[],r=[];function i(){var t=0,i=Math.max(1,n.length);for(r=new Array(i-1);++t0?r[i-1]:e[0],i=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return jb().domain([e,n]).range(o).unknown(t)},Yg.apply(ub(a),arguments)}function Nb(){var t,e=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[Et(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=Array.from(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Nb().domain(e).range(n).unknown(t)},Yg.apply(i,arguments)}const Lb=1e3,Rb=6e4,Db=36e5,Ib=864e5,Bb=6048e5,Fb=31536e6,zb=new Date,Ub=new Date;function $b(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n0))return a;let u;do{a.push(u=new Date(+n)),e(n,o),t(n)}while(u$b((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(zb.setTime(+e),Ub.setTime(+r),t(zb),t(Ub),Math.floor(n(zb,Ub))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}const Kb=$b((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Kb.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?$b((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Kb:null);const Yb=Kb.range,qb=$b((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*Lb)}),((t,e)=>(e-t)/Lb),(t=>t.getUTCSeconds())),Vb=qb.range,Hb=$b((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Lb)}),((t,e)=>{t.setTime(+t+e*Rb)}),((t,e)=>(e-t)/Rb),(t=>t.getMinutes())),Wb=Hb.range,Gb=$b((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*Rb)}),((t,e)=>(e-t)/Rb),(t=>t.getUTCMinutes())),Xb=Gb.range,Zb=$b((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Lb-t.getMinutes()*Rb)}),((t,e)=>{t.setTime(+t+e*Db)}),((t,e)=>(e-t)/Db),(t=>t.getHours())),Qb=Zb.range,Jb=$b((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*Db)}),((t,e)=>(e-t)/Db),(t=>t.getUTCHours())),t_=Jb.range,e_=$b((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Rb)/Ib),(t=>t.getDate()-1)),n_=e_.range,r_=$b((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Ib),(t=>t.getUTCDate()-1)),i_=r_.range,o_=$b((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Ib),(t=>Math.floor(t/Ib))),a_=o_.range;function u_(t){return $b((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Rb)/Bb))}const c_=u_(0),s_=u_(1),l_=u_(2),f_=u_(3),h_=u_(4),p_=u_(5),d_=u_(6),y_=c_.range,v_=s_.range,m_=l_.range,g_=f_.range,b_=h_.range,__=p_.range,w_=d_.range;function x_(t){return $b((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/Bb))}const k_=x_(0),E_=x_(1),S_=x_(2),O_=x_(3),T_=x_(4),A_=x_(5),M_=x_(6),P_=k_.range,C_=E_.range,j_=S_.range,N_=O_.range,L_=T_.range,R_=A_.range,D_=M_.range,I_=$b((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth())),B_=I_.range,F_=$b((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth())),z_=F_.range,U_=$b((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));U_.every=t=>isFinite(t=Math.floor(t))&&t>0?$b((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null;const $_=U_.range,K_=$b((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));K_.every=t=>isFinite(t=Math.floor(t))&&t>0?$b((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null;const Y_=K_.range;function q_(t,e,n,r,i,o){const a=[[qb,1,Lb],[qb,5,5e3],[qb,15,15e3],[qb,30,3e4],[o,1,Rb],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,Db],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,Ib],[r,2,1728e5],[n,1,Bb],[e,1,2592e6],[e,3,7776e6],[t,1,Fb]];function u(e,n,r){const i=Math.abs(n-e)/r,o=mt((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(xe(e/Fb,n/Fb,r));if(0===o)return Kb.every(Math.max(xe(e,n,r),1));const[u,c]=a[i/a[o-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:_x,s:wx,S:Uw,u:$w,U:Kw,V:qw,w:Vw,W:Hw,x:null,X:null,y:Ww,Y:Xw,Z:Qw,"%":bx},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Jw,e:Jw,f:ix,g:yx,G:mx,H:tx,I:ex,j:nx,L:rx,m:ox,M:ax,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:_x,s:wx,S:ux,u:cx,U:sx,V:fx,w:hx,W:px,x:null,X:null,y:dx,Y:vx,Z:gx,"%":bx},w={a:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:kw,e:kw,f:Mw,g:bw,G:gw,H:Sw,I:Sw,j:Ew,L:Aw,m:xw,M:Ow,p:function(t,e,n){var r=s.exec(e.slice(n));return r?(t.p=l.get(r[0].toLowerCase()),n+r[0].length):-1},q:ww,Q:Cw,s:jw,S:Tw,u:dw,U:yw,V:vw,w:pw,W:mw,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:bw,Y:gw,Z:_w,"%":Pw};function x(t,e){return function(n){var r,i,o,a=[],u=-1,c=0,s=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Z_(Q_(o.y,0,1))).getUTCDay(),r=i>4||0===i?E_.ceil(r):E_(r),r=r_.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=X_(Q_(o.y,0,1))).getDay(),r=i>4||0===i?s_.ceil(r):s_(r),r=e_.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Z_(Q_(o.y,0,1)).getUTCDay():X_(Q_(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Z_(o)):X_(o)}}function E(t,e,n,r){for(var i,o,a=0,u=e.length,c=n.length;a=c)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=w[i in ow?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=x(n,b),b.X=x(r,b),b.c=x(e,b),_.x=x(n,_),_.X=x(r,_),_.c=x(e,_),{format:function(t){var e=x(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",_);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var tw,ew,nw,rw,iw,ow={"-":"",_:" ",0:"0"},aw=/^\s*\d+/,uw=/^%/,cw=/[\\^$*+?|[\]().{}]/g;function sw(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function pw(t,e,n){var r=aw.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function dw(t,e,n){var r=aw.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function yw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function vw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function mw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function gw(t,e,n){var r=aw.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function bw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function _w(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ww(t,e,n){var r=aw.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function xw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function kw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Ew(t,e,n){var r=aw.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Sw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Ow(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Tw(t,e,n){var r=aw.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Aw(t,e,n){var r=aw.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Mw(t,e,n){var r=aw.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pw(t,e,n){var r=uw.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Cw(t,e,n){var r=aw.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jw(t,e,n){var r=aw.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Nw(t,e){return sw(t.getDate(),e,2)}function Lw(t,e){return sw(t.getHours(),e,2)}function Rw(t,e){return sw(t.getHours()%12||12,e,2)}function Dw(t,e){return sw(1+e_.count(U_(t),t),e,3)}function Iw(t,e){return sw(t.getMilliseconds(),e,3)}function Bw(t,e){return Iw(t,e)+"000"}function Fw(t,e){return sw(t.getMonth()+1,e,2)}function zw(t,e){return sw(t.getMinutes(),e,2)}function Uw(t,e){return sw(t.getSeconds(),e,2)}function $w(t){var e=t.getDay();return 0===e?7:e}function Kw(t,e){return sw(c_.count(U_(t)-1,t),e,2)}function Yw(t){var e=t.getDay();return e>=4||0===e?h_(t):h_.ceil(t)}function qw(t,e){return t=Yw(t),sw(h_.count(U_(t),t)+(4===U_(t).getDay()),e,2)}function Vw(t){return t.getDay()}function Hw(t,e){return sw(s_.count(U_(t)-1,t),e,2)}function Ww(t,e){return sw(t.getFullYear()%100,e,2)}function Gw(t,e){return sw((t=Yw(t)).getFullYear()%100,e,2)}function Xw(t,e){return sw(t.getFullYear()%1e4,e,4)}function Zw(t,e){var n=t.getDay();return sw((t=n>=4||0===n?h_(t):h_.ceil(t)).getFullYear()%1e4,e,4)}function Qw(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+sw(e/60|0,"0",2)+sw(e%60,"0",2)}function Jw(t,e){return sw(t.getUTCDate(),e,2)}function tx(t,e){return sw(t.getUTCHours(),e,2)}function ex(t,e){return sw(t.getUTCHours()%12||12,e,2)}function nx(t,e){return sw(1+r_.count(K_(t),t),e,3)}function rx(t,e){return sw(t.getUTCMilliseconds(),e,3)}function ix(t,e){return rx(t,e)+"000"}function ox(t,e){return sw(t.getUTCMonth()+1,e,2)}function ax(t,e){return sw(t.getUTCMinutes(),e,2)}function ux(t,e){return sw(t.getUTCSeconds(),e,2)}function cx(t){var e=t.getUTCDay();return 0===e?7:e}function sx(t,e){return sw(k_.count(K_(t)-1,t),e,2)}function lx(t){var e=t.getUTCDay();return e>=4||0===e?T_(t):T_.ceil(t)}function fx(t,e){return t=lx(t),sw(T_.count(K_(t),t)+(4===K_(t).getUTCDay()),e,2)}function hx(t){return t.getUTCDay()}function px(t,e){return sw(E_.count(K_(t)-1,t),e,2)}function dx(t,e){return sw(t.getUTCFullYear()%100,e,2)}function yx(t,e){return sw((t=lx(t)).getUTCFullYear()%100,e,2)}function vx(t,e){return sw(t.getUTCFullYear()%1e4,e,4)}function mx(t,e){var n=t.getUTCDay();return sw((t=n>=4||0===n?T_(t):T_.ceil(t)).getUTCFullYear()%1e4,e,4)}function gx(){return"+0000"}function bx(){return"%"}function _x(t){return+t}function wx(t){return Math.floor(+t/1e3)}function xx(t){return tw=J_(t),ew=tw.format,nw=tw.parse,rw=tw.utcFormat,iw=tw.utcParse,tw}function kx(t){return new Date(t)}function Ex(t){return t instanceof Date?+t:+new Date(+t)}function Sx(t,e,n,r,i,o,a,u,c,s){var l=ob(),f=l.invert,h=l.domain,p=s(".%L"),d=s(":%S"),y=s("%I:%M"),v=s("%I %p"),m=s("%a %d"),g=s("%b %d"),b=s("%B"),_=s("%Y");function w(t){return(c(t)e(r/(t.length-1))))},n.quantiles=function(e){return Array.from({length:e+1},((n,r)=>Ne(t,r/e)))},n.copy=function(){return Rx(e).domain(t)},qg.apply(n,arguments)}function Dx(){var t,e,n,r,i,o,a,u=0,c=.5,s=1,l=1,f=Jg,h=!1;function p(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*tZi(t[t.length-1]);var ek=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map($x);const nk=tk(ek);var rk=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map($x);const ik=tk(rk);var ok=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map($x);const ak=tk(ok);var uk=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map($x);const ck=tk(uk);var sk=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map($x);const lk=tk(sk);var fk=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map($x);const hk=tk(fk);var pk=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map($x);const dk=tk(pk);var yk=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map($x);const vk=tk(yk);var mk=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map($x);const gk=tk(mk);var bk=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map($x);const _k=tk(bk);var wk=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map($x);const xk=tk(wk);var kk=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map($x);const Ek=tk(kk);var Sk=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map($x);const Ok=tk(Sk);var Tk=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map($x);const Ak=tk(Tk);var Mk=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map($x);const Pk=tk(Mk);var Ck=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map($x);const jk=tk(Ck);var Nk=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map($x);const Lk=tk(Nk);var Rk=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map($x);const Dk=tk(Rk);var Ik=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map($x);const Bk=tk(Ik);var Fk=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map($x);const zk=tk(Fk);var Uk=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map($x);const $k=tk(Uk);var Kk=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map($x);const Yk=tk(Kk);var qk=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map($x);const Vk=tk(qk);var Hk=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map($x);const Wk=tk(Hk);var Gk=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map($x);const Xk=tk(Gk);var Zk=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map($x);const Qk=tk(Zk);var Jk=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map($x);const tE=tk(Jk);function eE(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"}const nE=fg(dc(300,.5,0),dc(-240,.5,1));var rE=fg(dc(-100,.75,.35),dc(80,1.5,.8)),iE=fg(dc(260,.75,.35),dc(80,1.5,.8)),oE=dc();function aE(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return oE.h=360*t-100,oE.s=1.5-1.5*e,oE.l=.8-.9*e,oE+""}var uE=Ai(),cE=Math.PI/3,sE=2*Math.PI/3;function lE(t){var e;return t=(.5-t)*Math.PI,uE.r=255*(e=Math.sin(t))*e,uE.g=255*(e=Math.sin(t+cE))*e,uE.b=255*(e=Math.sin(t+sE))*e,uE+""}function fE(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}function hE(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const pE=hE($x("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var dE=hE($x("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),yE=hE($x("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),vE=hE($x("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function mE(t){return Jr(Fr(t).call(document.documentElement))}var gE=0;function bE(){return new _E}function _E(){this._="@"+(++gE).toString(36)}function wE(t,e){return t.target&&(t=lo(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>fo(t,e)))}function xE(t){return"string"==typeof t?new Xr([document.querySelectorAll(t)],[document.documentElement]):new Xr([$n(t)],Gr)}function kE(t){return function(){return t}}_E.prototype=bE.prototype={constructor:_E,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};const EE=Math.abs,SE=Math.atan2,OE=Math.cos,TE=Math.max,AE=Math.min,ME=Math.sin,PE=Math.sqrt,CE=1e-12,jE=Math.PI,NE=jE/2,LE=2*jE;function RE(t){return t>=1?NE:t<=-1?-NE:Math.asin(t)}function DE(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new ku(e)}function IE(t){return t.innerRadius}function BE(t){return t.outerRadius}function FE(t){return t.startAngle}function zE(t){return t.endAngle}function UE(t){return t&&t.padAngle}function $E(t,e,n,r,i,o,a){var u=t-n,c=e-r,s=(a?o:-o)/PE(u*u+c*c),l=s*c,f=-s*u,h=t+l,p=e+f,d=n+l,y=r+f,v=(h+d)/2,m=(p+y)/2,g=d-h,b=y-p,_=g*g+b*b,w=i-o,x=h*y-d*p,k=(b<0?-1:1)*PE(TE(0,w*w*_-x*x)),E=(x*b-g*k)/_,S=(-x*g-b*k)/_,O=(x*b+g*k)/_,T=(-x*g+b*k)/_,A=E-v,M=S-m,P=O-v,C=T-m;return A*A+M*M>P*P+C*C&&(E=O,S=T),{cx:E,cy:S,x01:-l,y01:-f,x11:E*(i/w-1),y11:S*(i/w-1)}}function KE(){var t=IE,e=BE,n=kE(0),r=null,i=FE,o=zE,a=UE,u=null,c=DE(s);function s(){var s,l,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-NE,y=o.apply(this,arguments)-NE,v=EE(y-d),m=y>d;if(u||(u=s=c()),pCE)if(v>LE-CE)u.moveTo(p*OE(d),p*ME(d)),u.arc(0,0,p,d,y,!m),h>CE&&(u.moveTo(h*OE(y),h*ME(y)),u.arc(0,0,h,y,d,m));else{var g,b,_=d,w=y,x=d,k=y,E=v,S=v,O=a.apply(this,arguments)/2,T=O>CE&&(r?+r.apply(this,arguments):PE(h*h+p*p)),A=AE(EE(p-h)/2,+n.apply(this,arguments)),M=A,P=A;if(T>CE){var C=RE(T/h*ME(O)),j=RE(T/p*ME(O));(E-=2*C)>CE?(x+=C*=m?1:-1,k-=C):(E=0,x=k=(d+y)/2),(S-=2*j)>CE?(_+=j*=m?1:-1,w-=j):(S=0,_=w=(d+y)/2)}var N=p*OE(_),L=p*ME(_),R=h*OE(k),D=h*ME(k);if(A>CE){var I,B=p*OE(w),F=p*ME(w),z=h*OE(x),U=h*ME(x);if(v1?0:f<-1?jE:Math.acos(f))/2),H=PE(I[0]*I[0]+I[1]*I[1]);M=AE(A,(h-H)/(V-1)),P=AE(A,(p-H)/(V+1))}else M=P=0}S>CE?P>CE?(g=$E(z,U,N,L,p,P,m),b=$E(B,F,R,D,p,P,m),u.moveTo(g.cx+g.x01,g.cy+g.y01),PCE&&E>CE?M>CE?(g=$E(R,D,B,F,h,-M,m),b=$E(N,L,z,U,h,-M,m),u.lineTo(g.cx+g.x01,g.cy+g.y01),M=f;--h)u.point(m[h],g[h]);u.lineEnd(),u.areaEnd()}v&&(m[l]=+t(p,l,s),g[l]=+e(p,l,s),u.point(r?+r(p,l,s):m[l],n?+n(p,l,s):g[l]))}if(d)return u=null,d+""||null}function l(){return XE().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?WE:kE(+t),e="function"==typeof e?e:kE(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?GE:kE(+n),s.x=function(e){return arguments.length?(t="function"==typeof e?e:kE(+e),r=null,s):t},s.x0=function(e){return arguments.length?(t="function"==typeof e?e:kE(+e),s):t},s.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:kE(+t),s):r},s.y=function(t){return arguments.length?(e="function"==typeof t?t:kE(+t),n=null,s):e},s.y0=function(t){return arguments.length?(e="function"==typeof t?t:kE(+t),s):e},s.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:kE(+t),s):n},s.lineX0=s.lineY0=function(){return l().x(t).y(e)},s.lineY1=function(){return l().x(t).y(n)},s.lineX1=function(){return l().x(r).y(e)},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:kE(!!t),s):i},s.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),s):a},s.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),s):o},s}function QE(t,e){return et?1:e>=t?0:NaN}function JE(t){return t}function tS(){var t=JE,e=QE,n=null,r=kE(0),i=kE(LE),o=kE(0);function a(a){var u,c,s,l,f,h=(a=qE(a)).length,p=0,d=new Array(h),y=new Array(h),v=+r.apply(this,arguments),m=Math.min(LE,Math.max(-LE,i.apply(this,arguments)-v)),g=Math.min(Math.abs(m)/h,o.apply(this,arguments)),b=g*(m<0?-1:1);for(u=0;u0&&(p+=f);for(null!=e?d.sort((function(t,n){return e(y[t],y[n])})):null!=n&&d.sort((function(t,e){return n(a[t],a[e])})),u=0,s=p?(m-h*b)/p:0;u0?f*s:0)+b,y[c]={data:a[c],index:u,value:f,startAngle:v,endAngle:l,padAngle:g};return y}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:kE(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:kE(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:kE(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:kE(+t),a):o},a}VE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var eS=rS(HE);function nS(t){this._curve=t}function rS(t){function e(e){return new nS(t(e))}return e._curve=t,e}function iS(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(rS(t)):e()._curve},t}function oS(){return iS(XE().curve(eS))}function aS(){var t=ZE().curve(eS),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return iS(n())},delete t.lineX0,t.lineEndAngle=function(){return iS(r())},delete t.lineX1,t.lineInnerRadius=function(){return iS(i())},delete t.lineY0,t.lineOuterRadius=function(){return iS(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(rS(t)):e()._curve},t}function uS(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}nS.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};class cS{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}class sS{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,e){if(t=+t,e=+e,0===this._point)this._point=1;else{const n=uS(this._x0,this._y0),r=uS(this._x0,this._y0=(this._y0+e)/2),i=uS(t,this._y0),o=uS(t,e);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...i,...o)}this._x0=t,this._y0=e}}function lS(t){return new cS(t,!0)}function fS(t){return new cS(t,!1)}function hS(t){return new sS(t)}function pS(t){return t.source}function dS(t){return t.target}function yS(t){let e=pS,n=dS,r=WE,i=GE,o=null,a=null,u=DE(c);function c(){let c;const s=YE.call(arguments),l=e.apply(this,s),f=n.apply(this,s);if(null==o&&(a=t(c=u())),a.lineStart(),s[0]=l,a.point(+r.apply(this,s),+i.apply(this,s)),s[0]=f,a.point(+r.apply(this,s),+i.apply(this,s)),a.lineEnd(),c)return a=null,c+""||null}return c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.x=function(t){return arguments.length?(r="function"==typeof t?t:kE(+t),c):r},c.y=function(t){return arguments.length?(i="function"==typeof t?t:kE(+t),c):i},c.context=function(e){return arguments.length?(null==e?o=a=null:a=t(o=e),c):o},c}function vS(){return yS(lS)}function mS(){return yS(fS)}function gS(){const t=yS(hS);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const bS=PE(3),_S={draw(t,e){const n=.59436*PE(e+AE(e/28,.75)),r=n/2,i=r*bS;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},wS={draw(t,e){const n=PE(e/jE);t.moveTo(n,0),t.arc(0,0,n,0,LE)}},xS={draw(t,e){const n=PE(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},kS=PE(1/3),ES=2*kS,SS={draw(t,e){const n=PE(e/ES),r=n*kS;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},OS={draw(t,e){const n=.62625*PE(e);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},TS={draw(t,e){const n=.87559*PE(e-AE(e/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},AS={draw(t,e){const n=PE(e),r=-n/2;t.rect(r,r,n,n)}},MS={draw(t,e){const n=.4431*PE(e);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},PS=ME(jE/10)/ME(7*jE/10),CS=ME(LE/10)*PS,jS=-OE(LE/10)*PS,NS={draw(t,e){const n=PE(.8908130915292852*e),r=CS*n,i=jS*n;t.moveTo(0,-n),t.lineTo(r,i);for(let e=1;e<5;++e){const o=LE*e/5,a=OE(o),u=ME(o);t.lineTo(u*n,-a*n),t.lineTo(a*r-u*i,u*r+a*i)}t.closePath()}},LS=PE(3),RS={draw(t,e){const n=-PE(e/(3*LS));t.moveTo(0,2*n),t.lineTo(-LS*n,-n),t.lineTo(LS*n,-n),t.closePath()}},DS=PE(3),IS={draw(t,e){const n=.6824*PE(e),r=n/2,i=n*DS/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},BS=-.5,FS=PE(3)/2,zS=1/PE(12),US=3*(zS/2+1),$S={draw(t,e){const n=PE(e/US),r=n/2,i=n*zS,o=r,a=n*zS+n,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(BS*r-FS*i,FS*r+BS*i),t.lineTo(BS*o-FS*a,FS*o+BS*a),t.lineTo(BS*u-FS*c,FS*u+BS*c),t.lineTo(BS*r+FS*i,BS*i-FS*r),t.lineTo(BS*o+FS*a,BS*a-FS*o),t.lineTo(BS*u+FS*c,BS*c-FS*u),t.closePath()}},KS={draw(t,e){const n=.6189*PE(e-AE(e/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},YS=[wS,xS,SS,AS,NS,RS,$S],qS=[wS,TS,KS,IS,_S,MS,OS];function VS(t,e){let n=null,r=DE(i);function i(){let i;if(n||(n=i=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return t="function"==typeof t?t:kE(t||wS),e="function"==typeof e?e:kE(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:kE(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:kE(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function HS(){}function WS(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function GS(t){this._context=t}function XS(t){return new GS(t)}function ZS(t){this._context=t}function QS(t){return new ZS(t)}function JS(t){this._context=t}function tO(t){return new JS(t)}function eO(t,e){this._basis=new GS(t),this._beta=e}GS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:WS(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:WS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ZS.prototype={areaStart:HS,areaEnd:HS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:WS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},JS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:WS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},eO.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,u=e[n]-o,c=-1;++c<=n;)r=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*e[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const nO=function t(e){function n(t){return 1===e?new GS(t):new eO(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function rO(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function iO(t,e){this._context=t,this._k=(1-e)/6}iO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:rO(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:rO(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const oO=function t(e){function n(t){return new iO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function aO(t,e){this._context=t,this._k=(1-e)/6}aO.prototype={areaStart:HS,areaEnd:HS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:rO(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const uO=function t(e){function n(t){return new aO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function cO(t,e){this._context=t,this._k=(1-e)/6}cO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:rO(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const sO=function t(e){function n(t){return new cO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function lO(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>CE){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>CE){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*s+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function fO(t,e){this._context=t,this._alpha=e}fO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:lO(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const hO=function t(e){function n(t){return e?new fO(t,e):new iO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function pO(t,e){this._context=t,this._alpha=e}pO.prototype={areaStart:HS,areaEnd:HS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:lO(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const dO=function t(e){function n(t){return e?new pO(t,e):new aO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function yO(t,e){this._context=t,this._alpha=e}yO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:lO(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const vO=function t(e){function n(t){return e?new yO(t,e):new cO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function mO(t){this._context=t}function gO(t){return new mO(t)}function bO(t){return t<0?-1:1}function _O(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(bO(o)+bO(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function wO(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function xO(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*e,o-u,a-u*n,o,a)}function kO(t){this._context=t}function EO(t){this._context=new SO(t)}function SO(t){this._context=t}function OO(t){return new kO(t)}function TO(t){return new EO(t)}function AO(t){this._context=t}function MO(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e1)for(var n,r,i,o=1,a=t[e[0]],u=a.length;o=0;)n[e]=e;return n}function IO(t,e){return t[e]}function BO(t){const e=[];return e.key=t,e}function FO(){var t=kE([]),e=DO,n=RO,r=IO;function i(i){var o,a,u=Array.from(t.apply(this,arguments),BO),c=u.length,s=-1;for(const t of i)for(o=0,++s;o0){for(var n,r,i,o=0,a=t[0].length;o0)for(var n,r,i,o,a,u,c=0,s=t[e[0]].length;c0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)}function $O(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],o=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,o=0,a=1;ao&&(o=e,r=n);return r}function VO(t){var e=t.map(HO);return DO(t).sort((function(t,n){return e[t]-e[n]}))}function HO(t){for(var e,n=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var ZO="%Y-%m-%dT%H:%M:%S.%LZ",QO=Date.prototype.toISOString?function(t){return t.toISOString()}:rw(ZO);const JO=QO;var tT=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:iw(ZO);const eT=tT;function nT(t,e,n){var r=new Oo,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?Eo():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}const rT=t=>()=>t;function iT(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function oT(t,e,n){this.k=t,this.x=e,this.y=n}oT.prototype={constructor:oT,scale:function(t){return 1===t?this:new oT(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new oT(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var aT=new oT(1,0,0);function uT(t){for(;!t.__zoom;)if(!(t=t.parentNode))return aT;return t.__zoom}function cT(t){t.stopImmediatePropagation()}function sT(t){t.preventDefault(),t.stopImmediatePropagation()}function lT(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function fT(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function hT(){return this.__zoom||aT}function pT(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function dT(){return navigator.maxTouchPoints||"ontouchstart"in this}function yT(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function vT(){var t,e,n,r=lT,i=fT,o=yT,a=pT,u=dT,c=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,f=eg,h=Fn("start","zoom","end"),p=500,d=150,y=0,v=10;function m(t){t.property("__zoom",hT).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",O).filter(u).on("touchstart.zoom",T).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(c[0],Math.min(c[1],e)))===t.k?t:new oT(e,t.x,t.y)}function b(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new oT(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=x(t,o).event(r),u=i.apply(t,o),c=null==n?_(u):"function"==typeof n?n.apply(t,o):n,s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,o):e,p=f(l.invert(c).concat(s/l.k),h.invert(c).concat(s/h.k));return function(t){if(1===t)t=h;else{var e=p(t),n=s/e[2];t=new oT(n,c[0]-e[0]*n,c[1]-e[1]*n)}a.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new k(t,e)}function k(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function E(t,...e){if(r.apply(this,arguments)){var n=x(this,e).event(t),i=this.__zoom,u=Math.max(c[0],Math.min(c[1],i.k*Math.pow(2,a.apply(this,arguments)))),l=fo(t);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=i.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(i.k===u)return;n.mouse=[l,i.invert(l)],qo(this),n.start()}sT(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(g(i,u),n.mouse[0],n.mouse[1]),n.extent,s))}}function S(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=x(this,e,!0).event(t),u=Jr(t.view).on("mousemove.zoom",(function(t){if(sT(t),!a.moved){var e=t.clientX-l,n=t.clientY-f;a.moved=e*e+n*n>y}a.event(t).zoom("mouse",o(b(a.that.__zoom,a.mouse[0]=fo(t,i),a.mouse[1]),a.extent,s))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),oi(t.view,a.moved),sT(t),a.event(t).end()}),!0),c=fo(t,i),l=t.clientX,f=t.clientY;ii(t.view),cT(t),a.mouse=[c,this.__zoom.invert(c)],qo(this),a.start()}}function O(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=fo(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),c=n.k*(t.shiftKey?.5:2),f=o(b(g(n,c),a,u),i.apply(this,e),s);sT(t),l>0?Jr(this).transition().duration(l).call(w,f,a,t):Jr(this).call(m.transform,f,a,t)}}function T(n,...i){if(r.apply(this,arguments)){var o,a,u,c,s=n.touches,l=s.length,f=x(this,i,n.changedTouches.length===l).event(n);for(cT(n),a=0;a g").attr("transform","".concat(i," ").concat(o))}},{key:"getSourcesId",value:function(t){return this.pluginData.scene.selection.includes(t.subject.datum().data.id)?this.pluginData.scene.selection:[t.subject.datum().data.id]}},{key:"getSourcePosition",value:function(t){var e=this.viewport.select(".".concat(t," .model"));return{x:parseFloat(e.attr("x")),y:parseFloat(e.attr("y"))}}},{key:"getTargetsByDepth",value:function(t){var e=this,n=t.subject.datum().data.id,r=t.sourceEvent,i=r.clientX,o=r.clientY,a=[];return this.viewport.selectAll("g.component.container:not(.".concat(n,")")).each((function(t){var n=e.viewport.select(".".concat(t.data.id," .background")).node().getBoundingClientRect(),r=n.x,u=n.y,c=n.width,s=n.height;if(i>=r&&i<=r+c&&o>=u&&o<=u+s){for(var l=parseInt(e.viewport.select(".".concat(t.data.id)).attr("depth"),10)-1;a.length<=l;)a.push([]);a[l].push(t.data.id)}})),a}},{key:"getTargetsId",value:function(t){return this.getTargetsByDepth(t).flat().reverse()}},{key:"getTargetId",value:function(t){return this.getTargetsId(t)[0]}},{key:"getTransform",value:function(t,e){var n=this.viewport.select(t).node().getBoundingClientRect(),r=n.x,i=n.y,o=this.viewport.select(e).node().getBoundingClientRect();return{dx:r-o.x,dy:i-o.y}}}],e&&gT(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const wT=_T;function xT(t){return xT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xT(t)}function kT(t,e){for(var n=0;nf?p:f),r.attr("height",d>h?d:h);var y=this.viewport.select(".".concat(e.data.id," .components-background")),v=y.node().getBoundingClientRect();return f=Math.max((a-v.x)/n,e.data.definition.minWidth-e.data.definition.reservedWidth),h=Math.max((u-v.y)/n,e.data.definition.minHeight-e.data.definition.reservedHeight),p=(s-v.x)/n,d=(l-v.y)/n,y.attr("width",p>f?p:f),y.attr("height",d>h?d:h),!1}},{key:"finalize",value:function(t){var e=t.subject.datum().data.id,n=this.viewport.select(".".concat(e," .model")),r=this.pluginData.getComponentById(e);return r.drawOption.width=parseFloat(n.attr("width")),r.drawOption.height=parseFloat(n.attr("height")),this.pluginData.emitEvent({components:[e],type:"Drawer",action:"resize",status:"success"}),!0}},{key:"getMaxPosition",value:function(t){var e=this,n=this.pluginData.getComponentById(t),r=0,i=0;return this.pluginData.getChildren(t).forEach((function(t){var o=e.viewport.select(".".concat(t.id," .model")).node().getBoundingClientRect(),a=o.x,u=o.y,c=o.width,s=o.height;r=Math.max(r,a+c+n.definition.margin),i=Math.max(i,u+s+n.definition.margin)})),{x:r,y:i}}}],r&&dA(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(wT);const wA=_A;function xA(t){return xA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xA(t)}function kA(t){return function(t){if(Array.isArray(t))return EA(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return EA(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?EA(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n0,hasWarning:r>0,numberOfErrors:n,numberOfWarnings:r,hasX:!!t.drawOption.x,hasY:!!t.drawOption.y,isSelected:this.pluginData.scene.selection.includes(t.id),getIcon:function(t){return e.pluginData.resources.icons[t]},canHaveLink:this.pluginData.canHaveLink(t.definition.type),getAttribute:function(e){return t.attributes.find((function(t){return t.name===e}))}})}}],e&&pM(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const vM=yM;function mM(t){return mM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mM(t)}function gM(t,e){for(var n=0;n0&&this.pluginData.emitEvent({components:o,type:"Drawer",action:"move",status:"success"}),a.length>0&&this.pluginData.emitEvent({components:a,type:"Drawer",action:"resize",status:"success"}),!0}},{key:"getNodes",value:function(){var t=this,e={id:"root",parent:null,children:[],depth:0,type:"default",isContainer:!0,margin:this.pluginData.configuration.rootContainer.margin,gap:this.pluginData.configuration.rootContainer.gap},n=new Map(this.pluginData.components.map((function(e){return[e.id,t.createNode(e)]})));return n.set("root",e),n.forEach((function(t){if(t.parent){var e=n.get(t.parent);t.parent=e,e.children.push(t)}})),n}},{key:"createNode",value:function(t){return{id:t.id,parent:t.getContainerId()||"root",type:t.definition.displayType||"default",direction:t.definition.workflowDirection,children:[],depth:this.pluginData.getComponentDepth(t.id)+1,isContainer:t.definition.isContainer,width:t.definition.defaultWidth,height:t.definition.defaultHeight,minWidth:t.definition.minWidth,minHeight:t.definition.minHeight,reservedWidth:t.definition.reservedWidth,reservedHeight:t.definition.reservedHeight,margin:t.definition.margin,gap:t.definition.gap,x:t.drawOption.x,y:t.drawOption.y}}},{key:"generateLayout",value:function(t,e,n){var r=this;e.children.forEach((function(e){r.generateLayout(t,e,n)})),e.isContainer&&"default"===e.type?this.generateDefaultLayout(e,n):e.isContainer&&this.generateWorkflowLayout(t,e)}},{key:"generateDefaultLayout",value:function(t,e){this.text=0;var n=[],r=[],i=t.margin,o=t.gap,a=t.minWidth,u=t.minHeight,c=t.reservedWidth,s=t.reservedHeight,l=0,f=0;t.children.forEach((function(t){t.x&&t.y&&e?(n.push(t),l=Math.max(t.x+t.width,l),f=Math.max(t.y+t.height,f)):r.push(t)}));for(var h,p=0,d=0,y=this.getPoints(p,i,o);r.length>0;)h||(h=r[0]),0===y.length&&(d=0,p+=1,y=this.getPoints(p,i,o)),y.length>0&&this.canBePlaced(n,h,y[d])&&(h.x=y[d].x,h.y=y[d].y,l=Math.max(h.x+h.width,l),f=Math.max(h.y+h.height,f),n.push(h),r.shift(),h=null),(d+=1)>=y.length&&(d=0,p+=1,y=this.getPoints(p,i,o));t.width=Math.max(l+i+c,a),t.height=Math.max(f+i+s,u)}},{key:"canBePlaced",value:function(t,e,n){return t.every((function(t){var r=t.x,i=t.y,o=t.width,a=t.height,u=n.x+e.widthr+o,s=n.y+e.heighti+a;return u||c||s||l}))}},{key:"getPoints",value:function(t,e,n){if(0===t)return[{x:e,y:e}];for(var r=e+n*t,i=e+n*t,o=[],a=e,u=e;u<=r&&(u!==r||i!==a);)o.push({x:u,y:i}),u+=n,o.push({x:r,y:a}),a+=n;return o.push({x:r,y:i}),o}},{key:"generateWorkflowLayout",value:function(t,e){"vertical"===e.direction?this.generateVerticalWorkflowLayout(t,e):this.generateHorizontalWorkflowLayout(t,e)}},{key:"generateHorizontalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,u=e.reservedHeight,c=n,s=0;e.children.forEach((function(t){t.x=c,t.y=n,c=t.x+t.width+r,t.height>s&&(s=t.height)})),e.width=Math.max(c-r+n+a,i),e.height=Math.max(s+2*n+u,o)}},{key:"generateVerticalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,u=e.reservedHeight,c=n,s=0;e.children.forEach((function(t){t.x=n,t.y=c,c=t.y+t.height+r,t.width>s&&(s=t.width)})),e.width=Math.max(s+2*n+a,i),e.height=Math.max(c-r+n+u,o)}},{key:"resize",value:function(t){var e=this.pluginData.getComponentById(t);if(!e.definition.isContainer)return!1;var n=0,r=0;this.pluginData.getChildren(t).forEach((function(t){var e=t.drawOption.x+t.drawOption.width,i=t.drawOption.y+t.drawOption.height;e>n&&(n=e),i>r&&(r=i)}));var i=e.definition,o=i.minWidth,a=i.minHeight,u=i.reservedWidth,c=i.reservedHeight,s=i.margin,l=Math.max(n+2*s+u,o),f=Math.max(r+2*s+c,a);return l===e.drawOption.width&&f===e.drawOption.height||(e.drawOption.width=l,e.drawOption.height=f,this.pluginData.emitEvent({components:[t],type:"Drawer",action:"resize",status:"success"})),!0}}],r&&TM(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(SM);const LM=NM;function RM(t){return RM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},RM(t)}function DM(t){return function(t){if(Array.isArray(t))return IM(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return IM(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IM(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IM(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;M(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function $M(t,e,n,r,i,o,a){try{var u=t[o](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,i)}function KM(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];this.d3.select("#".concat(t)).selectAll(null).remove(),this.d3.select("#".concat(t)).html(""),this.viewport=this.d3.select("#".concat(t)),this.componentRenderer=this.initComponentRenderer(e),this.linkRenderer=this.initLinkRenderer(e),this.layout=new LM(this.pluginData,this.viewport),this.readOnly=e,this.clearActions(),this.readOnly&&(this.pluginData.scene.x=0,this.pluginData.scene.y=0,this.pluginData.scene.zoom=1),this.initActions(),this.initScene()}},{key:"initComponentRenderer",value:function(t){return new vM(this.pluginData,this.viewport,t)}},{key:"initLinkRenderer",value:function(t){return new wM(this.pluginData,this.viewport,t)}},{key:"clearActions",value:function(){this.actions.deleteAction=null,this.actions.dragComponent=null,this.actions.dragScene=null,this.actions.menuAction=null,this.actions.resizeComponent=null,this.actions.toggleSelection=null,this.actions.selectionAll=null,this.actions.deselectionAll=null,this.actions.zoom=null,this.viewport.on("wheel",null),this.d3.select("body").on("keydown",null).on("keyup",null),this.viewport.on(".drag",null)}},{key:"initActions",value:function(){var t=this;this.actions.selectionAll=new QA(this.pluginData,this.viewport,this.layout),this.actions.deleteAction=new PT(this.pluginData,this.viewport,this.layout),this.actions.dragScene=new WT(this.pluginData,this.viewport,this.layout),this.actions.menuAction=new hA(this.pluginData,this.viewport,this.layout),this.actions.link=new rA(this.pluginData,this.viewport,this.layout),this.actions.zoom=new uM(this.pluginData,this.viewport,this.layout),this.actions.dragComponent=new FT(this.pluginData,this.viewport,this.layout),this.actions.resizeComponent=new wA(this.pluginData,this.viewport,this.layout),this.actions.toggleSelection=new jA(this.pluginData,this.viewport,this.layout),this.actions.deselectionAll=new UA(this.pluginData,this.viewport,this.layout),this.viewport.on("wheel",(function(e){t.actions.zoom.execute(e)&&t.draw()})),this.readOnly||this.d3.select("body").on("keydown",(function(e){var n=!1;t.pluginData.configuration.keysBinding.selection.includes(e.key)&&(t.states.selection=!0),t.pluginData.configuration.keysBinding.deleteObject.includes(e.key)&&(n=t.actions.deleteAction.execute(e)),t.pluginData.configuration.keysBinding.selectAll.includes(e.key)&&(n=t.actions.selectionAll.execute(e)),t.pluginData.configuration.keysBinding.deselectAll.includes(e.key)&&(n=t.actions.deselectionAll.execute(e)),n&&t.draw()})).on("keyup",(function(e){var n=!1;t.pluginData.configuration.keysBinding.selection.includes(e.key)&&(t.states.selection=!1),t.pluginData.configuration.keysBinding.deleteObject.includes(e.key)&&(n=t.actions.deleteAction.finalize(e)),t.pluginData.configuration.keysBinding.selectAll.includes(e.key)&&(n=t.actions.selectionAll.finalize(e)),t.pluginData.configuration.keysBinding.deselectAll.includes(e.key)&&(n=t.actions.deselectionAll.finalize(e)),n&&t.draw()}));var e=this.d3.drag().subject((function(e){var n=e.sourceEvent.target.closest(".component");if(t.states.resizing=!!e.sourceEvent.target.closest(".resize-button"),t.states.menuOpening=!!e.sourceEvent.target.closest(".menu-button"),!n)return t.scene;var r=t.viewport.select(Array.from(n.classList).map((function(t){return".".concat(t)})).join(""));return t.states.linking=!!e.sourceEvent.target.closest(".anchor")&&t.pluginData.canHaveLink(r.datum().data.definition.type),r})).on("drag",(function(e){t.states.moving=!0;var n="scene"===e.subject.datum().data.id,r=!1;t.readOnly?t.actions.dragScene.execute(e):(n?r=t.actions.dragScene.execute(e):t.states.linking?(r=t.actions.link.execute(e),t.linkRenderer.render()):t.states.resizing?(r=t.actions.resizeComponent.execute(e),t.linkRenderer.render()):(r=t.actions.dragComponent.execute(e),t.linkRenderer.render()),r&&t.draw())})).on("end",function(){var e,n=(e=UM().mark((function e(n){var r,i,o,a,u,c,s;return UM().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.states.moving,i=t.states.selection,o=t.states.menuOpening,a=t.states.resizing,u=t.states.linking,c="scene"===n.subject.datum().data.id,s=!1,!t.readOnly){e.next=10;break}return c&&r&&t.actions.dragScene.finalize(n),e.abrupt("return");case 10:u?s=t.actions.link.finalize(n):r&&c?s=t.actions.dragScene.finalize(n):a?s=t.actions.resizeComponent.finalize(n):r&&!c?s=t.actions.dragComponent.finalize(n):!r&&o?s=t.actions.menuAction.finalize(n):r||c||!i||(s=t.actions.toggleSelection.finalize(n)),s&&t.draw(),t.states.moving=!1;case 13:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){$M(o,r,i,a,u,"next",t)}function u(t){$M(o,r,i,a,u,"throw",t)}a(void 0)}))});return function(t){return n.apply(this,arguments)}}());this.viewport.call(e)}},{key:"getScene",value:function(){return this.viewport.selectAll(".scene").data(this.getSceneData()).join("svg").attr("class","scene").attr("width","100%").attr("height","100%")}},{key:"initScene",value:function(){var t=this;this.viewport.append("style").text(this.pluginData.resources.style),this.scene=this.getScene(),this.scene.attr("version","1.1"),this.scene.attr("xmlns","http://www.w3.org/2000/svg"),this.scene.append("defs").html(Object.keys(this.pluginData.resources.markers).map((function(e){return t.pluginData.resources.markers[e]})).join(""));var e=this.pluginData.scene,n=e.x,r=e.y,i=e.zoom,o="translate(".concat(n," ").concat(r,") scale(").concat(i,")");this.scene.append("g").attr("class","components").attr("transform",o),this.scene.append("g").attr("class","links").attr("transform",o)}},{key:"draw",value:function(){if(this.scene=this.getScene(),this.componentRenderer.render("scene"),this.linkRenderer.render("scene"),this.readOnly){for(var t=this.viewport.node().getBoundingClientRect(),e=t.width,n=t.height,r=this.viewport.select(".scene .components").node().getBBox(),i=r.width,o=r.height,a=r.x,u=r.y,c=e/ic;)s*=.9;this.scene.attr("viewBox","".concat(a-15," ").concat(u-15," ").concat(i+a+15," ").concat(o+u+15)),this.pluginData.scene.zoom=s}}},{key:"arrangeComponentsPosition",value:function(t,e){this.layout.generateComponentsLayout(t,e)}},{key:"resize",value:function(t){this.layout.resize(t)}},{key:"getSceneData",value:function(){var t=this;return[this.d3.hierarchy(FM({id:"scene",name:"",children:DM(this.pluginData.components.filter((function(t){return null===t.getContainerId()})))},this.pluginData.scene),(function(e){return"scene"===e.id?e.children:t.pluginData.getChildren(e.id)}))]}},{key:"dropComponent",value:function(t,e){var n=e.target.closest(".component");if(t.drawOption.width=t.definition.width,t.drawOption.height=t.definition.height,!n){var r=this.viewport.select(".scene").node().getBoundingClientRect(),i=r.x,o=r.y;return t.drawOption.x=(e.clientX-i-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,void(t.drawOption.y=(e.clientY-o-this.pluginData.scene.y)/this.pluginData.scene.zoom-t.definition.defaultHeight/2)}if(n.canContain(t.definition.type)){var a=this.viewport.select(".".concat(t.id,".container")).node().getBoundingClientRect(),u=a.x,c=a.y;t.drawOption.x=(e.clientX-u-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,t.drawOption.y=(e.clientY-c-this.pluginData.scene.y)/this.pluginData.scene.zoom-t.definition.defaultHeight/2}}},{key:"exportSvg",value:function(t){return this.viewport.selectAll(".scene > g").attr("transform",""),document.querySelector("#".concat(t," .scene")).outerHTML}}],n&&KM(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();const VM=qM;function HM(t){return HM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HM(t)}function WM(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return t.path}))}},{key:"parseConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[e.path],data:{global:!1}});if(null!=e.content){var o=JSON.parse(e.content);o[t.path]?o[t.path][this.pluginData.name]?(Object.keys(o[t.path][this.pluginData.name]).forEach((function(e){var r=n.pluginData.getComponentByConfigurationKey(e);r&&o[t.path][n.pluginData.name][e]&&(r.drawOption=new S(o[t.path][n.pluginData.name][e]))})),this.pluginData.emitEvent({id:i,status:"success"})):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_plugin_content",global:!1}}):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_diagram_content",global:!1}})}else this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_content",global:!1}})}},{key:"isParsable",value:function(t){return null!=t}}],e&&JM(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const nP=eP;function rP(t){return rP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rP(t)}function iP(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e){return t[e.path]="",t}),{});return this.renderFiles(t).forEach((function(t){e[t.path]=t.content})),Object.keys(e).map((function(t){return new dt({path:t,content:e[t]})}))}},{key:"renderFiles",value:function(){return[]}},{key:"renderConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[e.path],data:{global:!1}}),o=JSON.parse(e.content)||{};o[t.path]||(o[t.path]={}),o[t.path][this.pluginData.name]={},this.pluginData.components.filter((function(t){return t.drawOption})).forEach((function(e){var r=e.getConfigurationKey();o[t.path][n.pluginData.name][r]=e.drawOption})),e.content=JSON.stringify(o,(function(t,e){return null===e?void 0:e}),2),this.pluginData.emitEvent({id:i,status:"success"})}}],e&&iP(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const uP=aP;function cP(t){return cP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cP(t)}function sP(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,parentId:null,files:null,components:null,links:null,type:null,action:null,status:null,data:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.id,r=e.parentId,i=e.files,o=e.components,a=e.links,u=e.type,c=e.action,s=e.status,l=e.data;this.id=n||null,this.parentId=r||null,this.startDate=null,this.endDate=null,this.files=i||null,this.components=o||null,this.links=a||null,this.type=u||null,this.action=c||null,this.status=s||null,this.data=l||null}));const pP=hP;function dP(t){return dP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dP(t)}function yP(t,e,n){return e=mP(e),function(t,e){if(e&&("object"==dP(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,vP()?Reflect.construct(e,n||[],mP(t).constructor):e.apply(t,n))}function vP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(vP=function(){return!!t})()}function mP(t){return mP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mP(t)}function gP(t,e){return gP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gP(t,e)}var bP=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{anchorName:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=yP(this,e,[n])).anchorName=n.anchorName||null,t.endX=null,t.endY=null,t.isTemporary=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gP(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(et);const _P=bP;function wP(t){return wP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wP(t)}function xP(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:{name:null,version:null,components:[],variables:[],definitions:{components:[],links:[]},parseLogs:[],resources:{},scene:{x:0,y:0,zoom:1,selection:[],selectionRef:null}},y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=d.name||null,this.version=d.version||null,this.components=d.components||[],this.scene={x:(null===(n=d.scene)||void 0===n?void 0:n.x)||0,y:(null===(r=d.scene)||void 0===r?void 0:r.y)||0,zoom:(null===(i=d.scene)||void 0===i?void 0:i.zoom)||1,selection:(null===(o=d.scene)||void 0===o?void 0:o.selection)||[],selectionRef:(null===(a=d.scene)||void 0===a?void 0:a.selectionRef)||null},this.variables=d.variables||[],this.definitions={components:(null===(u=d.definitions)||void 0===u?void 0:u.components)||[],links:(null===(c=d.definitions)||void 0===c?void 0:c.links)||[]},this.parseLogs=d.parseLogs||[],this.__eventIndex=0,this.eventManager=y,this.eventLogs=[],this.configuration=e,this.resources={icons:EP({},null===(s=d.resources)||void 0===s?void 0:s.icons),markers:EP({},null===(l=d.resources)||void 0===l?void 0:l.markers),links:EP({},null===(f=d.resources)||void 0===f?void 0:f.links),models:EP({},null===(h=d.resources)||void 0===h?void 0:h.models),style:(null===(p=d.resources)||void 0===p?void 0:p.style)||""},this.temporaryLink=null},e=[{key:"coreVersion",get:function(){return"0.27.3"}},{key:"getComponentById",value:function(t){return this.components.find((function(e){return e.id===t}))||null}},{key:"getComponentDepth",value:function(t){var e=this.getComponentById(t).getContainerId();return e?this.getComponentDepth(e)+1:0}},{key:"getComponentByConfigurationKey",value:function(t){return this.getComponentById(t)}},{key:"renameComponentExternalId",value:function(t,e){this.getComponentById(t).setExternalId(e)}},{key:"getComponentsByType",value:function(t){return this.components.filter((function(e){var n=e.definition;return n&&n.type===t}))}},{key:"addComponent",value:function(t,e){var n=this.generateComponentId();return this.components.push(new L({id:n,name:n,definition:t,path:e})),n}},{key:"generateComponentId",value:function(){var t=this.components.map((function(t){return t.id})).filter((function(t){return new RegExp("".concat("id_","\\d+")).test(t)})).map((function(t){return parseInt(t.substring(3),10)})),e=0===t.length?1:Math.max.apply(Math,function(t){return function(t){if(Array.isArray(t))return xP(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return xP(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xP(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t))+1;return"".concat("id_").concat(e)}},{key:"removeComponentById",value:function(t){var e=this;this.getChildren(t).forEach((function(t){return e.removeComponentById(t.id)})),this.components=this.components.filter((function(e){return e.id!==t})),this.components.forEach((function(e){e.removeLinkAttribute(t)}))}},{key:"removeLink",value:function(t){var e=t.source,n=t.target,r=t.definition.attributeRef;this.getComponentById(e).removeLinkAttribute(n,r)}},{key:"getLinks",value:function(){var t=this,e=[];return this.definitions.links.forEach((function(n){t.getComponentsByType(n.sourceRef).forEach((function(r){var i=r.getAttributeByName(n.attributeRef);i&&t.getLinkedComponentsIds(i).forEach((function(t){return e.push(new et({definition:n,source:r.id,target:t,isReverse:"Reverse"===i.definition.linkType}))}))}))})),this.temporaryLink&&e.push(this.temporaryLink),e.concat(this.getWorkflowLinks())}},{key:"getAttributeValue",value:function(t){return t.isVariable?this.getVariableValue(t.value):t.value}},{key:"getLinkedComponentsIds",value:function(t){var e=this.getAttributeValue(t);return null===e?[]:Array.isArray(e)?e:[e]}},{key:"getVariableValue",value:function(t){var e;return(null===(e=this.variables.find((function(e){return e.name===t})))||void 0===e?void 0:e.value)||null}},{key:"setVariableValue",value:function(t,e){var n=this.variables.find((function(e){return e.name===t}));n&&(n.value=e)}},{key:"getComponentIdFromValue",value:function(t){return t}},{key:"canHaveLink",value:function(t){return this.definitions.links.some((function(e){return e.sourceRef===t}))}},{key:"canBeLinked",value:function(t,e){return this.definitions.links.some((function(n){var r=n.sourceRef,i=n.targetRef;return r===t&&i===e}))}},{key:"createTemporaryLink",value:function(t,e){this.temporaryLink=new _P({anchorName:e,source:t,definition:this.definitions.links.find((function(t){return t.isTemporary}))})}},{key:"getWorkflowLinks",value:function(){var t=this;return this.components.filter((function(t){var e;return null===(e=t.definition.displayType)||void 0===e?void 0:e.match("workflow")})).reduce((function(e,n){var r=t.getChildren(n.id);if(r.length>1)for(var i=0;in,this.components.splice(i,0,r),this.components.splice(n+(it}))}},{key:"emitEvent",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.id;return r?(e=this.getEventLogById(r),Object.keys(n).forEach((function(t){e[t]=n[t]}))):(this.__eventIndex+=1,r=this.__eventIndex,(e=new pP(EP(EP({},n),{},{id:r}))).startDate=Date.now(),this.eventLogs.push(e)),["success","warning","error"].includes(e.status)&&(e.endDate=Date.now()),null!==(t=this.eventManager)&&void 0!==t&&t.next&&this.eventManager.next({plugin:this.name,event:EP({},e)}),r}}],e&&OP(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const MP=AP;function PP(t){return PP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},PP(t)}function CP(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function jP(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{editor:{syntax:null},restrictiveFolder:null,defaultFileName:null,defaultFileExtension:null,tags:[],isFolderTypeDiagram:!0,extraResources:[],rootContainer:{margin:30,gap:50},container:{margin:30,gap:50},keysBinding:{},i18n:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editor=jP({syntax:null},a.editor),this.restrictiveFolder=a.restrictiveFolder||null,this.defaultFileName=a.defaultFileName||null,this.defaultFileExtension=a.defaultFileExtension||null,this.tags=a.tags||[],this.isFolderTypeDiagram=null===(e=a.isFolderTypeDiagram)||void 0===e||e,this.extraResources=a.extraResources||[],this.rootContainer={margin:(null===(n=a.rootContainer)||void 0===n?void 0:n.margin)||30,gap:(null===(r=a.rootContainer)||void 0===r?void 0:r.gap)||50},this.container={margin:(null===(i=a.container)||void 0===i?void 0:i.margin)||30,gap:(null===(o=a.container)||void 0===o?void 0:o.gap)||50},this.keysBinding=jP({moveSceneUp:["ArrowUp"],moveSceneDown:["ArrowDown"],moveSceneLeft:["ArrowLeft"],moveSceneRight:["ArrowRight"],moveComponentUp:[],moveComponentDown:[],moveComponentLeft:[],moveComponentRight:[],zoomIn:["+"],zoomOut:["-"],deleteObject:["Delete"],editComponent:[",","?"],selection:["Shift"],selectAll:["A"],deselectAll:["D"]},a.keysBinding),this.i18n=a.i18n||{}}));const BP=IP;function FP(t){return FP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},FP(t)}function zP(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{event:null,configuration:null,pluginData:null,pluginDrawer:null,pluginMetadata:null,pluginParser:null,pluginRenderer:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.configuration=e.configuration||new BP,this.data=e.pluginData||new MP(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new VM(this.data),this.__metadata=e.pluginMetadata||new ZM(this.data),this.__parser=e.pluginParser||new nP(this.data),this.__renderer=e.pluginRenderer||new uP(this.data)},e=[{key:"init",value:function(){var t=this.data.emitEvent({type:"Plugin",action:"init",status:"running"});this.__metadata.parse(t),this.data.initLinkDefinitions(t),this.data.emitEvent({id:t,status:"success"})}},{key:"initResources",value:function(t){this.data.resources=t}},{key:"initDrawer",value:function(t,e){this.__drawer.init(t,e)}},{key:"draw",value:function(){this.__drawer.draw()}},{key:"parse",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Parser",action:"read",status:"running",files:n.map((function(t){return t.path})).concat(null==e?void 0:e.path),data:{global:!0}});this.__parser.parse(t,n,r),this.__parser.parseConfiguration(t,e,r),this.data.emitEvent({id:r,status:"success"})}},{key:"isParsable",value:function(t){return this.__parser.isParsable(t)}},{key:"getModels",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.__parser.getModels(e.filter((function(e){return t.isParsable(e)})))}},{key:"render",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Render",action:"write",status:"running",files:n.map((function(t){return t.path})).concat(e.path),data:{global:!0}});this.__renderer.renderConfiguration(t,e,r);var i=this.__renderer.render(n,r).concat(e);return this.data.emitEvent({id:r,status:"success"}),i}},{key:"arrangeComponentsPosition",value:function(t,e){this.__drawer.arrangeComponentsPosition(t,e)}},{key:"resize",value:function(t){this.__drawer.resize(t)}},{key:"exportSvg",value:function(t){this.__drawer.init(t,!0),this.draw();var e=this.__drawer.exportSvg(t);return this.__drawer.init(t,!1),this.draw(),e}},{key:"getComponentPosition",value:function(t,e){var n=e.x,r=e.y,i=this.__drawer.actions.zoom,o=i.scale,a=i.translate,u=document.querySelector("#".concat(t)).getBoundingClientRect(),c=u.left,s=u.top;return{x:(n-c-a.x)/o,y:(r-s-a.y)/o}}},{key:"addComponent",value:function(t,e,n,r){var i=this.data.addComponent(e,n),o=this.data.getComponentById(i);if(t){var a=this.data.getComponentById(t);o.setReferenceAttribute(a)}return r&&this.__drawer.dropComponent(o,r),i}}],e&&zP(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const KP=$P;function YP(t){return YP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},YP(t)}function qP(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,value:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.value;this.type=n||null,this.value=r||null}));const GP=WP;function XP(t){return XP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},XP(t)}function ZP(t,e,n){return e=JP(e),function(t,e){if(e&&("object"==XP(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,QP()?Reflect.construct(e,n||[],JP(t).constructor):e.apply(t,n))}function QP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(QP=function(){return!!t})()}function JP(t){return JP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},JP(t)}function tC(t,e){return tC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tC(t,e)}var eC=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,value:null,category:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=ZP(this,e,[n]);var r=n.name,i=n.type,o=n.value,a=n.category;return t.__class="Variable",t.name=r||null,t.type=i||null,t.value=o||null,t.category=a||null,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tC(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(b);const nC=eC})();var i=exports;for(var o in r)i[o]=r[o];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c673bfdc..f8ec70ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ditrit/leto-modelizer-plugin-core", - "version": "0.27.2", + "version": "0.27.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ditrit/leto-modelizer-plugin-core", - "version": "0.27.2", + "version": "0.27.3", "license": "MPL-2.0", "dependencies": { "d3": "=7.9.0", diff --git a/package.json b/package.json index ca9e3157..0786c124 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ditrit/leto-modelizer-plugin-core", - "version": "0.27.2", + "version": "0.27.3", "description": "Library that contains all models for modelling tools in Leto's projects.", "main": "dist/leto-modelizer-plugin-core.js", "exports": {