diff --git a/changelog.md b/changelog.md index 9645181..f79b53e 100644 --- a/changelog.md +++ b/changelog.md @@ -5,7 +5,7 @@ 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) -## [Unreleased] +## [0.5.2] - 2024/08/20 ### Fixed @@ -139,6 +139,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Setup first version of parser. - Setup first version of renderer. +[0.5.2]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.5.2 [0.5.1]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.5.1 [0.5.0]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.5.0 [0.4.2]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.4.2 diff --git a/dist/githubator-plugin.js b/dist/githubator-plugin.js index 0e079b1..a25a3fc 100644 --- a/dist/githubator-plugin.js +++ b/dist/githubator-plugin.js @@ -1,2 +1,2 @@ /*! For license information please see githubator-plugin.js.LICENSE.txt */ -(()=>{var t={149:(t,e)=>{(()=>{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 s(t,e){return i.hasOwnProperty.call(t,e)}function u(t){return o[t]}function c(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,c.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 s=new Error(t).stack;o=function(){return s}}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,c).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:u,Root:f,NodeList:l,Value:c,Literal:h,Symbol:p,Group:d,Array:m,Pair:y,Dict:v,Output:$,Capture:K,TemplateData:U,If:b,IfAsync:_,InlineIf:w,For:x,AsyncEach:k,AsyncAll:E,Macro:O,Caller:S,Import:T,FromImport:A,FunCall:N,Filter:L,FilterAsync:M,KeywordArgs:C,Block:j,Super:P,Extends:R,Include:I,Set:D,Switch:B,Case:F,LookupVal:g,BinOp:q,In:V,Is:Y,Or:W,And:H,Not:G,Add:J,Concat:X,Sub:Q,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:at,CompareOperand:st,CallExtension:ut,CallExtensionAsync:ct,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 ut)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 u?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),s=n(0).TemplateError,u=n(2).Frame,c=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 s(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 u=this._tmpid();this._emitLine(", "+this._makeCallback(u)),this._emitLine(this.buffer+" += runtime.suppressValue("+u+", "+s+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+s+" && 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 s=n._tmpid();n._emitLine("var "+s+" = "+o+"["+r+"]["+a+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+a+"]);"),e.set(t.name.children[a].value,s)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var s=t.name.children,u=s[0],c=s[1],l=this._tmpid(),f=this._tmpid();e.set(u.value,l),e.set(c.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("'+u.value+'", '+l+");"),this._emitLine('frame.set("'+c.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(),s=this._tmpid(),u=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+s+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof a.Array){var c=t.name.children.length;this._emit("runtime."+u+"("+s+", "+c+", 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."+u+"("+s+", 1, function("+l+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+l+'", '+l+");"),e.set(l,l)}this._emitLoopBindings(t,s,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 (!"+s+".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(),s=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 c,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+'"'}));c=s?e.push(!0):new u,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+l.join(", ")+") {","var callerFrame = frame;","frame = "+(s?"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+");"),c.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,c),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,c)})),this._emitLine("frame = "+(s?"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),s=n?"true":"false",u=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+s+", "+o+", "+u+", "+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,s=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 "+s+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,s),e.parent?n._emitLine('frame.set("'+o+'", '+s+");"):n._emitLine('context.setVariable("'+o+'", '+s+");")}))},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 u,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 u;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}(c);t.exports={compile:function(t,e,n,r,a){void 0===a&&(a={});var s=new f(r,a.throwOnUndefined),u=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return s.compile(o.transform(i.parse(u,n,a),e,r)),s.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),s=n(0),u=n(5),c=n(18),l=n(10),f=l.FileSystemLoader,h=l.WebLoader,p=l.PrecompiledLoader,d=n(20),m=n(21),y=n(1),v=y.Obj,g=y.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))}}}},O=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=s.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=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],s._entries(c).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),s._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=s.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,u=this,c=null;if(t&&t.raw&&(t=t.raw),s.isFunction(n)&&(i=n,n=null,e=e||!1),s.isFunction(e)&&(i=e,e=!1),t instanceof T)c=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 s=this.parsePrimary();if("_"===s.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",s.lineno,s.colno),this.skipSymbol("as")){var u=this.parsePrimary();r.addChild(new o.Pair(s.lineno,s.colno,s,u))}else r.addChild(s);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},u.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},u.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},u.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},u.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},u.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},u.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 s,u=this.peekToken(),c=[];do{this.skipSymbol(n);var l=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);c.push(new o.Case(u.line,u.col,l,f)),u=this.peekToken()}while(u&&u.value===n);switch(u.value){case r:this.advanceAfterBlockEnd(),s=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,c,s)},u.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==s.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 u=a[0],c=a[1],l=a[2];l===t?r+=1:l===e&&(r-=1),0===r?(i+=c,this.tokens.backN(u.length-c.length)):i+=u}return new o.Output(s.lineno,s.colno,[new o.TemplateData(s.lineno,s.colno,i)])},u.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},u.parseExpression=function(){return this.parseInlineIf()},u.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},u.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},u.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},u.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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)},u.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)},u.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},u.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},u.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])},u.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 s=this.parseExpression();t.addChild(s)}}return t},u.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),s=!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(s&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var u=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?a.addChild(new o.Pair(u.lineno,u.colno,u,this.parseExpression())):r.addChild(u)}s=!0}return a.children.length&&r.addChild(a),r},u.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],D=M+this.current();switch(-1!==r.indexOf(I,D)&&(this.forward(),M=D,-1!==r.indexOf(I,D+this.current())&&(M=D+this.current(),this.forward())),M){case"(":R=d;break;case")":R=m;break;case"[":R=y;break;case"]":R=v;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 L(R,M,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return L(O,t+"."+B,e,n)}return L("int",t,e,n)}if(t.match(/^(true|false)$/))return L(S,t,e,n);if("none"===t)return L(T,t,e,n);if("null"===t)return L(T,t,e,n);if(t)return L(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=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,L(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,L(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var U=t.slice(-this.colno);if(/^\s+$/.test(U)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return L(K?p:u,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 u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}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 s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,l=y(u,c);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},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.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 s(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,a=r.repeat(" ",n/2-n%2),s=r.repeat(" ",n/2);return i.copySafeness(t,a+t+s)},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"),s=r.repeat(" ",e),u=a.map((function(t,e){return 0!==e||n?""+s+t:t})).join("\n");return i.copySafeness(t,u)},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=u,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=c(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=c(!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 s=t.indexOf(e);if(0===r||-1===s)return t;for(var u=0,c=0;s>-1&&(-1===r||c=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})),s=r.getAttrGetter(i);return a.sort((function(t,a){var u=i?s(t):t,c=i?s(a):a;if(o.env.opts.throwOnUndefined&&i&&(void 0===u||void 0===c))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(u)&&r.isString(c)&&(u=u.toLowerCase(),c=c.toLowerCase()),uc?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 s(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 s=t.lastIndexOf(" ",e);-1===s&&(s=e),t=t.substring(0,s)}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\./,m=/\.(?: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+"":m.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 y=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=y,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),s=n(7).Environment,u=n(24);function c(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 s([]),r=e.wrapper||u;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 s([])).asyncFilters,u=n.extensionsList;e=e.replace(/\\/g,"/");try{r=a.compile(t,i,u,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 s([]),o=e.wrapper||u;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 s=i.join(o,a),u=s.substr(i.join(t,"/").length),l=r.statSync(s);l&&l.isDirectory()?c(u+="/",e.exclude)||n(s):c(u,e.include)&&p.push(s)}))}(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 n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";r.r(i),r.d(i,{Component:()=>O,ComponentAttribute:()=>f,ComponentAttributeDefinition:()=>j,ComponentDefinition:()=>T,ComponentDrawOption:()=>v,ComponentLink:()=>$,ComponentLinkDefinition:()=>U,ComponentRenderer:()=>FA,DefaultConfiguration:()=>WN,DefaultData:()=>$N,DefaultDrawer:()=>fN,DefaultMetadata:()=>mN,DefaultParser:()=>bN,DefaultPlugin:()=>XN,DefaultRender:()=>kN,FileInformation:()=>m,FileInput:()=>G,LinkRenderer:()=>zA,ParserLog:()=>s,Tag:()=>ZN,Variable:()=>aL});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 n(t,e,n){return(e=o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}r.r(t),r.d(t,{Adder:()=>xt,Delaunay:()=>Uu,FormatSpecifier:()=>sf,InternMap:()=>Ot,InternSet:()=>St,Node:()=>My,Path:()=>is,Voronoi:()=>Iu,ZoomTransform:()=>$S,active:()=>ca,arc:()=>EE,area:()=>CE,areaRadial:()=>KE,ascending:()=>J,autoType:()=>wc,axisBottom:()=>pn,axisLeft:()=>dn,axisRight:()=>hn,axisTop:()=>fn,bin:()=>ae,bisect:()=>ot,bisectCenter:()=>it,bisectLeft:()=>rt,bisectRight:()=>nt,bisector:()=>Q,blob:()=>ll,blur:()=>at,blur2:()=>st,blurImage:()=>ut,brush:()=>Ba,brushSelection:()=>Ra,brushX:()=>Ia,brushY:()=>Da,buffer:()=>hl,chord:()=>Ga,chordDirected:()=>Xa,chordTranspose:()=>Ja,cluster:()=>Ey,color:()=>oi,contourDensity:()=>pu,contours:()=>ou,count:()=>pt,create:()=>Qk,creator:()=>_r,cross:()=>vt,csv:()=>vl,csvFormat:()=>uc,csvFormatBody:()=>cc,csvFormatRow:()=>fc,csvFormatRows:()=>lc,csvFormatValue:()=>hc,csvParse:()=>ac,csvParseRows:()=>sc,cubehelix:()=>Gs,cumsum:()=>gt,curveBasis:()=>MO,curveBasisClosed:()=>jO,curveBasisOpen:()=>RO,curveBumpX:()=>VE,curveBumpY:()=>YE,curveBundle:()=>DO,curveCardinal:()=>$O,curveCardinalClosed:()=>UO,curveCardinalOpen:()=>qO,curveCatmullRom:()=>WO,curveCatmullRomClosed:()=>GO,curveCatmullRomOpen:()=>XO,curveLinear:()=>AE,curveLinearClosed:()=>ZO,curveMonotoneX:()=>sS,curveMonotoneY:()=>uS,curveNatural:()=>fS,curveStep:()=>pS,curveStepAfter:()=>mS,curveStepBefore:()=>dS,descending:()=>X,deviation:()=>_t,difference:()=>qe,disjoint:()=>Ve,dispatch:()=>_n,drag:()=>Gu,dragDisable:()=>Fr,dragEnable:()=>$r,dsv:()=>yl,dsvFormat:()=>ic,easeBack:()=>il,easeBackIn:()=>nl,easeBackInOut:()=>il,easeBackOut:()=>rl,easeBounce:()=>Zc,easeBounceIn:()=>Qc,easeBounceInOut:()=>tl,easeBounceOut:()=>Zc,easeCircle:()=>Kc,easeCircleIn:()=>Fc,easeCircleInOut:()=>Kc,easeCircleOut:()=>$c,easeCubic:()=>oa,easeCubicIn:()=>ra,easeCubicInOut:()=>oa,easeCubicOut:()=>ia,easeElastic:()=>sl,easeElasticIn:()=>al,easeElasticInOut:()=>ul,easeElasticOut:()=>sl,easeExp:()=>Bc,easeExpIn:()=>Ic,easeExpInOut:()=>Bc,easeExpOut:()=>Dc,easeLinear:()=>kc,easePoly:()=>Nc,easePolyIn:()=>Tc,easePolyInOut:()=>Nc,easePolyOut:()=>Ac,easeQuad:()=>Sc,easeQuadIn:()=>Ec,easeQuadInOut:()=>Sc,easeQuadOut:()=>Oc,easeSin:()=>Pc,easeSinIn:()=>Cc,easeSinInOut:()=>Pc,easeSinOut:()=>jc,every:()=>Be,extent:()=>wt,fcumsum:()=>Et,filter:()=>$e,flatGroup:()=>Rt,flatRollup:()=>It,forceCenter:()=>Sl,forceCollide:()=>Fl,forceLink:()=>Ul,forceManyBody:()=>Xl,forceRadial:()=>Ql,forceSimulation:()=>Jl,forceX:()=>Zl,forceY:()=>tf,format:()=>hf,formatDefaultLocale:()=>vf,formatLocale:()=>yf,formatPrefix:()=>pf,formatSpecifier:()=>af,fsum:()=>kt,geoAlbers:()=>Fm,geoAlbersUsa:()=>$m,geoArea:()=>wh,geoAzimuthalEqualArea:()=>qm,geoAzimuthalEqualAreaRaw:()=>zm,geoAzimuthalEquidistant:()=>Ym,geoAzimuthalEquidistantRaw:()=>Vm,geoBounds:()=>np,geoCentroid:()=>dp,geoCircle:()=>Op,geoClipAntimeridian:()=>Ip,geoClipCircle:()=>Dp,geoClipExtent:()=>Vp,geoClipRectangle:()=>qp,geoConicConformal:()=>Qm,geoConicConformalRaw:()=>Xm,geoConicEqualArea:()=>Bm,geoConicEqualAreaRaw:()=>Dm,geoConicEquidistant:()=>ny,geoConicEquidistantRaw:()=>ey,geoContains:()=>ud,geoDistance:()=>Zp,geoEqualEarth:()=>cy,geoEqualEarthRaw:()=>uy,geoEquirectangular:()=>ty,geoEquirectangularRaw:()=>Zm,geoGnomonic:()=>fy,geoGnomonicRaw:()=>ly,geoGraticule:()=>fd,geoGraticule10:()=>hd,geoIdentity:()=>hy,geoInterpolate:()=>pd,geoLength:()=>Jp,geoMercator:()=>Hm,geoMercatorRaw:()=>Wm,geoNaturalEarth1:()=>dy,geoNaturalEarth1Raw:()=>py,geoOrthographic:()=>yy,geoOrthographicRaw:()=>my,geoPath:()=>_m,geoProjection:()=>Pm,geoProjectionMutator:()=>Rm,geoRotation:()=>xp,geoStereographic:()=>gy,geoStereographicRaw:()=>vy,geoStream:()=>Xf,geoTransform:()=>wm,geoTransverseMercator:()=>_y,geoTransverseMercatorRaw:()=>by,gray:()=>Ns,greatest:()=>pe,greatestIndex:()=>Le,group:()=>Ct,groupSort:()=>Wt,groups:()=>jt,hcl:()=>Bs,hierarchy:()=>Sy,histogram:()=>ae,hsl:()=>gi,html:()=>El,image:()=>bl,index:()=>Ft,indexes:()=>$t,interpolate:()=>qi,interpolateArray:()=>Ii,interpolateBasis:()=>Ei,interpolateBasisClosed:()=>Oi,interpolateBlues:()=>Ok,interpolateBrBG:()=>Dx,interpolateBuGn:()=>ek,interpolateBuPu:()=>rk,interpolateCividis:()=>Ik,interpolateCool:()=>Fk,interpolateCubehelix:()=>Vv,interpolateCubehelixDefault:()=>Dk,interpolateCubehelixLong:()=>Yv,interpolateDate:()=>Bi,interpolateDiscrete:()=>Cv,interpolateGnBu:()=>ok,interpolateGreens:()=>Tk,interpolateGreys:()=>Nk,interpolateHcl:()=>Uv,interpolateHclLong:()=>zv,interpolateHsl:()=>Bv,interpolateHslLong:()=>Fv,interpolateHue:()=>jv,interpolateInferno:()=>Jk,interpolateLab:()=>$v,interpolateMagma:()=>Gk,interpolateNumber:()=>Fi,interpolateNumberArray:()=>Pi,interpolateObject:()=>$i,interpolateOrRd:()=>sk,interpolateOranges:()=>Rk,interpolatePRGn:()=>Fx,interpolatePiYG:()=>Kx,interpolatePlasma:()=>Xk,interpolatePuBu:()=>fk,interpolatePuBuGn:()=>ck,interpolatePuOr:()=>zx,interpolatePuRd:()=>pk,interpolatePurples:()=>Mk,interpolateRainbow:()=>Kk,interpolateRdBu:()=>Vx,interpolateRdGy:()=>Wx,interpolateRdPu:()=>mk,interpolateRdYlBu:()=>Gx,interpolateRdYlGn:()=>Xx,interpolateReds:()=>jk,interpolateRgb:()=>Li,interpolateRgbBasis:()=>Ci,interpolateRgbBasisClosed:()=>ji,interpolateRound:()=>Pv,interpolateSinebow:()=>Vk,interpolateSpectral:()=>Zx,interpolateString:()=>zi,interpolateTransformCss:()=>Co,interpolateTransformSvg:()=>jo,interpolateTurbo:()=>Yk,interpolateViridis:()=>Hk,interpolateWarm:()=>Bk,interpolateYlGn:()=>bk,interpolateYlGnBu:()=>vk,interpolateYlOrBr:()=>wk,interpolateYlOrRd:()=>kk,interpolateZoom:()=>Iv,interrupt:()=>So,intersection:()=>Ye,interval:()=>DS,isoFormat:()=>PS,isoParse:()=>IS,json:()=>wl,lab:()=>Ls,lch:()=>Ds,least:()=>Ae,leastIndex:()=>Ne,line:()=>ME,lineRadial:()=>$E,link:()=>JE,linkHorizontal:()=>XE,linkRadial:()=>ZE,linkVertical:()=>QE,local:()=>tE,map:()=>Ke,matcher:()=>Sn,max:()=>se,maxIndex:()=>ue,mean:()=>be,median:()=>_e,medianIndex:()=>we,merge:()=>xe,min:()=>ce,minIndex:()=>le,mode:()=>ke,namespace:()=>Kn,namespaces:()=>$n,nice:()=>ie,now:()=>io,pack:()=>nv,packEnclose:()=>$y,packSiblings:()=>tv,pairs:()=>Ee,partition:()=>uv,path:()=>os,pathRound:()=>as,permute:()=>zt,pie:()=>RE,piecewise:()=>Wv,pointRadial:()=>UE,pointer:()=>Yi,pointers:()=>nE,polygonArea:()=>Gv,polygonCentroid:()=>Jv,polygonContains:()=>eg,polygonHull:()=>tg,polygonLength:()=>ng,precisionFixed:()=>gf,precisionPrefix:()=>bf,precisionRound:()=>_f,quadtree:()=>Ml,quantile:()=>de,quantileIndex:()=>ye,quantileSorted:()=>me,quantize:()=>Hv,quickselect:()=>fe,radialArea:()=>KE,radialLine:()=>$E,randomBates:()=>cg,randomBernoulli:()=>hg,randomBeta:()=>mg,randomBinomial:()=>yg,randomCauchy:()=>gg,randomExponential:()=>lg,randomGamma:()=>dg,randomGeometric:()=>pg,randomInt:()=>og,randomIrwinHall:()=>ug,randomLcg:()=>Eg,randomLogNormal:()=>sg,randomLogistic:()=>bg,randomNormal:()=>ag,randomPareto:()=>fg,randomPoisson:()=>_g,randomUniform:()=>ig,randomWeibull:()=>vg,range:()=>Se,rank:()=>Te,reduce:()=>Ue,reverse:()=>ze,rgb:()=>ci,ribbon:()=>vs,ribbonArrow:()=>gs,rollup:()=>Dt,rollups:()=>Bt,scaleBand:()=>Ng,scaleDiverging:()=>gx,scaleDivergingLog:()=>bx,scaleDivergingPow:()=>wx,scaleDivergingSqrt:()=>xx,scaleDivergingSymlog:()=>_x,scaleIdentity:()=>qg,scaleImplicit:()=>Tg,scaleLinear:()=>zg,scaleLog:()=>Zg,scaleOrdinal:()=>Ag,scalePoint:()=>Mg,scalePow:()=>ub,scaleQuantile:()=>hb,scaleQuantize:()=>pb,scaleRadial:()=>fb,scaleSequential:()=>fx,scaleSequentialLog:()=>hx,scaleSequentialPow:()=>dx,scaleSequentialQuantile:()=>yx,scaleSequentialSqrt:()=>mx,scaleSequentialSymlog:()=>px,scaleSqrt:()=>cb,scaleSymlog:()=>rb,scaleThreshold:()=>db,scaleTime:()=>sx,scaleUtc:()=>ux,scan:()=>Me,schemeAccent:()=>Ox,schemeBlues:()=>Ek,schemeBrBG:()=>Ix,schemeBuGn:()=>tk,schemeBuPu:()=>nk,schemeCategory10:()=>Ex,schemeDark2:()=>Sx,schemeGnBu:()=>ik,schemeGreens:()=>Sk,schemeGreys:()=>Ak,schemeObservable10:()=>Tx,schemeOrRd:()=>ak,schemeOranges:()=>Pk,schemePRGn:()=>Bx,schemePaired:()=>Ax,schemePastel1:()=>Nx,schemePastel2:()=>Lx,schemePiYG:()=>$x,schemePuBu:()=>lk,schemePuBuGn:()=>uk,schemePuOr:()=>Ux,schemePuRd:()=>hk,schemePurples:()=>Lk,schemeRdBu:()=>qx,schemeRdGy:()=>Yx,schemeRdPu:()=>dk,schemeRdYlBu:()=>Hx,schemeRdYlGn:()=>Jx,schemeReds:()=>Ck,schemeSet1:()=>Mx,schemeSet2:()=>Cx,schemeSet3:()=>jx,schemeSpectral:()=>Qx,schemeTableau10:()=>Px,schemeYlGn:()=>gk,schemeYlGnBu:()=>yk,schemeYlOrBr:()=>_k,schemeYlOrRd:()=>xk,select:()=>Pr,selectAll:()=>rE,selection:()=>jr,selector:()=>xn,selectorAll:()=>On,shuffle:()=>Ce,shuffler:()=>je,some:()=>Fe,sort:()=>qt,stack:()=>_S,stackOffsetDiverging:()=>xS,stackOffsetExpand:()=>wS,stackOffsetNone:()=>yS,stackOffsetSilhouette:()=>kS,stackOffsetWiggle:()=>ES,stackOrderAppearance:()=>OS,stackOrderAscending:()=>TS,stackOrderDescending:()=>NS,stackOrderInsideOut:()=>LS,stackOrderNone:()=>vS,stackOrderReverse:()=>MS,stratify:()=>dv,style:()=>Qn,subset:()=>Je,sum:()=>Pe,superset:()=>He,svg:()=>Ol,symbol:()=>TO,symbolAsterisk:()=>eO,symbolCircle:()=>nO,symbolCross:()=>rO,symbolDiamond:()=>aO,symbolDiamond2:()=>sO,symbolPlus:()=>uO,symbolSquare:()=>cO,symbolSquare2:()=>lO,symbolStar:()=>dO,symbolTimes:()=>EO,symbolTriangle:()=>yO,symbolTriangle2:()=>gO,symbolWye:()=>kO,symbolX:()=>EO,symbols:()=>OO,symbolsFill:()=>OO,symbolsStroke:()=>SO,text:()=>dl,thresholdFreedmanDiaconis:()=>ve,thresholdScott:()=>ge,thresholdSturges:()=>oe,tickFormat:()=>Kg,tickIncrement:()=>ne,tickStep:()=>re,ticks:()=>ee,timeDay:()=>Ib,timeDays:()=>Db,timeFormat:()=>I_,timeFormatDefaultLocale:()=>rx,timeFormatLocale:()=>P_,timeFriday:()=>Hb,timeFridays:()=>e_,timeHour:()=>Cb,timeHours:()=>jb,timeInterval:()=>kb,timeMillisecond:()=>Eb,timeMilliseconds:()=>Ob,timeMinute:()=>Ab,timeMinutes:()=>Nb,timeMonday:()=>qb,timeMondays:()=>Xb,timeMonth:()=>g_,timeMonths:()=>b_,timeParse:()=>D_,timeSaturday:()=>Gb,timeSaturdays:()=>n_,timeSecond:()=>Sb,timeSeconds:()=>Tb,timeSunday:()=>zb,timeSundays:()=>Jb,timeThursday:()=>Wb,timeThursdays:()=>t_,timeTickInterval:()=>L_,timeTicks:()=>N_,timeTuesday:()=>Vb,timeTuesdays:()=>Qb,timeWednesday:()=>Yb,timeWednesdays:()=>Zb,timeWeek:()=>zb,timeWeeks:()=>Jb,timeYear:()=>x_,timeYears:()=>k_,timeout:()=>ho,timer:()=>so,timerFlush:()=>uo,transition:()=>ta,transpose:()=>Re,tree:()=>kv,treemap:()=>Av,treemapBinary:()=>Nv,treemapDice:()=>sv,treemapResquarify:()=>Mv,treemapSlice:()=>Ev,treemapSliceDice:()=>Lv,treemapSquarify:()=>Tv,tsv:()=>gl,tsvFormat:()=>yc,tsvFormatBody:()=>vc,tsvFormatRow:()=>bc,tsvFormatRows:()=>gc,tsvFormatValue:()=>_c,tsvParse:()=>dc,tsvParseRows:()=>mc,union:()=>Xe,unixDay:()=>$b,unixDays:()=>Kb,utcDay:()=>Bb,utcDays:()=>Fb,utcFormat:()=>B_,utcFriday:()=>c_,utcFridays:()=>y_,utcHour:()=>Pb,utcHours:()=>Rb,utcMillisecond:()=>Eb,utcMilliseconds:()=>Ob,utcMinute:()=>Lb,utcMinutes:()=>Mb,utcMonday:()=>o_,utcMondays:()=>h_,utcMonth:()=>__,utcMonths:()=>w_,utcParse:()=>F_,utcSaturday:()=>l_,utcSaturdays:()=>v_,utcSecond:()=>Sb,utcSeconds:()=>Tb,utcSunday:()=>i_,utcSundays:()=>f_,utcThursday:()=>u_,utcThursdays:()=>m_,utcTickInterval:()=>A_,utcTicks:()=>T_,utcTuesday:()=>a_,utcTuesdays:()=>p_,utcWednesday:()=>s_,utcWednesdays:()=>d_,utcWeek:()=>i_,utcWeeks:()=>f_,utcYear:()=>E_,utcYears:()=>O_,variance:()=>bt,window:()=>Hn,xml:()=>kl,zip:()=>De,zoom:()=>XS,zoomIdentity:()=>KS,zoomTransform:()=>US});var a=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((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,s=e.endColumn,u=e.message,c=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!=s?s:null,this.message=null!=u?u:null,this.initialErrorMessage=null!=c?c:null,this.componentId=null!=l?l:null,this.attribute=null!=f?f:null,this.extraData=null!=h?h:""}));n(a,"SEVERITY_HINT",1),n(a,"SEVERITY_INFO",2),n(a,"SEVERITY_WARNING",4),n(a,"SEVERITY_ERROR",8);const s=a;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 c(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}var l=function(){return t=function t(){var e=arguments.length>0&&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&&function(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}}])&&function(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 v=y;function g(t){return g="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},g(t)}function b(t){var e=function(t){if("object"!=g(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(e)?e:e+""}function _(t,e,n){return e=x(e),function(t,e){if(e&&("object"==g(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,w()?Reflect.construct(e,n||[],x(t).constructor):e.apply(t,n))}function w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(w=function(){return!!t})()}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}var E=function(t){function e(){var t,n=arguments.length>0&&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=_(this,e,[n]);var r=n.id,i=n.externalId,o=n.name,a=n.definition,s=n.drawOption,u=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=s||new v,t.attributes=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&&k(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 f(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&&function(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,s=e.categories,u=e.tags,c=e.url,l=e.parentTypes,f=e.childrenTypes,h=e.definedAttributes,p=e.isContainer,d=e.displayType,m=e.workflowDirection,y=e.linkModel,v=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=s||[],this.tags=u||[],this.url=c||null,this.parentTypes=l||[],this.childrenTypes=f||[],this.definedAttributes=h||[],this.isContainer=void 0!==p&&p,this.displayType=d||null,this.workflowDirection=m||"horizontal",this.linkModel=y||null,this.defaultWidth=v||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 T=S;function A(t){return A="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},A(t)}function N(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 L(t,e,n){return(e=M(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M(t){var e=function(t){if("object"!=A(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==A(e)?e:e+""}var C=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&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,s=e.url,u=e.linkType,c=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=s||null,this.linkType=u||null,this.linkRef=c||[],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=R(this,e);var r=n.source,i=n.target,o=n.name,a=n.definition,s=n.isReverse;return t.__class="Link",t.source=r||null,t.target=i||null,t.name=o||null,t.definition=a||null,t.isReverse=!!s,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&&B(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const $=F;var K=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&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,s=e.isTemporary;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null,this.model=a||null,this.isTemporary=!!s}));const U=K;function z(t){return z="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},z(t)}function q(t,e,n){return e=Y(e),function(t,e){if(e&&("object"==z(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,V()?Reflect.construct(e,n||[],Y(t).constructor):e.apply(t,n))}function V(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(V=function(){return!!t})()}function Y(t){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Y(t)}function W(t,e){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},W(t,e)}var H=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=q(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&&W(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const G=H;function J(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function X(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function Q(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(iJ(t(e),n),r=(e,n)=>t(e)-n):(e=t===J||t===X?t:Z,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=ht(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 st=ct(ht),ut=ct((function(t){const e=ht(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 ct(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 s=n&&t(n),u=r&&t(r),c=i.slice();return s&&u?(lt(s,c,i,o,a),lt(s,i,c,o,a),lt(s,c,i,o,a),ft(u,i,c,o,a),ft(u,c,i,o,a),ft(u,i,c,o,a)):s?(lt(s,i,c,o,a),lt(s,c,i,o,a),lt(s,i,c,o,a)):u&&(ft(u,i,c,o,a),ft(u,c,i,o,a),ft(u,i,c,o,a)),e}}function lt(t,e,n,r,i){for(let o=0,a=r*i;o{if(!((o-=a)>=i))return;let s=t*r[i];const u=a*t;for(let t=i,e=i+u;t{if(!((a-=s)>=o))return;let u=e*i[o];const c=s*e,l=c+s;for(let t=o,e=o+c;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 dt(t){return 0|t.length}function mt(t){return!(t>0)}function yt(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function vt(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(yt)).map(dt),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(mt))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 gt(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 s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}function _t(t,e){const n=bt(t,e);return n?Math.sqrt(n):n}function wt(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 kt(t,e){const n=new xt;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 Et(t,e){const n=new xt;let r=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):i=>n.add(+e(i,++r,t)||0))}class Ot extends Map{constructor(t,e=Lt){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(Tt(this,t))}has(t){return super.has(Tt(this,t))}set(t,e){return super.set(At(this,t),e)}delete(t){return super.delete(Nt(this,t))}}class St extends Set{constructor(t,e=Lt){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(Tt(this,t))}add(t){return super.add(At(this,t))}delete(t){return super.delete(Nt(this,t))}}function Tt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function At({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Nt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Lt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Mt(t){return t}function Ct(t,...e){return Ut(t,Mt,Mt,e)}function jt(t,...e){return Ut(t,Array.from,Mt,e)}function Pt(t,e){for(let n=1,r=e.length;nt.pop().map((([e,n])=>[...t,e,n]))));return t}function Rt(t,...e){return Pt(jt(t,...e),e)}function It(t,e,...n){return Pt(Bt(t,e,...n),n)}function Dt(t,e,...n){return Ut(t,Mt,e,n)}function Bt(t,e,...n){return Ut(t,Array.from,e,n)}function Ft(t,...e){return Ut(t,Mt,Kt,e)}function $t(t,...e){return Ut(t,Array.from,Kt,e)}function Kt(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function Ut(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Ot,s=r[o++];let u=-1;for(const t of i){const e=s(t,++u,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 zt(t,e){return Array.from(e,(e=>t[e]))}function qt(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=Yt(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Yt(n[t],n[e])))),zt(t,r)}return t.sort(Vt(n))}function Vt(t=J){if(t===J)return Yt;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 Yt(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function Wt(t,e,n){return(2!==e.length?qt(Dt(t,e,n),(([t,e],[n,r])=>J(e,r)||J(t,n))):qt(Ct(t,n),(([t,n],[r,i])=>e(n,i)||J(t,r)))).map((([t])=>t))}var Ht=Array.prototype,Gt=Ht.slice;function Jt(t){return()=>t}Ht.map;const Xt=Math.sqrt(50),Qt=Math.sqrt(10),Zt=Math.sqrt(2);function te(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>=Xt?10:o>=Qt?5:o>=Zt?2:1;let s,u,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),u=Math.round(e*c),s/ce&&--u,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),u=Math.round(e/c),s*ce&&--u),u0))return[];if((t=+t)==(e=+e))return[t];const r=e=i))return[];const s=o-i+1,u=new Array(s);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 oe(t){return Math.max(1,Math.ceil(Math.log(pt(t))/Math.LN2)+1)}function ae(){var t=Mt,e=wt,n=oe;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,u=new Array(s);for(i=0;i=f)if(t>=f&&e===wt){const t=ne(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,m=p;h[d]<=l;)++d;for(;h[m-1]>f;)--m;(d||m0?h[i-1]:l,y.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 ue(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 ce(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 le(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 fe(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?Yt:Vt(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);fe(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}const o=t[e];let a=n,s=r;for(he(t,n,e),i(t[r],o)>0&&he(t,n,r);a0;)--s}0===i(t[n],o)?he(t,n,s):(++s,he(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function he(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function pe(t,e=J){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?J(t,i)>0:0===J(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 de(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 ce(t);if(e>=1)return se(t);var r,i=(r-1)*e,o=Math.floor(i),a=se(fe(t,o).subarray(0,o+1));return a+(ce(t.subarray(o+1))-a)*(i-o)}}function me(t,e,n=tt){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 ye(t,e,n=tt){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>tt(n(t[r],r,t)))),e<=0)return le(r);if(e>=1)return ue(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return fe(i,a,0,o,((t,e)=>Yt(r[t],r[e]))),(a=pe(i.subarray(0,a+1),(t=>r[t])))>=0?a:-1}}function ve(t,e,n){const r=pt(t),i=de(t,.75)-de(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function ge(t,e,n){const r=pt(t),i=_t(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 _e(t,e){return de(t,.5,e)}function we(t,e){return ye(t,.5,e)}function xe(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function ke(t,e){const n=new Ot;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 Ee(t,e=Oe){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function Oe(t,e){return[t,e]}function Se(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===J?(t,e)=>Yt(n[t],n[e]):Vt(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 Ae(t,e=J){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?J(t,i)<0:0===J(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=J){if(1===e.length)return le(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 Le(t,e=J){if(1===e.length)return ue(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 Me(t,e){const n=Ne(t,e);return n<0?void 0:n}const Ce=je(Math.random);function je(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 Pe(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 Re(t){if(!(i=t.length))return[];for(var e=-1,n=ce(t,Ie),r=new Array(n);++ee(n,r,t)))}function Ue(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 ze(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function qe(t,...e){t=new St(t);for(const n of e)for(const e of n)t.delete(e);return t}function Ve(t,e){const n=e[Symbol.iterator](),r=new St;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 Ye(t,...e){t=new St(t),e=e.map(We);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function We(t){return t instanceof St?t:new St(t)}function He(t,e){const n=t[Symbol.iterator](),r=new Set;for(const t of e){const e=Ge(t);if(r.has(e))continue;let i,o;for(;({value:i,done:o}=n.next());){if(o)return!1;const t=Ge(i);if(r.add(t),Object.is(e,t))break}}return!0}function Ge(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Je(t,e){return He(e,t)}function Xe(...t){const e=new St;for(const n of t)for(const t of n)e.add(t);return e}function Qe(t){return t}var Ze=1,tn=2,en=3,nn=4,rn=1e-6;function on(t){return"translate("+t+",0)"}function an(t){return"translate(0,"+t+")"}function sn(t){return e=>+t(e)}function un(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function cn(){return!this.__axis}function ln(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,u="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=t===Ze||t===nn?-1:1,l=t===nn||t===tn?"x":"y",f=t===Ze||t===en?on:an;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):Qe:i,m=Math.max(o,0)+s,y=e.range(),v=+y[0]+u,g=+y[y.length-1]+u,b=(e.bandwidth?un:sn)(e.copy(),u),_=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"),O=x.select("line"),S=x.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(E),O=O.merge(E.append("line").attr("stroke","currentColor").attr(l+"2",c*o)),S=S.merge(E.append("text").attr("fill","currentColor").attr(l,c*m).attr("dy",t===Ze?"0em":t===en?"0.71em":"0.32em")),h!==_&&(w=w.transition(h),x=x.transition(h),O=O.transition(h),S=S.transition(h),k=k.transition(h).attr("opacity",rn).attr("transform",(function(t){return isFinite(t=b(t))?f(t+u):this.getAttribute("transform")})),E.attr("opacity",rn).attr("transform",(function(t){var e=this.parentNode.__axis;return f((e&&isFinite(e=e(t))?e:b(t))+u)}))),k.remove(),w.attr("d",t===nn||t===tn?a?"M"+c*a+","+v+"H"+u+"V"+g+"H"+c*a:"M"+u+","+v+"V"+g:a?"M"+v+","+c*a+"V"+u+"H"+g+"V"+c*a:"M"+v+","+u+"H"+g),x.attr("opacity",1).attr("transform",(function(t){return f(b(t)+u)})),O.attr(l+"2",c*o),S.attr(l,c*m).text(d),_.filter(cn).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===tn?"start":t===nn?"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?(s=+t,h):s},h.offset=function(t){return arguments.length?(u=+t,h):u},h}function fn(t){return ln(Ze,t)}function hn(t){return ln(tn,t)}function pn(t){return ln(en,t)}function dn(t){return ln(nn,t)}var mn={value:()=>{}};function yn(){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,s=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}jn.prototype={constructor:jn,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 Fn="http://www.w3.org/1999/xhtml";const $n={svg:"http://www.w3.org/2000/svg",xhtml:Fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Kn(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),$n.hasOwnProperty(e)?{space:$n[e],local:t}:t}function Un(t){return function(){this.removeAttribute(t)}}function zn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qn(t,e){return function(){this.setAttribute(t,e)}}function Vn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Yn(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Wn(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 Hn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Gn(t){return function(){this.style.removeProperty(t)}}function Jn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Xn(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Qn(t,e){return t.style.getPropertyValue(e)||Hn(t).getComputedStyle(t,null).getPropertyValue(e)}function Zn(t){return function(){delete this[t]}}function tr(t,e){return function(){this[t]=e}}function er(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function nr(t){return t.trim().split(/^|\s+/)}function rr(t){return t.classList||new ir(t)}function ir(t){this._node=t,this._names=nr(t.getAttribute("class")||"")}function or(t,e){for(var n=rr(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 Lr=[null];function Mr(t,e){this._groups=t,this._parents=e}function Cr(){return new Mr([[document.documentElement]],Lr)}Mr.prototype=Cr.prototype={constructor:Mr,select:function(t){"function"!=typeof t&&(t=xn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=w&&(w=_+1);!(b=v[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=Bn);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?Gn:"function"==typeof e?Xn:Jn)(t,e,null==n?"":n)):Qn(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Zn:"function"==typeof e?er:tr)(t,e)):this.node()[t]},classed:function(t,e){var n=nr(t+"");if(arguments.length<2){for(var r=rr(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(s=e?Sr:Or,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?si(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?si(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=Jr.exec(t))?new li(e[1],e[2],e[3],1):(e=Xr.exec(t))?new li(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Qr.exec(t))?si(e[1],e[2],e[3],e[4]):(e=Zr.exec(t))?si(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ti.exec(t))?yi(e[1],e[2]/100,e[3]/100,1):(e=ei.exec(t))?yi(e[1],e[2]/100,e[3]/100,e[4]):ni.hasOwnProperty(t)?ai(ni[t]):"transparent"===t?new li(NaN,NaN,NaN,0):null}function ai(t){return new li(t>>16&255,t>>8&255,255&t,1)}function si(t,e,n,r){return r<=0&&(t=e=n=NaN),new li(t,e,n,r)}function ui(t){return t instanceof zr||(t=oi(t)),t?new li((t=t.rgb()).r,t.g,t.b,t.opacity):new li}function ci(t,e,n,r){return 1===arguments.length?ui(t):new li(t,e,n,null==r?1:r)}function li(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function fi(){return`#${mi(this.r)}${mi(this.g)}${mi(this.b)}`}function hi(){const t=pi(this.opacity);return`${1===t?"rgb(":"rgba("}${di(this.r)}, ${di(this.g)}, ${di(this.b)}${1===t?")":`, ${t})`}`}function pi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function di(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mi(t){return((t=di(t))<16?"0":"")+t.toString(16)}function yi(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 vi(t){if(t instanceof bi)return new bi(t.h,t.s,t.l,t.opacity);if(t instanceof zr||(t=oi(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,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new bi(a,s,u,t.opacity)}function gi(t,e,n,r){return 1===arguments.length?vi(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 _i(t){return(t=(t||0)%360)<0?t+360:t}function wi(t){return Math.max(0,Math.min(1,t||0))}function xi(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 ki(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 Ei(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,s=r=240?t-240:t+120,i,r),xi(t,i,r),xi(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new bi(_i(this.h),wi(this.s),wi(this.l),pi(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=pi(this.opacity);return`${1===t?"hsl(":"hsla("}${_i(this.h)}, ${100*wi(this.s)}%, ${100*wi(this.l)}%${1===t?")":`, ${t})`}`}}));const Si=t=>()=>t;function Ti(t,e){return function(n){return t+n*e}}function Ai(t,e){var n=e-t;return n?Ti(t,n>180||n<-180?n-360*Math.round(n/360):n):Si(isNaN(t)?e:t)}function Ni(t,e){var n=e-t;return n?Ti(t,n):Si(isNaN(t)?e:t)}const Li=function t(e){var n=function(t){return 1==(t=+t)?Ni: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):Si(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=ci(t)).r,(e=ci(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ni(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 Mi(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Fi(n,r)})),o=Ui.lastIndex;return o=0&&e._call.call(void 0,t),e=e._next;--Gi}function co(){to=(Zi=no.now())+eo,Gi=Ji=0;try{uo()}finally{Gi=0,function(){for(var t,e,n=Wi,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:Wi=e);Hi=t,fo(r)}(),to=0}}function lo(){var t=no.now(),e=t-Zi;e>Qi&&(eo-=e,Zi=t)}function fo(t){Gi||(Ji&&(Ji=clearTimeout(Ji)),t-to>24?(t<1/0&&(Ji=setTimeout(co,t-no.now()-eo)),Xi&&(Xi=clearInterval(Xi))):(Xi||(Zi=no.now(),Xi=setInterval(lo,Qi)),Gi=1,ro(co)))}function ho(t,e,n){var r=new ao;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}ao.prototype=so.prototype={constructor:ao,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?io():+n)+(null==e?0:+e),this._next||Hi===this||(Hi?Hi._next=this:Wi=this,Hi=this),this._call=t,this._time=n,fo()},stop:function(){this._call&&(this._call=null,this._time=1/0,fo())}};var po=_n("start","end","cancel","interrupt"),mo=[],yo=0,vo=1,go=2,bo=3,_o=5,wo=6;function xo(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(u){var c,l,f,h;if(n.state!==vo)return s();for(c in i)if((h=i[c]).name===n.name){if(h.state===bo)return ho(o);4===h.state?(h.state=wo,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+cyo)throw new Error("too late; already scheduled");return n}function Eo(t,e){var n=Oo(t,e);if(n.state>bo)throw new Error("too late; already running");return n}function Oo(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function So(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>go&&n.state<_o,n.state=wo,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}}var To,Ao=180/Math.PI,No={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lo(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Fi(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Fi(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Fi(t,n)},{i:s-2,x:Fi(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ko:Eo;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=Kn(t),r="transform"===n?jo:Do;return this.attrTween(t,"function"==typeof e?(n.local?zo:Uo)(n,r,Io(this,"attr."+t,e)):null==e?(n.local?Fo:Bo)(n):(n.local?Ko:$o)(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=Kn(t);return this.tween(n,(r.local?qo:Vo)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Co:Do;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=Qn(this,t),a=(this.style.removeProperty(t),Qn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,Xo(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=Qn(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Qn(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Io(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=Eo(this,t),c=u.on,l=null==u.value[a]?o||(o=Xo(e)):void 0;c===n&&i===l||(r=(n=c).copy()).on(s,i=l),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=Qn(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}}(Io(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=Oo(this.node(),n).tween,o=0,a=i.length;ovo&&n.name===e)return new Zo([[t]],ua,e,+r);return null}const la=t=>()=>t;function fa(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 ha(t){t.preventDefault(),t.stopImmediatePropagation()}var pa={name:"drag"},da={name:"space"},ma={name:"handle"},ya={name:"center"};const{abs:va,max:ga,min:ba}=Math;function _a(t){return[+t[0],+t[1]]}function wa(t){return[_a(t[0]),_a(t[1])]}var xa={name:"x",handles:["w","e"].map(La),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]]}},ka={name:"y",handles:["n","s"].map(La),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]]}},Ea={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(La),input:function(t){return null==t?null:wa(t)},output:function(t){return t}},Oa={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"},Sa={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Ta={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Aa={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Na={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function La(t){return{type:t}}function Ma(t){return!t.ctrlKey&&!t.button}function Ca(){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 ja(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pa(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Ra(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Ia(){return Fa(xa)}function Da(){return Fa(ka)}function Ba(){return Fa(Ea)}function Fa(t){var e,n=Ca,r=Ma,i=ja,o=!0,a=_n("start","brush","end"),s=6;function u(e){var n=e.property("__brush",m).selectAll(".overlay").data([La("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Oa.overlay).merge(n).each((function(){var t=Pa(this).extent;Pr(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([La("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Oa.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 Oa[t.type]})),e.each(c).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 c(){var t=Pr(this),e=Pa(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]-s/2:e[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-s/2:e[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+s:s}))):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,s,u,f,h,p,d,m,y,v,g=this,b=n.target.__data__.type,_="selection"===(o&&n.metaKey?b="overlay":b)?pa:o&&n.altKey?ya:ma,w=t===ka?null:Aa[b],x=t===xa?null:Na[b],k=Pa(g),E=k.extent,O=k.selection,S=E[0][0],T=E[0][1],A=E[1][0],N=E[1][1],L=0,M=0,C=w&&x&&o&&n.shiftKey,j=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=Yi(t,g)).point0=t.slice(),t.identifier=e,t}));So(g);var P=l(g,arguments,!0).beforestart();if("overlay"===b){O&&(m=!0);const e=[j[0],j[1]||j[0]];k.selection=O=[[i=t===ka?S:ba(e[0][0],e[1][0]),s=t===xa?T:ba(e[0][1],e[1][1])],[f=t===ka?A:ga(e[0][0],e[1][0]),p=t===xa?N:ga(e[0][1],e[1][1])]],j.length>1&&F(n)}else i=O[0][0],s=O[0][1],f=O[1][0],p=O[1][1];a=i,u=s,h=f,d=p;var R=Pr(g).attr("pointer-events","none"),I=R.selectAll(".overlay").attr("cursor",Oa[b]);if(n.touches)P.moved=B,P.ended=$;else{var D=Pr(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",$,!0);o&&D.on("keydown.brush",(function(t){switch(t.keyCode){case 16:C=w&&x;break;case 18:_===ma&&(w&&(f=h-L*w,i=a+L*w),x&&(p=d-M*x,s=u+M*x),_=ya,F(t));break;case 32:_!==ma&&_!==ya||(w<0?f=h-L:w>0&&(i=a-L),x<0?p=d-M:x>0&&(s=u-M),_=da,I.attr("cursor",Oa.selection),F(t));break;default:return}ha(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:C&&(y=v=C=!1,F(t));break;case 18:_===ya&&(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=ma,F(t));break;case 32:_===da&&(t.altKey?(w&&(f=h-L*w,i=a+L*w),x&&(p=d-M*x,s=u+M*x),_=ya):(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=ma),I.attr("cursor",Oa[b]),F(t));break;default:return}ha(t)}),!0),Fr(n.view)}c.call(g),P.start(n,_.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of j)t.identifier===e.identifier&&(t.cur=Yi(e,g));if(C&&!y&&!v&&1===j.length){const t=j[0];va(t.cur[0]-t[0])>va(t.cur[1]-t[1])?v=!0:y=!0}for(const t of j)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);m=!0,ha(t),F(t)}function F(t){const e=j[0],n=e.point0;var r;switch(L=e[0]-n[0],M=e[1]-n[1],_){case da:case pa:w&&(L=ga(S-i,ba(A-f,L)),a=i+L,h=f+L),x&&(M=ga(T-s,ba(N-p,M)),u=s+M,d=p+M);break;case ma:j[1]?(w&&(a=ga(S,ba(A,j[0][0])),h=ga(S,ba(A,j[1][0])),w=1),x&&(u=ga(T,ba(N,j[0][1])),d=ga(T,ba(N,j[1][1])),x=1)):(w<0?(L=ga(S-i,ba(A-i,L)),a=i+L,h=f):w>0&&(L=ga(S-f,ba(A-f,L)),a=i,h=f+L),x<0?(M=ga(T-s,ba(N-s,M)),u=s+M,d=p):x>0&&(M=ga(T-p,ba(N-p,M)),u=s,d=p+M));break;case ya:w&&(a=ga(S,ba(A,i-L*w)),h=ga(S,ba(A,f+L*w))),x&&(u=ga(T,ba(N,s-M*x)),d=ga(T,ba(N,p+M*x)))}ht+n))}function Ga(){return Qa(!1,!1)}function Ja(){return Qa(!1,!0)}function Xa(){return Qa(!0,!1)}function Qa(t,e){var n=0,r=null,i=null,o=null;function a(a){var s,u=a.length,c=new Array(u),l=Ha(0,u),f=new Array(u*u),h=new Array(u),p=0;a=Float64Array.from({length:u*u},e?(t,e)=>a[e%u][e/u|0]:(t,e)=>a[e/u|0][e%u]);for(let e=0;er(c[t],c[e])));for(const n of l){const r=e;if(t){const t=Ha(1+~u,u).filter((t=>t<0?a[~t*u+n]:a[n*u+t]));i&&t.sort(((t,e)=>i(t<0?-a[~t*u+n]:a[n*u+t],e<0?-a[~e*u+n]:a[n*u+e])));for(const r of t)r<0?(f[~r*u+n]||(f[~r*u+n]={source:null,target:null})).target={index:n,startAngle:e,endAngle:e+=a[~r*u+n]*p,value:a[~r*u+n]}:(f[n*u+r]||(f[n*u+r]={source:null,target:null})).source={index:n,startAngle:e,endAngle:e+=a[n*u+r]*p,value:a[n*u+r]};h[n]={index:n,startAngle:r,endAngle:e,value:c[n]}}else{const t=Ha(0,u).filter((t=>a[n*u+t]||a[t*u+n]));i&&t.sort(((t,e)=>i(a[n*u+t],a[n*u+e])));for(const r of t){let t;if(n=0))throw new Error(`invalid digits: ${t}`);if(e>15)return rs;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;ees)if(Math.abs(l*s-u*c)>es&&i){let h=n-o,p=r-a,d=s*s+u*u,m=h*h+p*p,y=Math.sqrt(d),v=Math.sqrt(f),g=i*Math.tan((Za-Math.acos((d+f-m)/(2*y*v)))/2),b=g/v,_=g/y;Math.abs(b-1)>es&&this._append`L${t+b*c},${e+b*l}`,this._append`A${i},${i},0,0,${+(l*h>c*p)},${this._x1=t+_*s},${this._y1=e+_*u}`}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),s=n*Math.sin(r),u=t+a,c=e+s,l=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${u},${c}`:(Math.abs(this._x1-u)>es||Math.abs(this._y1-c)>es)&&this._append`L${u},${c}`,n&&(f<0&&(f=f%ts+ts),f>ns?this._append`A${n},${n},0,1,${l},${t-a},${e-s}A${n},${n},0,1,${l},${this._x1=u},${this._y1=c}`:f>es&&this._append`A${n},${n},0,${+(f>=Za)},${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 os(){return new is}function as(t=3){return new is(+t)}os.prototype=is.prototype;var ss=Array.prototype.slice;function us(t){return function(){return t}}function cs(t){return t.source}function ls(t){return t.target}function fs(t){return t.radius}function hs(t){return t.startAngle}function ps(t){return t.endAngle}function ds(){return 0}function ms(){return 10}function ys(t){var e=cs,n=ls,r=fs,i=fs,o=hs,a=ps,s=ds,u=null;function c(){var c,l=e.apply(this,arguments),f=n.apply(this,arguments),h=s.apply(this,arguments)/2,p=ss.call(arguments),d=+r.apply(this,(p[0]=l,p)),m=o.apply(this,p)-qa,y=a.apply(this,p)-qa,v=+i.apply(this,(p[0]=f,p)),g=o.apply(this,p)-qa,b=a.apply(this,p)-qa;if(u||(u=c=os()),h>Wa&&($a(y-m)>2*h+Wa?y>m?(m+=h,y-=h):(m-=h,y+=h):m=y=(m+y)/2,$a(b-g)>2*h+Wa?b>g?(g+=h,b-=h):(g-=h,b+=h):g=b=(g+b)/2),u.moveTo(d*Ka(m),d*Ua(m)),u.arc(0,0,d,m,y),m!==g||y!==b)if(t){var _=v-+t.apply(this,arguments),w=(g+b)/2;u.quadraticCurveTo(0,0,_*Ka(g),_*Ua(g)),u.lineTo(v*Ka(w),v*Ua(w)),u.lineTo(_*Ka(b),_*Ua(b))}else u.quadraticCurveTo(0,0,v*Ka(g),v*Ua(g)),u.arc(0,0,v,g,b);if(u.quadraticCurveTo(0,0,d*Ka(m),d*Ua(m)),u.closePath(),c)return u=null,c+""||null}return t&&(c.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:us(+e),c):t}),c.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:us(+t),c):r},c.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:us(+t),c):r},c.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:us(+t),c):i},c.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:us(+t),c):o},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:us(+t),c):a},c.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:us(+t),c):s},c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function vs(){return ys()}function gs(){return ys(ms)}const bs=Math.PI/180,_s=180/Math.PI,ws=.96422,xs=1,ks=.82521,Es=4/29,Os=6/29,Ss=3*Os*Os,Ts=Os*Os*Os;function As(t){if(t instanceof Ms)return new Ms(t.l,t.a,t.b,t.opacity);if(t instanceof Fs)return $s(t);t instanceof li||(t=ui(t));var e,n,r=Rs(t.r),i=Rs(t.g),o=Rs(t.b),a=Cs((.2225045*r+.7168786*i+.0606169*o)/xs);return r===i&&i===o?e=n=a:(e=Cs((.4360747*r+.3850649*i+.1430804*o)/ws),n=Cs((.0139322*r+.0971045*i+.7141733*o)/ks)),new Ms(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Ns(t,e){return new Ms(t,0,0,null==e?1:e)}function Ls(t,e,n,r){return 1===arguments.length?As(t):new Ms(t,e,n,null==r?1:r)}function Ms(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Cs(t){return t>Ts?Math.pow(t,1/3):t/Ss+Es}function js(t){return t>Os?t*t*t:Ss*(t-Es)}function Ps(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Rs(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Is(t){if(t instanceof Fs)return new Fs(t.h,t.c,t.l,t.opacity);if(t instanceof Ms||(t=As(t)),0===t.a&&0===t.b)return new Fs(NaN,0()=>t;function tu(t,e){for(var n,r=-1,i=e.length;++rr!=p>r&&n<(h-c)*(r-l)/(p-l)+c&&(i=-i)}return i}function nu(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 ru(){}var iu=[[],[[[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 ou(){var t=1,e=1,n=oe,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Qs);else{const n=wt(t,au);for(e=ee(...ie(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 s=[],u=[];return function(n,r,i){var o,s,u,c,l,f,h=new Array,p=new Array;for(o=s=-1,c=su(n[0],r),iu[c<<1].forEach(d);++o=r,iu[l<<2].forEach(d);++o0?s.push([t]):u.push(t)})),u.forEach((function(t){for(var e,n=0,r=s.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)?Zs(Xs.call(t)):Zs(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:ru,i):r===s},i}function au(t){return isFinite(t)?t:NaN}function su(t,e){return null!=t&&+t>=e}function uu(t){return null==t||isNaN(t=+t)?-1/0:t}function cu(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 lu(t){return t[0]}function fu(t){return t[1]}function hu(){return 1}function pu(){var t=lu,e=fu,n=hu,r=960,i=500,o=20,a=2,s=3*o,u=r+2*s>>a,c=i+2*s>>a,l=Zs(20);function f(r){var i=new Float32Array(u*c),l=Math.pow(2,-a),f=-1;for(const o of r){var h=(t(o,++f,r)+s)*l,p=(e(o,f,r)+s)*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(m)}function m(t){t.forEach(y)}function y(t){t[0]=t[0]*Math.pow(2,a)-s,t[1]=t[1]*Math.pow(2,a)-s}function v(){return u=r+2*(s=3*o)>>a,c=i+2*s>>a,h}return h.contours=function(t){var e=f(t),n=ou().size([u,c]),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:()=>se(e)/r}),i},h.x=function(e){return arguments.length?(t="function"==typeof e?e:Zs(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:Zs(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:Zs(+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,v()},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),v()},h.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Zs(Xs.call(t)):Zs(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,v()},h}const du=134217729;function mu(t,e,n,r,i){let o,a,s,u,c=e[0],l=r[0],f=0,h=0;l>c==l>-c?(o=c,c=e[++f]):(o=l,l=r[++h]);let p=0;if(fc==l>-c?(a=c+o,s=o-(a-c),c=e[++f]):(a=l+o,s=o-(a-l),l=r[++h]),o=a,0!==s&&(i[p++]=s);fc==l>-c?(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=e[++f]):(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=r[++h]),o=a,0!==s&&(i[p++]=s);for(;f=33306690738754716e-32*c?u:-function(t,e,n,r,i,o,a){let s,u,c,l,f,h,p,d,m,y,v,g,b,_,w,x,k,E;const O=t-i,S=n-i,T=e-o,A=r-o;_=O*A,h=du*O,p=h-(h-O),d=O-p,h=du*A,m=h-(h-A),y=A-m,w=d*y-(_-p*m-d*m-p*y),x=T*S,h=du*T,p=h-(h-T),d=T-p,h=du*S,m=h-(h-S),y=S-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,vu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,vu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,vu[2]=g-(E-f)+(v-f),vu[3]=E;let N=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,vu),L=22204460492503146e-32*a;if(N>=L||-N>=L)return N;if(f=t-O,s=t-(O+f)+(f-i),f=n-S,c=n-(S+f)+(f-i),f=e-T,u=e-(T+f)+(f-o),f=r-A,l=r-(A+f)+(f-o),0===s&&0===u&&0===c&&0===l)return N;if(L=11093356479670487e-47*a+33306690738754706e-32*Math.abs(N),N+=O*l+A*s-(T*c+S*u),N>=L||-N>=L)return N;_=s*A,h=du*s,p=h-(h-s),d=s-p,h=du*A,m=h-(h-A),y=A-m,w=d*y-(_-p*m-d*m-p*y),x=u*S,h=du*u,p=h-(h-u),d=u-p,h=du*S,m=h-(h-S),y=S-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,wu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,wu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,wu[2]=g-(E-f)+(v-f),wu[3]=E;const M=mu(4,vu,4,wu,gu);_=O*l,h=du*O,p=h-(h-O),d=O-p,h=du*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=T*c,h=du*T,p=h-(h-T),d=T-p,h=du*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,wu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,wu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,wu[2]=g-(E-f)+(v-f),wu[3]=E;const C=mu(M,gu,4,wu,bu);_=s*l,h=du*s,p=h-(h-s),d=s-p,h=du*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=u*c,h=du*u,p=h-(h-u),d=u-p,h=du*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,wu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,wu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,wu[2]=g-(E-f)+(v-f),wu[3]=E;const j=mu(C,bu,4,wu,_u);return _u[j-1]}(t,e,n,r,i,o,c)}yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(8),yu(8),yu(8),yu(4),yu(8),yu(8),yu(8),yu(12),yu(192),yu(192),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(4),yu(4),yu(4),yu(8),yu(16),yu(16),yu(16),yu(32),yu(32),yu(48),yu(64),yu(1152),yu(1152),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(1152),yu(1152),yu(1152),yu(1152),yu(1152),yu(2304),yu(2304),yu(3456),yu(5760),yu(8),yu(8),yu(8),yu(16),yu(24),yu(48),yu(48),yu(96),yu(192),yu(384),yu(384),yu(384),yu(768),yu(96),yu(96),yu(96),yu(1152);const ku=Math.pow(2,-52),Eu=new Uint32Array(512);class Ou{static from(t,e=Mu,n=Cu){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,s=1/0,u=-1/0,c=-1/0;for(let e=0;eu&&(u=n),r>c&&(c=r),this._ids[e]=e}const l=(a+u)/2,f=(s+c)/2;let h,p,d;for(let e=0,n=1/0;e0&&(p=e,n=r)}let v=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(xu(m,y,v,g,_,w)<0){const t=p,e=v,n=g;p=d,v=_,g=w,d=t,_=e,w=n}const x=function(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,c=o-e,l=a*a+s*s,f=u*u+c*c,h=.5/(a*c-s*u);return{x:t+(c*l-s*f)*h,y:e+(a*f-u*l)*h}}(m,y,v,g,_,w);this._cx=x.x,this._cy=x.y;for(let e=0;e0&&Math.abs(c-o)<=ku&&Math.abs(l-a)<=ku)continue;if(o=c,a=l,u===h||u===p||u===d)continue;let f=0;for(let t=0,e=this._hashKey(c,l);t=0;)if(y=m,y===f){y=-1;break}if(-1===y)continue;let v=this._addTriangle(y,u,n[y],-1,-1,r[y]);r[u]=this._legalize(v+2),r[y]=v,k++;let g=n[y];for(;m=n[g],xu(c,l,t[2*g],t[2*g+1],t[2*m],t[2*m+1])<0;)v=this._addTriangle(g,u,m,r[u],-1,r[g]),r[u]=this._legalize(v+2),n[g]=g,k--,g=m;if(y===f)for(;m=e[y],xu(c,l,t[2*m],t[2*m+1],t[2*y],t[2*y+1])<0;)v=this._addTriangle(m,u,y,-1,r[y],r[m]),this._legalize(v+2),r[m]=v,n[y]=y,k--,y=m;this._hullStart=e[u]=y,n[y]=e[g]=u,n[u]=g,i[this._hashKey(c,l)]=u,i[this._hashKey(t[2*y],t[2*y+1])]=y}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],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===i)break;t=Eu[--i];continue}const u=a-a%3,c=s+(t+1)%3,l=u+(a+2)%3,f=e[o],h=e[t],p=e[c],d=e[l];if(Tu(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 s=u+(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;Lu(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Lu(t,n,r),e[t[i]]>e[t[r]]&&Lu(t,i,r),e[t[n]]>e[t[i]]&&Lu(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]s);if(o=o-n?(Nu(t,e,i,r),Nu(t,e,n,o-1)):(Nu(t,e,n,o-1),Nu(t,e,i,r))}}function Lu(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Mu(t){return t[0]}function Cu(t){return t[1]}const ju=1e-6;class Pu{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)>ju||Math.abs(this._y1-i)>ju)&&(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 Ru{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 Iu{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,s,u=0,c=0,l=n.length;u1;)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 Iu(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:s,points:u}=this;if(-1===r[t]||!u.length)return(t+1)%(u.length>>1);let c=t,l=Bu(e-u[2*t],2)+Bu(n-u[2*t+1],2);const f=r[t];let h=f;do{let r=s[h];const f=Bu(e-u[2*r],2)+Bu(n-u[2*r+1],2);if(f()=>t;function qu(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:c,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:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function Vu(t){return!t.ctrlKey&&!t.button}function Yu(){return this.parentNode}function Wu(t,e){return null==e?{x:t.x,y:t.y}:e}function Hu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gu(){var t,e,n,r,i=Vu,o=Yu,a=Wu,s=Hu,u={},c=_n("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",y).on("touchmove.drag",v,Rr).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,s){if(!r&&i.call(this,a,s)){var u=b(this,o.call(this,a,s),a,s,"mouse");u&&(Pr(a.view).on("mousemove.drag",d,Ir).on("mouseup.drag",m,Ir),Fr(a.view),Dr(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function d(r){if(Br(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}u.mouse("drag",r)}function m(t){Pr(t.view).on("mousemove.drag mouseup.drag",null),$r(t.view,n),Br(t),u.mouse("end",t)}function y(t,e){if(i.call(this,t,e)){var n,r,a=t.changedTouches,s=o.call(this,t,e),u=a.length;for(n=0;n=o?u=!0:(r=t.charCodeAt(a++))===Zu?c=!0:r===tc&&(c=!0,t.charCodeAt(a)===Zu&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+rc(e,6):rc(e,4))+"-"+rc(t.getUTCMonth()+1,2)+"-"+rc(t.getUTCDate(),2)+(o?"T"+rc(n,2)+":"+rc(r,2)+":"+rc(i,2)+"."+rc(o,3)+"Z":i?"T"+rc(n,2)+":"+rc(r,2)+":"+rc(i,2)+"Z":r||n?"T"+rc(n,2)+":"+rc(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=ec(t);return function(r,i){return e(n(r),i,t)}}(t,e):ec(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=nc(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=nc(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var oc=ic(","),ac=oc.parse,sc=oc.parseRows,uc=oc.format,cc=oc.formatBody,lc=oc.formatRows,fc=oc.formatRow,hc=oc.formatValue,pc=ic("\t"),dc=pc.parse,mc=pc.parseRows,yc=pc.format,vc=pc.formatBody,gc=pc.formatRows,bc=pc.formatRow,_c=pc.formatValue;function wc(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;xc&&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 xc=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),kc=t=>+t;function Ec(t){return t*t}function Oc(t){return t*(2-t)}function Sc(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var Tc=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),Ac=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Nc=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),Lc=Math.PI,Mc=Lc/2;function Cc(t){return 1==+t?1:1-Math.cos(t*Mc)}function jc(t){return Math.sin(t*Mc)}function Pc(t){return(1-Math.cos(Lc*t))/2}function Rc(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function Ic(t){return Rc(1-+t)}function Dc(t){return 1-Rc(t)}function Bc(t){return((t*=2)<=1?Rc(1-t):2-Rc(t-1))/2}function Fc(t){return 1-Math.sqrt(1-t*t)}function $c(t){return Math.sqrt(1- --t*t)}function Kc(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Uc=4/11,zc=6/11,qc=8/11,Vc=3/4,Yc=9/11,Wc=10/11,Hc=15/16,Gc=21/22,Jc=63/64,Xc=1/Uc/Uc;function Qc(t){return 1-Zc(1-t)}function Zc(t){return(t=+t)dl(e,n).then((e=>(new DOMParser).parseFromString(e,t)))}const kl=xl("application/xml");var El=xl("text/html"),Ol=xl("image/svg+xml");function Sl(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i=(o=(m+v)/2))?m=o:v=o,(l=n>=(a=(y+g)/2))?y=a:g=a,i=p,!(p=p[f=l<<1|c]))return i[f]=d,t;if(s=+t._x.call(null,p.data),u=+t._y.call(null,p.data),e===s&&n===u)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),(c=e>=(o=(m+v)/2))?m=o:v=o,(l=n>=(a=(y+g)/2))?y=a:g=a}while((f=l<<1|c)==(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=d,t}function Al(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Nl(t){return t[0]}function Ll(t){return t[1]}function Ml(t,e,n){var r=new Cl(null==e?Nl:e,null==n?Ll:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Cl(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 jl(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Pl=Ml.prototype=Cl.prototype;function Rl(t){return function(){return t}}function Il(t){return 1e-6*(t()-.5)}function Dl(t){return t.x+t.vx}function Bl(t){return t.y+t.vy}function Fl(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,c,l,f,h,p=e.length,d=0;dc+d||ol+d||au.index){var m=c-s.x-s.vx,y=l-s.y-s.vy,v=m*m+y*y;vt.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r[s(t,e,r),t])));for(a=0,i=new Array(c);al&&(l=r),if&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;nt||t>=i||r>e||e>=o;)switch(s=(eh||(o=u.y0)>p||(a=u.x1)=v)<<1|t>=y)&&(u=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=u)}else{var g=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=g*g+b*b;if(_=(s=(d+y)/2))?d=s:y=s,(l=a>=(u=(m+v)/2))?m=u:v=u,e=p,!(p=p[f=l<<1|c]))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)},Pl.removeAll=function(t){for(var e=0,n=t.length;e(t=(zl*t+ql)%Vl)/Vl}();function f(){h(),c.call("tick",e),n1?(null==n?s.delete(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}}function Xl(){var t,e,n,r,i,o=Rl(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=Ml(t,Yl,Wl).visitAfter(f);for(r=n,i=0;i=s)){(t.data!==e||t.next)&&(0===f&&(d+=(f=Il(n))*f),0===h&&(d+=(h=Il(n))*h),d1?r[0]+r.slice(2):r,+t.slice(n+1)]}function nf(t){return(t=ef(Math.abs(t)))?t[1]:NaN}var rf,of=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function af(t){if(!(e=of.exec(t)))throw new Error("invalid format: "+t);var e;return new sf({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 sf(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 uf(t,e){var n=ef(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")}af.prototype=sf.prototype,sf.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 cf={"%":(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)=>uf(100*t,e),r:uf,s:function(t,e){var n=ef(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(rf=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")+ef(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function lf(t){return t}var ff,hf,pf,df=Array.prototype.map,mf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yf(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?lf:(e=df.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=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+"",s=void 0===t.numerals?lf:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(df.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=af(t)).fill,n=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,m=t.comma,y=t.precision,v=t.trim,g=t.type;"n"===g?(m=!0,g="g"):cf[g]||(void 0===y&&(y=12),v=!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)?u:"",w=cf[g],x=/[defgprs%]/.test(g);function k(t){var i,o,u,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),y),v&&(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:c:"-"===f||"("===f?"":f)+h,k=("s"===g?mf[8+rf/3]:"")+k+(E&&"("===f?")":""),x)for(i=-1,o=t.length;++i(u=t.charCodeAt(i))||u>57){k=(46===u?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}m&&!p&&(t=r(t,1/0));var O=h.length+t.length+k.length,S=O>1)+h+t+k+S.slice(O);break;default:t=S+h+t+k}return s(t)}return y=void 0===y?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=af(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(nf(e)/3))),i=Math.pow(10,-r),o=mf[8+r/3];return function(t){return n(i*t)+o}}}}function vf(t){return ff=yf(t),hf=ff.format,pf=ff.formatPrefix,ff}function gf(t){return Math.max(0,-nf(Math.abs(t)))}function bf(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(nf(e)/3)))-nf(Math.abs(t)))}function _f(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,nf(e)-nf(t))+1}vf({thousands:",",grouping:[3],currency:["$",""]});var wf=1e-6,xf=1e-12,kf=Math.PI,Ef=kf/2,Of=kf/4,Sf=2*kf,Tf=180/kf,Af=kf/180,Nf=Math.abs,Lf=Math.atan,Mf=Math.atan2,Cf=Math.cos,jf=Math.ceil,Pf=Math.exp,Rf=(Math.floor,Math.hypot),If=Math.log,Df=Math.pow,Bf=Math.sin,Ff=Math.sign||function(t){return t>0?1:t<0?-1:0},$f=Math.sqrt,Kf=Math.tan;function Uf(t){return t>1?0:t<-1?kf:Math.acos(t)}function zf(t){return t>1?Ef:t<-1?-Ef:Math.asin(t)}function qf(t){return(t=Bf(t/2))*t}function Vf(){}function Yf(t,e){t&&Hf.hasOwnProperty(t.type)&&Hf[t.type](t,e)}var Wf={Feature:function(t,e){Yf(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=Cf(e=(e*=Af)/2+Of),a=Bf(e),s=nh*a,u=eh*o+s*Cf(i),c=s*r*Bf(i);dh.add(Mf(c,u)),th=t,eh=o,nh=a}function wh(t){return mh=new xt,Xf(t,yh),2*mh}function xh(t){return[Mf(t[1],t[0]),zf(t[2])]}function kh(t){var e=t[0],n=t[1],r=Cf(n);return[r*Cf(e),r*Bf(e),Bf(n)]}function Eh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Oh(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 Sh(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Th(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ah(t){var e=$f(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Nh,Lh,Mh,Ch,jh,Ph,Rh,Ih,Dh,Bh,Fh,$h,Kh,Uh,zh,qh,Vh={point:Yh,lineStart:Hh,lineEnd:Gh,polygonStart:function(){Vh.point=Jh,Vh.lineStart=Xh,Vh.lineEnd=Qh,fh=new xt,yh.polygonStart()},polygonEnd:function(){yh.polygonEnd(),Vh.point=Yh,Vh.lineStart=Hh,Vh.lineEnd=Gh,dh<0?(rh=-(oh=180),ih=-(ah=90)):fh>wf?ah=90:fh<-wf&&(ih=-90),ph[0]=rh,ph[1]=oh},sphere:function(){rh=-(oh=180),ih=-(ah=90)}};function Yh(t,e){hh.push(ph=[rh=t,oh=t]),eah&&(ah=e)}function Wh(t,e){var n=kh([t*Af,e*Af]);if(lh){var r=Oh(lh,n),i=Oh([r[1],-r[0],0],r);Ah(i),i=xh(i);var o,a=t-sh,s=a>0?1:-1,u=i[0]*Tf*s,c=Nf(a)>180;c^(s*shah&&(ah=o):c^(s*sh<(u=(u+360)%360-180)&&uah&&(ah=e)),c?tZh(rh,oh)&&(oh=t):Zh(t,oh)>Zh(rh,oh)&&(rh=t):oh>=rh?(toh&&(oh=t)):t>sh?Zh(rh,t)>Zh(rh,oh)&&(oh=t):Zh(t,oh)>Zh(rh,oh)&&(rh=t)}else hh.push(ph=[rh=t,oh=t]);eah&&(ah=e),lh=n,sh=t}function Hh(){Vh.point=Wh}function Gh(){ph[0]=rh,ph[1]=oh,Vh.point=Yh,lh=null}function Jh(t,e){if(lh){var n=t-sh;fh.add(Nf(n)>180?n+(n>0?360:-360):n)}else uh=t,ch=e;yh.point(t,e),Wh(t,e)}function Xh(){yh.lineStart()}function Qh(){Jh(uh,ch),yh.lineEnd(),Nf(fh)>wf&&(rh=-(oh=180)),ph[0]=rh,ph[1]=oh,lh=null}function Zh(t,e){return(e-=t)<0?e+360:e}function tp(t,e){return t[0]-e[0]}function ep(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eZh(r[0],r[1])&&(r[1]=i[1]),Zh(i[0],r[1])>Zh(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],(s=Zh(r[1],i[0]))>a&&(a=s,rh=i[0],oh=r[1])}return hh=ph=null,rh===1/0||ih===1/0?[[NaN,NaN],[NaN,NaN]]:[[rh,ih],[oh,ah]]}var rp={sphere:Vf,point:ip,lineStart:ap,lineEnd:cp,polygonStart:function(){rp.lineStart=lp,rp.lineEnd=fp},polygonEnd:function(){rp.lineStart=ap,rp.lineEnd=cp}};function ip(t,e){t*=Af;var n=Cf(e*=Af);op(n*Cf(t),n*Bf(t),Bf(e))}function op(t,e,n){++Nh,Mh+=(t-Mh)/Nh,Ch+=(e-Ch)/Nh,jh+=(n-jh)/Nh}function ap(){rp.point=sp}function sp(t,e){t*=Af;var n=Cf(e*=Af);Uh=n*Cf(t),zh=n*Bf(t),qh=Bf(e),rp.point=up,op(Uh,zh,qh)}function up(t,e){t*=Af;var n=Cf(e*=Af),r=n*Cf(t),i=n*Bf(t),o=Bf(e),a=Mf($f((a=zh*o-qh*i)*a+(a=qh*r-Uh*o)*a+(a=Uh*i-zh*r)*a),Uh*r+zh*i+qh*o);Lh+=a,Ph+=a*(Uh+(Uh=r)),Rh+=a*(zh+(zh=i)),Ih+=a*(qh+(qh=o)),op(Uh,zh,qh)}function cp(){rp.point=ip}function lp(){rp.point=hp}function fp(){pp($h,Kh),rp.point=ip}function hp(t,e){$h=t,Kh=e,t*=Af,e*=Af,rp.point=pp;var n=Cf(e);Uh=n*Cf(t),zh=n*Bf(t),qh=Bf(e),op(Uh,zh,qh)}function pp(t,e){t*=Af;var n=Cf(e*=Af),r=n*Cf(t),i=n*Bf(t),o=Bf(e),a=zh*o-qh*i,s=qh*r-Uh*o,u=Uh*i-zh*r,c=Rf(a,s,u),l=zf(c),f=c&&-l/c;Dh.add(f*a),Bh.add(f*s),Fh.add(f*u),Lh+=l,Ph+=l*(Uh+(Uh=r)),Rh+=l*(zh+(zh=i)),Ih+=l*(qh+(qh=o)),op(Uh,zh,qh)}function dp(t){Nh=Lh=Mh=Ch=jh=Ph=Rh=Ih=0,Dh=new xt,Bh=new xt,Fh=new xt,Xf(t,rp);var e=+Dh,n=+Bh,r=+Fh,i=Rf(e,n,r);return ikf&&(t-=Math.round(t/Sf)*Sf),[t,e]}function gp(t,e,n){return(t%=Sf)?e||n?yp(_p(t),wp(e,n)):_p(t):e||n?wp(e,n):vp}function bp(t){return function(e,n){return Nf(e+=t)>kf&&(e-=Math.round(e/Sf)*Sf),[e,n]}}function _p(t){var e=bp(t);return e.invert=bp(-t),e}function wp(t,e){var n=Cf(t),r=Bf(t),i=Cf(e),o=Bf(e);function a(t,e){var a=Cf(e),s=Cf(t)*a,u=Bf(t)*a,c=Bf(e),l=c*n+s*r;return[Mf(u*i-l*o,s*n-c*r),zf(l*i+u*o)]}return a.invert=function(t,e){var a=Cf(e),s=Cf(t)*a,u=Bf(t)*a,c=Bf(e),l=c*i-u*o;return[Mf(u*i+c*o,s*n+l*r),zf(l*n-s*r)]},a}function xp(t){function e(e){return(e=t(e[0]*Af,e[1]*Af))[0]*=Tf,e[1]*=Tf,e}return t=gp(t[0]*Af,t[1]*Af,t.length>2?t[2]*Af:0),e.invert=function(e){return(e=t.invert(e[0]*Af,e[1]*Af))[0]*=Tf,e[1]*=Tf,e},e}function kp(t,e,n,r,i,o){if(n){var a=Cf(e),s=Bf(e),u=r*n;null==i?(i=e+r*Sf,o=e-u/2):(i=Ep(a,i),o=Ep(a,o),(r>0?io)&&(i+=r*Sf));for(var c,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 Tp(t,e){return Nf(t[0]-e[0])=0;--o)i.point((l=c[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,p=!p}while(!h.v);i.lineEnd()}}}function Lp(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,S=O*E,T=S>kf,A=y*x;if(u.add(Mf(A*O*Bf(S),v*k+A*Cf(S))),a+=T?E+O*Sf:E,T^d>=n^_>=n){var N=Oh(kh(p),kh(b));Ah(N);var L=Oh(o,N);Ah(L);var M=(T^E>=0?-1:1)*zf(L[2]);(r>M||r===M&&(N[0]||N[1]))&&(s+=T^E>=0?1:-1)}}return(a<-wf||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&u&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Pp))}return h}}function Pp(t){return t.length>1}function Rp(t,e){return((t=t.x)[0]<0?t[1]-Ef-wf:Ef-t[1])-((e=e.x)[0]<0?e[1]-Ef-wf:Ef-e[1])}vp.invert=vp;const Ip=jp((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 s=o>0?kf:-kf,u=Nf(o-n);Nf(u-kf)0?Ef:-Ef),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=kf&&(Nf(n-i)wf?Lf((Bf(e)*(o=Cf(r))*Bf(n)-Bf(r)*(i=Cf(e))*Bf(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Ef,r.point(-kf,i),r.point(0,i),r.point(kf,i),r.point(kf,0),r.point(kf,-i),r.point(0,-i),r.point(-kf,-i),r.point(-kf,0),r.point(-kf,i);else if(Nf(t[0]-e[0])>wf){var o=t[0]0,i=Nf(e)>wf;function o(t,n){return Cf(t)*Cf(n)>e}function a(t,n,r){var i=[1,0,0],o=Oh(kh(t),kh(n)),a=Eh(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var c=e*a/u,l=-e*s/u,f=Oh(i,o),h=Th(i,c);Sh(h,Th(o,l));var p=f,d=Eh(h,p),m=Eh(p,p),y=d*d-m*(Eh(h,h)-1);if(!(y<0)){var v=$f(y),g=Th(p,(-d-v)/m);if(Sh(g,h),g=xh(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-_,O=Nf(E-kf)0^g[1]<(Nf(g[0]-_)kf^(_<=g[0]&&g[0]<=w)){var S=Th(p,(-d+v)/m);return Sh(S,h),[g,xh(S)]}}}function s(e,n){var i=r?t:kf-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return jp(o,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,h){var p,d=[f,h],m=o(f,h),y=r?m?0:s(f,h):m?s(f+(f<0?kf:-kf),h):0;if(!e&&(c=u=m)&&t.lineStart(),m!==u&&(!(p=a(e,d))||Tp(e,p)||Tp(d,p))&&(d[2]=1),m!==u)l=0,m?(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^m){var v;y&n||!(v=a(d,e,!0))||(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!m||e&&Tp(e,d)||t.point(d[0],d[1]),e=d,u=m,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(e,r,i,o){kp(o,t,n,i,e,r)}),r?[0,-t]:[-kf,t-kf])}var Bp,Fp,$p,Kp,Up=1e9,zp=-Up;function qp(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,c){var l=0,f=0;if(null==i||(l=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==f);else c.point(o[0],o[1])}function a(r,i){return Nf(r[0]-t)0?0:3:Nf(r[0]-n)0?2:1:Nf(r[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(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 u,c,l,f,h,p,d,m,y,v,g,b=a,_=Sp(),w={point:x,lineStart:function(){w.point=k,c&&c.push(l=[]),v=!0,y=!1,d=m=NaN},lineEnd:function(){u&&(k(f,h),p&&y&&_.rejoin(),u.push(_.result())),w.point=x,y&&b.lineEnd()},polygonStart:function(){b=_,u=[],c=[],g=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.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=(u=xe(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Np(u,s,e,o,a),a.polygonEnd()),b=a,u=c=l=null}};function x(t,e){i(t,e)&&b.point(t,e)}function k(o,a){var s=i(o,a);if(c&&l.push([o,a]),v)f=o,h=a,p=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&y)b.point(o,a);else{var u=[d=Math.max(zp,Math.min(Up,d)),m=Math.max(zp,Math.min(Up,m))],_=[o=Math.max(zp,Math.min(Up,o)),a=Math.max(zp,Math.min(Up,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],c=0,l=1,f=e[0]-s,h=e[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>c&&(c=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=o-u,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>c&&(c=a)}else if(h>0){if(a0&&(t[0]=s+c*f,t[1]=u+c*h),l<1&&(e[0]=s+l*f,e[1]=u+l*h),!0}}}}}(u,_,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),g=!1):(y||(b.lineStart(),b.point(u[0],u[1])),b.point(_[0],_[1]),s||b.lineEnd(),g=!1)}d=o,m=a,y=s}return w}}function Vp(){var t,e,n,r=0,i=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=qp(r,i,o,a)(e=n)},extent:function(s){return arguments.length?(r=+s[0][0],i=+s[0][1],o=+s[1][0],a=+s[1][1],t=e=null,n):[[r,i],[o,a]]}}}var Yp={sphere:Vf,point:Vf,lineStart:function(){Yp.point=Hp,Yp.lineEnd=Wp},lineEnd:Vf,polygonStart:Vf,polygonEnd:Vf};function Wp(){Yp.point=Yp.lineEnd=Vf}function Hp(t,e){Fp=t*=Af,$p=Bf(e*=Af),Kp=Cf(e),Yp.point=Gp}function Gp(t,e){t*=Af;var n=Bf(e*=Af),r=Cf(e),i=Nf(t-Fp),o=Cf(i),a=r*Bf(i),s=Kp*n-$p*r*o,u=$p*n+Kp*r*o;Bp.add(Mf($f(a*a+s*s),u)),Fp=t,$p=n,Kp=r}function Jp(t){return Bp=new xt,Xf(t,Yp),+Bp}var Xp=[null,null],Qp={type:"LineString",coordinates:Xp};function Zp(t,e){return Xp[0]=t,Xp[1]=e,Jp(Qp)}var td={Feature:function(t,e){return nd(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Zp(t[o],t[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))wf})).map(u)).concat(Se(jf(o/p)*p,i,p).filter((function(t){return Nf(t%m)>wf})).map(c))}return v.lines=function(){return g().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),v.precision(y)):[[r,s],[n,a]]},v.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),v.precision(y)):[[e,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(d=+t[0],m=+t[1],v):[d,m]},v.stepMinor=function(t){return arguments.length?(h=+t[0],p=+t[1],v):[h,p]},v.precision=function(h){return arguments.length?(y=+h,u=cd(o,i,90),c=ld(e,t,y),l=cd(s,a,90),f=ld(r,n,y),v):y},v.extentMajor([[-180,-90+wf],[180,90-wf]]).extentMinor([[-180,-80-wf],[180,80+wf]])}function hd(){return fd()()}function pd(t,e){var n=t[0]*Af,r=t[1]*Af,i=e[0]*Af,o=e[1]*Af,a=Cf(r),s=Bf(r),u=Cf(o),c=Bf(o),l=a*Cf(n),f=a*Bf(n),h=u*Cf(i),p=u*Bf(i),d=2*zf($f(qf(o-r)+a*u*qf(i-n))),m=Bf(d),y=d?function(t){var e=Bf(t*=d)/m,n=Bf(d-t)/m,r=n*l+e*h,i=n*f+e*p,o=n*s+e*c;return[Mf(i,r)*Tf,Mf(o,$f(r*r+i*i))*Tf]}:function(){return[n*Tf,r*Tf]};return y.distance=d,y}const dd=t=>t;var md,yd,vd,gd,bd=new xt,_d=new xt,wd={point:Vf,lineStart:Vf,lineEnd:Vf,polygonStart:function(){wd.lineStart=xd,wd.lineEnd=Od},polygonEnd:function(){wd.lineStart=wd.lineEnd=wd.point=Vf,bd.add(Nf(_d)),_d=new xt},result:function(){var t=bd/2;return bd=new xt,t}};function xd(){wd.point=kd}function kd(t,e){wd.point=Ed,md=vd=t,yd=gd=e}function Ed(t,e){_d.add(gd*t-vd*e),vd=t,gd=e}function Od(){Ed(md,yd)}const Sd=wd;var Td=1/0,Ad=Td,Nd=-Td,Ld=Nd,Md={point:function(t,e){tNd&&(Nd=t),eLd&&(Ld=e)},lineStart:Vf,lineEnd:Vf,polygonStart:Vf,polygonEnd:Vf,result:function(){var t=[[Td,Ad],[Nd,Ld]];return Nd=Ld=-(Ad=Td=1/0),t}};const Cd=Md;var jd,Pd,Rd,Id,Dd=0,Bd=0,Fd=0,$d=0,Kd=0,Ud=0,zd=0,qd=0,Vd=0,Yd={point:Wd,lineStart:Hd,lineEnd:Xd,polygonStart:function(){Yd.lineStart=Qd,Yd.lineEnd=Zd},polygonEnd:function(){Yd.point=Wd,Yd.lineStart=Hd,Yd.lineEnd=Xd},result:function(){var t=Vd?[zd/Vd,qd/Vd]:Ud?[$d/Ud,Kd/Ud]:Fd?[Dd/Fd,Bd/Fd]:[NaN,NaN];return Dd=Bd=Fd=$d=Kd=Ud=zd=qd=Vd=0,t}};function Wd(t,e){Dd+=t,Bd+=e,++Fd}function Hd(){Yd.point=Gd}function Gd(t,e){Yd.point=Jd,Wd(Rd=t,Id=e)}function Jd(t,e){var n=t-Rd,r=e-Id,i=$f(n*n+r*r);$d+=i*(Rd+t)/2,Kd+=i*(Id+e)/2,Ud+=i,Wd(Rd=t,Id=e)}function Xd(){Yd.point=Wd}function Qd(){Yd.point=tm}function Zd(){em(jd,Pd)}function tm(t,e){Yd.point=em,Wd(jd=Rd=t,Pd=Id=e)}function em(t,e){var n=t-Rd,r=e-Id,i=$f(n*n+r*r);$d+=i*(Rd+t)/2,Kd+=i*(Id+e)/2,Ud+=i,zd+=(i=Id*t-Rd*e)*(Rd+t),qd+=i*(Id+e),Vd+=3*i,Wd(Rd=t,Id=e)}const nm=Yd;function rm(t){this._context=t}rm.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,Sf)}},result:Vf};var im,om,am,sm,um,cm=new xt,lm={point:Vf,lineStart:function(){lm.point=fm},lineEnd:function(){im&&hm(om,am),lm.point=Vf},polygonStart:function(){im=!0},polygonEnd:function(){im=null},result:function(){var t=+cm;return cm=new xt,t}};function fm(t,e){lm.point=hm,om=sm=t,am=um=e}function hm(t,e){sm-=t,um-=e,cm.add($f(sm*sm+um*um)),sm=t,um=e}const pm=lm;let dm,mm,ym,vm;class gm{constructor(t){this._append=null==t?bm:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return bm;if(e!==dm){const t=10**e;dm=e,mm=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 gm(i)),a},a.projection(t).digits(i).context(e)}function wm(t){return{stream:xm(t)}}function xm(t){return function(e){var n=new km;for(var r in t)n[r]=t[r];return n.stream=e,n}}function km(){}function Em(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Xf(n,t.stream(Cd)),e(Cd.result()),null!=r&&t.clipExtent(r),t}function Om(t,e,n){return Em(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,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function Sm(t,e,n){return Om(t,[[0,0],e],n)}function Tm(t,e,n){return Em(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 Am(t,e,n){return Em(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)}km.prototype={constructor:km,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 Nm=16,Lm=Cf(30*Af);function Mm(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,c,l,f,h,p,d,m,y){var v=c-r,g=l-i,b=v*v+g*g;if(b>4*e&&m--){var _=a+h,w=s+p,x=u+d,k=$f(_*_+w*w+x*x),E=zf(x/=k),O=Nf(Nf(x)-1)e||Nf((v*N+g*L)/b-.5)>.3||a*h+s*p+u*d2?t[2]%360*Af:0,N()):[y*Tf,v*Tf,g*Tf]},T.angle=function(t){return arguments.length?(b=t%360*Af,N()):b*Tf},T.reflectX=function(t){return arguments.length?(_=t?-1:1,N()):_<0},T.reflectY=function(t){return arguments.length?(w=t?-1:1,N()):w<0},T.precision=function(t){return arguments.length?(a=Mm(s,S=t*t),L()):$f(S)},T.fitExtent=function(t,e){return Om(T,t,e)},T.fitSize=function(t,e){return Sm(T,t,e)},T.fitWidth=function(t,e){return Tm(T,t,e)},T.fitHeight=function(t,e){return Am(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&A,N()}}function Im(t){var e=0,n=kf/3,r=Rm(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Af,n=t[1]*Af):[e*Tf,n*Tf]},i}function Dm(t,e){var n=Bf(t),r=(n+Bf(e))/2;if(Nf(r)=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<-Ef+wf&&(e=-Ef+wf):e>Ef-wf&&(e=Ef-wf);var n=i/Df(Jm(e),r);return[n*Bf(r*t),i-n*Cf(r*t)]}return o.invert=function(t,e){var n=i-e,o=Ff(r)*$f(t*t+n*n),a=Mf(t,Nf(n))*Ff(n);return n*r<0&&(a-=kf*Ff(t)*Ff(n)),[a/r,2*Lf(Df(i/o,1/r))-Ef]},o}function Qm(){return Im(Xm).scale(109.5).parallels([30,30])}function Zm(t,e){return[t,e]}function ty(){return Pm(Zm).scale(152.63)}function ey(t,e){var n=Cf(t),r=t===e?Bf(t):(n-Cf(e))/(e-t),i=n/r+t;if(Nf(r)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function wy(t,e){return t.parent===e.parent?1:2}function xy(t,e){return t+e.x}function ky(t,e){return Math.max(t,e.y)}function Ey(){var t=wy,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(xy,0)/t.length}(n),e.y=function(t){return 1+t.reduce(ky,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=s.x-t(s,u)/2,l=u.x+t(u,s)/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-c)/(l-c)*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 Oy(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 Sy(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Ay)):void 0===e&&(e=Ty);for(var n,r,i,o,a,s=new My(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new My(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Ly)}function Ty(t){return t.children}function Ay(t){return Array.isArray(t)?t[1]:null}function Ny(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Ly(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function My(t){this.data=t,this.depth=this.height=0,this.parent=null}function Cy(t){return null==t?null:jy(t)}function jy(t){if("function"!=typeof t)throw new Error;return t}function Py(){return 0}function Ry(t){return function(){return t}}uy.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*(ry+iy*i+o*(oy+ay*i))-e)/(ry+3*iy*i+o*(7*oy+9*ay*i)))*r)*i*i,!(Nf(n)wf&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},my.invert=Um(zf),vy.invert=Um((function(t){return 2*Lf(t)})),by.invert=function(t,e){return[-e,2*Lf(Pf(t))-Ef]},My.prototype=Sy.prototype={constructor:My,count:function(){return this.eachAfter(Oy)},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],s=[],u=-1;o=a.pop();)if(s.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 Sy(this).eachBefore(Ny)},[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=(Iy*t+Dy)%By)/By}function $y(t){return Ky(t,Fy())}function Ky(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 Vy(t,e){for(var n=0;n1e-6?(T+Math.sqrt(T*T-4*S*A))/(2*S):A/T);return{x:r+x+k*N,y:i+E+O*N,r:N}}function Gy(t,e,n){var r,i,o,a,s=t.x-e.x,u=t.y-e.y,c=s*s+u*u;c?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function Jy(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 Xy(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 Qy(t){this._=t,this.next=null,this.previous=null}function Zy(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,s,u,c,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;Gy(i,r,o=t[2]),r=new Qy(r),i=new Qy(i),o=new Qy(o),r.next=o.previous=i,i.next=r.previous=o,o.next=i.previous=r;t:for(c=3;cfunction(t){let e=(t=`${t}`).length;return yv(t,e-1)&&!yv(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(mv),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(mv(t)),h.push(fv));p=(t,n)=>e[n],d=(t,e)=>n[e]}for(a=0,i=h.length;a=0&&(c=h[t]).data===fv;--t)c.data=null}if(s.parent=cv,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Ly),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=Cy(t),r):e},r.parentId=function(t){return arguments.length?(n=Cy(t),r):n},r.path=function(e){return arguments.length?(t=Cy(e),r):t},r}function mv(t){let e=t.length;if(e<2)return"";for(;--e>1&&!yv(t,e););return t.slice(0,e)}function yv(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function vv(t,e){return t.parent===e.parent?1:2}function gv(t){var e=t.children;return e?e[0]:t.t}function bv(t){var e=t.children;return e?e[e.length-1]:t.t}function _v(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 wv(t,e,n){return t.a.parent===e.parent?t.a:n}function xv(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 kv(){var t=vv,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new xv(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new xv(r[i],i)),n.parent=e;return(a.parent=new xv(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=c===l?1:t(c,l)/2,p=h-c.x,d=e/(l.x+h+p),m=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*m}))}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,s=n,u=o.parent.children[0],c=o.m,l=a.m,f=s.m,h=u.m;s=bv(s),o=gv(o),s&&o;)u=gv(u),(a=bv(a)).a=e,(i=s.z+f-o.z-c+t(s._,o._))>0&&(_v(wv(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=o.m,h+=u.m,l+=a.m;s&&!bv(a)&&(a.t=s,a.m+=f-l),o&&!gv(u)&&(u.t=o,u.m+=c-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 s(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 Ev(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,c=t.value&&(i-n)/t.value;++sh&&(h=s),y=l*l*m,(p=Math.max(h/y,y/f))>d){l-=s;break}d=p}v.push(a={value:l,dice:u1?e:1)},n}(Ov);function Av(){var t=Tv,e=!1,n=1,r=1,i=[0],o=Py,a=Py,s=Py,u=Py,c=Py;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(av),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=s[e];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=u)}for(var f=c[e],h=r/2+f,p=e+1,d=n-1;p>>1;c[m]u-o){var g=r?(i*v+a*y)/r:a;t(e,p,y,i,o,g,u),t(p,n,v,g,o,a,u)}else{var b=r?(o*v+u*y)/r:u;t(e,p,y,i,o,a,b),t(p,n,v,i,b,a,u)}}(0,u,t.value,e,n,r,i)}function Lv(t,e,n,r,i){(1&t.depth?Ev:sv)(t,e,n,r,i)}const Mv=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,c,l,f=-1,h=a.length,p=t.value;++f1?e:1)},n}(Ov);function Cv(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function jv(t,e){var n=Ai(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}function Pv(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Rv(t){return((t=Math.exp(t))+1/t)/2}const Iv=function t(e,n,r){function i(t,i){var o,a,s=t[0],u=t[1],c=t[2],l=i[0],f=i[1],h=i[2],p=l-s,d=f-u,m=p*p+d*d;if(m<1e-12)a=Math.log(h/c)/e,o=function(t){return[s+t*p,u+t*d,c*Math.exp(e*t*a)]};else{var y=Math.sqrt(m),v=(h*h-c*c+r*m)/(2*c*n*y),g=(h*h-c*c-r*m)/(2*h*n*y),b=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(g*g+1)-g);a=(_-b)/e,o=function(t){var r,i=t*a,o=Rv(b),l=c/(n*y)*(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[s+l*p,u+l*d,c*o/Rv(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 Dv(t){return function(e,n){var r=t((e=gi(e)).h,(n=gi(n)).h),i=Ni(e.s,n.s),o=Ni(e.l,n.l),a=Ni(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 Bv=Dv(Ai);var Fv=Dv(Ni);function $v(t,e){var n=Ni((t=Ls(t)).l,(e=Ls(e)).l),r=Ni(t.a,e.a),i=Ni(t.b,e.b),o=Ni(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 Kv(t){return function(e,n){var r=t((e=Bs(e)).h,(n=Bs(n)).h),i=Ni(e.c,n.c),o=Ni(e.l,n.l),a=Ni(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 Uv=Kv(Ai);var zv=Kv(Ni);function qv(t){return function e(n){function r(e,r){var i=t((e=Gs(e)).h,(r=Gs(r)).h),o=Ni(e.s,r.s),a=Ni(e.l,r.l),s=Ni(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=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}const Vv=qv(Ai);var Yv=qv(Ni);function Wv(t,e){void 0===e&&(e=t,t=qi);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n1&&Xv(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function tg(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)c.push(t[r[o[e]][2]]);for(e=+s;es!=c>s&&a<(u-n)*(s-r)/(c-r)+n&&(l=!l),u=n,c=r;return l}function ng(t){for(var e,n,r=-1,i=t.length,o=t[i-1],a=o[0],s=o[1],u=0;++r1);return t+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(rg),sg=function t(e){var n=ag.source(e);function r(){var t=n.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(rg),ug=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}(rg),cg=function t(e){var n=ug.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}(rg),lg=function t(e){function n(t){return function(){return-Math.log1p(-e())/t}}return n.source=t,n}(rg),fg=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}(rg),hg=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}(rg),pg=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}(rg),dg=function t(e){var n=ag.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(),s=1+o*t}while(s<=0);s*=s*s;var u=1-e()}while(u>=1-.0331*t*t*t*t&&Math.log(u)>=.5*t*t+i*(1-s+Math.log(s)));return i*s*a()*r}}return r.source=t,r}(rg),mg=function t(e){var n=dg.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}(rg),yg=function t(e){var n=pg.source(e),r=mg.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 s=Math.floor((o+1)*a),u=r(s,o-s+1)();u<=a?(i+=s,o-=s,a=(a-u)/(1-u)):(o=s-1,a/=u)}for(var c=a<.5,l=n(c?a:1-a),f=l(),h=0;f<=o;++h)f+=l();return i+(c?h:o-h)}}return i.source=t,i}(rg),vg=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}(rg),gg=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}(rg),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}(rg),_g=function t(e){var n=dg.source(e),r=yg.source(e);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),s=n(a)();if(s>o)return i+r(a-1,o/s)();i+=a,o-=s}for(var u=-Math.log1p(-e()),c=0;u<=o;++c)u-=Math.log1p(-e());return i+c}}return i.source=t,i}(rg),wg=1664525,xg=1013904223,kg=1/4294967296;function Eg(t=Math.random()){let e=0|(0<=t&&t<1?t/kg:Math.abs(t));return()=>(e=wg*e+xg|0,kg*(e>>>0))}function Og(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Sg(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 Tg=Symbol("implicit");function Ag(){var t=new Ot,e=[],n=[],r=Tg;function i(i){let o=t.get(i);if(void 0===o){if(r!==Tg)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 Ot;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 Ag(e,n).unknown(r)},Og.apply(i,arguments),i}function Ng(){var t,e,n=Ag().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,u=0,c=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?Dg:Ig,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(c(e)))}return f.invert=function(n){return c(e((o||(o=r(s,a.map(t),Fi)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Cg),l()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),l()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=Pv,l()},f.clamp=function(t){return arguments.length?(c=!!t||Pg,l()):c!==Pg},f.interpolate=function(t){return arguments.length?(u=t,l()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function $g(){return Fg()(Pg,Pg)}function Kg(t,e,n,r){var i,o=re(t,e,n);switch((r=af(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),pf(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=_f(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=gf(o))||(r.precision=i-2*("%"===r.type))}return hf(r)}function Ug(t){var e=t.domain;return t.ticks=function(t){var n=e();return ee(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Kg(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,s=o.length-1,u=o[a],c=o[s],l=10;for(c0;){if((i=ne(u,c,n))===r)return o[a]=u,o[s]=c,e(o);if(i>0)u=Math.floor(u/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function zg(){var t=$g();return t.copy=function(){return Bg(t,zg())},Og.apply(t,arguments),Ug(t)}function qg(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,Cg),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return qg(t).unknown(e)},t=arguments.length?Array.from(t,Cg):[0,1],Ug(n)}function Vg(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-e,n)}function Qg(t){const e=t(Yg,Wg),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?Jg:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=Xg(r),i=Xg(i),t(Hg,Gg)):t(Yg,Wg),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],s=e[e.length-1];const u=s0){for(;f<=h;++f)for(c=1;cs)break;d.push(l)}}else for(;f<=h;++f)for(c=o-1;c>=1;--c)if(l=f>0?c/i(-f):c*i(f),!(ls)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=af(n)).precision||(n.trim=!0),n=hf(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(Vg(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function Zg(){const t=Qg(Fg()).domain([1,10]);return t.copy=()=>Bg(t,Zg()).base(t.base()),Og.apply(t,arguments),t}function tb(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function eb(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nb(t){var e=1,n=t(tb(e),eb(e));return n.constant=function(n){return arguments.length?t(tb(e=+n),eb(e)):e},Ug(n)}function rb(){var t=nb(Fg());return t.copy=function(){return Bg(t,rb()).constant(t.constant())},Og.apply(t,arguments)}function ib(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ob(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ab(t){return t<0?-t*t:t*t}function sb(t){var e=t(Pg,Pg),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(Pg,Pg):.5===n?t(ob,ab):t(ib(n),ib(1/n)):n},Ug(e)}function ub(){var t=sb(Fg());return t.copy=function(){return Bg(t,ub()).exponent(t.exponent())},Og.apply(t,arguments),t}function cb(){return ub.apply(null,arguments).exponent(.5)}function lb(t){return Math.sign(t)*t*t}function fb(){var t,e=$g(),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(lb(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,Cg)).map(lb)),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 fb(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},Og.apply(i,arguments),Ug(i)}function hb(){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 pb().domain([e,n]).range(o).unknown(t)},Og.apply(Ug(a),arguments)}function db(){var t,e=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[ot(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 db().domain(e).range(n).unknown(t)},Og.apply(i,arguments)}const mb=1e3,yb=6e4,vb=36e5,gb=864e5,bb=6048e5,_b=31536e6,wb=new Date,xb=new Date;function kb(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 s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(skb((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)=>(wb.setTime(+e),xb.setTime(+r),t(wb),t(xb),Math.floor(n(wb,xb))),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 Eb=kb((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Eb.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?kb((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Eb:null);const Ob=Eb.range,Sb=kb((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*mb)}),((t,e)=>(e-t)/mb),(t=>t.getUTCSeconds())),Tb=Sb.range,Ab=kb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mb)}),((t,e)=>{t.setTime(+t+e*yb)}),((t,e)=>(e-t)/yb),(t=>t.getMinutes())),Nb=Ab.range,Lb=kb((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*yb)}),((t,e)=>(e-t)/yb),(t=>t.getUTCMinutes())),Mb=Lb.range,Cb=kb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mb-t.getMinutes()*yb)}),((t,e)=>{t.setTime(+t+e*vb)}),((t,e)=>(e-t)/vb),(t=>t.getHours())),jb=Cb.range,Pb=kb((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*vb)}),((t,e)=>(e-t)/vb),(t=>t.getUTCHours())),Rb=Pb.range,Ib=kb((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yb)/gb),(t=>t.getDate()-1)),Db=Ib.range,Bb=kb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/gb),(t=>t.getUTCDate()-1)),Fb=Bb.range,$b=kb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/gb),(t=>Math.floor(t/gb))),Kb=$b.range;function Ub(t){return kb((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())*yb)/bb))}const zb=Ub(0),qb=Ub(1),Vb=Ub(2),Yb=Ub(3),Wb=Ub(4),Hb=Ub(5),Gb=Ub(6),Jb=zb.range,Xb=qb.range,Qb=Vb.range,Zb=Yb.range,t_=Wb.range,e_=Hb.range,n_=Gb.range;function r_(t){return kb((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 i_=r_(0),o_=r_(1),a_=r_(2),s_=r_(3),u_=r_(4),c_=r_(5),l_=r_(6),f_=i_.range,h_=o_.range,p_=a_.range,d_=s_.range,m_=u_.range,y_=c_.range,v_=l_.range,g_=kb((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_=g_.range,__=kb((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())),w_=__.range,x_=kb((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()));x_.every=t=>isFinite(t=Math.floor(t))&&t>0?kb((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 k_=x_.range,E_=kb((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()));E_.every=t=>isFinite(t=Math.floor(t))&&t>0?kb((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 O_=E_.range;function S_(t,e,n,r,i,o){const a=[[Sb,1,mb],[Sb,5,5e3],[Sb,15,15e3],[Sb,30,3e4],[o,1,yb],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,vb],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,gb],[r,2,1728e5],[n,1,bb],[e,1,2592e6],[e,3,7776e6],[t,1,_b]];function s(e,n,r){const i=Math.abs(n-e)/r,o=Q((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(re(e/_b,n/_b,r));if(0===o)return Eb.every(Math.max(re(e,n,r),1));const[s,u]=a[i/a[o-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ex,s:nx,S:xw,u:kw,U:Ew,V:Sw,w:Tw,W:Aw,x:null,X:null,y:Nw,Y:Mw,Z:jw,"%":tx},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Pw,e:Pw,f:Fw,g:Jw,G:Qw,H:Rw,I:Iw,j:Dw,L:Bw,m:$w,M:Kw,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ex,s:nx,S:Uw,u:zw,U:qw,V:Yw,w:Ww,W:Hw,x:null,X:null,y:Gw,Y:Xw,Z:Zw,"%":tx},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=v.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=m.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:iw,e:iw,f:lw,g:tw,G:Z_,H:aw,I:aw,j:ow,L:cw,m:rw,M:sw,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l.get(r[0].toLowerCase()),n+r[0].length):-1},q:nw,Q:hw,s:pw,S:uw,u:G_,U:J_,V:X_,w:H_,W:Q_,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:tw,Y:Z_,Z:ew,"%":fw};function x(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=C_(j_(o.y,0,1))).getUTCDay(),r=i>4||0===i?o_.ceil(r):o_(r),r=Bb.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=M_(j_(o.y,0,1))).getDay(),r=i>4||0===i?qb.ceil(r):qb(r),r=Ib.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?C_(j_(o.y,0,1)).getUTCDay():M_(j_(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,C_(o)):M_(o)}}function E(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=w[i in $_?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 R_,I_,D_,B_,F_,$_={"-":"",_:" ",0:"0"},K_=/^\s*\d+/,U_=/^%/,z_=/[\\^$*+?|[\]().{}]/g;function q_(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function H_(t,e,n){var r=K_.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function G_(t,e,n){var r=K_.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function J_(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function X_(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Q_(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Z_(t,e,n){var r=K_.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function tw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ew(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 nw(t,e,n){var r=K_.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function rw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function iw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ow(t,e,n){var r=K_.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function aw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function sw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function uw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function cw(t,e,n){var r=K_.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function lw(t,e,n){var r=K_.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fw(t,e,n){var r=U_.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function hw(t,e,n){var r=K_.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function pw(t,e,n){var r=K_.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function dw(t,e){return q_(t.getDate(),e,2)}function mw(t,e){return q_(t.getHours(),e,2)}function yw(t,e){return q_(t.getHours()%12||12,e,2)}function vw(t,e){return q_(1+Ib.count(x_(t),t),e,3)}function gw(t,e){return q_(t.getMilliseconds(),e,3)}function bw(t,e){return gw(t,e)+"000"}function _w(t,e){return q_(t.getMonth()+1,e,2)}function ww(t,e){return q_(t.getMinutes(),e,2)}function xw(t,e){return q_(t.getSeconds(),e,2)}function kw(t){var e=t.getDay();return 0===e?7:e}function Ew(t,e){return q_(zb.count(x_(t)-1,t),e,2)}function Ow(t){var e=t.getDay();return e>=4||0===e?Wb(t):Wb.ceil(t)}function Sw(t,e){return t=Ow(t),q_(Wb.count(x_(t),t)+(4===x_(t).getDay()),e,2)}function Tw(t){return t.getDay()}function Aw(t,e){return q_(qb.count(x_(t)-1,t),e,2)}function Nw(t,e){return q_(t.getFullYear()%100,e,2)}function Lw(t,e){return q_((t=Ow(t)).getFullYear()%100,e,2)}function Mw(t,e){return q_(t.getFullYear()%1e4,e,4)}function Cw(t,e){var n=t.getDay();return q_((t=n>=4||0===n?Wb(t):Wb.ceil(t)).getFullYear()%1e4,e,4)}function jw(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q_(e/60|0,"0",2)+q_(e%60,"0",2)}function Pw(t,e){return q_(t.getUTCDate(),e,2)}function Rw(t,e){return q_(t.getUTCHours(),e,2)}function Iw(t,e){return q_(t.getUTCHours()%12||12,e,2)}function Dw(t,e){return q_(1+Bb.count(E_(t),t),e,3)}function Bw(t,e){return q_(t.getUTCMilliseconds(),e,3)}function Fw(t,e){return Bw(t,e)+"000"}function $w(t,e){return q_(t.getUTCMonth()+1,e,2)}function Kw(t,e){return q_(t.getUTCMinutes(),e,2)}function Uw(t,e){return q_(t.getUTCSeconds(),e,2)}function zw(t){var e=t.getUTCDay();return 0===e?7:e}function qw(t,e){return q_(i_.count(E_(t)-1,t),e,2)}function Vw(t){var e=t.getUTCDay();return e>=4||0===e?u_(t):u_.ceil(t)}function Yw(t,e){return t=Vw(t),q_(u_.count(E_(t),t)+(4===E_(t).getUTCDay()),e,2)}function Ww(t){return t.getUTCDay()}function Hw(t,e){return q_(o_.count(E_(t)-1,t),e,2)}function Gw(t,e){return q_(t.getUTCFullYear()%100,e,2)}function Jw(t,e){return q_((t=Vw(t)).getUTCFullYear()%100,e,2)}function Xw(t,e){return q_(t.getUTCFullYear()%1e4,e,4)}function Qw(t,e){var n=t.getUTCDay();return q_((t=n>=4||0===n?u_(t):u_.ceil(t)).getUTCFullYear()%1e4,e,4)}function Zw(){return"+0000"}function tx(){return"%"}function ex(t){return+t}function nx(t){return Math.floor(+t/1e3)}function rx(t){return R_=P_(t),I_=R_.format,D_=R_.parse,B_=R_.utcFormat,F_=R_.utcParse,R_}function ix(t){return new Date(t)}function ox(t){return t instanceof Date?+t:+new Date(+t)}function ax(t,e,n,r,i,o,a,s,u,c){var l=$g(),f=l.invert,h=l.domain,p=c(".%L"),d=c(":%S"),m=c("%I:%M"),y=c("%I %p"),v=c("%a %d"),g=c("%b %d"),b=c("%B"),_=c("%Y");function w(t){return(u(t)e(r/(t.length-1))))},n.quantiles=function(e){return Array.from({length:e+1},((n,r)=>de(t,r/e)))},n.copy=function(){return yx(e).domain(t)},Sg.apply(n,arguments)}function vx(){var t,e,n,r,i,o,a,s=0,u=.5,c=1,l=1,f=Pg,h=!1;function p(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*tCi(t[t.length-1]);var Ix=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(kx);const Dx=Rx(Ix);var Bx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(kx);const Fx=Rx(Bx);var $x=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(kx);const Kx=Rx($x);var Ux=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(kx);const zx=Rx(Ux);var qx=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(kx);const Vx=Rx(qx);var Yx=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(kx);const Wx=Rx(Yx);var Hx=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(kx);const Gx=Rx(Hx);var Jx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(kx);const Xx=Rx(Jx);var Qx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(kx);const Zx=Rx(Qx);var tk=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(kx);const ek=Rx(tk);var nk=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(kx);const rk=Rx(nk);var ik=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(kx);const ok=Rx(ik);var ak=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(kx);const sk=Rx(ak);var uk=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(kx);const ck=Rx(uk);var lk=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(kx);const fk=Rx(lk);var hk=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(kx);const pk=Rx(hk);var dk=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(kx);const mk=Rx(dk);var yk=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(kx);const vk=Rx(yk);var gk=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(kx);const bk=Rx(gk);var _k=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(kx);const wk=Rx(_k);var xk=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(kx);const kk=Rx(xk);var Ek=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(kx);const Ok=Rx(Ek);var Sk=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(kx);const Tk=Rx(Sk);var Ak=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(kx);const Nk=Rx(Ak);var Lk=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(kx);const Mk=Rx(Lk);var Ck=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(kx);const jk=Rx(Ck);var Pk=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(kx);const Rk=Rx(Pk);function Ik(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 Dk=Yv(Gs(300,.5,0),Gs(-240,.5,1));var Bk=Yv(Gs(-100,.75,.35),Gs(80,1.5,.8)),Fk=Yv(Gs(260,.75,.35),Gs(80,1.5,.8)),$k=Gs();function Kk(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return $k.h=360*t-100,$k.s=1.5-1.5*e,$k.l=.8-.9*e,$k+""}var Uk=ci(),zk=Math.PI/3,qk=2*Math.PI/3;function Vk(t){var e;return t=(.5-t)*Math.PI,Uk.r=255*(e=Math.sin(t))*e,Uk.g=255*(e=Math.sin(t+zk))*e,Uk.b=255*(e=Math.sin(t+qk))*e,Uk+""}function Yk(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 Wk(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Hk=Wk(kx("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Gk=Wk(kx("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Jk=Wk(kx("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Xk=Wk(kx("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Qk(t){return Pr(_r(t).call(document.documentElement))}var Zk=0;function tE(){return new eE}function eE(){this._="@"+(++Zk).toString(36)}function nE(t,e){return t.target&&(t=Vi(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>Yi(t,e)))}function rE(t){return"string"==typeof t?new Mr([document.querySelectorAll(t)],[document.documentElement]):new Mr([kn(t)],Lr)}function iE(t){return function(){return t}}eE.prototype=tE.prototype={constructor:eE,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 oE=Math.abs,aE=Math.atan2,sE=Math.cos,uE=Math.max,cE=Math.min,lE=Math.sin,fE=Math.sqrt,hE=1e-12,pE=Math.PI,dE=pE/2,mE=2*pE;function yE(t){return t>=1?dE:t<=-1?-dE:Math.asin(t)}function vE(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 is(e)}function gE(t){return t.innerRadius}function bE(t){return t.outerRadius}function _E(t){return t.startAngle}function wE(t){return t.endAngle}function xE(t){return t&&t.padAngle}function kE(t,e,n,r,i,o,a){var s=t-n,u=e-r,c=(a?o:-o)/fE(s*s+u*u),l=c*u,f=-c*s,h=t+l,p=e+f,d=n+l,m=r+f,y=(h+d)/2,v=(p+m)/2,g=d-h,b=m-p,_=g*g+b*b,w=i-o,x=h*m-d*p,k=(b<0?-1:1)*fE(uE(0,w*w*_-x*x)),E=(x*b-g*k)/_,O=(-x*g-b*k)/_,S=(x*b+g*k)/_,T=(-x*g+b*k)/_,A=E-y,N=O-v,L=S-y,M=T-v;return A*A+N*N>L*L+M*M&&(E=S,O=T),{cx:E,cy:O,x01:-l,y01:-f,x11:E*(i/w-1),y11:O*(i/w-1)}}function EE(){var t=gE,e=bE,n=iE(0),r=null,i=_E,o=wE,a=xE,s=null,u=vE(c);function c(){var c,l,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-dE,m=o.apply(this,arguments)-dE,y=oE(m-d),v=m>d;if(s||(s=c=u()),phE)if(y>mE-hE)s.moveTo(p*sE(d),p*lE(d)),s.arc(0,0,p,d,m,!v),h>hE&&(s.moveTo(h*sE(m),h*lE(m)),s.arc(0,0,h,m,d,v));else{var g,b,_=d,w=m,x=d,k=m,E=y,O=y,S=a.apply(this,arguments)/2,T=S>hE&&(r?+r.apply(this,arguments):fE(h*h+p*p)),A=cE(oE(p-h)/2,+n.apply(this,arguments)),N=A,L=A;if(T>hE){var M=yE(T/h*lE(S)),C=yE(T/p*lE(S));(E-=2*M)>hE?(x+=M*=v?1:-1,k-=M):(E=0,x=k=(d+m)/2),(O-=2*C)>hE?(_+=C*=v?1:-1,w-=C):(O=0,_=w=(d+m)/2)}var j=p*sE(_),P=p*lE(_),R=h*sE(k),I=h*lE(k);if(A>hE){var D,B=p*sE(w),F=p*lE(w),$=h*sE(x),K=h*lE(x);if(y1?0:f<-1?pE:Math.acos(f))/2),W=fE(D[0]*D[0]+D[1]*D[1]);N=cE(A,(h-W)/(Y-1)),L=cE(A,(p-W)/(Y+1))}else N=L=0}O>hE?L>hE?(g=kE($,K,j,P,p,L,v),b=kE(B,F,R,I,p,L,v),s.moveTo(g.cx+g.x01,g.cy+g.y01),LhE&&E>hE?N>hE?(g=kE(R,I,B,F,h,-N,v),b=kE(j,P,$,K,h,-N,v),s.lineTo(g.cx+g.x01,g.cy+g.y01),N=f;--h)s.point(v[h],g[h]);s.lineEnd(),s.areaEnd()}y&&(v[l]=+t(p,l,c),g[l]=+e(p,l,c),s.point(r?+r(p,l,c):v[l],n?+n(p,l,c):g[l]))}if(d)return s=null,d+""||null}function l(){return ME().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?NE:iE(+t),e="function"==typeof e?e:iE(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?LE:iE(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:iE(+e),r=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:iE(+e),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:iE(+t),c):r},c.y=function(t){return arguments.length?(e="function"==typeof t?t:iE(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:iE(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:iE(+t),c):n},c.lineX0=c.lineY0=function(){return l().x(t).y(e)},c.lineY1=function(){return l().x(t).y(n)},c.lineX1=function(){return l().x(r).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:iE(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),c):o},c}function jE(t,e){return et?1:e>=t?0:NaN}function PE(t){return t}function RE(){var t=PE,e=jE,n=null,r=iE(0),i=iE(mE),o=iE(0);function a(a){var s,u,c,l,f,h=(a=SE(a)).length,p=0,d=new Array(h),m=new Array(h),y=+r.apply(this,arguments),v=Math.min(mE,Math.max(-mE,i.apply(this,arguments)-y)),g=Math.min(Math.abs(v)/h,o.apply(this,arguments)),b=g*(v<0?-1:1);for(s=0;s0&&(p+=f);for(null!=e?d.sort((function(t,n){return e(m[t],m[n])})):null!=n&&d.sort((function(t,e){return n(a[t],a[e])})),s=0,c=p?(v-h*b)/p:0;s0?f*c:0)+b,m[u]={data:a[u],index:s,value:f,startAngle:y,endAngle:l,padAngle:g};return m}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:iE(+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:iE(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:iE(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:iE(+t),a):o},a}TE.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 IE=BE(AE);function DE(t){this._curve=t}function BE(t){function e(e){return new DE(t(e))}return e._curve=t,e}function FE(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(BE(t)):e()._curve},t}function $E(){return FE(ME().curve(IE))}function KE(){var t=CE().curve(IE),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 FE(n())},delete t.lineX0,t.lineEndAngle=function(){return FE(r())},delete t.lineX1,t.lineInnerRadius=function(){return FE(i())},delete t.lineY0,t.lineOuterRadius=function(){return FE(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(BE(t)):e()._curve},t}function UE(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}DE.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 zE{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 qE{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=UE(this._x0,this._y0),r=UE(this._x0,this._y0=(this._y0+e)/2),i=UE(t,this._y0),o=UE(t,e);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...i,...o)}this._x0=t,this._y0=e}}function VE(t){return new zE(t,!0)}function YE(t){return new zE(t,!1)}function WE(t){return new qE(t)}function HE(t){return t.source}function GE(t){return t.target}function JE(t){let e=HE,n=GE,r=NE,i=LE,o=null,a=null,s=vE(u);function u(){let u;const c=OE.call(arguments),l=e.apply(this,c),f=n.apply(this,c);if(null==o&&(a=t(u=s())),a.lineStart(),c[0]=l,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),u)return a=null,u+""||null}return u.source=function(t){return arguments.length?(e=t,u):e},u.target=function(t){return arguments.length?(n=t,u):n},u.x=function(t){return arguments.length?(r="function"==typeof t?t:iE(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:iE(+t),u):i},u.context=function(e){return arguments.length?(null==e?o=a=null:a=t(o=e),u):o},u}function XE(){return JE(VE)}function QE(){return JE(YE)}function ZE(){const t=JE(WE);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const tO=fE(3),eO={draw(t,e){const n=.59436*fE(e+cE(e/28,.75)),r=n/2,i=r*tO;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},nO={draw(t,e){const n=fE(e/pE);t.moveTo(n,0),t.arc(0,0,n,0,mE)}},rO={draw(t,e){const n=fE(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()}},iO=fE(1/3),oO=2*iO,aO={draw(t,e){const n=fE(e/oO),r=n*iO;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},sO={draw(t,e){const n=.62625*fE(e);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},uO={draw(t,e){const n=.87559*fE(e-cE(e/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},cO={draw(t,e){const n=fE(e),r=-n/2;t.rect(r,r,n,n)}},lO={draw(t,e){const n=.4431*fE(e);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},fO=lE(pE/10)/lE(7*pE/10),hO=lE(mE/10)*fO,pO=-sE(mE/10)*fO,dO={draw(t,e){const n=fE(.8908130915292852*e),r=hO*n,i=pO*n;t.moveTo(0,-n),t.lineTo(r,i);for(let e=1;e<5;++e){const o=mE*e/5,a=sE(o),s=lE(o);t.lineTo(s*n,-a*n),t.lineTo(a*r-s*i,s*r+a*i)}t.closePath()}},mO=fE(3),yO={draw(t,e){const n=-fE(e/(3*mO));t.moveTo(0,2*n),t.lineTo(-mO*n,-n),t.lineTo(mO*n,-n),t.closePath()}},vO=fE(3),gO={draw(t,e){const n=.6824*fE(e),r=n/2,i=n*vO/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},bO=-.5,_O=fE(3)/2,wO=1/fE(12),xO=3*(wO/2+1),kO={draw(t,e){const n=fE(e/xO),r=n/2,i=n*wO,o=r,a=n*wO+n,s=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,u),t.lineTo(bO*r-_O*i,_O*r+bO*i),t.lineTo(bO*o-_O*a,_O*o+bO*a),t.lineTo(bO*s-_O*u,_O*s+bO*u),t.lineTo(bO*r+_O*i,bO*i-_O*r),t.lineTo(bO*o+_O*a,bO*a-_O*o),t.lineTo(bO*s+_O*u,bO*u-_O*s),t.closePath()}},EO={draw(t,e){const n=.6189*fE(e-cE(e/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},OO=[nO,rO,aO,cO,dO,yO,kO],SO=[nO,uO,EO,gO,eO,lO,sO];function TO(t,e){let n=null,r=vE(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:iE(t||nO),e="function"==typeof e?e:iE(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:iE(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:iE(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function AO(){}function NO(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 LO(t){this._context=t}function MO(t){return new LO(t)}function CO(t){this._context=t}function jO(t){return new CO(t)}function PO(t){this._context=t}function RO(t){return new PO(t)}function IO(t,e){this._basis=new LO(t),this._beta=e}LO.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:NO(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:NO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},CO.prototype={areaStart:AO,areaEnd:AO,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:NO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},PO.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:NO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},IO.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,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const DO=function t(e){function n(t){return 1===e?new LO(t):new IO(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function BO(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 FO(t,e){this._context=t,this._k=(1-e)/6}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._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:BO(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:BO(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 $O=function t(e){function n(t){return new FO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function KO(t,e){this._context=t,this._k=(1-e)/6}KO.prototype={areaStart:AO,areaEnd:AO,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:BO(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 KO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function zO(t,e){this._context=t,this._k=(1-e)/6}zO.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:BO(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 qO=function t(e){function n(t){return new zO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function VO(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>hE){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>hE){var c=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*c+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}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(){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:VO(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 WO=function t(e){function n(t){return e?new YO(t,e):new FO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function HO(t,e){this._context=t,this._alpha=e}HO.prototype={areaStart:AO,areaEnd:AO,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:VO(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 GO=function t(e){function n(t){return e?new HO(t,e):new KO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function JO(t,e){this._context=t,this._alpha=e}JO.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:VO(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 XO=function t(e){function n(t){return e?new JO(t,e):new zO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function QO(t){this._context=t}function ZO(t){return new QO(t)}function tS(t){return t<0?-1:1}function eS(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),s=(o*i+a*r)/(r+i);return(tS(o)+tS(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function nS(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function rS(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function iS(t){this._context=t}function oS(t){this._context=new aS(t)}function aS(t){this._context=t}function sS(t){return new iS(t)}function uS(t){return new oS(t)}function cS(t){this._context=t}function lS(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]],s=a.length;o=0;)n[e]=e;return n}function gS(t,e){return t[e]}function bS(t){const e=[];return e.key=t,e}function _S(){var t=iE([]),e=vS,n=yS,r=gS;function i(i){var o,a,s=Array.from(t.apply(this,arguments),bS),u=s.length,c=-1;for(const t of i)for(o=0,++c;o0){for(var n,r,i,o=0,a=t[0].length;o0)for(var n,r,i,o,a,s,u=0,c=t[e[0]].length;u0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)}function kS(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 TS(t){var e=t.map(AS);return vS(t).sort((function(t,n){return e[t]-e[n]}))}function AS(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 CS="%Y-%m-%dT%H:%M:%S.%LZ",jS=Date.prototype.toISOString?function(t){return t.toISOString()}:B_(CS);const PS=jS;var RS=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:F_(CS);const IS=RS;function DS(t,e,n){var r=new ao,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?io():+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 BS=t=>()=>t;function FS(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 $S(t,e,n){this.k=t,this.x=e,this.y=n}$S.prototype={constructor:$S,scale:function(t){return 1===t?this:new $S(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new $S(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 KS=new $S(1,0,0);function US(t){for(;!t.__zoom;)if(!(t=t.parentNode))return KS;return t.__zoom}function zS(t){t.stopImmediatePropagation()}function qS(t){t.preventDefault(),t.stopImmediatePropagation()}function VS(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function YS(){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 WS(){return this.__zoom||KS}function HS(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function GS(){return navigator.maxTouchPoints||"ontouchstart"in this}function JS(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 XS(){var t,e,n,r=VS,i=YS,o=JS,a=HS,s=GS,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,f=Iv,h=_n("start","zoom","end"),p=500,d=150,m=0,y=10;function v(t){t.property("__zoom",WS).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",S).filter(s).on("touchstart.zoom",T).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new $S(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 $S(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),s=i.apply(t,o),u=null==n?_(s):"function"==typeof n?n.apply(t,o):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,o):e,p=f(l.invert(u).concat(c/l.k),h.invert(u).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=p(t),n=c/e[2];t=new $S(n,u[0]-e[0]*n,u[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,s=Math.max(u[0],Math.min(u[1],i.k*Math.pow(2,a.apply(this,arguments)))),l=Yi(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===s)return;n.mouse=[l,i.invert(l)],So(this),n.start()}qS(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(g(i,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function O(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=x(this,e,!0).event(t),s=Pr(t.view).on("mousemove.zoom",(function(t){if(qS(t),!a.moved){var e=t.clientX-l,n=t.clientY-f;a.moved=e*e+n*n>m}a.event(t).zoom("mouse",o(b(a.that.__zoom,a.mouse[0]=Yi(t,i),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),$r(t.view,a.moved),qS(t),a.event(t).end()}),!0),u=Yi(t,i),l=t.clientX,f=t.clientY;Fr(t.view),zS(t),a.mouse=[u,this.__zoom.invert(u)],So(this),a.start()}}function S(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=Yi(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),f=o(b(g(n,u),a,s),i.apply(this,e),c);qS(t),l>0?Pr(this).transition().duration(l).call(w,f,a,t):Pr(this).call(v.transform,f,a,t)}}function T(n,...i){if(r.apply(this,arguments)){var o,a,s,u,c=n.touches,l=c.length,f=x(this,i,n.changedTouches.length===l).event(n);for(zS(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,s=n.y,u=n.width,c=n.height;if(i>=r&&i<=r+u&&o>=s&&o<=s+c){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&&function(t,e){for(var n=0;nf?p:f),r.attr("height",d>h?d:h);var m=this.viewport.select(".".concat(e.data.id," .components-background")),y=m.node().getBoundingClientRect();return f=Math.max((a-y.x)/n,e.data.definition.minWidth-e.data.definition.reservedWidth),h=Math.max((s-y.y)/n,e.data.definition.minHeight-e.data.definition.reservedHeight),p=(c-y.x)/n,d=(l-y.y)/n,m.attr("width",p>f?p:f),m.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,s=o.y,u=o.width,c=o.height;r=Math.max(r,a+u+n.definition.margin),i=Math.max(i,s+c+n.definition.margin)})),{x:r,y:i}}}],r&&function(t,e){for(var n=0;nt.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&&function(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,s=t.minHeight,u=t.reservedWidth,c=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,m=this.getPoints(p,i,o);r.length>0;)h||(h=r[0]),0===m.length&&(d=0,p+=1,m=this.getPoints(p,i,o)),m.length>0&&this.canBePlaced(n,h,m[d])&&(h.x=m[d].x,h.y=m[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)>=m.length&&(d=0,p+=1,m=this.getPoints(p,i,o));t.width=Math.max(l+i+u,a),t.height=Math.max(f+i+c,s)}},{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,s=n.x+e.widthr+o,c=n.y+e.heighti+a;return s||u||c||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,s=e;s<=r&&(s!==r||i!==a);)o.push({x:s,y:i}),s+=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,s=e.reservedHeight,u=n,c=0;e.children.forEach((function(t){t.x=u,t.y=n,u=t.x+t.width+r,t.height>c&&(c=t.height)})),e.width=Math.max(u-r+n+a,i),e.height=Math.max(c+2*n+s,o)}},{key:"generateVerticalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,s=e.reservedHeight,u=n,c=0;e.children.forEach((function(t){t.x=n,t.y=u,u=t.y+t.height+r,t.width>c&&(c=t.width)})),e.width=Math.max(c+2*n+a,i),e.height=Math.max(u-r+n+s,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,s=i.reservedWidth,u=i.reservedHeight,c=i.margin,l=Math.max(n+2*c+s,o),f=Math.max(r+2*c+u,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&&function(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){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),N(n),y}},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;N(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function uN(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function cN(t){var e=function(t){if("object"!=eN(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=eN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eN(e)?e:e+""}var lN=function(){return e=function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.pluginData=n,this.componentRenderer=null,this.linkRenderer=null,this.layout=null,this.viewport=null,this.scene=null,this.d3=t,this.actions={deleteAction:null,dragComponent:null,dragScene:null,linkAction:null,menuAction:null,resizeComponent:null,toggleSelection:null,selectionAll:null,deselectionAll:null,zoom:null},this.states={linking:!1,menuOpening:!1,moving:!1,resizing:!1,selection:!1},this.readOnly=!1},n=[{key:"init",value:function(t){var e=arguments.length>1&&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 tN(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 FA(this.pluginData,this.viewport,t)}},{key:"initLinkRenderer",value:function(t){return new zA(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 kA(this.pluginData,this.viewport,this.layout),this.actions.deleteAction=new cT(this.pluginData,this.viewport,this.layout),this.actions.dragScene=new OT(this.pluginData,this.viewport,this.layout),this.actions.menuAction=new KT(this.pluginData,this.viewport,this.layout),this.actions.link=new jT(this.pluginData,this.viewport,this.layout),this.actions.zoom=new MA(this.pluginData,this.viewport,this.layout),this.actions.dragComponent=new vT(this.pluginData,this.viewport,this.layout),this.actions.resizeComponent=new GT(this.pluginData,this.viewport,this.layout),this.actions.toggleSelection=new oA(this.pluginData,this.viewport,this.layout),this.actions.deselectionAll=new pA(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=sN().mark((function e(n){var r,i,o,a,s,u,c;return sN().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,s=t.states.linking,u="scene"===n.subject.datum().data.id,c=!1,!t.readOnly){e.next=10;break}return u&&r&&t.actions.dragScene.finalize(n),e.abrupt("return");case 10:s?c=t.actions.link.finalize(n):r&&u?c=t.actions.dragScene.finalize(n):a?c=t.actions.resizeComponent.finalize(n):r&&!u?c=t.actions.dragComponent.finalize(n):!r&&o?c=t.actions.menuAction.finalize(n):r||u||!i||(c=t.actions.toggleSelection.finalize(n)),c&&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){uN(o,r,i,a,s,"next",t)}function s(t){uN(o,r,i,a,s,"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,s=r.y,u=e/iu;)c*=.9;this.scene.attr("viewBox","".concat(a-15," ").concat(s-15," ").concat(i+a+15," ").concat(o+s+15)),this.pluginData.scene.zoom=c}}},{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(oN({id:"scene",name:"",children:nN(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(),s=a.x,u=a.y;t.drawOption.x=(e.clientX-s-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,t.drawOption.y=(e.clientY-u-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&&function(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 v(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&&function(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 G({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&&function(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,s=e.type,u=e.action,c=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=s||null,this.action=u||null,this.status=c||null,this.data=l||null}));const ON=EN;function SN(t){return SN="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},SN(t)}function TN(t,e,n){return e=NN(e),function(t,e){if(e&&("object"==SN(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,AN()?Reflect.construct(e,n||[],NN(t).constructor):e.apply(t,n))}function AN(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(AN=function(){return!!t})()}function NN(t){return NN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},NN(t)}function LN(t,e){return LN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},LN(t,e)}var MN=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=TN(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&&LN(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}($);const CN=MN;function jN(t){return jN="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},jN(t)}function PN(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}},m=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===(s=d.definitions)||void 0===s?void 0:s.components)||[],links:(null===(u=d.definitions)||void 0===u?void 0:u.links)||[]},this.parseLogs=d.parseLogs||[],this.__eventIndex=0,this.eventManager=m,this.eventLogs=[],this.configuration=e,this.resources={icons:IN({},null===(c=d.resources)||void 0===c?void 0:c.icons),markers:IN({},null===(l=d.resources)||void 0===l?void 0:l.markers),links:IN({},null===(f=d.resources)||void 0===f?void 0:f.links),models:IN({},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.28.0"}},{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 O({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 PN(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 PN(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)?PN(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 $({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 CN({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 ON(IN(IN({},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:IN({},e)}),r}}],e&&function(t,e){for(var n=0;n0&&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=zN({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=zN({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 WN=YN;function HN(t){return HN="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},HN(t)}function GN(t){var e=function(t){if("object"!=HN(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=HN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==HN(e)?e:e+""}var JN=function(){return t=function t(){var e=arguments.length>0&&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 WN,this.data=e.pluginData||new $N(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new fN(this.data),this.__metadata=e.pluginMetadata||new mN(this.data),this.__parser=e.pluginParser||new bN(this.data),this.__renderer=e.pluginRenderer||new kN(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,s=document.querySelector("#".concat(t)).getBoundingClientRect(),u=s.left,c=s.top;return{x:(n-u-a.x)/o,y:(r-c-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&&function(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 ZN=QN;function tL(t){return tL="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},tL(t)}function eL(t,e,n){return e=rL(e),function(t,e){if(e&&("object"==tL(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,nL()?Reflect.construct(e,n||[],rL(t).constructor):e.apply(t,n))}function nL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nL=function(){return!!t})()}function rL(t){return rL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rL(t)}function iL(t,e){return iL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},iL(t,e)}var oL=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=eL(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&&iL(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const aL=oL})();var o=e;for(var a in i)o[a]=i[a];i.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()},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 s(t,e){return i.hasOwnProperty.call(t,e)}function u(t){return o[t]}function c(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,c.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 s=new Error(t).stack;o=function(){return s}}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,c).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:h,NodeList:f,Value:l,Literal:p,Symbol:d,Group:m,Array:y,Pair:v,Dict:g,Output:K,Capture:U,TemplateData:z,If:_,IfAsync:w,InlineIf:x,For:k,AsyncEach:E,AsyncAll:O,Macro:S,Caller:T,Import:A,FromImport:N,FunCall:L,Filter:M,FilterAsync:C,KeywordArgs:j,Block:P,Super:R,Extends:I,Include:D,Set:B,Switch:F,Case:$,LookupVal:b,BinOp:V,In:Y,Is:W,Or:H,And:G,Not:J,Add:X,Concat:Q,Sub:Z,Mul:tt,Div:et,FloorDiv:nt,Mod:rt,Pow:it,Neg:ot,Pos:at,Compare:st,CompareOperand:ut,CallExtension:ct,CallExtensionAsync:lt,printNodes:function t(e,n){if(n=n||0,ft(e.typename+": ",n),e instanceof f)ft("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ct)ft(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?ft(JSON.stringify(i,null,2)+"\n",null,!0):ft("\n"),r.forEach((function(e){var r=e[0],i=e[1];ft("["+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),s=n(0).TemplateError,u=n(2).Frame,c=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 s(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 u=this._tmpid();this._emitLine(", "+this._makeCallback(u)),this._emitLine(this.buffer+" += runtime.suppressValue("+u+", "+s+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+s+" && 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 s=n._tmpid();n._emitLine("var "+s+" = "+o+"["+r+"]["+a+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+a+"]);"),e.set(t.name.children[a].value,s)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var s=t.name.children,u=s[0],c=s[1],l=this._tmpid(),f=this._tmpid();e.set(u.value,l),e.set(c.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("'+u.value+'", '+l+");"),this._emitLine('frame.set("'+c.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(),s=this._tmpid(),u=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+s+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof a.Array){var c=t.name.children.length;this._emit("runtime."+u+"("+s+", "+c+", 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."+u+"("+s+", 1, function("+l+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+l+'", '+l+");"),e.set(l,l)}this._emitLoopBindings(t,s,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 (!"+s+".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(),s=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 c,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+'"'}));c=s?e.push(!0):new u,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+l.join(", ")+") {","var callerFrame = frame;","frame = "+(s?"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+");"),c.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,c),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,c)})),this._emitLine("frame = "+(s?"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),s=n?"true":"false",u=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+s+", "+o+", "+u+", "+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,s=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 "+s+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,s),e.parent?n._emitLine('frame.set("'+o+'", '+s+");"):n._emitLine('context.setVariable("'+o+'", '+s+");")}))},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 u,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 u;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}(c);t.exports={compile:function(t,e,n,r,a){void 0===a&&(a={});var s=new f(r,a.throwOnUndefined),u=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return s.compile(o.transform(i.parse(u,n,a),e,r)),s.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),s=n(0),u=n(5),c=n(18),l=n(10),f=l.FileSystemLoader,h=l.WebLoader,p=l.PrecompiledLoader,d=n(20),m=n(21),y=n(1),v=y.Obj,g=y.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))}}}},O=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=s.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=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],s._entries(c).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),s._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=s.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,u=this,c=null;if(t&&t.raw&&(t=t.raw),s.isFunction(n)&&(i=n,n=null,e=e||!1),s.isFunction(e)&&(i=e,e=!1),t instanceof T)c=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 s=this.parsePrimary();if("_"===s.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",s.lineno,s.colno),this.skipSymbol("as")){var u=this.parsePrimary();r.addChild(new o.Pair(s.lineno,s.colno,s,u))}else r.addChild(s);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},u.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},u.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},u.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},u.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},u.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},u.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 s,u=this.peekToken(),c=[];do{this.skipSymbol(n);var l=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);c.push(new o.Case(u.line,u.col,l,f)),u=this.peekToken()}while(u&&u.value===n);switch(u.value){case r:this.advanceAfterBlockEnd(),s=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,c,s)},u.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==s.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 u=a[0],c=a[1],l=a[2];l===t?r+=1:l===e&&(r-=1),0===r?(i+=c,this.tokens.backN(u.length-c.length)):i+=u}return new o.Output(s.lineno,s.colno,[new o.TemplateData(s.lineno,s.colno,i)])},u.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},u.parseExpression=function(){return this.parseInlineIf()},u.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},u.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},u.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},u.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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)},u.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)},u.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},u.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},u.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])},u.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 s=this.parseExpression();t.addChild(s)}}return t},u.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),s=!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(s&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var u=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?a.addChild(new o.Pair(u.lineno,u.colno,u,this.parseExpression())):r.addChild(u)}s=!0}return a.children.length&&r.addChild(a),r},u.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],D=M+this.current();switch(-1!==r.indexOf(I,D)&&(this.forward(),M=D,-1!==r.indexOf(I,D+this.current())&&(M=D+this.current(),this.forward())),M){case"(":R=d;break;case")":R=m;break;case"[":R=y;break;case"]":R=v;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 L(R,M,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return L(O,t+"."+B,e,n)}return L("int",t,e,n)}if(t.match(/^(true|false)$/))return L(S,t,e,n);if("none"===t)return L(T,t,e,n);if("null"===t)return L(T,t,e,n);if(t)return L(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=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,L(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,L(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var U=t.slice(-this.colno);if(/^\s+$/.test(U)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return L(K?p:u,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 u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}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 s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,l=y(u,c);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},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.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 s(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,a=r.repeat(" ",n/2-n%2),s=r.repeat(" ",n/2);return i.copySafeness(t,a+t+s)},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"),s=r.repeat(" ",e),u=a.map((function(t,e){return 0!==e||n?""+s+t:t})).join("\n");return i.copySafeness(t,u)},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=u,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=c(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=c(!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 s=t.indexOf(e);if(0===r||-1===s)return t;for(var u=0,c=0;s>-1&&(-1===r||c=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})),s=r.getAttrGetter(i);return a.sort((function(t,a){var u=i?s(t):t,c=i?s(a):a;if(o.env.opts.throwOnUndefined&&i&&(void 0===u||void 0===c))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(u)&&r.isString(c)&&(u=u.toLowerCase(),c=c.toLowerCase()),uc?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 s(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 s=t.lastIndexOf(" ",e);-1===s&&(s=e),t=t.substring(0,s)}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\./,m=/\.(?: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+"":m.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 y=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=y,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),s=n(7).Environment,u=n(24);function c(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 s([]),r=e.wrapper||u;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 s([])).asyncFilters,u=n.extensionsList;e=e.replace(/\\/g,"/");try{r=a.compile(t,i,u,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 s([]),o=e.wrapper||u;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 s=i.join(o,a),u=s.substr(i.join(t,"/").length),l=r.statSync(s);l&&l.isDirectory()?c(u+="/",e.exclude)||n(s):c(u,e.include)&&p.push(s)}))}(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{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,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,{default:()=>oi});var t=n(149);const e={generic:JSON.parse('{"workflow":{"type":"workflow","category":"workflow","model":"workflow","icon":"DefaultWorkflow","displayName":"Workflow","description":"A workflow is a configurable automated process that will run one or more jobs.

Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows","childrenTypes":["push-trigger","pullrequest-trigger","job"],"categories":["GithubAction"],"isContainer":true,"available":true,"attributes":[{"name":"name","type":"String","required":true,"description":"The name of the workflow as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows#understanding-the-workflow-file"}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":12,"reservedHeight":80,"margin":15,"gap":50},"trigger":{"type":"trigger","category":"trigger","model":"trigger","icon":"DefaultTrigger","available":false,"parentTypes":["workflow"],"categories":["GithubAction"],"attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":0,"reservedHeight":0,"margin":15,"gap":50},"job":{"type":"job","category":"job","model":"job","displayName":"Job","description":"A workflow run is made up of one or more jobs, which run in parallel by default.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow","icon":"DefaultJob","available":true,"parentTypes":["workflow"],"childrenTypes":["command-step","reusable-step"],"categories":["GithubAction"],"isContainer":true,"displayType":"workflow","workflowDirection":"horizontal","linkModel":"defaultLink","attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true},{"name":"name","type":"String","description":"The name of the job as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"runs-on","type":"String","displayName":"Type of runner","description":"The type of machine to run the job on.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on"},{"name":"needs","displayName":"Previous job(s)","description":"Identify any jobs that must complete successfully before this job will run","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#defining-prerequisite-jobs","type":"Link","linkType":"Reverse","linkRef":"job","linkModel":"defaultLink"}],"defaultWidth":96,"defaultHeight":80,"minWidth":140,"minHeight":200,"reservedWidth":12,"reservedHeight":80,"margin":15,"gap":50},"step":{"type":"step","category":"step","model":"step","icon":"DefaultStep","available":false,"parentTypes":["job"],"categories":["GithubAction"],"description":"Task of the job. Step can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsteps","attributes":[{"name":"job_id","displayName":"Id of job","type":"Reference","containerRef":"job","required":true},{"name":"name","type":"String","description":"The name of the step as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"env","type":"Object","displayName":"Environment variables","description":"Variables for steps to use in the runner environment.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv"}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":0,"reservedHeight":0,"margin":15,"gap":50}}'),trigger:JSON.parse('[{"type":"push-trigger","category":"trigger","icon":"PushTrigger","displayName":"Trigger - push","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push","action":"push","attributes":[{"name":"branches","type":"Array","description":"Select branch name on push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs"}]},{"type":"pullrequest-trigger","category":"trigger","icon":"PullRequestTrigger","displayName":"Trigger - pull request","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a pull request event.","action":"pull_request","attributes":[{"name":"types","type":"Array","displayName":"Activity types","description":"Run your workflow when an activity on a pull request occurs in the workflow\'s repository.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request"}]}]'),step:JSON.parse('[{"type":"command-step","category":"step","displayName":"Command step","icon":"CommandStep","name":"command-step","attributes":[{"name":"run","type":"String","required":true}]},{"type":"reusable-step","category":"step","displayName":"Reusable step","icon":"ReusableStep","name":"reusable-step","attributes":[{"name":"uses","type":"String","required":true,"displayName":"External action","description":"Select an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses"},{"name":"with","type":"Object","displayName":"Input parameters","description":"Input parameters of the action defined by \\"uses\\" keyword.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith"}]}]')};function i(t){return i="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},i(t)}function o(t,e,n){return e=s(e),function(t,e){if(e&&("object"==i(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,a()?Reflect.construct(e,n||[],s(t).constructor):e.apply(t,n))}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(a=function(){return!!t})()}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}const c=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{available:!1,category:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=o(this,e,[n])).available=!!n.available,t.category=n.category||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&&u(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.ComponentDefinition);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){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 h(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{action:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=m(this,e,[h(h({},n),{},{category:"trigger"})])).action=n.action||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&&g(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(c);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){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 x(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n!!t&&"object"==typeof t&&t[z]===D,V=t=>!!t&&"object"==typeof t&&t[z]===B,Y=t=>!!t&&"object"==typeof t&&t[z]===F,W=t=>!!t&&"object"==typeof t&&t[z]===$,H=t=>!!t&&"object"==typeof t&&t[z]===K,G=t=>!!t&&"object"==typeof t&&t[z]===U;function J(t){if(t&&"object"==typeof t)switch(t[z]){case F:case U:return!0}return!1}function X(t){if(t&&"object"==typeof t)switch(t[z]){case D:case F:case K:case U:return!0}return!1}const Q=t=>(H(t)||J(t))&&!!t.anchor,Z=Symbol("break visit"),tt=Symbol("skip children"),et=Symbol("remove node");function nt(t,e){const n=at(e);V(t)?rt(null,t.contents,n,Object.freeze([t]))===et&&(t.contents=null):rt(null,t,n,Object.freeze([]))}function rt(t,e,n,r){const i=st(t,e,n,r);if(X(i)||W(i))return ut(t,r,i),rt(t,i,n,r);if("symbol"!=typeof i)if(J(e)){r=Object.freeze(r.concat(e));for(let t=0;t"!==t[t.length-1]&&e("Verbatim tags must end with a >"),n)}const[,n,r]=t.match(/^(.*!)([^!]*)$/s);r||e(`The ${t} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(t){return e(String(t)),null}return"!"===n?t:(e(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[e,n]of Object.entries(this.tags))if(t.startsWith(n))return e+t.substring(n.length).replace(/[!,[\]{}]/g,(t=>ct[t]));return"!"===t[0]?t:`!<${t}>`}toString(t){const e=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(t&&n.length>0&&X(t.contents)){const e={};nt(t.contents,((t,n)=>{X(n)&&n.tag&&(e[n.tag]=!0)})),r=Object.keys(e)}else r=[];for(const[i,o]of n)"!!"===i&&"tag:yaml.org,2002:"===o||t&&!r.some((t=>t.startsWith(o)))||e.push(`%TAG ${i} ${o}`);return e.join("\n")}}function ft(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const e=JSON.stringify(t);throw new Error(`Anchor must not contain whitespace or control characters: ${e}`)}return!0}function ht(t){const e=new Set;return nt(t,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function pt(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function dt(t,e,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let e=0,n=r.length;emt(t,String(e),n)));if(t&&"function"==typeof t.toJSON){if(!n||!Q(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=t=>{r.res=t,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof t||n?.keep?t:Number(t)}lt.defaultYaml={explicit:!1,version:"1.2"},lt.defaultTags={"!!":"tag:yaml.org,2002:"};class yt{constructor(t){Object.defineProperty(this,z,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:e,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!V(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:!0===e,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},a=mt(this,"",o);if("function"==typeof r)for(const{count:t,res:e}of o.anchors.values())r(e,t);return"function"==typeof i?dt(i,{"":a},"",a):a}}class vt extends yt{constructor(t){super(D),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let e;return nt(t,{Node:(t,n)=>{if(n===this)return nt.BREAK;n.anchor===this.source&&(e=n)}}),e}toJSON(t,e){if(!e)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=e,o=this.resolve(r);if(!o){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(t)}let a=n.get(o);if(a||(mt(o,null,e),a=n.get(o)),!a||void 0===a.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=gt(r,o,n)),a.count*a.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return a.res}toString(t,e,n){const r=`*${this.source}`;if(t){if(ft(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(t)}if(t.implicitKey)return`${r} `}return r}}function gt(t,e,n){if(q(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(J(e)){let r=0;for(const i of e.items){const e=gt(t,i,n);e>r&&(r=e)}return r}if(W(e)){const r=gt(t,e.key,n),i=gt(t,e.value,n);return Math.max(r,i)}return 1}const bt=t=>!t||"function"!=typeof t&&"object"!=typeof t;class _t extends yt{constructor(t){super(K),this.value=t}toJSON(t,e){return e?.keep?this.value:mt(this.value,t,e)}toString(){return String(this.value)}}_t.BLOCK_FOLDED="BLOCK_FOLDED",_t.BLOCK_LITERAL="BLOCK_LITERAL",_t.PLAIN="PLAIN",_t.QUOTE_DOUBLE="QUOTE_DOUBLE",_t.QUOTE_SINGLE="QUOTE_SINGLE";const wt="tag:yaml.org,2002:";function xt(t,e,n){if(V(t)&&(t=t.contents),X(t))return t;if(W(t)){const e=n.schema[F].createNode?.(n.schema,null,n);return e.items.push(t),e}(t instanceof String||t instanceof Number||t instanceof Boolean||"undefined"!=typeof BigInt&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:a,sourceObjects:s}=n;let u;if(r&&t&&"object"==typeof t){if(u=s.get(t),u)return u.anchor||(u.anchor=i(t)),new vt(u.anchor);u={anchor:null,node:null},s.set(t,u)}e?.startsWith("!!")&&(e=wt+e.slice(2));let c=function(t,e,n){if(e){const t=n.filter((t=>t.tag===e)),r=t.find((t=>!t.format))??t[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find((e=>e.identify?.(t)&&!e.format))}(t,e,a.tags);if(!c){if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),!t||"object"!=typeof t){const e=new _t(t);return u&&(u.node=e),e}c=t instanceof Map?a[F]:Symbol.iterator in Object(t)?a[U]:a[F]}o&&(o(c),delete n.onTagObj);const l=c?.createNode?c.createNode(n.schema,t,n):"function"==typeof c?.nodeClass?.from?c.nodeClass.from(n.schema,t,n):new _t(t);return e?l.tag=e:c.default||(l.tag=c.tag),u&&(u.node=l),l}function kt(t,e,n){let r=n;for(let t=e.length-1;t>=0;--t){const n=e[t];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const t=[];t[n]=r,r=t}else r=new Map([[n,r]])}return xt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Et=t=>null==t||"object"==typeof t&&!!t[Symbol.iterator]().next().done;class Ot extends yt{constructor(t,e){super(t),Object.defineProperty(this,"schema",{value:e,configurable:!0,enumerable:!1,writable:!0})}clone(t){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(e.schema=t),e.items=e.items.map((e=>X(e)||W(e)?e.clone(t):e)),this.range&&(e.range=this.range.slice()),e}addIn(t,e){if(Et(t))this.add(e);else{const[n,...r]=t,i=this.get(n,!0);if(J(i))i.addIn(r,e);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,kt(this.schema,r,e))}}}deleteIn(t){const[e,...n]=t;if(0===n.length)return this.delete(e);const r=this.get(e,!0);if(J(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn(t,e){const[n,...r]=t,i=this.get(n,!0);return 0===r.length?!e&&H(i)?i.value:i:J(i)?i.getIn(r,e):void 0}hasAllNullValues(t){return this.items.every((e=>{if(!W(e))return!1;const n=e.value;return null==n||t&&H(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn(t){const[e,...n]=t;if(0===n.length)return this.has(e);const r=this.get(e,!0);return!!J(r)&&r.hasIn(n)}setIn(t,e){const[n,...r]=t;if(0===r.length)this.set(n,e);else{const t=this.get(n,!0);if(J(t))t.setIn(r,e);else{if(void 0!==t||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,kt(this.schema,r,e))}}}}const St=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Tt(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const At=(t,e,n)=>t.endsWith("\n")?Tt(n,e):n.includes("\n")?"\n"+Tt(n,e):(t.endsWith(" ")?"":" ")+n,Nt="flow",Lt="block",Mt="quoted";function Ct(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:a,onOverflow:s}={}){if(!i||i<0)return t;ii-Math.max(2,o)?c.push(0):p=i-r);let d=!1,m=-1,y=-1,v=-1;n===Lt&&(m=jt(t,m,e.length),-1!==m&&(p=m+u));for(let r;r=t[m+=1];){if(n===Mt&&"\\"===r){switch(y=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}v=m}if("\n"===r)n===Lt&&(m=jt(t,m,e.length)),p=m+e.length+u,f=void 0;else{if(" "===r&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const e=t[m+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(f=m)}if(m>=p)if(f)c.push(f),p=f+u,f=void 0;else if(n===Mt){for(;" "===h||"\t"===h;)h=r,r=t[m+=1],d=!0;const e=m>v+1?m-2:y-1;if(l[e])return t;c.push(e),l[e]=!0,p=e+u,f=void 0}else d=!0}h=r}if(d&&s&&s(),0===c.length)return t;a&&a();let g=t.slice(0,c[0]);for(let r=0;r({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Rt=t=>/^(%|---|\.\.\.)/m.test(t);function It(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Rt(t)?" ":"");let a="",s=0;for(let t=0,e=n[t];e;e=n[++t])if(" "===e&&"\\"===n[t+1]&&"n"===n[t+2]&&(a+=n.slice(s,t)+"\\ ",t+=1,s=t,e="\\"),"\\"===e)switch(n[t+1]){case"u":{a+=n.slice(s,t);const e=n.substr(t+2,4);switch(e){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===e.substr(0,2)?a+="\\x"+e.substr(2):a+=n.substr(t,6)}t+=5,s=t+1}break;case"n":if(r||'"'===n[t+2]||n.lengthr)return!0;if(n=e+1,i-n<=r)return!1}return!0}(n,u,c.length));if(!n)return l?"|\n":">\n";let f,h;for(h=n.length;h>0;--h){const t=n[h-1];if("\n"!==t&&"\t"!==t&&" "!==t)break}let p=n.substring(h);const d=p.indexOf("\n");-1===d?f="-":n===p||d!==p.length-1?(f="+",o&&o()):f="",p&&(n=n.slice(0,-p.length),"\n"===p[p.length-1]&&(p=p.slice(0,-1)),p=p.replace(Ft,`$&${c}`));let m,y=!1,v=-1;for(m=0;m")+(y?c?"2":"1":"")+f;return t&&(b+=" "+s(t.replace(/ ?[\r\n]+/g," ")),i&&i()),l?`${b}\n${c}${g}${n=n.replace(/\n+/g,`$&${c}`)}${p}`:`${b}\n${c}${Ct(`${g}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`)}${p}`,c,Lt,Pt(r,!0))}`}function Kt(t,e,n,r){const{implicitKey:i,inFlow:o}=e,a="string"==typeof t.value?t:Object.assign({},t,{value:String(t.value)});let{type:s}=t;s!==_t.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(s=_t.QUOTE_DOUBLE);const u=t=>{switch(t){case _t.BLOCK_FOLDED:case _t.BLOCK_LITERAL:return i||o?Bt(a.value,e):$t(a,e,n,r);case _t.QUOTE_DOUBLE:return It(a.value,e);case _t.QUOTE_SINGLE:return Dt(a.value,e);case _t.PLAIN:return function(t,e,n,r){const{type:i,value:o}=t,{actualString:a,implicitKey:s,indent:u,indentStep:c,inFlow:l}=e;if(s&&o.includes("\n")||l&&/[[\]{},]/.test(o))return Bt(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return s||l||!o.includes("\n")?Bt(o,e):$t(t,e,n,r);if(!s&&!l&&i!==_t.PLAIN&&o.includes("\n"))return $t(t,e,n,r);if(Rt(o)){if(""===u)return e.forceBlockIndent=!0,$t(t,e,n,r);if(s&&u===c)return Bt(o,e)}const f=o.replace(/\n+/g,`$&\n${u}`);if(a){const t=t=>t.default&&"tag:yaml.org,2002:str"!==t.tag&&t.test?.test(f),{compat:n,tags:r}=e.doc.schema;if(r.some(t)||n?.some(t))return Bt(o,e)}return s?f:Ct(f,u,Nt,Pt(e,!1))}(a,e,n,r);default:return null}};let c=u(s);if(null===c){const{defaultKeyType:t,defaultStringType:n}=e.options,r=i&&t||n;if(c=u(r),null===c)throw new Error(`Unsupported default string type ${r}`)}return c}function Ut(t,e){const n=Object.assign({blockQuote:!0,commentString:St,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function zt(t,e,n,r){if(W(t))return t.toString(e,n,r);if(q(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const o=X(t)?t:e.doc.createNode(t,{onTagObj:t=>i=t});i||(i=function(t,e){if(e.tag){const n=t.filter((t=>t.tag===e.tag));if(n.length>0)return n.find((t=>t.format===e.format))??n[0]}let n,r;if(H(e)){r=e.value;const i=t.filter((t=>t.identify?.(r)));n=i.find((t=>t.format===e.format))??i.find((t=>!t.format))}else r=e,n=t.find((t=>t.nodeClass&&r instanceof t.nodeClass));if(!n)throw new Error(`Tag not resolved for ${r?.constructor?.name??typeof r} value`);return n}(e.doc.schema.tags,o));const a=function(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],o=(H(t)||J(t))&&t.anchor;o&&ft(o)&&(n.add(o),i.push(`&${o}`));const a=t.tag?t.tag:e.default?null:e.tag;return a&&i.push(r.directives.tagString(a)),i.join(" ")}(o,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);const s="function"==typeof i.stringify?i.stringify(o,e,n,r):H(o)?Kt(o,e,n,r):o.toString(e,n,r);return a?H(o)||"{"===s[0]||"["===s[0]?`${a} ${s}`:`${a}\n${e.indent}${s}`:s}function qt(t,e){"debug"!==t&&"warn"!==t||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(e):console.warn(e))}function Vt(t,e,{key:n,value:r}){if(t?.doc.schema.merge&&Yt(n))if(r=q(r)?r.resolve(t.doc):r,G(r))for(const n of r.items)Wt(t,e,n);else if(Array.isArray(r))for(const n of r)Wt(t,e,n);else Wt(t,e,r);else{const i=mt(n,"",t);if(e instanceof Map)e.set(i,mt(r,i,t));else if(e instanceof Set)e.add(i);else{const o=function(t,e,n){if(null===e)return"";if("object"!=typeof e)return String(e);if(X(t)&&n?.doc){const e=Ut(n.doc,{});e.anchors=new Set;for(const t of n.anchors.keys())e.anchors.add(t.anchor);e.inFlow=!0,e.inStringifyKey=!0;const r=t.toString(e);if(!n.mapKeyWarned){let t=JSON.stringify(r);t.length>40&&(t=t.substring(0,36)+'..."'),qt(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}(n,i,t),a=mt(r,o,t);o in e?Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[o]=a}}return e}const Yt=t=>"<<"===t||H(t)&&"<<"===t.value&&(!t.type||t.type===_t.PLAIN);function Wt(t,e,n){const r=t&&q(n)?n.resolve(t.doc):n;if(!Y(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,t,Map);for(const[t,n]of i)e instanceof Map?e.has(t)||e.set(t,n):e instanceof Set?e.add(t):Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0});return e}function Ht(t,e,n){const r=xt(t,void 0,n),i=xt(e,void 0,n);return new Gt(r,i)}class Gt{constructor(t,e=null){Object.defineProperty(this,z,{value:$}),this.key=t,this.value=e}clone(t){let{key:e,value:n}=this;return X(e)&&(e=e.clone(t)),X(n)&&(n=n.clone(t)),new Gt(e,n)}toJSON(t,e){return Vt(e,e?.mapAsMap?new Map:{},this)}toString(t,e,n){return t?.doc?function({key:t,value:e},n,r,i){const{allNullValues:o,doc:a,indent:s,indentStep:u,options:{commentString:c,indentSeq:l,simpleKeys:f}}=n;let h=X(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(J(t)||!X(t)&&"object"==typeof t)throw new Error("With simple keys, collection cannot be used as a key value")}let p=!f&&(!t||h&&null==e&&!n.inFlow||J(t)||(H(t)?t.type===_t.BLOCK_FOLDED||t.type===_t.BLOCK_LITERAL:"object"==typeof t));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:s+u});let d,m,y,v=!1,g=!1,b=zt(t,n,(()=>v=!0),(()=>g=!0));if(!p&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||null==e)return v&&r&&r(),""===b?"?":p?`? ${b}`:b}else if(o&&!f||null==e&&p)return b=`? ${b}`,h&&!v?b+=At(b,n.indent,c(h)):g&&i&&i(),b;v&&(h=null),p?(h&&(b+=At(b,n.indent,c(h))),b=`? ${b}\n${s}:`):(b=`${b}:`,h&&(b+=At(b,n.indent,c(h)))),X(e)?(d=!!e.spaceBefore,m=e.commentBefore,y=e.comment):(d=!1,m=null,y=null,e&&"object"==typeof e&&(e=a.createNode(e))),n.implicitKey=!1,p||h||!H(e)||(n.indentAtStart=b.length+1),g=!1,l||!(u.length>=2)||n.inFlow||p||!G(e)||e.flow||e.tag||e.anchor||(n.indent=n.indent.substring(2));let _=!1;const w=zt(e,n,(()=>_=!0),(()=>g=!0));let x=" ";if(h||d||m)x=d?"\n":"",m&&(x+=`\n${Tt(c(m),n.indent)}`),""!==w||n.inFlow?x+=`\n${n.indent}`:"\n"===x&&(x="\n\n");else if(!p&&J(e)){const t=w[0],r=w.indexOf("\n"),i=-1!==r,o=n.inFlow??e.flow??0===e.items.length;if(i||!o){let e=!1;if(i&&("&"===t||"!"===t)){let n=w.indexOf(" ");"&"===t&&-1!==n&&na=null),(()=>f=!0));a&&(s+=At(s,o,c(a))),f&&a&&(f=!1),h.push(r+s)}let p;if(0===h.length)p=i.start+i.end;else{p=h[0];for(let t=1;to=null));nl||a.includes("\n"))&&(c=!0),f.push(a),l=f.length}const{start:h,end:p}=n;if(0===f.length)return h+p;if(!c){const t=f.reduce(((t,e)=>t+e.length+2),2);c=e.options.lineWidth>0&&t>e.options.lineWidth}if(c){let t=h;for(const e of f)t+=e?`\n${o}${i}${e}`:"\n";return`${t}\n${i}${p}`}return`${h}${a}${f.join(" ")}${a}${p}`}function Zt({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const i=Tt(e(r),t);n.push(i.trimStart())}}function te(t,e){const n=H(e)?e.value:e;for(const r of t)if(W(r)){if(r.key===e||r.key===n)return r;if(H(r.key)&&r.key.value===n)return r}}class ee extends Ot{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(F,t),this.items=[]}static from(t,e,n){const{keepUndefined:r,replacer:i}=n,o=new this(t),a=(t,a)=>{if("function"==typeof i)a=i.call(e,t,a);else if(Array.isArray(i)&&!i.includes(t))return;(void 0!==a||r)&&o.items.push(Ht(t,a,n))};if(e instanceof Map)for(const[t,n]of e)a(t,n);else if(e&&"object"==typeof e)for(const t of Object.keys(e))a(t,e[t]);return"function"==typeof t.sortMapEntries&&o.items.sort(t.sortMapEntries),o}add(t,e){let n;n=W(t)?t:t&&"object"==typeof t&&"key"in t?new Gt(t.key,t.value):new Gt(t,t?.value);const r=te(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${n.key} already set`);H(r.value)&&bt(n.value)?r.value.value=n.value:r.value=n.value}else if(i){const t=this.items.findIndex((t=>i(n,t)<0));-1===t?this.items.push(n):this.items.splice(t,0,n)}else this.items.push(n)}delete(t){const e=te(this.items,t);return!!e&&this.items.splice(this.items.indexOf(e),1).length>0}get(t,e){const n=te(this.items,t),r=n?.value;return(!e&&H(r)?r.value:r)??void 0}has(t){return!!te(this.items,t)}set(t,e){this.add(new Gt(t,e),!0)}toJSON(t,e,n){const r=n?new n:e?.mapAsMap?new Map:{};e?.onCreate&&e.onCreate(r);for(const t of this.items)Vt(e,r,t);return r}toString(t,e,n){if(!t)return JSON.stringify(this);for(const t of this.items)if(!W(t))throw new Error(`Map items must all be pairs; found ${JSON.stringify(t)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Jt(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:e})}}const ne={collection:"map",default:!0,nodeClass:ee,tag:"tag:yaml.org,2002:map",resolve:(t,e)=>(Y(t)||e("Expected a mapping for this tag"),t),createNode:(t,e,n)=>ee.from(t,e,n)};class re extends Ot{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(U,t),this.items=[]}add(t){this.items.push(t)}delete(t){const e=ie(t);return"number"==typeof e&&this.items.splice(e,1).length>0}get(t,e){const n=ie(t);if("number"!=typeof n)return;const r=this.items[n];return!e&&H(r)?r.value:r}has(t){const e=ie(t);return"number"==typeof e&&e=0?e:null}const oe={collection:"seq",default:!0,nodeClass:re,tag:"tag:yaml.org,2002:seq",resolve:(t,e)=>(G(t)||e("Expected a sequence for this tag"),t),createNode:(t,e,n)=>re.from(t,e,n)},ae={identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:(t,e,n,r)=>Kt(t,e=Object.assign({actualString:!0},e),n,r)},se={identify:t=>null==t,createNode:()=>new _t(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _t(null),stringify:({source:t},e)=>"string"==typeof t&&se.test.test(t)?t:e.options.nullStr},ue={identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new _t("t"===t[0]||"T"===t[0]),stringify:({source:t,value:e},n)=>t&&ue.test.test(t)&&e===("t"===t[0]||"T"===t[0])?t:e?n.options.trueStr:n.options.falseStr};function ce({format:t,minFractionDigits:e,tag:n,value:r}){if("bigint"==typeof r)return String(r);const i="number"==typeof r?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=JSON.stringify(r);if(!t&&e&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(o)){let t=o.indexOf(".");t<0&&(t=o.length,o+=".");let n=e-(o.length-t-1);for(;n-- >0;)o+="0"}return o}const le={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ce},fe={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ce(t)}},he={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new _t(parseFloat(t)),n=t.indexOf(".");return-1!==n&&"0"===t[t.length-1]&&(e.minFractionDigits=t.length-n-1),e},stringify:ce},pe=t=>"bigint"==typeof t||Number.isInteger(t),de=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function me(t,e,n){const{value:r}=t;return pe(r)&&r>=0?n+r.toString(e):ce(t)}const ye={identify:t=>pe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>de(t,2,8,n),stringify:t=>me(t,8,"0o")},ve={identify:pe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>de(t,0,10,n),stringify:ce},ge={identify:t=>pe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>de(t,2,16,n),stringify:t=>me(t,16,"0x")},be=[ne,oe,ae,se,ue,ye,ve,ge,le,fe,he];function _e(t){return"bigint"==typeof t||Number.isInteger(t)}const we=({value:t})=>JSON.stringify(t),xe=[ne,oe].concat([{identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:we},{identify:t=>null==t,createNode:()=>new _t(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:we},{identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>"true"===t,stringify:we},{identify:_e,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>_e(t)?t.toString():JSON.stringify(t)},{identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:we}],{default:!0,tag:"",test:/^/,resolve:(t,e)=>(e(`Unresolved plain scalar ${JSON.stringify(t)}`),t)}),ke={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if("function"==typeof Buffer)return Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t1&&e("Each pair must have its own sequence indicator");const t=r.items[0]||new Gt(new _t(null));if(r.commentBefore&&(t.key.commentBefore=t.key.commentBefore?`${r.commentBefore}\n${t.key.commentBefore}`:r.commentBefore),r.comment){const e=t.value??t.key;e.comment=e.comment?`${r.comment}\n${e.comment}`:r.comment}r=t}t.items[n]=W(r)?r:new Gt(r)}}else e("Expected a sequence for this tag");return t}function Oe(t,e,n){const{replacer:r}=n,i=new re(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let t of e){let a,s;if("function"==typeof r&&(t=r.call(e,String(o++),t)),Array.isArray(t)){if(2!==t.length)throw new TypeError(`Expected [key, value] tuple: ${t}`);a=t[0],s=t[1]}else if(t&&t instanceof Object){const e=Object.keys(t);if(1!==e.length)throw new TypeError(`Expected tuple with one key, not ${e.length} keys`);a=e[0],s=t[a]}else a=t;i.items.push(Ht(a,s,n))}return i}const Se={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ee,createNode:Oe};class Te extends re{constructor(){super(),this.add=ee.prototype.add.bind(this),this.delete=ee.prototype.delete.bind(this),this.get=ee.prototype.get.bind(this),this.has=ee.prototype.has.bind(this),this.set=ee.prototype.set.bind(this),this.tag=Te.tag}toJSON(t,e){if(!e)return super.toJSON(t);const n=new Map;e?.onCreate&&e.onCreate(n);for(const t of this.items){let r,i;if(W(t)?(r=mt(t.key,"",e),i=mt(t.value,r,e)):r=mt(t,"",e),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}static from(t,e,n){const r=Oe(t,e,n),i=new this;return i.items=r.items,i}}Te.tag="tag:yaml.org,2002:omap";const Ae={collection:"seq",identify:t=>t instanceof Map,nodeClass:Te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=Ee(t,e),r=[];for(const{key:t}of n.items)H(t)&&(r.includes(t.value)?e(`Ordered maps must not include duplicate keys: ${t.value}`):r.push(t.value));return Object.assign(new Te,n)},createNode:(t,e,n)=>Te.from(t,e,n)};function Ne({value:t,source:e},n){return e&&(t?Le:Me).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Le={identify:t=>!0===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new _t(!0),stringify:Ne},Me={identify:t=>!1===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new _t(!1),stringify:Ne},Ce={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ce},je={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ce(t)}},Pe={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new _t(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(-1!==n){const r=t.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(e.minFractionDigits=r.length)}return e},stringify:ce},Re=t=>"bigint"==typeof t||Number.isInteger(t);function Ie(t,e,n,{intAsBigInt:r}){const i=t[0];if("-"!==i&&"+"!==i||(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`}const e=BigInt(t);return"-"===i?BigInt(-1)*e:e}const o=parseInt(t,n);return"-"===i?-1*o:o}function De(t,e,n){const{value:r}=t;if(Re(r)){const t=r.toString(e);return r<0?"-"+n+t.substr(1):n+t}return ce(t)}const Be={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Ie(t,2,2,n),stringify:t=>De(t,2,"0b")},Fe={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Ie(t,1,8,n),stringify:t=>De(t,8,"0")},$e={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Ie(t,0,10,n),stringify:ce},Ke={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Ie(t,2,16,n),stringify:t=>De(t,16,"0x")};class Ue extends ee{constructor(t){super(t),this.tag=Ue.tag}add(t){let e;e=W(t)?t:t&&"object"==typeof t&&"key"in t&&"value"in t&&null===t.value?new Gt(t.key,null):new Gt(t,null),te(this.items,e.key)||this.items.push(e)}get(t,e){const n=te(this.items,t);return!e&&W(n)?H(n.key)?n.key.value:n.key:n}set(t,e){if("boolean"!=typeof e)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof e);const n=te(this.items,t);n&&!e?this.items.splice(this.items.indexOf(n),1):!n&&e&&this.items.push(new Gt(t))}toJSON(t,e){return super.toJSON(t,e,Set)}toString(t,e,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),e,n);throw new Error("Set items must all have null values")}static from(t,e,n){const{replacer:r}=n,i=new this(t);if(e&&Symbol.iterator in Object(e))for(let t of e)"function"==typeof r&&(t=r.call(e,t,t)),i.items.push(Ht(t,null,n));return i}}Ue.tag="tag:yaml.org,2002:set";const ze={collection:"map",identify:t=>t instanceof Set,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ue.from(t,e,n),resolve(t,e){if(Y(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ue,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function qe(t,e){const n=t[0],r="-"===n||"+"===n?t.substring(1):t,i=t=>e?BigInt(t):Number(t),o=r.replace(/_/g,"").split(":").reduce(((t,e)=>t*i(60)+i(e)),i(0));return"-"===n?i(-1)*o:o}function Ve(t){let{value:e}=t,n=t=>t;if("bigint"==typeof e)n=t=>BigInt(t);else if(isNaN(e)||!isFinite(e))return ce(t);let r="";e<0&&(r="-",e*=n(-1));const i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map((t=>String(t).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const Ye={identify:t=>"bigint"==typeof t||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>qe(t,n),stringify:Ve},We={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>qe(t,!1),stringify:Ve},He={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(He.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,o,a,s]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(n,r-1,i,o||0,a||0,s||0,u);const l=e[8];if(l&&"Z"!==l){let t=qe(l,!1);Math.abs(t)<30&&(t*=60),c-=6e4*t}return new Date(c)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Ge=[ne,oe,ae,se,Le,Me,Be,Fe,$e,Ke,Ce,je,Pe,ke,Ae,Se,ze,Ye,We,He],Je=new Map([["core",be],["failsafe",[ne,oe,ae]],["json",xe],["yaml11",Ge],["yaml-1.1",Ge]]),Xe={binary:ke,bool:ue,float:he,floatExp:fe,floatNaN:le,floatTime:We,int:ve,intHex:ge,intOct:ye,intTime:Ye,map:ne,null:se,omap:Ae,pairs:Se,seq:oe,set:ze,timestamp:He},Qe={"tag:yaml.org,2002:binary":ke,"tag:yaml.org,2002:omap":Ae,"tag:yaml.org,2002:pairs":Se,"tag:yaml.org,2002:set":ze,"tag:yaml.org,2002:timestamp":He};function Ze(t,e){let n=Je.get(e);if(!n){if(!Array.isArray(t)){const t=Array.from(Je.keys()).filter((t=>"yaml11"!==t)).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${t} or define customTags array`)}n=[]}if(Array.isArray(t))for(const e of t)n=n.concat(e);else"function"==typeof t&&(n=t(n.slice()));return n.map((t=>{if("string"!=typeof t)return t;const e=Xe[t];if(e)return e;const n=Object.keys(Xe).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown custom tag "${t}"; use one of ${n}`)}))}const tn=(t,e)=>t.keye.key?1:0;class en{constructor({compat:t,customTags:e,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Ze(t,"compat"):t?Ze(null,t):null,this.merge=!!n,this.name="string"==typeof i&&i||"core",this.knownTags=r?Qe:{},this.tags=Ze(e,this.name),this.toStringOptions=a??null,Object.defineProperty(this,F,{value:ne}),Object.defineProperty(this,K,{value:ae}),Object.defineProperty(this,U,{value:oe}),this.sortMapEntries="function"==typeof o?o:!0===o?tn:null}clone(){const t=Object.create(en.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}class nn{constructor(t,e,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,z,{value:B});let r=null;"function"==typeof e||Array.isArray(e)?r=e:void 0===n&&e&&(n=e,e=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new lt({version:o}),this.setSchema(o,n),this.contents=void 0===t?null:this.createNode(t,r,n)}clone(){const t=Object.create(nn.prototype,{[z]:{value:B}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=X(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){rn(this.contents)&&this.contents.add(t)}addIn(t,e){rn(this.contents)&&this.contents.addIn(t,e)}createAlias(t,e){if(!t.anchor){const n=ht(this);t.anchor=!e||n.has(e)?pt(e||"a",n):e}return new vt(t.anchor)}createNode(t,e,n){let r;if("function"==typeof e)t=e.call({"":t},"",t),r=e;else if(Array.isArray(e)){const t=t=>"number"==typeof t||t instanceof String||t instanceof Number,n=e.filter(t).map(String);n.length>0&&(e=e.concat(n)),r=e}else void 0===n&&e&&(n=e,e=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:s,onTagObj:u,tag:c}=n??{},{onAnchor:l,setAnchors:f,sourceObjects:h}=function(t,e){const n=[],r=new Map;let i=null;return{onAnchor:r=>{n.push(r),i||(i=ht(t));const o=pt(e,i);return i.add(o),o},setAnchors:()=>{for(const t of n){const e=r.get(t);if("object"!=typeof e||!e.anchor||!H(e.node)&&!J(e.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}e.node.anchor=e.anchor}},sourceObjects:r}}(this,o||"a"),p=xt(t,c,{aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:l,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:h});return a&&J(p)&&(p.flow=!0),f(),p}createPair(t,e,n={}){const r=this.createNode(t,null,n),i=this.createNode(e,null,n);return new Gt(r,i)}delete(t){return!!rn(this.contents)&&this.contents.delete(t)}deleteIn(t){return Et(t)?null!=this.contents&&(this.contents=null,!0):!!rn(this.contents)&&this.contents.deleteIn(t)}get(t,e){return J(this.contents)?this.contents.get(t,e):void 0}getIn(t,e){return Et(t)?!e&&H(this.contents)?this.contents.value:this.contents:J(this.contents)?this.contents.getIn(t,e):void 0}has(t){return!!J(this.contents)&&this.contents.has(t)}hasIn(t){return Et(t)?void 0!==this.contents:!!J(this.contents)&&this.contents.hasIn(t)}set(t,e){null==this.contents?this.contents=kt(this.schema,[t],e):rn(this.contents)&&this.contents.set(t,e)}setIn(t,e){Et(t)?this.contents=e:null==this.contents?this.contents=kt(this.schema,Array.from(t),e):rn(this.contents)&&this.contents.setIn(t,e)}setSchema(t,e={}){let n;switch("number"==typeof t&&(t=String(t)),t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new lt({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new lt({version:t}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const e=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${e}`)}}if(e.schema instanceof Object)this.schema=e.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new en(Object.assign(n,e))}}toJS({json:t,jsonArg:e,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},s=mt(this.contents,e??"",a);if("function"==typeof i)for(const{count:t,res:e}of a.anchors.values())i(e,t);return"function"==typeof o?dt(o,{"":s},"",s):s}toJSON(t,e){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:e})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const e=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${e}`)}return function(t,e){const n=[];let r=!0===e.directives;if(!1!==e.directives&&t.directives){const e=t.directives.toString(t);e?(n.push(e),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const i=Ut(t,e),{commentString:o}=i.options;if(t.commentBefore){1!==n.length&&n.unshift("");const e=o(t.commentBefore);n.unshift(Tt(e,""))}let a=!1,s=null;if(t.contents){if(X(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const e=o(t.contents.commentBefore);n.push(Tt(e,""))}i.forceBlockIndent=!!t.comment,s=t.contents.comment}const e=s?void 0:()=>a=!0;let u=zt(t.contents,i,(()=>s=null),e);s&&(u+=At(u,"",o(s))),"|"!==u[0]&&">"!==u[0]||"---"!==n[n.length-1]?n.push(u):n[n.length-1]=`--- ${u}`}else n.push(zt(t.contents,i));if(t.directives?.docEnd)if(t.comment){const e=o(t.comment);e.includes("\n")?(n.push("..."),n.push(Tt(e,""))):n.push(`... ${e}`)}else n.push("...");else{let e=t.comment;e&&a&&(e=e.replace(/^\n+/,"")),e&&(a&&!s||""===n[n.length-1]||n.push(""),n.push(Tt(o(e),"")))}return n.join("\n")+"\n"}(this,t)}}function rn(t){if(J(t))return!0;throw new Error("Expected a YAML collection as document contents")}class on extends Error{constructor(t,e,n,r){super(),this.name=t,this.code=n,this.message=r,this.pos=e}}class an extends on{constructor(t,e,n){super("YAMLParseError",t,e,n)}}class sn extends on{constructor(t,e,n){super("YAMLWarning",t,e,n)}}const un=(t,e)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((t=>e.linePos(t)));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,a=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const t=Math.min(o-39,a.length-79);a="…"+a.substring(t),o-=t-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,o))){let n=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),a=n+a}if(/[^ ]/.test(a)){let t=1;const e=n.linePos[1];e&&e.line===r&&e.col>i&&(t=Math.max(1,Math.min(e.col-i,80-o)));const s=" ".repeat(o)+"^".repeat(t);n.message+=`:\n\n${a}\n${s}\n`}};function cn(t,{flow:e,indicator:n,next:r,offset:i,onError:o,parentIndent:a,startOnNewline:s}){let u=!1,c=s,l=s,f="",h="",p=!1,d=!1,m=null,y=null,v=null,g=null,b=null,_=null,w=null;for(const i of t)switch(d&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),m&&(c&&"comment"!==i.type&&"newline"!==i.type&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":e||"doc-start"===n&&"flow-collection"===r?.type||!i.source.includes("\t")||(m=i),l=!0;break;case"comment":{l||o(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=i.source.substring(1)||" ";f?f+=h+t:f=t,h="",c=!1;break}case"newline":c?f?f+=i.source:u=!0:h+=i.source,c=!0,p=!0,(y||v)&&(g=i),l=!0;break;case"anchor":y&&o(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&o(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=i,null===w&&(w=i.offset),c=!1,l=!1,d=!0;break;case"tag":v&&o(i,"MULTIPLE_TAGS","A node can have at most one tag"),v=i,null===w&&(w=i.offset),c=!1,l=!1,d=!0;break;case n:(y||v)&&o(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),_&&o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${e??"collection"}`),_=i,c="seq-item-ind"===n||"explicit-key-ind"===n,l=!1;break;case"comma":if(e){b&&o(i,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=i,c=!1,l=!1;break}default:o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),c=!1,l=!1}const x=t[t.length-1],k=x?x.offset+x.source.length:i;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=a||"block-map"===r?.type||"block-seq"===r?.type)&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:_,spaceBefore:u,comment:f,hasNewline:p,anchor:y,tag:v,newlineAfterProp:g,end:k,start:w??k}}function ln(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const e of t.items){for(const t of e.start)if("newline"===t.type)return!0;if(e.sep)for(const t of e.sep)if("newline"===t.type)return!0;if(ln(e.key)||ln(e.value))return!0}return!1;default:return!0}}function fn(t,e,n){if("flow-collection"===e?.type){const r=e.end[0];r.indent!==t||"]"!==r.source&&"}"!==r.source||!ln(e)||n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function hn(t,e,n){const{uniqueKeys:r}=t.options;if(!1===r)return!1;const i="function"==typeof r?r:(e,n)=>e===n||H(e)&&H(n)&&e.value===n.value&&!("<<"===e.value&&t.schema.merge);return e.some((t=>i(t.key,n)))}const pn="All mapping items must start at the same column";function dn(t,e,n,r){let i="";if(t){let o=!1,a="";for(const s of t){const{source:t,type:u}=s;switch(u){case"space":o=!0;break;case"comment":{n&&!o&&r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=t.substring(1)||" ";i?i+=a+e:i=e,a="";break}case"newline":i&&(a+=t),o=!0;break;default:r(s,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=t.length}}return{comment:i,offset:e}}const mn="Block collections are not allowed within flow collections",yn=t=>t&&("block-map"===t.type||"block-seq"===t.type);function vn(t,e,n,r,i,o){const a="block-map"===n.type?function({composeNode:t,composeEmptyNode:e},n,r,i,o){const a=new(o?.nodeClass??ee)(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,u=null;for(const o of r.items){const{start:c,key:l,sep:f,value:h}=o,p=cn(c,{indicator:"explicit-key-ind",next:l??f?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),d=!p.found;if(d){if(l&&("block-seq"===l.type?i(s,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in l&&l.indent!==r.indent&&i(s,"BAD_INDENT",pn)),!p.anchor&&!p.tag&&!f){u=p.end,p.comment&&(a.comment?a.comment+="\n"+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||ln(l))&&i(l??c[c.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(s,"BAD_INDENT",pn);const m=p.end,y=l?t(n,l,p,i):e(n,m,c,null,p,i);n.schema.compat&&fn(r.indent,l,i),hn(n,a.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const v=cn(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,parentIndent:r.indent,startOnNewline:!l||"block-scalar"===l.type});if(s=v.end,v.found){d&&("block-map"!==h?.type||v.hasNewline||i(s,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start0){const t=dn(p,d,n.options.strict,i);t.comment&&(u.comment?u.comment+="\n"+t.comment:u.comment=t.comment),u.range=[r.offset,d,t.offset]}else u.range=[r.offset,d,d];return u}(t,e,n,r,o),s=a.constructor;return"!"===i||i===s.tagName?(a.tag=s.tagName,a):(i&&(a.tag=i),a)}function gn(t){let e,n;try{e=new RegExp("(.*?)(?"===i.mode?_t.BLOCK_FOLDED:_t.BLOCK_LITERAL,a=e.source?function(t){const e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let t=1;t=0;--t){const e=a[t][1];if(""!==e&&"\r"!==e)break;s=t}if(0===s){const t="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let n=r+i.length;return e.source&&(n+=e.source.length),{value:t,type:o,comment:i.comment,range:[r,n,n]}}let u=e.indent+i.indent,c=e.offset+i.length,l=0;for(let e=0;eu&&(u=r.length),c+=r.length+o.length+1}for(let t=a.length-1;t>=s;--t)a[t][0].length>u&&(s=t+1);let f="",h="",p=!1;for(let t=0;tu||"\t"===r[0]?(" "===h?h="\n":p||"\n"!==h||(h="\n\n"),f+=h+e.slice(u)+r,h="\n",p=!0):""===r?"\n"===h?f+="\n":h="\n":(f+=h+r,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let t=s;tn(r+t,e,i);switch(i){case"scalar":s=_t.PLAIN,u=function(t,e){let n="";switch(t[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${t[0]}`;break;case"@":case"`":n=`reserved character ${t[0]}`}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),gn(t)}(o,c);break;case"single-quoted-scalar":s=_t.QUOTE_SINGLE,u=function(t,e){return"'"===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR","Missing closing 'quote"),gn(t.slice(1,-1)).replace(/''/g,"'")}(o,c);break;case"double-quoted-scalar":s=_t.QUOTE_DOUBLE,u=function(t,e){let n="";for(let r=1;re?t.slice(e,r+1):i)}else n+=i}return'"'===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}(o,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const l=r+o.length,f=dn(a,l,e,n);return{value:u,type:s,comment:f.comment,range:[r,l,f.offset]}}(e,t.options.strict,r),u=n?t.directives.tagName(n.source,(t=>r(n,"TAG_RESOLVE_FAILED",t))):null,c=n&&u?function(t,e,n,r,i){if("!"===n)return t[K];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===n){if(!e.default||!e.test)return e;o.push(e)}for(const t of o)if(t.test?.test(e))return t;const a=t.knownTags[n];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),t[K])}(t.schema,i,u,n,r):"scalar"===e.type?function({directives:t,schema:e},n,r,i){const o=e.tags.find((t=>t.default&&t.test?.test(n)))||e[K];if(e.compat){const a=e.compat.find((t=>t.default&&t.test?.test(n)))??e[K];o.tag!==a.tag&&i(r,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(a.tag)}`,!0)}return o}(t,i,e,r):t.schema[K];let l;try{const o=c.resolve(i,(t=>r(n??e,"TAG_RESOLVE_FAILED",t)),t.options);l=H(o)?o:new _t(o)}catch(t){const o=t instanceof Error?t.message:String(t);r(n??e,"TAG_RESOLVE_FAILED",o),l=new _t(i)}return l.range=s,l.source=i,o&&(l.type=o),u&&(l.tag=u),c.format&&(l.format=c.format),a&&(l.comment=a),l}function kn(t,e,n){if(e){null===n&&(n=e.length);for(let r=n-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++r];"space"===n?.type;)t+=n.source.length,n=e[++r];break}}return t}const En={composeNode:On,composeEmptyNode:Sn};function On(t,e,n,r){const{spaceBefore:i,comment:o,anchor:a,tag:s}=n;let u,c=!0;switch(e.type){case"alias":u=function({options:t},{offset:e,source:n,end:r},i){const o=new vt(n.substring(1));""===o.source&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=e+n.length,s=dn(r,a,t.strict,i);return o.range=[e,a,s.offset],s.comment&&(o.comment=s.comment),o}(t,e,r),(a||s)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=xn(t,e,s,r),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":u=function(t,e,n,r,i){const o=r.tag,a=o?e.directives.tagName(o.source,(t=>i(o,"TAG_RESOLVE_FAILED",t))):null;if("block-seq"===n.type){const{anchor:t,newlineAfterProp:e}=r,n=t&&o?t.offset>o.offset?t:o:t??o;n&&(!e||e.offsett.tag===a&&t.collection===s));if(!u){const r=e.schema.knownTags[a];if(!r||r.collection!==s)return r?.collection?i(o,"BAD_COLLECTION_TYPE",`${r.tag} used for ${s} collection, but expects ${r.collection}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),vn(t,e,n,i,a);e.schema.tags.push(Object.assign({},r,{default:!1})),u=r}const c=vn(t,e,n,i,a,u),l=u.resolve?.(c,(t=>i(o,"TAG_RESOLVE_FAILED",t)),e.options)??c,f=X(l)?l:new _t(l);return f.range=c.range,f.tag=a,u?.format&&(f.format=u.format),f}(En,t,e,n,r),a&&(u.anchor=a.source.substring(1));break;default:r(e,"UNEXPECTED_TOKEN","error"===e.type?e.message:`Unsupported token (type: ${e.type})`),u=Sn(t,e.offset,void 0,null,n,r),c=!1}return a&&""===u.anchor&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(u.spaceBefore=!0),o&&("scalar"===e.type&&""===e.source?u.comment=o:u.commentBefore=o),t.options.keepSourceTokens&&c&&(u.srcToken=e),u}function Sn(t,e,n,r,{spaceBefore:i,comment:o,anchor:a,tag:s,end:u},c){const l=xn(t,{type:"scalar",offset:kn(e,n,r),indent:-1,source:""},s,c);return a&&(l.anchor=a.source.substring(1),""===l.anchor&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(l.spaceBefore=!0),o&&(l.comment=o,l.range[2]=u),l}function Tn(t){if("number"==typeof t)return[t,t+1];if(Array.isArray(t))return 2===t.length?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+("string"==typeof n?n.length:1)]}function An(t){let e="",n=!1,r=!1;for(let i=0;i{const i=Tn(t);r?this.warnings.push(new sn(i,e,n)):this.errors.push(new an(i,e,n))},this.directives=new lt({version:t.version||"1.2"}),this.options=t}decorate(t,e){const{comment:n,afterEmptyLine:r}=An(this.prelude);if(n){const i=t.contents;if(e)t.comment=t.comment?`${t.comment}\n${n}`:n;else if(r||t.directives.docStart||!i)t.commentBefore=n;else if(J(i)&&!i.flow&&i.items.length>0){let t=i.items[0];W(t)&&(t=t.key);const e=t.commentBefore;t.commentBefore=e?`${n}\n${e}`:n}else{const t=i.commentBefore;i.commentBefore=t?`${n}\n${t}`:n}}e?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:An(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,e=!1,n=-1){for(const e of t)yield*this.next(e);yield*this.end(e,n)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,((e,n,r)=>{const i=Tn(t);i[0]+=e,this.onError(i,"BAD_DIRECTIVE",n,r)})),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const e=function(t,e,{offset:n,start:r,value:i,end:o},a){const s=Object.assign({_directives:e},t),u=new nn(void 0,s),c={atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},l=cn(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});l.found&&(u.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||l.hasNewline||a(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=i?On(c,i,l,a):Sn(c,l.end,r,null,l,a);const f=u.contents.range[2],h=dn(o,f,!1,a);return h.comment&&(u.comment=h.comment),u.range=[n,f,h.offset],u}(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new an(Tn(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new an(Tn(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=dn(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new an(Tn(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,e=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const t=Object.assign({_directives:this.directives},this.options),n=new nn(void 0,t);this.atDirectives&&this.onError(e,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,e,e],this.decorate(n,!1),yield n}}}const Ln=Symbol("break visit"),Mn=Symbol("skip children"),Cn=Symbol("remove item");function jn(t,e){"type"in t&&"document"===t.type&&(t={start:t.start,value:t.value}),Pn(Object.freeze([]),t,e)}function Pn(t,e,n){let r=n(e,t);if("symbol"==typeof r)return r;for(const i of["key","value"]){const o=e[i];if(o&&"items"in o){for(let e=0;e{let n=t;for(const[t,r]of e){const e=n?.[t];if(!e||!("items"in e))return;n=e.items[r]}return n},jn.parentCollection=(t,e)=>{const n=jn.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Rn(t){switch(t){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const In=new Set("0123456789ABCDEFabcdef"),Dn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bn=new Set(",[]{}"),Fn=new Set(" ,[]{}\n\r\t"),$n=t=>!t||Fn.has(t);class Kn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,e=!1){if(t){if("string"!=typeof t)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!e;let n=this.next??"stream";for(;n&&(e||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,e=this.buffer[t];for(;" "===e||"\t"===e;)e=this.buffer[++t];return!e||"#"===e||"\n"===e||"\r"===e&&"\n"===this.buffer[t+1]}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let e=this.buffer[t];if(this.indentNext>0){let n=0;for(;" "===e;)e=this.buffer[++n+t];if("\r"===e){const e=this.buffer[n+t+1];if("\n"===e||!e&&!this.atEnd)return t+n+1}return"\n"===e||n>=this.indentNext||!e&&!this.atEnd?t+n:-1}if("-"===e||"."===e){const e=this.buffer.substr(t,3);if(("---"===e||"..."===e)&&Rn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return("number"!=typeof t||-1!==t&&tthis.indentValue&&!Rn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,e]=this.peek(2);if(!e&&!this.atEnd)return this.setNext("block-start");if(("-"===t||"?"===t||":"===t)&&Rn(e)){const t=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=t,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(null===t)return this.setNext("doc");let e=yield*this.pushIndicators();switch(t[e]){case"#":yield*this.pushCount(t.length-e);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil($n),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return e+=(yield*this.parseBlockScalarHeader()),e+=(yield*this.pushSpaces(!0)),yield*this.pushCount(t.length-e),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,e,n=-1;do{t=yield*this.pushNewline(),t>0?(e=yield*this.pushSpaces(!1),this.indentValue=n=e):e=0,e+=(yield*this.pushSpaces(!0))}while(t+e>0);const r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n"0"&&e<="9")this.blockScalarIndent=Number(e)-1;else if("-"!==e)break}return yield*this.pushUntil((t=>Rn(t)||"#"===t))}*parseBlockScalar(){let t,e=this.pos-1,n=0;t:for(let r=this.pos;t=this.buffer[r];++r)switch(t){case" ":n+=1;break;case"\n":e=r,n=0;break;case"\r":{const t=this.buffer[r+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break t}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const t=this.continueScalar(e+1);if(-1===t)break;e=this.buffer.indexOf("\n",t)}while(-1!==e);if(-1===e){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(t=this.buffer[r];" "===t;)t=this.buffer[++r];if("\t"===t){for(;"\t"===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)for(;;){let t=e-1,r=this.buffer[t];"\r"===r&&(r=this.buffer[--t]);const i=t;for(;" "===r;)r=this.buffer[--t];if(!("\n"===r&&t>=this.pos&&t+1+n>i))break;e=t}return yield"",yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let e,n=this.pos-1,r=this.pos-1;for(;e=this.buffer[++r];)if(":"===e){const e=this.buffer[r+1];if(Rn(e)||t&&Bn.has(e))break;n=r}else if(Rn(e)){let i=this.buffer[r+1];if("\r"===e&&("\n"===i?(r+=1,e="\n",i=this.buffer[r+1]):n=r),"#"===i||t&&Bn.has(i))break;if("\n"===e){const t=this.continueScalar(r+1);if(-1===t)break;r=Math.max(r,t-2)}}else{if(t&&Bn.has(e))break;n=r}return e||this.atEnd?(yield"",yield*this.pushToIndex(n+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,e){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(e&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil($n))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,e=this.charAt(1);if(Rn(e)||t&&Bn.has(e))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let t=this.pos+2,e=this.buffer[t];for(;!Rn(e)&&">"!==e;)e=this.buffer[++t];return yield*this.pushToIndex(">"===e?t+1:t,!1)}{let t=this.pos+1,e=this.buffer[t];for(;e;)if(Dn.has(e))e=this.buffer[++t];else{if("%"!==e||!In.has(this.buffer[t+1])||!In.has(this.buffer[t+2]))break;e=this.buffer[t+=3]}return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return"\n"===t?yield*this.pushCount(1):"\r"===t&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(t){let e,n=this.pos-1;do{e=this.buffer[++n]}while(" "===e||t&&"\t"===e);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let e=this.pos,n=this.buffer[e];for(;!t(n);)n=this.buffer[++e];return yield*this.pushToIndex(e,!1)}}class Un{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let e=0,n=this.lineStarts.length;for(;e>1;this.lineStarts[r]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break t}for(;"space"===t[++e]?.type;);return t.splice(e,t.length)}function Hn(t){if("flow-seq-start"===t.start.type)for(const e of t.items)!e.sep||e.value||zn(e.start,"explicit-key-ind")||zn(e.sep,"map-value-ind")||(e.key&&(e.value=e.key),delete e.key,Vn(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Gn{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Kn,this.onNewLine=t}*parse(t,e=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(t,e))yield*this.next(n);e||(yield*this.end())}*next(t){if(this.source=t,this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=t.length);const e=function(t){switch(t){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}(t);if(e)if("scalar"===e)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=e,yield*this.step(),e){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&" "===t[0]&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const e=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if("doc-end"!==this.type||t&&"doc-end"===t.type){if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(t){return this.stack[this.stack.length-t]}*pop(t){const e=t??this.stack.pop();if(e)if(0===this.stack.length)yield e;else{const t=this.peek(1);switch("block-scalar"===e.type?e.indent="indent"in t?t.indent:0:"flow-collection"===e.type&&"document"===t.type&&(e.indent=0),"flow-collection"===e.type&&Hn(e),t.type){case"document":t.value=e;break;case"block-scalar":t.props.push(e);break;case"block-map":{const n=t.items[t.items.length-1];if(n.value)return t.items.push({start:[],key:e,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:e,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=e;break}case"block-seq":{const n=t.items[t.items.length-1];n.value?t.items.push({start:[],value:e}):n.value=e;break}case"flow-collection":{const n=t.items[t.items.length-1];return void(!n||n.value?t.items.push({start:[],key:e,sep:[]}):n.sep?n.value=e:Object.assign(n,{key:e,sep:[]}))}default:yield*this.pop(),yield*this.pop(e)}if(!("document"!==t.type&&"block-map"!==t.type&&"block-seq"!==t.type||"block-map"!==e.type&&"block-seq"!==e.type)){const n=e.items[e.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===qn(n.start)&&(0===e.indent||n.start.every((t=>"comment"!==t.type||t.indent=t.indent){const n=!this.onKeyLine&&this.indent===t.indent,r=n&&(e.sep||e.explicitKey)&&"seq-item-ind"!==this.type;let i=[];if(r&&e.sep&&!e.value){const n=[];for(let r=0;rt.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=e.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(r||e.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"explicit-key-ind":return e.sep||e.explicitKey?r||e.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(e.start.push(this.sourceToken),e.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(e.explicitKey)if(e.sep)if(e.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(zn(e.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Vn(e.key)&&!zn(e.sep,"newline")){const t=Wn(e.start),n=e.key,r=e.sep;r.push(this.sourceToken),delete e.key,delete e.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:n,sep:r}]})}else i.length>0?e.sep=e.sep.concat(i,this.sourceToken):e.sep.push(this.sourceToken);else if(zn(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{const t=Wn(e.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]})}else e.sep?e.value||r?t.items.push({start:i,key:null,sep:[this.sourceToken]}):zn(e.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(r||e.value?(t.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):e.sep?this.stack.push(n):(Object.assign(e,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const e=this.startBlockValue(t);if(e)return n&&"block-seq"!==e.type&&t.items.push({start:i}),void this.stack.push(e)}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const e=t.items[t.items.length-1];switch(this.type){case"newline":if(e.value){const n="end"in e.value?e.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(e.start,t.indent)){const n=t.items[t.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,e.start),r.push(this.sourceToken),void t.items.pop()}e.start.push(this.sourceToken)}return;case"anchor":case"tag":if(e.value||this.indent<=t.indent)break;return void e.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==t.indent)break;return void(e.value||zn(e.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken))}if(this.indent>t.indent){const e=this.startBlockValue(t);if(e)return void this.stack.push(e)}yield*this.pop(),yield*this.step()}*flowCollection(t){const e=t.items[t.items.length-1];if("flow-error-end"===this.type){let t;do{yield*this.pop(),t=this.peek(1)}while(t&&"flow-collection"===t.type)}else if(0===t.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!e||e.sep?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken));case"map-value-ind":return void(!e||e.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!e||e.value?t.items.push({start:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!e||e.value?t.items.push({start:[],key:n,sep:[]}):e.sep?this.stack.push(n):Object.assign(e,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void t.end.push(this.sourceToken)}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const e=this.peek(2);if("block-map"===e.type&&("map-value-ind"===this.type&&e.indent===t.indent||"newline"===this.type&&!e.items[e.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==e.type){const n=Wn(Yn(e));Hn(t);const r=t.end.splice(1,t.end.length);r.push(this.sourceToken);const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let t=this.source.indexOf("\n")+1;for(;0!==t;)this.onNewLine(this.offset+t),t=this.source.indexOf("\n",t)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const e=Wn(Yn(t));return e.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const e=Wn(Yn(t));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,e){return"comment"===this.type&&!(this.indent<=e)&&t.every((t=>"newline"===t.type||"space"===t.type))}*documentEnd(t){"doc-mode"!==this.type&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function Jn(t,e={}){const{lineCounter:n,prettyErrors:r}=function(t){const e=!1!==t.prettyErrors;return{lineCounter:t.lineCounter||e&&new Un||null,prettyErrors:e}}(e),i=new Gn(n?.addNewLine),o=new Nn(e);let a=null;for(const e of o.compose(i.parse(t),!0,t.length))if(a){if("silent"!==a.options.logLevel){a.errors.push(new an(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else a=e;return r&&n&&(a.errors.forEach(un(t,n)),a.warnings.forEach(un(t,n))),a}class Xn extends on{constructor(t,e,n){super(t,e,"IMPOSSIBLE",n),this.name=t}pretty(t){this.linePos=t.lineCounter.linePos(this.pos);const{line:e,col:n}=this.linePos;this.message+=` at line ${e}, column ${n} ${t.file?" @"+t.file:""}`}}class Qn{constructor(){this.lineCounter=new Un,this.src="",this.txt="",this.errors=[],this.warnings=[],this.yaml_ok=!1,this.contents=null,this.listener=null,this.prog={}}errors(t){this.errors=this.errors.concat(t)}warnings(t){this.warnings=this.warnings.concat(t)}fileError(t){let e=new Xn("FILE_ERROR",0,`FileError : ${t}`);return this.errors.push(e),e}syntaxError(t,e){let n=new Xn("SYNTAX_ERROR",t.range?t.range[0]:0,`SyntaxError : ${e}`);return this.errors.push(n),n}syntaxWarning(t,e){let n=new Xn("SYNTAX_WARNING",t.range?t.range[0]:0,`SyntaxWarning : ${e}`);return this.warnings.push(n),n}typeError(t,e){let n=new Xn("TYPE_ERROR",t.range?t.range[0]:0,`TypeError : ${e}`);return this.errors.push(n),n}grammarError(t){let e=new Xn("GRAMMAR_ERROR",0,`GrammarError : ${t}`);this.errors.push(e)}grammarWarning(t){let e=new Xn("GRAMMAR_WARNING",0,`GrammarWarning : ${t}`);return this.warnings.push(e),e}fails(){return this.errors.length>0}success(){return 0==this.errors.length&&0==this.warnings.length}result(){return this.contents}}class Zn{constructor(t,e,n){this.ctx=t,this.type=e,this.current=n,this.start=n.range[0],this.end=n.range[1],this.childs=[]}getChild(t){return this.childs[t]}getChildCount(){return this.childs.length}getValue(){return this.value}toString(){return this.value}}class tr extends Zn{constructor(t,e,n){super(t,e,n)}equals(t){if(t instanceof tr)return this.value==t.value;this.ctx.syntaxError(this.current,`Error can not compare values '${this.value}' and '${t.value}'`)}}class er extends tr{constructor(t,e){if(super(t,"string",e),!er.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a string`);this.value=e.value}static checkCurrent(t){return H(t)&&"string"==typeof t.value}static parse(t,e){try{return new er(t,e)}catch(t){return null}}}class nr extends tr{constructor(t,e){if(super(t,"binary",e),!nr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a base64 string`);this.value=e.value}static checkCurrent(t){return H(t)&&"string"==typeof t.value&&/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(t.value)}static parse(t,e){try{return new nr(t,e)}catch(t){return null}}}class rr extends tr{constructor(t,e){if(super(t,"int",e),!rr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not an integer`);this.value=e.value}static checkCurrent(t){return H(t)&&"number"==typeof t.value&&t.value==Math.floor(t.value)}static parse(t,e){try{return new rr(t,e)}catch(t){return null}}}class ir extends tr{constructor(t,e){if(super(t,"float",e),!ir.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a number`);this.value=e.value}static checkCurrent(t){return H(t)&&"number"==typeof t.value}static parse(t,e){try{return new ir(t,e)}catch(t){return null}}}class or extends tr{constructor(t,e){if(super(t,"boolean",e),this.value=null,!or.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e.value}' is not a boolean`);this.value=e.value}static checkCurrent(t){return H(t)&&"boolean"==typeof t.value}static parse(t,e){try{return new or(t,e)}catch(t){return null}}}class ar extends tr{constructor(t,e){if(super(t,"null",e),this.value=null,!ar.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not the null value`)}static checkCurrent(t){return H(t)&&(null==t.value||["Null","NULL","null","~"].includes(t.value))}static parse(t,e){try{return new ar(t,e)}catch(t){return null}}}class sr extends tr{constructor(t,e,n){if(super(t,"timestamp",e),!sr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a timestamp in ISO9601 format`);this.value=new Date(e.value)}static checkCurrent(t){let e=H(t)&&"string"==typeof t.value&&/\d{4}-\d{2}-\d{2}|\d{4}-\d{2}?-\d{2}?([Tt]|[ \t]+)\d{2}?:\d{2}:\d{2}(\.\d*)?(([ \t]*)Z|[-+]\d\d?(:\d{2})?)?/.test(t.value);if(1==e)try{new Date(t.value)}catch(t){e=!1}return e}static parse(t,e){try{return new sr(t,e)}catch(t){return null}}equals(t){return t instanceof sr?this.value.getTime()==t.value.getTime():this.ctx.syntaxError("Error : can not compare a timestamp with something else")}}class ur extends Zn{constructor(t,e,n){super(t,e,n)}length(){return this.childs.length}isEmpty(){return 0==this.length()}}class cr extends ur{constructor(t,e,n){if(super(t,"map",e),"object"!=typeof n||n instanceof Array)throw t.syntaxError(e,"Erorr : MapNode must be initialized with a parsed map. This should not happen.");this.value=n;for(const t in n)this.childs.push(n[t])}static checkCurrent(t){return Y(t)&&t.items.every((t=>t.key&&H(t.key)&&"string"==typeof t.key.value))}}class lr{static parse(t,e,n){"object"!=typeof e&&t.grammarError("Error: oneof rule can not be parsed'");let r=e._oneOf;if(r instanceof Array){let e=[].concat(t.errors),i=[].concat(t.warnings),o=t.errors.length;for(let a of r){let r=xr(t,null,a,n);if(o==t.errors.length)return t.errors=e,t.warnings=i,r;o=t.errors.length}return t.syntaxError(n,"Syntax Error : no valid alternative found during parsing"),null}t.grammarError("Error: _oneof rules expects a sequence of alternatives")}}var fr="undefined"!=typeof Symbol;function hr(t){var e=typeof t;return"string"===e||"number"===e||"boolean"===e||!0===fr&&"symbol"===e||null==t||!0===fr&&t instanceof Symbol||t instanceof String||t instanceof Number||t instanceof Boolean}class pr{static parse(t,e){if("object"==typeof e){if(e._oneOf){let n;!e._oneOf instanceof Array&&t.grammarError("Error : _oneof value have to be a list"),e._oneOf=e._oneOf.map((e=>pr.parse(t,e)));do{if(n=e._oneOf.findIndex((t=>t._oneOf)),n>=0){let t=e._oneOf[n]._oneOf;(e={_oneOf:[].concat(e._oneOf)})._oneOf.splice(n,1),e._oneOf=e._oneOf.concat(t)}}while(n>=0);return e}if(e._merge){if(!(e._merge instanceof Array))return t.grammarError("Error : _merge value have to be a map"),null;const{_merge:n,...r}=e;let i;e={_merge:e._merge},Object.keys(r).length&&e._merge.push(r),e._merge=e._merge.map((e=>hr(e)&&t.rules[e]?t.rules[e]:e)),e._merge=e._merge.map((e=>pr.parse(t,e)));do{if(i=e._merge.findIndex((t=>t._merge)),i>=0){let t=e.one._merge;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),e._merge=e._merge.concat(t)}}while(i>=0);let o={_oneOf:[]};do{if(i=(e={_merge:[].concat(e._merge)})._merge.findIndex((t=>t._oneOf)),i>=0){let t=e._merge[i]._oneOf;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),t.forEach((t=>{let n={_merge:[t].concat(e._merge)};o._oneOf.push(n)}))}}while(i>=0);if(o._oneOf.length>=1)return pr.parse(t,o);e._merge.some((t=>t._merge||t._oneOf))&&t.grammarError("Error : merge has not been processed successfully. This error should not occur.");let a={},s={},u=null,c=-1,l=-1,f=-1;e._merge.forEach((e=>{if(e._map){a={...a};for(let n in e._map)a.key&&t.grammarError("Error : can not merge two maps with some identical keys"),a[n]=e._map[n]}if(e._mapFacultative){s={...s};for(let n in e._mapFacultative)s.key&&t.grammarError("Error : can not merge two maps with some identical keys"),s[n]=e._mapFacultative[n]}if(e._mapOf){if(null!=u)return t.grammarError("Error : only one '_mapOf' is allowed in a '_merge' clause"),null;u=e._mapOf}e._nb&&(c<0||c==e._nb?c=e._nb:t.grammarError("Contradictory sizing in merge clause")),e._min&&(l=Math.max(e._min,l)),e._max&&(nax=c>0?Math.min(e._max,f):e._max)}));let h={};return c>=0&&(h._nb=c),l>=0&&(h._min=l),f>=0&&(h._max=f),Object.keys(a).length>0&&(h._map=a),Object.keys(s).length>0&&(h._mapFacultative=s),null!=u&&(h._mapOf=u),h}if(e._map){let n={};for(const r in e._map)n[r]=pr.parse(t,e._map[r]);e._map=n}if(e._mapFacultative){let n={};for(const r in e._mapFacultative)n[r]=pr.parse(t,e._mapFacultative[r]);e._mapFacultative=n}if(e._mapOf){let n={};for(const r in e._mapOf){let i=pr.parse(t,r),o=pr.parse(t,e._mapOf[r]);n[i]=o}e._mapOf=n}e._list&&(e._list=e._list.map((e=>pr.parse(t,e)))),e._listFacultative&&(e._listFacultative=e._listFacultative.map((e=>pr.parse(t,e)))),e._listOf&&(e._listOf=pr.parse(t,e._listOf))}return e}}class dr{static isPositiveInt(t){return"number"==typeof t&&t==Math.floor(t)&&t>0}static sizeChecker(t,e,n,r){if(dr.isPositiveInt(n))if(Y(r)||G(r))switch(e){case"eq":return r.items.length==n;case"min":return r.items.length>=n;case"max":return r.items.length<=n}else t.syntaxError(r,"Error : a map is expected");else t.grammarError(`Error: the map checker '${e}' does not have a positive integer as value`);return!1}static sizeCheckers(t,e,n){return null==e._nb||dr.sizeChecker(t,"eq",e._nb,n)?null==e._min||dr.sizeChecker(t,"min",e._min,n)?!(null!=e._max&&!dr.sizeChecker(t,"max",e._max,n)&&(t.syntaxError(n,`Error : map expected with more than ${e._max} elements but ${n.items.length} are provided`),1)):(t.syntaxError(n,`Error : map expected with more than ${e._min} elements but ${n.items.length} are provided`),!1):(t.syntaxError(n,`Error : map expected with ${e._nb} elements but ${n.items.length} are provided`),!1)}}class mr{static parse(t,e,n){if(!cr.checkCurrent(n))return t.syntaxError(n,"Error : a map whose keys are strings is expected "),null;if(e._merge&&(e=pr.parse(t,e))._oneOf)return lr.parse(t,e,n);let r=e._map,i=e._mapOf,o=e._mapFacultative;if(null!=i&&"object"!=typeof i||null!=o&&"object"!=typeof o)return t.grammarError("Error : error in map value definition"),null;if(!dr.sizeCheckers(t,e,n))return null;if(null!=r)for(let e in r){if("string"!=typeof e)return t.grammarError("Error : error in map definition"),null;if(!n.has(e))return t.syntaxError(n,`Error : key '${e}' not found in current value`),null}let a,s=null;if(i){let t=Object.entries(i);1==t.length&&([[a,s]]=t)}let u={};for(let i of n.items){let n=i.key.value,c=i.value,l=null;if(r&&r[n])l=xr(t,null,r[n],c);else if(o&&o[n])l=xr(t,null,o[n],c);else{if(!a||!s)return t.syntaxError(c,`Error : '${n}' is not a valid key (in rule : ${JSON.stringify(e)})`),null;{let e=xr(t,null,a,i.key);if(l=xr(t,null,s,c),e.value!=n)return t.syntaxError(n,`Error : '${n}' does not match expected '${a}' type`),null}}if(null==l)return t.syntaxError(c,`Error : bad value '${c}'found for '${n}' (mapparser.parse)`),null;let f=new er(t,i.key);if(l.key=f,null!=u[n])return t.syntaxError(c,`Error : more than one value provided in the map for the key '${n}'`),null;u[n]=l}return new cr(t,n,u)}static parse_any(t,e){if(!cr.checkCurrent(e))return t.syntaxError(e,"Error : a map whose keys are strings is expected "),null;let n={};return e.items.forEach((e=>{let r=e.key.value,i=e.value,o=gr.parse_any(t,i);if(null==o)return t.syntaxError(i,`Error : bad value '${i}' found for '${r}' (mapparser.parse_any)`),null;let a=new er(t,e.key);o.key=a,null!=n[r]&&t.syntaxError(i,`Error : more than one value provided in the map for the key '${r}'`),n[r]=o})),new cr(t,e,n)}}class yr extends ur{constructor(t,e,n){if(super(t,"list",e),!n instanceof Array)throw t.syntaxError(e,"Erorr : ListNode must be initialized with an array. This should not happen.");this.value=n,this.childs=this.value}static checkCurrent(t){return G(t)}}class vr{static parse(t,e,n){if(!yr.checkCurrent(n))return t.syntaxError(n,"Error : a list is expected "),null;if(!dr.sizeCheckers(t,e,n))return null;let r=e._list,i=e._listOf,o=e._listFacultative;if(null!=r&&!(r instanceof Array)||null!=o&&!(o instanceof Array))return t.grammarError("Error : error in list value definition"),null;let a=0,s=n.items.length,u=[];r&&r.forEach((e=>{if(!(a{if(a{let r=gr.parse_any(t,e);if(null==r)return t.SyntaxError(value,`Error : bad value '${value}' found for '${key}' (listparser.parse_any)`),null;n.push(r)})),new yr(t,e,n)}}class gr{static parse(t,e,n){switch(e){case"string":return er.parse(t,n);case"binary":return nr.parse(t,n);case"timestamp":return sr.parse(t,n);case"int":return rr.parse(t,n);case"float":return ir.parse(t,n);case"boolean":return or.parse(t,n);case"null":return ar.parse(t,n);case"any":return gr.parse_any(t,n);default:return kr(t,e,n)}}static parse_any(t,e){if(H(e)){switch(typeof e.value){case"number":return rr.checkCurrent(e)?rr.parse(t,e):ir.parse(t,e);case"boolean":return or.parse(t,e);case"string":return er.parse(t,e);case"object":if(null==e.value)return ar.parse(t,e);t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`);default:t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`)}return null}return Y(e)?mr.parse_any(t,e):G(e)?vr.parse_any(t,e):null}}class br{static parse(t,e,n){"object"==typeof e&&e._in||t.grammarError("Error: can not parse _in rule'");let r=e._in;if(!(r instanceof Array))return t.grammarError("Error: _in rules expects a sequence of alternatives"),null;for(let e of r)if(!hr(e))return t.grammarError("Error: _in rules expects each alternative to be a scalar"),null;if(!H(n))return t.syntaxError(n,"Syntax Error : scalar value expected by rule '_in'"),null;let i=gr.parse_any(t,n);if(i){let e=[].concat(t.errors),n=[].concat(t.warnings),o=t.errors.length,a=i.value;for(let s of r)if(s){let r=s==a?i:null;if(null!=r)return t.errors=e,t.warnings=n,r;o=t.errors.length}}return t.syntaxError(n,"Syntax Error : no valid alternative for '_in' rule found during parsing"),null}}class _r{static parse(t,e,n){if(!er.checkCurrent(n))return t.syntaxError(n,`Error: regular expressions match only strings, '${n?n.value:""}' is not a string`),null;let r=e._regex;if(null==r)return t.grammarError("Error : regep rule must have a value for key '_regex'"),null;let i=null;try{i=new RegExp(r)}catch(t){}return null==i?(t.grammarError(`Error: value '${i}' is not a valid regular expression`),null):i.test(n.value)?new er(t,n):(t.syntaxError(n,`Error: value '${n.value}' does not match the regular expression '${i}'`),null)}}class wr{static scalartypes=["string","int","float","null","boolean","binary","timestamp"];static keywords=["_map","_mapOf","_mapFacultative","_list","_listOf","_listFacultative","_oneOf","_regex","_nb","_min","_max","_in"];static parse(t,e,n,r){if(null==r)return t.fileError("No source to parse"),null;if(wr.scalartypes.includes(e)||wr.keywords.includes(e))return t.syntaxError(r,`'${e}' is not allowed as rule_name in Lidy Grammar (reserved keyword)`),null;let i="enter_"+e;r.ctx=t,t.listener&&t.listener[i]&&t.listener[i](r);let o=xr(t,null,n,r),a="exit_"+e;return"node_template"==e&&console.log("Sortie de node_template"),t.listener&&t.listener[a]&&t.listener[a](o),o}}function xr(t,e,n,r){if(e)return wr.parse(t,e,n,r);if(hr(n))return gr.parse(t,n,r);if("object"==typeof n){if(n._map||n._mapOf||n._mapFacultative||n._merge)return mr.parse(t,n,r);if(n._list||n._listOf||n._listFacultative)return vr.parse(t,n,r);if(n._oneOf)return lr.parse(t,n,r);if(n._regex)return _r.parse(t,n,r);if(n._in)return br.parse(t,n,r)}return t.grammarError("Error : grammar error : no valid keyword found"),null}function kr(t,e,n){let r=t.rules[e];return void 0!==r?xr(t,e,r,n):(t.grammarError(`no rule named ${e} found.`),null)}function Er(t){t.keyword||(t.keyword="main");let e=new Qn;return e.prog=t.prog,t.rules?e.rules=t.rules:function(t,e,n){try{t.rules=function(t,e,n){let r;const i=Jn(t,n);if(!i)return null;if(i.warnings.forEach((t=>qt(i.options.logLevel,t))),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}(e)}catch(e){throw t.errors.push(e),t.grammarError("ERROR : can not parse dsl ")}if("object"==(t.rules,!1))throw t.grammarError("ERROR : can not parse dsl ");if(!t.rules[n])throw Error("ERROR : no rule labeled '"+n+"' in the grammar")}(e,t.dsl_data,t.keyword),e.listener=t.listener,function(t,e){t.lineCounter=new Un;let n=Jn(e,{lineCounter:t.lineCounter});n||t.fileError("can not parse the provided source code."),t.src=n.contents,t.txt=e,t.errors=n.errors,t.warnings=n.warnings,t.yaml_ok=0==t.errors.length&&0==t.warnings.length}(e,t.src_data),function(t,e,n){let r=kr(t,e,n);return t.errors.filter((t=>t instanceof Xn)).forEach((e=>e.pretty(t))),t.warnings.filter((t=>t instanceof Xn)).forEach((e=>e.pretty(t))),t.contents=r,t}(e,t.keyword,e.src)}var Or={main:"workflow",workflow:{_mapFacultative:{name:"WorkflowName",on:{_mapFacultative:{push:"PushTrigger",pull_request:"PullRequestTrigger"}},jobs:{_mapOf:{JobId:"Job"}}}},WorkflowName:"string",PushTrigger:{_map:{branches:"PushTriggerBranches"}},PushTriggerBranches:{_listOf:"string"},PullRequestTrigger:{_map:{types:"PullRequestTriggerTypes"}},PullRequestTriggerTypes:{_listOf:"string"},Job:{_mapFacultative:{name:"JobName","runs-on":"JobRunsOn",needs:"JobNeeds",steps:{_listOf:"Step"}}},JobId:"string",JobName:"string",JobRunsOn:"string",JobNeeds:{_listOf:"string"},Step:{_oneOf:["CommandStep","ReusableStep"]},ReusableStep:{_map:{uses:"StepUses"},_mapFacultative:{name:"StepName",with:"StepWith",env:"StepEnv"}},CommandStep:{_map:{run:"StepRun"},_mapFacultative:{name:"StepName",env:"StepEnv"}},StepUses:"string",StepName:"string",StepRun:"string",StepWith:{_mapOf:{StepMapKey:"StepMapValue"}},StepEnv:{_mapOf:{StepMapKey:"StepMapValue"}},StepMapKey:"string",StepMapValue:{_oneOf:["int","float","string"]}};function Sr(t){return Sr="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},Sr(t)}function Tr(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.pluginData.components=[],this.pluginData.parseErrors=[],n.filter((function(e){var n=e.path;return t.path===n})).filter((function(t){var n=t.path,i=t.content;return!(!i||""===i.trim())||(e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"warning",files:[n],data:{code:"no_content",global:!1}}),!1)})).forEach((function(t,n){var i=e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[t.path],data:{global:!1}}),o=new I(t,e.pluginData.definitions.components,"workflow_".concat(n+1));!function(t){t.rules=Or,Er(t)}({src_data:t.content,listener:o,path:t.path,prog:{errors:[],warnings:[],imports:[],alreadyImported:[],root:[]}}),o.components.forEach((function(t){return e.pluginData.components.push(t)})),e.pluginData.emitEvent({id:i,status:"success"})}))}}],r&&Tr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(t.DefaultParser);var Pr=n(326),Rr=n.n(Pr);const Ir={root:"name: {{ workflowName.value }}\n\n{% if triggers.length > 0 %}\non:\n{% for trigger in triggers %}\n{% if trigger.definition.action === 'push' %}{% set branches = getTriggerAttribute(trigger, 'branches').value %}\n push:\n branches: [{% if branches.length > 0 %}{{ branches.join(', ') }}{% endif %}]\n{% else %}{% set types = getTriggerAttribute(trigger, 'types').value %}\n pull_request:\n types: [{% if types.length > 0 %}{{ types.join(', ') }}{% endif %}]\n{% endif %}\n{% endfor %}\n{% endif %}\n\njobs:\n{% for job in jobs %}\n {{ job.id }}:\n{% for attribute in getAttributes(job) %}\n {% if attribute.type === 'Array' %}\n {{attribute.name}}: [{{ attribute.value.join(', ')}}]\n {% else %}\n {{attribute.name}}: {{attribute.value }}\n {% endif %}\n{% endfor %}\n{% if getSteps(job.id).length > 0 %}\n steps:\n{% for step in getSteps(job.id) %}\n{% for attribute in getAttributes(step) %}\n{% if attribute.type === 'Array' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: [{{ attribute.value.join(', ')}}]\n{% elif attribute.type === 'Object' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}:\n{% for value in attribute.value %}\n{{value.name | indent(10,true)}}: {% if value.type == 'Number' and value.value == null %}0{% else %}{{ value.value }}{% endif %}\n\n{% endfor %}\n{% else %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: {{ attribute.value }}\n{% endif %}\n{% endfor %}\n{% endfor %}\n\n{% endif %}\n{% endfor %}"};function Dr(t){return Dr="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},Dr(t)}function Br(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,i=[];return e.forEach((function(e,o){var a=n.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[o],data:{global:!1}}),s=e.find((function(t){return"workflow"===t.definition.category})),u=e.filter((function(t){return"trigger"===t.definition.category})),c=e.filter((function(t){return"step"===t.definition.category})),l="".concat(n.template.render({workflow:s,workflowName:null==s?void 0:s.attributes.find((function(t){return"name"===t.name})),triggers:u,jobs:e.filter((function(t){return"job"===t.definition.category})),getAttributes:function(t){return t.attributes.filter((function(t){var e=t.name;return"workflow_id"!==e&&"job_id"!==e}))},getTriggerAttribute:function(t,e){return t.attributes.find((function(t){return t.name===e}))},getSteps:function(t){return c.filter((function(e){return e.attributes.some((function(e){var n=e.name,r=e.value;return"job_id"===n&&r===t}))}))}}).trim(),"\n");i.push(new t.FileInput({path:o,content:l})),n.pluginData.emitEvent({id:a,status:"success"})})),i}}],i&&Br(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(t.DefaultRender);const Vr=qr,Yr=JSON.parse('{"UU":"@ditrit/githubator-plugin","rE":"0.5.1"}'),Wr={name:"githubAction",languageSettings:{id:"githubAction",extensions:[".yml",".yaml"],aliases:["githubaction","Githubaction","githubAction","GithubAction"],mimetypes:["string"]},languageConfiguration:{comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],colorizedBracketPairs:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"'",close:"'",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{offSide:!0}},tokenProvider:{tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?\d+)/,numberFloat:/(?:0|[+-]?\d+)(?:\.\d+)?(?:e[-+][1-9]\d*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,{[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|]\d*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]}])/,"number"],[/@numberFloat(?=[ \t]*[,\]}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]}])/,"number.date"]],tagHandle:[[/![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}}};function Hr(t){return Hr="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},Hr(t)}function Gr(t,e,n){return e=Xr(e),function(t,e){if(e&&("object"==Hr(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,Jr()?Reflect.construct(e,n||[],Xr(t).constructor):e.apply(t,n))}function Jr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jr=function(){return!!t})()}function Xr(t){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xr(t)}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}const Zr=function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),Gr(this,n,[{editor:{syntax:Wr},tags:[new t.Tag({type:"language",value:"Github"}),new t.Tag({type:"category",value:"CI"}),new t.Tag({type:"category",value:"CD"})],restrictiveFolder:".github/workflows/",isFolderTypeDiagram:!1,defaultFileName:"new_workflow.yml",defaultFileExtension:"yml",extraResources:[{type:"markers",name:"startLinkMarker"},{type:"markers",name:"endLinkMarker"},{type:"links",name:"defaultLink"},{type:"links",name:"temporaryLink"},{type:"icons",name:"error"},{type:"icons",name:"menu"},{type:"icons",name:"resize"}],container:{margin:15,gap:50},i18N:{"en-US":{displayName:"GitHub Action"}}}])}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&&Qr(t,e)}(n,e),r=n,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(t.DefaultConfiguration);function ti(t){return ti="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},ti(t)}function ei(t,e,n){return e=ri(e),function(t,e){if(e&&("object"==ti(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,ni()?Reflect.construct(e,n||[],ri(t).constructor):e.apply(t,n))}function ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ni=function(){return!!t})()}function ri(t){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ri(t)}function ii(t,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ii(t,e)}const oi=function(e){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{event:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var r=new Zr,i=new t.DefaultData(r,{name:Yr.UU,version:Yr.rE},e.event);return ei(this,n,[{configuration:r,pluginData:i,pluginMetadata:new C(i),pluginParser:new jr(i),pluginRenderer:new Vr(i)}])}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&&ii(t,e)}(n,e),r=n,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(t.DefaultPlugin)})();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={149:(t,e)=>{(()=>{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 s(t,e){return i.hasOwnProperty.call(t,e)}function u(t){return o[t]}function c(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,c.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 s=new Error(t).stack;o=function(){return s}}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,c).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:u,Root:f,NodeList:l,Value:c,Literal:h,Symbol:p,Group:d,Array:m,Pair:y,Dict:v,Output:$,Capture:K,TemplateData:U,If:b,IfAsync:_,InlineIf:w,For:x,AsyncEach:k,AsyncAll:E,Macro:O,Caller:S,Import:T,FromImport:A,FunCall:N,Filter:L,FilterAsync:M,KeywordArgs:C,Block:j,Super:P,Extends:R,Include:I,Set:D,Switch:B,Case:F,LookupVal:g,BinOp:q,In:V,Is:Y,Or:W,And:H,Not:G,Add:J,Concat:X,Sub:Q,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:at,CompareOperand:st,CallExtension:ut,CallExtensionAsync:ct,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 ut)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 u?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),s=n(0).TemplateError,u=n(2).Frame,c=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 s(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 u=this._tmpid();this._emitLine(", "+this._makeCallback(u)),this._emitLine(this.buffer+" += runtime.suppressValue("+u+", "+s+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+s+" && 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 s=n._tmpid();n._emitLine("var "+s+" = "+o+"["+r+"]["+a+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+a+"]);"),e.set(t.name.children[a].value,s)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var s=t.name.children,u=s[0],c=s[1],l=this._tmpid(),f=this._tmpid();e.set(u.value,l),e.set(c.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("'+u.value+'", '+l+");"),this._emitLine('frame.set("'+c.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(),s=this._tmpid(),u=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+s+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof a.Array){var c=t.name.children.length;this._emit("runtime."+u+"("+s+", "+c+", 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."+u+"("+s+", 1, function("+l+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+l+'", '+l+");"),e.set(l,l)}this._emitLoopBindings(t,s,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 (!"+s+".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(),s=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 c,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+'"'}));c=s?e.push(!0):new u,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+l.join(", ")+") {","var callerFrame = frame;","frame = "+(s?"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+");"),c.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,c),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,c)})),this._emitLine("frame = "+(s?"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),s=n?"true":"false",u=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+s+", "+o+", "+u+", "+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,s=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 "+s+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,s),e.parent?n._emitLine('frame.set("'+o+'", '+s+");"):n._emitLine('context.setVariable("'+o+'", '+s+");")}))},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 u,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 u;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}(c);t.exports={compile:function(t,e,n,r,a){void 0===a&&(a={});var s=new f(r,a.throwOnUndefined),u=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return s.compile(o.transform(i.parse(u,n,a),e,r)),s.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),s=n(0),u=n(5),c=n(18),l=n(10),f=l.FileSystemLoader,h=l.WebLoader,p=l.PrecompiledLoader,d=n(20),m=n(21),y=n(1),v=y.Obj,g=y.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))}}}},O=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=s.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=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],s._entries(c).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),s._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=s.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,u=this,c=null;if(t&&t.raw&&(t=t.raw),s.isFunction(n)&&(i=n,n=null,e=e||!1),s.isFunction(e)&&(i=e,e=!1),t instanceof T)c=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 s=this.parsePrimary();if("_"===s.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",s.lineno,s.colno),this.skipSymbol("as")){var u=this.parsePrimary();r.addChild(new o.Pair(s.lineno,s.colno,s,u))}else r.addChild(s);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},u.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},u.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},u.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},u.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},u.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},u.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 s,u=this.peekToken(),c=[];do{this.skipSymbol(n);var l=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);c.push(new o.Case(u.line,u.col,l,f)),u=this.peekToken()}while(u&&u.value===n);switch(u.value){case r:this.advanceAfterBlockEnd(),s=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,c,s)},u.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==s.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 u=a[0],c=a[1],l=a[2];l===t?r+=1:l===e&&(r-=1),0===r?(i+=c,this.tokens.backN(u.length-c.length)):i+=u}return new o.Output(s.lineno,s.colno,[new o.TemplateData(s.lineno,s.colno,i)])},u.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},u.parseExpression=function(){return this.parseInlineIf()},u.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},u.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},u.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},u.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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)},u.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)},u.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},u.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},u.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])},u.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 s=this.parseExpression();t.addChild(s)}}return t},u.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),s=!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(s&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var u=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?a.addChild(new o.Pair(u.lineno,u.colno,u,this.parseExpression())):r.addChild(u)}s=!0}return a.children.length&&r.addChild(a),r},u.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],D=M+this.current();switch(-1!==r.indexOf(I,D)&&(this.forward(),M=D,-1!==r.indexOf(I,D+this.current())&&(M=D+this.current(),this.forward())),M){case"(":R=d;break;case")":R=m;break;case"[":R=y;break;case"]":R=v;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 L(R,M,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return L(O,t+"."+B,e,n)}return L("int",t,e,n)}if(t.match(/^(true|false)$/))return L(S,t,e,n);if("none"===t)return L(T,t,e,n);if("null"===t)return L(T,t,e,n);if(t)return L(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=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,L(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,L(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var U=t.slice(-this.colno);if(/^\s+$/.test(U)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return L(K?p:u,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 u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}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 s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,l=y(u,c);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},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.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 s(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,a=r.repeat(" ",n/2-n%2),s=r.repeat(" ",n/2);return i.copySafeness(t,a+t+s)},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"),s=r.repeat(" ",e),u=a.map((function(t,e){return 0!==e||n?""+s+t:t})).join("\n");return i.copySafeness(t,u)},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=u,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=c(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=c(!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 s=t.indexOf(e);if(0===r||-1===s)return t;for(var u=0,c=0;s>-1&&(-1===r||c=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})),s=r.getAttrGetter(i);return a.sort((function(t,a){var u=i?s(t):t,c=i?s(a):a;if(o.env.opts.throwOnUndefined&&i&&(void 0===u||void 0===c))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(u)&&r.isString(c)&&(u=u.toLowerCase(),c=c.toLowerCase()),uc?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 s(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 s=t.lastIndexOf(" ",e);-1===s&&(s=e),t=t.substring(0,s)}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\./,m=/\.(?: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+"":m.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 y=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=y,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),s=n(7).Environment,u=n(24);function c(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 s([]),r=e.wrapper||u;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 s([])).asyncFilters,u=n.extensionsList;e=e.replace(/\\/g,"/");try{r=a.compile(t,i,u,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 s([]),o=e.wrapper||u;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 s=i.join(o,a),u=s.substr(i.join(t,"/").length),l=r.statSync(s);l&&l.isDirectory()?c(u+="/",e.exclude)||n(s):c(u,e.include)&&p.push(s)}))}(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 n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";r.r(i),r.d(i,{Component:()=>O,ComponentAttribute:()=>f,ComponentAttributeDefinition:()=>j,ComponentDefinition:()=>T,ComponentDrawOption:()=>v,ComponentLink:()=>$,ComponentLinkDefinition:()=>U,ComponentRenderer:()=>FA,DefaultConfiguration:()=>WN,DefaultData:()=>$N,DefaultDrawer:()=>fN,DefaultMetadata:()=>mN,DefaultParser:()=>bN,DefaultPlugin:()=>XN,DefaultRender:()=>kN,FileInformation:()=>m,FileInput:()=>G,LinkRenderer:()=>zA,ParserLog:()=>s,Tag:()=>ZN,Variable:()=>aL});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 n(t,e,n){return(e=o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}r.r(t),r.d(t,{Adder:()=>xt,Delaunay:()=>Uu,FormatSpecifier:()=>sf,InternMap:()=>Ot,InternSet:()=>St,Node:()=>My,Path:()=>is,Voronoi:()=>Iu,ZoomTransform:()=>$S,active:()=>ca,arc:()=>EE,area:()=>CE,areaRadial:()=>KE,ascending:()=>J,autoType:()=>wc,axisBottom:()=>pn,axisLeft:()=>dn,axisRight:()=>hn,axisTop:()=>fn,bin:()=>ae,bisect:()=>ot,bisectCenter:()=>it,bisectLeft:()=>rt,bisectRight:()=>nt,bisector:()=>Q,blob:()=>ll,blur:()=>at,blur2:()=>st,blurImage:()=>ut,brush:()=>Ba,brushSelection:()=>Ra,brushX:()=>Ia,brushY:()=>Da,buffer:()=>hl,chord:()=>Ga,chordDirected:()=>Xa,chordTranspose:()=>Ja,cluster:()=>Ey,color:()=>oi,contourDensity:()=>pu,contours:()=>ou,count:()=>pt,create:()=>Qk,creator:()=>_r,cross:()=>vt,csv:()=>vl,csvFormat:()=>uc,csvFormatBody:()=>cc,csvFormatRow:()=>fc,csvFormatRows:()=>lc,csvFormatValue:()=>hc,csvParse:()=>ac,csvParseRows:()=>sc,cubehelix:()=>Gs,cumsum:()=>gt,curveBasis:()=>MO,curveBasisClosed:()=>jO,curveBasisOpen:()=>RO,curveBumpX:()=>VE,curveBumpY:()=>YE,curveBundle:()=>DO,curveCardinal:()=>$O,curveCardinalClosed:()=>UO,curveCardinalOpen:()=>qO,curveCatmullRom:()=>WO,curveCatmullRomClosed:()=>GO,curveCatmullRomOpen:()=>XO,curveLinear:()=>AE,curveLinearClosed:()=>ZO,curveMonotoneX:()=>sS,curveMonotoneY:()=>uS,curveNatural:()=>fS,curveStep:()=>pS,curveStepAfter:()=>mS,curveStepBefore:()=>dS,descending:()=>X,deviation:()=>_t,difference:()=>qe,disjoint:()=>Ve,dispatch:()=>_n,drag:()=>Gu,dragDisable:()=>Fr,dragEnable:()=>$r,dsv:()=>yl,dsvFormat:()=>ic,easeBack:()=>il,easeBackIn:()=>nl,easeBackInOut:()=>il,easeBackOut:()=>rl,easeBounce:()=>Zc,easeBounceIn:()=>Qc,easeBounceInOut:()=>tl,easeBounceOut:()=>Zc,easeCircle:()=>Kc,easeCircleIn:()=>Fc,easeCircleInOut:()=>Kc,easeCircleOut:()=>$c,easeCubic:()=>oa,easeCubicIn:()=>ra,easeCubicInOut:()=>oa,easeCubicOut:()=>ia,easeElastic:()=>sl,easeElasticIn:()=>al,easeElasticInOut:()=>ul,easeElasticOut:()=>sl,easeExp:()=>Bc,easeExpIn:()=>Ic,easeExpInOut:()=>Bc,easeExpOut:()=>Dc,easeLinear:()=>kc,easePoly:()=>Nc,easePolyIn:()=>Tc,easePolyInOut:()=>Nc,easePolyOut:()=>Ac,easeQuad:()=>Sc,easeQuadIn:()=>Ec,easeQuadInOut:()=>Sc,easeQuadOut:()=>Oc,easeSin:()=>Pc,easeSinIn:()=>Cc,easeSinInOut:()=>Pc,easeSinOut:()=>jc,every:()=>Be,extent:()=>wt,fcumsum:()=>Et,filter:()=>$e,flatGroup:()=>Rt,flatRollup:()=>It,forceCenter:()=>Sl,forceCollide:()=>Fl,forceLink:()=>Ul,forceManyBody:()=>Xl,forceRadial:()=>Ql,forceSimulation:()=>Jl,forceX:()=>Zl,forceY:()=>tf,format:()=>hf,formatDefaultLocale:()=>vf,formatLocale:()=>yf,formatPrefix:()=>pf,formatSpecifier:()=>af,fsum:()=>kt,geoAlbers:()=>Fm,geoAlbersUsa:()=>$m,geoArea:()=>wh,geoAzimuthalEqualArea:()=>qm,geoAzimuthalEqualAreaRaw:()=>zm,geoAzimuthalEquidistant:()=>Ym,geoAzimuthalEquidistantRaw:()=>Vm,geoBounds:()=>np,geoCentroid:()=>dp,geoCircle:()=>Op,geoClipAntimeridian:()=>Ip,geoClipCircle:()=>Dp,geoClipExtent:()=>Vp,geoClipRectangle:()=>qp,geoConicConformal:()=>Qm,geoConicConformalRaw:()=>Xm,geoConicEqualArea:()=>Bm,geoConicEqualAreaRaw:()=>Dm,geoConicEquidistant:()=>ny,geoConicEquidistantRaw:()=>ey,geoContains:()=>ud,geoDistance:()=>Zp,geoEqualEarth:()=>cy,geoEqualEarthRaw:()=>uy,geoEquirectangular:()=>ty,geoEquirectangularRaw:()=>Zm,geoGnomonic:()=>fy,geoGnomonicRaw:()=>ly,geoGraticule:()=>fd,geoGraticule10:()=>hd,geoIdentity:()=>hy,geoInterpolate:()=>pd,geoLength:()=>Jp,geoMercator:()=>Hm,geoMercatorRaw:()=>Wm,geoNaturalEarth1:()=>dy,geoNaturalEarth1Raw:()=>py,geoOrthographic:()=>yy,geoOrthographicRaw:()=>my,geoPath:()=>_m,geoProjection:()=>Pm,geoProjectionMutator:()=>Rm,geoRotation:()=>xp,geoStereographic:()=>gy,geoStereographicRaw:()=>vy,geoStream:()=>Xf,geoTransform:()=>wm,geoTransverseMercator:()=>_y,geoTransverseMercatorRaw:()=>by,gray:()=>Ns,greatest:()=>pe,greatestIndex:()=>Le,group:()=>Ct,groupSort:()=>Wt,groups:()=>jt,hcl:()=>Bs,hierarchy:()=>Sy,histogram:()=>ae,hsl:()=>gi,html:()=>El,image:()=>bl,index:()=>Ft,indexes:()=>$t,interpolate:()=>qi,interpolateArray:()=>Ii,interpolateBasis:()=>Ei,interpolateBasisClosed:()=>Oi,interpolateBlues:()=>Ok,interpolateBrBG:()=>Dx,interpolateBuGn:()=>ek,interpolateBuPu:()=>rk,interpolateCividis:()=>Ik,interpolateCool:()=>Fk,interpolateCubehelix:()=>Vv,interpolateCubehelixDefault:()=>Dk,interpolateCubehelixLong:()=>Yv,interpolateDate:()=>Bi,interpolateDiscrete:()=>Cv,interpolateGnBu:()=>ok,interpolateGreens:()=>Tk,interpolateGreys:()=>Nk,interpolateHcl:()=>Uv,interpolateHclLong:()=>zv,interpolateHsl:()=>Bv,interpolateHslLong:()=>Fv,interpolateHue:()=>jv,interpolateInferno:()=>Jk,interpolateLab:()=>$v,interpolateMagma:()=>Gk,interpolateNumber:()=>Fi,interpolateNumberArray:()=>Pi,interpolateObject:()=>$i,interpolateOrRd:()=>sk,interpolateOranges:()=>Rk,interpolatePRGn:()=>Fx,interpolatePiYG:()=>Kx,interpolatePlasma:()=>Xk,interpolatePuBu:()=>fk,interpolatePuBuGn:()=>ck,interpolatePuOr:()=>zx,interpolatePuRd:()=>pk,interpolatePurples:()=>Mk,interpolateRainbow:()=>Kk,interpolateRdBu:()=>Vx,interpolateRdGy:()=>Wx,interpolateRdPu:()=>mk,interpolateRdYlBu:()=>Gx,interpolateRdYlGn:()=>Xx,interpolateReds:()=>jk,interpolateRgb:()=>Li,interpolateRgbBasis:()=>Ci,interpolateRgbBasisClosed:()=>ji,interpolateRound:()=>Pv,interpolateSinebow:()=>Vk,interpolateSpectral:()=>Zx,interpolateString:()=>zi,interpolateTransformCss:()=>Co,interpolateTransformSvg:()=>jo,interpolateTurbo:()=>Yk,interpolateViridis:()=>Hk,interpolateWarm:()=>Bk,interpolateYlGn:()=>bk,interpolateYlGnBu:()=>vk,interpolateYlOrBr:()=>wk,interpolateYlOrRd:()=>kk,interpolateZoom:()=>Iv,interrupt:()=>So,intersection:()=>Ye,interval:()=>DS,isoFormat:()=>PS,isoParse:()=>IS,json:()=>wl,lab:()=>Ls,lch:()=>Ds,least:()=>Ae,leastIndex:()=>Ne,line:()=>ME,lineRadial:()=>$E,link:()=>JE,linkHorizontal:()=>XE,linkRadial:()=>ZE,linkVertical:()=>QE,local:()=>tE,map:()=>Ke,matcher:()=>Sn,max:()=>se,maxIndex:()=>ue,mean:()=>be,median:()=>_e,medianIndex:()=>we,merge:()=>xe,min:()=>ce,minIndex:()=>le,mode:()=>ke,namespace:()=>Kn,namespaces:()=>$n,nice:()=>ie,now:()=>io,pack:()=>nv,packEnclose:()=>$y,packSiblings:()=>tv,pairs:()=>Ee,partition:()=>uv,path:()=>os,pathRound:()=>as,permute:()=>zt,pie:()=>RE,piecewise:()=>Wv,pointRadial:()=>UE,pointer:()=>Yi,pointers:()=>nE,polygonArea:()=>Gv,polygonCentroid:()=>Jv,polygonContains:()=>eg,polygonHull:()=>tg,polygonLength:()=>ng,precisionFixed:()=>gf,precisionPrefix:()=>bf,precisionRound:()=>_f,quadtree:()=>Ml,quantile:()=>de,quantileIndex:()=>ye,quantileSorted:()=>me,quantize:()=>Hv,quickselect:()=>fe,radialArea:()=>KE,radialLine:()=>$E,randomBates:()=>cg,randomBernoulli:()=>hg,randomBeta:()=>mg,randomBinomial:()=>yg,randomCauchy:()=>gg,randomExponential:()=>lg,randomGamma:()=>dg,randomGeometric:()=>pg,randomInt:()=>og,randomIrwinHall:()=>ug,randomLcg:()=>Eg,randomLogNormal:()=>sg,randomLogistic:()=>bg,randomNormal:()=>ag,randomPareto:()=>fg,randomPoisson:()=>_g,randomUniform:()=>ig,randomWeibull:()=>vg,range:()=>Se,rank:()=>Te,reduce:()=>Ue,reverse:()=>ze,rgb:()=>ci,ribbon:()=>vs,ribbonArrow:()=>gs,rollup:()=>Dt,rollups:()=>Bt,scaleBand:()=>Ng,scaleDiverging:()=>gx,scaleDivergingLog:()=>bx,scaleDivergingPow:()=>wx,scaleDivergingSqrt:()=>xx,scaleDivergingSymlog:()=>_x,scaleIdentity:()=>qg,scaleImplicit:()=>Tg,scaleLinear:()=>zg,scaleLog:()=>Zg,scaleOrdinal:()=>Ag,scalePoint:()=>Mg,scalePow:()=>ub,scaleQuantile:()=>hb,scaleQuantize:()=>pb,scaleRadial:()=>fb,scaleSequential:()=>fx,scaleSequentialLog:()=>hx,scaleSequentialPow:()=>dx,scaleSequentialQuantile:()=>yx,scaleSequentialSqrt:()=>mx,scaleSequentialSymlog:()=>px,scaleSqrt:()=>cb,scaleSymlog:()=>rb,scaleThreshold:()=>db,scaleTime:()=>sx,scaleUtc:()=>ux,scan:()=>Me,schemeAccent:()=>Ox,schemeBlues:()=>Ek,schemeBrBG:()=>Ix,schemeBuGn:()=>tk,schemeBuPu:()=>nk,schemeCategory10:()=>Ex,schemeDark2:()=>Sx,schemeGnBu:()=>ik,schemeGreens:()=>Sk,schemeGreys:()=>Ak,schemeObservable10:()=>Tx,schemeOrRd:()=>ak,schemeOranges:()=>Pk,schemePRGn:()=>Bx,schemePaired:()=>Ax,schemePastel1:()=>Nx,schemePastel2:()=>Lx,schemePiYG:()=>$x,schemePuBu:()=>lk,schemePuBuGn:()=>uk,schemePuOr:()=>Ux,schemePuRd:()=>hk,schemePurples:()=>Lk,schemeRdBu:()=>qx,schemeRdGy:()=>Yx,schemeRdPu:()=>dk,schemeRdYlBu:()=>Hx,schemeRdYlGn:()=>Jx,schemeReds:()=>Ck,schemeSet1:()=>Mx,schemeSet2:()=>Cx,schemeSet3:()=>jx,schemeSpectral:()=>Qx,schemeTableau10:()=>Px,schemeYlGn:()=>gk,schemeYlGnBu:()=>yk,schemeYlOrBr:()=>_k,schemeYlOrRd:()=>xk,select:()=>Pr,selectAll:()=>rE,selection:()=>jr,selector:()=>xn,selectorAll:()=>On,shuffle:()=>Ce,shuffler:()=>je,some:()=>Fe,sort:()=>qt,stack:()=>_S,stackOffsetDiverging:()=>xS,stackOffsetExpand:()=>wS,stackOffsetNone:()=>yS,stackOffsetSilhouette:()=>kS,stackOffsetWiggle:()=>ES,stackOrderAppearance:()=>OS,stackOrderAscending:()=>TS,stackOrderDescending:()=>NS,stackOrderInsideOut:()=>LS,stackOrderNone:()=>vS,stackOrderReverse:()=>MS,stratify:()=>dv,style:()=>Qn,subset:()=>Je,sum:()=>Pe,superset:()=>He,svg:()=>Ol,symbol:()=>TO,symbolAsterisk:()=>eO,symbolCircle:()=>nO,symbolCross:()=>rO,symbolDiamond:()=>aO,symbolDiamond2:()=>sO,symbolPlus:()=>uO,symbolSquare:()=>cO,symbolSquare2:()=>lO,symbolStar:()=>dO,symbolTimes:()=>EO,symbolTriangle:()=>yO,symbolTriangle2:()=>gO,symbolWye:()=>kO,symbolX:()=>EO,symbols:()=>OO,symbolsFill:()=>OO,symbolsStroke:()=>SO,text:()=>dl,thresholdFreedmanDiaconis:()=>ve,thresholdScott:()=>ge,thresholdSturges:()=>oe,tickFormat:()=>Kg,tickIncrement:()=>ne,tickStep:()=>re,ticks:()=>ee,timeDay:()=>Ib,timeDays:()=>Db,timeFormat:()=>I_,timeFormatDefaultLocale:()=>rx,timeFormatLocale:()=>P_,timeFriday:()=>Hb,timeFridays:()=>e_,timeHour:()=>Cb,timeHours:()=>jb,timeInterval:()=>kb,timeMillisecond:()=>Eb,timeMilliseconds:()=>Ob,timeMinute:()=>Ab,timeMinutes:()=>Nb,timeMonday:()=>qb,timeMondays:()=>Xb,timeMonth:()=>g_,timeMonths:()=>b_,timeParse:()=>D_,timeSaturday:()=>Gb,timeSaturdays:()=>n_,timeSecond:()=>Sb,timeSeconds:()=>Tb,timeSunday:()=>zb,timeSundays:()=>Jb,timeThursday:()=>Wb,timeThursdays:()=>t_,timeTickInterval:()=>L_,timeTicks:()=>N_,timeTuesday:()=>Vb,timeTuesdays:()=>Qb,timeWednesday:()=>Yb,timeWednesdays:()=>Zb,timeWeek:()=>zb,timeWeeks:()=>Jb,timeYear:()=>x_,timeYears:()=>k_,timeout:()=>ho,timer:()=>so,timerFlush:()=>uo,transition:()=>ta,transpose:()=>Re,tree:()=>kv,treemap:()=>Av,treemapBinary:()=>Nv,treemapDice:()=>sv,treemapResquarify:()=>Mv,treemapSlice:()=>Ev,treemapSliceDice:()=>Lv,treemapSquarify:()=>Tv,tsv:()=>gl,tsvFormat:()=>yc,tsvFormatBody:()=>vc,tsvFormatRow:()=>bc,tsvFormatRows:()=>gc,tsvFormatValue:()=>_c,tsvParse:()=>dc,tsvParseRows:()=>mc,union:()=>Xe,unixDay:()=>$b,unixDays:()=>Kb,utcDay:()=>Bb,utcDays:()=>Fb,utcFormat:()=>B_,utcFriday:()=>c_,utcFridays:()=>y_,utcHour:()=>Pb,utcHours:()=>Rb,utcMillisecond:()=>Eb,utcMilliseconds:()=>Ob,utcMinute:()=>Lb,utcMinutes:()=>Mb,utcMonday:()=>o_,utcMondays:()=>h_,utcMonth:()=>__,utcMonths:()=>w_,utcParse:()=>F_,utcSaturday:()=>l_,utcSaturdays:()=>v_,utcSecond:()=>Sb,utcSeconds:()=>Tb,utcSunday:()=>i_,utcSundays:()=>f_,utcThursday:()=>u_,utcThursdays:()=>m_,utcTickInterval:()=>A_,utcTicks:()=>T_,utcTuesday:()=>a_,utcTuesdays:()=>p_,utcWednesday:()=>s_,utcWednesdays:()=>d_,utcWeek:()=>i_,utcWeeks:()=>f_,utcYear:()=>E_,utcYears:()=>O_,variance:()=>bt,window:()=>Hn,xml:()=>kl,zip:()=>De,zoom:()=>XS,zoomIdentity:()=>KS,zoomTransform:()=>US});var a=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((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,s=e.endColumn,u=e.message,c=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!=s?s:null,this.message=null!=u?u:null,this.initialErrorMessage=null!=c?c:null,this.componentId=null!=l?l:null,this.attribute=null!=f?f:null,this.extraData=null!=h?h:""}));n(a,"SEVERITY_HINT",1),n(a,"SEVERITY_INFO",2),n(a,"SEVERITY_WARNING",4),n(a,"SEVERITY_ERROR",8);const s=a;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 c(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}var l=function(){return t=function t(){var e=arguments.length>0&&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&&function(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}}])&&function(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 v=y;function g(t){return g="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},g(t)}function b(t){var e=function(t){if("object"!=g(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(e)?e:e+""}function _(t,e,n){return e=x(e),function(t,e){if(e&&("object"==g(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,w()?Reflect.construct(e,n||[],x(t).constructor):e.apply(t,n))}function w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(w=function(){return!!t})()}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}var E=function(t){function e(){var t,n=arguments.length>0&&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=_(this,e,[n]);var r=n.id,i=n.externalId,o=n.name,a=n.definition,s=n.drawOption,u=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=s||new v,t.attributes=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&&k(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 f(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&&function(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,s=e.categories,u=e.tags,c=e.url,l=e.parentTypes,f=e.childrenTypes,h=e.definedAttributes,p=e.isContainer,d=e.displayType,m=e.workflowDirection,y=e.linkModel,v=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=s||[],this.tags=u||[],this.url=c||null,this.parentTypes=l||[],this.childrenTypes=f||[],this.definedAttributes=h||[],this.isContainer=void 0!==p&&p,this.displayType=d||null,this.workflowDirection=m||"horizontal",this.linkModel=y||null,this.defaultWidth=v||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 T=S;function A(t){return A="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},A(t)}function N(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 L(t,e,n){return(e=M(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M(t){var e=function(t){if("object"!=A(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==A(e)?e:e+""}var C=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&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,s=e.url,u=e.linkType,c=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=s||null,this.linkType=u||null,this.linkRef=c||[],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=R(this,e);var r=n.source,i=n.target,o=n.name,a=n.definition,s=n.isReverse;return t.__class="Link",t.source=r||null,t.target=i||null,t.name=o||null,t.definition=a||null,t.isReverse=!!s,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&&B(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const $=F;var K=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&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,s=e.isTemporary;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null,this.model=a||null,this.isTemporary=!!s}));const U=K;function z(t){return z="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},z(t)}function q(t,e,n){return e=Y(e),function(t,e){if(e&&("object"==z(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,V()?Reflect.construct(e,n||[],Y(t).constructor):e.apply(t,n))}function V(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(V=function(){return!!t})()}function Y(t){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Y(t)}function W(t,e){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},W(t,e)}var H=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=q(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&&W(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const G=H;function J(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function X(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function Q(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(iJ(t(e),n),r=(e,n)=>t(e)-n):(e=t===J||t===X?t:Z,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=ht(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 st=ct(ht),ut=ct((function(t){const e=ht(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 ct(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 s=n&&t(n),u=r&&t(r),c=i.slice();return s&&u?(lt(s,c,i,o,a),lt(s,i,c,o,a),lt(s,c,i,o,a),ft(u,i,c,o,a),ft(u,c,i,o,a),ft(u,i,c,o,a)):s?(lt(s,i,c,o,a),lt(s,c,i,o,a),lt(s,i,c,o,a)):u&&(ft(u,i,c,o,a),ft(u,c,i,o,a),ft(u,i,c,o,a)),e}}function lt(t,e,n,r,i){for(let o=0,a=r*i;o{if(!((o-=a)>=i))return;let s=t*r[i];const u=a*t;for(let t=i,e=i+u;t{if(!((a-=s)>=o))return;let u=e*i[o];const c=s*e,l=c+s;for(let t=o,e=o+c;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 dt(t){return 0|t.length}function mt(t){return!(t>0)}function yt(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function vt(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(yt)).map(dt),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(mt))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 gt(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 s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}function _t(t,e){const n=bt(t,e);return n?Math.sqrt(n):n}function wt(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 kt(t,e){const n=new xt;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 Et(t,e){const n=new xt;let r=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):i=>n.add(+e(i,++r,t)||0))}class Ot extends Map{constructor(t,e=Lt){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(Tt(this,t))}has(t){return super.has(Tt(this,t))}set(t,e){return super.set(At(this,t),e)}delete(t){return super.delete(Nt(this,t))}}class St extends Set{constructor(t,e=Lt){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(Tt(this,t))}add(t){return super.add(At(this,t))}delete(t){return super.delete(Nt(this,t))}}function Tt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function At({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Nt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Lt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Mt(t){return t}function Ct(t,...e){return Ut(t,Mt,Mt,e)}function jt(t,...e){return Ut(t,Array.from,Mt,e)}function Pt(t,e){for(let n=1,r=e.length;nt.pop().map((([e,n])=>[...t,e,n]))));return t}function Rt(t,...e){return Pt(jt(t,...e),e)}function It(t,e,...n){return Pt(Bt(t,e,...n),n)}function Dt(t,e,...n){return Ut(t,Mt,e,n)}function Bt(t,e,...n){return Ut(t,Array.from,e,n)}function Ft(t,...e){return Ut(t,Mt,Kt,e)}function $t(t,...e){return Ut(t,Array.from,Kt,e)}function Kt(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function Ut(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Ot,s=r[o++];let u=-1;for(const t of i){const e=s(t,++u,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 zt(t,e){return Array.from(e,(e=>t[e]))}function qt(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=Yt(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Yt(n[t],n[e])))),zt(t,r)}return t.sort(Vt(n))}function Vt(t=J){if(t===J)return Yt;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 Yt(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function Wt(t,e,n){return(2!==e.length?qt(Dt(t,e,n),(([t,e],[n,r])=>J(e,r)||J(t,n))):qt(Ct(t,n),(([t,n],[r,i])=>e(n,i)||J(t,r)))).map((([t])=>t))}var Ht=Array.prototype,Gt=Ht.slice;function Jt(t){return()=>t}Ht.map;const Xt=Math.sqrt(50),Qt=Math.sqrt(10),Zt=Math.sqrt(2);function te(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>=Xt?10:o>=Qt?5:o>=Zt?2:1;let s,u,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),u=Math.round(e*c),s/ce&&--u,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),u=Math.round(e/c),s*ce&&--u),u0))return[];if((t=+t)==(e=+e))return[t];const r=e=i))return[];const s=o-i+1,u=new Array(s);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 oe(t){return Math.max(1,Math.ceil(Math.log(pt(t))/Math.LN2)+1)}function ae(){var t=Mt,e=wt,n=oe;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,u=new Array(s);for(i=0;i=f)if(t>=f&&e===wt){const t=ne(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,m=p;h[d]<=l;)++d;for(;h[m-1]>f;)--m;(d||m0?h[i-1]:l,y.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 ue(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 ce(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 le(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 fe(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?Yt:Vt(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);fe(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}const o=t[e];let a=n,s=r;for(he(t,n,e),i(t[r],o)>0&&he(t,n,r);a0;)--s}0===i(t[n],o)?he(t,n,s):(++s,he(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function he(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function pe(t,e=J){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?J(t,i)>0:0===J(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 de(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 ce(t);if(e>=1)return se(t);var r,i=(r-1)*e,o=Math.floor(i),a=se(fe(t,o).subarray(0,o+1));return a+(ce(t.subarray(o+1))-a)*(i-o)}}function me(t,e,n=tt){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 ye(t,e,n=tt){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>tt(n(t[r],r,t)))),e<=0)return le(r);if(e>=1)return ue(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return fe(i,a,0,o,((t,e)=>Yt(r[t],r[e]))),(a=pe(i.subarray(0,a+1),(t=>r[t])))>=0?a:-1}}function ve(t,e,n){const r=pt(t),i=de(t,.75)-de(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function ge(t,e,n){const r=pt(t),i=_t(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 _e(t,e){return de(t,.5,e)}function we(t,e){return ye(t,.5,e)}function xe(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function ke(t,e){const n=new Ot;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 Ee(t,e=Oe){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function Oe(t,e){return[t,e]}function Se(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===J?(t,e)=>Yt(n[t],n[e]):Vt(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 Ae(t,e=J){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?J(t,i)<0:0===J(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=J){if(1===e.length)return le(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 Le(t,e=J){if(1===e.length)return ue(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 Me(t,e){const n=Ne(t,e);return n<0?void 0:n}const Ce=je(Math.random);function je(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 Pe(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 Re(t){if(!(i=t.length))return[];for(var e=-1,n=ce(t,Ie),r=new Array(n);++ee(n,r,t)))}function Ue(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 ze(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function qe(t,...e){t=new St(t);for(const n of e)for(const e of n)t.delete(e);return t}function Ve(t,e){const n=e[Symbol.iterator](),r=new St;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 Ye(t,...e){t=new St(t),e=e.map(We);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function We(t){return t instanceof St?t:new St(t)}function He(t,e){const n=t[Symbol.iterator](),r=new Set;for(const t of e){const e=Ge(t);if(r.has(e))continue;let i,o;for(;({value:i,done:o}=n.next());){if(o)return!1;const t=Ge(i);if(r.add(t),Object.is(e,t))break}}return!0}function Ge(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Je(t,e){return He(e,t)}function Xe(...t){const e=new St;for(const n of t)for(const t of n)e.add(t);return e}function Qe(t){return t}var Ze=1,tn=2,en=3,nn=4,rn=1e-6;function on(t){return"translate("+t+",0)"}function an(t){return"translate(0,"+t+")"}function sn(t){return e=>+t(e)}function un(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function cn(){return!this.__axis}function ln(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,u="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=t===Ze||t===nn?-1:1,l=t===nn||t===tn?"x":"y",f=t===Ze||t===en?on:an;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):Qe:i,m=Math.max(o,0)+s,y=e.range(),v=+y[0]+u,g=+y[y.length-1]+u,b=(e.bandwidth?un:sn)(e.copy(),u),_=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"),O=x.select("line"),S=x.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(E),O=O.merge(E.append("line").attr("stroke","currentColor").attr(l+"2",c*o)),S=S.merge(E.append("text").attr("fill","currentColor").attr(l,c*m).attr("dy",t===Ze?"0em":t===en?"0.71em":"0.32em")),h!==_&&(w=w.transition(h),x=x.transition(h),O=O.transition(h),S=S.transition(h),k=k.transition(h).attr("opacity",rn).attr("transform",(function(t){return isFinite(t=b(t))?f(t+u):this.getAttribute("transform")})),E.attr("opacity",rn).attr("transform",(function(t){var e=this.parentNode.__axis;return f((e&&isFinite(e=e(t))?e:b(t))+u)}))),k.remove(),w.attr("d",t===nn||t===tn?a?"M"+c*a+","+v+"H"+u+"V"+g+"H"+c*a:"M"+u+","+v+"V"+g:a?"M"+v+","+c*a+"V"+u+"H"+g+"V"+c*a:"M"+v+","+u+"H"+g),x.attr("opacity",1).attr("transform",(function(t){return f(b(t)+u)})),O.attr(l+"2",c*o),S.attr(l,c*m).text(d),_.filter(cn).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===tn?"start":t===nn?"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?(s=+t,h):s},h.offset=function(t){return arguments.length?(u=+t,h):u},h}function fn(t){return ln(Ze,t)}function hn(t){return ln(tn,t)}function pn(t){return ln(en,t)}function dn(t){return ln(nn,t)}var mn={value:()=>{}};function yn(){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,s=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}jn.prototype={constructor:jn,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 Fn="http://www.w3.org/1999/xhtml";const $n={svg:"http://www.w3.org/2000/svg",xhtml:Fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Kn(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),$n.hasOwnProperty(e)?{space:$n[e],local:t}:t}function Un(t){return function(){this.removeAttribute(t)}}function zn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qn(t,e){return function(){this.setAttribute(t,e)}}function Vn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Yn(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Wn(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 Hn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Gn(t){return function(){this.style.removeProperty(t)}}function Jn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Xn(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Qn(t,e){return t.style.getPropertyValue(e)||Hn(t).getComputedStyle(t,null).getPropertyValue(e)}function Zn(t){return function(){delete this[t]}}function tr(t,e){return function(){this[t]=e}}function er(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function nr(t){return t.trim().split(/^|\s+/)}function rr(t){return t.classList||new ir(t)}function ir(t){this._node=t,this._names=nr(t.getAttribute("class")||"")}function or(t,e){for(var n=rr(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 Lr=[null];function Mr(t,e){this._groups=t,this._parents=e}function Cr(){return new Mr([[document.documentElement]],Lr)}Mr.prototype=Cr.prototype={constructor:Mr,select:function(t){"function"!=typeof t&&(t=xn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=w&&(w=_+1);!(b=v[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=Bn);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?Gn:"function"==typeof e?Xn:Jn)(t,e,null==n?"":n)):Qn(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Zn:"function"==typeof e?er:tr)(t,e)):this.node()[t]},classed:function(t,e){var n=nr(t+"");if(arguments.length<2){for(var r=rr(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(s=e?Sr:Or,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?si(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?si(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=Jr.exec(t))?new li(e[1],e[2],e[3],1):(e=Xr.exec(t))?new li(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Qr.exec(t))?si(e[1],e[2],e[3],e[4]):(e=Zr.exec(t))?si(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ti.exec(t))?yi(e[1],e[2]/100,e[3]/100,1):(e=ei.exec(t))?yi(e[1],e[2]/100,e[3]/100,e[4]):ni.hasOwnProperty(t)?ai(ni[t]):"transparent"===t?new li(NaN,NaN,NaN,0):null}function ai(t){return new li(t>>16&255,t>>8&255,255&t,1)}function si(t,e,n,r){return r<=0&&(t=e=n=NaN),new li(t,e,n,r)}function ui(t){return t instanceof zr||(t=oi(t)),t?new li((t=t.rgb()).r,t.g,t.b,t.opacity):new li}function ci(t,e,n,r){return 1===arguments.length?ui(t):new li(t,e,n,null==r?1:r)}function li(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function fi(){return`#${mi(this.r)}${mi(this.g)}${mi(this.b)}`}function hi(){const t=pi(this.opacity);return`${1===t?"rgb(":"rgba("}${di(this.r)}, ${di(this.g)}, ${di(this.b)}${1===t?")":`, ${t})`}`}function pi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function di(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mi(t){return((t=di(t))<16?"0":"")+t.toString(16)}function yi(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 vi(t){if(t instanceof bi)return new bi(t.h,t.s,t.l,t.opacity);if(t instanceof zr||(t=oi(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,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new bi(a,s,u,t.opacity)}function gi(t,e,n,r){return 1===arguments.length?vi(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 _i(t){return(t=(t||0)%360)<0?t+360:t}function wi(t){return Math.max(0,Math.min(1,t||0))}function xi(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 ki(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 Ei(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,s=r=240?t-240:t+120,i,r),xi(t,i,r),xi(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new bi(_i(this.h),wi(this.s),wi(this.l),pi(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=pi(this.opacity);return`${1===t?"hsl(":"hsla("}${_i(this.h)}, ${100*wi(this.s)}%, ${100*wi(this.l)}%${1===t?")":`, ${t})`}`}}));const Si=t=>()=>t;function Ti(t,e){return function(n){return t+n*e}}function Ai(t,e){var n=e-t;return n?Ti(t,n>180||n<-180?n-360*Math.round(n/360):n):Si(isNaN(t)?e:t)}function Ni(t,e){var n=e-t;return n?Ti(t,n):Si(isNaN(t)?e:t)}const Li=function t(e){var n=function(t){return 1==(t=+t)?Ni: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):Si(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=ci(t)).r,(e=ci(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ni(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 Mi(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Fi(n,r)})),o=Ui.lastIndex;return o=0&&e._call.call(void 0,t),e=e._next;--Gi}function co(){to=(Zi=no.now())+eo,Gi=Ji=0;try{uo()}finally{Gi=0,function(){for(var t,e,n=Wi,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:Wi=e);Hi=t,fo(r)}(),to=0}}function lo(){var t=no.now(),e=t-Zi;e>Qi&&(eo-=e,Zi=t)}function fo(t){Gi||(Ji&&(Ji=clearTimeout(Ji)),t-to>24?(t<1/0&&(Ji=setTimeout(co,t-no.now()-eo)),Xi&&(Xi=clearInterval(Xi))):(Xi||(Zi=no.now(),Xi=setInterval(lo,Qi)),Gi=1,ro(co)))}function ho(t,e,n){var r=new ao;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}ao.prototype=so.prototype={constructor:ao,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?io():+n)+(null==e?0:+e),this._next||Hi===this||(Hi?Hi._next=this:Wi=this,Hi=this),this._call=t,this._time=n,fo()},stop:function(){this._call&&(this._call=null,this._time=1/0,fo())}};var po=_n("start","end","cancel","interrupt"),mo=[],yo=0,vo=1,go=2,bo=3,_o=5,wo=6;function xo(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(u){var c,l,f,h;if(n.state!==vo)return s();for(c in i)if((h=i[c]).name===n.name){if(h.state===bo)return ho(o);4===h.state?(h.state=wo,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+cyo)throw new Error("too late; already scheduled");return n}function Eo(t,e){var n=Oo(t,e);if(n.state>bo)throw new Error("too late; already running");return n}function Oo(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function So(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>go&&n.state<_o,n.state=wo,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}}var To,Ao=180/Math.PI,No={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lo(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Fi(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Fi(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Fi(t,n)},{i:s-2,x:Fi(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ko:Eo;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=Kn(t),r="transform"===n?jo:Do;return this.attrTween(t,"function"==typeof e?(n.local?zo:Uo)(n,r,Io(this,"attr."+t,e)):null==e?(n.local?Fo:Bo)(n):(n.local?Ko:$o)(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=Kn(t);return this.tween(n,(r.local?qo:Vo)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Co:Do;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=Qn(this,t),a=(this.style.removeProperty(t),Qn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,Xo(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=Qn(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Qn(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Io(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=Eo(this,t),c=u.on,l=null==u.value[a]?o||(o=Xo(e)):void 0;c===n&&i===l||(r=(n=c).copy()).on(s,i=l),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=Qn(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}}(Io(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=Oo(this.node(),n).tween,o=0,a=i.length;ovo&&n.name===e)return new Zo([[t]],ua,e,+r);return null}const la=t=>()=>t;function fa(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 ha(t){t.preventDefault(),t.stopImmediatePropagation()}var pa={name:"drag"},da={name:"space"},ma={name:"handle"},ya={name:"center"};const{abs:va,max:ga,min:ba}=Math;function _a(t){return[+t[0],+t[1]]}function wa(t){return[_a(t[0]),_a(t[1])]}var xa={name:"x",handles:["w","e"].map(La),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]]}},ka={name:"y",handles:["n","s"].map(La),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]]}},Ea={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(La),input:function(t){return null==t?null:wa(t)},output:function(t){return t}},Oa={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"},Sa={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Ta={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Aa={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Na={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function La(t){return{type:t}}function Ma(t){return!t.ctrlKey&&!t.button}function Ca(){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 ja(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pa(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Ra(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Ia(){return Fa(xa)}function Da(){return Fa(ka)}function Ba(){return Fa(Ea)}function Fa(t){var e,n=Ca,r=Ma,i=ja,o=!0,a=_n("start","brush","end"),s=6;function u(e){var n=e.property("__brush",m).selectAll(".overlay").data([La("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Oa.overlay).merge(n).each((function(){var t=Pa(this).extent;Pr(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([La("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Oa.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 Oa[t.type]})),e.each(c).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 c(){var t=Pr(this),e=Pa(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]-s/2:e[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-s/2:e[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+s:s}))):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,s,u,f,h,p,d,m,y,v,g=this,b=n.target.__data__.type,_="selection"===(o&&n.metaKey?b="overlay":b)?pa:o&&n.altKey?ya:ma,w=t===ka?null:Aa[b],x=t===xa?null:Na[b],k=Pa(g),E=k.extent,O=k.selection,S=E[0][0],T=E[0][1],A=E[1][0],N=E[1][1],L=0,M=0,C=w&&x&&o&&n.shiftKey,j=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=Yi(t,g)).point0=t.slice(),t.identifier=e,t}));So(g);var P=l(g,arguments,!0).beforestart();if("overlay"===b){O&&(m=!0);const e=[j[0],j[1]||j[0]];k.selection=O=[[i=t===ka?S:ba(e[0][0],e[1][0]),s=t===xa?T:ba(e[0][1],e[1][1])],[f=t===ka?A:ga(e[0][0],e[1][0]),p=t===xa?N:ga(e[0][1],e[1][1])]],j.length>1&&F(n)}else i=O[0][0],s=O[0][1],f=O[1][0],p=O[1][1];a=i,u=s,h=f,d=p;var R=Pr(g).attr("pointer-events","none"),I=R.selectAll(".overlay").attr("cursor",Oa[b]);if(n.touches)P.moved=B,P.ended=$;else{var D=Pr(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",$,!0);o&&D.on("keydown.brush",(function(t){switch(t.keyCode){case 16:C=w&&x;break;case 18:_===ma&&(w&&(f=h-L*w,i=a+L*w),x&&(p=d-M*x,s=u+M*x),_=ya,F(t));break;case 32:_!==ma&&_!==ya||(w<0?f=h-L:w>0&&(i=a-L),x<0?p=d-M:x>0&&(s=u-M),_=da,I.attr("cursor",Oa.selection),F(t));break;default:return}ha(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:C&&(y=v=C=!1,F(t));break;case 18:_===ya&&(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=ma,F(t));break;case 32:_===da&&(t.altKey?(w&&(f=h-L*w,i=a+L*w),x&&(p=d-M*x,s=u+M*x),_=ya):(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=ma),I.attr("cursor",Oa[b]),F(t));break;default:return}ha(t)}),!0),Fr(n.view)}c.call(g),P.start(n,_.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of j)t.identifier===e.identifier&&(t.cur=Yi(e,g));if(C&&!y&&!v&&1===j.length){const t=j[0];va(t.cur[0]-t[0])>va(t.cur[1]-t[1])?v=!0:y=!0}for(const t of j)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);m=!0,ha(t),F(t)}function F(t){const e=j[0],n=e.point0;var r;switch(L=e[0]-n[0],M=e[1]-n[1],_){case da:case pa:w&&(L=ga(S-i,ba(A-f,L)),a=i+L,h=f+L),x&&(M=ga(T-s,ba(N-p,M)),u=s+M,d=p+M);break;case ma:j[1]?(w&&(a=ga(S,ba(A,j[0][0])),h=ga(S,ba(A,j[1][0])),w=1),x&&(u=ga(T,ba(N,j[0][1])),d=ga(T,ba(N,j[1][1])),x=1)):(w<0?(L=ga(S-i,ba(A-i,L)),a=i+L,h=f):w>0&&(L=ga(S-f,ba(A-f,L)),a=i,h=f+L),x<0?(M=ga(T-s,ba(N-s,M)),u=s+M,d=p):x>0&&(M=ga(T-p,ba(N-p,M)),u=s,d=p+M));break;case ya:w&&(a=ga(S,ba(A,i-L*w)),h=ga(S,ba(A,f+L*w))),x&&(u=ga(T,ba(N,s-M*x)),d=ga(T,ba(N,p+M*x)))}ht+n))}function Ga(){return Qa(!1,!1)}function Ja(){return Qa(!1,!0)}function Xa(){return Qa(!0,!1)}function Qa(t,e){var n=0,r=null,i=null,o=null;function a(a){var s,u=a.length,c=new Array(u),l=Ha(0,u),f=new Array(u*u),h=new Array(u),p=0;a=Float64Array.from({length:u*u},e?(t,e)=>a[e%u][e/u|0]:(t,e)=>a[e/u|0][e%u]);for(let e=0;er(c[t],c[e])));for(const n of l){const r=e;if(t){const t=Ha(1+~u,u).filter((t=>t<0?a[~t*u+n]:a[n*u+t]));i&&t.sort(((t,e)=>i(t<0?-a[~t*u+n]:a[n*u+t],e<0?-a[~e*u+n]:a[n*u+e])));for(const r of t)r<0?(f[~r*u+n]||(f[~r*u+n]={source:null,target:null})).target={index:n,startAngle:e,endAngle:e+=a[~r*u+n]*p,value:a[~r*u+n]}:(f[n*u+r]||(f[n*u+r]={source:null,target:null})).source={index:n,startAngle:e,endAngle:e+=a[n*u+r]*p,value:a[n*u+r]};h[n]={index:n,startAngle:r,endAngle:e,value:c[n]}}else{const t=Ha(0,u).filter((t=>a[n*u+t]||a[t*u+n]));i&&t.sort(((t,e)=>i(a[n*u+t],a[n*u+e])));for(const r of t){let t;if(n=0))throw new Error(`invalid digits: ${t}`);if(e>15)return rs;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;ees)if(Math.abs(l*s-u*c)>es&&i){let h=n-o,p=r-a,d=s*s+u*u,m=h*h+p*p,y=Math.sqrt(d),v=Math.sqrt(f),g=i*Math.tan((Za-Math.acos((d+f-m)/(2*y*v)))/2),b=g/v,_=g/y;Math.abs(b-1)>es&&this._append`L${t+b*c},${e+b*l}`,this._append`A${i},${i},0,0,${+(l*h>c*p)},${this._x1=t+_*s},${this._y1=e+_*u}`}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),s=n*Math.sin(r),u=t+a,c=e+s,l=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${u},${c}`:(Math.abs(this._x1-u)>es||Math.abs(this._y1-c)>es)&&this._append`L${u},${c}`,n&&(f<0&&(f=f%ts+ts),f>ns?this._append`A${n},${n},0,1,${l},${t-a},${e-s}A${n},${n},0,1,${l},${this._x1=u},${this._y1=c}`:f>es&&this._append`A${n},${n},0,${+(f>=Za)},${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 os(){return new is}function as(t=3){return new is(+t)}os.prototype=is.prototype;var ss=Array.prototype.slice;function us(t){return function(){return t}}function cs(t){return t.source}function ls(t){return t.target}function fs(t){return t.radius}function hs(t){return t.startAngle}function ps(t){return t.endAngle}function ds(){return 0}function ms(){return 10}function ys(t){var e=cs,n=ls,r=fs,i=fs,o=hs,a=ps,s=ds,u=null;function c(){var c,l=e.apply(this,arguments),f=n.apply(this,arguments),h=s.apply(this,arguments)/2,p=ss.call(arguments),d=+r.apply(this,(p[0]=l,p)),m=o.apply(this,p)-qa,y=a.apply(this,p)-qa,v=+i.apply(this,(p[0]=f,p)),g=o.apply(this,p)-qa,b=a.apply(this,p)-qa;if(u||(u=c=os()),h>Wa&&($a(y-m)>2*h+Wa?y>m?(m+=h,y-=h):(m-=h,y+=h):m=y=(m+y)/2,$a(b-g)>2*h+Wa?b>g?(g+=h,b-=h):(g-=h,b+=h):g=b=(g+b)/2),u.moveTo(d*Ka(m),d*Ua(m)),u.arc(0,0,d,m,y),m!==g||y!==b)if(t){var _=v-+t.apply(this,arguments),w=(g+b)/2;u.quadraticCurveTo(0,0,_*Ka(g),_*Ua(g)),u.lineTo(v*Ka(w),v*Ua(w)),u.lineTo(_*Ka(b),_*Ua(b))}else u.quadraticCurveTo(0,0,v*Ka(g),v*Ua(g)),u.arc(0,0,v,g,b);if(u.quadraticCurveTo(0,0,d*Ka(m),d*Ua(m)),u.closePath(),c)return u=null,c+""||null}return t&&(c.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:us(+e),c):t}),c.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:us(+t),c):r},c.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:us(+t),c):r},c.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:us(+t),c):i},c.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:us(+t),c):o},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:us(+t),c):a},c.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:us(+t),c):s},c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function vs(){return ys()}function gs(){return ys(ms)}const bs=Math.PI/180,_s=180/Math.PI,ws=.96422,xs=1,ks=.82521,Es=4/29,Os=6/29,Ss=3*Os*Os,Ts=Os*Os*Os;function As(t){if(t instanceof Ms)return new Ms(t.l,t.a,t.b,t.opacity);if(t instanceof Fs)return $s(t);t instanceof li||(t=ui(t));var e,n,r=Rs(t.r),i=Rs(t.g),o=Rs(t.b),a=Cs((.2225045*r+.7168786*i+.0606169*o)/xs);return r===i&&i===o?e=n=a:(e=Cs((.4360747*r+.3850649*i+.1430804*o)/ws),n=Cs((.0139322*r+.0971045*i+.7141733*o)/ks)),new Ms(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Ns(t,e){return new Ms(t,0,0,null==e?1:e)}function Ls(t,e,n,r){return 1===arguments.length?As(t):new Ms(t,e,n,null==r?1:r)}function Ms(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Cs(t){return t>Ts?Math.pow(t,1/3):t/Ss+Es}function js(t){return t>Os?t*t*t:Ss*(t-Es)}function Ps(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Rs(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Is(t){if(t instanceof Fs)return new Fs(t.h,t.c,t.l,t.opacity);if(t instanceof Ms||(t=As(t)),0===t.a&&0===t.b)return new Fs(NaN,0()=>t;function tu(t,e){for(var n,r=-1,i=e.length;++rr!=p>r&&n<(h-c)*(r-l)/(p-l)+c&&(i=-i)}return i}function nu(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 ru(){}var iu=[[],[[[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 ou(){var t=1,e=1,n=oe,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Qs);else{const n=wt(t,au);for(e=ee(...ie(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 s=[],u=[];return function(n,r,i){var o,s,u,c,l,f,h=new Array,p=new Array;for(o=s=-1,c=su(n[0],r),iu[c<<1].forEach(d);++o=r,iu[l<<2].forEach(d);++o0?s.push([t]):u.push(t)})),u.forEach((function(t){for(var e,n=0,r=s.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)?Zs(Xs.call(t)):Zs(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:ru,i):r===s},i}function au(t){return isFinite(t)?t:NaN}function su(t,e){return null!=t&&+t>=e}function uu(t){return null==t||isNaN(t=+t)?-1/0:t}function cu(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 lu(t){return t[0]}function fu(t){return t[1]}function hu(){return 1}function pu(){var t=lu,e=fu,n=hu,r=960,i=500,o=20,a=2,s=3*o,u=r+2*s>>a,c=i+2*s>>a,l=Zs(20);function f(r){var i=new Float32Array(u*c),l=Math.pow(2,-a),f=-1;for(const o of r){var h=(t(o,++f,r)+s)*l,p=(e(o,f,r)+s)*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(m)}function m(t){t.forEach(y)}function y(t){t[0]=t[0]*Math.pow(2,a)-s,t[1]=t[1]*Math.pow(2,a)-s}function v(){return u=r+2*(s=3*o)>>a,c=i+2*s>>a,h}return h.contours=function(t){var e=f(t),n=ou().size([u,c]),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:()=>se(e)/r}),i},h.x=function(e){return arguments.length?(t="function"==typeof e?e:Zs(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:Zs(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:Zs(+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,v()},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),v()},h.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Zs(Xs.call(t)):Zs(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,v()},h}const du=134217729;function mu(t,e,n,r,i){let o,a,s,u,c=e[0],l=r[0],f=0,h=0;l>c==l>-c?(o=c,c=e[++f]):(o=l,l=r[++h]);let p=0;if(fc==l>-c?(a=c+o,s=o-(a-c),c=e[++f]):(a=l+o,s=o-(a-l),l=r[++h]),o=a,0!==s&&(i[p++]=s);fc==l>-c?(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=e[++f]):(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=r[++h]),o=a,0!==s&&(i[p++]=s);for(;f=33306690738754716e-32*c?u:-function(t,e,n,r,i,o,a){let s,u,c,l,f,h,p,d,m,y,v,g,b,_,w,x,k,E;const O=t-i,S=n-i,T=e-o,A=r-o;_=O*A,h=du*O,p=h-(h-O),d=O-p,h=du*A,m=h-(h-A),y=A-m,w=d*y-(_-p*m-d*m-p*y),x=T*S,h=du*T,p=h-(h-T),d=T-p,h=du*S,m=h-(h-S),y=S-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,vu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,vu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,vu[2]=g-(E-f)+(v-f),vu[3]=E;let N=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,vu),L=22204460492503146e-32*a;if(N>=L||-N>=L)return N;if(f=t-O,s=t-(O+f)+(f-i),f=n-S,c=n-(S+f)+(f-i),f=e-T,u=e-(T+f)+(f-o),f=r-A,l=r-(A+f)+(f-o),0===s&&0===u&&0===c&&0===l)return N;if(L=11093356479670487e-47*a+33306690738754706e-32*Math.abs(N),N+=O*l+A*s-(T*c+S*u),N>=L||-N>=L)return N;_=s*A,h=du*s,p=h-(h-s),d=s-p,h=du*A,m=h-(h-A),y=A-m,w=d*y-(_-p*m-d*m-p*y),x=u*S,h=du*u,p=h-(h-u),d=u-p,h=du*S,m=h-(h-S),y=S-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,wu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,wu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,wu[2]=g-(E-f)+(v-f),wu[3]=E;const M=mu(4,vu,4,wu,gu);_=O*l,h=du*O,p=h-(h-O),d=O-p,h=du*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=T*c,h=du*T,p=h-(h-T),d=T-p,h=du*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,wu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,wu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,wu[2]=g-(E-f)+(v-f),wu[3]=E;const C=mu(M,gu,4,wu,bu);_=s*l,h=du*s,p=h-(h-s),d=s-p,h=du*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=u*c,h=du*u,p=h-(h-u),d=u-p,h=du*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,wu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,wu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,wu[2]=g-(E-f)+(v-f),wu[3]=E;const j=mu(C,bu,4,wu,_u);return _u[j-1]}(t,e,n,r,i,o,c)}yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(8),yu(8),yu(8),yu(4),yu(8),yu(8),yu(8),yu(12),yu(192),yu(192),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(4),yu(4),yu(4),yu(8),yu(16),yu(16),yu(16),yu(32),yu(32),yu(48),yu(64),yu(1152),yu(1152),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(1152),yu(1152),yu(1152),yu(1152),yu(1152),yu(2304),yu(2304),yu(3456),yu(5760),yu(8),yu(8),yu(8),yu(16),yu(24),yu(48),yu(48),yu(96),yu(192),yu(384),yu(384),yu(384),yu(768),yu(96),yu(96),yu(96),yu(1152);const ku=Math.pow(2,-52),Eu=new Uint32Array(512);class Ou{static from(t,e=Mu,n=Cu){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,s=1/0,u=-1/0,c=-1/0;for(let e=0;eu&&(u=n),r>c&&(c=r),this._ids[e]=e}const l=(a+u)/2,f=(s+c)/2;let h,p,d;for(let e=0,n=1/0;e0&&(p=e,n=r)}let v=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(xu(m,y,v,g,_,w)<0){const t=p,e=v,n=g;p=d,v=_,g=w,d=t,_=e,w=n}const x=function(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,c=o-e,l=a*a+s*s,f=u*u+c*c,h=.5/(a*c-s*u);return{x:t+(c*l-s*f)*h,y:e+(a*f-u*l)*h}}(m,y,v,g,_,w);this._cx=x.x,this._cy=x.y;for(let e=0;e0&&Math.abs(c-o)<=ku&&Math.abs(l-a)<=ku)continue;if(o=c,a=l,u===h||u===p||u===d)continue;let f=0;for(let t=0,e=this._hashKey(c,l);t=0;)if(y=m,y===f){y=-1;break}if(-1===y)continue;let v=this._addTriangle(y,u,n[y],-1,-1,r[y]);r[u]=this._legalize(v+2),r[y]=v,k++;let g=n[y];for(;m=n[g],xu(c,l,t[2*g],t[2*g+1],t[2*m],t[2*m+1])<0;)v=this._addTriangle(g,u,m,r[u],-1,r[g]),r[u]=this._legalize(v+2),n[g]=g,k--,g=m;if(y===f)for(;m=e[y],xu(c,l,t[2*m],t[2*m+1],t[2*y],t[2*y+1])<0;)v=this._addTriangle(m,u,y,-1,r[y],r[m]),this._legalize(v+2),r[m]=v,n[y]=y,k--,y=m;this._hullStart=e[u]=y,n[y]=e[g]=u,n[u]=g,i[this._hashKey(c,l)]=u,i[this._hashKey(t[2*y],t[2*y+1])]=y}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],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===i)break;t=Eu[--i];continue}const u=a-a%3,c=s+(t+1)%3,l=u+(a+2)%3,f=e[o],h=e[t],p=e[c],d=e[l];if(Tu(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 s=u+(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;Lu(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Lu(t,n,r),e[t[i]]>e[t[r]]&&Lu(t,i,r),e[t[n]]>e[t[i]]&&Lu(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]s);if(o=o-n?(Nu(t,e,i,r),Nu(t,e,n,o-1)):(Nu(t,e,n,o-1),Nu(t,e,i,r))}}function Lu(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Mu(t){return t[0]}function Cu(t){return t[1]}const ju=1e-6;class Pu{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)>ju||Math.abs(this._y1-i)>ju)&&(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 Ru{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 Iu{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,s,u=0,c=0,l=n.length;u1;)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 Iu(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:s,points:u}=this;if(-1===r[t]||!u.length)return(t+1)%(u.length>>1);let c=t,l=Bu(e-u[2*t],2)+Bu(n-u[2*t+1],2);const f=r[t];let h=f;do{let r=s[h];const f=Bu(e-u[2*r],2)+Bu(n-u[2*r+1],2);if(f()=>t;function qu(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:c,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:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function Vu(t){return!t.ctrlKey&&!t.button}function Yu(){return this.parentNode}function Wu(t,e){return null==e?{x:t.x,y:t.y}:e}function Hu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gu(){var t,e,n,r,i=Vu,o=Yu,a=Wu,s=Hu,u={},c=_n("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",y).on("touchmove.drag",v,Rr).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,s){if(!r&&i.call(this,a,s)){var u=b(this,o.call(this,a,s),a,s,"mouse");u&&(Pr(a.view).on("mousemove.drag",d,Ir).on("mouseup.drag",m,Ir),Fr(a.view),Dr(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function d(r){if(Br(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}u.mouse("drag",r)}function m(t){Pr(t.view).on("mousemove.drag mouseup.drag",null),$r(t.view,n),Br(t),u.mouse("end",t)}function y(t,e){if(i.call(this,t,e)){var n,r,a=t.changedTouches,s=o.call(this,t,e),u=a.length;for(n=0;n=o?u=!0:(r=t.charCodeAt(a++))===Zu?c=!0:r===tc&&(c=!0,t.charCodeAt(a)===Zu&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+rc(e,6):rc(e,4))+"-"+rc(t.getUTCMonth()+1,2)+"-"+rc(t.getUTCDate(),2)+(o?"T"+rc(n,2)+":"+rc(r,2)+":"+rc(i,2)+"."+rc(o,3)+"Z":i?"T"+rc(n,2)+":"+rc(r,2)+":"+rc(i,2)+"Z":r||n?"T"+rc(n,2)+":"+rc(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=ec(t);return function(r,i){return e(n(r),i,t)}}(t,e):ec(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=nc(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=nc(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var oc=ic(","),ac=oc.parse,sc=oc.parseRows,uc=oc.format,cc=oc.formatBody,lc=oc.formatRows,fc=oc.formatRow,hc=oc.formatValue,pc=ic("\t"),dc=pc.parse,mc=pc.parseRows,yc=pc.format,vc=pc.formatBody,gc=pc.formatRows,bc=pc.formatRow,_c=pc.formatValue;function wc(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;xc&&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 xc=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),kc=t=>+t;function Ec(t){return t*t}function Oc(t){return t*(2-t)}function Sc(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var Tc=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),Ac=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Nc=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),Lc=Math.PI,Mc=Lc/2;function Cc(t){return 1==+t?1:1-Math.cos(t*Mc)}function jc(t){return Math.sin(t*Mc)}function Pc(t){return(1-Math.cos(Lc*t))/2}function Rc(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function Ic(t){return Rc(1-+t)}function Dc(t){return 1-Rc(t)}function Bc(t){return((t*=2)<=1?Rc(1-t):2-Rc(t-1))/2}function Fc(t){return 1-Math.sqrt(1-t*t)}function $c(t){return Math.sqrt(1- --t*t)}function Kc(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Uc=4/11,zc=6/11,qc=8/11,Vc=3/4,Yc=9/11,Wc=10/11,Hc=15/16,Gc=21/22,Jc=63/64,Xc=1/Uc/Uc;function Qc(t){return 1-Zc(1-t)}function Zc(t){return(t=+t)dl(e,n).then((e=>(new DOMParser).parseFromString(e,t)))}const kl=xl("application/xml");var El=xl("text/html"),Ol=xl("image/svg+xml");function Sl(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i=(o=(m+v)/2))?m=o:v=o,(l=n>=(a=(y+g)/2))?y=a:g=a,i=p,!(p=p[f=l<<1|c]))return i[f]=d,t;if(s=+t._x.call(null,p.data),u=+t._y.call(null,p.data),e===s&&n===u)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),(c=e>=(o=(m+v)/2))?m=o:v=o,(l=n>=(a=(y+g)/2))?y=a:g=a}while((f=l<<1|c)==(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=d,t}function Al(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Nl(t){return t[0]}function Ll(t){return t[1]}function Ml(t,e,n){var r=new Cl(null==e?Nl:e,null==n?Ll:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Cl(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 jl(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Pl=Ml.prototype=Cl.prototype;function Rl(t){return function(){return t}}function Il(t){return 1e-6*(t()-.5)}function Dl(t){return t.x+t.vx}function Bl(t){return t.y+t.vy}function Fl(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,c,l,f,h,p=e.length,d=0;dc+d||ol+d||au.index){var m=c-s.x-s.vx,y=l-s.y-s.vy,v=m*m+y*y;vt.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r[s(t,e,r),t])));for(a=0,i=new Array(c);al&&(l=r),if&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;nt||t>=i||r>e||e>=o;)switch(s=(eh||(o=u.y0)>p||(a=u.x1)=v)<<1|t>=y)&&(u=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=u)}else{var g=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=g*g+b*b;if(_=(s=(d+y)/2))?d=s:y=s,(l=a>=(u=(m+v)/2))?m=u:v=u,e=p,!(p=p[f=l<<1|c]))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)},Pl.removeAll=function(t){for(var e=0,n=t.length;e(t=(zl*t+ql)%Vl)/Vl}();function f(){h(),c.call("tick",e),n1?(null==n?s.delete(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}}function Xl(){var t,e,n,r,i,o=Rl(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=Ml(t,Yl,Wl).visitAfter(f);for(r=n,i=0;i=s)){(t.data!==e||t.next)&&(0===f&&(d+=(f=Il(n))*f),0===h&&(d+=(h=Il(n))*h),d1?r[0]+r.slice(2):r,+t.slice(n+1)]}function nf(t){return(t=ef(Math.abs(t)))?t[1]:NaN}var rf,of=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function af(t){if(!(e=of.exec(t)))throw new Error("invalid format: "+t);var e;return new sf({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 sf(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 uf(t,e){var n=ef(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")}af.prototype=sf.prototype,sf.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 cf={"%":(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)=>uf(100*t,e),r:uf,s:function(t,e){var n=ef(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(rf=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")+ef(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function lf(t){return t}var ff,hf,pf,df=Array.prototype.map,mf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yf(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?lf:(e=df.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=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+"",s=void 0===t.numerals?lf:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(df.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=af(t)).fill,n=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,m=t.comma,y=t.precision,v=t.trim,g=t.type;"n"===g?(m=!0,g="g"):cf[g]||(void 0===y&&(y=12),v=!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)?u:"",w=cf[g],x=/[defgprs%]/.test(g);function k(t){var i,o,u,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),y),v&&(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:c:"-"===f||"("===f?"":f)+h,k=("s"===g?mf[8+rf/3]:"")+k+(E&&"("===f?")":""),x)for(i=-1,o=t.length;++i(u=t.charCodeAt(i))||u>57){k=(46===u?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}m&&!p&&(t=r(t,1/0));var O=h.length+t.length+k.length,S=O>1)+h+t+k+S.slice(O);break;default:t=S+h+t+k}return s(t)}return y=void 0===y?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=af(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(nf(e)/3))),i=Math.pow(10,-r),o=mf[8+r/3];return function(t){return n(i*t)+o}}}}function vf(t){return ff=yf(t),hf=ff.format,pf=ff.formatPrefix,ff}function gf(t){return Math.max(0,-nf(Math.abs(t)))}function bf(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(nf(e)/3)))-nf(Math.abs(t)))}function _f(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,nf(e)-nf(t))+1}vf({thousands:",",grouping:[3],currency:["$",""]});var wf=1e-6,xf=1e-12,kf=Math.PI,Ef=kf/2,Of=kf/4,Sf=2*kf,Tf=180/kf,Af=kf/180,Nf=Math.abs,Lf=Math.atan,Mf=Math.atan2,Cf=Math.cos,jf=Math.ceil,Pf=Math.exp,Rf=(Math.floor,Math.hypot),If=Math.log,Df=Math.pow,Bf=Math.sin,Ff=Math.sign||function(t){return t>0?1:t<0?-1:0},$f=Math.sqrt,Kf=Math.tan;function Uf(t){return t>1?0:t<-1?kf:Math.acos(t)}function zf(t){return t>1?Ef:t<-1?-Ef:Math.asin(t)}function qf(t){return(t=Bf(t/2))*t}function Vf(){}function Yf(t,e){t&&Hf.hasOwnProperty(t.type)&&Hf[t.type](t,e)}var Wf={Feature:function(t,e){Yf(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=Cf(e=(e*=Af)/2+Of),a=Bf(e),s=nh*a,u=eh*o+s*Cf(i),c=s*r*Bf(i);dh.add(Mf(c,u)),th=t,eh=o,nh=a}function wh(t){return mh=new xt,Xf(t,yh),2*mh}function xh(t){return[Mf(t[1],t[0]),zf(t[2])]}function kh(t){var e=t[0],n=t[1],r=Cf(n);return[r*Cf(e),r*Bf(e),Bf(n)]}function Eh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Oh(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 Sh(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Th(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ah(t){var e=$f(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Nh,Lh,Mh,Ch,jh,Ph,Rh,Ih,Dh,Bh,Fh,$h,Kh,Uh,zh,qh,Vh={point:Yh,lineStart:Hh,lineEnd:Gh,polygonStart:function(){Vh.point=Jh,Vh.lineStart=Xh,Vh.lineEnd=Qh,fh=new xt,yh.polygonStart()},polygonEnd:function(){yh.polygonEnd(),Vh.point=Yh,Vh.lineStart=Hh,Vh.lineEnd=Gh,dh<0?(rh=-(oh=180),ih=-(ah=90)):fh>wf?ah=90:fh<-wf&&(ih=-90),ph[0]=rh,ph[1]=oh},sphere:function(){rh=-(oh=180),ih=-(ah=90)}};function Yh(t,e){hh.push(ph=[rh=t,oh=t]),eah&&(ah=e)}function Wh(t,e){var n=kh([t*Af,e*Af]);if(lh){var r=Oh(lh,n),i=Oh([r[1],-r[0],0],r);Ah(i),i=xh(i);var o,a=t-sh,s=a>0?1:-1,u=i[0]*Tf*s,c=Nf(a)>180;c^(s*shah&&(ah=o):c^(s*sh<(u=(u+360)%360-180)&&uah&&(ah=e)),c?tZh(rh,oh)&&(oh=t):Zh(t,oh)>Zh(rh,oh)&&(rh=t):oh>=rh?(toh&&(oh=t)):t>sh?Zh(rh,t)>Zh(rh,oh)&&(oh=t):Zh(t,oh)>Zh(rh,oh)&&(rh=t)}else hh.push(ph=[rh=t,oh=t]);eah&&(ah=e),lh=n,sh=t}function Hh(){Vh.point=Wh}function Gh(){ph[0]=rh,ph[1]=oh,Vh.point=Yh,lh=null}function Jh(t,e){if(lh){var n=t-sh;fh.add(Nf(n)>180?n+(n>0?360:-360):n)}else uh=t,ch=e;yh.point(t,e),Wh(t,e)}function Xh(){yh.lineStart()}function Qh(){Jh(uh,ch),yh.lineEnd(),Nf(fh)>wf&&(rh=-(oh=180)),ph[0]=rh,ph[1]=oh,lh=null}function Zh(t,e){return(e-=t)<0?e+360:e}function tp(t,e){return t[0]-e[0]}function ep(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eZh(r[0],r[1])&&(r[1]=i[1]),Zh(i[0],r[1])>Zh(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],(s=Zh(r[1],i[0]))>a&&(a=s,rh=i[0],oh=r[1])}return hh=ph=null,rh===1/0||ih===1/0?[[NaN,NaN],[NaN,NaN]]:[[rh,ih],[oh,ah]]}var rp={sphere:Vf,point:ip,lineStart:ap,lineEnd:cp,polygonStart:function(){rp.lineStart=lp,rp.lineEnd=fp},polygonEnd:function(){rp.lineStart=ap,rp.lineEnd=cp}};function ip(t,e){t*=Af;var n=Cf(e*=Af);op(n*Cf(t),n*Bf(t),Bf(e))}function op(t,e,n){++Nh,Mh+=(t-Mh)/Nh,Ch+=(e-Ch)/Nh,jh+=(n-jh)/Nh}function ap(){rp.point=sp}function sp(t,e){t*=Af;var n=Cf(e*=Af);Uh=n*Cf(t),zh=n*Bf(t),qh=Bf(e),rp.point=up,op(Uh,zh,qh)}function up(t,e){t*=Af;var n=Cf(e*=Af),r=n*Cf(t),i=n*Bf(t),o=Bf(e),a=Mf($f((a=zh*o-qh*i)*a+(a=qh*r-Uh*o)*a+(a=Uh*i-zh*r)*a),Uh*r+zh*i+qh*o);Lh+=a,Ph+=a*(Uh+(Uh=r)),Rh+=a*(zh+(zh=i)),Ih+=a*(qh+(qh=o)),op(Uh,zh,qh)}function cp(){rp.point=ip}function lp(){rp.point=hp}function fp(){pp($h,Kh),rp.point=ip}function hp(t,e){$h=t,Kh=e,t*=Af,e*=Af,rp.point=pp;var n=Cf(e);Uh=n*Cf(t),zh=n*Bf(t),qh=Bf(e),op(Uh,zh,qh)}function pp(t,e){t*=Af;var n=Cf(e*=Af),r=n*Cf(t),i=n*Bf(t),o=Bf(e),a=zh*o-qh*i,s=qh*r-Uh*o,u=Uh*i-zh*r,c=Rf(a,s,u),l=zf(c),f=c&&-l/c;Dh.add(f*a),Bh.add(f*s),Fh.add(f*u),Lh+=l,Ph+=l*(Uh+(Uh=r)),Rh+=l*(zh+(zh=i)),Ih+=l*(qh+(qh=o)),op(Uh,zh,qh)}function dp(t){Nh=Lh=Mh=Ch=jh=Ph=Rh=Ih=0,Dh=new xt,Bh=new xt,Fh=new xt,Xf(t,rp);var e=+Dh,n=+Bh,r=+Fh,i=Rf(e,n,r);return ikf&&(t-=Math.round(t/Sf)*Sf),[t,e]}function gp(t,e,n){return(t%=Sf)?e||n?yp(_p(t),wp(e,n)):_p(t):e||n?wp(e,n):vp}function bp(t){return function(e,n){return Nf(e+=t)>kf&&(e-=Math.round(e/Sf)*Sf),[e,n]}}function _p(t){var e=bp(t);return e.invert=bp(-t),e}function wp(t,e){var n=Cf(t),r=Bf(t),i=Cf(e),o=Bf(e);function a(t,e){var a=Cf(e),s=Cf(t)*a,u=Bf(t)*a,c=Bf(e),l=c*n+s*r;return[Mf(u*i-l*o,s*n-c*r),zf(l*i+u*o)]}return a.invert=function(t,e){var a=Cf(e),s=Cf(t)*a,u=Bf(t)*a,c=Bf(e),l=c*i-u*o;return[Mf(u*i+c*o,s*n+l*r),zf(l*n-s*r)]},a}function xp(t){function e(e){return(e=t(e[0]*Af,e[1]*Af))[0]*=Tf,e[1]*=Tf,e}return t=gp(t[0]*Af,t[1]*Af,t.length>2?t[2]*Af:0),e.invert=function(e){return(e=t.invert(e[0]*Af,e[1]*Af))[0]*=Tf,e[1]*=Tf,e},e}function kp(t,e,n,r,i,o){if(n){var a=Cf(e),s=Bf(e),u=r*n;null==i?(i=e+r*Sf,o=e-u/2):(i=Ep(a,i),o=Ep(a,o),(r>0?io)&&(i+=r*Sf));for(var c,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 Tp(t,e){return Nf(t[0]-e[0])=0;--o)i.point((l=c[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,p=!p}while(!h.v);i.lineEnd()}}}function Lp(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,S=O*E,T=S>kf,A=y*x;if(u.add(Mf(A*O*Bf(S),v*k+A*Cf(S))),a+=T?E+O*Sf:E,T^d>=n^_>=n){var N=Oh(kh(p),kh(b));Ah(N);var L=Oh(o,N);Ah(L);var M=(T^E>=0?-1:1)*zf(L[2]);(r>M||r===M&&(N[0]||N[1]))&&(s+=T^E>=0?1:-1)}}return(a<-wf||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&u&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Pp))}return h}}function Pp(t){return t.length>1}function Rp(t,e){return((t=t.x)[0]<0?t[1]-Ef-wf:Ef-t[1])-((e=e.x)[0]<0?e[1]-Ef-wf:Ef-e[1])}vp.invert=vp;const Ip=jp((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 s=o>0?kf:-kf,u=Nf(o-n);Nf(u-kf)0?Ef:-Ef),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=kf&&(Nf(n-i)wf?Lf((Bf(e)*(o=Cf(r))*Bf(n)-Bf(r)*(i=Cf(e))*Bf(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Ef,r.point(-kf,i),r.point(0,i),r.point(kf,i),r.point(kf,0),r.point(kf,-i),r.point(0,-i),r.point(-kf,-i),r.point(-kf,0),r.point(-kf,i);else if(Nf(t[0]-e[0])>wf){var o=t[0]0,i=Nf(e)>wf;function o(t,n){return Cf(t)*Cf(n)>e}function a(t,n,r){var i=[1,0,0],o=Oh(kh(t),kh(n)),a=Eh(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var c=e*a/u,l=-e*s/u,f=Oh(i,o),h=Th(i,c);Sh(h,Th(o,l));var p=f,d=Eh(h,p),m=Eh(p,p),y=d*d-m*(Eh(h,h)-1);if(!(y<0)){var v=$f(y),g=Th(p,(-d-v)/m);if(Sh(g,h),g=xh(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-_,O=Nf(E-kf)0^g[1]<(Nf(g[0]-_)kf^(_<=g[0]&&g[0]<=w)){var S=Th(p,(-d+v)/m);return Sh(S,h),[g,xh(S)]}}}function s(e,n){var i=r?t:kf-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return jp(o,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,h){var p,d=[f,h],m=o(f,h),y=r?m?0:s(f,h):m?s(f+(f<0?kf:-kf),h):0;if(!e&&(c=u=m)&&t.lineStart(),m!==u&&(!(p=a(e,d))||Tp(e,p)||Tp(d,p))&&(d[2]=1),m!==u)l=0,m?(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^m){var v;y&n||!(v=a(d,e,!0))||(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!m||e&&Tp(e,d)||t.point(d[0],d[1]),e=d,u=m,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(e,r,i,o){kp(o,t,n,i,e,r)}),r?[0,-t]:[-kf,t-kf])}var Bp,Fp,$p,Kp,Up=1e9,zp=-Up;function qp(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,c){var l=0,f=0;if(null==i||(l=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==f);else c.point(o[0],o[1])}function a(r,i){return Nf(r[0]-t)0?0:3:Nf(r[0]-n)0?2:1:Nf(r[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(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 u,c,l,f,h,p,d,m,y,v,g,b=a,_=Sp(),w={point:x,lineStart:function(){w.point=k,c&&c.push(l=[]),v=!0,y=!1,d=m=NaN},lineEnd:function(){u&&(k(f,h),p&&y&&_.rejoin(),u.push(_.result())),w.point=x,y&&b.lineEnd()},polygonStart:function(){b=_,u=[],c=[],g=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.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=(u=xe(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Np(u,s,e,o,a),a.polygonEnd()),b=a,u=c=l=null}};function x(t,e){i(t,e)&&b.point(t,e)}function k(o,a){var s=i(o,a);if(c&&l.push([o,a]),v)f=o,h=a,p=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&y)b.point(o,a);else{var u=[d=Math.max(zp,Math.min(Up,d)),m=Math.max(zp,Math.min(Up,m))],_=[o=Math.max(zp,Math.min(Up,o)),a=Math.max(zp,Math.min(Up,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],c=0,l=1,f=e[0]-s,h=e[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>c&&(c=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=o-u,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>c&&(c=a)}else if(h>0){if(a0&&(t[0]=s+c*f,t[1]=u+c*h),l<1&&(e[0]=s+l*f,e[1]=u+l*h),!0}}}}}(u,_,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),g=!1):(y||(b.lineStart(),b.point(u[0],u[1])),b.point(_[0],_[1]),s||b.lineEnd(),g=!1)}d=o,m=a,y=s}return w}}function Vp(){var t,e,n,r=0,i=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=qp(r,i,o,a)(e=n)},extent:function(s){return arguments.length?(r=+s[0][0],i=+s[0][1],o=+s[1][0],a=+s[1][1],t=e=null,n):[[r,i],[o,a]]}}}var Yp={sphere:Vf,point:Vf,lineStart:function(){Yp.point=Hp,Yp.lineEnd=Wp},lineEnd:Vf,polygonStart:Vf,polygonEnd:Vf};function Wp(){Yp.point=Yp.lineEnd=Vf}function Hp(t,e){Fp=t*=Af,$p=Bf(e*=Af),Kp=Cf(e),Yp.point=Gp}function Gp(t,e){t*=Af;var n=Bf(e*=Af),r=Cf(e),i=Nf(t-Fp),o=Cf(i),a=r*Bf(i),s=Kp*n-$p*r*o,u=$p*n+Kp*r*o;Bp.add(Mf($f(a*a+s*s),u)),Fp=t,$p=n,Kp=r}function Jp(t){return Bp=new xt,Xf(t,Yp),+Bp}var Xp=[null,null],Qp={type:"LineString",coordinates:Xp};function Zp(t,e){return Xp[0]=t,Xp[1]=e,Jp(Qp)}var td={Feature:function(t,e){return nd(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Zp(t[o],t[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))wf})).map(u)).concat(Se(jf(o/p)*p,i,p).filter((function(t){return Nf(t%m)>wf})).map(c))}return v.lines=function(){return g().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),v.precision(y)):[[r,s],[n,a]]},v.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),v.precision(y)):[[e,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(d=+t[0],m=+t[1],v):[d,m]},v.stepMinor=function(t){return arguments.length?(h=+t[0],p=+t[1],v):[h,p]},v.precision=function(h){return arguments.length?(y=+h,u=cd(o,i,90),c=ld(e,t,y),l=cd(s,a,90),f=ld(r,n,y),v):y},v.extentMajor([[-180,-90+wf],[180,90-wf]]).extentMinor([[-180,-80-wf],[180,80+wf]])}function hd(){return fd()()}function pd(t,e){var n=t[0]*Af,r=t[1]*Af,i=e[0]*Af,o=e[1]*Af,a=Cf(r),s=Bf(r),u=Cf(o),c=Bf(o),l=a*Cf(n),f=a*Bf(n),h=u*Cf(i),p=u*Bf(i),d=2*zf($f(qf(o-r)+a*u*qf(i-n))),m=Bf(d),y=d?function(t){var e=Bf(t*=d)/m,n=Bf(d-t)/m,r=n*l+e*h,i=n*f+e*p,o=n*s+e*c;return[Mf(i,r)*Tf,Mf(o,$f(r*r+i*i))*Tf]}:function(){return[n*Tf,r*Tf]};return y.distance=d,y}const dd=t=>t;var md,yd,vd,gd,bd=new xt,_d=new xt,wd={point:Vf,lineStart:Vf,lineEnd:Vf,polygonStart:function(){wd.lineStart=xd,wd.lineEnd=Od},polygonEnd:function(){wd.lineStart=wd.lineEnd=wd.point=Vf,bd.add(Nf(_d)),_d=new xt},result:function(){var t=bd/2;return bd=new xt,t}};function xd(){wd.point=kd}function kd(t,e){wd.point=Ed,md=vd=t,yd=gd=e}function Ed(t,e){_d.add(gd*t-vd*e),vd=t,gd=e}function Od(){Ed(md,yd)}const Sd=wd;var Td=1/0,Ad=Td,Nd=-Td,Ld=Nd,Md={point:function(t,e){tNd&&(Nd=t),eLd&&(Ld=e)},lineStart:Vf,lineEnd:Vf,polygonStart:Vf,polygonEnd:Vf,result:function(){var t=[[Td,Ad],[Nd,Ld]];return Nd=Ld=-(Ad=Td=1/0),t}};const Cd=Md;var jd,Pd,Rd,Id,Dd=0,Bd=0,Fd=0,$d=0,Kd=0,Ud=0,zd=0,qd=0,Vd=0,Yd={point:Wd,lineStart:Hd,lineEnd:Xd,polygonStart:function(){Yd.lineStart=Qd,Yd.lineEnd=Zd},polygonEnd:function(){Yd.point=Wd,Yd.lineStart=Hd,Yd.lineEnd=Xd},result:function(){var t=Vd?[zd/Vd,qd/Vd]:Ud?[$d/Ud,Kd/Ud]:Fd?[Dd/Fd,Bd/Fd]:[NaN,NaN];return Dd=Bd=Fd=$d=Kd=Ud=zd=qd=Vd=0,t}};function Wd(t,e){Dd+=t,Bd+=e,++Fd}function Hd(){Yd.point=Gd}function Gd(t,e){Yd.point=Jd,Wd(Rd=t,Id=e)}function Jd(t,e){var n=t-Rd,r=e-Id,i=$f(n*n+r*r);$d+=i*(Rd+t)/2,Kd+=i*(Id+e)/2,Ud+=i,Wd(Rd=t,Id=e)}function Xd(){Yd.point=Wd}function Qd(){Yd.point=tm}function Zd(){em(jd,Pd)}function tm(t,e){Yd.point=em,Wd(jd=Rd=t,Pd=Id=e)}function em(t,e){var n=t-Rd,r=e-Id,i=$f(n*n+r*r);$d+=i*(Rd+t)/2,Kd+=i*(Id+e)/2,Ud+=i,zd+=(i=Id*t-Rd*e)*(Rd+t),qd+=i*(Id+e),Vd+=3*i,Wd(Rd=t,Id=e)}const nm=Yd;function rm(t){this._context=t}rm.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,Sf)}},result:Vf};var im,om,am,sm,um,cm=new xt,lm={point:Vf,lineStart:function(){lm.point=fm},lineEnd:function(){im&&hm(om,am),lm.point=Vf},polygonStart:function(){im=!0},polygonEnd:function(){im=null},result:function(){var t=+cm;return cm=new xt,t}};function fm(t,e){lm.point=hm,om=sm=t,am=um=e}function hm(t,e){sm-=t,um-=e,cm.add($f(sm*sm+um*um)),sm=t,um=e}const pm=lm;let dm,mm,ym,vm;class gm{constructor(t){this._append=null==t?bm:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return bm;if(e!==dm){const t=10**e;dm=e,mm=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 gm(i)),a},a.projection(t).digits(i).context(e)}function wm(t){return{stream:xm(t)}}function xm(t){return function(e){var n=new km;for(var r in t)n[r]=t[r];return n.stream=e,n}}function km(){}function Em(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Xf(n,t.stream(Cd)),e(Cd.result()),null!=r&&t.clipExtent(r),t}function Om(t,e,n){return Em(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,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function Sm(t,e,n){return Om(t,[[0,0],e],n)}function Tm(t,e,n){return Em(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 Am(t,e,n){return Em(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)}km.prototype={constructor:km,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 Nm=16,Lm=Cf(30*Af);function Mm(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,c,l,f,h,p,d,m,y){var v=c-r,g=l-i,b=v*v+g*g;if(b>4*e&&m--){var _=a+h,w=s+p,x=u+d,k=$f(_*_+w*w+x*x),E=zf(x/=k),O=Nf(Nf(x)-1)e||Nf((v*N+g*L)/b-.5)>.3||a*h+s*p+u*d2?t[2]%360*Af:0,N()):[y*Tf,v*Tf,g*Tf]},T.angle=function(t){return arguments.length?(b=t%360*Af,N()):b*Tf},T.reflectX=function(t){return arguments.length?(_=t?-1:1,N()):_<0},T.reflectY=function(t){return arguments.length?(w=t?-1:1,N()):w<0},T.precision=function(t){return arguments.length?(a=Mm(s,S=t*t),L()):$f(S)},T.fitExtent=function(t,e){return Om(T,t,e)},T.fitSize=function(t,e){return Sm(T,t,e)},T.fitWidth=function(t,e){return Tm(T,t,e)},T.fitHeight=function(t,e){return Am(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&A,N()}}function Im(t){var e=0,n=kf/3,r=Rm(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Af,n=t[1]*Af):[e*Tf,n*Tf]},i}function Dm(t,e){var n=Bf(t),r=(n+Bf(e))/2;if(Nf(r)=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<-Ef+wf&&(e=-Ef+wf):e>Ef-wf&&(e=Ef-wf);var n=i/Df(Jm(e),r);return[n*Bf(r*t),i-n*Cf(r*t)]}return o.invert=function(t,e){var n=i-e,o=Ff(r)*$f(t*t+n*n),a=Mf(t,Nf(n))*Ff(n);return n*r<0&&(a-=kf*Ff(t)*Ff(n)),[a/r,2*Lf(Df(i/o,1/r))-Ef]},o}function Qm(){return Im(Xm).scale(109.5).parallels([30,30])}function Zm(t,e){return[t,e]}function ty(){return Pm(Zm).scale(152.63)}function ey(t,e){var n=Cf(t),r=t===e?Bf(t):(n-Cf(e))/(e-t),i=n/r+t;if(Nf(r)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function wy(t,e){return t.parent===e.parent?1:2}function xy(t,e){return t+e.x}function ky(t,e){return Math.max(t,e.y)}function Ey(){var t=wy,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(xy,0)/t.length}(n),e.y=function(t){return 1+t.reduce(ky,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=s.x-t(s,u)/2,l=u.x+t(u,s)/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-c)/(l-c)*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 Oy(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 Sy(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Ay)):void 0===e&&(e=Ty);for(var n,r,i,o,a,s=new My(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new My(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Ly)}function Ty(t){return t.children}function Ay(t){return Array.isArray(t)?t[1]:null}function Ny(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Ly(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function My(t){this.data=t,this.depth=this.height=0,this.parent=null}function Cy(t){return null==t?null:jy(t)}function jy(t){if("function"!=typeof t)throw new Error;return t}function Py(){return 0}function Ry(t){return function(){return t}}uy.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*(ry+iy*i+o*(oy+ay*i))-e)/(ry+3*iy*i+o*(7*oy+9*ay*i)))*r)*i*i,!(Nf(n)wf&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},my.invert=Um(zf),vy.invert=Um((function(t){return 2*Lf(t)})),by.invert=function(t,e){return[-e,2*Lf(Pf(t))-Ef]},My.prototype=Sy.prototype={constructor:My,count:function(){return this.eachAfter(Oy)},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],s=[],u=-1;o=a.pop();)if(s.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 Sy(this).eachBefore(Ny)},[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=(Iy*t+Dy)%By)/By}function $y(t){return Ky(t,Fy())}function Ky(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 Vy(t,e){for(var n=0;n1e-6?(T+Math.sqrt(T*T-4*S*A))/(2*S):A/T);return{x:r+x+k*N,y:i+E+O*N,r:N}}function Gy(t,e,n){var r,i,o,a,s=t.x-e.x,u=t.y-e.y,c=s*s+u*u;c?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function Jy(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 Xy(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 Qy(t){this._=t,this.next=null,this.previous=null}function Zy(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,s,u,c,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;Gy(i,r,o=t[2]),r=new Qy(r),i=new Qy(i),o=new Qy(o),r.next=o.previous=i,i.next=r.previous=o,o.next=i.previous=r;t:for(c=3;cfunction(t){let e=(t=`${t}`).length;return yv(t,e-1)&&!yv(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(mv),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(mv(t)),h.push(fv));p=(t,n)=>e[n],d=(t,e)=>n[e]}for(a=0,i=h.length;a=0&&(c=h[t]).data===fv;--t)c.data=null}if(s.parent=cv,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Ly),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=Cy(t),r):e},r.parentId=function(t){return arguments.length?(n=Cy(t),r):n},r.path=function(e){return arguments.length?(t=Cy(e),r):t},r}function mv(t){let e=t.length;if(e<2)return"";for(;--e>1&&!yv(t,e););return t.slice(0,e)}function yv(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function vv(t,e){return t.parent===e.parent?1:2}function gv(t){var e=t.children;return e?e[0]:t.t}function bv(t){var e=t.children;return e?e[e.length-1]:t.t}function _v(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 wv(t,e,n){return t.a.parent===e.parent?t.a:n}function xv(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 kv(){var t=vv,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new xv(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new xv(r[i],i)),n.parent=e;return(a.parent=new xv(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=c===l?1:t(c,l)/2,p=h-c.x,d=e/(l.x+h+p),m=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*m}))}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,s=n,u=o.parent.children[0],c=o.m,l=a.m,f=s.m,h=u.m;s=bv(s),o=gv(o),s&&o;)u=gv(u),(a=bv(a)).a=e,(i=s.z+f-o.z-c+t(s._,o._))>0&&(_v(wv(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=o.m,h+=u.m,l+=a.m;s&&!bv(a)&&(a.t=s,a.m+=f-l),o&&!gv(u)&&(u.t=o,u.m+=c-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 s(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 Ev(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,c=t.value&&(i-n)/t.value;++sh&&(h=s),y=l*l*m,(p=Math.max(h/y,y/f))>d){l-=s;break}d=p}v.push(a={value:l,dice:u1?e:1)},n}(Ov);function Av(){var t=Tv,e=!1,n=1,r=1,i=[0],o=Py,a=Py,s=Py,u=Py,c=Py;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(av),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=s[e];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=u)}for(var f=c[e],h=r/2+f,p=e+1,d=n-1;p>>1;c[m]u-o){var g=r?(i*v+a*y)/r:a;t(e,p,y,i,o,g,u),t(p,n,v,g,o,a,u)}else{var b=r?(o*v+u*y)/r:u;t(e,p,y,i,o,a,b),t(p,n,v,i,b,a,u)}}(0,u,t.value,e,n,r,i)}function Lv(t,e,n,r,i){(1&t.depth?Ev:sv)(t,e,n,r,i)}const Mv=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,c,l,f=-1,h=a.length,p=t.value;++f1?e:1)},n}(Ov);function Cv(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function jv(t,e){var n=Ai(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}function Pv(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Rv(t){return((t=Math.exp(t))+1/t)/2}const Iv=function t(e,n,r){function i(t,i){var o,a,s=t[0],u=t[1],c=t[2],l=i[0],f=i[1],h=i[2],p=l-s,d=f-u,m=p*p+d*d;if(m<1e-12)a=Math.log(h/c)/e,o=function(t){return[s+t*p,u+t*d,c*Math.exp(e*t*a)]};else{var y=Math.sqrt(m),v=(h*h-c*c+r*m)/(2*c*n*y),g=(h*h-c*c-r*m)/(2*h*n*y),b=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(g*g+1)-g);a=(_-b)/e,o=function(t){var r,i=t*a,o=Rv(b),l=c/(n*y)*(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[s+l*p,u+l*d,c*o/Rv(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 Dv(t){return function(e,n){var r=t((e=gi(e)).h,(n=gi(n)).h),i=Ni(e.s,n.s),o=Ni(e.l,n.l),a=Ni(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 Bv=Dv(Ai);var Fv=Dv(Ni);function $v(t,e){var n=Ni((t=Ls(t)).l,(e=Ls(e)).l),r=Ni(t.a,e.a),i=Ni(t.b,e.b),o=Ni(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 Kv(t){return function(e,n){var r=t((e=Bs(e)).h,(n=Bs(n)).h),i=Ni(e.c,n.c),o=Ni(e.l,n.l),a=Ni(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 Uv=Kv(Ai);var zv=Kv(Ni);function qv(t){return function e(n){function r(e,r){var i=t((e=Gs(e)).h,(r=Gs(r)).h),o=Ni(e.s,r.s),a=Ni(e.l,r.l),s=Ni(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=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}const Vv=qv(Ai);var Yv=qv(Ni);function Wv(t,e){void 0===e&&(e=t,t=qi);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n1&&Xv(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function tg(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)c.push(t[r[o[e]][2]]);for(e=+s;es!=c>s&&a<(u-n)*(s-r)/(c-r)+n&&(l=!l),u=n,c=r;return l}function ng(t){for(var e,n,r=-1,i=t.length,o=t[i-1],a=o[0],s=o[1],u=0;++r1);return t+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(rg),sg=function t(e){var n=ag.source(e);function r(){var t=n.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(rg),ug=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}(rg),cg=function t(e){var n=ug.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}(rg),lg=function t(e){function n(t){return function(){return-Math.log1p(-e())/t}}return n.source=t,n}(rg),fg=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}(rg),hg=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}(rg),pg=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}(rg),dg=function t(e){var n=ag.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(),s=1+o*t}while(s<=0);s*=s*s;var u=1-e()}while(u>=1-.0331*t*t*t*t&&Math.log(u)>=.5*t*t+i*(1-s+Math.log(s)));return i*s*a()*r}}return r.source=t,r}(rg),mg=function t(e){var n=dg.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}(rg),yg=function t(e){var n=pg.source(e),r=mg.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 s=Math.floor((o+1)*a),u=r(s,o-s+1)();u<=a?(i+=s,o-=s,a=(a-u)/(1-u)):(o=s-1,a/=u)}for(var c=a<.5,l=n(c?a:1-a),f=l(),h=0;f<=o;++h)f+=l();return i+(c?h:o-h)}}return i.source=t,i}(rg),vg=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}(rg),gg=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}(rg),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}(rg),_g=function t(e){var n=dg.source(e),r=yg.source(e);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),s=n(a)();if(s>o)return i+r(a-1,o/s)();i+=a,o-=s}for(var u=-Math.log1p(-e()),c=0;u<=o;++c)u-=Math.log1p(-e());return i+c}}return i.source=t,i}(rg),wg=1664525,xg=1013904223,kg=1/4294967296;function Eg(t=Math.random()){let e=0|(0<=t&&t<1?t/kg:Math.abs(t));return()=>(e=wg*e+xg|0,kg*(e>>>0))}function Og(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Sg(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 Tg=Symbol("implicit");function Ag(){var t=new Ot,e=[],n=[],r=Tg;function i(i){let o=t.get(i);if(void 0===o){if(r!==Tg)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 Ot;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 Ag(e,n).unknown(r)},Og.apply(i,arguments),i}function Ng(){var t,e,n=Ag().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,u=0,c=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?Dg:Ig,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(c(e)))}return f.invert=function(n){return c(e((o||(o=r(s,a.map(t),Fi)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Cg),l()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),l()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=Pv,l()},f.clamp=function(t){return arguments.length?(c=!!t||Pg,l()):c!==Pg},f.interpolate=function(t){return arguments.length?(u=t,l()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function $g(){return Fg()(Pg,Pg)}function Kg(t,e,n,r){var i,o=re(t,e,n);switch((r=af(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),pf(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=_f(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=gf(o))||(r.precision=i-2*("%"===r.type))}return hf(r)}function Ug(t){var e=t.domain;return t.ticks=function(t){var n=e();return ee(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Kg(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,s=o.length-1,u=o[a],c=o[s],l=10;for(c0;){if((i=ne(u,c,n))===r)return o[a]=u,o[s]=c,e(o);if(i>0)u=Math.floor(u/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function zg(){var t=$g();return t.copy=function(){return Bg(t,zg())},Og.apply(t,arguments),Ug(t)}function qg(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,Cg),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return qg(t).unknown(e)},t=arguments.length?Array.from(t,Cg):[0,1],Ug(n)}function Vg(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-e,n)}function Qg(t){const e=t(Yg,Wg),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?Jg:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=Xg(r),i=Xg(i),t(Hg,Gg)):t(Yg,Wg),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],s=e[e.length-1];const u=s0){for(;f<=h;++f)for(c=1;cs)break;d.push(l)}}else for(;f<=h;++f)for(c=o-1;c>=1;--c)if(l=f>0?c/i(-f):c*i(f),!(ls)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=af(n)).precision||(n.trim=!0),n=hf(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(Vg(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function Zg(){const t=Qg(Fg()).domain([1,10]);return t.copy=()=>Bg(t,Zg()).base(t.base()),Og.apply(t,arguments),t}function tb(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function eb(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nb(t){var e=1,n=t(tb(e),eb(e));return n.constant=function(n){return arguments.length?t(tb(e=+n),eb(e)):e},Ug(n)}function rb(){var t=nb(Fg());return t.copy=function(){return Bg(t,rb()).constant(t.constant())},Og.apply(t,arguments)}function ib(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ob(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ab(t){return t<0?-t*t:t*t}function sb(t){var e=t(Pg,Pg),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(Pg,Pg):.5===n?t(ob,ab):t(ib(n),ib(1/n)):n},Ug(e)}function ub(){var t=sb(Fg());return t.copy=function(){return Bg(t,ub()).exponent(t.exponent())},Og.apply(t,arguments),t}function cb(){return ub.apply(null,arguments).exponent(.5)}function lb(t){return Math.sign(t)*t*t}function fb(){var t,e=$g(),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(lb(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,Cg)).map(lb)),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 fb(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},Og.apply(i,arguments),Ug(i)}function hb(){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 pb().domain([e,n]).range(o).unknown(t)},Og.apply(Ug(a),arguments)}function db(){var t,e=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[ot(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 db().domain(e).range(n).unknown(t)},Og.apply(i,arguments)}const mb=1e3,yb=6e4,vb=36e5,gb=864e5,bb=6048e5,_b=31536e6,wb=new Date,xb=new Date;function kb(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 s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(skb((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)=>(wb.setTime(+e),xb.setTime(+r),t(wb),t(xb),Math.floor(n(wb,xb))),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 Eb=kb((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Eb.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?kb((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Eb:null);const Ob=Eb.range,Sb=kb((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*mb)}),((t,e)=>(e-t)/mb),(t=>t.getUTCSeconds())),Tb=Sb.range,Ab=kb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mb)}),((t,e)=>{t.setTime(+t+e*yb)}),((t,e)=>(e-t)/yb),(t=>t.getMinutes())),Nb=Ab.range,Lb=kb((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*yb)}),((t,e)=>(e-t)/yb),(t=>t.getUTCMinutes())),Mb=Lb.range,Cb=kb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mb-t.getMinutes()*yb)}),((t,e)=>{t.setTime(+t+e*vb)}),((t,e)=>(e-t)/vb),(t=>t.getHours())),jb=Cb.range,Pb=kb((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*vb)}),((t,e)=>(e-t)/vb),(t=>t.getUTCHours())),Rb=Pb.range,Ib=kb((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yb)/gb),(t=>t.getDate()-1)),Db=Ib.range,Bb=kb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/gb),(t=>t.getUTCDate()-1)),Fb=Bb.range,$b=kb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/gb),(t=>Math.floor(t/gb))),Kb=$b.range;function Ub(t){return kb((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())*yb)/bb))}const zb=Ub(0),qb=Ub(1),Vb=Ub(2),Yb=Ub(3),Wb=Ub(4),Hb=Ub(5),Gb=Ub(6),Jb=zb.range,Xb=qb.range,Qb=Vb.range,Zb=Yb.range,t_=Wb.range,e_=Hb.range,n_=Gb.range;function r_(t){return kb((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 i_=r_(0),o_=r_(1),a_=r_(2),s_=r_(3),u_=r_(4),c_=r_(5),l_=r_(6),f_=i_.range,h_=o_.range,p_=a_.range,d_=s_.range,m_=u_.range,y_=c_.range,v_=l_.range,g_=kb((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_=g_.range,__=kb((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())),w_=__.range,x_=kb((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()));x_.every=t=>isFinite(t=Math.floor(t))&&t>0?kb((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 k_=x_.range,E_=kb((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()));E_.every=t=>isFinite(t=Math.floor(t))&&t>0?kb((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 O_=E_.range;function S_(t,e,n,r,i,o){const a=[[Sb,1,mb],[Sb,5,5e3],[Sb,15,15e3],[Sb,30,3e4],[o,1,yb],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,vb],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,gb],[r,2,1728e5],[n,1,bb],[e,1,2592e6],[e,3,7776e6],[t,1,_b]];function s(e,n,r){const i=Math.abs(n-e)/r,o=Q((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(re(e/_b,n/_b,r));if(0===o)return Eb.every(Math.max(re(e,n,r),1));const[s,u]=a[i/a[o-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ex,s:nx,S:xw,u:kw,U:Ew,V:Sw,w:Tw,W:Aw,x:null,X:null,y:Nw,Y:Mw,Z:jw,"%":tx},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Pw,e:Pw,f:Fw,g:Jw,G:Qw,H:Rw,I:Iw,j:Dw,L:Bw,m:$w,M:Kw,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ex,s:nx,S:Uw,u:zw,U:qw,V:Yw,w:Ww,W:Hw,x:null,X:null,y:Gw,Y:Xw,Z:Zw,"%":tx},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=v.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=m.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:iw,e:iw,f:lw,g:tw,G:Z_,H:aw,I:aw,j:ow,L:cw,m:rw,M:sw,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l.get(r[0].toLowerCase()),n+r[0].length):-1},q:nw,Q:hw,s:pw,S:uw,u:G_,U:J_,V:X_,w:H_,W:Q_,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:tw,Y:Z_,Z:ew,"%":fw};function x(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=C_(j_(o.y,0,1))).getUTCDay(),r=i>4||0===i?o_.ceil(r):o_(r),r=Bb.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=M_(j_(o.y,0,1))).getDay(),r=i>4||0===i?qb.ceil(r):qb(r),r=Ib.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?C_(j_(o.y,0,1)).getUTCDay():M_(j_(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,C_(o)):M_(o)}}function E(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=w[i in $_?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 R_,I_,D_,B_,F_,$_={"-":"",_:" ",0:"0"},K_=/^\s*\d+/,U_=/^%/,z_=/[\\^$*+?|[\]().{}]/g;function q_(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function H_(t,e,n){var r=K_.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function G_(t,e,n){var r=K_.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function J_(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function X_(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Q_(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Z_(t,e,n){var r=K_.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function tw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ew(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 nw(t,e,n){var r=K_.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function rw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function iw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ow(t,e,n){var r=K_.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function aw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function sw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function uw(t,e,n){var r=K_.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function cw(t,e,n){var r=K_.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function lw(t,e,n){var r=K_.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fw(t,e,n){var r=U_.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function hw(t,e,n){var r=K_.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function pw(t,e,n){var r=K_.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function dw(t,e){return q_(t.getDate(),e,2)}function mw(t,e){return q_(t.getHours(),e,2)}function yw(t,e){return q_(t.getHours()%12||12,e,2)}function vw(t,e){return q_(1+Ib.count(x_(t),t),e,3)}function gw(t,e){return q_(t.getMilliseconds(),e,3)}function bw(t,e){return gw(t,e)+"000"}function _w(t,e){return q_(t.getMonth()+1,e,2)}function ww(t,e){return q_(t.getMinutes(),e,2)}function xw(t,e){return q_(t.getSeconds(),e,2)}function kw(t){var e=t.getDay();return 0===e?7:e}function Ew(t,e){return q_(zb.count(x_(t)-1,t),e,2)}function Ow(t){var e=t.getDay();return e>=4||0===e?Wb(t):Wb.ceil(t)}function Sw(t,e){return t=Ow(t),q_(Wb.count(x_(t),t)+(4===x_(t).getDay()),e,2)}function Tw(t){return t.getDay()}function Aw(t,e){return q_(qb.count(x_(t)-1,t),e,2)}function Nw(t,e){return q_(t.getFullYear()%100,e,2)}function Lw(t,e){return q_((t=Ow(t)).getFullYear()%100,e,2)}function Mw(t,e){return q_(t.getFullYear()%1e4,e,4)}function Cw(t,e){var n=t.getDay();return q_((t=n>=4||0===n?Wb(t):Wb.ceil(t)).getFullYear()%1e4,e,4)}function jw(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q_(e/60|0,"0",2)+q_(e%60,"0",2)}function Pw(t,e){return q_(t.getUTCDate(),e,2)}function Rw(t,e){return q_(t.getUTCHours(),e,2)}function Iw(t,e){return q_(t.getUTCHours()%12||12,e,2)}function Dw(t,e){return q_(1+Bb.count(E_(t),t),e,3)}function Bw(t,e){return q_(t.getUTCMilliseconds(),e,3)}function Fw(t,e){return Bw(t,e)+"000"}function $w(t,e){return q_(t.getUTCMonth()+1,e,2)}function Kw(t,e){return q_(t.getUTCMinutes(),e,2)}function Uw(t,e){return q_(t.getUTCSeconds(),e,2)}function zw(t){var e=t.getUTCDay();return 0===e?7:e}function qw(t,e){return q_(i_.count(E_(t)-1,t),e,2)}function Vw(t){var e=t.getUTCDay();return e>=4||0===e?u_(t):u_.ceil(t)}function Yw(t,e){return t=Vw(t),q_(u_.count(E_(t),t)+(4===E_(t).getUTCDay()),e,2)}function Ww(t){return t.getUTCDay()}function Hw(t,e){return q_(o_.count(E_(t)-1,t),e,2)}function Gw(t,e){return q_(t.getUTCFullYear()%100,e,2)}function Jw(t,e){return q_((t=Vw(t)).getUTCFullYear()%100,e,2)}function Xw(t,e){return q_(t.getUTCFullYear()%1e4,e,4)}function Qw(t,e){var n=t.getUTCDay();return q_((t=n>=4||0===n?u_(t):u_.ceil(t)).getUTCFullYear()%1e4,e,4)}function Zw(){return"+0000"}function tx(){return"%"}function ex(t){return+t}function nx(t){return Math.floor(+t/1e3)}function rx(t){return R_=P_(t),I_=R_.format,D_=R_.parse,B_=R_.utcFormat,F_=R_.utcParse,R_}function ix(t){return new Date(t)}function ox(t){return t instanceof Date?+t:+new Date(+t)}function ax(t,e,n,r,i,o,a,s,u,c){var l=$g(),f=l.invert,h=l.domain,p=c(".%L"),d=c(":%S"),m=c("%I:%M"),y=c("%I %p"),v=c("%a %d"),g=c("%b %d"),b=c("%B"),_=c("%Y");function w(t){return(u(t)e(r/(t.length-1))))},n.quantiles=function(e){return Array.from({length:e+1},((n,r)=>de(t,r/e)))},n.copy=function(){return yx(e).domain(t)},Sg.apply(n,arguments)}function vx(){var t,e,n,r,i,o,a,s=0,u=.5,c=1,l=1,f=Pg,h=!1;function p(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*tCi(t[t.length-1]);var Ix=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(kx);const Dx=Rx(Ix);var Bx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(kx);const Fx=Rx(Bx);var $x=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(kx);const Kx=Rx($x);var Ux=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(kx);const zx=Rx(Ux);var qx=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(kx);const Vx=Rx(qx);var Yx=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(kx);const Wx=Rx(Yx);var Hx=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(kx);const Gx=Rx(Hx);var Jx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(kx);const Xx=Rx(Jx);var Qx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(kx);const Zx=Rx(Qx);var tk=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(kx);const ek=Rx(tk);var nk=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(kx);const rk=Rx(nk);var ik=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(kx);const ok=Rx(ik);var ak=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(kx);const sk=Rx(ak);var uk=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(kx);const ck=Rx(uk);var lk=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(kx);const fk=Rx(lk);var hk=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(kx);const pk=Rx(hk);var dk=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(kx);const mk=Rx(dk);var yk=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(kx);const vk=Rx(yk);var gk=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(kx);const bk=Rx(gk);var _k=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(kx);const wk=Rx(_k);var xk=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(kx);const kk=Rx(xk);var Ek=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(kx);const Ok=Rx(Ek);var Sk=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(kx);const Tk=Rx(Sk);var Ak=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(kx);const Nk=Rx(Ak);var Lk=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(kx);const Mk=Rx(Lk);var Ck=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(kx);const jk=Rx(Ck);var Pk=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(kx);const Rk=Rx(Pk);function Ik(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 Dk=Yv(Gs(300,.5,0),Gs(-240,.5,1));var Bk=Yv(Gs(-100,.75,.35),Gs(80,1.5,.8)),Fk=Yv(Gs(260,.75,.35),Gs(80,1.5,.8)),$k=Gs();function Kk(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return $k.h=360*t-100,$k.s=1.5-1.5*e,$k.l=.8-.9*e,$k+""}var Uk=ci(),zk=Math.PI/3,qk=2*Math.PI/3;function Vk(t){var e;return t=(.5-t)*Math.PI,Uk.r=255*(e=Math.sin(t))*e,Uk.g=255*(e=Math.sin(t+zk))*e,Uk.b=255*(e=Math.sin(t+qk))*e,Uk+""}function Yk(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 Wk(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Hk=Wk(kx("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Gk=Wk(kx("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Jk=Wk(kx("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Xk=Wk(kx("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Qk(t){return Pr(_r(t).call(document.documentElement))}var Zk=0;function tE(){return new eE}function eE(){this._="@"+(++Zk).toString(36)}function nE(t,e){return t.target&&(t=Vi(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>Yi(t,e)))}function rE(t){return"string"==typeof t?new Mr([document.querySelectorAll(t)],[document.documentElement]):new Mr([kn(t)],Lr)}function iE(t){return function(){return t}}eE.prototype=tE.prototype={constructor:eE,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 oE=Math.abs,aE=Math.atan2,sE=Math.cos,uE=Math.max,cE=Math.min,lE=Math.sin,fE=Math.sqrt,hE=1e-12,pE=Math.PI,dE=pE/2,mE=2*pE;function yE(t){return t>=1?dE:t<=-1?-dE:Math.asin(t)}function vE(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 is(e)}function gE(t){return t.innerRadius}function bE(t){return t.outerRadius}function _E(t){return t.startAngle}function wE(t){return t.endAngle}function xE(t){return t&&t.padAngle}function kE(t,e,n,r,i,o,a){var s=t-n,u=e-r,c=(a?o:-o)/fE(s*s+u*u),l=c*u,f=-c*s,h=t+l,p=e+f,d=n+l,m=r+f,y=(h+d)/2,v=(p+m)/2,g=d-h,b=m-p,_=g*g+b*b,w=i-o,x=h*m-d*p,k=(b<0?-1:1)*fE(uE(0,w*w*_-x*x)),E=(x*b-g*k)/_,O=(-x*g-b*k)/_,S=(x*b+g*k)/_,T=(-x*g+b*k)/_,A=E-y,N=O-v,L=S-y,M=T-v;return A*A+N*N>L*L+M*M&&(E=S,O=T),{cx:E,cy:O,x01:-l,y01:-f,x11:E*(i/w-1),y11:O*(i/w-1)}}function EE(){var t=gE,e=bE,n=iE(0),r=null,i=_E,o=wE,a=xE,s=null,u=vE(c);function c(){var c,l,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-dE,m=o.apply(this,arguments)-dE,y=oE(m-d),v=m>d;if(s||(s=c=u()),phE)if(y>mE-hE)s.moveTo(p*sE(d),p*lE(d)),s.arc(0,0,p,d,m,!v),h>hE&&(s.moveTo(h*sE(m),h*lE(m)),s.arc(0,0,h,m,d,v));else{var g,b,_=d,w=m,x=d,k=m,E=y,O=y,S=a.apply(this,arguments)/2,T=S>hE&&(r?+r.apply(this,arguments):fE(h*h+p*p)),A=cE(oE(p-h)/2,+n.apply(this,arguments)),N=A,L=A;if(T>hE){var M=yE(T/h*lE(S)),C=yE(T/p*lE(S));(E-=2*M)>hE?(x+=M*=v?1:-1,k-=M):(E=0,x=k=(d+m)/2),(O-=2*C)>hE?(_+=C*=v?1:-1,w-=C):(O=0,_=w=(d+m)/2)}var j=p*sE(_),P=p*lE(_),R=h*sE(k),I=h*lE(k);if(A>hE){var D,B=p*sE(w),F=p*lE(w),$=h*sE(x),K=h*lE(x);if(y1?0:f<-1?pE:Math.acos(f))/2),W=fE(D[0]*D[0]+D[1]*D[1]);N=cE(A,(h-W)/(Y-1)),L=cE(A,(p-W)/(Y+1))}else N=L=0}O>hE?L>hE?(g=kE($,K,j,P,p,L,v),b=kE(B,F,R,I,p,L,v),s.moveTo(g.cx+g.x01,g.cy+g.y01),LhE&&E>hE?N>hE?(g=kE(R,I,B,F,h,-N,v),b=kE(j,P,$,K,h,-N,v),s.lineTo(g.cx+g.x01,g.cy+g.y01),N=f;--h)s.point(v[h],g[h]);s.lineEnd(),s.areaEnd()}y&&(v[l]=+t(p,l,c),g[l]=+e(p,l,c),s.point(r?+r(p,l,c):v[l],n?+n(p,l,c):g[l]))}if(d)return s=null,d+""||null}function l(){return ME().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?NE:iE(+t),e="function"==typeof e?e:iE(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?LE:iE(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:iE(+e),r=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:iE(+e),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:iE(+t),c):r},c.y=function(t){return arguments.length?(e="function"==typeof t?t:iE(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:iE(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:iE(+t),c):n},c.lineX0=c.lineY0=function(){return l().x(t).y(e)},c.lineY1=function(){return l().x(t).y(n)},c.lineX1=function(){return l().x(r).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:iE(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),c):o},c}function jE(t,e){return et?1:e>=t?0:NaN}function PE(t){return t}function RE(){var t=PE,e=jE,n=null,r=iE(0),i=iE(mE),o=iE(0);function a(a){var s,u,c,l,f,h=(a=SE(a)).length,p=0,d=new Array(h),m=new Array(h),y=+r.apply(this,arguments),v=Math.min(mE,Math.max(-mE,i.apply(this,arguments)-y)),g=Math.min(Math.abs(v)/h,o.apply(this,arguments)),b=g*(v<0?-1:1);for(s=0;s0&&(p+=f);for(null!=e?d.sort((function(t,n){return e(m[t],m[n])})):null!=n&&d.sort((function(t,e){return n(a[t],a[e])})),s=0,c=p?(v-h*b)/p:0;s0?f*c:0)+b,m[u]={data:a[u],index:s,value:f,startAngle:y,endAngle:l,padAngle:g};return m}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:iE(+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:iE(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:iE(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:iE(+t),a):o},a}TE.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 IE=BE(AE);function DE(t){this._curve=t}function BE(t){function e(e){return new DE(t(e))}return e._curve=t,e}function FE(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(BE(t)):e()._curve},t}function $E(){return FE(ME().curve(IE))}function KE(){var t=CE().curve(IE),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 FE(n())},delete t.lineX0,t.lineEndAngle=function(){return FE(r())},delete t.lineX1,t.lineInnerRadius=function(){return FE(i())},delete t.lineY0,t.lineOuterRadius=function(){return FE(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(BE(t)):e()._curve},t}function UE(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}DE.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 zE{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 qE{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=UE(this._x0,this._y0),r=UE(this._x0,this._y0=(this._y0+e)/2),i=UE(t,this._y0),o=UE(t,e);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...i,...o)}this._x0=t,this._y0=e}}function VE(t){return new zE(t,!0)}function YE(t){return new zE(t,!1)}function WE(t){return new qE(t)}function HE(t){return t.source}function GE(t){return t.target}function JE(t){let e=HE,n=GE,r=NE,i=LE,o=null,a=null,s=vE(u);function u(){let u;const c=OE.call(arguments),l=e.apply(this,c),f=n.apply(this,c);if(null==o&&(a=t(u=s())),a.lineStart(),c[0]=l,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),u)return a=null,u+""||null}return u.source=function(t){return arguments.length?(e=t,u):e},u.target=function(t){return arguments.length?(n=t,u):n},u.x=function(t){return arguments.length?(r="function"==typeof t?t:iE(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:iE(+t),u):i},u.context=function(e){return arguments.length?(null==e?o=a=null:a=t(o=e),u):o},u}function XE(){return JE(VE)}function QE(){return JE(YE)}function ZE(){const t=JE(WE);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const tO=fE(3),eO={draw(t,e){const n=.59436*fE(e+cE(e/28,.75)),r=n/2,i=r*tO;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},nO={draw(t,e){const n=fE(e/pE);t.moveTo(n,0),t.arc(0,0,n,0,mE)}},rO={draw(t,e){const n=fE(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()}},iO=fE(1/3),oO=2*iO,aO={draw(t,e){const n=fE(e/oO),r=n*iO;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},sO={draw(t,e){const n=.62625*fE(e);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},uO={draw(t,e){const n=.87559*fE(e-cE(e/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},cO={draw(t,e){const n=fE(e),r=-n/2;t.rect(r,r,n,n)}},lO={draw(t,e){const n=.4431*fE(e);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},fO=lE(pE/10)/lE(7*pE/10),hO=lE(mE/10)*fO,pO=-sE(mE/10)*fO,dO={draw(t,e){const n=fE(.8908130915292852*e),r=hO*n,i=pO*n;t.moveTo(0,-n),t.lineTo(r,i);for(let e=1;e<5;++e){const o=mE*e/5,a=sE(o),s=lE(o);t.lineTo(s*n,-a*n),t.lineTo(a*r-s*i,s*r+a*i)}t.closePath()}},mO=fE(3),yO={draw(t,e){const n=-fE(e/(3*mO));t.moveTo(0,2*n),t.lineTo(-mO*n,-n),t.lineTo(mO*n,-n),t.closePath()}},vO=fE(3),gO={draw(t,e){const n=.6824*fE(e),r=n/2,i=n*vO/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},bO=-.5,_O=fE(3)/2,wO=1/fE(12),xO=3*(wO/2+1),kO={draw(t,e){const n=fE(e/xO),r=n/2,i=n*wO,o=r,a=n*wO+n,s=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,u),t.lineTo(bO*r-_O*i,_O*r+bO*i),t.lineTo(bO*o-_O*a,_O*o+bO*a),t.lineTo(bO*s-_O*u,_O*s+bO*u),t.lineTo(bO*r+_O*i,bO*i-_O*r),t.lineTo(bO*o+_O*a,bO*a-_O*o),t.lineTo(bO*s+_O*u,bO*u-_O*s),t.closePath()}},EO={draw(t,e){const n=.6189*fE(e-cE(e/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},OO=[nO,rO,aO,cO,dO,yO,kO],SO=[nO,uO,EO,gO,eO,lO,sO];function TO(t,e){let n=null,r=vE(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:iE(t||nO),e="function"==typeof e?e:iE(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:iE(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:iE(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function AO(){}function NO(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 LO(t){this._context=t}function MO(t){return new LO(t)}function CO(t){this._context=t}function jO(t){return new CO(t)}function PO(t){this._context=t}function RO(t){return new PO(t)}function IO(t,e){this._basis=new LO(t),this._beta=e}LO.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:NO(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:NO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},CO.prototype={areaStart:AO,areaEnd:AO,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:NO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},PO.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:NO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},IO.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,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const DO=function t(e){function n(t){return 1===e?new LO(t):new IO(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function BO(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 FO(t,e){this._context=t,this._k=(1-e)/6}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._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:BO(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:BO(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 $O=function t(e){function n(t){return new FO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function KO(t,e){this._context=t,this._k=(1-e)/6}KO.prototype={areaStart:AO,areaEnd:AO,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:BO(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 KO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function zO(t,e){this._context=t,this._k=(1-e)/6}zO.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:BO(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 qO=function t(e){function n(t){return new zO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function VO(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>hE){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>hE){var c=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*c+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}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(){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:VO(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 WO=function t(e){function n(t){return e?new YO(t,e):new FO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function HO(t,e){this._context=t,this._alpha=e}HO.prototype={areaStart:AO,areaEnd:AO,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:VO(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 GO=function t(e){function n(t){return e?new HO(t,e):new KO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function JO(t,e){this._context=t,this._alpha=e}JO.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:VO(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 XO=function t(e){function n(t){return e?new JO(t,e):new zO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function QO(t){this._context=t}function ZO(t){return new QO(t)}function tS(t){return t<0?-1:1}function eS(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),s=(o*i+a*r)/(r+i);return(tS(o)+tS(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function nS(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function rS(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function iS(t){this._context=t}function oS(t){this._context=new aS(t)}function aS(t){this._context=t}function sS(t){return new iS(t)}function uS(t){return new oS(t)}function cS(t){this._context=t}function lS(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]],s=a.length;o=0;)n[e]=e;return n}function gS(t,e){return t[e]}function bS(t){const e=[];return e.key=t,e}function _S(){var t=iE([]),e=vS,n=yS,r=gS;function i(i){var o,a,s=Array.from(t.apply(this,arguments),bS),u=s.length,c=-1;for(const t of i)for(o=0,++c;o0){for(var n,r,i,o=0,a=t[0].length;o0)for(var n,r,i,o,a,s,u=0,c=t[e[0]].length;u0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)}function kS(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 TS(t){var e=t.map(AS);return vS(t).sort((function(t,n){return e[t]-e[n]}))}function AS(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 CS="%Y-%m-%dT%H:%M:%S.%LZ",jS=Date.prototype.toISOString?function(t){return t.toISOString()}:B_(CS);const PS=jS;var RS=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:F_(CS);const IS=RS;function DS(t,e,n){var r=new ao,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?io():+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 BS=t=>()=>t;function FS(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 $S(t,e,n){this.k=t,this.x=e,this.y=n}$S.prototype={constructor:$S,scale:function(t){return 1===t?this:new $S(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new $S(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 KS=new $S(1,0,0);function US(t){for(;!t.__zoom;)if(!(t=t.parentNode))return KS;return t.__zoom}function zS(t){t.stopImmediatePropagation()}function qS(t){t.preventDefault(),t.stopImmediatePropagation()}function VS(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function YS(){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 WS(){return this.__zoom||KS}function HS(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function GS(){return navigator.maxTouchPoints||"ontouchstart"in this}function JS(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 XS(){var t,e,n,r=VS,i=YS,o=JS,a=HS,s=GS,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,f=Iv,h=_n("start","zoom","end"),p=500,d=150,m=0,y=10;function v(t){t.property("__zoom",WS).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",S).filter(s).on("touchstart.zoom",T).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new $S(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 $S(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),s=i.apply(t,o),u=null==n?_(s):"function"==typeof n?n.apply(t,o):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,o):e,p=f(l.invert(u).concat(c/l.k),h.invert(u).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=p(t),n=c/e[2];t=new $S(n,u[0]-e[0]*n,u[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,s=Math.max(u[0],Math.min(u[1],i.k*Math.pow(2,a.apply(this,arguments)))),l=Yi(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===s)return;n.mouse=[l,i.invert(l)],So(this),n.start()}qS(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(g(i,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function O(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=x(this,e,!0).event(t),s=Pr(t.view).on("mousemove.zoom",(function(t){if(qS(t),!a.moved){var e=t.clientX-l,n=t.clientY-f;a.moved=e*e+n*n>m}a.event(t).zoom("mouse",o(b(a.that.__zoom,a.mouse[0]=Yi(t,i),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),$r(t.view,a.moved),qS(t),a.event(t).end()}),!0),u=Yi(t,i),l=t.clientX,f=t.clientY;Fr(t.view),zS(t),a.mouse=[u,this.__zoom.invert(u)],So(this),a.start()}}function S(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=Yi(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),f=o(b(g(n,u),a,s),i.apply(this,e),c);qS(t),l>0?Pr(this).transition().duration(l).call(w,f,a,t):Pr(this).call(v.transform,f,a,t)}}function T(n,...i){if(r.apply(this,arguments)){var o,a,s,u,c=n.touches,l=c.length,f=x(this,i,n.changedTouches.length===l).event(n);for(zS(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,s=n.y,u=n.width,c=n.height;if(i>=r&&i<=r+u&&o>=s&&o<=s+c){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&&function(t,e){for(var n=0;nf?p:f),r.attr("height",d>h?d:h);var m=this.viewport.select(".".concat(e.data.id," .components-background")),y=m.node().getBoundingClientRect();return f=Math.max((a-y.x)/n,e.data.definition.minWidth-e.data.definition.reservedWidth),h=Math.max((s-y.y)/n,e.data.definition.minHeight-e.data.definition.reservedHeight),p=(c-y.x)/n,d=(l-y.y)/n,m.attr("width",p>f?p:f),m.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,s=o.y,u=o.width,c=o.height;r=Math.max(r,a+u+n.definition.margin),i=Math.max(i,s+c+n.definition.margin)})),{x:r,y:i}}}],r&&function(t,e){for(var n=0;nt.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&&function(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,s=t.minHeight,u=t.reservedWidth,c=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,m=this.getPoints(p,i,o);r.length>0;)h||(h=r[0]),0===m.length&&(d=0,p+=1,m=this.getPoints(p,i,o)),m.length>0&&this.canBePlaced(n,h,m[d])&&(h.x=m[d].x,h.y=m[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)>=m.length&&(d=0,p+=1,m=this.getPoints(p,i,o));t.width=Math.max(l+i+u,a),t.height=Math.max(f+i+c,s)}},{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,s=n.x+e.widthr+o,c=n.y+e.heighti+a;return s||u||c||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,s=e;s<=r&&(s!==r||i!==a);)o.push({x:s,y:i}),s+=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,s=e.reservedHeight,u=n,c=0;e.children.forEach((function(t){t.x=u,t.y=n,u=t.x+t.width+r,t.height>c&&(c=t.height)})),e.width=Math.max(u-r+n+a,i),e.height=Math.max(c+2*n+s,o)}},{key:"generateVerticalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,s=e.reservedHeight,u=n,c=0;e.children.forEach((function(t){t.x=n,t.y=u,u=t.y+t.height+r,t.width>c&&(c=t.width)})),e.width=Math.max(c+2*n+a,i),e.height=Math.max(u-r+n+s,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,s=i.reservedWidth,u=i.reservedHeight,c=i.margin,l=Math.max(n+2*c+s,o),f=Math.max(r+2*c+u,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&&function(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){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),N(n),y}},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;N(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function uN(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function cN(t){var e=function(t){if("object"!=eN(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=eN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eN(e)?e:e+""}var lN=function(){return e=function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.pluginData=n,this.componentRenderer=null,this.linkRenderer=null,this.layout=null,this.viewport=null,this.scene=null,this.d3=t,this.actions={deleteAction:null,dragComponent:null,dragScene:null,linkAction:null,menuAction:null,resizeComponent:null,toggleSelection:null,selectionAll:null,deselectionAll:null,zoom:null},this.states={linking:!1,menuOpening:!1,moving:!1,resizing:!1,selection:!1},this.readOnly=!1},n=[{key:"init",value:function(t){var e=arguments.length>1&&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 tN(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 FA(this.pluginData,this.viewport,t)}},{key:"initLinkRenderer",value:function(t){return new zA(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 kA(this.pluginData,this.viewport,this.layout),this.actions.deleteAction=new cT(this.pluginData,this.viewport,this.layout),this.actions.dragScene=new OT(this.pluginData,this.viewport,this.layout),this.actions.menuAction=new KT(this.pluginData,this.viewport,this.layout),this.actions.link=new jT(this.pluginData,this.viewport,this.layout),this.actions.zoom=new MA(this.pluginData,this.viewport,this.layout),this.actions.dragComponent=new vT(this.pluginData,this.viewport,this.layout),this.actions.resizeComponent=new GT(this.pluginData,this.viewport,this.layout),this.actions.toggleSelection=new oA(this.pluginData,this.viewport,this.layout),this.actions.deselectionAll=new pA(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=sN().mark((function e(n){var r,i,o,a,s,u,c;return sN().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,s=t.states.linking,u="scene"===n.subject.datum().data.id,c=!1,!t.readOnly){e.next=10;break}return u&&r&&t.actions.dragScene.finalize(n),e.abrupt("return");case 10:s?c=t.actions.link.finalize(n):r&&u?c=t.actions.dragScene.finalize(n):a?c=t.actions.resizeComponent.finalize(n):r&&!u?c=t.actions.dragComponent.finalize(n):!r&&o?c=t.actions.menuAction.finalize(n):r||u||!i||(c=t.actions.toggleSelection.finalize(n)),c&&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){uN(o,r,i,a,s,"next",t)}function s(t){uN(o,r,i,a,s,"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,s=r.y,u=e/iu;)c*=.9;this.scene.attr("viewBox","".concat(a-15," ").concat(s-15," ").concat(i+a+15," ").concat(o+s+15)),this.pluginData.scene.zoom=c}}},{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(oN({id:"scene",name:"",children:nN(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(),s=a.x,u=a.y;t.drawOption.x=(e.clientX-s-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,t.drawOption.y=(e.clientY-u-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&&function(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 v(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&&function(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 G({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&&function(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,s=e.type,u=e.action,c=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=s||null,this.action=u||null,this.status=c||null,this.data=l||null}));const ON=EN;function SN(t){return SN="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},SN(t)}function TN(t,e,n){return e=NN(e),function(t,e){if(e&&("object"==SN(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,AN()?Reflect.construct(e,n||[],NN(t).constructor):e.apply(t,n))}function AN(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(AN=function(){return!!t})()}function NN(t){return NN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},NN(t)}function LN(t,e){return LN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},LN(t,e)}var MN=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=TN(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&&LN(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}($);const CN=MN;function jN(t){return jN="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},jN(t)}function PN(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}},m=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===(s=d.definitions)||void 0===s?void 0:s.components)||[],links:(null===(u=d.definitions)||void 0===u?void 0:u.links)||[]},this.parseLogs=d.parseLogs||[],this.__eventIndex=0,this.eventManager=m,this.eventLogs=[],this.configuration=e,this.resources={icons:IN({},null===(c=d.resources)||void 0===c?void 0:c.icons),markers:IN({},null===(l=d.resources)||void 0===l?void 0:l.markers),links:IN({},null===(f=d.resources)||void 0===f?void 0:f.links),models:IN({},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.28.0"}},{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 O({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 PN(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 PN(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)?PN(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 $({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 CN({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 ON(IN(IN({},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:IN({},e)}),r}}],e&&function(t,e){for(var n=0;n0&&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=zN({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=zN({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 WN=YN;function HN(t){return HN="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},HN(t)}function GN(t){var e=function(t){if("object"!=HN(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=HN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==HN(e)?e:e+""}var JN=function(){return t=function t(){var e=arguments.length>0&&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 WN,this.data=e.pluginData||new $N(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new fN(this.data),this.__metadata=e.pluginMetadata||new mN(this.data),this.__parser=e.pluginParser||new bN(this.data),this.__renderer=e.pluginRenderer||new kN(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,s=document.querySelector("#".concat(t)).getBoundingClientRect(),u=s.left,c=s.top;return{x:(n-u-a.x)/o,y:(r-c-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&&function(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 ZN=QN;function tL(t){return tL="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},tL(t)}function eL(t,e,n){return e=rL(e),function(t,e){if(e&&("object"==tL(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,nL()?Reflect.construct(e,n||[],rL(t).constructor):e.apply(t,n))}function nL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nL=function(){return!!t})()}function rL(t){return rL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rL(t)}function iL(t,e){return iL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},iL(t,e)}var oL=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=eL(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&&iL(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const aL=oL})();var o=e;for(var a in i)o[a]=i[a];i.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()},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 s(t,e){return i.hasOwnProperty.call(t,e)}function u(t){return o[t]}function c(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,c.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 s=new Error(t).stack;o=function(){return s}}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,c).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:h,NodeList:f,Value:l,Literal:p,Symbol:d,Group:m,Array:y,Pair:v,Dict:g,Output:K,Capture:U,TemplateData:z,If:_,IfAsync:w,InlineIf:x,For:k,AsyncEach:E,AsyncAll:O,Macro:S,Caller:T,Import:A,FromImport:N,FunCall:L,Filter:M,FilterAsync:C,KeywordArgs:j,Block:P,Super:R,Extends:I,Include:D,Set:B,Switch:F,Case:$,LookupVal:b,BinOp:V,In:Y,Is:W,Or:H,And:G,Not:J,Add:X,Concat:Q,Sub:Z,Mul:tt,Div:et,FloorDiv:nt,Mod:rt,Pow:it,Neg:ot,Pos:at,Compare:st,CompareOperand:ut,CallExtension:ct,CallExtensionAsync:lt,printNodes:function t(e,n){if(n=n||0,ft(e.typename+": ",n),e instanceof f)ft("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ct)ft(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?ft(JSON.stringify(i,null,2)+"\n",null,!0):ft("\n"),r.forEach((function(e){var r=e[0],i=e[1];ft("["+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),s=n(0).TemplateError,u=n(2).Frame,c=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 s(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 u=this._tmpid();this._emitLine(", "+this._makeCallback(u)),this._emitLine(this.buffer+" += runtime.suppressValue("+u+", "+s+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+s+" && 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 s=n._tmpid();n._emitLine("var "+s+" = "+o+"["+r+"]["+a+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+a+"]);"),e.set(t.name.children[a].value,s)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var s=t.name.children,u=s[0],c=s[1],l=this._tmpid(),f=this._tmpid();e.set(u.value,l),e.set(c.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("'+u.value+'", '+l+");"),this._emitLine('frame.set("'+c.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(),s=this._tmpid(),u=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+s+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof a.Array){var c=t.name.children.length;this._emit("runtime."+u+"("+s+", "+c+", 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."+u+"("+s+", 1, function("+l+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+l+'", '+l+");"),e.set(l,l)}this._emitLoopBindings(t,s,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 (!"+s+".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(),s=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 c,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+'"'}));c=s?e.push(!0):new u,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+l.join(", ")+") {","var callerFrame = frame;","frame = "+(s?"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+");"),c.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,c),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,c)})),this._emitLine("frame = "+(s?"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),s=n?"true":"false",u=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+s+", "+o+", "+u+", "+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,s=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 "+s+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,s),e.parent?n._emitLine('frame.set("'+o+'", '+s+");"):n._emitLine('context.setVariable("'+o+'", '+s+");")}))},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 u,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 u;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}(c);t.exports={compile:function(t,e,n,r,a){void 0===a&&(a={});var s=new f(r,a.throwOnUndefined),u=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return s.compile(o.transform(i.parse(u,n,a),e,r)),s.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),s=n(0),u=n(5),c=n(18),l=n(10),f=l.FileSystemLoader,h=l.WebLoader,p=l.PrecompiledLoader,d=n(20),m=n(21),y=n(1),v=y.Obj,g=y.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))}}}},O=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=s.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=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],s._entries(c).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),s._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=s.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,u=this,c=null;if(t&&t.raw&&(t=t.raw),s.isFunction(n)&&(i=n,n=null,e=e||!1),s.isFunction(e)&&(i=e,e=!1),t instanceof T)c=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 s=this.parsePrimary();if("_"===s.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",s.lineno,s.colno),this.skipSymbol("as")){var u=this.parsePrimary();r.addChild(new o.Pair(s.lineno,s.colno,s,u))}else r.addChild(s);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},u.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},u.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},u.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},u.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},u.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},u.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 s,u=this.peekToken(),c=[];do{this.skipSymbol(n);var l=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);c.push(new o.Case(u.line,u.col,l,f)),u=this.peekToken()}while(u&&u.value===n);switch(u.value){case r:this.advanceAfterBlockEnd(),s=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,c,s)},u.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==s.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 u=a[0],c=a[1],l=a[2];l===t?r+=1:l===e&&(r-=1),0===r?(i+=c,this.tokens.backN(u.length-c.length)):i+=u}return new o.Output(s.lineno,s.colno,[new o.TemplateData(s.lineno,s.colno,i)])},u.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},u.parseExpression=function(){return this.parseInlineIf()},u.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},u.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},u.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},u.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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},u.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)},u.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)},u.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},u.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},u.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])},u.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 s=this.parseExpression();t.addChild(s)}}return t},u.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),s=!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(s&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var u=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?a.addChild(new o.Pair(u.lineno,u.colno,u,this.parseExpression())):r.addChild(u)}s=!0}return a.children.length&&r.addChild(a),r},u.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],D=M+this.current();switch(-1!==r.indexOf(I,D)&&(this.forward(),M=D,-1!==r.indexOf(I,D+this.current())&&(M=D+this.current(),this.forward())),M){case"(":R=d;break;case")":R=m;break;case"[":R=y;break;case"]":R=v;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 L(R,M,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return L(O,t+"."+B,e,n)}return L("int",t,e,n)}if(t.match(/^(true|false)$/))return L(S,t,e,n);if("none"===t)return L(T,t,e,n);if("null"===t)return L(T,t,e,n);if(t)return L(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=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,L(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,L(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var U=t.slice(-this.colno);if(/^\s+$/.test(U)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return L(K?p:u,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 u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}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 s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,l=y(u,c);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},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.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 s(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,a=r.repeat(" ",n/2-n%2),s=r.repeat(" ",n/2);return i.copySafeness(t,a+t+s)},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"),s=r.repeat(" ",e),u=a.map((function(t,e){return 0!==e||n?""+s+t:t})).join("\n");return i.copySafeness(t,u)},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=u,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=c(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=c(!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 s=t.indexOf(e);if(0===r||-1===s)return t;for(var u=0,c=0;s>-1&&(-1===r||c=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})),s=r.getAttrGetter(i);return a.sort((function(t,a){var u=i?s(t):t,c=i?s(a):a;if(o.env.opts.throwOnUndefined&&i&&(void 0===u||void 0===c))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(u)&&r.isString(c)&&(u=u.toLowerCase(),c=c.toLowerCase()),uc?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 s(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 s=t.lastIndexOf(" ",e);-1===s&&(s=e),t=t.substring(0,s)}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\./,m=/\.(?: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+"":m.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 y=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=y,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),s=n(7).Environment,u=n(24);function c(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 s([]),r=e.wrapper||u;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 s([])).asyncFilters,u=n.extensionsList;e=e.replace(/\\/g,"/");try{r=a.compile(t,i,u,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 s([]),o=e.wrapper||u;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 s=i.join(o,a),u=s.substr(i.join(t,"/").length),l=r.statSync(s);l&&l.isDirectory()?c(u+="/",e.exclude)||n(s):c(u,e.include)&&p.push(s)}))}(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{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,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,{default:()=>oi});var t=n(149);const e={generic:JSON.parse('{"workflow":{"type":"workflow","category":"workflow","model":"workflow","icon":"DefaultWorkflow","displayName":"Workflow","description":"A workflow is a configurable automated process that will run one or more jobs.

Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows","childrenTypes":["push-trigger","pullrequest-trigger","job"],"categories":["GithubAction"],"isContainer":true,"available":true,"attributes":[{"name":"name","type":"String","required":true,"description":"The name of the workflow as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows#understanding-the-workflow-file"}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":12,"reservedHeight":80,"margin":15,"gap":50},"trigger":{"type":"trigger","category":"trigger","model":"trigger","icon":"DefaultTrigger","available":false,"parentTypes":["workflow"],"categories":["GithubAction"],"attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":0,"reservedHeight":0,"margin":15,"gap":50},"job":{"type":"job","category":"job","model":"job","displayName":"Job","description":"A workflow run is made up of one or more jobs, which run in parallel by default.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow","icon":"DefaultJob","available":true,"parentTypes":["workflow"],"childrenTypes":["command-step","reusable-step"],"categories":["GithubAction"],"isContainer":true,"displayType":"workflow","workflowDirection":"horizontal","linkModel":"defaultLink","attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true},{"name":"name","type":"String","description":"The name of the job as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"runs-on","type":"String","displayName":"Type of runner","description":"The type of machine to run the job on.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on"},{"name":"needs","displayName":"Previous job(s)","description":"Identify any jobs that must complete successfully before this job will run","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#defining-prerequisite-jobs","type":"Link","linkType":"Reverse","linkRef":"job","linkModel":"defaultLink"}],"defaultWidth":96,"defaultHeight":80,"minWidth":140,"minHeight":200,"reservedWidth":12,"reservedHeight":80,"margin":15,"gap":50},"step":{"type":"step","category":"step","model":"step","icon":"DefaultStep","available":false,"parentTypes":["job"],"categories":["GithubAction"],"description":"Task of the job. Step can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsteps","attributes":[{"name":"job_id","displayName":"Id of job","type":"Reference","containerRef":"job","required":true},{"name":"name","type":"String","description":"The name of the step as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"env","type":"Object","displayName":"Environment variables","description":"Variables for steps to use in the runner environment.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv"}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":0,"reservedHeight":0,"margin":15,"gap":50}}'),trigger:JSON.parse('[{"type":"push-trigger","category":"trigger","icon":"PushTrigger","displayName":"Trigger - push","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push","action":"push","attributes":[{"name":"branches","type":"Array","description":"Select branch name on push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs"}]},{"type":"pullrequest-trigger","category":"trigger","icon":"PullRequestTrigger","displayName":"Trigger - pull request","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a pull request event.","action":"pull_request","attributes":[{"name":"types","type":"Array","displayName":"Activity types","description":"Run your workflow when an activity on a pull request occurs in the workflow\'s repository.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request"}]}]'),step:JSON.parse('[{"type":"command-step","category":"step","displayName":"Command step","icon":"CommandStep","name":"command-step","attributes":[{"name":"run","type":"String","required":true}]},{"type":"reusable-step","category":"step","displayName":"Reusable step","icon":"ReusableStep","name":"reusable-step","attributes":[{"name":"uses","type":"String","required":true,"displayName":"External action","description":"Select an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses"},{"name":"with","type":"Object","displayName":"Input parameters","description":"Input parameters of the action defined by \\"uses\\" keyword.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith"}]}]')};function i(t){return i="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},i(t)}function o(t,e,n){return e=s(e),function(t,e){if(e&&("object"==i(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,a()?Reflect.construct(e,n||[],s(t).constructor):e.apply(t,n))}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(a=function(){return!!t})()}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}const c=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{available:!1,category:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=o(this,e,[n])).available=!!n.available,t.category=n.category||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&&u(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.ComponentDefinition);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){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 h(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{action:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=m(this,e,[h(h({},n),{},{category:"trigger"})])).action=n.action||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&&g(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(c);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){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 x(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n!!t&&"object"==typeof t&&t[z]===D,V=t=>!!t&&"object"==typeof t&&t[z]===B,Y=t=>!!t&&"object"==typeof t&&t[z]===F,W=t=>!!t&&"object"==typeof t&&t[z]===$,H=t=>!!t&&"object"==typeof t&&t[z]===K,G=t=>!!t&&"object"==typeof t&&t[z]===U;function J(t){if(t&&"object"==typeof t)switch(t[z]){case F:case U:return!0}return!1}function X(t){if(t&&"object"==typeof t)switch(t[z]){case D:case F:case K:case U:return!0}return!1}const Q=t=>(H(t)||J(t))&&!!t.anchor,Z=Symbol("break visit"),tt=Symbol("skip children"),et=Symbol("remove node");function nt(t,e){const n=at(e);V(t)?rt(null,t.contents,n,Object.freeze([t]))===et&&(t.contents=null):rt(null,t,n,Object.freeze([]))}function rt(t,e,n,r){const i=st(t,e,n,r);if(X(i)||W(i))return ut(t,r,i),rt(t,i,n,r);if("symbol"!=typeof i)if(J(e)){r=Object.freeze(r.concat(e));for(let t=0;t"!==t[t.length-1]&&e("Verbatim tags must end with a >"),n)}const[,n,r]=t.match(/^(.*!)([^!]*)$/s);r||e(`The ${t} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(t){return e(String(t)),null}return"!"===n?t:(e(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[e,n]of Object.entries(this.tags))if(t.startsWith(n))return e+t.substring(n.length).replace(/[!,[\]{}]/g,(t=>ct[t]));return"!"===t[0]?t:`!<${t}>`}toString(t){const e=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(t&&n.length>0&&X(t.contents)){const e={};nt(t.contents,((t,n)=>{X(n)&&n.tag&&(e[n.tag]=!0)})),r=Object.keys(e)}else r=[];for(const[i,o]of n)"!!"===i&&"tag:yaml.org,2002:"===o||t&&!r.some((t=>t.startsWith(o)))||e.push(`%TAG ${i} ${o}`);return e.join("\n")}}function ft(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const e=JSON.stringify(t);throw new Error(`Anchor must not contain whitespace or control characters: ${e}`)}return!0}function ht(t){const e=new Set;return nt(t,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function pt(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function dt(t,e,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let e=0,n=r.length;emt(t,String(e),n)));if(t&&"function"==typeof t.toJSON){if(!n||!Q(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=t=>{r.res=t,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof t||n?.keep?t:Number(t)}lt.defaultYaml={explicit:!1,version:"1.2"},lt.defaultTags={"!!":"tag:yaml.org,2002:"};class yt{constructor(t){Object.defineProperty(this,z,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:e,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!V(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:!0===e,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},a=mt(this,"",o);if("function"==typeof r)for(const{count:t,res:e}of o.anchors.values())r(e,t);return"function"==typeof i?dt(i,{"":a},"",a):a}}class vt extends yt{constructor(t){super(D),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let e;return nt(t,{Node:(t,n)=>{if(n===this)return nt.BREAK;n.anchor===this.source&&(e=n)}}),e}toJSON(t,e){if(!e)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=e,o=this.resolve(r);if(!o){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(t)}let a=n.get(o);if(a||(mt(o,null,e),a=n.get(o)),!a||void 0===a.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=gt(r,o,n)),a.count*a.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return a.res}toString(t,e,n){const r=`*${this.source}`;if(t){if(ft(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(t)}if(t.implicitKey)return`${r} `}return r}}function gt(t,e,n){if(q(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(J(e)){let r=0;for(const i of e.items){const e=gt(t,i,n);e>r&&(r=e)}return r}if(W(e)){const r=gt(t,e.key,n),i=gt(t,e.value,n);return Math.max(r,i)}return 1}const bt=t=>!t||"function"!=typeof t&&"object"!=typeof t;class _t extends yt{constructor(t){super(K),this.value=t}toJSON(t,e){return e?.keep?this.value:mt(this.value,t,e)}toString(){return String(this.value)}}_t.BLOCK_FOLDED="BLOCK_FOLDED",_t.BLOCK_LITERAL="BLOCK_LITERAL",_t.PLAIN="PLAIN",_t.QUOTE_DOUBLE="QUOTE_DOUBLE",_t.QUOTE_SINGLE="QUOTE_SINGLE";const wt="tag:yaml.org,2002:";function xt(t,e,n){if(V(t)&&(t=t.contents),X(t))return t;if(W(t)){const e=n.schema[F].createNode?.(n.schema,null,n);return e.items.push(t),e}(t instanceof String||t instanceof Number||t instanceof Boolean||"undefined"!=typeof BigInt&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:a,sourceObjects:s}=n;let u;if(r&&t&&"object"==typeof t){if(u=s.get(t),u)return u.anchor||(u.anchor=i(t)),new vt(u.anchor);u={anchor:null,node:null},s.set(t,u)}e?.startsWith("!!")&&(e=wt+e.slice(2));let c=function(t,e,n){if(e){const t=n.filter((t=>t.tag===e)),r=t.find((t=>!t.format))??t[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find((e=>e.identify?.(t)&&!e.format))}(t,e,a.tags);if(!c){if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),!t||"object"!=typeof t){const e=new _t(t);return u&&(u.node=e),e}c=t instanceof Map?a[F]:Symbol.iterator in Object(t)?a[U]:a[F]}o&&(o(c),delete n.onTagObj);const l=c?.createNode?c.createNode(n.schema,t,n):"function"==typeof c?.nodeClass?.from?c.nodeClass.from(n.schema,t,n):new _t(t);return e?l.tag=e:c.default||(l.tag=c.tag),u&&(u.node=l),l}function kt(t,e,n){let r=n;for(let t=e.length-1;t>=0;--t){const n=e[t];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const t=[];t[n]=r,r=t}else r=new Map([[n,r]])}return xt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Et=t=>null==t||"object"==typeof t&&!!t[Symbol.iterator]().next().done;class Ot extends yt{constructor(t,e){super(t),Object.defineProperty(this,"schema",{value:e,configurable:!0,enumerable:!1,writable:!0})}clone(t){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(e.schema=t),e.items=e.items.map((e=>X(e)||W(e)?e.clone(t):e)),this.range&&(e.range=this.range.slice()),e}addIn(t,e){if(Et(t))this.add(e);else{const[n,...r]=t,i=this.get(n,!0);if(J(i))i.addIn(r,e);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,kt(this.schema,r,e))}}}deleteIn(t){const[e,...n]=t;if(0===n.length)return this.delete(e);const r=this.get(e,!0);if(J(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn(t,e){const[n,...r]=t,i=this.get(n,!0);return 0===r.length?!e&&H(i)?i.value:i:J(i)?i.getIn(r,e):void 0}hasAllNullValues(t){return this.items.every((e=>{if(!W(e))return!1;const n=e.value;return null==n||t&&H(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn(t){const[e,...n]=t;if(0===n.length)return this.has(e);const r=this.get(e,!0);return!!J(r)&&r.hasIn(n)}setIn(t,e){const[n,...r]=t;if(0===r.length)this.set(n,e);else{const t=this.get(n,!0);if(J(t))t.setIn(r,e);else{if(void 0!==t||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,kt(this.schema,r,e))}}}}const St=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Tt(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const At=(t,e,n)=>t.endsWith("\n")?Tt(n,e):n.includes("\n")?"\n"+Tt(n,e):(t.endsWith(" ")?"":" ")+n,Nt="flow",Lt="block",Mt="quoted";function Ct(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:a,onOverflow:s}={}){if(!i||i<0)return t;ii-Math.max(2,o)?c.push(0):p=i-r);let d=!1,m=-1,y=-1,v=-1;n===Lt&&(m=jt(t,m,e.length),-1!==m&&(p=m+u));for(let r;r=t[m+=1];){if(n===Mt&&"\\"===r){switch(y=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}v=m}if("\n"===r)n===Lt&&(m=jt(t,m,e.length)),p=m+e.length+u,f=void 0;else{if(" "===r&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const e=t[m+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(f=m)}if(m>=p)if(f)c.push(f),p=f+u,f=void 0;else if(n===Mt){for(;" "===h||"\t"===h;)h=r,r=t[m+=1],d=!0;const e=m>v+1?m-2:y-1;if(l[e])return t;c.push(e),l[e]=!0,p=e+u,f=void 0}else d=!0}h=r}if(d&&s&&s(),0===c.length)return t;a&&a();let g=t.slice(0,c[0]);for(let r=0;r({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Rt=t=>/^(%|---|\.\.\.)/m.test(t);function It(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Rt(t)?" ":"");let a="",s=0;for(let t=0,e=n[t];e;e=n[++t])if(" "===e&&"\\"===n[t+1]&&"n"===n[t+2]&&(a+=n.slice(s,t)+"\\ ",t+=1,s=t,e="\\"),"\\"===e)switch(n[t+1]){case"u":{a+=n.slice(s,t);const e=n.substr(t+2,4);switch(e){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===e.substr(0,2)?a+="\\x"+e.substr(2):a+=n.substr(t,6)}t+=5,s=t+1}break;case"n":if(r||'"'===n[t+2]||n.lengthr)return!0;if(n=e+1,i-n<=r)return!1}return!0}(n,u,c.length));if(!n)return l?"|\n":">\n";let f,h;for(h=n.length;h>0;--h){const t=n[h-1];if("\n"!==t&&"\t"!==t&&" "!==t)break}let p=n.substring(h);const d=p.indexOf("\n");-1===d?f="-":n===p||d!==p.length-1?(f="+",o&&o()):f="",p&&(n=n.slice(0,-p.length),"\n"===p[p.length-1]&&(p=p.slice(0,-1)),p=p.replace(Ft,`$&${c}`));let m,y=!1,v=-1;for(m=0;m")+(y?c?"2":"1":"")+f;return t&&(b+=" "+s(t.replace(/ ?[\r\n]+/g," ")),i&&i()),l?`${b}\n${c}${g}${n=n.replace(/\n+/g,`$&${c}`)}${p}`:`${b}\n${c}${Ct(`${g}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`)}${p}`,c,Lt,Pt(r,!0))}`}function Kt(t,e,n,r){const{implicitKey:i,inFlow:o}=e,a="string"==typeof t.value?t:Object.assign({},t,{value:String(t.value)});let{type:s}=t;s!==_t.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(s=_t.QUOTE_DOUBLE);const u=t=>{switch(t){case _t.BLOCK_FOLDED:case _t.BLOCK_LITERAL:return i||o?Bt(a.value,e):$t(a,e,n,r);case _t.QUOTE_DOUBLE:return It(a.value,e);case _t.QUOTE_SINGLE:return Dt(a.value,e);case _t.PLAIN:return function(t,e,n,r){const{type:i,value:o}=t,{actualString:a,implicitKey:s,indent:u,indentStep:c,inFlow:l}=e;if(s&&o.includes("\n")||l&&/[[\]{},]/.test(o))return Bt(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return s||l||!o.includes("\n")?Bt(o,e):$t(t,e,n,r);if(!s&&!l&&i!==_t.PLAIN&&o.includes("\n"))return $t(t,e,n,r);if(Rt(o)){if(""===u)return e.forceBlockIndent=!0,$t(t,e,n,r);if(s&&u===c)return Bt(o,e)}const f=o.replace(/\n+/g,`$&\n${u}`);if(a){const t=t=>t.default&&"tag:yaml.org,2002:str"!==t.tag&&t.test?.test(f),{compat:n,tags:r}=e.doc.schema;if(r.some(t)||n?.some(t))return Bt(o,e)}return s?f:Ct(f,u,Nt,Pt(e,!1))}(a,e,n,r);default:return null}};let c=u(s);if(null===c){const{defaultKeyType:t,defaultStringType:n}=e.options,r=i&&t||n;if(c=u(r),null===c)throw new Error(`Unsupported default string type ${r}`)}return c}function Ut(t,e){const n=Object.assign({blockQuote:!0,commentString:St,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function zt(t,e,n,r){if(W(t))return t.toString(e,n,r);if(q(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const o=X(t)?t:e.doc.createNode(t,{onTagObj:t=>i=t});i||(i=function(t,e){if(e.tag){const n=t.filter((t=>t.tag===e.tag));if(n.length>0)return n.find((t=>t.format===e.format))??n[0]}let n,r;if(H(e)){r=e.value;const i=t.filter((t=>t.identify?.(r)));n=i.find((t=>t.format===e.format))??i.find((t=>!t.format))}else r=e,n=t.find((t=>t.nodeClass&&r instanceof t.nodeClass));if(!n)throw new Error(`Tag not resolved for ${r?.constructor?.name??typeof r} value`);return n}(e.doc.schema.tags,o));const a=function(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],o=(H(t)||J(t))&&t.anchor;o&&ft(o)&&(n.add(o),i.push(`&${o}`));const a=t.tag?t.tag:e.default?null:e.tag;return a&&i.push(r.directives.tagString(a)),i.join(" ")}(o,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);const s="function"==typeof i.stringify?i.stringify(o,e,n,r):H(o)?Kt(o,e,n,r):o.toString(e,n,r);return a?H(o)||"{"===s[0]||"["===s[0]?`${a} ${s}`:`${a}\n${e.indent}${s}`:s}function qt(t,e){"debug"!==t&&"warn"!==t||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(e):console.warn(e))}function Vt(t,e,{key:n,value:r}){if(t?.doc.schema.merge&&Yt(n))if(r=q(r)?r.resolve(t.doc):r,G(r))for(const n of r.items)Wt(t,e,n);else if(Array.isArray(r))for(const n of r)Wt(t,e,n);else Wt(t,e,r);else{const i=mt(n,"",t);if(e instanceof Map)e.set(i,mt(r,i,t));else if(e instanceof Set)e.add(i);else{const o=function(t,e,n){if(null===e)return"";if("object"!=typeof e)return String(e);if(X(t)&&n?.doc){const e=Ut(n.doc,{});e.anchors=new Set;for(const t of n.anchors.keys())e.anchors.add(t.anchor);e.inFlow=!0,e.inStringifyKey=!0;const r=t.toString(e);if(!n.mapKeyWarned){let t=JSON.stringify(r);t.length>40&&(t=t.substring(0,36)+'..."'),qt(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}(n,i,t),a=mt(r,o,t);o in e?Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[o]=a}}return e}const Yt=t=>"<<"===t||H(t)&&"<<"===t.value&&(!t.type||t.type===_t.PLAIN);function Wt(t,e,n){const r=t&&q(n)?n.resolve(t.doc):n;if(!Y(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,t,Map);for(const[t,n]of i)e instanceof Map?e.has(t)||e.set(t,n):e instanceof Set?e.add(t):Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0});return e}function Ht(t,e,n){const r=xt(t,void 0,n),i=xt(e,void 0,n);return new Gt(r,i)}class Gt{constructor(t,e=null){Object.defineProperty(this,z,{value:$}),this.key=t,this.value=e}clone(t){let{key:e,value:n}=this;return X(e)&&(e=e.clone(t)),X(n)&&(n=n.clone(t)),new Gt(e,n)}toJSON(t,e){return Vt(e,e?.mapAsMap?new Map:{},this)}toString(t,e,n){return t?.doc?function({key:t,value:e},n,r,i){const{allNullValues:o,doc:a,indent:s,indentStep:u,options:{commentString:c,indentSeq:l,simpleKeys:f}}=n;let h=X(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(J(t)||!X(t)&&"object"==typeof t)throw new Error("With simple keys, collection cannot be used as a key value")}let p=!f&&(!t||h&&null==e&&!n.inFlow||J(t)||(H(t)?t.type===_t.BLOCK_FOLDED||t.type===_t.BLOCK_LITERAL:"object"==typeof t));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:s+u});let d,m,y,v=!1,g=!1,b=zt(t,n,(()=>v=!0),(()=>g=!0));if(!p&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||null==e)return v&&r&&r(),""===b?"?":p?`? ${b}`:b}else if(o&&!f||null==e&&p)return b=`? ${b}`,h&&!v?b+=At(b,n.indent,c(h)):g&&i&&i(),b;v&&(h=null),p?(h&&(b+=At(b,n.indent,c(h))),b=`? ${b}\n${s}:`):(b=`${b}:`,h&&(b+=At(b,n.indent,c(h)))),X(e)?(d=!!e.spaceBefore,m=e.commentBefore,y=e.comment):(d=!1,m=null,y=null,e&&"object"==typeof e&&(e=a.createNode(e))),n.implicitKey=!1,p||h||!H(e)||(n.indentAtStart=b.length+1),g=!1,l||!(u.length>=2)||n.inFlow||p||!G(e)||e.flow||e.tag||e.anchor||(n.indent=n.indent.substring(2));let _=!1;const w=zt(e,n,(()=>_=!0),(()=>g=!0));let x=" ";if(h||d||m)x=d?"\n":"",m&&(x+=`\n${Tt(c(m),n.indent)}`),""!==w||n.inFlow?x+=`\n${n.indent}`:"\n"===x&&(x="\n\n");else if(!p&&J(e)){const t=w[0],r=w.indexOf("\n"),i=-1!==r,o=n.inFlow??e.flow??0===e.items.length;if(i||!o){let e=!1;if(i&&("&"===t||"!"===t)){let n=w.indexOf(" ");"&"===t&&-1!==n&&na=null),(()=>f=!0));a&&(s+=At(s,o,c(a))),f&&a&&(f=!1),h.push(r+s)}let p;if(0===h.length)p=i.start+i.end;else{p=h[0];for(let t=1;to=null));nl||a.includes("\n"))&&(c=!0),f.push(a),l=f.length}const{start:h,end:p}=n;if(0===f.length)return h+p;if(!c){const t=f.reduce(((t,e)=>t+e.length+2),2);c=e.options.lineWidth>0&&t>e.options.lineWidth}if(c){let t=h;for(const e of f)t+=e?`\n${o}${i}${e}`:"\n";return`${t}\n${i}${p}`}return`${h}${a}${f.join(" ")}${a}${p}`}function Zt({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const i=Tt(e(r),t);n.push(i.trimStart())}}function te(t,e){const n=H(e)?e.value:e;for(const r of t)if(W(r)){if(r.key===e||r.key===n)return r;if(H(r.key)&&r.key.value===n)return r}}class ee extends Ot{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(F,t),this.items=[]}static from(t,e,n){const{keepUndefined:r,replacer:i}=n,o=new this(t),a=(t,a)=>{if("function"==typeof i)a=i.call(e,t,a);else if(Array.isArray(i)&&!i.includes(t))return;(void 0!==a||r)&&o.items.push(Ht(t,a,n))};if(e instanceof Map)for(const[t,n]of e)a(t,n);else if(e&&"object"==typeof e)for(const t of Object.keys(e))a(t,e[t]);return"function"==typeof t.sortMapEntries&&o.items.sort(t.sortMapEntries),o}add(t,e){let n;n=W(t)?t:t&&"object"==typeof t&&"key"in t?new Gt(t.key,t.value):new Gt(t,t?.value);const r=te(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${n.key} already set`);H(r.value)&&bt(n.value)?r.value.value=n.value:r.value=n.value}else if(i){const t=this.items.findIndex((t=>i(n,t)<0));-1===t?this.items.push(n):this.items.splice(t,0,n)}else this.items.push(n)}delete(t){const e=te(this.items,t);return!!e&&this.items.splice(this.items.indexOf(e),1).length>0}get(t,e){const n=te(this.items,t),r=n?.value;return(!e&&H(r)?r.value:r)??void 0}has(t){return!!te(this.items,t)}set(t,e){this.add(new Gt(t,e),!0)}toJSON(t,e,n){const r=n?new n:e?.mapAsMap?new Map:{};e?.onCreate&&e.onCreate(r);for(const t of this.items)Vt(e,r,t);return r}toString(t,e,n){if(!t)return JSON.stringify(this);for(const t of this.items)if(!W(t))throw new Error(`Map items must all be pairs; found ${JSON.stringify(t)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Jt(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:e})}}const ne={collection:"map",default:!0,nodeClass:ee,tag:"tag:yaml.org,2002:map",resolve:(t,e)=>(Y(t)||e("Expected a mapping for this tag"),t),createNode:(t,e,n)=>ee.from(t,e,n)};class re extends Ot{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(U,t),this.items=[]}add(t){this.items.push(t)}delete(t){const e=ie(t);return"number"==typeof e&&this.items.splice(e,1).length>0}get(t,e){const n=ie(t);if("number"!=typeof n)return;const r=this.items[n];return!e&&H(r)?r.value:r}has(t){const e=ie(t);return"number"==typeof e&&e=0?e:null}const oe={collection:"seq",default:!0,nodeClass:re,tag:"tag:yaml.org,2002:seq",resolve:(t,e)=>(G(t)||e("Expected a sequence for this tag"),t),createNode:(t,e,n)=>re.from(t,e,n)},ae={identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:(t,e,n,r)=>Kt(t,e=Object.assign({actualString:!0},e),n,r)},se={identify:t=>null==t,createNode:()=>new _t(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _t(null),stringify:({source:t},e)=>"string"==typeof t&&se.test.test(t)?t:e.options.nullStr},ue={identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new _t("t"===t[0]||"T"===t[0]),stringify:({source:t,value:e},n)=>t&&ue.test.test(t)&&e===("t"===t[0]||"T"===t[0])?t:e?n.options.trueStr:n.options.falseStr};function ce({format:t,minFractionDigits:e,tag:n,value:r}){if("bigint"==typeof r)return String(r);const i="number"==typeof r?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=JSON.stringify(r);if(!t&&e&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(o)){let t=o.indexOf(".");t<0&&(t=o.length,o+=".");let n=e-(o.length-t-1);for(;n-- >0;)o+="0"}return o}const le={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ce},fe={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ce(t)}},he={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new _t(parseFloat(t)),n=t.indexOf(".");return-1!==n&&"0"===t[t.length-1]&&(e.minFractionDigits=t.length-n-1),e},stringify:ce},pe=t=>"bigint"==typeof t||Number.isInteger(t),de=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function me(t,e,n){const{value:r}=t;return pe(r)&&r>=0?n+r.toString(e):ce(t)}const ye={identify:t=>pe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>de(t,2,8,n),stringify:t=>me(t,8,"0o")},ve={identify:pe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>de(t,0,10,n),stringify:ce},ge={identify:t=>pe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>de(t,2,16,n),stringify:t=>me(t,16,"0x")},be=[ne,oe,ae,se,ue,ye,ve,ge,le,fe,he];function _e(t){return"bigint"==typeof t||Number.isInteger(t)}const we=({value:t})=>JSON.stringify(t),xe=[ne,oe].concat([{identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:we},{identify:t=>null==t,createNode:()=>new _t(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:we},{identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>"true"===t,stringify:we},{identify:_e,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>_e(t)?t.toString():JSON.stringify(t)},{identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:we}],{default:!0,tag:"",test:/^/,resolve:(t,e)=>(e(`Unresolved plain scalar ${JSON.stringify(t)}`),t)}),ke={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if("function"==typeof Buffer)return Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t1&&e("Each pair must have its own sequence indicator");const t=r.items[0]||new Gt(new _t(null));if(r.commentBefore&&(t.key.commentBefore=t.key.commentBefore?`${r.commentBefore}\n${t.key.commentBefore}`:r.commentBefore),r.comment){const e=t.value??t.key;e.comment=e.comment?`${r.comment}\n${e.comment}`:r.comment}r=t}t.items[n]=W(r)?r:new Gt(r)}}else e("Expected a sequence for this tag");return t}function Oe(t,e,n){const{replacer:r}=n,i=new re(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let t of e){let a,s;if("function"==typeof r&&(t=r.call(e,String(o++),t)),Array.isArray(t)){if(2!==t.length)throw new TypeError(`Expected [key, value] tuple: ${t}`);a=t[0],s=t[1]}else if(t&&t instanceof Object){const e=Object.keys(t);if(1!==e.length)throw new TypeError(`Expected tuple with one key, not ${e.length} keys`);a=e[0],s=t[a]}else a=t;i.items.push(Ht(a,s,n))}return i}const Se={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ee,createNode:Oe};class Te extends re{constructor(){super(),this.add=ee.prototype.add.bind(this),this.delete=ee.prototype.delete.bind(this),this.get=ee.prototype.get.bind(this),this.has=ee.prototype.has.bind(this),this.set=ee.prototype.set.bind(this),this.tag=Te.tag}toJSON(t,e){if(!e)return super.toJSON(t);const n=new Map;e?.onCreate&&e.onCreate(n);for(const t of this.items){let r,i;if(W(t)?(r=mt(t.key,"",e),i=mt(t.value,r,e)):r=mt(t,"",e),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}static from(t,e,n){const r=Oe(t,e,n),i=new this;return i.items=r.items,i}}Te.tag="tag:yaml.org,2002:omap";const Ae={collection:"seq",identify:t=>t instanceof Map,nodeClass:Te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=Ee(t,e),r=[];for(const{key:t}of n.items)H(t)&&(r.includes(t.value)?e(`Ordered maps must not include duplicate keys: ${t.value}`):r.push(t.value));return Object.assign(new Te,n)},createNode:(t,e,n)=>Te.from(t,e,n)};function Ne({value:t,source:e},n){return e&&(t?Le:Me).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Le={identify:t=>!0===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new _t(!0),stringify:Ne},Me={identify:t=>!1===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new _t(!1),stringify:Ne},Ce={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ce},je={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ce(t)}},Pe={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new _t(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(-1!==n){const r=t.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(e.minFractionDigits=r.length)}return e},stringify:ce},Re=t=>"bigint"==typeof t||Number.isInteger(t);function Ie(t,e,n,{intAsBigInt:r}){const i=t[0];if("-"!==i&&"+"!==i||(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`}const e=BigInt(t);return"-"===i?BigInt(-1)*e:e}const o=parseInt(t,n);return"-"===i?-1*o:o}function De(t,e,n){const{value:r}=t;if(Re(r)){const t=r.toString(e);return r<0?"-"+n+t.substr(1):n+t}return ce(t)}const Be={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Ie(t,2,2,n),stringify:t=>De(t,2,"0b")},Fe={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Ie(t,1,8,n),stringify:t=>De(t,8,"0")},$e={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Ie(t,0,10,n),stringify:ce},Ke={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Ie(t,2,16,n),stringify:t=>De(t,16,"0x")};class Ue extends ee{constructor(t){super(t),this.tag=Ue.tag}add(t){let e;e=W(t)?t:t&&"object"==typeof t&&"key"in t&&"value"in t&&null===t.value?new Gt(t.key,null):new Gt(t,null),te(this.items,e.key)||this.items.push(e)}get(t,e){const n=te(this.items,t);return!e&&W(n)?H(n.key)?n.key.value:n.key:n}set(t,e){if("boolean"!=typeof e)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof e);const n=te(this.items,t);n&&!e?this.items.splice(this.items.indexOf(n),1):!n&&e&&this.items.push(new Gt(t))}toJSON(t,e){return super.toJSON(t,e,Set)}toString(t,e,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),e,n);throw new Error("Set items must all have null values")}static from(t,e,n){const{replacer:r}=n,i=new this(t);if(e&&Symbol.iterator in Object(e))for(let t of e)"function"==typeof r&&(t=r.call(e,t,t)),i.items.push(Ht(t,null,n));return i}}Ue.tag="tag:yaml.org,2002:set";const ze={collection:"map",identify:t=>t instanceof Set,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ue.from(t,e,n),resolve(t,e){if(Y(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ue,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function qe(t,e){const n=t[0],r="-"===n||"+"===n?t.substring(1):t,i=t=>e?BigInt(t):Number(t),o=r.replace(/_/g,"").split(":").reduce(((t,e)=>t*i(60)+i(e)),i(0));return"-"===n?i(-1)*o:o}function Ve(t){let{value:e}=t,n=t=>t;if("bigint"==typeof e)n=t=>BigInt(t);else if(isNaN(e)||!isFinite(e))return ce(t);let r="";e<0&&(r="-",e*=n(-1));const i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map((t=>String(t).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const Ye={identify:t=>"bigint"==typeof t||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>qe(t,n),stringify:Ve},We={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>qe(t,!1),stringify:Ve},He={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(He.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,o,a,s]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(n,r-1,i,o||0,a||0,s||0,u);const l=e[8];if(l&&"Z"!==l){let t=qe(l,!1);Math.abs(t)<30&&(t*=60),c-=6e4*t}return new Date(c)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Ge=[ne,oe,ae,se,Le,Me,Be,Fe,$e,Ke,Ce,je,Pe,ke,Ae,Se,ze,Ye,We,He],Je=new Map([["core",be],["failsafe",[ne,oe,ae]],["json",xe],["yaml11",Ge],["yaml-1.1",Ge]]),Xe={binary:ke,bool:ue,float:he,floatExp:fe,floatNaN:le,floatTime:We,int:ve,intHex:ge,intOct:ye,intTime:Ye,map:ne,null:se,omap:Ae,pairs:Se,seq:oe,set:ze,timestamp:He},Qe={"tag:yaml.org,2002:binary":ke,"tag:yaml.org,2002:omap":Ae,"tag:yaml.org,2002:pairs":Se,"tag:yaml.org,2002:set":ze,"tag:yaml.org,2002:timestamp":He};function Ze(t,e){let n=Je.get(e);if(!n){if(!Array.isArray(t)){const t=Array.from(Je.keys()).filter((t=>"yaml11"!==t)).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${t} or define customTags array`)}n=[]}if(Array.isArray(t))for(const e of t)n=n.concat(e);else"function"==typeof t&&(n=t(n.slice()));return n.map((t=>{if("string"!=typeof t)return t;const e=Xe[t];if(e)return e;const n=Object.keys(Xe).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown custom tag "${t}"; use one of ${n}`)}))}const tn=(t,e)=>t.keye.key?1:0;class en{constructor({compat:t,customTags:e,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Ze(t,"compat"):t?Ze(null,t):null,this.merge=!!n,this.name="string"==typeof i&&i||"core",this.knownTags=r?Qe:{},this.tags=Ze(e,this.name),this.toStringOptions=a??null,Object.defineProperty(this,F,{value:ne}),Object.defineProperty(this,K,{value:ae}),Object.defineProperty(this,U,{value:oe}),this.sortMapEntries="function"==typeof o?o:!0===o?tn:null}clone(){const t=Object.create(en.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}class nn{constructor(t,e,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,z,{value:B});let r=null;"function"==typeof e||Array.isArray(e)?r=e:void 0===n&&e&&(n=e,e=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new lt({version:o}),this.setSchema(o,n),this.contents=void 0===t?null:this.createNode(t,r,n)}clone(){const t=Object.create(nn.prototype,{[z]:{value:B}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=X(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){rn(this.contents)&&this.contents.add(t)}addIn(t,e){rn(this.contents)&&this.contents.addIn(t,e)}createAlias(t,e){if(!t.anchor){const n=ht(this);t.anchor=!e||n.has(e)?pt(e||"a",n):e}return new vt(t.anchor)}createNode(t,e,n){let r;if("function"==typeof e)t=e.call({"":t},"",t),r=e;else if(Array.isArray(e)){const t=t=>"number"==typeof t||t instanceof String||t instanceof Number,n=e.filter(t).map(String);n.length>0&&(e=e.concat(n)),r=e}else void 0===n&&e&&(n=e,e=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:s,onTagObj:u,tag:c}=n??{},{onAnchor:l,setAnchors:f,sourceObjects:h}=function(t,e){const n=[],r=new Map;let i=null;return{onAnchor:r=>{n.push(r),i||(i=ht(t));const o=pt(e,i);return i.add(o),o},setAnchors:()=>{for(const t of n){const e=r.get(t);if("object"!=typeof e||!e.anchor||!H(e.node)&&!J(e.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}e.node.anchor=e.anchor}},sourceObjects:r}}(this,o||"a"),p=xt(t,c,{aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:l,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:h});return a&&J(p)&&(p.flow=!0),f(),p}createPair(t,e,n={}){const r=this.createNode(t,null,n),i=this.createNode(e,null,n);return new Gt(r,i)}delete(t){return!!rn(this.contents)&&this.contents.delete(t)}deleteIn(t){return Et(t)?null!=this.contents&&(this.contents=null,!0):!!rn(this.contents)&&this.contents.deleteIn(t)}get(t,e){return J(this.contents)?this.contents.get(t,e):void 0}getIn(t,e){return Et(t)?!e&&H(this.contents)?this.contents.value:this.contents:J(this.contents)?this.contents.getIn(t,e):void 0}has(t){return!!J(this.contents)&&this.contents.has(t)}hasIn(t){return Et(t)?void 0!==this.contents:!!J(this.contents)&&this.contents.hasIn(t)}set(t,e){null==this.contents?this.contents=kt(this.schema,[t],e):rn(this.contents)&&this.contents.set(t,e)}setIn(t,e){Et(t)?this.contents=e:null==this.contents?this.contents=kt(this.schema,Array.from(t),e):rn(this.contents)&&this.contents.setIn(t,e)}setSchema(t,e={}){let n;switch("number"==typeof t&&(t=String(t)),t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new lt({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new lt({version:t}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const e=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${e}`)}}if(e.schema instanceof Object)this.schema=e.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new en(Object.assign(n,e))}}toJS({json:t,jsonArg:e,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},s=mt(this.contents,e??"",a);if("function"==typeof i)for(const{count:t,res:e}of a.anchors.values())i(e,t);return"function"==typeof o?dt(o,{"":s},"",s):s}toJSON(t,e){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:e})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const e=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${e}`)}return function(t,e){const n=[];let r=!0===e.directives;if(!1!==e.directives&&t.directives){const e=t.directives.toString(t);e?(n.push(e),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const i=Ut(t,e),{commentString:o}=i.options;if(t.commentBefore){1!==n.length&&n.unshift("");const e=o(t.commentBefore);n.unshift(Tt(e,""))}let a=!1,s=null;if(t.contents){if(X(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const e=o(t.contents.commentBefore);n.push(Tt(e,""))}i.forceBlockIndent=!!t.comment,s=t.contents.comment}const e=s?void 0:()=>a=!0;let u=zt(t.contents,i,(()=>s=null),e);s&&(u+=At(u,"",o(s))),"|"!==u[0]&&">"!==u[0]||"---"!==n[n.length-1]?n.push(u):n[n.length-1]=`--- ${u}`}else n.push(zt(t.contents,i));if(t.directives?.docEnd)if(t.comment){const e=o(t.comment);e.includes("\n")?(n.push("..."),n.push(Tt(e,""))):n.push(`... ${e}`)}else n.push("...");else{let e=t.comment;e&&a&&(e=e.replace(/^\n+/,"")),e&&(a&&!s||""===n[n.length-1]||n.push(""),n.push(Tt(o(e),"")))}return n.join("\n")+"\n"}(this,t)}}function rn(t){if(J(t))return!0;throw new Error("Expected a YAML collection as document contents")}class on extends Error{constructor(t,e,n,r){super(),this.name=t,this.code=n,this.message=r,this.pos=e}}class an extends on{constructor(t,e,n){super("YAMLParseError",t,e,n)}}class sn extends on{constructor(t,e,n){super("YAMLWarning",t,e,n)}}const un=(t,e)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((t=>e.linePos(t)));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,a=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const t=Math.min(o-39,a.length-79);a="…"+a.substring(t),o-=t-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,o))){let n=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),a=n+a}if(/[^ ]/.test(a)){let t=1;const e=n.linePos[1];e&&e.line===r&&e.col>i&&(t=Math.max(1,Math.min(e.col-i,80-o)));const s=" ".repeat(o)+"^".repeat(t);n.message+=`:\n\n${a}\n${s}\n`}};function cn(t,{flow:e,indicator:n,next:r,offset:i,onError:o,parentIndent:a,startOnNewline:s}){let u=!1,c=s,l=s,f="",h="",p=!1,d=!1,m=null,y=null,v=null,g=null,b=null,_=null,w=null;for(const i of t)switch(d&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),m&&(c&&"comment"!==i.type&&"newline"!==i.type&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":e||"doc-start"===n&&"flow-collection"===r?.type||!i.source.includes("\t")||(m=i),l=!0;break;case"comment":{l||o(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=i.source.substring(1)||" ";f?f+=h+t:f=t,h="",c=!1;break}case"newline":c?f?f+=i.source:u=!0:h+=i.source,c=!0,p=!0,(y||v)&&(g=i),l=!0;break;case"anchor":y&&o(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&o(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=i,null===w&&(w=i.offset),c=!1,l=!1,d=!0;break;case"tag":v&&o(i,"MULTIPLE_TAGS","A node can have at most one tag"),v=i,null===w&&(w=i.offset),c=!1,l=!1,d=!0;break;case n:(y||v)&&o(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),_&&o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${e??"collection"}`),_=i,c="seq-item-ind"===n||"explicit-key-ind"===n,l=!1;break;case"comma":if(e){b&&o(i,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=i,c=!1,l=!1;break}default:o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),c=!1,l=!1}const x=t[t.length-1],k=x?x.offset+x.source.length:i;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=a||"block-map"===r?.type||"block-seq"===r?.type)&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:_,spaceBefore:u,comment:f,hasNewline:p,anchor:y,tag:v,newlineAfterProp:g,end:k,start:w??k}}function ln(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const e of t.items){for(const t of e.start)if("newline"===t.type)return!0;if(e.sep)for(const t of e.sep)if("newline"===t.type)return!0;if(ln(e.key)||ln(e.value))return!0}return!1;default:return!0}}function fn(t,e,n){if("flow-collection"===e?.type){const r=e.end[0];r.indent!==t||"]"!==r.source&&"}"!==r.source||!ln(e)||n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function hn(t,e,n){const{uniqueKeys:r}=t.options;if(!1===r)return!1;const i="function"==typeof r?r:(e,n)=>e===n||H(e)&&H(n)&&e.value===n.value&&!("<<"===e.value&&t.schema.merge);return e.some((t=>i(t.key,n)))}const pn="All mapping items must start at the same column";function dn(t,e,n,r){let i="";if(t){let o=!1,a="";for(const s of t){const{source:t,type:u}=s;switch(u){case"space":o=!0;break;case"comment":{n&&!o&&r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=t.substring(1)||" ";i?i+=a+e:i=e,a="";break}case"newline":i&&(a+=t),o=!0;break;default:r(s,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=t.length}}return{comment:i,offset:e}}const mn="Block collections are not allowed within flow collections",yn=t=>t&&("block-map"===t.type||"block-seq"===t.type);function vn(t,e,n,r,i,o){const a="block-map"===n.type?function({composeNode:t,composeEmptyNode:e},n,r,i,o){const a=new(o?.nodeClass??ee)(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,u=null;for(const o of r.items){const{start:c,key:l,sep:f,value:h}=o,p=cn(c,{indicator:"explicit-key-ind",next:l??f?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),d=!p.found;if(d){if(l&&("block-seq"===l.type?i(s,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in l&&l.indent!==r.indent&&i(s,"BAD_INDENT",pn)),!p.anchor&&!p.tag&&!f){u=p.end,p.comment&&(a.comment?a.comment+="\n"+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||ln(l))&&i(l??c[c.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(s,"BAD_INDENT",pn);const m=p.end,y=l?t(n,l,p,i):e(n,m,c,null,p,i);n.schema.compat&&fn(r.indent,l,i),hn(n,a.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const v=cn(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,parentIndent:r.indent,startOnNewline:!l||"block-scalar"===l.type});if(s=v.end,v.found){d&&("block-map"!==h?.type||v.hasNewline||i(s,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start0){const t=dn(p,d,n.options.strict,i);t.comment&&(u.comment?u.comment+="\n"+t.comment:u.comment=t.comment),u.range=[r.offset,d,t.offset]}else u.range=[r.offset,d,d];return u}(t,e,n,r,o),s=a.constructor;return"!"===i||i===s.tagName?(a.tag=s.tagName,a):(i&&(a.tag=i),a)}function gn(t){let e,n;try{e=new RegExp("(.*?)(?"===i.mode?_t.BLOCK_FOLDED:_t.BLOCK_LITERAL,a=e.source?function(t){const e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let t=1;t=0;--t){const e=a[t][1];if(""!==e&&"\r"!==e)break;s=t}if(0===s){const t="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let n=r+i.length;return e.source&&(n+=e.source.length),{value:t,type:o,comment:i.comment,range:[r,n,n]}}let u=e.indent+i.indent,c=e.offset+i.length,l=0;for(let e=0;eu&&(u=r.length),c+=r.length+o.length+1}for(let t=a.length-1;t>=s;--t)a[t][0].length>u&&(s=t+1);let f="",h="",p=!1;for(let t=0;tu||"\t"===r[0]?(" "===h?h="\n":p||"\n"!==h||(h="\n\n"),f+=h+e.slice(u)+r,h="\n",p=!0):""===r?"\n"===h?f+="\n":h="\n":(f+=h+r,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let t=s;tn(r+t,e,i);switch(i){case"scalar":s=_t.PLAIN,u=function(t,e){let n="";switch(t[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${t[0]}`;break;case"@":case"`":n=`reserved character ${t[0]}`}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),gn(t)}(o,c);break;case"single-quoted-scalar":s=_t.QUOTE_SINGLE,u=function(t,e){return"'"===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR","Missing closing 'quote"),gn(t.slice(1,-1)).replace(/''/g,"'")}(o,c);break;case"double-quoted-scalar":s=_t.QUOTE_DOUBLE,u=function(t,e){let n="";for(let r=1;re?t.slice(e,r+1):i)}else n+=i}return'"'===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}(o,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const l=r+o.length,f=dn(a,l,e,n);return{value:u,type:s,comment:f.comment,range:[r,l,f.offset]}}(e,t.options.strict,r),u=n?t.directives.tagName(n.source,(t=>r(n,"TAG_RESOLVE_FAILED",t))):null,c=n&&u?function(t,e,n,r,i){if("!"===n)return t[K];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===n){if(!e.default||!e.test)return e;o.push(e)}for(const t of o)if(t.test?.test(e))return t;const a=t.knownTags[n];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),t[K])}(t.schema,i,u,n,r):"scalar"===e.type?function({directives:t,schema:e},n,r,i){const o=e.tags.find((t=>t.default&&t.test?.test(n)))||e[K];if(e.compat){const a=e.compat.find((t=>t.default&&t.test?.test(n)))??e[K];o.tag!==a.tag&&i(r,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(a.tag)}`,!0)}return o}(t,i,e,r):t.schema[K];let l;try{const o=c.resolve(i,(t=>r(n??e,"TAG_RESOLVE_FAILED",t)),t.options);l=H(o)?o:new _t(o)}catch(t){const o=t instanceof Error?t.message:String(t);r(n??e,"TAG_RESOLVE_FAILED",o),l=new _t(i)}return l.range=s,l.source=i,o&&(l.type=o),u&&(l.tag=u),c.format&&(l.format=c.format),a&&(l.comment=a),l}function kn(t,e,n){if(e){null===n&&(n=e.length);for(let r=n-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++r];"space"===n?.type;)t+=n.source.length,n=e[++r];break}}return t}const En={composeNode:On,composeEmptyNode:Sn};function On(t,e,n,r){const{spaceBefore:i,comment:o,anchor:a,tag:s}=n;let u,c=!0;switch(e.type){case"alias":u=function({options:t},{offset:e,source:n,end:r},i){const o=new vt(n.substring(1));""===o.source&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=e+n.length,s=dn(r,a,t.strict,i);return o.range=[e,a,s.offset],s.comment&&(o.comment=s.comment),o}(t,e,r),(a||s)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=xn(t,e,s,r),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":u=function(t,e,n,r,i){const o=r.tag,a=o?e.directives.tagName(o.source,(t=>i(o,"TAG_RESOLVE_FAILED",t))):null;if("block-seq"===n.type){const{anchor:t,newlineAfterProp:e}=r,n=t&&o?t.offset>o.offset?t:o:t??o;n&&(!e||e.offsett.tag===a&&t.collection===s));if(!u){const r=e.schema.knownTags[a];if(!r||r.collection!==s)return r?.collection?i(o,"BAD_COLLECTION_TYPE",`${r.tag} used for ${s} collection, but expects ${r.collection}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),vn(t,e,n,i,a);e.schema.tags.push(Object.assign({},r,{default:!1})),u=r}const c=vn(t,e,n,i,a,u),l=u.resolve?.(c,(t=>i(o,"TAG_RESOLVE_FAILED",t)),e.options)??c,f=X(l)?l:new _t(l);return f.range=c.range,f.tag=a,u?.format&&(f.format=u.format),f}(En,t,e,n,r),a&&(u.anchor=a.source.substring(1));break;default:r(e,"UNEXPECTED_TOKEN","error"===e.type?e.message:`Unsupported token (type: ${e.type})`),u=Sn(t,e.offset,void 0,null,n,r),c=!1}return a&&""===u.anchor&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(u.spaceBefore=!0),o&&("scalar"===e.type&&""===e.source?u.comment=o:u.commentBefore=o),t.options.keepSourceTokens&&c&&(u.srcToken=e),u}function Sn(t,e,n,r,{spaceBefore:i,comment:o,anchor:a,tag:s,end:u},c){const l=xn(t,{type:"scalar",offset:kn(e,n,r),indent:-1,source:""},s,c);return a&&(l.anchor=a.source.substring(1),""===l.anchor&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(l.spaceBefore=!0),o&&(l.comment=o,l.range[2]=u),l}function Tn(t){if("number"==typeof t)return[t,t+1];if(Array.isArray(t))return 2===t.length?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+("string"==typeof n?n.length:1)]}function An(t){let e="",n=!1,r=!1;for(let i=0;i{const i=Tn(t);r?this.warnings.push(new sn(i,e,n)):this.errors.push(new an(i,e,n))},this.directives=new lt({version:t.version||"1.2"}),this.options=t}decorate(t,e){const{comment:n,afterEmptyLine:r}=An(this.prelude);if(n){const i=t.contents;if(e)t.comment=t.comment?`${t.comment}\n${n}`:n;else if(r||t.directives.docStart||!i)t.commentBefore=n;else if(J(i)&&!i.flow&&i.items.length>0){let t=i.items[0];W(t)&&(t=t.key);const e=t.commentBefore;t.commentBefore=e?`${n}\n${e}`:n}else{const t=i.commentBefore;i.commentBefore=t?`${n}\n${t}`:n}}e?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:An(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,e=!1,n=-1){for(const e of t)yield*this.next(e);yield*this.end(e,n)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,((e,n,r)=>{const i=Tn(t);i[0]+=e,this.onError(i,"BAD_DIRECTIVE",n,r)})),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const e=function(t,e,{offset:n,start:r,value:i,end:o},a){const s=Object.assign({_directives:e},t),u=new nn(void 0,s),c={atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},l=cn(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});l.found&&(u.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||l.hasNewline||a(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=i?On(c,i,l,a):Sn(c,l.end,r,null,l,a);const f=u.contents.range[2],h=dn(o,f,!1,a);return h.comment&&(u.comment=h.comment),u.range=[n,f,h.offset],u}(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new an(Tn(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new an(Tn(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=dn(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new an(Tn(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,e=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const t=Object.assign({_directives:this.directives},this.options),n=new nn(void 0,t);this.atDirectives&&this.onError(e,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,e,e],this.decorate(n,!1),yield n}}}const Ln=Symbol("break visit"),Mn=Symbol("skip children"),Cn=Symbol("remove item");function jn(t,e){"type"in t&&"document"===t.type&&(t={start:t.start,value:t.value}),Pn(Object.freeze([]),t,e)}function Pn(t,e,n){let r=n(e,t);if("symbol"==typeof r)return r;for(const i of["key","value"]){const o=e[i];if(o&&"items"in o){for(let e=0;e{let n=t;for(const[t,r]of e){const e=n?.[t];if(!e||!("items"in e))return;n=e.items[r]}return n},jn.parentCollection=(t,e)=>{const n=jn.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Rn(t){switch(t){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const In=new Set("0123456789ABCDEFabcdef"),Dn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bn=new Set(",[]{}"),Fn=new Set(" ,[]{}\n\r\t"),$n=t=>!t||Fn.has(t);class Kn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,e=!1){if(t){if("string"!=typeof t)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!e;let n=this.next??"stream";for(;n&&(e||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,e=this.buffer[t];for(;" "===e||"\t"===e;)e=this.buffer[++t];return!e||"#"===e||"\n"===e||"\r"===e&&"\n"===this.buffer[t+1]}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let e=this.buffer[t];if(this.indentNext>0){let n=0;for(;" "===e;)e=this.buffer[++n+t];if("\r"===e){const e=this.buffer[n+t+1];if("\n"===e||!e&&!this.atEnd)return t+n+1}return"\n"===e||n>=this.indentNext||!e&&!this.atEnd?t+n:-1}if("-"===e||"."===e){const e=this.buffer.substr(t,3);if(("---"===e||"..."===e)&&Rn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return("number"!=typeof t||-1!==t&&tthis.indentValue&&!Rn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,e]=this.peek(2);if(!e&&!this.atEnd)return this.setNext("block-start");if(("-"===t||"?"===t||":"===t)&&Rn(e)){const t=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=t,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(null===t)return this.setNext("doc");let e=yield*this.pushIndicators();switch(t[e]){case"#":yield*this.pushCount(t.length-e);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil($n),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return e+=(yield*this.parseBlockScalarHeader()),e+=(yield*this.pushSpaces(!0)),yield*this.pushCount(t.length-e),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,e,n=-1;do{t=yield*this.pushNewline(),t>0?(e=yield*this.pushSpaces(!1),this.indentValue=n=e):e=0,e+=(yield*this.pushSpaces(!0))}while(t+e>0);const r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n"0"&&e<="9")this.blockScalarIndent=Number(e)-1;else if("-"!==e)break}return yield*this.pushUntil((t=>Rn(t)||"#"===t))}*parseBlockScalar(){let t,e=this.pos-1,n=0;t:for(let r=this.pos;t=this.buffer[r];++r)switch(t){case" ":n+=1;break;case"\n":e=r,n=0;break;case"\r":{const t=this.buffer[r+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break t}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const t=this.continueScalar(e+1);if(-1===t)break;e=this.buffer.indexOf("\n",t)}while(-1!==e);if(-1===e){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(t=this.buffer[r];" "===t;)t=this.buffer[++r];if("\t"===t){for(;"\t"===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)for(;;){let t=e-1,r=this.buffer[t];"\r"===r&&(r=this.buffer[--t]);const i=t;for(;" "===r;)r=this.buffer[--t];if(!("\n"===r&&t>=this.pos&&t+1+n>i))break;e=t}return yield"",yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let e,n=this.pos-1,r=this.pos-1;for(;e=this.buffer[++r];)if(":"===e){const e=this.buffer[r+1];if(Rn(e)||t&&Bn.has(e))break;n=r}else if(Rn(e)){let i=this.buffer[r+1];if("\r"===e&&("\n"===i?(r+=1,e="\n",i=this.buffer[r+1]):n=r),"#"===i||t&&Bn.has(i))break;if("\n"===e){const t=this.continueScalar(r+1);if(-1===t)break;r=Math.max(r,t-2)}}else{if(t&&Bn.has(e))break;n=r}return e||this.atEnd?(yield"",yield*this.pushToIndex(n+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,e){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(e&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil($n))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,e=this.charAt(1);if(Rn(e)||t&&Bn.has(e))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let t=this.pos+2,e=this.buffer[t];for(;!Rn(e)&&">"!==e;)e=this.buffer[++t];return yield*this.pushToIndex(">"===e?t+1:t,!1)}{let t=this.pos+1,e=this.buffer[t];for(;e;)if(Dn.has(e))e=this.buffer[++t];else{if("%"!==e||!In.has(this.buffer[t+1])||!In.has(this.buffer[t+2]))break;e=this.buffer[t+=3]}return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return"\n"===t?yield*this.pushCount(1):"\r"===t&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(t){let e,n=this.pos-1;do{e=this.buffer[++n]}while(" "===e||t&&"\t"===e);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let e=this.pos,n=this.buffer[e];for(;!t(n);)n=this.buffer[++e];return yield*this.pushToIndex(e,!1)}}class Un{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let e=0,n=this.lineStarts.length;for(;e>1;this.lineStarts[r]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break t}for(;"space"===t[++e]?.type;);return t.splice(e,t.length)}function Hn(t){if("flow-seq-start"===t.start.type)for(const e of t.items)!e.sep||e.value||zn(e.start,"explicit-key-ind")||zn(e.sep,"map-value-ind")||(e.key&&(e.value=e.key),delete e.key,Vn(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Gn{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Kn,this.onNewLine=t}*parse(t,e=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(t,e))yield*this.next(n);e||(yield*this.end())}*next(t){if(this.source=t,this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=t.length);const e=function(t){switch(t){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}(t);if(e)if("scalar"===e)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=e,yield*this.step(),e){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&" "===t[0]&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const e=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if("doc-end"!==this.type||t&&"doc-end"===t.type){if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(t){return this.stack[this.stack.length-t]}*pop(t){const e=t??this.stack.pop();if(e)if(0===this.stack.length)yield e;else{const t=this.peek(1);switch("block-scalar"===e.type?e.indent="indent"in t?t.indent:0:"flow-collection"===e.type&&"document"===t.type&&(e.indent=0),"flow-collection"===e.type&&Hn(e),t.type){case"document":t.value=e;break;case"block-scalar":t.props.push(e);break;case"block-map":{const n=t.items[t.items.length-1];if(n.value)return t.items.push({start:[],key:e,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:e,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=e;break}case"block-seq":{const n=t.items[t.items.length-1];n.value?t.items.push({start:[],value:e}):n.value=e;break}case"flow-collection":{const n=t.items[t.items.length-1];return void(!n||n.value?t.items.push({start:[],key:e,sep:[]}):n.sep?n.value=e:Object.assign(n,{key:e,sep:[]}))}default:yield*this.pop(),yield*this.pop(e)}if(!("document"!==t.type&&"block-map"!==t.type&&"block-seq"!==t.type||"block-map"!==e.type&&"block-seq"!==e.type)){const n=e.items[e.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===qn(n.start)&&(0===e.indent||n.start.every((t=>"comment"!==t.type||t.indent=t.indent){const n=!this.onKeyLine&&this.indent===t.indent,r=n&&(e.sep||e.explicitKey)&&"seq-item-ind"!==this.type;let i=[];if(r&&e.sep&&!e.value){const n=[];for(let r=0;rt.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=e.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(r||e.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"explicit-key-ind":return e.sep||e.explicitKey?r||e.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(e.start.push(this.sourceToken),e.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(e.explicitKey)if(e.sep)if(e.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(zn(e.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Vn(e.key)&&!zn(e.sep,"newline")){const t=Wn(e.start),n=e.key,r=e.sep;r.push(this.sourceToken),delete e.key,delete e.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:n,sep:r}]})}else i.length>0?e.sep=e.sep.concat(i,this.sourceToken):e.sep.push(this.sourceToken);else if(zn(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{const t=Wn(e.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]})}else e.sep?e.value||r?t.items.push({start:i,key:null,sep:[this.sourceToken]}):zn(e.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(r||e.value?(t.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):e.sep?this.stack.push(n):(Object.assign(e,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const e=this.startBlockValue(t);if(e)return n&&"block-seq"!==e.type&&t.items.push({start:i}),void this.stack.push(e)}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const e=t.items[t.items.length-1];switch(this.type){case"newline":if(e.value){const n="end"in e.value?e.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(e.start,t.indent)){const n=t.items[t.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,e.start),r.push(this.sourceToken),void t.items.pop()}e.start.push(this.sourceToken)}return;case"anchor":case"tag":if(e.value||this.indent<=t.indent)break;return void e.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==t.indent)break;return void(e.value||zn(e.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken))}if(this.indent>t.indent){const e=this.startBlockValue(t);if(e)return void this.stack.push(e)}yield*this.pop(),yield*this.step()}*flowCollection(t){const e=t.items[t.items.length-1];if("flow-error-end"===this.type){let t;do{yield*this.pop(),t=this.peek(1)}while(t&&"flow-collection"===t.type)}else if(0===t.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!e||e.sep?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken));case"map-value-ind":return void(!e||e.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!e||e.value?t.items.push({start:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!e||e.value?t.items.push({start:[],key:n,sep:[]}):e.sep?this.stack.push(n):Object.assign(e,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void t.end.push(this.sourceToken)}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const e=this.peek(2);if("block-map"===e.type&&("map-value-ind"===this.type&&e.indent===t.indent||"newline"===this.type&&!e.items[e.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==e.type){const n=Wn(Yn(e));Hn(t);const r=t.end.splice(1,t.end.length);r.push(this.sourceToken);const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let t=this.source.indexOf("\n")+1;for(;0!==t;)this.onNewLine(this.offset+t),t=this.source.indexOf("\n",t)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const e=Wn(Yn(t));return e.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const e=Wn(Yn(t));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,e){return"comment"===this.type&&!(this.indent<=e)&&t.every((t=>"newline"===t.type||"space"===t.type))}*documentEnd(t){"doc-mode"!==this.type&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function Jn(t,e={}){const{lineCounter:n,prettyErrors:r}=function(t){const e=!1!==t.prettyErrors;return{lineCounter:t.lineCounter||e&&new Un||null,prettyErrors:e}}(e),i=new Gn(n?.addNewLine),o=new Nn(e);let a=null;for(const e of o.compose(i.parse(t),!0,t.length))if(a){if("silent"!==a.options.logLevel){a.errors.push(new an(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else a=e;return r&&n&&(a.errors.forEach(un(t,n)),a.warnings.forEach(un(t,n))),a}class Xn extends on{constructor(t,e,n){super(t,e,"IMPOSSIBLE",n),this.name=t}pretty(t){this.linePos=t.lineCounter.linePos(this.pos);const{line:e,col:n}=this.linePos;this.message+=` at line ${e}, column ${n} ${t.file?" @"+t.file:""}`}}class Qn{constructor(){this.lineCounter=new Un,this.src="",this.txt="",this.errors=[],this.warnings=[],this.yaml_ok=!1,this.contents=null,this.listener=null,this.prog={}}errors(t){this.errors=this.errors.concat(t)}warnings(t){this.warnings=this.warnings.concat(t)}fileError(t){let e=new Xn("FILE_ERROR",0,`FileError : ${t}`);return this.errors.push(e),e}syntaxError(t,e){let n=new Xn("SYNTAX_ERROR",t.range?t.range[0]:0,`SyntaxError : ${e}`);return this.errors.push(n),n}syntaxWarning(t,e){let n=new Xn("SYNTAX_WARNING",t.range?t.range[0]:0,`SyntaxWarning : ${e}`);return this.warnings.push(n),n}typeError(t,e){let n=new Xn("TYPE_ERROR",t.range?t.range[0]:0,`TypeError : ${e}`);return this.errors.push(n),n}grammarError(t){let e=new Xn("GRAMMAR_ERROR",0,`GrammarError : ${t}`);this.errors.push(e)}grammarWarning(t){let e=new Xn("GRAMMAR_WARNING",0,`GrammarWarning : ${t}`);return this.warnings.push(e),e}fails(){return this.errors.length>0}success(){return 0==this.errors.length&&0==this.warnings.length}result(){return this.contents}}class Zn{constructor(t,e,n){this.ctx=t,this.type=e,this.current=n,this.start=n.range[0],this.end=n.range[1],this.childs=[]}getChild(t){return this.childs[t]}getChildCount(){return this.childs.length}getValue(){return this.value}toString(){return this.value}}class tr extends Zn{constructor(t,e,n){super(t,e,n)}equals(t){if(t instanceof tr)return this.value==t.value;this.ctx.syntaxError(this.current,`Error can not compare values '${this.value}' and '${t.value}'`)}}class er extends tr{constructor(t,e){if(super(t,"string",e),!er.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a string`);this.value=e.value}static checkCurrent(t){return H(t)&&"string"==typeof t.value}static parse(t,e){try{return new er(t,e)}catch(t){return null}}}class nr extends tr{constructor(t,e){if(super(t,"binary",e),!nr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a base64 string`);this.value=e.value}static checkCurrent(t){return H(t)&&"string"==typeof t.value&&/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(t.value)}static parse(t,e){try{return new nr(t,e)}catch(t){return null}}}class rr extends tr{constructor(t,e){if(super(t,"int",e),!rr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not an integer`);this.value=e.value}static checkCurrent(t){return H(t)&&"number"==typeof t.value&&t.value==Math.floor(t.value)}static parse(t,e){try{return new rr(t,e)}catch(t){return null}}}class ir extends tr{constructor(t,e){if(super(t,"float",e),!ir.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a number`);this.value=e.value}static checkCurrent(t){return H(t)&&"number"==typeof t.value}static parse(t,e){try{return new ir(t,e)}catch(t){return null}}}class or extends tr{constructor(t,e){if(super(t,"boolean",e),this.value=null,!or.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e.value}' is not a boolean`);this.value=e.value}static checkCurrent(t){return H(t)&&"boolean"==typeof t.value}static parse(t,e){try{return new or(t,e)}catch(t){return null}}}class ar extends tr{constructor(t,e){if(super(t,"null",e),this.value=null,!ar.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not the null value`)}static checkCurrent(t){return H(t)&&(null==t.value||["Null","NULL","null","~"].includes(t.value))}static parse(t,e){try{return new ar(t,e)}catch(t){return null}}}class sr extends tr{constructor(t,e,n){if(super(t,"timestamp",e),!sr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a timestamp in ISO9601 format`);this.value=new Date(e.value)}static checkCurrent(t){let e=H(t)&&"string"==typeof t.value&&/\d{4}-\d{2}-\d{2}|\d{4}-\d{2}?-\d{2}?([Tt]|[ \t]+)\d{2}?:\d{2}:\d{2}(\.\d*)?(([ \t]*)Z|[-+]\d\d?(:\d{2})?)?/.test(t.value);if(1==e)try{new Date(t.value)}catch(t){e=!1}return e}static parse(t,e){try{return new sr(t,e)}catch(t){return null}}equals(t){return t instanceof sr?this.value.getTime()==t.value.getTime():this.ctx.syntaxError("Error : can not compare a timestamp with something else")}}class ur extends Zn{constructor(t,e,n){super(t,e,n)}length(){return this.childs.length}isEmpty(){return 0==this.length()}}class cr extends ur{constructor(t,e,n){if(super(t,"map",e),"object"!=typeof n||n instanceof Array)throw t.syntaxError(e,"Erorr : MapNode must be initialized with a parsed map. This should not happen.");this.value=n;for(const t in n)this.childs.push(n[t])}static checkCurrent(t){return Y(t)&&t.items.every((t=>t.key&&H(t.key)&&"string"==typeof t.key.value))}}class lr{static parse(t,e,n){"object"!=typeof e&&t.grammarError("Error: oneof rule can not be parsed'");let r=e._oneOf;if(r instanceof Array){let e=[].concat(t.errors),i=[].concat(t.warnings),o=t.errors.length;for(let a of r){let r=xr(t,null,a,n);if(o==t.errors.length)return t.errors=e,t.warnings=i,r;o=t.errors.length}return t.syntaxError(n,"Syntax Error : no valid alternative found during parsing"),null}t.grammarError("Error: _oneof rules expects a sequence of alternatives")}}var fr="undefined"!=typeof Symbol;function hr(t){var e=typeof t;return"string"===e||"number"===e||"boolean"===e||!0===fr&&"symbol"===e||null==t||!0===fr&&t instanceof Symbol||t instanceof String||t instanceof Number||t instanceof Boolean}class pr{static parse(t,e){if("object"==typeof e){if(e._oneOf){let n;!e._oneOf instanceof Array&&t.grammarError("Error : _oneof value have to be a list"),e._oneOf=e._oneOf.map((e=>pr.parse(t,e)));do{if(n=e._oneOf.findIndex((t=>t._oneOf)),n>=0){let t=e._oneOf[n]._oneOf;(e={_oneOf:[].concat(e._oneOf)})._oneOf.splice(n,1),e._oneOf=e._oneOf.concat(t)}}while(n>=0);return e}if(e._merge){if(!(e._merge instanceof Array))return t.grammarError("Error : _merge value have to be a map"),null;const{_merge:n,...r}=e;let i;e={_merge:e._merge},Object.keys(r).length&&e._merge.push(r),e._merge=e._merge.map((e=>hr(e)&&t.rules[e]?t.rules[e]:e)),e._merge=e._merge.map((e=>pr.parse(t,e)));do{if(i=e._merge.findIndex((t=>t._merge)),i>=0){let t=e.one._merge;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),e._merge=e._merge.concat(t)}}while(i>=0);let o={_oneOf:[]};do{if(i=(e={_merge:[].concat(e._merge)})._merge.findIndex((t=>t._oneOf)),i>=0){let t=e._merge[i]._oneOf;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),t.forEach((t=>{let n={_merge:[t].concat(e._merge)};o._oneOf.push(n)}))}}while(i>=0);if(o._oneOf.length>=1)return pr.parse(t,o);e._merge.some((t=>t._merge||t._oneOf))&&t.grammarError("Error : merge has not been processed successfully. This error should not occur.");let a={},s={},u=null,c=-1,l=-1,f=-1;e._merge.forEach((e=>{if(e._map){a={...a};for(let n in e._map)a.key&&t.grammarError("Error : can not merge two maps with some identical keys"),a[n]=e._map[n]}if(e._mapFacultative){s={...s};for(let n in e._mapFacultative)s.key&&t.grammarError("Error : can not merge two maps with some identical keys"),s[n]=e._mapFacultative[n]}if(e._mapOf){if(null!=u)return t.grammarError("Error : only one '_mapOf' is allowed in a '_merge' clause"),null;u=e._mapOf}e._nb&&(c<0||c==e._nb?c=e._nb:t.grammarError("Contradictory sizing in merge clause")),e._min&&(l=Math.max(e._min,l)),e._max&&(nax=c>0?Math.min(e._max,f):e._max)}));let h={};return c>=0&&(h._nb=c),l>=0&&(h._min=l),f>=0&&(h._max=f),Object.keys(a).length>0&&(h._map=a),Object.keys(s).length>0&&(h._mapFacultative=s),null!=u&&(h._mapOf=u),h}if(e._map){let n={};for(const r in e._map)n[r]=pr.parse(t,e._map[r]);e._map=n}if(e._mapFacultative){let n={};for(const r in e._mapFacultative)n[r]=pr.parse(t,e._mapFacultative[r]);e._mapFacultative=n}if(e._mapOf){let n={};for(const r in e._mapOf){let i=pr.parse(t,r),o=pr.parse(t,e._mapOf[r]);n[i]=o}e._mapOf=n}e._list&&(e._list=e._list.map((e=>pr.parse(t,e)))),e._listFacultative&&(e._listFacultative=e._listFacultative.map((e=>pr.parse(t,e)))),e._listOf&&(e._listOf=pr.parse(t,e._listOf))}return e}}class dr{static isPositiveInt(t){return"number"==typeof t&&t==Math.floor(t)&&t>0}static sizeChecker(t,e,n,r){if(dr.isPositiveInt(n))if(Y(r)||G(r))switch(e){case"eq":return r.items.length==n;case"min":return r.items.length>=n;case"max":return r.items.length<=n}else t.syntaxError(r,"Error : a map is expected");else t.grammarError(`Error: the map checker '${e}' does not have a positive integer as value`);return!1}static sizeCheckers(t,e,n){return null==e._nb||dr.sizeChecker(t,"eq",e._nb,n)?null==e._min||dr.sizeChecker(t,"min",e._min,n)?!(null!=e._max&&!dr.sizeChecker(t,"max",e._max,n)&&(t.syntaxError(n,`Error : map expected with more than ${e._max} elements but ${n.items.length} are provided`),1)):(t.syntaxError(n,`Error : map expected with more than ${e._min} elements but ${n.items.length} are provided`),!1):(t.syntaxError(n,`Error : map expected with ${e._nb} elements but ${n.items.length} are provided`),!1)}}class mr{static parse(t,e,n){if(!cr.checkCurrent(n))return t.syntaxError(n,"Error : a map whose keys are strings is expected "),null;if(e._merge&&(e=pr.parse(t,e))._oneOf)return lr.parse(t,e,n);let r=e._map,i=e._mapOf,o=e._mapFacultative;if(null!=i&&"object"!=typeof i||null!=o&&"object"!=typeof o)return t.grammarError("Error : error in map value definition"),null;if(!dr.sizeCheckers(t,e,n))return null;if(null!=r)for(let e in r){if("string"!=typeof e)return t.grammarError("Error : error in map definition"),null;if(!n.has(e))return t.syntaxError(n,`Error : key '${e}' not found in current value`),null}let a,s=null;if(i){let t=Object.entries(i);1==t.length&&([[a,s]]=t)}let u={};for(let i of n.items){let n=i.key.value,c=i.value,l=null;if(r&&r[n])l=xr(t,null,r[n],c);else if(o&&o[n])l=xr(t,null,o[n],c);else{if(!a||!s)return t.syntaxError(c,`Error : '${n}' is not a valid key (in rule : ${JSON.stringify(e)})`),null;{let e=xr(t,null,a,i.key);if(l=xr(t,null,s,c),e.value!=n)return t.syntaxError(n,`Error : '${n}' does not match expected '${a}' type`),null}}if(null==l)return t.syntaxError(c,`Error : bad value '${c}'found for '${n}' (mapparser.parse)`),null;let f=new er(t,i.key);if(l.key=f,null!=u[n])return t.syntaxError(c,`Error : more than one value provided in the map for the key '${n}'`),null;u[n]=l}return new cr(t,n,u)}static parse_any(t,e){if(!cr.checkCurrent(e))return t.syntaxError(e,"Error : a map whose keys are strings is expected "),null;let n={};return e.items.forEach((e=>{let r=e.key.value,i=e.value,o=gr.parse_any(t,i);if(null==o)return t.syntaxError(i,`Error : bad value '${i}' found for '${r}' (mapparser.parse_any)`),null;let a=new er(t,e.key);o.key=a,null!=n[r]&&t.syntaxError(i,`Error : more than one value provided in the map for the key '${r}'`),n[r]=o})),new cr(t,e,n)}}class yr extends ur{constructor(t,e,n){if(super(t,"list",e),!n instanceof Array)throw t.syntaxError(e,"Erorr : ListNode must be initialized with an array. This should not happen.");this.value=n,this.childs=this.value}static checkCurrent(t){return G(t)}}class vr{static parse(t,e,n){if(!yr.checkCurrent(n))return t.syntaxError(n,"Error : a list is expected "),null;if(!dr.sizeCheckers(t,e,n))return null;let r=e._list,i=e._listOf,o=e._listFacultative;if(null!=r&&!(r instanceof Array)||null!=o&&!(o instanceof Array))return t.grammarError("Error : error in list value definition"),null;let a=0,s=n.items.length,u=[];r&&r.forEach((e=>{if(!(a{if(a{let r=gr.parse_any(t,e);if(null==r)return t.SyntaxError(value,`Error : bad value '${value}' found for '${key}' (listparser.parse_any)`),null;n.push(r)})),new yr(t,e,n)}}class gr{static parse(t,e,n){switch(e){case"string":return er.parse(t,n);case"binary":return nr.parse(t,n);case"timestamp":return sr.parse(t,n);case"int":return rr.parse(t,n);case"float":return ir.parse(t,n);case"boolean":return or.parse(t,n);case"null":return ar.parse(t,n);case"any":return gr.parse_any(t,n);default:return kr(t,e,n)}}static parse_any(t,e){if(H(e)){switch(typeof e.value){case"number":return rr.checkCurrent(e)?rr.parse(t,e):ir.parse(t,e);case"boolean":return or.parse(t,e);case"string":return er.parse(t,e);case"object":if(null==e.value)return ar.parse(t,e);t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`);default:t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`)}return null}return Y(e)?mr.parse_any(t,e):G(e)?vr.parse_any(t,e):null}}class br{static parse(t,e,n){"object"==typeof e&&e._in||t.grammarError("Error: can not parse _in rule'");let r=e._in;if(!(r instanceof Array))return t.grammarError("Error: _in rules expects a sequence of alternatives"),null;for(let e of r)if(!hr(e))return t.grammarError("Error: _in rules expects each alternative to be a scalar"),null;if(!H(n))return t.syntaxError(n,"Syntax Error : scalar value expected by rule '_in'"),null;let i=gr.parse_any(t,n);if(i){let e=[].concat(t.errors),n=[].concat(t.warnings),o=t.errors.length,a=i.value;for(let s of r)if(s){let r=s==a?i:null;if(null!=r)return t.errors=e,t.warnings=n,r;o=t.errors.length}}return t.syntaxError(n,"Syntax Error : no valid alternative for '_in' rule found during parsing"),null}}class _r{static parse(t,e,n){if(!er.checkCurrent(n))return t.syntaxError(n,`Error: regular expressions match only strings, '${n?n.value:""}' is not a string`),null;let r=e._regex;if(null==r)return t.grammarError("Error : regep rule must have a value for key '_regex'"),null;let i=null;try{i=new RegExp(r)}catch(t){}return null==i?(t.grammarError(`Error: value '${i}' is not a valid regular expression`),null):i.test(n.value)?new er(t,n):(t.syntaxError(n,`Error: value '${n.value}' does not match the regular expression '${i}'`),null)}}class wr{static scalartypes=["string","int","float","null","boolean","binary","timestamp"];static keywords=["_map","_mapOf","_mapFacultative","_list","_listOf","_listFacultative","_oneOf","_regex","_nb","_min","_max","_in"];static parse(t,e,n,r){if(null==r)return t.fileError("No source to parse"),null;if(wr.scalartypes.includes(e)||wr.keywords.includes(e))return t.syntaxError(r,`'${e}' is not allowed as rule_name in Lidy Grammar (reserved keyword)`),null;let i="enter_"+e;r.ctx=t,t.listener&&t.listener[i]&&t.listener[i](r);let o=xr(t,null,n,r),a="exit_"+e;return"node_template"==e&&console.log("Sortie de node_template"),t.listener&&t.listener[a]&&t.listener[a](o),o}}function xr(t,e,n,r){if(e)return wr.parse(t,e,n,r);if(hr(n))return gr.parse(t,n,r);if("object"==typeof n){if(n._map||n._mapOf||n._mapFacultative||n._merge)return mr.parse(t,n,r);if(n._list||n._listOf||n._listFacultative)return vr.parse(t,n,r);if(n._oneOf)return lr.parse(t,n,r);if(n._regex)return _r.parse(t,n,r);if(n._in)return br.parse(t,n,r)}return t.grammarError("Error : grammar error : no valid keyword found"),null}function kr(t,e,n){let r=t.rules[e];return void 0!==r?xr(t,e,r,n):(t.grammarError(`no rule named ${e} found.`),null)}function Er(t){t.keyword||(t.keyword="main");let e=new Qn;return e.prog=t.prog,t.rules?e.rules=t.rules:function(t,e,n){try{t.rules=function(t,e,n){let r;const i=Jn(t,n);if(!i)return null;if(i.warnings.forEach((t=>qt(i.options.logLevel,t))),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}(e)}catch(e){throw t.errors.push(e),t.grammarError("ERROR : can not parse dsl ")}if("object"==(t.rules,!1))throw t.grammarError("ERROR : can not parse dsl ");if(!t.rules[n])throw Error("ERROR : no rule labeled '"+n+"' in the grammar")}(e,t.dsl_data,t.keyword),e.listener=t.listener,function(t,e){t.lineCounter=new Un;let n=Jn(e,{lineCounter:t.lineCounter});n||t.fileError("can not parse the provided source code."),t.src=n.contents,t.txt=e,t.errors=n.errors,t.warnings=n.warnings,t.yaml_ok=0==t.errors.length&&0==t.warnings.length}(e,t.src_data),function(t,e,n){let r=kr(t,e,n);return t.errors.filter((t=>t instanceof Xn)).forEach((e=>e.pretty(t))),t.warnings.filter((t=>t instanceof Xn)).forEach((e=>e.pretty(t))),t.contents=r,t}(e,t.keyword,e.src)}var Or={main:"workflow",workflow:{_mapFacultative:{name:"WorkflowName",on:{_mapFacultative:{push:"PushTrigger",pull_request:"PullRequestTrigger"}},jobs:{_mapOf:{JobId:"Job"}}}},WorkflowName:"string",PushTrigger:{_map:{branches:"PushTriggerBranches"}},PushTriggerBranches:{_listOf:"string"},PullRequestTrigger:{_map:{types:"PullRequestTriggerTypes"}},PullRequestTriggerTypes:{_listOf:"string"},Job:{_mapFacultative:{name:"JobName","runs-on":"JobRunsOn",needs:"JobNeeds",steps:{_listOf:"Step"}}},JobId:"string",JobName:"string",JobRunsOn:"string",JobNeeds:{_listOf:"string"},Step:{_oneOf:["CommandStep","ReusableStep"]},ReusableStep:{_map:{uses:"StepUses"},_mapFacultative:{name:"StepName",with:"StepWith",env:"StepEnv"}},CommandStep:{_map:{run:"StepRun"},_mapFacultative:{name:"StepName",env:"StepEnv"}},StepUses:"string",StepName:"string",StepRun:"string",StepWith:{_mapOf:{StepMapKey:"StepMapValue"}},StepEnv:{_mapOf:{StepMapKey:"StepMapValue"}},StepMapKey:"string",StepMapValue:{_oneOf:["int","float","string"]}};function Sr(t){return Sr="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},Sr(t)}function Tr(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.pluginData.components=[],this.pluginData.parseErrors=[],n.filter((function(e){var n=e.path;return t.path===n})).filter((function(t){var n=t.path,i=t.content;return!(!i||""===i.trim())||(e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"warning",files:[n],data:{code:"no_content",global:!1}}),!1)})).forEach((function(t,n){var i=e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[t.path],data:{global:!1}}),o=new I(t,e.pluginData.definitions.components,"workflow_".concat(n+1));!function(t){t.rules=Or,Er(t)}({src_data:t.content,listener:o,path:t.path,prog:{errors:[],warnings:[],imports:[],alreadyImported:[],root:[]}}),o.components.forEach((function(t){return e.pluginData.components.push(t)})),e.pluginData.emitEvent({id:i,status:"success"})}))}}],r&&Tr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(t.DefaultParser);var Pr=n(326),Rr=n.n(Pr);const Ir={root:"name: {{ workflowName.value }}\n\n{% if triggers.length > 0 %}\non:\n{% for trigger in triggers %}\n{% if trigger.definition.action === 'push' %}{% set branches = getTriggerAttribute(trigger, 'branches').value %}\n push:\n branches: [{% if branches.length > 0 %}{{ branches.join(', ') }}{% endif %}]\n{% else %}{% set types = getTriggerAttribute(trigger, 'types').value %}\n pull_request:\n types: [{% if types.length > 0 %}{{ types.join(', ') }}{% endif %}]\n{% endif %}\n{% endfor %}\n{% endif %}\n\njobs:\n{% for job in jobs %}\n {{ job.id }}:\n{% for attribute in getAttributes(job) %}\n {% if attribute.type === 'Array' %}\n {{attribute.name}}: [{{ attribute.value.join(', ')}}]\n {% else %}\n {{attribute.name}}: {{attribute.value }}\n {% endif %}\n{% endfor %}\n{% if getSteps(job.id).length > 0 %}\n steps:\n{% for step in getSteps(job.id) %}\n{% for attribute in getAttributes(step) %}\n{% if attribute.type === 'Array' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: [{{ attribute.value.join(', ')}}]\n{% elif attribute.type === 'Object' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}:\n{% for value in attribute.value %}\n{{value.name | indent(10,true)}}: {% if value.type == 'Number' and value.value == null %}0{% else %}{{ value.value }}{% endif %}\n\n{% endfor %}\n{% else %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: {{ attribute.value }}\n{% endif %}\n{% endfor %}\n{% endfor %}\n\n{% endif %}\n{% endfor %}"};function Dr(t){return Dr="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},Dr(t)}function Br(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,i=[];return e.forEach((function(e,o){var a=n.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[o],data:{global:!1}}),s=e.find((function(t){return"workflow"===t.definition.category})),u=e.filter((function(t){return"trigger"===t.definition.category})),c=e.filter((function(t){return"step"===t.definition.category})),l="".concat(n.template.render({workflow:s,workflowName:null==s?void 0:s.attributes.find((function(t){return"name"===t.name})),triggers:u,jobs:e.filter((function(t){return"job"===t.definition.category})),getAttributes:function(t){return t.attributes.filter((function(t){var e=t.name;return"workflow_id"!==e&&"job_id"!==e}))},getTriggerAttribute:function(t,e){return t.attributes.find((function(t){return t.name===e}))},getSteps:function(t){return c.filter((function(e){return e.attributes.some((function(e){var n=e.name,r=e.value;return"job_id"===n&&r===t}))}))}}).trim(),"\n");i.push(new t.FileInput({path:o,content:l})),n.pluginData.emitEvent({id:a,status:"success"})})),i}}],i&&Br(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(t.DefaultRender);const Vr=qr,Yr=JSON.parse('{"UU":"@ditrit/githubator-plugin","rE":"0.5.2"}'),Wr={name:"githubAction",languageSettings:{id:"githubAction",extensions:[".yml",".yaml"],aliases:["githubaction","Githubaction","githubAction","GithubAction"],mimetypes:["string"]},languageConfiguration:{comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],colorizedBracketPairs:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"'",close:"'",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{offSide:!0}},tokenProvider:{tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?\d+)/,numberFloat:/(?:0|[+-]?\d+)(?:\.\d+)?(?:e[-+][1-9]\d*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,{[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|]\d*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]}])/,"number"],[/@numberFloat(?=[ \t]*[,\]}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]}])/,"number.date"]],tagHandle:[[/![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}}};function Hr(t){return Hr="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},Hr(t)}function Gr(t,e,n){return e=Xr(e),function(t,e){if(e&&("object"==Hr(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,Jr()?Reflect.construct(e,n||[],Xr(t).constructor):e.apply(t,n))}function Jr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jr=function(){return!!t})()}function Xr(t){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xr(t)}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}const Zr=function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),Gr(this,n,[{editor:{syntax:Wr},tags:[new t.Tag({type:"language",value:"Github"}),new t.Tag({type:"category",value:"CI"}),new t.Tag({type:"category",value:"CD"})],restrictiveFolder:".github/workflows/",isFolderTypeDiagram:!1,defaultFileName:"new_workflow.yml",defaultFileExtension:"yml",extraResources:[{type:"markers",name:"startLinkMarker"},{type:"markers",name:"endLinkMarker"},{type:"links",name:"defaultLink"},{type:"links",name:"temporaryLink"},{type:"icons",name:"error"},{type:"icons",name:"menu"},{type:"icons",name:"resize"}],container:{margin:15,gap:50},i18n:{"en-US":{displayName:"GitHub Action"}}}])}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&&Qr(t,e)}(n,e),r=n,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(t.DefaultConfiguration);function ti(t){return ti="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},ti(t)}function ei(t,e,n){return e=ri(e),function(t,e){if(e&&("object"==ti(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,ni()?Reflect.construct(e,n||[],ri(t).constructor):e.apply(t,n))}function ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ni=function(){return!!t})()}function ri(t){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ri(t)}function ii(t,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ii(t,e)}const oi=function(e){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{event:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var r=new Zr,i=new t.DefaultData(r,{name:Yr.UU,version:Yr.rE},e.event);return ei(this,n,[{configuration:r,pluginData:i,pluginMetadata:new C(i),pluginParser:new jr(i),pluginRenderer:new Vr(i)}])}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&&ii(t,e)}(n,e),r=n,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(t.DefaultPlugin)})();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 8a37791..9f63e4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ditrit/githubator-plugin", - "version": "0.5.1", + "version": "0.5.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ditrit/githubator-plugin", - "version": "0.5.1", + "version": "0.5.2", "license": "MPL-2.0", "dependencies": { "lidy-js": "github:ditrit/lidy-js#1.0.1", diff --git a/package.json b/package.json index 5eea67b..b04b112 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ditrit/githubator-plugin", - "version": "0.5.1", + "version": "0.5.2", "description": "Github action plugin for Leto modelizer.", "main": "dist/githubator-plugin.js", "exports": {